/* ============================================================
   Taccuino v2 - styles
   Base rules first; all media queries live at the END of the file
   so the cascade is explicit (overrides always come after base).
   ============================================================ */

:root {
  --sidebar-bg: #17251c;
  --sidebar-bg2: #1d2f24;
  --sidebar-text: #cfd8d1;
  --sidebar-muted: #7e8f85;
  --accent: #1f9d55;
  --accent-strong: #17803f;
  --accent-soft: rgba(31, 157, 85, 0.12);
  --bg-list: #f4f6f4;
  --bg-reader: #ffffff;
  --bg-hover: #eaeeea;
  --bg-active: #e0ebe2;
  --text: #1c211e;
  --text-muted: #6b7570;
  --border: #e2e6e2;
  --chip-bg: #edf1ed;
  --shadow: 0 8px 30px rgba(10, 20, 14, 0.12);
  --danger: #c4453a;
  --warn-bg: #fff6e0;
}
html[data-theme="dark"] {
  --sidebar-bg: #101a14;
  --sidebar-bg2: #16211a;
  --sidebar-text: #c3cdc6;
  --sidebar-muted: #6d7d73;
  --accent: #37c273;
  --accent-strong: #2ba55f;
  --accent-soft: rgba(55, 194, 115, 0.14);
  --bg-list: #171b19;
  --bg-reader: #1d2220;
  --bg-hover: #212724;
  --bg-active: #24312a;
  --text: #e6eae7;
  --text-muted: #93a099;
  --border: #2a312d;
  --chip-bg: #262d29;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --danger: #e06a60;
  --warn-bg: #35301f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg-reader);
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
kbd {
  background: var(--chip-bg); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: inherit;
}

#app {
  display: grid;
  grid-template-columns: 250px 350px 1fr;
  /* Cap the single row to the viewport (minmax 0 lets it shrink) so the panes
     get a bounded height and their inner areas scroll, instead of the whole
     grid growing to content height and being clipped by body{overflow:hidden}. */
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
}
/* Grid/flex scroll containers must be allowed to shrink below content size,
   otherwise min-height:auto keeps them full-content-height and nothing scrolls. */
#sidebar, #listPane, #readerPane, #noteView, #noteList, #sideNav, .note-scroll { min-height: 0; }

/* ============================ sidebar ============================ */
#sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  padding: 14px 12px 10px;
  gap: 12px;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand-logo, .empty-logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(145deg, #27b866, #157a42);
  position: relative;
}
.brand-logo::after, .empty-logo::after {
  content: ""; position: absolute; left: 7px; top: 8px; width: 16px; height: 3px;
  border-radius: 2px; background: #fff;
  box-shadow: 0 6px 0 rgba(255,255,255,.72), 0 12px 0 rgba(255,255,255,.42);
}
.brand-name { font-weight: 650; font-size: 17px; letter-spacing: .2px; color: #fff; }
.sidebar-close { margin-left: auto; display: none; }

.primary-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600;
  border-radius: 10px; padding: 10px 12px; transition: background .15s;
}
.primary-btn:hover { background: var(--accent-strong); }
.btn-ic { display: inline-flex; width: 16px; height: 16px; }

#sideNav { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
  color: var(--sidebar-text); font-size: 13.8px;
  user-select: none;
}
.nav-item:hover { background: var(--sidebar-bg2); }
.nav-item.active { background: var(--accent-soft); color: #fff; }
.nav-item.active .nav-count { color: var(--accent); }
.nav-ic { width: 16px; height: 16px; flex: none; display: inline-flex; opacity: .8; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11.5px; color: var(--sidebar-muted); font-variant-numeric: tabular-nums; }
.nav-badge { font-size: 10px; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 1px 4px; margin-left: 4px; }
.nav-x {
  display: none; width: 18px; height: 18px; border-radius: 5px; line-height: 18px; text-align: center;
  color: var(--sidebar-muted); font-size: 15px; flex: none;
}
.nav-item:hover .nav-x { display: inline-block; }
.nav-x:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-group { margin-top: 10px; }
.nav-group-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--sidebar-muted); padding: 4px 8px 6px; font-weight: 600;
}
.ghost-btn { color: var(--sidebar-muted); border-radius: 8px; padding: 6px 8px; text-align: left; }
.ghost-btn:hover { background: var(--sidebar-bg2); color: var(--sidebar-text); }
.ghost-btn.small { font-size: 12px; }

