/* =========================================================================
   Personal Kanban — design system
   ========================================================================= */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, system-ui, sans-serif;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --col-w: 300px;
  --appbar-h: 58px;

  --c-slate: #64748b;
  --c-red: #ef4444;
  --c-amber: #f59e0b;
  --c-green: #22c55e;
  --c-blue: #3b82f6;
  --c-violet: #8b5cf6;
  --c-pink: #ec4899;
  --c-teal: #14b8a6;
  --c-orange: #f97316;
}

:root[data-theme='dark'] {
  --bg: #0b0d12;
  --bg-grad: radial-gradient(1200px 640px at 12% -8%, #182036 0%, transparent 58%),
    radial-gradient(1100px 560px at 100% -4%, #241a33 0%, transparent 54%);
  --surface: #151a24;
  --surface-2: #1b2130;
  --surface-3: #212a3b;
  --surface-hover: #232c3d;
  --col-bg: rgba(20, 25, 35, 0.55);
  --border: #283041;
  --border-soft: #212736;
  --text: #e8edf5;
  --text-dim: #9aa5b8;
  --text-faint: #6a7488;
  --shadow: 0 18px 46px -20px rgba(0, 0, 0, 0.75);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 3px 10px -6px rgba(0, 0, 0, 0.6);
  --shadow-drag: 0 24px 50px -12px rgba(0, 0, 0, 0.75);
  --glass: rgba(12, 15, 22, 0.72);
  --scrim: rgba(3, 5, 10, 0.62);
}

:root[data-theme='light'] {
  --bg: #eef1f7;
  --bg-grad: radial-gradient(1200px 640px at 12% -8%, #dde6ff 0%, transparent 58%),
    radial-gradient(1100px 560px at 100% -4%, #f1e2ff 0%, transparent 54%);
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #eef2f8;
  --surface-hover: #eaeff7;
  --col-bg: rgba(255, 255, 255, 0.62);
  --border: #dde2ec;
  --border-soft: #e8ecf3;
  --text: #17202f;
  --text-dim: #55607a;
  --text-faint: #8a93a6;
  --shadow: 0 20px 46px -22px rgba(30, 41, 74, 0.4);
  --shadow-card: 0 1px 2px rgba(30, 41, 74, 0.08), 0 3px 10px -6px rgba(30, 41, 74, 0.16);
  --shadow-drag: 0 26px 54px -14px rgba(30, 41, 74, 0.4);
  --glass: rgba(255, 255, 255, 0.72);
  --scrim: rgba(20, 28, 48, 0.42);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--c-blue) 30%, transparent); }

/* =========================================================================
   App bar
   ========================================================================= */
.appbar {
  height: var(--appbar-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 clamp(12px, 2vw, 22px);
  padding-top: env(safe-area-inset-top);
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 30;
}
.appbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar-right { display: flex; align-items: center; gap: 8px; }

.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c-violet), var(--c-blue));
  box-shadow: 0 6px 16px -6px var(--c-violet);
}
.board-name {
  font-size: clamp(15px, 2vw, 18px); font-weight: 680; letter-spacing: -0.01em;
  color: var(--text); background: none; border: none; cursor: pointer;
  padding: 5px 8px; border-radius: 8px; max-width: 42vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-name:hover { background: var(--surface-hover); }

.search {
  display: flex; align-items: center; gap: 8px; height: 38px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px; color: var(--text-faint);
  transition: border-color 0.15s, box-shadow 0.15s, width 0.2s var(--ease);
}
.search:focus-within { border-color: var(--c-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-blue) 20%, transparent); }
.search input {
  border: none; background: none; outline: none; color: var(--text);
  font-size: 14px; width: clamp(90px, 16vw, 200px); font-family: inherit;
}
.search input::placeholder { color: var(--text-faint); }

