/* Horsmann PM — "Night press"
   Process inks carry meaning: cyan = in progress, magenta = overdue / high priority,
   yellow = today / primary action, K (graphite) = done. Everything else stays quiet. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2-variations"), url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root, [data-theme="dark"] {
  --ink: #181c25;        /* background: wet press ink */
  --plate: #21262f;      /* raised surfaces */
  --plate-2: #2a303b;
  --rule: #313744;
  --rule-2: #414858;
  --paper: #e6e1d3;      /* text: newsprint under a work lamp */
  --paper-2: #b9b5aa;
  --graphite: #868891;   /* K: done, secondary */
  --cyan: #3db2d6;
  --magenta: #e2477e;
  --yellow: #f0c43a;
  --yellow-text: #f0c43a;
  --on-yellow: #181c25;
  --cyan-wash: rgba(61, 178, 214, .12);
  --magenta-wash: rgba(226, 71, 126, .13);
  --yellow-wash: rgba(240, 196, 58, .12);
  color-scheme: dark;
}
[data-theme="light"] {
  --ink: #ebeae5;        /* proof sheet in daylight */
  --plate: #f6f5f1;
  --plate-2: #e2e1db;
  --rule: #d5d3cc;
  --rule-2: #bdbbb3;
  --paper: #1c2029;
  --paper-2: #474b55;
  --graphite: #73757d;
  --cyan: #1a83a8;
  --magenta: #c0275f;
  --yellow: #f0c43a;
  --yellow-text: #8a6700;
  --on-yellow: #1c2029;
  --cyan-wash: rgba(26, 131, 168, .1);
  --magenta-wash: rgba(192, 39, 95, .09);
  --yellow-wash: rgba(240, 196, 58, .22);
  color-scheme: light;
}