.side-footer { border-top: 1px solid rgba(255,255,255,.07); padding-top: 8px; }
.side-tools { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: inherit; opacity: .85;
}
.icon-btn:hover { background: var(--sidebar-bg2); opacity: 1; }
.icon-btn svg { width: 17px; height: 17px; }
.side-stats { font-size: 11px; color: var(--sidebar-muted); padding: 6px 6px 0; line-height: 1.5; }

/* ============================ note list ============================ */
#listPane {
  background: var(--bg-list);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-width: 0;
}
.list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 8px;
}
.list-head .icon-btn:hover, #readerPane .icon-btn:hover { background: var(--bg-hover); }
.burger { display: none; flex: none; }
.search-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.search-ic { position: absolute; left: 10px; width: 15px; height: 15px; display: inline-flex; color: var(--text-muted); pointer-events: none; }
#searchInput {
  width: 100%; padding: 8px 10px 8px 32px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-reader); color: var(--text); outline: none;
}
#searchInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.index-pill {
  position: absolute; right: 8px; font-size: 10px; color: var(--text-muted);
  background: var(--chip-bg); padding: 2px 6px; border-radius: 99px;
}
#sortSel {
  border: 1px solid var(--border); background: var(--bg-reader);
  border-radius: 9px; padding: 7px 6px; color: var(--text-muted); outline: none;
}
.list-context {
  padding: 2px 16px 8px; font-size: 12.5px; color: var(--text-muted);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.list-context b { color: var(--text); font-size: 14px; }
.list-context .ctx-link { color: var(--accent); cursor: pointer; }
.list-context .ctx-link:hover { text-decoration: underline; }

#noteList { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 20px; outline: none; }
.note-item {
  display: flex; gap: 10px; align-items: stretch;
  padding: 10px 10px; margin: 2px 0;
  border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
}
.note-item:hover { background: var(--bg-hover); }
.note-item.active { background: var(--bg-active); border-color: var(--accent-soft); }
.ni-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ni-title {
  font-weight: 600; font-size: 13.8px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ni-snippet {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.ni-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ni-date { font-variant-numeric: tabular-nums; flex: none; }
.ni-tag { background: var(--chip-bg); border-radius: 4px; padding: 1px 5px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ni-badge { display: inline-flex; align-items: center; gap: 3px; }
.ni-badge svg { width: 11px; height: 11px; }
.ni-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.ni-thumb {
  width: 58px; height: 58px; object-fit: cover; border-radius: 8px; flex: none;
  border: 1px solid var(--border); background: var(--bg-reader); align-self: center;
}
.list-msg { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.list-sentinel { height: 1px; }

/* ============================ reader ============================ */
#readerPane { background: var(--bg-reader); min-width: 0; display: flex; flex-direction: column; position: relative; }
#emptyState {
  margin: auto; text-align: center; color: var(--text-muted); padding: 30px;
}
.empty-logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 18px; opacity: .9; }
.empty-logo::after { left: 15px; top: 17px; width: 34px; height: 6px; border-radius: 4px; box-shadow: 0 13px 0 rgba(255,255,255,.72), 0 26px 0 rgba(255,255,255,.42); }
#emptyState h2 { color: var(--text); margin: 0 0 6px; font-size: 21px; }
#emptyState p { margin: 4px 0; }
.empty-hint { font-size: 13px; line-height: 1.8; }

#noteView { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.note-head { display: flex; gap: 12px; padding: 18px 26px 6px; align-items: flex-start; }
.back-btn { display: none; flex: none; margin-top: 3px; }
.note-head-main { flex: 1; min-width: 0; }
#noteTitle { font-size: 23px; margin: 0 0 4px; line-height: 1.25; word-break: break-word; }
#noteTitleInput {
  width: 100%; font-size: 23px; font-weight: 650; line-height: 1.25;
  border: none; border-bottom: 2px solid var(--accent); background: none; outline: none;
  padding: 0 0 3px; margin: 0 0 4px; color: var(--text);
}
.note-meta { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.note-meta a { color: var(--accent); text-decoration: none; }
.note-meta a:hover { text-decoration: underline; }
.meta-badge { background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.note-actions { display: flex; gap: 4px; flex: none; align-items: center; }
.note-actions .icon-btn.danger:hover { color: var(--danger); }
.note-actions .save-btn { background: var(--accent); color: #fff; width: auto; padding: 0 14px; font-weight: 600; gap: 6px; }
.note-actions .save-btn:hover { background: var(--accent-strong); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 26px 2px; align-items: center; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--chip-bg); border-radius: 99px; padding: 3px 10px;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
}
.tag-chip:hover { color: var(--accent); }
.tag-chip .tag-x { cursor: pointer; opacity: .6; font-size: 13px; line-height: 1; }
.tag-chip .tag-x:hover { opacity: 1; color: var(--danger); }
.tag-add-input {
  border: 1px dashed var(--border); background: none; border-radius: 99px;
  padding: 3px 10px; font-size: 12px; width: 110px; outline: none; color: var(--text);
}
.tag-add-input:focus { border-color: var(--accent); }

#editorToolbar {
  display: flex; gap: 2px; align-items: center; flex-wrap: wrap;
  margin: 8px 26px 0; padding: 5px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-list);
  position: sticky; top: 0; z-index: 3;
}
#editorToolbar button {
  min-width: 30px; height: 28px; border-radius: 7px; padding: 0 7px;
  color: var(--text-muted); font-size: 13px;
}
#editorToolbar button:hover { background: var(--bg-hover); color: var(--text); }
.tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

.note-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 26px 40px; position: relative; }

