/* ============================================================
   Sticky — styles
   ============================================================ */
:root {
  --font-scale: 1;
  --accent: #f4b942;
  --accent-2: #f59e42;

  --topbar-h: 58px;
  --radius: 16px;

  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hand-font: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Chalkboard SE", cursive;

  --board-bg: #ece5d8;
  --board-dot: rgba(120, 100, 70, 0.14);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --text: #26221b;
  --text-soft: #6b6353;
  --line: rgba(0, 0, 0, 0.10);
  --shadow-note: 0 2px 3px rgba(0,0,0,.10), 0 10px 22px rgba(0,0,0,.14);
  --shadow-lift: 0 8px 12px rgba(0,0,0,.14), 0 22px 44px rgba(0,0,0,.22);
}

:root[data-theme="dark"] {
  --board-bg: #191c22;
  --board-dot: rgba(255, 255, 255, 0.05);
  --panel: rgba(30, 34, 42, 0.86);
  --panel-solid: #232833;
  --text: #e9edf3;
  --text-soft: #9aa4b2;
  --line: rgba(255, 255, 255, 0.10);
  --shadow-note: 0 2px 4px rgba(0,0,0,.30), 0 12px 26px rgba(0,0,0,.42);
  --shadow-lift: 0 10px 16px rgba(0,0,0,.4), 0 26px 50px rgba(0,0,0,.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--ui-font);
  color: var(--text);
  background: var(--board-bg);
  overflow: hidden;
  overscroll-behavior: none;
}

/* ============================ TOP BAR ============================ */
#topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 100;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-mark { font-size: 22px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.brand-name { color: var(--text); }

.boards { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 34vw; }
.boards::-webkit-scrollbar { display: none; }
.board-tab {
  border: 1px solid var(--line); background: transparent; color: var(--text-soft);
  padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: .15s;
}
.board-tab:hover { color: var(--text); background: rgba(0,0,0,.04); }
.board-tab.active { background: var(--accent); color: #3a2c00; border-color: transparent; box-shadow: 0 2px 8px rgba(244,185,66,.4); }
:root[data-theme="dark"] .board-tab.active { color: #241a00; }

.spacer { flex: 1 1 auto; }

.search { position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 11px; font-size: 13px; opacity: .6; pointer-events: none; }
#search {
  width: 190px; max-width: 40vw; height: 38px; padding: 0 12px 0 32px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.5);
  color: var(--text); font-size: 15px; outline: none; transition: .15s;
}
:root[data-theme="dark"] #search { background: rgba(255,255,255,.06); }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244,185,66,.25); background: var(--panel-solid); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg-btn { border: 0; background: transparent; color: var(--text); padding: 8px 11px; font-size: 14px; font-weight: 700; cursor: pointer; }
.seg-btn:hover { background: rgba(0,0,0,.06); }
.seg-btn:first-child { border-right: 1px solid var(--line); }

