/* Task Culture: the design system (docs/design/web-redesign). Tokens
   first, then components, then screens. */

@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url(/static/fonts-roboto-400.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url(/static/fonts-roboto-500.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 600 700; font-display: swap; src: url(/static/fonts-roboto-700.woff2) format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-weight: 400; font-display: swap; src: url(/static/fonts-roboto-mono-400.woff2) format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-weight: 500; font-display: swap; src: url(/static/fonts-roboto-mono-500.woff2) format("woff2"); }

:root {
  --tint-sage: #dde6d5; --tint-mint: #d3e6de; --tint-sky: #d6e2ee; --tint-lavender: #e0ddee;
  --tint-blush: #eedcde; --tint-peach: #f0e0d1; --tint-sand: #ebe3cd; --tint-stone: #e0e2e3;
  --tint-ink: #2b2419; --tint-ink-2: #4a3f31; --tint-bar: rgba(43, 36, 25, .25); --tint-chip: rgba(43, 36, 25, .09);
  --mk-indigo: #273469; --mk-slate: #3f6496; --mk-teal: #2a6e6c; --mk-sage: #456c48; --mk-olive: #66672c;
  --mk-ochre: #8f621d; --mk-terracotta: #a44a33; --mk-rose: #9c3f62; --mk-plum: #634283; --mk-graphite: #48505a;
  --bg: #dce1e4;
  --surface: #f8fafb;
  --surface2: #f0f3f5;
  --sunken: #d2d8dc;
  --colbg: #d0d6da;
  --line: #c5ccd1;
  --line-strong: #9da6ad;
  --text: #1d2226;
  --muted: #4f5860;
  --accent: #273469;
  --accent-hover: #1c2652;
  --accent-text: #ffffff;
  --accent-soft: #d5dbee;
  --danger: #a3352c;
  --danger-hover: #86291f;
  --danger-text: #ffffff;
  --warn: #8f621d;
  --ok: #2f6b3a;
  --ok-soft: #d8eadb;
  --chip: rgba(31, 36, 32, .07);
  --toast-bg: #1d2226;
  --toast-fg: #ffffff;
  --c-sage: #dde6d5;
  --c-mint: #d3e6de;
  --c-sky: #d6e2ee;
  --c-lavender: #e0ddee;
  --c-blush: #eedcde;
  --c-peach: #f0e0d1;
  --c-sand: #ebe3cd;
  --c-stone: #e0e2e3;
  --mk-indigo: #273469;
  --mk-graphite: #48505a;
  --shadow: 0 1px 2px rgba(20, 26, 32, .08), 0 0 0 .5px rgba(20, 26, 32, .04);
  --shadow-lift: 0 2px 4px rgba(20, 26, 32, .10), 0 10px 24px rgba(20, 26, 32, .10);
  --shadow-dialog: 0 2px 6px rgba(0, 0, 0, .08), 0 24px 64px rgba(12, 16, 28, .28);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --tint-sage: #2f4840; --tint-mint: #284a4a; --tint-sky: #2d4b6c; --tint-lavender: #3c4168;
  --tint-blush: #4c3c52; --tint-peach: #4e4246; --tint-sand: #48493f; --tint-stone: #38475b;
  --tint-ink: #e6ecf3; --tint-ink-2: #a9b6c6; --tint-bar: rgba(230, 236, 243, .28); --tint-chip: rgba(230, 236, 243, .12);
  --mk-indigo: #3e4c94; --mk-graphite: #56606b;
  --bg: #233449;
  --surface: #2c3e55;
  --surface2: #31445c;
  --sunken: #1d2c3e;
  --colbg: #1d2b3d;
  --line: #3a4d66;
  --line-strong: #566b86;
  --text: #e6ecf3;
  --muted: #a9b6c6;
  --accent: #a9b6ea;
  --accent-hover: #c4cdf2;
  --accent-text: #141a36;
  --accent-soft: #3b4c85;
  --danger: #e8968c;
  --danger-hover: #f0b1a9;
  --danger-text: #1a0e0c;
  --warn: #e2bd7a;
  --ok: #8fc79a;
  --ok-soft: #2c4a3c;
  --chip: rgba(255, 255, 255, .08);
  --toast-bg: #e6ecf3;
  --toast-fg: #141a36;
  --c-sage: #2f4840;
  --c-mint: #284a4a;
  --c-sky: #2d4b6c;
  --c-lavender: #3c4168;
  --c-blush: #4c3c52;
  --c-peach: #4e4246;
  --c-sand: #48493f;
  --c-stone: #38475b;
  --mk-indigo: #3e4c94;
  --mk-graphite: #56606b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 10px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
/* No choice made: as the system says. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --tint-sage: #2f4840; --tint-mint: #284a4a; --tint-sky: #2d4b6c; --tint-lavender: #3c4168;
    --tint-blush: #4c3c52; --tint-peach: #4e4246; --tint-sand: #48493f; --tint-stone: #38475b;
    --tint-ink: #e6ecf3; --tint-ink-2: #a9b6c6; --tint-bar: rgba(230, 236, 243, .28); --tint-chip: rgba(230, 236, 243, .12);
    --mk-indigo: #3e4c94; --mk-graphite: #56606b;
    --bg: #233449;
    --surface: #2c3e55;
    --surface2: #31445c;
    --sunken: #1d2c3e;
    --colbg: #1d2b3d;
    --line: #3a4d66;
    --line-strong: #566b86;
    --text: #e6ecf3;
    --muted: #a9b6c6;
    --accent: #a9b6ea;
    --accent-hover: #c4cdf2;
    --accent-text: #141a36;
    --accent-soft: #3b4c85;
    --danger: #e8968c;
    --danger-hover: #f0b1a9;
    --danger-text: #1a0e0c;
    --warn: #e2bd7a;
    --ok: #8fc79a;
    --ok-soft: #2c4a3c;
    --chip: rgba(255, 255, 255, .08);
    --toast-bg: #e6ecf3;
    --toast-fg: #141a36;
    --c-sage: #2f4840;
    --c-mint: #284a4a;
    --c-sky: #2d4b6c;
    --c-lavender: #3c4168;
    --c-blush: #4c3c52;
    --c-peach: #4e4246;
    --c-sand: #48493f;
    --c-stone: #38475b;
    --mk-indigo: #3e4c94;
    --mk-graphite: #56606b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 10px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="light"] { color-scheme: light; }

/* ---- Base ---- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
.mono, code, kbd { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.i { flex: none; }

/* ---- App bar, brand, breadcrumbs, navigation (Board, Settings, Projects) ---- */
.app-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .i { color: var(--accent); }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; }
a.crumb-link { display: inline-flex; align-items: center; height: 34px; padding: 0 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
a.crumb-link:hover { color: var(--text); background: var(--sunken); }
.crumb-sep { color: var(--line-strong); font-size: 16px; }
a.navlink { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
a.navlink:hover, a.navlink.active { color: var(--text); background: var(--sunken); }
.proj-switch { position: relative; }
.proj-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.proj-btn:hover, .proj-btn[aria-expanded="true"] { background: var(--sunken); }
.proj-key { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--sunken); color: var(--muted); font-size: 11px; font-weight: 500; flex: none; }
.proj-btn:hover .proj-key, .proj-btn[aria-expanded="true"] .proj-key { background: var(--surface); }
.proj-catcher, .click-catcher, .cal-catcher { position: fixed; inset: 0; z-index: 40; border: 0; padding: 0; background: transparent; cursor: default; }
.proj-menu { position: absolute; top: 42px; left: 0; z-index: 41; width: 300px; padding: 8px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-dialog); display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.proj-head { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
a.proj-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 8px; border-radius: 9px; color: var(--text); text-decoration: none; }
a.proj-item:hover, a.proj-item:focus-visible { background: var(--sunken); outline: none; color: var(--text); }
a.proj-item.is-current { font-weight: 600; }
.proj-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.tb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-label { flex: none; width: 72px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side { display: flex; flex-direction: column; gap: 2px; }
a.side-link { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; }
a.side-link:hover { background: var(--surface); color: var(--text); }
a.side-link.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20, 26, 32, .08); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--sunken); color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-primary, a.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover, a.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--danger-text); }
.btn-danger-outline { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger-outline:hover { background: var(--sunken); color: var(--danger); }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--sunken); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn.added { background: var(--accent-soft); border-color: transparent; }
.btn.added .hover-only { display: none; }
.btn.added:hover .hover-only, .btn.added:focus-visible .hover-only { display: inline-flex; align-items: center; gap: 6px; }
.btn.added:hover .rest-only, .btn.added:focus-visible .rest-only { display: none; }
.rest-only { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 0; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--sunken); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; }
.link-btn:hover { background: var(--surface2); }
.add-task { display: flex; align-items: center; gap: 6px; margin: 0 8px 8px; height: 34px; padding: 0 8px; border: 1px dashed transparent; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; flex: none; }
.add-task:hover { background: var(--surface); border-color: var(--line-strong); color: var(--text); }