/* Type scale (major third on 15px): 12 · 15 · 18.75 · 23.4 · 29.3 · 36.6 · 45.8 */
:root {
  --t-sm: .8rem;
  --t-base: .9375rem;
  --t-md: 1.17rem;
  --t-lg: 1.46rem;
  --t-xl: 1.83rem;
  --t-hero: clamp(2.1rem, 1.2rem + 3.4vw, 3.4rem);
  --gap: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: var(--t-base); line-height: 1.55; font-stretch: 100%;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
h1 { font-size: var(--t-xl); font-stretch: 112%; letter-spacing: -.015em; }
h2 { font-size: var(--t-base); font-weight: 650; }
p { margin: 0; }
code, pre, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
.muted { color: var(--graphite); }
.small { font-size: var(--t-sm); }
.right { text-align: right; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--yellow); color: var(--on-yellow); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- semantic ink ---------- */
.state-doing { color: var(--cyan); }
.flag-high { color: var(--magenta); font-weight: 600; }
.due { color: var(--graphite); white-space: nowrap; }
.due-soon { color: var(--yellow-text); }
.due-overdue { color: var(--magenta); font-weight: 600; }
.status-note { color: var(--paper-2); font-weight: 600; }

.proj-tag { display: inline-flex; align-items: center; gap: 7px; color: var(--paper-2); white-space: nowrap; }
.proj-tag::before { content: ""; width: 3px; height: .95em; border-radius: 1px; background: var(--c); flex: none; }
a.proj-tag:hover { color: var(--paper); }

.avatar {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 1px solid var(--rule-2); color: var(--paper-2);
  font-size: .62rem; font-weight: 700; font-stretch: 80%; letter-spacing: .02em;
}
.count { color: var(--graphite); font-size: var(--t-sm); font-weight: 500; }
.count:empty { display: none; }
.chip { display: inline-block; font-size: var(--t-sm); color: var(--paper-2); border: 1px solid var(--rule-2); border-radius: 3px; padding: 0 6px; }

/* Project stage: a printed stamp when live, an outline while in development */
.stage {
  display: inline-block; vertical-align: middle; font-size: var(--t-sm); font-weight: 650; font-stretch: 100%;
  letter-spacing: 0; line-height: 1.5; padding: 0 7px; border-radius: 3px; border: 1px solid var(--rule-2); color: var(--graphite);
}
.stage-live { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.stage-switch { display: inline-flex; margin-top: 10px; border: 1px solid var(--rule-2); border-radius: 3px; }
.stage-opt { background: none; border: 0; padding: 3px 11px; font: inherit; font-size: var(--t-sm); font-weight: 600; color: var(--graphite); cursor: pointer; }
.stage-opt + .stage-opt { border-left: 1px solid var(--rule-2); }
.stage-opt:hover { color: var(--paper); }
.stage-opt.is-on { color: var(--paper); background: var(--plate-2); }
.stage-opt.stage-live.is-on { background: var(--paper); color: var(--ink); }
.radio-row { display: flex; gap: 22px; flex-wrap: wrap; }

/* ---------- shell ---------- */
.has-nav .main { margin-left: 232px; padding: 36px 48px 80px; max-width: 1300px; }
.no-nav .main { padding: 24px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30;
  display: flex; flex-direction: column; padding: 22px 14px 16px;
  background: var(--ink); border-right: 1px solid var(--rule); overflow-y: auto;
}
.topbar { display: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-stretch: 115%; letter-spacing: -.01em; }
.brand-mark { width: 20px; height: 20px; fill: none; stroke: var(--paper); stroke-width: 1.4; flex: none; }
.brand-mark .brand-dot { fill: var(--yellow); stroke: none; }
.brand-side { padding: 0 10px 26px; font-size: 1.02rem; }

.nav-main { display: flex; flex-direction: column; gap: 1px; }
.nav-main a, .nav-foot > a, .nav-project {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 4px;
  color: var(--paper-2); font-weight: 500;
}
.nav-main a:hover, .nav-foot > a:hover, .nav-project:hover { color: var(--paper); background: var(--plate); }
.nav-main a.active, .nav-foot > a.active, .nav-project.active { color: var(--paper); background: var(--plate); font-weight: 650; }
.nav-section { margin-top: 28px; flex: 1; }
.nav-label { display: flex; justify-content: space-between; align-items: center; padding: 0 10px 8px; color: var(--graphite); font-size: var(--t-sm); }
.nav-add { font-size: 1.15rem; line-height: 1; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; color: var(--graphite); }
.nav-add:hover { color: var(--paper); background: var(--plate); }
.nav-project { position: relative; padding-left: 18px; }
.nav-project::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 3px; border-radius: 1px; background: var(--c); }
.nav-project-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-empty { color: var(--graphite); font-size: var(--t-sm); padding: 0 10px; }
.nav-foot { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 18px; }
.nav-foot-row { display: flex; justify-content: space-between; padding: 8px 10px 0; }
.nav-foot-row form { margin: 0; }
.scrim { display: none; }

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.lede { margin-top: 8px; color: var(--paper-2); max-width: 64ch; }
.project-title { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem); font-stretch: 118%; font-weight: 800; letter-spacing: -.02em; }
.project-head { border-left: 4px solid var(--c); padding-left: 18px; }
.project-head .status-note { margin-top: 6px; }
.crumbs { display: flex; gap: 10px; align-items: center; color: var(--graphite); margin-bottom: 18px; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 8px 0; color: var(--graphite); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.tabs a:hover { color: var(--paper); }
.tabs a.active { color: var(--paper); border-color: var(--paper); }

.flash { padding: 9px 14px; border-radius: 4px; margin-bottom: 18px; font-weight: 550; border-left: 3px solid; }
.flash-ok { background: var(--cyan-wash); color: var(--paper); border-color: var(--cyan); }
.flash-err { background: var(--magenta-wash); color: var(--paper); border-color: var(--magenta); }

.panel { background: var(--plate); border-radius: 6px; padding: 20px 22px; }
.panel.narrow { max-width: 600px; }
.panel + .panel { margin-top: 18px; }
.panel > h2 { font-size: var(--t-md); font-stretch: 108%; margin-bottom: 12px; }
.empty-state { padding: 56px 0; max-width: 52ch; }
.empty-state h1 { margin-bottom: 10px; }
.empty-state p + p { margin-top: 14px; }
.empty-line { padding: 14px 0; }

/* ---------- controls ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input:not([type]), select, textarea {
  width: 100%; background: var(--ink); color: var(--paper); border: 1px solid var(--rule-2);
  border-radius: 3px; padding: 8px 10px; font: inherit; outline: none;
}
input::placeholder, textarea::placeholder { color: var(--graphite); }
input:focus, select:focus, textarea:focus { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
textarea { resize: vertical; line-height: 1.6; }
label, .field legend { display: block; font-weight: 600; color: var(--paper-2); }
label > input, label > select, label > textarea, label > .input-row { margin-top: 6px; }
.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 8px; }
.form-stack > * + * { margin-top: 16px; }
.form-stack h2 { margin-top: 26px; font-size: var(--t-md); font-stretch: 108%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 20px; }
.input-row { display: flex; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--paper); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--yellow); margin: 0; }
.inline { display: inline; margin: 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.inline-form input { flex: 1 1 200px; width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px;
  border-radius: 3px; border: 1px solid var(--rule-2); background: transparent; color: var(--paper);
  font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: var(--paper-2); }
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.btn-primary:hover { background: #f5d063; border-color: #f5d063; }
.btn-ghost { border-color: transparent; color: var(--paper-2); }
.btn-ghost:hover { color: var(--paper); border-color: transparent; }
.btn-danger { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--graphite); font: inherit; font-size: var(--t-sm); cursor: pointer; }
.link-btn:hover { color: var(--paper); }
.link-btn.danger:hover, .danger { color: var(--magenta); }
.icon-btn { background: none; border: 0; color: var(--paper); padding: 6px; border-radius: 4px; cursor: pointer; display: grid; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 26px; height: 26px; border-radius: 3px; background: var(--c); cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; }
.swatch input:checked + span { outline-color: var(--paper); }
.swatch input:focus-visible + span { outline-color: var(--yellow); }

.danger-zone { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--rule); }
.danger-panel { margin-top: 18px; box-shadow: inset 3px 0 0 var(--magenta); }
.danger-panel > * + * { margin-top: 12px; }

/* ---------- sign-in ---------- */
.auth-wrap { min-height: 86vh; display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card > * + * { margin-top: 16px; }
.auth-brand { font-size: var(--t-lg); margin-bottom: 14px; }
.auth-brand .brand-mark { width: 26px; height: 26px; }
.install-card { max-width: 520px; background: var(--plate); padding: 28px; border-radius: 6px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks .ok { color: var(--paper-2); }
.checks .bad { color: var(--magenta); }

/* ---------- dashboard: next up ---------- */
.nextup { padding-bottom: 30px; margin-bottom: 34px; border-bottom: 1px solid var(--rule); max-width: 980px; }
.nextup-date { color: var(--graphite); margin-bottom: 26px; }
.nextup-lead { color: var(--yellow-text); font-weight: 650; margin-bottom: 6px; }
.nextup-title {
  font-size: var(--t-hero); font-stretch: 116%; font-weight: 800; line-height: 1.04;
  letter-spacing: -.025em; max-width: 21ch; text-wrap: balance;
}
.nextup-title a { background: linear-gradient(var(--yellow), var(--yellow)) 0 100% / 0 3px no-repeat; transition: background-size .25s ease; }
.nextup-title a:hover { background-size: 100% 3px; }
.nextup-clear { color: var(--paper-2); }
.nextup-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 18px; font-size: var(--t-md); }
.nextup-meta .btn { font-size: var(--t-base); }
.tally { margin-top: 28px; color: var(--paper-2); max-width: 78ch; }
.tally a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.tally a.state-doing { color: var(--cyan); }
.tally a.due-overdue { color: var(--magenta); }
.tally a:hover { text-decoration-color: currentColor; }
.tally-done { color: var(--graphite); }

.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 56px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 8px; border-bottom: 2px solid var(--paper); }
.block-head h2 { font-size: var(--t-md); font-stretch: 108%; letter-spacing: -.005em; }
.more { color: var(--graphite); font-size: var(--t-sm); }
.more:hover { color: var(--paper); }
.projects-block { margin-top: 48px; }

/* ---------- task rows ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.task-check-form { margin: 0; padding-top: 2px; }
.task-check {
  width: 18px; height: 18px; border-radius: 3px; border: 1.5px solid var(--rule-2); background: transparent;
  padding: 0; cursor: pointer; display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.task-check svg { width: 12px; height: 12px; fill: none; stroke: transparent; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.task-check:hover { border-color: var(--paper-2); }
.task-check:hover svg { stroke: var(--graphite); }
.is-done .task-check { background: var(--graphite); border-color: var(--graphite); }
.is-done .task-check svg { stroke: var(--ink); }
.task-row-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 3px 14px; align-items: baseline; justify-content: space-between; }
.task-row-title { min-width: 0; overflow-wrap: anywhere; }
.task-row-main:hover .task-row-title { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.is-done .task-row-title { color: var(--graphite); text-decoration: line-through; }
.task-row-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: var(--t-sm); }

/* ---------- project rows ---------- */
.project-rows { list-style: none; margin: 0; padding: 0; }
.project-row > a {
  display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px 120px; gap: 6px 28px; align-items: baseline;
  padding: 16px 0 16px 18px; border-bottom: 1px solid var(--rule); position: relative;
}
.project-row > a::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 1px; background: var(--c); }
.project-row-name { font-size: var(--t-md); font-weight: 750; font-stretch: 118%; letter-spacing: -.01em; }
.project-row > a:hover .project-row-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--c); }
.project-row-desc { color: var(--paper-2); min-width: 0; }
.project-row-counts { display: flex; gap: 14px; font-size: var(--t-sm); white-space: nowrap; }
.coverage { align-self: center; height: 6px; background: var(--rule); border-radius: 1px; overflow: hidden; }
.coverage span { display: block; height: 100%; background: var(--c); }