.tool-btn {
  position: relative; height: 38px; min-width: 38px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tool-btn:hover { background: var(--surface-hover); color: var(--text); }
.tool-btn.active { color: var(--c-blue); border-color: color-mix(in srgb, var(--c-blue) 45%, var(--border)); }
.filter-count {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--c-blue); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.pomo-time { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13.5px; }
.pomo-btn.running { color: var(--c-red); border-color: color-mix(in srgb, var(--c-red) 40%, var(--border)); }

/* theme icon swap */
.ico-sun { display: none; }
.ico-moon { display: block; }
:root[data-theme='dark'] .ico-sun { display: block; }
:root[data-theme='dark'] .ico-moon { display: none; }

/* =========================================================================
   Board & columns
   ========================================================================= */
.board {
  flex: 1; min-height: 0;
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px clamp(12px, 2vw, 22px) 22px;
  overflow-x: auto; overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.board::-webkit-scrollbar { height: 10px; }
.board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }
.board::-webkit-scrollbar-track { background: transparent; }

.column {
  flex: 0 0 var(--col-w); width: var(--col-w);
  max-height: 100%; display: flex; flex-direction: column;
  background: var(--col-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  box-shadow: var(--shadow); transition: box-shadow 0.15s, border-color 0.15s;
}
.column.drop-target { border-color: color-mix(in srgb, var(--c-blue) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-blue) 22%, transparent), var(--shadow); }

.col-head {
  display: flex; align-items: center; gap: 9px; padding: 12px 12px 10px;
  cursor: grab; touch-action: manipulation; user-select: none;
}
.col-head:active { cursor: grabbing; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.col-name {
  flex: 1; min-width: 0; font-weight: 660; font-size: 14px; color: var(--text);
  background: none; border: none; outline: none; padding: 3px 5px; border-radius: 7px;
  font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.col-name:focus { background: var(--surface-hover); white-space: normal; }
.col-count {
  font-size: 12px; font-weight: 650; color: var(--text-faint);
  background: var(--surface-2); border-radius: 20px; padding: 2px 9px; font-variant-numeric: tabular-nums;
}
.col-count.over { color: var(--c-red); background: color-mix(in srgb, var(--c-red) 16%, transparent); }
.col-menu { border: none; background: none; color: var(--text-faint); cursor: pointer; padding: 4px; border-radius: 7px; display: grid; place-items: center; }
.col-menu:hover { background: var(--surface-hover); color: var(--text); }

.card-list {
  list-style: none; margin: 0; padding: 2px 10px 8px;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 8px;
  scrollbar-width: thin;
}
.card-list::-webkit-scrollbar { width: 8px; }
.card-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }

.add-card {
  margin: 0 10px 12px; padding: 10px; border-radius: var(--r-sm);
  border: 1px dashed var(--border); background: transparent; color: var(--text-faint);
  font-size: 13px; font-weight: 550; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 7px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.add-card:hover { background: var(--surface-hover); color: var(--text); border-color: var(--text-faint); }
.add-card-input {
  margin: 0 10px 12px; width: calc(100% - 20px); padding: 11px;
  border: 1px solid var(--c-blue); background: var(--surface); color: var(--text);
  border-radius: var(--r-sm); font-size: 14px; font-family: inherit; outline: none; resize: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-blue) 18%, transparent);
}

.add-column {
  flex: 0 0 var(--col-w); width: var(--col-w); padding: 14px;
  border: 1px dashed var(--border); border-radius: var(--r-lg); background: transparent;
  color: var(--text-faint); font-size: 14px; font-weight: 560; cursor: pointer;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.add-column:hover { background: var(--col-bg); color: var(--text); border-color: var(--text-faint); }

/* =========================================================================
   Card
   ========================================================================= */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: 11px 12px; box-shadow: var(--shadow-card);
  cursor: pointer; touch-action: manipulation;
  transition: transform 0.12s var(--ease), box-shadow 0.15s, border-color 0.15s;
}
@media (hover: hover) { .card:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.5); } }
.card.source-hidden { opacity: 0; pointer-events: none; }

.card-labels { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 9px;
  font-size: 11px; font-weight: 650; border-radius: 20px; white-space: nowrap;
  color: var(--chip-fg); background: var(--chip-bg);
}
.card-title { font-size: 14px; font-weight: 500; line-height: 1.42; word-break: break-word; }

.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.card-meta:empty { display: none; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 7px; background: var(--surface-2); color: var(--text-dim);
}
.badge svg { width: 12px; height: 12px; }
.badge.due-soon { color: var(--c-amber); background: color-mix(in srgb, var(--c-amber) 15%, transparent); }
.badge.due-over { color: var(--c-red); background: color-mix(in srgb, var(--c-red) 15%, transparent); }
.badge.checks.complete { color: var(--c-green); background: color-mix(in srgb, var(--c-green) 15%, transparent); }