.icon-btn, .chip {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: 999px;
  font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.icon-btn:hover, .chip:hover { background: rgba(0,0,0,.06); }
.chip { font-size: 14px; font-weight: 600; gap: 4px; }
.chip.ghost { color: var(--text-soft); }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 46px; width: 230px; z-index: 200;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lift); padding: 6px; display: flex; flex-direction: column;
}
.menu button {
  text-align: left; border: 0; background: transparent; color: var(--text);
  padding: 11px 12px; border-radius: 9px; font-size: 15px; cursor: pointer;
}
.menu button:hover { background: rgba(0,0,0,.06); }
:root[data-theme="dark"] .menu button:hover { background: rgba(255,255,255,.07); }
.menu button.danger { color: #d64545; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 8px; }

/* ============================ BOARD ============================ */
.board {
  position: absolute; inset: var(--topbar-h) 0 0 0;
  overflow: hidden;
  background-image: radial-gradient(var(--board-dot) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  touch-action: none;              /* we handle pan + pinch-zoom ourselves */
  overscroll-behavior: none;
}
.notes {
  position: absolute; top: 0; left: 0; min-width: 100%; min-height: 100%;
  transform-origin: 0 0; will-change: transform;
}
/* grid/stacked view uses native scrolling instead of pan+zoom */
body.grid-view .board { overflow: auto; touch-action: pan-y; background-position: 0 0 !important; }
body.grid-view .notes { position: relative; transform: none !important; }

/* strings/connections layer */
.strings { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 1; }
.strings .string-hit { stroke: transparent; stroke-width: 18; fill: none; pointer-events: stroke; cursor: pointer; }
.strings .string-shadow { stroke: rgba(0,0,0,.22); fill: none; stroke-linecap: round; }
.strings .string-line { fill: none; stroke-linecap: round; transition: stroke-width .12s; }
.strings .string-grp:hover .string-line { stroke-width: 5.5; filter: brightness(1.08); }
.string-del {
  position: absolute; transform: translate(-50%,-50%); z-index: 40;
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  background: #d64545; color: #fff; font-size: 12px; cursor: pointer; display: none;
  align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.string-del.show { display: flex; }
.link-pin { fill: var(--panel-solid); stroke: rgba(0,0,0,.3); stroke-width: 1.5; }

/* linking banner */
.link-banner {
  position: fixed; top: calc(var(--topbar-h) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 300; background: #1f2530; color: #fff; padding: 10px 16px; border-radius: 999px;
  box-shadow: var(--shadow-lift); font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 12px;
  animation: dropIn .25s ease;
}
.link-banner button { border: 0; background: rgba(255,255,255,.18); color: #fff; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; }
@keyframes dropIn { from { opacity: 0; transform: translate(-50%,-8px); } }

body.linking .note { cursor: crosshair; }
body.linking .note-body, body.linking .grip, body.linking .note-bar { pointer-events: none; }
/* zoomed-out overview: hide per-note controls so notes read clearly */
body.zoomed-out .note-bar, body.zoomed-out .move-grip, body.zoomed-out .grip { display: none !important; }
body.linking .note.link-source { outline: 3px dashed var(--accent); outline-offset: 3px; }
body.linking .note:not(.link-source):hover { outline: 3px solid #38bdf8; outline-offset: 3px; }

/* ============================ NOTE ============================ */
.note {
  position: absolute; z-index: 5;
  background:
    linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 42%),
    var(--bg);
  border-radius: 4px 4px 10px 4px;
  box-shadow: var(--shadow-note);
  transform: rotate(var(--rot, 0deg));
  display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s;
  will-change: transform;
}
.note::after { /* subtle paper edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); pointer-events: none;
}
.note:hover { box-shadow: var(--shadow-lift); }
/* float a hovered / focused note (and its toolbar) above overlapping notes */
.note:hover, .note:focus-within { z-index: 600 !important; }
.note.dragging { box-shadow: var(--shadow-lift); transform: rotate(calc(var(--rot,0deg) * .3)) scale(1.03); cursor: grabbing; transition: none; z-index: 999 !important; }
.note.resizing { transition: none; }
/* free-layout notes own their touch gestures so a finger-drag moves them
   immediately instead of the browser hijacking it as a scroll. Must be on the
   descendants too — touch-action is decided by the element the finger lands on. */
body:not(.grid-view) .note,
body:not(.grid-view) .note * { touch-action: none; }
.note.pinned { box-shadow: var(--shadow-lift); }
.note.pop { animation: pop .28s cubic-bezier(.2,1.4,.5,1); }
@keyframes pop { from { transform: rotate(var(--rot,0deg)) scale(.6); opacity: 0; } }
.note.removing { animation: rip .18s ease forwards; }
@keyframes rip { to { transform: rotate(calc(var(--rot,0deg) + 8deg)) scale(.75) translateY(20px); opacity: 0; } }
.note.dimmed { opacity: .22; filter: grayscale(.4); }

/* folded corner */
.fold {
  position: absolute; right: 0; bottom: 0; width: 22px; height: 22px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.10) 50%, rgba(0,0,0,.16));
  border-radius: 0 0 10px 0;
}
.pin-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 22px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); z-index: 6; }

/* note toolbar */
.note-bar {
  position: absolute; top: -42px; right: 6px; z-index: 8;
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--panel-solid); box-shadow: var(--shadow-note); border: 1px solid var(--line);
  opacity: 0; transform: translateY(6px) scale(.95); transition: .15s; pointer-events: none;
}
.note:hover .note-bar, .note:focus-within .note-bar { opacity: 1; transform: none; pointer-events: auto; }
body.touch .note-bar { opacity: 1; transform: none; pointer-events: auto; }
.nb {
  border: 0; background: transparent; width: 30px; height: 30px; border-radius: 50%;
  font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.nb:hover { background: rgba(0,0,0,.08); }
.nb.danger:hover { background: rgba(214,69,69,.15); }
.nb.voice { background: rgba(56,189,248,.16); }
.nb.voice:hover { background: rgba(56,189,248,.3); }
.nb.listening { background: #ef4444 !important; animation: micpulse 1.1s infinite; }
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.55); }
  60% { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
}

/* reminder ribbon */
.reminder {
  margin: 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: rgba(0,0,0,.08); border-radius: 8px; padding: 3px 4px 3px 9px;
  font-size: calc(12.5px * var(--font-scale)); font-weight: 700; color: rgba(0,0,0,.65);
}
.reminder.soon { background: rgba(56,189,248,.22); color: #0b5f86; }
.reminder.due { background: rgba(245,158,11,.28); color: #8a5a00; }
.reminder.overdue { background: rgba(214,69,69,.25); color: #a01f1f; }
.rm-x { border: 0; background: transparent; cursor: pointer; font-size: 12px; opacity: .6; padding: 2px 5px; border-radius: 6px; }
.rm-x:hover { opacity: 1; background: rgba(0,0,0,.1); }

/* body / text */
.note-body { flex: 1 1 auto; display: flex; flex-direction: column; padding: 14px 14px 10px; overflow: auto; min-height: 0; }
.note-body::-webkit-scrollbar { width: 6px; }
.note-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 6px; }

.note-title, .note-text, .check-text {
  outline: none; color: rgba(0,0,0,.82); word-break: break-word; overflow-wrap: anywhere;
}
.note-title {
  font-size: calc(17px * var(--font-scale)); font-weight: 800; line-height: 1.25; margin-bottom: 6px;
  letter-spacing: -.01em;
}
.note-text {
  font-size: calc(15px * var(--font-scale)); line-height: 1.45; white-space: pre-wrap; flex: 1;
}
[contenteditable][data-ph]:empty::before { content: attr(data-ph); color: rgba(0,0,0,.32); pointer-events: none; }
body.hand .note-title, body.hand .note-text, body.hand .check-text { font-family: var(--hand-font); }

/* checklist */
.checklist { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.check-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: calc(11px * var(--font-scale)); font-weight: 700; color: rgba(0,0,0,.55); }
.cp-bar { flex: 1; height: 6px; background: rgba(0,0,0,.12); border-radius: 6px; overflow: hidden; }
.cp-bar i { display: block; height: 100%; background: var(--ink); border-radius: 6px; transition: width .3s; }
.check-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; }
.check-box {
  flex: none; width: calc(22px * var(--font-scale)); height: calc(22px * var(--font-scale)); margin-top: 1px;
  border: 2px solid var(--ink); border-radius: 6px; background: transparent; color: #fff;
  cursor: pointer; font-size: calc(13px * var(--font-scale)); display: flex; align-items: center; justify-content: center; transition: .12s;
}
.check-row.done .check-box { background: var(--ink); }
.check-text { flex: 1; font-size: calc(15px * var(--font-scale)); line-height: 1.4; }
.check-row.done .check-text { text-decoration: line-through; opacity: .5; }
.check-del { border: 0; background: transparent; opacity: 0; cursor: pointer; font-size: 12px; padding: 2px 4px; color: rgba(0,0,0,.5); }
.check-row:hover .check-del { opacity: .7; }
body.touch .check-del { opacity: .5; }
.check-add { align-self: flex-start; border: 0; background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; font-size: calc(14px * var(--font-scale)); padding: 6px 2px; margin-top: 2px; }
.check-add:hover { text-decoration: underline; }

/* resize grip */
.grip {
  position: absolute; right: 1px; bottom: 1px; width: 24px; height: 24px; cursor: nwse-resize; z-index: 7;
  touch-action: none;
}
.grip::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 8px; height: 8px; border-right: 2px solid rgba(0,0,0,.28); border-bottom: 2px solid rgba(0,0,0,.28); border-radius: 0 0 3px 0; }

/* move handle — obvious grab point (drag-anywhere also works) */
.move-grip {
  position: absolute; top: 5px; left: 6px; z-index: 7; cursor: grab; touch-action: none;
  width: 26px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,.32); font-size: 15px; line-height: 1; opacity: 0; transition: opacity .15s, background .15s;
}
.move-grip span { transform: rotate(90deg); letter-spacing: -1px; }
.note:hover .move-grip { opacity: 1; }
.move-grip:hover { background: rgba(0,0,0,.08); color: rgba(0,0,0,.55); }
body.touch .move-grip { opacity: .9; width: 34px; height: 28px; font-size: 17px; background: rgba(0,0,0,.06); }
.note.dragging .move-grip { cursor: grabbing; }
/* keep the title clear of the handle */
.note-title { padding-left: 26px; }
.note.dragging, .note.dragging * { user-select: none; -webkit-user-select: none; }
/* cursor affordance: whole note is grabbable, text areas show a caret */
.note { cursor: grab; }
.note.dragging { cursor: grabbing; }
.note-title, .note-text, .check-text { cursor: text; }