/* ---------- board ---------- */
.board-tools { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 3px; }
.seg a { padding: 4px 12px; color: var(--graphite); font-weight: 600; font-size: var(--t-sm); }
.seg a + a { border-left: 1px solid var(--rule-2); }
.seg a.active { color: var(--paper); background: var(--plate); }
.board { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(250px, 1fr)); gap: 22px; align-items: start; overflow-x: auto; }
.column { display: flex; flex-direction: column; gap: 8px; border-top: 5px solid var(--paper-2); padding-top: 10px; }
.col-doing { border-top-color: var(--cyan); }
.col-done { border-top-color: var(--graphite); }
.column-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 4px; }
.column-head h2 { font-size: var(--t-lg); font-stretch: 72%; font-weight: 750; letter-spacing: -.01em; }
.col-doing .column-head h2 { color: var(--cyan); }
.col-done .column-head h2 { color: var(--graphite); }
.column-head .count { font-size: var(--t-base); }
.quick-add input { background: transparent; border: 1px dashed var(--rule-2); padding: 8px 10px; }
.quick-add input:focus { border-style: solid; background: var(--ink); }
.cards { display: flex; flex-direction: column; gap: 6px; min-height: 72px; padding-bottom: 24px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  background: var(--plate); border-radius: 4px; cursor: grab; user-select: none; -webkit-user-select: none;
}
.card:hover { background: var(--plate-2); }
.card.prio-high::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: var(--magenta); }
.card-title { overflow-wrap: anywhere; line-height: 1.4; }
.col-done .card { background: transparent; border: 1px solid var(--rule); }
.col-done .card-title { color: var(--graphite); text-decoration: line-through; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); }
.card-meta:empty { display: none; }
.card-meta .avatar { margin-left: auto; }
.card-icon { display: inline-flex; align-items: center; gap: 3px; color: var(--graphite); }
.card-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.board-foot { margin-top: 4px; }
.board-foot a { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.card.sortable-ghost { opacity: .4; outline: 1px dashed var(--paper-2); }
.card.sortable-drag { background: var(--plate-2); box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
.more-link { font-size: var(--t-sm); color: var(--graphite); }
.more-link:hover { color: var(--paper); }

/* ---------- task + note editing ---------- */
.task-form { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 36px; align-items: start; }
.task-form-side { position: sticky; top: 24px; }
.task-form-side > * + * { margin-top: 14px; }
input.title-input, textarea.title-input {
  font-size: var(--t-xl) !important; font-weight: 750; font-stretch: 112%; letter-spacing: -.015em;
  background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--rule) !important;
  border-radius: 0 !important; padding: 4px 0 10px !important; margin-bottom: 18px; box-shadow: none !important;
}
input.title-input:focus, textarea.title-input:focus { border-bottom-color: var(--yellow) !important; }
.md-field { border: 1px solid var(--rule-2); border-radius: 4px; overflow: hidden; }
.md-field textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 260px; padding: 14px 16px; max-width: 100%; }
.md-tabs { display: flex; gap: 2px; align-items: center; padding: 5px; border-bottom: 1px solid var(--rule); background: var(--plate); }
.md-tabs button { background: none; border: 0; color: var(--graphite); font: inherit; font-weight: 600; font-size: var(--t-sm); padding: 4px 10px; border-radius: 3px; cursor: pointer; }
.md-tabs button.active { background: var(--ink); color: var(--paper); }
.md-tabs .muted { margin-left: auto; padding-right: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.md-preview { padding: 14px 18px; min-height: 260px; }
.meta-list { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); font-size: var(--t-sm); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; color: var(--graphite); }
.meta-list dt { font-weight: 600; }
.meta-list dd { margin: 0; }
.note-form .form-actions { justify-content: flex-start; }
.note-view { max-width: 72ch; }

