#notepad { min-width: 0; }
.np-tabs-row, .np-editor-top, .np-bar, .np-actions, .np-options, .np-preference {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.np-tabs-row, .np-editor-top, .np-bar { justify-content: space-between; }
#np-tabs { gap: 2px; }
#np-tabs:empty { display: none; }
#np-tabs button { max-width: min(12rem, 66vw); min-width: 0; }
#np-tabs bdi { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-editor-top { margin-top: 8px; }
.np-editor-top label { font-size: .875rem; font-weight: 600; }
#np-text {
  display: block;
  margin: 0;
  min-height: 184px;
  height: clamp(184px, 31vh, 290px);
  padding: 14px;
  font: 400 1rem/1.55 var(--font-prose);
  resize: vertical;
}
#np-text[data-size='m'] { font-size: 1.125rem; }
#np-text[data-size='l'] { font-size: 1.375rem; }
#np-text[data-monospace='true'] { font-family: var(--font-ui); }
#np-text[data-wrap='false'] { white-space: pre; overflow-wrap: normal; }
#np-parts { margin-top: 4px; }
#np-parts .zt-link:disabled { opacity: .56; }
#notepad.np-over #np-text { border-color: var(--go); background: var(--go-tint); }
#np-counts { margin: 8px 0 12px; }
.np-result { margin-block: 8px; padding: 0; border: 0; }
.np-result .zt-hint { margin-block: 4px; }
.np-result .zt-explain:empty { display: none; }
.np-result .zt-next { column-gap: 12px; }
.np-result .zt-next a { min-height: 44px; }
.np-bar { padding: 10px 12px; border: 1px solid var(--ws-line-strong); border-radius: var(--r-sm); }
.np-actions .zt-link:disabled { opacity: .56; text-decoration: none; }
.np-options, .np-preference { align-items: end; margin-top: 12px; }
.np-preference { border-top: 1px solid var(--ws-line); padding-top: 6px; align-items: center; }
.np-preference p { margin: 0; }
.np-option { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; font-size: .875rem; }
.np-option input { margin: 0; }
.np-error, #np-save-status.np-error { color: var(--err); }
#np-undo-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  margin: 0 0 8px;
  border: 1px solid var(--ws-line-strong);
  border-radius: var(--r-sm);
  background: var(--ws-2);
  font-size: .875rem;
}
#np-rename-dialog { width: min(26rem, calc(100% - 32px)); padding: 20px; background: var(--ws); color: var(--ws-ink); border-radius: var(--r-md); }
#np-rename-dialog::backdrop { background: #0009; }
#np-rename-dialog h2 { margin: 0 0 12px; }
#np-rename-dialog .np-actions { margin-top: 14px; }
#notepad:fullscreen, #notepad.zt-full-window { background: var(--ws); color: var(--ws-ink); padding: 16px; overflow: auto; }
#notepad:fullscreen #np-text, #notepad.zt-full-window #np-text { height: max(184px, calc(100dvh - 300px)); }
@media (min-width: 801px) {
  #np-text { min-height: 55vh; }
}
@media (max-width: 560px) {
  #np-text { min-height: 148px; height: clamp(148px, 22vh, 184px); }
  .np-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 8px;
  }
  .np-result #np-counts { grid-area: 1 / 1; margin: 0; }
  .np-result #np-download { grid-area: 1 / 2; width: auto; }
  .np-result p { grid-column: 1 / -1; }
  .np-actions { column-gap: 8px; }
  .np-editor-top { gap: 0 8px; }
}
@media print {
  body { background: white; color: black; }
  body > :not(main), .zt-tool-page > :not(#tool), #tool > :not(#notepad), #notepad > :not(#np-print-text) { display: none !important; }
  main.zt-container, .zt-tool-page, #tool, #notepad, #notepad.zt-full-window {
    display: block;
    position: static;
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: white;
    color: black;
    overflow: visible;
  }
  #np-print-text[hidden] { display: block !important; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
}