/* ============================ GRID VIEW ============================ */
body.grid-view .notes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 46px 22px; padding: 50px 26px 26px; min-height: auto;
}
body.grid-view .note {
  position: relative !important; left: auto !important; top: auto !important;
  width: auto !important; height: auto !important; min-height: 190px; transform: none !important;
}
body.grid-view .strings, body.grid-view .fold, body.grid-view .grip, body.grid-view .move-grip { display: none; }
body.grid-view .note-title { padding-left: 0; }
body.grid-view .note.dragging { transform: none !important; }

/* ============================ FAB + palette ============================ */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 250;
  height: 62px; min-width: 62px; padding: 0 22px 0 18px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #3a2b00; font-weight: 800; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 16px rgba(244,150,50,.5), 0 2px 4px rgba(0,0,0,.2);
  transition: transform .15s, box-shadow .15s; touch-action: none;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(244,150,50,.6); }
.fab:active { transform: scale(.95); }
.fab-plus { font-size: 26px; line-height: 1; margin-top: -2px; }
.palette {
  position: fixed; right: 26px; bottom: 96px; z-index: 251;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; padding: 12px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(10px) scale(.9); transition: .18s; transform-origin: bottom right;
}
.palette.open { opacity: 1; transform: none; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .12s; }
.swatch:hover { transform: scale(1.15); }
.color-pop {
  position: fixed; z-index: 400; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 10px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift);
}
.date-pop {
  position: fixed; z-index: 450; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-solid); color: var(--text);
  font-size: 16px; box-shadow: var(--shadow-lift); font-family: var(--ui-font);
}
.date-pop::-webkit-calendar-picker-indicator { cursor: pointer; }