.md { line-height: 1.65; overflow-wrap: anywhere; max-width: 72ch; }
.md > :first-child { margin-top: 0; }
.md h2 { font-size: var(--t-lg); font-stretch: 110%; margin: 1.5em 0 .5em; }
.md h3 { font-size: var(--t-md); font-stretch: 105%; margin: 1.4em 0 .4em; }
.md h4, .md h5 { font-size: var(--t-base); margin: 1.2em 0 .4em; }
.md p, .md ul, .md ol, .md pre, .md blockquote { margin: 0 0 .9em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .2em 0; }
.md a { text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
.md code { background: var(--plate); padding: 1px 5px; border-radius: 3px; }
.md pre { background: var(--plate); padding: 12px 14px; border-radius: 4px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { padding: 2px 16px; border-left: 3px solid var(--rule-2); color: var(--paper-2); }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6em 0; }
.md .md-check { list-style: none; margin-left: -1.3em; display: flex; gap: 9px; align-items: baseline; }
.md .md-box { width: 15px; height: 15px; border: 1.5px solid var(--rule-2); border-radius: 3px; display: inline-grid; place-items: center; font-size: .68rem; flex: none; transform: translateY(2px); }
.md .is-done { color: var(--graphite); text-decoration: line-through; }
.md .is-done .md-box { background: var(--graphite); border-color: var(--graphite); color: var(--ink); }

.toolbar { margin-bottom: 20px; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; }
.note-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 0; border-top: 2px solid var(--rule); }
.note-card:hover { border-top-color: var(--paper-2); }
.note-card-title { font-weight: 700; font-size: var(--t-md); font-stretch: 106%; }
.note-card-body { color: var(--paper-2); }
.note-card-meta { color: var(--graphite); font-size: var(--t-sm); margin-top: auto; }
.pin { color: var(--yellow-text); }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.link-main { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; }
.link-glyph { width: 24px; height: 24px; border-radius: 3px; background: var(--plate-2); display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--paper-2); flex: none; align-self: center; }
.link-label { font-weight: 650; }
.link-url { color: var(--graphite); font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.link-main:hover .link-label { text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
.link-edit summary { list-style: none; }
.link-edit summary::-webkit-details-marker { display: none; }
.link-edit[open] { flex-basis: 100%; }
.link-edit[open] .inline-form { margin: 10px 0 6px; }

.member-list { list-style: none; padding: 0; margin: 14px 0 18px; }
.member-list li { padding: 9px 0; border-bottom: 1px solid var(--rule); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; flex: 0 1 auto; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.two-col .panel + .panel { margin-top: 0; }
.two-col > .panel:first-child { background: transparent; padding: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: var(--t-sm); color: var(--graphite); font-weight: 600; padding: 0 10px 8px 0; border-bottom: 2px solid var(--paper); }
.table td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table td .avatar { vertical-align: middle; margin-right: 6px; }
.table td.right { white-space: nowrap; }
.table td.right > * + * { margin-left: 12px; }

/* ---------- versions ---------- */
.ver {
  display: inline-block; font-size: var(--t-sm); font-weight: 700; line-height: 1.5; padding: 0 6px;
  border-radius: 3px; border: 1px solid var(--rule-2); color: var(--paper-2); font-stretch: 100%; letter-spacing: 0;
}
.ver-live { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.ver-beta { border-color: var(--cyan); color: var(--cyan); }
.ver-development { border-style: dashed; color: var(--graphite); }
.ver-retired { border-color: transparent; color: var(--graphite); padding-left: 0; }
.ver-line { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--paper-2); font-size: var(--t-sm); }
.ver-line span + .ver { margin-left: 10px; }
a.ver:hover { filter: brightness(1.12); }
.project-row-versions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: var(--t-sm); font-weight: 400; font-stretch: 100%; color: var(--graphite); letter-spacing: 0; }
.project-row-versions .ver + .ver, .project-row-versions .ver:not(:first-child) { margin-left: 8px; }
.project-row-name .stage { margin-left: 4px; }

.release-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-bottom: 26px; }
.release-actions > details[open] { flex-basis: 100%; order: 2; }
.release-add { margin: 0; }
.import-form textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; }
.import-warnings { border-left: 3px solid var(--yellow); background: var(--yellow-wash); padding: 10px 14px; border-radius: 4px; margin-bottom: 22px; max-width: 80ch; }
.import-warnings p + p { margin-top: 6px; }
.import-confirm { max-width: 720px; margin-bottom: 28px; }
.import-confirm > * + * { margin-top: 14px; }
.import-list .release-main { cursor: pointer; list-style: none; }
.import-list .release-main::-webkit-details-marker { display: none; }
.import-gist { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-list .is-dup { opacity: .55; }
.import-list details[open] .import-gist { visibility: hidden; }
.release-add > summary { list-style: none; display: inline-flex; }
.release-add > summary::-webkit-details-marker { display: none; }
.release-add[open] > summary { margin-bottom: 16px; }
.release-form { max-width: 640px; }
.release-form > * + * { margin-top: 14px; }
.release-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.release-group + .release-group { margin-top: 28px; }
.release-group-head { font-size: var(--t-md); font-stretch: 108%; padding-bottom: 8px; border-bottom: 2px solid var(--paper); }
.release-list { list-style: none; margin: 0; padding: 0; }
.release { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.release-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.release-main .ver { font-size: var(--t-base); padding: 1px 8px; }
.release-promote { display: inline-flex; gap: 14px; margin-left: auto; }
.release-notes { margin-top: 8px; font-size: var(--t-base); color: var(--paper-2); }
.release-notes > :last-child { margin-bottom: 0; }
.release .link-edit { margin-top: 6px; }
.release .link-edit[open] .release-form { margin: 12px 0; }
@media (max-width: 860px) {
  .release-fields { grid-template-columns: 1fr; }
  .release-promote { margin-left: 0; }
}

/* ---------- footer + changelog ---------- */
.app-footer { display: flex; gap: 8px; align-items: baseline; margin-top: 64px; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--graphite); font-size: var(--t-sm); }
.app-footer a { color: var(--paper-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.app-footer a:hover { color: var(--paper); text-decoration-color: currentColor; }
.no-nav .app-footer { justify-content: center; border-top: 0; margin-top: 0; }
.changelog { max-width: 72ch; }
.changelog-entry { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.changelog-entry .release-main { margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1150px) {
  .project-row > a { grid-template-columns: 1fr auto; }
  .project-row-desc { grid-column: 1 / -1; grid-row: 2; }
  .project-row-counts { grid-row: 1; grid-column: 2; }
  .coverage { grid-column: 1 / -1; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .lists { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .has-nav .main { margin-left: 0; padding: 76px 18px 56px; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: fixed; inset: 0 0 auto; height: 56px;
    padding: 0 12px; padding-top: env(safe-area-inset-top); background: var(--ink); border-bottom: 1px solid var(--rule); z-index: 20;
  }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .nextup-date { margin-bottom: 18px; }
  .project-row > a { grid-template-columns: 1fr; }
  .project-row-counts { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .board {
    grid-template-columns: repeat(var(--cols, 3), 82vw); overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -18px; padding: 0 18px 8px; scroll-padding: 18px;
  }
  .column { scroll-snap-align: start; }
  .task-form { grid-template-columns: 1fr; gap: 22px; }
  .task-form-side { position: static; }
  .form-row { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

.release-more { margin-top: 4px; }
.release-more > summary { list-style: none; display: inline; }
.release-more > summary::-webkit-details-marker { display: none; }
.release-more[open] > summary { display: none; }
.md ul ul, .md ol ul, .md ul ol { margin: .2em 0 .3em; }
.md h4 { font-size: var(--t-base); margin: 1em 0 .35em; }
.release-notes > h4:first-child { margin-top: 0; }

.backup-block { max-width: 760px; margin-bottom: 36px; }
.backup-block > * + * { margin-top: 14px; }
.backup-text { max-width: 72ch; color: var(--paper-2); }
.copy-field { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.copy-field code { flex: 1 1 320px; min-width: 0; background: var(--plate); padding: 8px 10px; border-radius: 3px; overflow-x: auto; white-space: nowrap; }
.backup-table td:first-child { overflow-wrap: anywhere; }

.ver-sm { font-size: .72rem; padding: 0 5px; }
.ver-filter select { width: auto; padding: 4px 8px; font-size: var(--t-sm); }
.field-hint { display: block; margin-top: 6px; font-weight: 400; }
.release-tasks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 8px; font-size: var(--t-sm); }
.release-progress { display: inline-flex; align-items: center; gap: 10px; color: var(--paper-2); }
.release-progress .coverage { width: 120px; }
.release-progress:hover { color: var(--paper); }
.release-tasks .release-more { flex-basis: 100%; margin-top: 0; }
.release-tasks .release-more[open] > summary { display: inline; }
.release-task-list { list-style: none; margin: 6px 0 0; padding: 0; }
.release-task-list li { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; }
.release-task-list li.is-done a { color: var(--graphite); text-decoration: line-through; }
.release-task-list a:hover { text-decoration: underline; }

.release-tools { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 8px; }
.release-tools .link-edit { margin-top: 0; }
.release-tools .link-edit[open] { flex-basis: 100%; }
.link-btn.is-copied, .btn.is-copied { color: var(--cyan); }

.column-list { list-style: none; padding: 0; margin: 0 0 24px; max-width: 860px; }
.column-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 0 12px 16px; border-bottom: 1px solid var(--rule); border-left: 4px solid var(--paper-2); }
.column-row.col-doing { border-left-color: var(--cyan); }
.column-row.col-done { border-left-color: var(--graphite); }
.column-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 420px; }
.column-edit input[type=text] { flex: 1 1 180px; width: auto; font-weight: 650; }
.column-kind { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--t-sm); }
.column-kind select, .column-add select, .column-delete select { width: auto; margin-top: 0; }
.column-order { display: inline-flex; gap: 2px; }
.column-order .icon-btn:disabled { opacity: .3; cursor: default; }
.column-delete[open] { flex-basis: 100%; }
.column-delete .inline-form { margin: 10px 0 0; align-items: center; }
.column-add { max-width: 860px; align-items: center; }

.comments { max-width: 760px; margin-top: 36px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-body { padding-left: 32px; }
.comment-body > :last-child { margin-bottom: 0; }
.comment-tools { display: flex; gap: 16px; align-items: baseline; padding-left: 32px; margin-top: 4px; }
.comment-tools .link-edit[open] { flex-basis: 100%; }
.comment-form { margin-top: 14px; }
.comment-form .form-actions { margin-top: 10px; }

.nav-search { padding: 0 2px 16px; }
.nav-search input { padding: 6px 10px; font-size: var(--t-sm); background: var(--plate); border-color: transparent; }
.search-big { display: flex; gap: 8px; max-width: 640px; margin-bottom: 22px; }
.search-big input { flex: 1; }
.search-section { max-width: 820px; margin-bottom: 30px; }
.search-list { list-style: none; margin: 0; padding: 0; }
.search-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.search-title { font-weight: 600; }
.search-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.search-title.is-done { color: var(--graphite); text-decoration: line-through; }
.search-snippet { flex-basis: 100%; color: var(--paper-2); font-size: var(--t-sm); }
mark { background: var(--yellow-wash); color: var(--paper); border-radius: 2px; padding: 0 1px; box-shadow: inset 0 -2px 0 var(--yellow); }

.auth-title { font-size: var(--t-lg); font-stretch: 108%; }
.auth-card .link-btn { display: inline-block; }
.mail-settings { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); }
.mail-settings > * + * { margin-top: 10px; }
.mail-settings h2 { font-size: var(--t-md); font-stretch: 108%; }
.mail-settings code { overflow-wrap: anywhere; }
.copy-group { display: inline-flex; gap: 10px; align-items: baseline; color: var(--graphite); font-size: var(--t-sm); }
.column-delete > summary { list-style: none; cursor: pointer; }
.column-delete > summary::-webkit-details-marker { display: none; }

/* ---------- v1.7.1 clarity pass ---------- */
.dash-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 36px 56px; align-items: start; }
.block-head .seg { align-self: center; }
.group-head { font-size: var(--t-sm); font-weight: 650; color: var(--paper-2); margin: 18px 0 2px; display: flex; gap: 8px; align-items: baseline; }
.group-head.due-overdue { color: var(--magenta); }
.more-line { margin-top: 12px; }
.welcome { max-width: 760px; padding-bottom: 24px; }
.welcome .nextup-title { margin-bottom: 22px; }
.welcome-steps { margin: 0 0 26px; padding-left: 1.4em; color: var(--paper-2); font-size: var(--t-md); line-height: 1.6; }
.welcome-steps li + li { margin-top: 8px; }
.welcome-steps strong { color: var(--paper); }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.ver-pair { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.project-row-versions .ver-pair + .ver-pair, .project-row-versions .stage + .ver-pair { margin-left: 8px; }
.project-row-versions .stage { margin-left: 0; }
.project-head .ver-line { margin-top: 12px; }
.ver-line .status-note { margin-left: 10px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: baseline; font-weight: 400; color: var(--paper); cursor: pointer; }
.choice input { accent-color: var(--yellow); margin: 0; transform: translateY(2px); }
.choice strong { font-weight: 650; }
.btn-sm { padding: 4px 10px; font-size: var(--t-sm); }
.release-main { align-items: center; }
.release-actions-right { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.release-actions-right form { display: inline-flex; gap: 6px; }
.release-tools { gap: 6px 14px; }
.release-edit { margin-top: 12px; padding: 14px 16px; background: var(--plate); border-radius: 4px; }
.release-edit > * + * { margin-top: 12px; }
.release-tasks { margin-top: 6px; }
@media (max-width: 860px) { .release-actions-right { margin-left: 0; flex-basis: 100%; } }

.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "main side" "comments side" "danger side"; gap: 0 36px; align-items: start; }
.task-layout .task-main { grid-area: main; display: block; }
.task-layout .task-form-side { grid-area: side; }
.task-layout .comments { grid-area: comments; max-width: none; margin-top: 30px; }
.task-layout .danger-zone { grid-area: danger; }
textarea.title-input { resize: none; overflow: hidden; line-height: 1.2; min-height: 0; }
.md-field textarea[data-autogrow] { min-height: 180px; overflow: hidden; resize: none; }
@media (max-width: 860px) {
  .task-layout { grid-template-columns: 1fr; grid-template-areas: "main" "side" "comments" "danger"; }
  .task-layout .task-form-side { margin-top: 22px; }
  textarea.title-input { font-size: var(--t-lg) !important; }
}
.nav-foot .nav-label { padding-top: 2px; }
.nav-sep { border: 0; border-top: 1px solid var(--rule); margin: 10px 0; }

/* Waiting for review: yellow outline — it needs your attention when it comes back */
.ver-review { border-color: var(--yellow); color: var(--yellow-text); }
.stage-review { border-color: var(--yellow); color: var(--yellow-text); }
.review-wait { color: var(--yellow-text); }
.btn-approve { border-color: var(--paper-2); }
.review-list { list-style: none; margin: 0 0 26px; padding: 0; }
.review-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.review-list a.review-proj { font-weight: 600; }
.review-list .review-wait { font-size: var(--t-sm); }
@media (max-width: 860px) { .release-actions-right > .btn-ghost:first-child { padding-left: 0; } }

/* ---------- roadmap ---------- */
.rm-import { max-width: 760px; }
.rm-import-title { font-size: var(--t-lg); font-stretch: 108%; margin-bottom: 8px; }
.rm-import .lede { margin-bottom: 18px; }
.rm-import-form textarea { font-size: .85rem; }
.rm-or { margin: 4px 0 -4px; }
.rm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; grid-template-areas: "doc rail"; gap: 0 44px; align-items: start; padding-bottom: 90px; }
.rm-doc { grid-area: doc; max-width: 78ch; }
.rm-rail { grid-area: rail; position: sticky; top: 24px; font-size: var(--t-sm); }
.rm-summary { font-size: var(--t-base); margin-bottom: 14px; }
.rm-toc { list-style: none; margin: 0 0 16px; padding: 0; border-top: 2px solid var(--paper); }
.rm-toc li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 4px; }
.rm-toc a { font-weight: 600; color: var(--paper); }
.rm-toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rm-toc .coverage { height: 4px; }
.rm-toc .coverage span { background: var(--cyan); }
.rm-meta { margin-bottom: 10px; }
.rm-section { scroll-margin-top: 20px; }
.rm-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 2em 0 .6em; padding-bottom: 6px; border-bottom: 2px solid var(--paper); }
.rm-section-head h2 { margin: 0; font-size: var(--t-lg); font-stretch: 110%; flex: 1 1 auto; }
.rm-count { color: var(--graphite); font-size: var(--t-sm); }
.rm-doc .md-table-wrap { margin: 0 0 1em; }
.md-table-wrap { overflow-x: auto; }
.md-table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
.md-table th { text-align: left; color: var(--graphite); font-weight: 600; padding: 6px 12px 6px 0; border-bottom: 2px solid var(--rule-2); }
.md-table td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.rm-items { list-style: none; padding: 0; margin: 0 0 1em; }
.rm-item { display: flex; align-items: baseline; gap: 10px; padding: 6px 0 6px calc(var(--lvl, 0) * 22px); border-bottom: 1px solid var(--rule); }
.rm-item:last-child { border-bottom: 0; }
.rm-pick { display: flex; align-items: baseline; gap: 10px; font-weight: 400; color: var(--paper); cursor: pointer; flex: 1; }
.rm-pick input { width: 16px; height: 16px; accent-color: var(--yellow); margin: 0; flex: none; transform: translateY(3px); }
.rm-pick:hover .rm-text { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.rm-mark { width: 16px; flex: none; text-align: center; color: var(--cyan); font-weight: 700; }
.rm-item.is-done .rm-mark { color: var(--graphite); }
.rm-text { flex: 1; min-width: 0; }
a.rm-text { color: var(--paper); }
a.rm-text:hover { text-decoration: underline; text-underline-offset: 3px; }
.rm-item.is-done .rm-text { color: var(--graphite); text-decoration: line-through; }
.rm-where { flex: none; font-size: var(--t-sm); color: var(--cyan); white-space: nowrap; }
.rm-item.is-done .rm-where { color: var(--graphite); }
.rm-bar {
  position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin: 0 -12px; padding: 12px; background: var(--plate); border-top: 1px solid var(--rule-2); border-radius: 6px 6px 0 0;
}
.rm-bar-count { flex: 1 1 220px; color: var(--paper-2); }
.rm-bar.is-active .rm-bar-count { color: var(--paper); font-weight: 650; }
.rm-bar-field { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); }
.rm-bar-field select { width: auto; margin-top: 0; padding: 5px 8px; }
.rm-bar .btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 1000px) {
  .rm-layout { grid-template-columns: 1fr; grid-template-areas: "rail" "doc"; }
  .rm-rail { position: static; margin-bottom: 10px; }
  .rm-toc { display: none; }
}
@media (max-width: 860px) {
  .rm-where { white-space: normal; flex-basis: 100%; padding-left: 26px; }
  .rm-bar { margin: 0 -18px; border-radius: 0; }
}
.md .rm-items { padding-left: 0; margin-left: 0; }
.md a.rm-text { text-decoration: none; color: var(--paper); }
.md a.rm-text:hover { text-decoration: underline; text-decoration-color: var(--cyan); }
@media (max-width: 860px) { .rm-bar-field { flex: 1 1 140px; } .rm-bar-field select { flex: 1; } .rm-bar .btn { flex: 1 1 100%; } }

/* ---------------------------------------------------------- files (v1.10) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dropzone { position: relative; margin: 0 0 20px; }
.dropzone-label { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px dashed var(--rule-2); border-radius: 6px; cursor: pointer; color: var(--paper-2); transition: border-color .15s, background .15s; }
.dropzone-label svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--yellow-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dropzone-label strong { color: var(--paper); font-weight: 650; }
.dropzone-label:hover, .dropzone.is-drop .dropzone-label, .dropzone-label:focus-within { border-color: var(--yellow); background: var(--yellow-wash); }
.dropzone-label:focus-within { outline: 2px solid var(--yellow); outline-offset: 2px; }
.dropzone.is-busy .dropzone-label { opacity: .6; pointer-events: none; }
.dropzone-status { display: block; margin-top: 6px; }
.dropzone-status:empty { display: none; }
.dropzone-status.is-err { color: var(--magenta); }

.file-list { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--rule); }
.file-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.file-thumb { display: block; width: 52px; height: 52px; border-radius: 4px; overflow: hidden; background: var(--plate-2); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-type { display: flex; align-items: center; justify-content: center; text-decoration: none; border: 1px solid var(--rule-2); background: var(--plate); }
.file-type span { font-size: 11px; font-weight: 750; letter-spacing: .06em; color: var(--paper-2); font-stretch: 85%; }
.file-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-name { color: var(--paper); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.file-name:hover { text-decoration: underline; }
.file-meta a { color: inherit; }
.file-tools { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.file-tools form { margin: 0; }
@media (max-width: 640px) {
  .file-item { grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; }
  .file-thumb { width: 44px; height: 44px; grid-row: span 2; }
  .file-tools { grid-column: 2; flex-wrap: wrap; gap: 4px 14px; }
}
/* Images filter on the Files tab: a contact sheet */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; border-top: 0; }
.file-grid .file-item { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 0; border: 0; }
.file-grid .file-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; grid-row: auto; }
.file-grid .file-thumb img { object-fit: contain; background: var(--plate-2); }
.file-grid .file-tools { flex-wrap: wrap; gap: 4px 12px; }