/* Drag ghost + placeholder */
.drag-ghost {
  position: fixed; top: 0; left: 0; z-index: 200; pointer-events: none;
  box-shadow: 0 14px 26px -10px rgba(0, 0, 0, 0.55); border-radius: var(--r-md); rotate: 2.5deg;
  opacity: 0.97; will-change: transform;
}
/* Performance: backdrop blur on every column is expensive to repaint while
   dragging/auto-scrolling on mobile — drop it for the duration of the drag. */
body.dragging .column,
body.dragging .appbar { backdrop-filter: none; }
.drag-ghost.col-ghost { rotate: 1.5deg; border-radius: var(--r-lg); }
.placeholder {
  border: 2px dashed color-mix(in srgb, var(--c-blue) 55%, transparent);
  background: color-mix(in srgb, var(--c-blue) 8%, transparent);
  border-radius: var(--r-md); flex: none;
}
.col-placeholder {
  flex: 0 0 var(--col-w); width: var(--col-w); align-self: stretch;
  border-radius: var(--r-lg); border: 2px dashed color-mix(in srgb, var(--c-blue) 50%, transparent);
  background: color-mix(in srgb, var(--c-blue) 7%, transparent);
}
body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging { user-select: none; }

/* =========================================================================
   Popover menus
   ========================================================================= */
.menu {
  position: fixed; z-index: 120; min-width: 210px; max-width: min(300px, 92vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 7px; animation: pop 0.14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.menu-label { font-size: 11px; color: var(--text-faint); padding: 7px 9px 3px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.menu button.item {
  display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none;
  color: var(--text); text-align: left; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; cursor: pointer;
}
.menu button.item:hover { background: var(--surface-hover); }
.menu button.item.danger { color: var(--c-red); }
.menu button.item svg { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.menu hr { border: none; border-top: 1px solid var(--border-soft); margin: 6px 4px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 9px 8px; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.1s; position: relative;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--surface); box-shadow: 0 0 0 2px currentColor; }
.menu input[type='number'], .menu input[type='text'] {
  width: 100%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 9px; padding: 8px 10px; font-size: 13.5px; font-family: inherit; outline: none;
}
.menu input:focus { border-color: var(--c-blue); }

/* label rows (filter + manager) */
.label-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.label-row:hover { background: var(--surface-hover); }
.label-row .dot { width: 13px; height: 13px; border-radius: 4px; flex: none; }
.label-row .name { flex: 1; font-size: 13.5px; }
.label-row .check { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; color: #fff; }
.label-row .check.on { background: var(--c-blue); border-color: var(--c-blue); }
.label-row .edit { opacity: 0; color: var(--text-faint); border: none; background: none; cursor: pointer; padding: 2px; }
.label-row:hover .edit { opacity: 1; }

/* =========================================================================
   Card sheet / modal
   ========================================================================= */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90; background: var(--scrim); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px; animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(600px, 100%); max-height: min(90vh, 820px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 8px 22px 18px; animation: sheetIn 0.22s var(--ease);
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-top: 10px; }
.sheet-labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.sheet-labels .add-label-btn {
  height: 26px; padding: 0 10px; border-radius: 20px; border: 1px dashed var(--border);
  background: none; color: var(--text-faint); font-size: 12px; font-weight: 600; cursor: pointer;
}
.sheet-labels .add-label-btn:hover { color: var(--text); border-color: var(--text-faint); }
.icon-btn { height: 34px; width: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); cursor: pointer; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }

.sheet-title {
  width: 100%; margin: 12px 0 4px; border: none; background: none; color: var(--text);
  font-size: clamp(18px, 3vw, 21px); font-weight: 680; font-family: inherit; outline: none;
  resize: none; overflow: hidden; line-height: 1.3; padding: 4px 2px; border-radius: 8px;
}
.sheet-title:focus { background: var(--surface-2); }
.field { margin-top: 14px; }
.field-label { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 7px; }
.sheet-grid { display: flex; gap: 14px; margin-top: 6px; }
.sheet-grid .field { flex: 1; margin-top: 8px; }
input[type='date'], select {
  width: 100%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none;
}
input[type='date']:focus, select:focus { border-color: var(--c-blue); }
.sheet-desc {
  width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); border-radius: 11px; padding: 12px;
  font-size: 14px; font-family: inherit; outline: none; line-height: 1.55;
}
.sheet-desc:focus { border-color: var(--c-blue); }

.row-between { display: flex; align-items: baseline; justify-content: space-between; }
.checklist-progress { font-size: 12px; color: var(--text-faint); font-weight: 650; }
.progress-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--c-green); border-radius: 6px; transition: width 0.25s var(--ease); }
.subtask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.subtask { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; transition: background 0.12s; }
.subtask:hover { background: var(--surface-2); }
.subtask input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--c-green); cursor: pointer; flex: none; }
.subtask-text { flex: 1; font-size: 14px; border: none; background: none; color: var(--text); outline: none; font-family: inherit; padding: 3px; border-radius: 6px; }
.subtask.done .subtask-text { text-decoration: line-through; color: var(--text-faint); }
.subtask-del { border: none; background: none; color: var(--text-faint); cursor: pointer; opacity: 0; padding: 3px; border-radius: 6px; }
.subtask:hover .subtask-del { opacity: 1; }
.subtask-del:hover { color: var(--c-red); }
.subtask-add input {
  width: 100%; margin-top: 6px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); border-radius: 9px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none;
}
.subtask-add input:focus { border-color: var(--c-blue); }