/* ============================ zoom controls ============================ */
.zoom-controls {
  position: fixed; left: 16px; bottom: 20px; z-index: 240;
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow-note);
}
.zoom-controls button {
  border: 0; background: transparent; color: var(--text); cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.zoom-controls button:hover { background: rgba(0,0,0,.08); }
:root[data-theme="dark"] .zoom-controls button:hover { background: rgba(255,255,255,.08); }
.zoom-controls .zoom-fit { font-size: 17px; }
.zoom-pct {
  min-width: 46px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-soft);
  cursor: pointer; user-select: none;
}
body.grid-view .zoom-controls { display: none; }
@media (max-width: 720px) {
  .zoom-controls { left: 12px; bottom: 14px; }
  .zoom-controls button { width: 42px; height: 42px; }
}

/* ============================ empty state ============================ */
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; }
.empty-card { text-align: center; max-width: 380px; pointer-events: auto; }
.empty-emoji { font-size: 64px; margin-bottom: 8px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
.empty-card h2 { margin: 0 0 8px; font-size: 24px; }
.empty-card p { color: var(--text-soft); font-size: 16px; line-height: 1.5; margin: 0 0 20px; }
.btn-primary {
  border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #3a2b00;
  padding: 13px 24px; border-radius: 999px; font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 14px rgba(244,150,50,.45);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-text { display: block; margin: 12px auto 0; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 14px; text-decoration: underline; }

/* ============================ toast ============================ */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  z-index: 500; background: #1f2530; color: #fff; padding: 12px 16px; border-radius: 12px;
  font-size: 15px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-lift);
  opacity: 0; transition: .25s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast-act { border: 0; background: var(--accent); color: #3a2b00; font-weight: 800; padding: 6px 14px; border-radius: 8px; cursor: pointer; }

/* ============================ modal ============================ */
.modal { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.modal-card { background: var(--panel-solid); color: var(--text); border-radius: 18px; padding: 26px; max-width: 460px; width: 100%; box-shadow: var(--shadow-lift); position: relative; max-height: 86vh; overflow: auto; }
.modal-card h2 { margin: 0 0 14px; font-size: 22px; }
.modal-x { position: absolute; top: 14px; right: 14px; border: 0; background: rgba(0,0,0,.06); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--text); }
.help-list { padding-left: 18px; margin: 0 0 20px; }
.help-list li { margin-bottom: 11px; font-size: 15.5px; line-height: 1.45; color: var(--text); }

/* ============================ responsive ============================ */
/* menu items that only appear on small screens (board + theme live here on mobile) */
.menu .only-mobile { display: none; }

@media (max-width: 720px) {
  .brand-name { display: none; }
  #search { width: 150px; }
  .fab-label { display: none; }
  .fab { right: 16px; bottom: 16px; height: 58px; padding: 0; min-width: 58px; justify-content: center; }
  .palette { right: 16px; bottom: 84px; }
}

/* phones: a single tidy row — brand · board tabs (scroll) · search · A−/A+ · ⋯
   +Board and theme move into the ⋯ menu so nothing overlaps. */
@media (max-width: 640px) {
  #topbar { gap: 6px; padding: 0 7px; }
  .spacer { display: none; }
  .boards { flex: 1 1 auto; min-width: 0; max-width: none; }
  #addBoard, #themeBtn { display: none; }
  .menu .only-mobile { display: block; }
  #topbar > *, .chip, .icon-btn, .seg-btn, .board-tab { flex-shrink: 0; white-space: nowrap; }
  .boards { flex-shrink: 1; }
  #search:not(:focus) { width: 42px; padding-right: 0; }
  #search:focus { width: 44vw; }
  .seg-btn { padding: 8px 11px; }
}

/* ============================ print ============================ */
@media print {
  #topbar, .fab, .palette, .note-bar, .grip, .strings, .empty, .toast, .fold { display: none !important; }
  body, .board { position: static; overflow: visible; background: #fff; }
  .notes { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 18px; position: static; }
  .note { position: relative !important; left: auto !important; top: auto !important; width: auto !important; height: auto !important; transform: none !important; break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