/* ---- Form fields ---- */
.input { height: 38px; width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.input.sm { height: 32px; font-size: 13px; }
.input:disabled { background: var(--sunken); color: var(--muted); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.err { margin: 6px 0 0; font-size: 13px; color: var(--danger); }
.check { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; flex: none; cursor: pointer; }
.check:disabled { cursor: not-allowed; }
.date-btn { display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; }
.date-btn.empty { color: var(--muted); }
.st-ok { color: var(--ok); }
.st-muted { color: var(--muted); }

/* ---- Surfaces ---- */
.panel { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.savebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; border-radius: 14px; background: var(--surface2); }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--ok-soft); color: var(--text); }
.notice.ok { background: var(--ok-soft); }
.notice.warn { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); }
.notice.danger { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
.section-title { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.preview-well { padding: 10px; border-radius: 14px; background: var(--sunken); }
.sq-card { border-radius: 12px; box-shadow: 0 1px 2px rgba(20, 26, 32, .10), 0 0 0 .5px rgba(20, 26, 32, .04); }
:root[data-theme="dark"] .sq-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.token { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface2); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* ---- Small things: chip, key, tag, pill, badge, avatar, count ---- */
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--chip); font-size: 12px; color: var(--text); white-space: nowrap; }
.key { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--sunken); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--accent-soft); color: var(--text); font-size: 12px; font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; }
.kind { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--sunken); color: var(--muted); font-size: 11px; font-weight: 500; flex: none; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--accent-soft); color: var(--text); }
.badge.type { gap: 5px; background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--text); font-size: 12px; font-weight: 600; flex: none; text-decoration: none; }
a.avatar, a.avatar:hover { color: var(--text); }
.avatar.llm { border-radius: 9px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line-strong); }
.avatar.group { border-radius: 9px; background: var(--accent); color: var(--accent-text); }
.avatar.current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--sunken); font-size: 12px; font-weight: 500; color: var(--muted); flex: none; white-space: nowrap; }
.handle { font-family: var(--mono); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Segmented control ---- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunken); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20, 26, 32, .12); }
.seg .n { font-size: 12px; opacity: .75; }

/* ---- Tabs ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface2); }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .center { text-align: center; }

/* ---- Lists and rows (project members) ---- */
.list-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 10px; }
.list-head span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 12px; }
.row:hover { background: var(--surface2); }
.row.is-added { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Steps ---- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.step { display: inline-flex; align-items: center; gap: 8px; }
.step-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 600; }
.step.done .step-dot { background: var(--accent-soft); color: var(--accent); }
.step.current { color: var(--text); font-weight: 600; }
.step.current .step-dot { background: var(--accent); color: var(--accent-text); }
.step-sep { width: 28px; height: 1px; background: var(--line-strong); }