.attachments { grid-area: files; margin-top: 30px; }
.task-layout { grid-template-areas: "main side" "files side" "comments side" "danger side"; }
@media (max-width: 860px) {
  .task-layout { grid-template-areas: "main" "side" "files" "comments" "danger"; }
}
.attachments .file-list { border-top: 0; margin-bottom: 12px; }
.attachments .dropzone { margin: 12px 0 0; }

/* Uploads inside Markdown fields */
.md-tabs .md-attach { margin-left: 6px; font-size: var(--t-sm); }
.comment-form .form-actions .md-attach { margin-right: auto; }
textarea.is-drop { outline: 2px dashed var(--yellow); outline-offset: -4px; background: var(--yellow-wash); }
.upload-msg { margin: 6px 0 0; color: var(--magenta); font-size: var(--t-sm); }
.md a.md-img { display: inline-block; max-width: 100%; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; line-height: 0; vertical-align: top; }
.md a.md-img { margin: 4px 8px 4px 0; }
.md a.md-img img { max-width: 100%; max-height: min(70vh, 560px); height: auto; display: block; }
/* Images on consecutive lines sit side by side, like a contact sheet */
.md p:has(> a.md-img) br { display: none; }
.md a.md-file { display: inline-flex; align-items: center; gap: 5px; }
.md a.md-file::before { content: ""; width: 12px; height: 12px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.5 4.5 5.8 9.2a1.3 1.3 0 0 0 1.9 1.9l5-5a2.6 2.6 0 0 0-3.7-3.7l-5 5a3.9 3.9 0 0 0 5.5 5.5l4-4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.5 4.5 5.8 9.2a1.3 1.3 0 0 0 1.9 1.9l5-5a2.6 2.6 0 0 0-3.7-3.7l-5 5a3.9 3.9 0 0 0 5.5 5.5l4-4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ------------------------------------------- account, backups (v1.11) */
.account-block { max-width: 760px; margin-bottom: 40px; }
.account-block > * + * { margin-top: 14px; }
.account-block .narrow { max-width: 600px; }
.note-warn { color: var(--magenta); }
.note-ok { color: var(--paper-2); }
.device-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: 600px; }
.device-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.device-list li form { margin-left: auto; }
.backup-settings { max-width: 600px; }
.field-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-card .check { margin-top: 2px; }

/* Home-screen app: keep clear of the iPhone status bar and notch */
@media (max-width: 860px) {
  .topbar { height: calc(56px + env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .has-nav .main { padding-top: calc(76px + env(safe-area-inset-top)); padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .sidebar { padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
.no-nav .main { padding-top: max(24px, env(safe-area-inset-top)); }
/* The status bar text is white in the home-screen app; give it a dark strip in the light theme */
[data-theme="light"] body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top); background: #181c25; z-index: 50; pointer-events: none; }
