:root {
  --bg: #0b0c10;
  --bg-2: #12141b;
  --card: #171a22;
  --ink: #efe8dc;
  --muted: #9a9286;
  --line: rgba(239, 232, 220, 0.08);
  --gold: #d4b483;
  --gold-2: #e8d3a8;
  --sage: #8fbea8;
  --rose: #d9897a;
  --sky: #8aa4c7;
  --on-accent: #1a140c;
  --glow-1: rgba(212, 180, 131, 0.09);
  --glow-2: rgba(138, 164, 199, 0.08);
  --panel: rgba(23, 26, 34, 0.72);
  --chrome: rgba(11, 12, 16, 0.72);
  --sasha: #8aa4c7;
  --masha: #d9897a;
}

html[data-theme="light"] {
  --bg: #f3eee4;
  --bg-2: #e7dfd0;
  --card: #fffaf2;
  --ink: #1c1915;
  --muted: #6f675c;
  --line: rgba(28, 25, 21, 0.1);
  --gold: #9a7040;
  --gold-2: #6e4e28;
  --sage: #3f7a62;
  --rose: #b85a4c;
  --sky: #4d6f94;
  --on-accent: #1a140c;
  --glow-1: rgba(154, 112, 64, 0.14);
  --glow-2: rgba(77, 111, 148, 0.1);
  --panel: rgba(255, 250, 242, 0.86);
  --chrome: rgba(243, 238, 228, 0.82);
  --sasha: #4d6f94;
  --masha: #b85a4c;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); height: 100%; }
html[data-theme="light"] { color-scheme: light; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 8% -10%, var(--glow-1), transparent 50%),
    radial-gradient(900px 420px at 100% 0%, var(--glow-2), transparent 46%),
    var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow: hidden;
}
h1, h2, h3, p { margin: 0; }
button, input { font-family: inherit; }
.hidden { display: none !important; }

.site-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  flex-wrap: wrap;
  background: var(--chrome);
  backdrop-filter: blur(18px);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
}
.logo em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  padding: 0 0.12em;
}
.brand-rest {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.brand-sep {
  color: var(--gold);
  opacity: 0.7;
  font-weight: 400;
}
.brand-page {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
  white-space: nowrap;
}
.sync-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.sync-status[data-ok="1"] { color: var(--sage); }
.chrome-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.who-now {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.who-now-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .sync-status,
  .who-now-label { display: none; }
}
.who-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font: 700 11px Montserrat, sans-serif;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.who-chip.sasha.is-on {
  color: var(--sasha);
  border-color: color-mix(in srgb, var(--sasha) 55%, var(--line));
  background: color-mix(in srgb, var(--sasha) 16%, transparent);
}
.who-chip.masha.is-on {
  color: var(--masha);
  border-color: color-mix(in srgb, var(--masha) 55%, var(--line));
  background: color-mix(in srgb, var(--masha) 16%, transparent);
}
.notes-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.notes-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 6px 10px;
  min-height: 36px;
  border-radius: 999px;
  font: 700 11px/1 Montserrat, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.notes-nav-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notes-nav-link.is-on {
  color: var(--gold-2);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
  background: color-mix(in srgb, var(--gold) 14%, transparent);
}
.notes-nav-count {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--on-accent);
  font-size: 10px;
  display: grid;
  place-items: center;
}
.notes-nav-count[hidden] { display: none; }
.archive-bar {
  flex: 0 0 auto;
  display: none;
  gap: 8px;
  padding: 12px 18px 0;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}
body.on-archive .archive-bar { display: grid; }
.archive-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 16px;
  padding: 10px 16px;
  font: 500 15px/1.4 Montserrat, sans-serif;
  outline: none;
}
.archive-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.archive-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
body.on-archive .composer,
body.on-archive .clear-btn { display: none; }
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  padding: 7px 12px;
  font: 600 11px Montserrat, sans-serif;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.theme-toggle:hover { border-color: var(--gold); }
.home-link {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--bg-2);
  text-decoration: none;
}
.home-link:hover { border-color: var(--gold); color: var(--gold); }
.home-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.boards {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  padding: 16px 18px 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}
.boards-split {
  display: grid;
  place-items: center;
  width: 52px;
  color: var(--gold);
  font-size: 22px;
  font-style: italic;
  font-weight: 500;
  opacity: 0.85;
}
.board {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px 18px 10px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}
.board-sasha { box-shadow: inset 3px 0 0 var(--sasha), 0 18px 50px rgba(0, 0, 0, 0.16); }
.board-masha { box-shadow: inset 3px 0 0 var(--masha), 0 18px 50px rgba(0, 0, 0, 0.16); }