/* ---- Dialog, popover, menu, toast ---- */
dialog.dialog { width: min(520px, calc(100% - 32px)); margin: 120px auto auto; padding: 0; border: 0; background: var(--surface); color: var(--text); border-radius: 16px; box-shadow: var(--shadow-dialog); overflow: hidden; }
dialog.dialog.wide { width: min(680px, calc(100% - 32px)); margin-top: 48px; }
dialog#new-task { margin-top: 48px; max-height: calc(100vh - 96px); overflow-y: auto; }
dialog.dialog::backdrop, .backdrop { background: rgba(12, 16, 28, .45); }
.backdrop { position: fixed; inset: 0; z-index: 55; border: 0; padding: 0; cursor: default; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.dialog-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 22px 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 22px; background: var(--surface2); }
.popover { position: absolute; top: 42px; right: 0; z-index: 30; width: 280px; padding: 8px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lift); }
.menu { position: absolute; top: 40px; right: 4px; z-index: 30; min-width: 210px; padding: 4px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lift); display: flex; flex-direction: column; cursor: default; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.menu-item:hover:not(:disabled) { background: var(--sunken); }
.menu-item:disabled { opacity: .45; cursor: not-allowed; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 28px; margin: 0; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--toast-bg); color: var(--toast-fg); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.toast-btn { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.toast-btn:hover { background: rgba(127, 127, 127, .2); }

/* ---- Board (Board artboard) ---- */
.board { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 32px; overflow-x: auto; scroll-behavior: smooth; scroll-padding-inline: 20px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--line-strong) 55%, transparent) transparent; }
.board:hover { scrollbar-color: var(--line-strong) transparent; }
.col-body { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.col-body:hover { scrollbar-color: var(--line-strong) transparent; }
.col { position: relative; flex: none; width: 284px; display: flex; flex-direction: column; background: var(--colbg); border-radius: 14px; max-height: 780px; }
.col.col-collapsed { width: 46px; }
.col.col-dragging { opacity: .4; }
.col.col-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.drop-slot { flex: none; height: 46px; border-radius: 12px; border: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drop-tail { flex: 1 0 24px; }
.col-head { position: relative; display: flex; align-items: center; gap: 2px; padding: 6px 4px 6px 2px; cursor: grab; }
.col-title { margin: 0 4px 0 2px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-head .count { background: var(--surface); }
.col-body { display: flex; flex-direction: column; gap: 8px; padding: 8px; overflow-y: auto; min-height: 56px; }
.col-foot { display: flex; gap: 4px; margin: 0 8px 8px; }
.col-foot .add-task { margin: 0; }
.col-foot .add-task:first-child { flex: 1; }
a.card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 0; border-radius: 12px; box-shadow: 0 1px 2px rgba(20, 26, 32, .10), 0 0 0 .5px rgba(20, 26, 32, .04); color: var(--text); text-decoration: none; cursor: grab; transition: box-shadow .15s; }
a.card:hover { box-shadow: 0 2px 4px rgba(20, 26, 32, .10), 0 8px 20px rgba(20, 26, 32, .10); color: var(--text); }
a.card.card-dragging { opacity: .4; }
:root[data-theme="dark"] a.card { box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
:root[data-theme="dark"] a.card:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .45), 0 8px 20px rgba(0, 0, 0, .4); }
.c-none { background: var(--surface); }
.c-sage { background: var(--c-sage); }
.c-mint { background: var(--c-mint); }
.c-sky { background: var(--c-sky); }
.c-lavender { background: var(--c-lavender); }
.c-blush { background: var(--c-blush); }
.c-peach { background: var(--c-peach); }
.c-sand { background: var(--c-sand); }
.c-stone { background: var(--c-stone); }
.meta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars span { display: block; width: 3px; border-radius: 1px; background: var(--line-strong); }
.bars span:nth-child(1) { height: 4px; }
.bars span:nth-child(2) { height: 7px; }
.bars span:nth-child(3) { height: 10px; }
.bars span:nth-child(4) { height: 13px; }
.bars span.on { background: var(--text); }
.prio-urgent { color: var(--danger); font-weight: 600; }
.prio-urgent .bars span.on { background: var(--danger); }
.collapsed-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-radius: 14px; background: transparent; color: var(--text); font: inherit; cursor: pointer; min-height: 240px; }
.collapsed-btn:hover { background: var(--sunken); }
.vert { writing-mode: vertical-rl; font-weight: 600; font-size: 13px; white-space: nowrap; }
.marker { position: relative; flex: none; display: flex; align-items: center; justify-content: center; padding: .75em 38px; border-radius: 12px; color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .02em; text-align: center; cursor: grab; box-shadow: 0 1px 2px rgba(20, 26, 32, .14); }
.marker-title { overflow-wrap: anywhere; }
.marker-x { position: absolute; top: 50%; right: 8px; margin-top: -13px; width: 26px; height: 26px; border: 0; border-radius: 50%; padding: 0; background: rgba(255, 255, 255, .16); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.marker:hover .marker-x, .marker:focus-within .marker-x { opacity: 1; }
.marker-x:hover { background: rgba(255, 255, 255, .3); }
.marker-x:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.marker.card-dragging { opacity: .4; }
.mk-indigo { background: var(--mk-indigo); }
.mk-slate { background: #3f6496; }
.mk-teal { background: #2a6e6c; }
.mk-sage { background: #456c48; }
.mk-olive { background: #66672c; }
.mk-ochre { background: #8f621d; }
.mk-terracotta { background: #a44a33; }
.mk-rose { background: #9c3f62; }
.mk-plum { background: #634283; }
.mk-graphite { background: var(--mk-graphite); }
.marker-form { display: flex; flex-direction: column; gap: 10px; margin: 0 8px 8px; padding: 10px; border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 26, 32, .10); }
.mk-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.mk-sw { width: 24px; height: 24px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; }
.mk-sw.on { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.swatch.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch.none { background: linear-gradient(135deg, transparent 46%, var(--muted) 46% 54%, transparent 54%), var(--surface); }
.imp-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; border: 1.5px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; cursor: pointer; }
.imp-drop:hover, .imp-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--text); }
.imp-file:focus-visible + .imp-drop { outline: 2px solid var(--accent); outline-offset: 2px; }
.imp-filechip { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--surface2); }
.imp-preview { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface2); }
.imp-warn { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--warn); }
.imp-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.imp-rows li { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 4px 8px; border-radius: 8px; background: var(--surface); }
.imp-col-pill { flex: none; min-width: 110px; font-size: 12px; font-weight: 500; color: var(--muted); }
.imp-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Settings: milestones, calendar ---- */
.cal { position: absolute; top: 44px; left: 0; z-index: 41; width: 300px; padding: 12px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-dialog); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow { display: flex; align-items: center; justify-content: center; height: 28px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.cal-day { height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cal-day:hover { background: var(--sunken); }
.cal-day.out { color: var(--muted); opacity: .55; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }
.cal-day.sel { background: var(--accent); color: var(--accent-text); font-weight: 600; box-shadow: none; }
.ms-list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.ms-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; }
.ms-row:hover { background: var(--surface2); }
.ms-row.is-done .ms-name { color: var(--muted); text-decoration: line-through; }
.ms-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.ms-icon.done { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.ms-icon.late { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ms-name { font-weight: 600; }
.ms-when { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 500; }
.ms-when.soon { background: var(--accent-soft); color: var(--text); }
.ms-when.late { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ms-when.done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.ms-done { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.ms-done:hover { background: var(--sunken); color: var(--text); }

/* ---- Task edit: files, thumbnails, lightbox ---- */
.dropzone { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); cursor: pointer; text-align: center; }
.dropzone:hover { border-color: var(--accent); color: var(--text); }
.file-input:focus-visible + .dropzone { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumb, .file-tile { flex: none; width: 72px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--sunken); }
.thumb { padding: 0; border: 0; cursor: zoom-in; box-shadow: 0 0 0 1px rgba(20, 26, 32, .08); transition: transform .15s, box-shadow .15s; }
.thumb:hover { transform: scale(1.04); box-shadow: 0 0 0 1px rgba(20, 26, 32, .08), 0 4px 12px rgba(20, 26, 32, .15); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.file-tile { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 80; align-items: center; justify-content: center; padding: 76px 76px 40px; }
.lightbox:not(dialog) { display: flex; }
.lb-backdrop { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(10, 14, 26, .86); cursor: zoom-out; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 14px 20px; color: #fff; }
.lb-img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: 0 24px 64px rgba(0, 0, 0, .5); }
.lb-btn { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; text-decoration: none; }
a.lb-btn { color: #fff; }
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-prev, .lb-next { position: absolute; top: 50%; margin-top: -20px; width: 44px; height: 44px; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }

/* ---- Task edit: the page ---- */
.narrow-1240 { max-width: 1240px; width: 100%; margin: 0 auto; padding: 20px 20px 64px; box-sizing: border-box; }
#task { display: flex; flex-direction: column; gap: 18px; }
.task-top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crumbs-sm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.crumbs-sm [aria-current] { color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.save-status { font-size: 13px; color: var(--muted); }
.save-status.dirty { color: var(--warn); font-weight: 500; }
.task-notice { flex-direction: column; gap: 8px; }
.task-notice p { margin: 0; }
.task-notice label { display: grid; gap: 4px; width: 100%; font-size: 13px; font-weight: 600; }
.task-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.task-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.task-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.pad-20 { padding: 20px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.task-main > .panel { display: flex; flex-direction: column; gap: 14px; }
textarea.input.title-input { min-height: 44px; font-size: 18px; font-weight: 600; line-height: 1.4; resize: none; overflow: hidden; field-sizing: content; }
.title-read { margin: 0; font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.add-row > .input { flex: 1 1 200px; width: auto; }
.task-main details.edit > summary { font-size: 13px; }
.subtask-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.subtask-list .ref { font-size: 12px; }
.checklists .checklist { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface2); }
.checklist-items .icon-btn { width: 28px; height: 28px; }
.checklist-items li:hover { background: var(--surface); }
.code-links li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: var(--muted); }
.attach { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.attach > .btn { align-self: flex-start; }
.dropzone.over { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.file-names { margin: 6px 0 0; overflow-wrap: anywhere; }
.dropzone .browse { color: var(--accent); text-decoration: underline; }
.tab-seg { align-self: flex-start; }
.seg > a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.seg > a:hover { color: var(--text); }
.seg > a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20, 26, 32, .12); }
.thread .time .total { margin: 0 0 8px; }
.tbl-wrap { overflow-x: auto; }
.row-actions { white-space: nowrap; }
.row-actions details.edit { display: inline-block; }
.log-time { margin-top: 10px; }
.thread .history { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.thread .comments { margin: 0; padding: 0; gap: 16px; }
.comment.card { display: flex; gap: 12px; padding: 0; border: 0; background: transparent; border-radius: 0; aspect-ratio: auto; overflow: visible; box-shadow: none; }
.comment.card .avatar, .composer .avatar { width: 28px; height: 28px; font-size: 11px; }
.comment-body { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.comment-body .card-head { padding-right: 88px; }
.comment-body .card-head strong { color: var(--text); font-weight: 600; font-size: 14px; }
.comment-body > .markdown > :first-child { margin-top: 0; }
.comment-body > .markdown > :last-child { margin-bottom: 0; }
.comment-body > details.edit > summary { position: absolute; top: 0; right: 0; margin: 0; font-size: 12px; }
.comment-body > details.edit[open] > form { margin-top: 8px; }
/* Hide / Unhide: a small link-like button, left of Edit. */
.comment-hide .text-btn { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.comment-hide .text-btn:hover { text-decoration: underline; }
.comment-body > .comment-hide { position: absolute; top: 0; right: 0; }
.comment-body > .comment-hide.beside-edit { right: 40px; }
/* A hidden comment: one muted line; Show unfolds its text. */
.comment.folded { align-items: baseline; padding-left: 40px; font-size: 13px; }
.comment.folded > details { flex: 1; min-width: 0; }
.comment.folded > details > summary { cursor: pointer; }
.comment.folded .show { color: var(--accent); }
.comment.folded > details[open] > .markdown { margin-top: 6px; opacity: .75; }
.thread .file-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 40px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.composer { display: flex; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.composer-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.composer-foot { display: flex; justify-content: flex-end; }
.multi { position: relative; }
.multi > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.multi > summary::-webkit-details-marker { display: none; }
.multi > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-list { position: absolute; top: 42px; left: 0; right: 0; z-index: 30; max-height: 260px; overflow-y: auto; padding: 6px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lift); display: flex; flex-direction: column; }
.multi-list p { margin: 6px 8px; }
.multi-opt { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 8px; border-radius: 8px; cursor: pointer; }
.multi-opt:hover { background: var(--sunken); }
.task-side .seg { display: flex; }
.task-side .seg-opt { flex: 1; }
.task-side .seg-opt span { flex: 1; justify-content: center; }
.task-side .swatches { gap: 10px; padding: 2px; }
.task-side .swatch { width: 28px; height: 28px; border-color: var(--line-strong); }
.task-side .swatch.none { background: var(--surface); }
/* "On the board": the board's card, at the board's card width. */
ul.preview-well { display: flex; justify-content: center; padding: 10px; margin: 0; min-height: 0; overflow: visible; }
.preview-well > li.card { width: min(100%, 268px); }
.preview-card .card-bottom[hidden], .preview-card .module-badge[hidden] { display: none; }
.preview-card > .card-link { box-sizing: border-box; height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: inherit; }
.preview-card .card-title { flex: 1 1 0; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }
.preview-card:has(.chips) .card-title { -webkit-line-clamp: 3; line-clamp: 3; }
.preview-card .chips { flex: none; max-height: 2.4em; overflow: hidden; color: var(--muted); }
.side-fold { padding: 0; }
.side-fold > summary { display: flex; align-items: center; min-height: 56px; padding: 0 20px; cursor: pointer; list-style: none; }
.side-fold > summary::-webkit-details-marker { display: none; }
.side-fold > summary h2::before { content: "▸"; color: var(--muted); font-size: .8em; }
.side-fold[open] > summary h2::before { content: "▾"; }
.fold-body { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 20px; }
.side-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.side-actions form { margin: 0; }
/* The right column's Add group: a button per empty (hidden) panel of the
   main column; a button opens its form on a row of its own. */
.side-add .section-title { margin-bottom: 12px; }
.add-folds { display: flex; flex-wrap: wrap; gap: 8px; }
.add-fold[open] { flex-basis: 100%; }
.add-fold > summary { list-style: none; width: fit-content; }
.add-fold > summary::-webkit-details-marker { display: none; }
.add-fold[open] > summary { background: var(--sunken); }
.add-fold > form { margin-top: 10px; }
dialog.lightbox { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; background: transparent; color: #fff; overflow: hidden; }
dialog.lightbox::backdrop { background: transparent; }
dialog.lightbox[open] { display: flex; }
.lb-top form { margin: 0; }
.lb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lb-title strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-title span, .lb-pos { font-size: 12px; opacity: .8; }
.lb-img { cursor: zoom-out; }
.lb-btn[hidden] { display: none; }
@media (max-width: 600px) {
  .narrow-1240 { padding: 16px 16px 48px; }
  .pad-20 { padding: 16px; }
  .lightbox { padding: 64px 12px 24px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}

/* ---- Account: password meter and requirements ---- */
.meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.meter span { height: 6px; border-radius: 3px; background: var(--sunken); }
.meter.s1 span:nth-child(-n+1) { background: var(--danger); }
.meter.s2 span:nth-child(-n+2) { background: var(--warn); }
.meter.s3 span:nth-child(-n+3) { background: var(--ok); }
.meter.s4 span:nth-child(-n+4) { background: var(--ok); }
.reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.req { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.req.met { color: var(--ok); }
.req .dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; }
.req.met .dot { background: var(--ok); box-shadow: none; color: var(--surface); }

/* ---- Squircle corners where the browser can draw them ---- */
@supports (corner-shape: squircle) {
  .panel, .savebar { corner-shape: squircle; border-radius: 28px; }
  .btn, .input, .icon-btn, .link-btn, a.crumb-link, a.navlink, .proj-btn, a.proj-item, .collapsed-btn, .add-task, .menu-item { corner-shape: squircle; border-radius: 14px; }
  a.side-link { corner-shape: squircle; border-radius: 14px; }
  textarea.input { border-radius: 18px; }
  dialog.dialog { corner-shape: squircle; border-radius: 32px; }
  .popover, .menu { corner-shape: squircle; border-radius: 22px; }
  .proj-menu { corner-shape: squircle; border-radius: 26px; }
  .cal, .toast { corner-shape: squircle; border-radius: 26px; }
  .col { corner-shape: squircle; border-radius: 28px; }
  a.card, li.card, .sq-card { corner-shape: squircle; border-radius: 22px; }
  .marker, .marker-form, .imp-drop, .imp-filechip, .imp-preview, .preview-well { corner-shape: squircle; border-radius: 22px; }
  .drop-slot, .row, .empty, .ms-row, .notice { corner-shape: squircle; border-radius: 22px; }
  .avatar.llm, .avatar.group { corner-shape: squircle; border-radius: 16px; }
  .seg { corner-shape: squircle; border-radius: 18px; }
  .seg button { corner-shape: squircle; border-radius: 13px; }
  .cal-day, .ms-icon, .thumb, .file-tile { corner-shape: squircle; border-radius: 16px; }
  .thumb, .file-tile { border-radius: 18px; }
  .dropzone { corner-shape: squircle; border-radius: 20px; }
}

.bar-sep { width: 1px; height: 22px; background: var(--line); flex: none; }
.bar-fill { flex: 1; }
.project-nav { display: flex; align-items: center; gap: 2px; }
.project-nav .navlink .i { margin-right: 6px; }
.proj-menu input[type="search"] { width: 100%; margin-bottom: 4px; }
a.proj-item.on { font-weight: 600; }
.clock-pill { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px 2px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-variant-numeric: tabular-nums; }
.clock-pill a { color: var(--text); text-decoration: none; }
.clock-pill .clock-time { color: var(--muted); }
.theme-sun { display: none; }
.theme-moon { display: inline-flex; }
:root[data-theme="dark"] .theme-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-sun { display: inline-flex; }
  :root:not([data-theme]) .theme-moon { display: none; }
}
.proj-menu[hidden], .popover[hidden], .menu[hidden] { display: none; }

/* ---- the login page ---- */
.out-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.login-main { display: block; }
.login-page { display: flex; align-items: center; justify-content: center; padding: 24px 16px 96px; min-height: calc(100vh - 62px); }
.login-box { width: 100%; max-width: 380px; display: grid; gap: 24px; }
.login-head { text-align: center; display: grid; justify-items: center; gap: 10px; }
.login-logo { color: var(--accent); display: inline-flex; }
.login-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
.login-head p, .login-foot { margin: 0; color: var(--muted); font-size: 13px; }
.login-form { padding: 24px; display: grid; gap: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 2px; }
.login-go { width: 100%; height: 40px; }
.login-foot { text-align: center; }
@media (max-width: 640px) { .app-bar { padding: 8px 12px; gap: 8px; } .bar-sep { display: none; } .project-nav { order: 5; width: 100%; overflow-x: auto; } }

/* ---- Choose project (Projects artboard) ---- */
.page { display: flex; flex-direction: column; gap: 24px; }
.narrow-1120 { max-width: 1120px; width: 100%; margin: 0 auto; padding: 40px 20px 64px; box-sizing: border-box; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; }
.page-head p { margin: 0; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-tools .search, .search { position: relative; display: block; width: 260px; max-width: 100%; margin: 0; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 34px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
a.project { display: flex; flex-direction: column; gap: 12px; padding: 18px; min-height: 180px; background: var(--surface); border-radius: 14px; color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(20, 26, 32, .08), 0 0 0 .5px rgba(20, 26, 32, .04); transition: box-shadow .15s, transform .15s; }
a.project:hover { color: var(--text); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(20, 26, 32, .10), 0 10px 24px rgba(20, 26, 32, .10); }
a.project[hidden] { display: none; }
:root[data-theme="dark"] a.project { box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
a.project h2 { margin: 0; font-size: 18px; font-weight: 600; }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.project-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.project-foot strong { color: var(--text); }
.avatars { display: inline-flex; padding-left: 6px; }
.avatars .avatar { width: 28px; height: 28px; font-size: 11px; margin-left: -6px; border: 2px solid var(--surface); }
.empty-line { margin: 0; color: var(--muted); }
.empty-line[hidden] { display: none; }
.fold.panel { padding: 0; margin: 0; }
.fold.panel > summary { display: flex; align-items: center; min-height: 52px; padding: 0 18px; cursor: pointer; list-style: none; }
.fold.panel > summary::-webkit-details-marker { display: none; }
.fold.panel > summary h2 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fold.panel > summary h2::before { content: "▸"; color: var(--muted); font-size: .8em; }
.fold.panel[open] > summary h2::before { content: "▾"; }
.fold.panel[open] > summary { margin-bottom: 0; }
.fold.panel > .list, .fold.panel > .empty-line { padding: 0 8px 12px; }
.fold.panel > .empty-line { padding: 0 18px 16px; }
.fold.panel > .project-grid { padding: 0 18px 18px; }
.fold.panel > .project-grid > a.project { background: var(--surface2); }
.task-list .row .prio { flex: none; }
.task-list .row .assignee { font-size: 12px; color: var(--muted); }
.task-list .row .assignee.mine { color: var(--accent); }
.np-grid { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
@media (max-width: 480px) { .np-grid { grid-template-columns: 1fr; } }

/* ---- Carried over from before the redesign: each rule below is still used ---- */
/* The old custom properties, re-pointed to the design's tokens. */
:root {
  --low: var(--line-strong);
  --normal: transparent;
  --high: var(--warn);
  --urgent: var(--danger);
  --drop: var(--accent);
}
form.inline { display: inline; margin: 0; }
button, select, input { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 2px 10px; cursor: pointer; }
input, select { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 8px; }
.members-step .search { width: 100%; margin: 8px 0 16px; }
.sections { display: flex; flex-direction: column; gap: 12px; }
.section.panel { margin: 0; }
.section > summary { gap: 8px; }
.section > summary h2 { flex: 1; min-width: 0; }
.section > summary .count { color: var(--muted); font-weight: 400; font-size: 13px; }
.section > summary .add { margin-left: auto; flex: none; text-decoration: none; padding: 0 8px; }
.section > summary.drop-into { outline: 2px solid var(--drop); outline-offset: -2px; border-radius: 14px; }
.tasks { list-style: none; margin: 0; padding: 0 8px 4px; }
.task { flex-wrap: wrap; gap: 8px 12px; }
.task[draggable="true"] { cursor: grab; }
.task.drop-before { box-shadow: 0 -2px 0 var(--drop); }
.task.drop-after { box-shadow: 0 2px 0 var(--drop); }
.task .mark { width: 4px; align-self: stretch; border-radius: 2px; background: var(--normal); flex: none; }
.task.priority-low .mark { background: var(--low); }
.task.priority-high .mark { background: var(--high); }
.task.priority-urgent .mark { background: var(--urgent); }
.task .ref { color: var(--muted); text-decoration: none; flex: none; font-size: 13px; }
.task .title { flex: 1 1 200px; color: var(--text); text-decoration: none; }
.task .title:hover { text-decoration: underline; }
.task.tinted .title { color: var(--tint-ink); }
.task .assignee { color: var(--muted); font-size: 12px; }
.task .assignee.mine { color: var(--accent); }
.task .actions { display: flex; gap: 6px; align-items: center; }
.add-form { padding: 4px 18px 16px; }
.add-form input[name="title"] { width: 100%; }
main.list-main { max-width: 1100px; margin: 0 auto; padding: 0 20px 32px; }
.list-page { display: flex; flex-direction: column; gap: 16px; }
.list-page .board-head { padding: 16px 0 0; }
.list-page .board-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.list-page .board-head .narrowed { margin: 0; }
@media (max-width: 600px) {
  .task .actions { width: 100%; }
  main.list-main { padding: 0 12px 24px; }
}
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 4px; }
.muted { color: var(--muted); }
textarea { font: inherit; color: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 6px 8px; width: 100%; }
.facts { color: var(--muted); }
.markdown { overflow-wrap: anywhere; }
.markdown a { text-decoration: underline; text-underline-offset: 2px; }
.markdown a:not([href]) { color: var(--accent); text-decoration-style: dashed; cursor: default; }
.markdown code { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: .9em; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.markdown pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.markdown pre { overflow-x: auto; background: var(--bg); padding: 8px; border-radius: 6px; }
.markdown table { border-collapse: collapse; }
.markdown li:has(> .md-check:first-child), .markdown li:has(> p:first-child > .md-check:first-child) { list-style: none; }
.markdown ul:has(> li > .md-check:first-child), .markdown ul:has(> li > p:first-child > .md-check:first-child) { padding-left: 1.2em; }
.md-check { display: inline-block; box-sizing: border-box; width: 14px; height: 14px; margin: 0 6px 0 -2px; vertical-align: -2px; border: 1.5px solid var(--line-strong); border-radius: 4px; background: var(--surface); }
.md-check.done { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.markdown td, .markdown th { border: 1px solid var(--line); padding: 2px 6px; }
details.edit > summary { cursor: pointer; color: var(--accent); margin: 8px 0; }
.comments, .history { list-style: none; padding: 0; }
.history li { padding: 4px 0; }
.task-notice label { display: grid; gap: 4px; margin-top: 8px; }
table.rows { border-collapse: collapse; margin-bottom: 8px; }
table.rows th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 8px 4px 0; }
table.rows td { padding: 4px 8px 4px 0; }
fieldset.filter-row { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
@media (max-width: 600px) {
  table.rows { width: 100%; }
  table.rows input:not([type="checkbox"]) { width: 100%; }
}
.attachments h2 { font-size: 16px; margin: 16px 0 8px; }
.attach { margin-top: 8px; }
[data-theme-switch] { color: var(--muted); }
.md-editor { display: grid; gap: 4px; }
.md-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.md-bar[hidden] { display: none; }
.md-bar button { padding: 0 8px; font-size: 13px; line-height: 24px; }
.md-bar button[hidden] { display: none; }
.md-tabs { margin-left: auto; display: flex; gap: 4px; }
.md-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.md-editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.md-preview { min-height: 6em; border: 1px dashed var(--line); border-radius: 6px; padding: 6px 10px; background: var(--surface); }
.md-hint { margin: 0; font-size: 12px; }
/* The task page's facts for readers (see "Task edit" for the rest). */
.facts dd { color: var(--text); }
/* "Saved.": the design's toast, going away by itself after 5 seconds. */
.toast.fade { animation: toast-out 5s forwards; pointer-events: none; }
@keyframes toast-out {
  0%, 90% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}
/* The thread: comments as cards. */
.comments { display: grid; gap: 10px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 10px; }
.card-head { font-size: 12px; color: var(--muted); padding-right: 48px; }
/* Questions in a comment. */
.questions { display: grid; gap: 6px; }
.question { border: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.question legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
.question label { display: flex; gap: 6px; align-items: center; }
.question label.other input[type="text"] { flex: 1; max-width: 320px; padding: 2px 6px; }
.questions [data-answer-save] { justify-self: start; }
/* The Kanban board: the page head with its two toolbars, then the
   columns side by side, scrolled sideways inside .board; they end at the
   bottom of the window and each scrolls its own cards. */
body:has(#board) { height: 100dvh; display: flex; flex-direction: column; }
body:has(#board) main.board-main { max-width: none; width: 100%; box-sizing: border-box; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-head { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 0; }
.board-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.board-head .narrowed { margin: 0; }
.board-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-title-text { display: flex; flex-direction: column; gap: 2px; }
.tb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-label { flex: none; width: 72px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tb-row .search.tb-search { width: 220px; margin: 0; }
.input.auto { width: auto; }
.bulk { display: inline-flex; align-items: center; gap: 6px; }
.bulk[hidden] { display: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.pop-anchor { position: relative; }
.pop-anchor > .popover { top: 42px; left: 0; right: auto; }
.pop-anchor > .popover.pop-right { left: auto; right: 0; }
.popover.stack { padding: 12px; gap: 12px; }
.pop-title { padding: 4px 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop-row { display: flex; align-items: center; gap: 8px; padding: 6px; }
.pop-row > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pop-row form { margin: 0; }
.pop-empty { margin: 0; padding: 6px; }
#board { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#board > .notice { margin: 8px 20px 0; }
.columns { flex: 1; min-height: 0; display: flex; gap: 12px; align-items: stretch; overflow-x: auto; }
.col { flex: none; width: 284px; min-height: 0; max-height: none; }
.col.collapsed { width: 46px; }
.col.drop-into { outline: 2px dashed var(--accent); outline-offset: 2px; }
.col-head { cursor: default; }
details.column-menu { margin: 0; }
details.column-menu > summary { list-style: none; cursor: pointer; }
details.column-menu > summary::-webkit-details-marker { display: none; }
.col-rename { padding: 4px; }
.col-head > .col-rename { padding: 0; }
.menu-item[data-rename] { display: none; }
.js .menu-item[data-rename] { display: flex; }
.js .menu .col-rename { display: none; }
.col-head > .col-title:first-child, .col-head > .col-rename + .col-title:first-child { margin-left: 10px; }
.col-grip { display: inline-flex; align-items: center; flex: none; padding: 4px 0; color: var(--muted); cursor: grab; user-select: none; }
.col.collapsed .col-grip { justify-content: center; padding: 8px 0 0; }
.col-rename { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; margin: 0; }
.col-rename .input { height: 30px; flex: 1; min-width: 0; }
.col-head.renaming > :not(.col-grip):not(.col-rename) { display: none; }
.col-head.renaming .col-rename { display: flex; }
.menu-form { display: block; margin: 0; }
.menu .menu-item { width: 100%; }
.cards { list-style: none; margin: 0; flex: 1; min-height: 56px; overflow-y: auto; }
/* Cards keep their shape; the column scrolls instead of squeezing them. */
.cards > * { flex: none; }
.col-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 8px 2px; }
.col-period > select.input { flex: 1; width: auto; min-width: 0; }
.period-range { display: flex; align-items: center; gap: 4px; width: 100%; color: var(--muted); }
.period-range > .input { flex: 1; min-width: 0; padding: 0 6px; }
.col-more { padding: 4px 8px; text-align: center; font-size: 12px; color: var(--muted); }
.col-empty { padding: 14px 8px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; }
li.card { position: relative; display: block; aspect-ratio: 4 / 3; box-sizing: border-box; overflow: hidden; padding: 0; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); cursor: default; transition: box-shadow .15s; }
li.card[draggable="true"] { cursor: grab; }
li.card:hover { box-shadow: var(--shadow-lift); }
li.card.tinted { background: var(--tint); }
li.card.card-dragging { opacity: .45; box-shadow: none; }
/* The copy of a card the pointer carries while dragging (app.js). */
.drag-ghost { position: fixed; top: -1000px; left: -1000px; list-style: none; box-shadow: var(--shadow-lift); pointer-events: none; }
a.card-link, a.card-link:hover { box-sizing: border-box; height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: inherit; color: inherit; text-decoration: none; }
a.card-link:focus-visible { outline-offset: -2px; }
.card-top, .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-id { font-size: 12px; color: var(--muted); }
.prio { text-transform: capitalize; }
.card-title { display: block; overflow-wrap: anywhere; color: var(--text); }
li.card[hidden] { display: none; }
.col .task-card .card-title { flex: 1 1 0; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }
.col .task-card:has(.chips) .card-title { -webkit-line-clamp: 3; line-clamp: 3; }
.col .task-card .chips { flex: none; max-height: 2.4em; overflow: hidden; color: var(--muted); }
.card-top, .card-bottom { flex: none; }
.card-count { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: 12px; color: var(--muted); }
.card-count svg { display: block; }
.tinted .card-count { color: var(--tint-ink-2); }
.card-bottom .avatar { width: 26px; height: 26px; font-size: 11px; }
.card-bottom .avatar.mine { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.col.finished .task-card { opacity: .7; }
/* A tinted card: the design tint for the theme, with its own ink. */
.tinted, .tinted .card-title { color: var(--tint-ink); }
.tinted .card-id, .tinted .prio, .tinted .chips, .tinted .chips span { color: var(--tint-ink-2); }
.tinted .bars span { background: var(--tint-bar); }
.tinted .bars span.on { background: var(--tint-ink); }
.tinted .prio-urgent, .tinted .chips .due-chip.overdue { color: var(--danger); }
.tinted .prio-urgent .bars span.on { background: var(--danger); }
.tinted .chip { background: var(--tint-chip); color: var(--tint-ink); }
.tinted .chip.module-badge { background: var(--tint-chip); color: var(--tint-ink); }
.tinted .label-chip { border-color: var(--label); }
/* Where a dragged card would land: the design's dashed slot, drawn outside
   the card so the card under the pointer stays the target. */
/* Where a dragged card would land: a dashed slot between the cards. */
#board .drop-slot { flex: none; height: 44px; list-style: none; box-sizing: border-box; border: 2px dashed color-mix(in srgb, var(--accent) 75%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, transparent); pointer-events: none; }
#board .cards:has(> .drop-slot) > .col-empty { display: none; }
/* A marker card: a title on a full colour. */
/* As high as its text: at most a letter (1em) above and below it. */
.marker { background: var(--marker); box-sizing: border-box; overflow: hidden; cursor: default; }
.marker[draggable="true"] { cursor: grab; }
.marker-title { overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.marker-delete { margin: 0; }
.marker-x { opacity: .8; }
.marker-delete .marker-x { position: absolute; }
.marker:hover .marker-x, .marker:focus-within .marker-x { opacity: 1; }
.marker-x svg { display: block; }
/* The footer: Add task, and the marker form that opens under it. */
.col-foot { flex-wrap: wrap; }
.col-foot > .add-task:first-child { flex: 1; }
details.add-marker { flex: 0 1 auto; }
details.add-marker[open] { flex-basis: 100%; }
details.add-marker > summary.add-task { list-style: none; margin: 0; }
details.add-marker > summary::-webkit-details-marker { display: none; }
details.add-marker[open] > summary.add-task { margin-bottom: 8px; background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.marker-form { margin: 0; }
.marker-form .swatches legend { font-size: 12px; color: var(--muted); }
/* A collapsed column: a thin strip with its count and name along it. */
.col.collapsed { align-items: stretch; }
.col.collapsed > .menu-form { flex: 1; display: flex; }
.col.collapsed .collapsed-btn { flex: 1; }
@media (max-width: 640px) {
  .tb-label { display: none; }
  .tb-row .search.tb-search { width: 100%; }
  .board-head, .board { padding-left: 12px; padding-right: 12px; }
}
/* The home page's parts, each closed by a click on its heading. */
.fold { margin-bottom: 24px; }
.fold > summary { cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .count { color: var(--muted); font-weight: 400; font-size: 0.7em; }
/* Modules: a small badge in the module's colour. */
/* Modules are one neutral chip, as in the design (the module colour is
   not shown). */
.module-badge { display: inline-flex; align-items: center; height: 20px; box-sizing: border-box; padding: 0 8px; border-radius: 10px; background: var(--chip); color: var(--text); font-size: 12px; font-weight: 400; white-space: nowrap; text-decoration: none; }
/* A task's pastel colour: its card's background, with dark text in
   either theme. */
.tinted { background: var(--tint); color: var(--tint-ink); }
.tinted a, .tinted .ref, .tinted .assignee, .tinted .assignee.mine { color: var(--tint-ink-2); }
.task.tinted { padding-left: 6px; padding-right: 6px; border-radius: 6px; }
/* The colour choice on the task page. */
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.swatches legend { padding: 0; margin-bottom: 4px; }
.swatch { position: relative; width: 24px; height: 24px; border-radius: 50%; background: var(--tint); border: 1px solid var(--line); cursor: pointer; }
.swatch.none { background: linear-gradient(135deg, transparent 46%, var(--muted) 46% 54%, transparent 54%), var(--surface); }
.swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.swatch:has(input:checked) { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatch:has(input:focus-visible) { outline: 2px dashed var(--accent); outline-offset: 2px; }
/* The module picker in the new-task and import dialogs. */
.module-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin: 10px 0; }
.module-pick select { margin-left: 6px; }
.add-module > summary { list-style: none; display: inline-block; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 2px 10px; cursor: pointer; }
.add-module > summary::-webkit-details-marker { display: none; }
.add-module[open] { flex-basis: 100%; }
.add-module[open] > summary { margin-bottom: 8px; }
.swatch.next::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; opacity: 0.85; pointer-events: none; }
.facts .overdue { color: var(--urgent); font-weight: 600; }
/* Chips: what is set of a task's planning fields, on rows and cards. */
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; line-height: 1.5; }
.label-chip { border: 1px solid var(--label); color: var(--text); border-radius: 999px; padding: 0 6px; }
.size-chip { border-radius: 4px; padding: 0 5px; background: var(--line); font-weight: 600; }
.due-chip { color: var(--muted); }
.due-chip.overdue { color: var(--urgent); font-weight: 600; }
.milestone-chip { color: var(--muted); }
.project-chip { color: var(--muted); font-style: italic; }
.narrowed { margin: 0 0 12px; color: var(--muted); }
/* Subtasks on the task page, and the parent link and chip. */
.parent-link { display: block; width: fit-content; max-width: 100%; padding: 6px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.parent-link a { font-weight: 600; color: var(--text); }
.subtask-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.subtask-list .ref { color: var(--muted); font-size: 12px; }
.subtask-list .state { color: var(--muted); font-size: 12px; }
.subtask-list li.done a { text-decoration: line-through; color: var(--muted); }
.parent-chip { color: var(--muted); }
.purge-form { margin-top: 16px; }
/* An LLM at work on a card, and a card that just changed on the server. */
.llm-working { font-size: 11px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.avatar.working { animation: llm-working 2s ease-in-out infinite; }
@keyframes llm-working { 50% { box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1px var(--accent); } }
.task-card.changed { animation: card-changed 5s ease-out; }
@keyframes card-changed { from, 40% { box-shadow: 0 0 0 2px var(--accent); } }
@media (prefers-reduced-motion: reduce) {
  .avatar.working { animation: none; box-shadow: inset 0 0 0 1px var(--accent); }
  .task-card.changed { animation: none; box-shadow: 0 0 0 2px var(--accent); }
}
/* Checklists on the task page. */
.checklist h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.checklist progress { width: 100%; height: 6px; }
.checklist-items { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 2px; }
.checklist-items li { display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-radius: 6px; }
.checklist-items .item-handle { cursor: grab; color: var(--muted); user-select: none; }
.checklist-items li.done .text { text-decoration: line-through; color: var(--muted); }
.checklist-items .by { font-size: 12px; margin-left: auto; }
.checklist-items .item-edit > summary { margin: 0; font-size: 12px; }
.checklist-items li.drop-before { box-shadow: 0 -2px 0 var(--drop); }
.checklist-items li.drop-after { box-shadow: 0 2px 0 var(--drop); }
.check-chip { color: var(--muted); }
/* The Time tab. */
.time .total { margin: 8px 0; }
.time table { width: 100%; }
.time-chip { color: var(--muted); font-variant-numeric: tabular-nums; }
.work-time td.minutes, .work-time th.minutes { text-align: right; font-variant-numeric: tabular-nums; }
.work-time tr.total td { font-weight: 600; border-top: 1px solid var(--line); }
/* Code links on the task page. */
.code-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.code-links a { font-family: var(--mono); font-size: 13px; }
.link-chip { color: var(--muted); }

/* ---- New project: members step ---- */
.narrow-1180 { max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px 20px 40px; box-sizing: border-box; }
.members-step .err { margin: 0 0 12px; }
.two-panels { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.two-panels > .panel { flex: 1 1 440px; min-width: 0; }
.pad-18 { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 4px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head .sm, .muted.sm { font-size: 13px; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field .input { width: auto; }
.row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .inline { display: inline-flex; align-items: center; gap: 6px; }
.row .inline .input.sm { width: auto; }
.row[hidden] { display: none; }
.access-line { display: flex; align-items: center; gap: 8px; padding: 10px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.step-foot-actions { display: inline-flex; gap: 8px; }

/* ---- Board dialogs: new task, import, delete column ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }
.field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain > legend { padding: 0; }
.seg-opt { position: relative; display: inline-flex; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 500; text-transform: capitalize; }
.seg-opt input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20, 26, 32, .12); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.file-pick { height: auto; padding: 10px; border-style: dashed; cursor: pointer; }
textarea.mono { font-family: var(--mono, "Roboto Mono", ui-monospace, monospace); font-size: 13px; }
.module-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.module-row > .input { width: auto; min-width: 180px; }
.add-module > summary { list-style: none; cursor: pointer; }
.add-module > summary::-webkit-details-marker { display: none; }
.add-module-form { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); min-width: 260px; }
.dialog-foot form[hidden] { display: none; }

/* ---- Settings: tabs with a save bar (Settings artboard) ---- */
.narrow-1040 { max-width: 1040px; width: 100%; margin: 0 auto; padding: 28px 20px 64px; box-sizing: border-box; }
.page.narrow-1040 { gap: 20px; }
.page-head-col { display: flex; flex-direction: column; gap: 4px; }
.page-head-col h1 { margin: 0; font-size: 22px; font-weight: 600; }
.page-head-col p { margin: 0; }
.page-head-col .crumbs-sm { margin-bottom: 4px; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.tab-panel[hidden] { display: none; }
.tab-panel > p { margin: 0; }
.tab-panel .section-title { font-size: 15px; }
/* Its .sr labels are placed inside it, not where the scrolled table would put them on the page. */
.tab-panel .tbl-wrap { position: relative; }
.tbl.wide-520 { min-width: 520px; }
.tbl.wide-560 { min-width: 560px; }
.tbl.wide-640 { min-width: 640px; }
.tbl.wide-760 { min-width: 760px; }
.tbl .w-60 { width: 60px; }
.tbl .w-80 { width: 80px; }
.tbl .w-84 { width: 84px; }
.tbl .w-100 { width: 100px; }
.tbl .w-130 { width: 130px; }
.tbl .w-190 { width: 190px; }
.tbl .w-200 { width: 200px; }
.tbl form { margin: 0; }
.tbl .order-input { width: 64px; }
.row-inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.row-inline .input { max-width: 360px; }
.row-inline .swatches { flex-wrap: nowrap; }
.row-sub.block { display: block; white-space: normal; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-text { display: flex; flex-direction: column; min-width: 0; }
/* Add member (Settings artboard): the filter, Role and Add in one row,
   the list to pick from below them. */
.add-member { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 240px) auto; grid-template-areas: "filter role add" "list list list"; align-items: end; gap: 8px 12px; margin: 0; }
.am-filter { grid-area: filter; min-width: 0; }
.am-role { grid-area: role; min-width: 0; }
.am-add { grid-area: add; }
.am-list { grid-area: list; min-width: 0; }
.picker-list { height: auto; margin-top: 6px; padding: 4px; }
.picker-list option { padding: 4px 6px; border-radius: 6px; }
.add-row .narrow-input { flex: 0 1 220px; }
.add-row .kind-input { flex: 0 0 auto; width: auto; }
.savebar { position: sticky; bottom: 16px; z-index: 20; }
.savebar .save-status { flex: 1; }
.tab-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tab-foot .hint { margin: 0; max-width: 620px; }
.tab-foot .hint strong { color: var(--text); font-weight: 600; }
.sub-head { margin: 8px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; align-items: start; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; }
.label .normal, .normal { font-weight: 400; }
.center-text { text-align: center; }
.filter-row { margin: 0; padding: 16px 20px 18px; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.filter-row > legend { float: left; width: 100%; padding: 0; margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.filter-row > legend + * { clear: both; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.choice-group { display: flex; flex-direction: column; gap: 4px; }
.choice-group > .label { margin: 0; }
.choice-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.choice-list label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.ms-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ms-intro > p { margin: 0 auto 0 0; max-width: 620px; }
.ms-new > summary, .ms-edit > summary { list-style: none; }
.ms-new > summary::-webkit-details-marker, .ms-edit > summary::-webkit-details-marker { display: none; }
.ms-new[open] { flex-basis: 100%; }
.ms-new > form { margin-top: 12px; }
.ms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
a.ms-name { color: var(--text); text-decoration: none; }
a.ms-name:hover { color: var(--accent); text-decoration: underline; }
.ms-desc { font-size: 13px; color: var(--muted); }
.ms-progress { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ms-progress progress { width: 110px; height: 6px; accent-color: var(--accent); }
.ms-due { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ms-date { font-weight: 500; white-space: nowrap; }
.ms-actions { position: relative; display: flex; align-items: center; gap: 2px; flex: none; }
button.ms-done { border: 0; background: transparent; font: inherit; font-size: 13px; }
.ms-box { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border: 1.5px solid var(--line-strong); border-radius: 4px; color: transparent; flex: none; }
.ms-done[aria-pressed="true"] .ms-box { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.ms-edit-form { position: absolute; right: 0; top: 40px; z-index: 30; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-dialog); }
@media (max-width: 640px) {
  .narrow-1040 { padding: 16px 16px 48px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tab { padding: 0 12px; }
  .ms-row { flex-wrap: wrap; }
  .ms-main { flex-basis: calc(100% - 50px); }
  .ms-due { align-items: flex-start; margin-left: 50px; }
  .add-member { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "filter filter" "role add" "list list"; }
}

/* ---- Account hub: side nav, forms, error page ---- */
main.account-page { flex-direction: row; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.account-nav { flex: 1 1 200px; max-width: 240px; display: flex; flex-direction: column; gap: 16px; }
.account-nav .who { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.account-nav .who-text { display: flex; flex-direction: column; min-width: 0; }
.account-nav .who-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.account-nav form.inline { display: block; }
button.side-link.as-button { width: 100%; border: 0; background: transparent; font: inherit; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--muted); text-align: left; }
button.side-link.as-button:hover { background: var(--surface); color: var(--text); }
button.side-link.as-button:focus-visible, a.side-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.account-body { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.account-form { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.account-form .err { margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.meter-row { display: flex; align-items: center; gap: 12px; }
.meter-row .meter { flex: 1; }
.strength { font-size: 13px; min-width: 92px; text-align: right; color: var(--muted); }
.req .dot svg { display: none; }
.req.met .dot svg { display: block; }
.notice > div { flex: 1; }
.notice > svg { color: var(--ok); flex: none; margin-top: 1px; }
.theme-cards { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.theme-cards legend { padding: 0; }
.theme-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.theme-card > span { display: flex; flex-direction: column; }
.theme-card input { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; }
.theme-card:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.theme-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-wrap { overflow-x: auto; padding: 8px 16px; }
.table-wrap table.rows { width: 100%; margin: 0; }
.table-wrap table.rows th, .table-wrap table.rows td { padding: 8px 12px 8px 0; }
.table-wrap td.minutes, .table-wrap th.minutes { text-align: right; white-space: nowrap; }
.table-wrap tr.total td { font-weight: 600; }
main.error-page { max-width: 480px; width: 100%; margin: 0 auto; padding: 64px 20px; box-sizing: border-box; }
.error-panel { padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.error-panel h1 { margin: 0; font-size: 22px; font-weight: 600; }
.error-panel p { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .account-nav { max-width: none; flex-basis: 100%; } .account-form { padding: 18px; } }

/* A task in a wide popup over the board or the list, on a desktop (app.js:
   openTaskPop). The page inside is the task page without its header. */
html.embedded .app-bar { display: none; }
html.embedded .narrow-1240 { max-width: none; }
.task-pop-scrim { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--text) 22%, transparent); }
.task-pop { position: fixed; bottom: 16px; z-index: 31; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-dialog); overflow: hidden; }
.task-pop-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 4px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.task-pop iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