.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.btn-ghost-danger {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent;
  background: color-mix(in srgb, var(--c-red) 12%, transparent); color: var(--c-red);
  border-radius: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.btn-ghost-danger:hover { background: color-mix(in srgb, var(--c-red) 20%, transparent); }
.sheet-meta { font-size: 12px; color: var(--text-faint); text-align: right; }

/* =========================================================================
   Toast + gate
   ========================================================================= */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 11px 17px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13.5px; font-weight: 500;
  z-index: 150; opacity: 0; transition: opacity 0.2s, transform 0.2s var(--ease); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.gate {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px;
  background: var(--bg); background-image: var(--bg-grad);
}
.gate-card {
  width: min(390px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px; text-align: center; animation: sheetIn 0.22s var(--ease);
}
.gate-mark { color: var(--c-violet); margin-bottom: 10px; }
.gate-card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 680; }
.gate-sub { margin: 0 0 20px; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.gate-card input {
  width: 100%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 12px; padding: 13px 15px; font-size: 15px; font-family: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gate-card input:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-blue) 20%, transparent); }
.gate-error { color: var(--c-red); font-size: 13px; font-weight: 500; margin-top: 10px; }
.gate-btn {
  width: 100%; margin-top: 16px; border: none; border-radius: 12px; padding: 13px; font-size: 15px;
  font-weight: 650; color: #fff; background: linear-gradient(135deg, var(--c-violet), var(--c-blue));
  cursor: pointer; transition: filter 0.15s, transform 0.1s;
}
.gate-btn:hover { filter: brightness(1.08); }
.gate-btn:active { transform: translateY(1px); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (min-width: 1800px) { :root { --col-w: 320px; } .board { gap: 20px; } }

@media (max-width: 760px) {
  :root { --col-w: 84vw; --appbar-h: 54px; }
  .board { gap: 12px; padding: 12px 12px 16px; scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: center; }
  .add-column { flex-basis: 70vw; width: 70vw; }
  .only-wide { display: none; }
  .search input { width: 34vw; }
  .board-name { max-width: 34vw; }

  /* Card detail becomes a bottom sheet */
  .sheet-backdrop { place-items: end stretch; padding: 0; }
  .sheet {
    width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 6px 18px calc(18px + env(safe-area-inset-bottom));
    animation: sheetUp 0.26s var(--ease);
  }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  .sheet-grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 8px auto 2px; }
  .sheet-grid { flex-direction: column; gap: 0; }
}

@media (max-width: 420px) {
  .search { padding: 0 9px; }
  .search input { width: 26vw; }
  .tool-btn { padding: 0 7px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.05ms !important; scroll-behavior: auto !important; }
}