/* privacy gate for the Passwords notebook */
#blurGate { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-start; justify-content: center; padding-top: 90px; }
#revealBtn {
  background: var(--bg-reader); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 12px; padding: 12px 20px; font-weight: 600; color: var(--text);
}
#revealBtn:hover { border-color: var(--accent); color: var(--accent); }
.nx-content.blurred { filter: blur(14px); pointer-events: none; user-select: none; }

/* ---------- note content (built HTML from ENML) ---------- */
.nx-content { line-height: 1.55; word-wrap: break-word; overflow-wrap: break-word; min-height: 120px; }
.nx-content:focus { outline: none; }
.nx-content[contenteditable="true"] {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  background: var(--bg-reader); min-height: 260px;
}
.nx-content[contenteditable="true"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nx-content img, .nx-content video { max-width: 100%; height: auto; border-radius: 6px; }
.nx-content a { color: var(--accent); }
.nx-content table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.nx-content td, .nx-content th { border: 1px solid var(--border); padding: 4px 8px; }
.nx-content pre { background: var(--chip-bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.nx-content blockquote { border-left: 3px solid var(--accent); margin: 8px 0; padding: 2px 14px; color: var(--text-muted); }
.nx-content hr { border: none; border-top: 1px solid var(--border); }
.nx-todo { accent-color: var(--accent); width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; }
.nx-crypt {
  background: var(--warn-bg); border-radius: 6px; padding: 2px 8px; font-size: 12.5px;
}
.nx-att {
  display: inline-flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 14px; margin: 4px 6px 4px 0;
  text-decoration: none; color: var(--text); background: var(--bg-list);
  max-width: 100%;
}
.nx-att:hover { border-color: var(--accent); }
.nx-att-name { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.nx-att-meta { font-size: 11px; color: var(--text-muted); }
.nx-att-missing {
  display: inline-block; border: 1px dashed var(--border); border-radius: 8px;
  color: var(--text-muted); font-size: 11.5px; padding: 3px 10px; margin: 2px 4px 2px 0;
}
.nx-orphans { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--border); }
.nx-audio { max-width: 100%; }

#attRow { padding-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
#attRow:empty { display: none; }
#attRow .att-head { width: 100%; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }

/* ============================ misc ============================ */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--sidebar-bg); color: #fff; border-radius: 10px;
  padding: 10px 18px; font-size: 13.5px; box-shadow: var(--shadow); z-index: 60;
  max-width: 80vw;
}
#sidebarScrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 19;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); }
::-webkit-scrollbar-track { background: transparent; }


/* ============================ v2 additions (base rules) ============================ */
.nav-mini {
  float: right; width: 20px; height: 20px; border-radius: 6px; line-height: 18px; text-align: center;
  color: var(--sidebar-muted); font-size: 15px; margin-top: -3px;
}
.nav-mini:hover { background: var(--sidebar-bg2); color: #fff; }
.nav-x {
  display: none; width: 18px; height: 18px; border-radius: 5px; line-height: 18px; text-align: center;
  color: var(--sidebar-muted); font-size: 15px; flex: none;
}
.nav-item:hover .nav-x { display: inline-block; }
.nav-x:hover { background: rgba(255,255,255,.08); color: #fff; }
a.icon-btn { text-decoration: none; }

/* sign in */
#authScreen {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: var(--sidebar-bg); padding: 20px;
}
.auth-card {
  width: 100%; max-width: 360px; background: var(--bg-reader); color: var(--text);
  border-radius: 18px; padding: 28px 26px 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.auth-logo { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 4px; background: linear-gradient(145deg, #27b866, #157a42); position: relative; }
.auth-logo::after { content: ""; position: absolute; left: 12px; top: 14px; width: 28px; height: 5px; border-radius: 3px; background: #fff; box-shadow: 0 10px 0 rgba(255,255,255,.72), 0 20px 0 rgba(255,255,255,.42); }
.auth-card h1 { margin: 0; text-align: center; font-size: 22px; }
.auth-hint { margin: 0; text-align: center; color: var(--text-muted); font-size: 13px; }
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-muted); }
.auth-card input {
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-list);
  color: var(--text); font-size: 16px; outline: none;
}
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-error { color: var(--danger); font-size: 13px; }
.auth-card .primary-btn { margin-top: 6px; padding: 12px; }

/* floating action button (mobile) */
.fab {
  display: none; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff;
  box-shadow: 0 8px 24px rgba(10, 60, 30, .35); z-index: 8; align-items: center; justify-content: center;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { background: var(--accent-strong); }

/* settings sheet */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: var(--bg-reader); color: var(--text);
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow); padding-bottom: env(safe-area-inset-bottom);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 0; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-body { padding: 6px 18px 22px; }
.sheet-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 18px 0 6px; }
.sheet-body p { margin: 6px 0; line-height: 1.5; }
.muted { color: var(--text-muted); font-size: 13px; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 130px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-list); color: var(--text); font-size: 15px; outline: none; }
.inline-form input:focus { border-color: var(--accent); }
.primary-btn.small { padding: 8px 14px; }
.ghost-btn.danger-text { color: var(--danger); margin-top: 18px; padding: 8px 0; }
.ghost-btn.danger-text:hover { background: none; text-decoration: underline; }

/* save state */
.save-state { font-size: 11.5px; color: var(--text-muted); }
.save-state.dirty { color: var(--accent); }
#readerPane .icon-btn { width: 36px; height: 36px; }
#readerPane .icon-btn svg { width: 18px; height: 18px; }
#sidebar .icon-btn:hover { background: var(--sidebar-bg2); }
.note-actions .done-btn { background: var(--accent); color: #fff; width: auto; padding: 0 14px; font-weight: 600; gap: 6px; }
.note-actions .done-btn:hover { background: var(--accent-strong); }
.nx-content[contenteditable="true"] img { cursor: default; }
.upload-pill { display: inline-block; font-size: 12px; color: var(--text-muted); padding: 2px 8px; background: var(--chip-bg); border-radius: 99px; }

/* ============================================================
   media queries - keep AFTER all base rules (cascade order)
   ============================================================ */
@media (max-width: 1150px) {
  #app { grid-template-columns: 350px 1fr; }
  #sidebar {
    position: fixed; z-index: 20; left: 0; top: 0; bottom: 0; width: 268px;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  body.sidebar-open #sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .burger { display: inline-flex; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; }
  #listPane { border-right: none; }
  #readerPane { display: none; }
  body.note-open #readerPane {
    display: flex; position: fixed; inset: 0; z-index: 10;
  }
  body.note-open #listPane { visibility: hidden; }
  .back-btn { display: inline-flex; }
  .note-head { padding: 14px 16px 6px; }
  .tag-row, .note-scroll { padding-left: 16px; padding-right: 16px; }
  #editorToolbar { margin: 8px 16px 0; }
  .ni-thumb { width: 48px; height: 48px; }
}
@media (max-width: 760px) {
  .fab { display: flex; }
  body.note-open .fab { display: none; }
  #noteList { padding-bottom: 96px; }
  .list-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .note-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .note-scroll { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .note-item { padding: 12px 10px; }
  .ni-title { font-size: 15px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  /* Some imported notes have no real title, so the first paragraph became the
     title. Clamp it in the reader header so it can't swallow the whole screen;
     the full text is still there when you tap Edit (it becomes an input). */
  #noteTitle { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  #searchInput { font-size: 16px; }
  #editorToolbar button { min-width: 36px; height: 34px; font-size: 15px; }
  .tag-chip { padding: 6px 12px; font-size: 13px; }
  .nav-item { padding: 10px 8px; font-size: 15px; }
  .nav-x { display: inline-block; }
}
@media print {
  #sidebar, #listPane, .note-actions, #editorToolbar, .back-btn, #toast, #blurGate { display: none !important; }
  #app { display: block; height: auto; }
  #readerPane { display: block !important; }
  body { overflow: visible; }
  .note-scroll { overflow: visible; padding: 0; }
  #noteView { height: auto; }
}