.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 4px;
}
.board-sasha .eyebrow { color: var(--sasha); }
.board-masha .eyebrow { color: var(--masha); }
.board h2 {
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 700;
  line-height: 1;
}
.board-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}
.count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.clear-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font: 600 11px Montserrat, sans-serif;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.clear-btn:hover { color: var(--ink); border-color: var(--gold); }
.clear-btn.armed {
  color: var(--on-accent);
  background: var(--rose);
  border-color: var(--rose);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 12px;
}
.composer input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  outline: none;
}
.composer input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.composer button[type="submit"] {
  border: 0;
  background: var(--gold);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 11px 16px;
  font: 700 12px Montserrat, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.composer button[type="submit"]:hover { filter: brightness(1.06); }
.mic-btn {
  min-width: 88px;
  height: 44px;
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, var(--bg));
  color: var(--gold-2);
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font: 700 12px Montserrat, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mic-btn:hover { filter: brightness(1.08); }
.mic-btn.listening {
  color: var(--on-accent);
  background: var(--gold);
  border-color: var(--gold);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 45%, transparent); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

.tasks {
  list-style: none;
  margin: 0;
  padding: 0 2px 8px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px 28px;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
}
.task:hover { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.task.open {
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  border-color: var(--line);
}
.task.done .task-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--gold) 55%, var(--muted));
}
.task-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding-top: 1px;
}
.task-hit {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-radius: 8px;
}
.task-hit-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 8px;
  align-items: start;
  width: 100%;
}
.task-chevron {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  transition: transform 0.16s ease, color 0.16s ease;
  transform-origin: 50% 50%;
}
.task.open .task-chevron,
.task-hit.has-extra .task-chevron,
.task-hit[aria-expanded="true"] .task-chevron {
  color: var(--gold-2);
}
.task.open .task-chevron {
  transform: rotate(90deg);
}
.task-due {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  cursor: pointer;
}
.task-due.is-soon,
.task-due.is-today { color: var(--gold-2); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.task-due.is-overdue { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 40%, var(--line)); }
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.task-byline {
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  border: 0;
  padding: 0;
  background: none;
}
.task-byline-k {
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  margin-right: 0.25em;
}
.task-byline.sasha { color: var(--sasha); }
.task-byline.masha { color: var(--masha); }
.task-done-at {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.task-restore {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.task-restore input[type="date"] {
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 10px;
  padding: 4px 8px;
  font: 600 13px Montserrat, sans-serif;
}
.check {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  color: transparent;
  flex-shrink: 0;
}
.board-sasha .check { border-color: color-mix(in srgb, var(--sasha) 55%, var(--line)); }
.board-masha .check { border-color: color-mix(in srgb, var(--masha) 55%, var(--line)); }
.task.done .check {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-accent);
}
.check.fake {
  pointer-events: none;
  background: color-mix(in srgb, var(--gold) 35%, transparent);
  border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
  color: var(--gold-2);
}
.task.in-archive .task-text {
  text-decoration: none;
  color: var(--muted);
}
.check svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.task-text {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  word-break: break-word;
  display: block;
  width: 100%;
  min-width: 0;
}
@media (hover: hover) {
  .task-hit:hover .task-text { color: var(--gold-2); }
  .task-hit:hover .task-chevron { color: var(--gold-2); }
}
.task-title-input {
  width: 100%;
  border: 1px solid var(--gold);
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.4 Montserrat, sans-serif;
  border-radius: 10px;
  padding: 4px 8px;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.task.renaming .task-title-input {
  text-decoration: none;
}
.task-del {
  width: 28px;
  height: 28px;
  margin-top: -2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  border-radius: 999px;
  flex-shrink: 0;
}
.task-del:hover {
  color: var(--rose);
  background: color-mix(in srgb, var(--rose) 14%, transparent);
}
.task-del.armed {
  width: auto;
  min-width: 0;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  color: var(--on-accent);
  background: var(--rose);
  line-height: 28px;
}
.task.confirm-del {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}
.task.confirm-del .task-rename-btn,
.task.confirm-del .task-icon-slot {
  display: none;
}
.task-rename-btn,
.task-icon-slot {
  width: 28px;
  height: 28px;
  margin-top: -2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}
.task-icon-slot { cursor: default; pointer-events: none; }
.task-rename-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.task-rename-btn:hover {
  color: var(--gold-2);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
}
.task-extra {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding: 12px 12px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
}
.detail-due-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-due {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.detail-due span,
.detail-editor > span {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.detail-due input[type="date"] {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font: 600 13px Montserrat, sans-serif;
  outline: none;
  min-height: 36px;
  color-scheme: inherit;
}
.detail-due input[type="date"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.detail-due-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.detail-editor { display: grid; gap: 6px; }
.detail-compose { gap: 8px; }
.detail-editor textarea,
.detail-editor input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  font: 500 14px/1.45 Montserrat, sans-serif;
  outline: none;
}
.detail-editor input[type="text"] {
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
}
.detail-editor textarea {
  min-height: 56px;
  max-height: min(45vh, 420px);
  padding: 10px 12px;
  font: 500 15px/1.5 Montserrat, sans-serif;
  resize: none;
  overflow-y: auto;
}
.detail-editor textarea:focus,
.detail-editor input[type="text"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}
.detail-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 500;
}
.detail-view {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 16px;
  padding: 10px 12px;
  cursor: text;
}
.detail-view .detail-check,
.detail-view [data-bullet] { cursor: pointer; }
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.detail-actions.is-idle {
  display: none;
}
.detail-blocks { display: grid; gap: 7px; }
.detail-gap { min-height: 0.7em; }
.detail-p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}
.detail-li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: flex-start;
}
.detail-check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--sage) 70%, var(--line));
  background: transparent;
  color: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.detail-check.fake {
  cursor: default;
  pointer-events: none;
}
.detail-check svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-li.done .detail-check {
  background: color-mix(in srgb, var(--sage) 82%, var(--gold));
  border-color: transparent;
  color: var(--on-accent);
}
.detail-li-text {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  padding-top: 1px;
}
.detail-li.done .detail-li-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--gold) 78%, transparent);
  text-decoration-thickness: 1.6px;
  text-decoration-skip-ink: none;
  opacity: 0.86;
}
.detail-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: var(--gold);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  font: 700 12px Montserrat, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.detail-save-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--gold);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.detail-save-mark svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-save:hover { filter: brightness(1.06); }
.task-rename {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 6px;
  width: 100%;
  align-items: center;
}
.task-rename-due {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.task-rename-due input[type="date"] {
  min-height: 36px;
  flex: 1;
  border: 1px solid var(--gold);
  background: var(--bg);
  color: var(--ink);
  border-radius: 10px;
  padding: 4px 8px;
  font: 600 13px Montserrat, sans-serif;
}
.task-rename-save {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.task-rename-save svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font: 600 11px Montserrat, sans-serif;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.detail-btn:hover { color: var(--ink); border-color: var(--gold); }
.detail-btn.primary {
  background: var(--gold);
  color: var(--on-accent);
  border-color: var(--gold);
  font-weight: 700;
}
.detail-btn.danger:hover,
.detail-btn.danger.armed {
  color: var(--on-accent);
  background: var(--rose);
  border-color: var(--rose);
}
.empty {
  margin: 18px 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
}

@media (max-width: 820px) {
  body { overflow: hidden; }
  .boards {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
    gap: 0;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .boards-split {
    width: auto;
    height: 28px;
    font-size: 16px;
  }
  .board {
    border-radius: 18px;
    padding: 12px 12px 8px;
    min-height: 0;
  }
  .board h2 { font-size: 20px; }
  .board-head { margin-bottom: 10px; }
  .composer input,
  .composer button[type="submit"] { min-height: 44px; font-size: 16px; }
  .composer button[type="submit"] { font-size: 12px; padding: 8px 14px; }
  .mic-btn { min-width: 80px; min-height: 44px; }
  .clear-btn { min-height: 36px; }
  .check { width: 24px; height: 24px; }
  .task { padding: 8px 6px; grid-template-columns: 28px minmax(0, 1fr) 32px 32px; }
  .task.confirm-del { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .task-rename-btn, .task-del, .task-rename-save { width: 32px; height: 32px; }
  .task-del.armed {
    width: auto;
    min-width: 0;
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
  }
  .detail-save { min-height: 44px; }
  .detail-due input[type="date"] { min-height: 40px; font-size: 16px; }
  .detail-editor textarea,
  .detail-editor input[type="text"],
  .task-title-input { font-size: 16px; }
  .detail-editor textarea { min-height: 64px; max-height: min(50vh, 480px); }
  .home-link { width: 40px; height: 40px; }
  .theme-toggle { min-height: 40px; padding: 8px 12px; font-size: 12px; }
  .sync-status { display: none; }
  .who-now-label { display: none; }
  .notes-nav-link { min-height: 40px; }
  .archive-bar { padding: 10px 12px 0; }
  .archive-search input { font-size: 16px; }
  .task-restore input[type="date"],
  .task-rename-due input[type="date"] { font-size: 16px; min-height: 40px; }
  .brand-page { font-size: 14px; }
  .site-chrome { padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
}

@media (max-width: 380px) {
  .count { display: none; }
  .board h2 { font-size: 18px; }
}
