/* ==========================================================================
   Lanewise 1.0 — project management app UI kit
   One stylesheet for every page. Sections:
     1. Tokens (colours, type, spacing)     7. List view
     2. Base and helpers                    8. Calendar
     3. Buttons, fields, small parts        9. Timeline
     4. App shell: sidebar, top bar        10. Overview, team, wizard, settings, sign in
     5. Board                              11. Menus, dialogs, toasts
     6. Task dialog                        12. Responsive, print, reduced motion
   To rebrand, change --brand and its two partners below.
   ========================================================================== */

/* 1. Tokens --------------------------------------------------------------- */
:root {
  /* brand: the fill colour, the text on top of it, and the same hue as readable text */
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-text: #0c625b;

  --canvas: #f4f6f7;
  --side: #e9edef;
  --surface: #ffffff;
  --raised: #ffffff;
  --sunk: #eef1f3;
  --lane: #e9edf0;
  --hover: #e3e8ec;
  --ink: #141a21;
  --ink-2: #3f4854;
  --ink-3: #5f6b7a;
  --line: #dbe1e6;
  --line-2: #c3ccd4;

  --ok: #15803d;
  --warn: #92580a;
  --bad: #be123c;
  --info: #1d5fbf;
  --ok-soft: #e1f3e7;
  --warn-soft: #fbefd2;
  --bad-soft: #fde7ec;
  --info-soft: #e2edfb;

  /* named colours for columns, labels, people and projects: use data-color="blue" */
  --c-slate: #64748b;
  --c-blue: #2563eb;
  --c-teal: #0d9488;
  --c-green: #16a34a;
  --c-amber: #d97706;
  --c-orange: #ea580c;
  --c-rose: #e11d48;
  --c-violet: #7c3aed;
  --tint: 13%;                 /* how much of a colour goes into a chip background */
  --shade: 58%;                /* how much of a colour goes into chip text (rest is --ink) */

  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r: 9px;
  --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(20, 26, 33, .07);
  --shadow-2: 0 6px 18px -6px rgba(20, 26, 33, .18), 0 2px 5px rgba(20, 26, 33, .06);
  --shadow-3: 0 24px 60px -18px rgba(20, 26, 33, .35), 0 6px 16px rgba(20, 26, 33, .1);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 32%, transparent);
  --brand-soft: color-mix(in srgb, var(--brand) 11%, var(--surface));
  --col-w: 292px;              /* width of one board column */
  --gap: 12px;
  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #2dd4bf;
  --brand-ink: #03201c;
  --brand-text: #5eead4;
  --canvas: #0f1318;
  --side: #0b0e12;
  --surface: #181d24;
  --raised: #1f252e;
  --sunk: #12161c;
  --lane: #141920;
  --hover: #252c36;
  --ink: #edf0f4;
  --ink-2: #bcc5d0;
  --ink-3: #8f9bab;
  --line: #2a323d;
  --line-2: #3b4553;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #7cb4ff;
  --ok-soft: #12301f;
  --warn-soft: #33290d;
  --bad-soft: #3b1420;
  --info-soft: #13253f;
  --c-slate: #94a3b8;
  --c-blue: #60a5fa;
  --c-teal: #2dd4bf;
  --c-green: #4ade80;
  --c-amber: #fbbf24;
  --c-orange: #fb923c;
  --c-rose: #fb7185;
  --c-violet: #a78bfa;
  --tint: 20%;
  --shade: 78%;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-3: 0 28px 70px -20px rgba(0, 0, 0, .85), 0 6px 18px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* accent presets: data-accent on <html>, or pick one in Settings */
[data-accent="blue"]   { --brand: #2563eb; --brand-ink: #ffffff; --brand-text: #1d4fd0; }
[data-accent="violet"] { --brand: #7c3aed; --brand-ink: #ffffff; --brand-text: #6a2bd9; }
[data-accent="rose"]   { --brand: #be123c; --brand-ink: #ffffff; --brand-text: #a80f35; }
[data-accent="ink"]    { --brand: #1f2937; --brand-ink: #ffffff; --brand-text: #1f2937; }
[data-theme="dark"][data-accent="blue"]   { --brand: #60a5fa; --brand-ink: #06162f; --brand-text: #93c5fd; }
[data-theme="dark"][data-accent="violet"] { --brand: #a78bfa; --brand-ink: #1b0c40; --brand-text: #c4b5fd; }
[data-theme="dark"][data-accent="rose"]   { --brand: #fb7185; --brand-ink: #3b0613; --brand-text: #fda4af; }
[data-theme="dark"][data-accent="ink"]    { --brand: #e5e7eb; --brand-ink: #111827; --brand-text: #f3f4f6; }

[data-color="slate"] { --c: var(--c-slate); }
[data-color="blue"] { --c: var(--c-blue); }
[data-color="teal"] { --c: var(--c-teal); }
[data-color="green"] { --c: var(--c-green); }
[data-color="amber"] { --c: var(--c-amber); }
[data-color="orange"] { --c: var(--c-orange); }
[data-color="rose"] { --c: var(--c-rose); }
[data-color="violet"] { --c: var(--c-violet); }

[data-density="compact"] { --col-w: 264px; --gap: 9px; }

/* 2. Base and helpers ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-xs { width: 13px; height: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* 3. Buttons, fields, small parts ---------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9333rem; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background-color .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn:active { translate: 0 1px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, var(--ink)); border-color: color-mix(in srgb, var(--brand) 86%, var(--ink)); }
[data-theme="dark"] .btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, #fff); border-color: color-mix(in srgb, var(--brand) 86%, #fff); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: .8667rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 44px; padding: 0 18px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--r-sm); color: var(--ink-2); transition: background-color .12s, color .12s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-text); }
.link { color: var(--brand-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; }
.label { font-size: .8667rem; font-weight: 600; }
.hint { font-size: .8rem; color: var(--ink-3); }
.error-text { font-size: .8rem; color: var(--bad); font-weight: 500; }
.input, .select, .textarea { width: 100%; min-width: 0; min-height: 38px; padding: 7px 11px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--brand-text); box-shadow: var(--focus); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8796' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }
.input-sm { min-height: 32px; padding: 4px 9px; font-size: .9rem; border-radius: var(--r-sm); }
.input-icon { position: relative; display: block; }
.input-icon > .icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.input-icon > .input { padding-left: 34px; }
.tick { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.tick input, .cb { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 40px; height: 22px; margin: 0; cursor: pointer; }
.switch i { width: 40px; height: 22px; flex: none; border-radius: 99px; background: var(--line-2); transition: background-color .15s; position: relative; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: translate .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { translate: 18px 0; background: var(--brand-ink); }
.switch input:focus-visible + i { outline: 2px solid var(--brand-text); outline-offset: 2px; }

/* chips: labels, statuses, people */
.chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 21px; padding: 0 8px; border-radius: 6px; font-size: .78rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--c-slate)) var(--tint), var(--surface)); color: color-mix(in srgb, var(--c, var(--c-slate)) var(--shade), var(--ink)); }
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .8667rem; white-space: nowrap; }
.status::before, .dot { content: ''; display: inline-block; width: 9px; height: 9px; flex: none; border-radius: 3px; background: var(--c, var(--c-slate)); }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pill-ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill-bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.pill-info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.key { font-family: var(--mono); font-size: .76rem; color: var(--ink-3); letter-spacing: -.01em; white-space: nowrap; }
.kbd { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font-family: var(--mono); font-size: .72rem; color: var(--ink-2); }

.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; font-size: .68rem; font-weight: 700; letter-spacing: .01em;
  background: color-mix(in srgb, var(--c, var(--c-slate)) 82%, #000); color: #fff; }
[data-theme="dark"] .avatar { background: color-mix(in srgb, var(--c, var(--c-slate)) 55%, #0b0e12); }
.avatar.sm { width: 22px; height: 22px; font-size: .6rem; }
.avatar.lg { width: 40px; height: 40px; font-size: .9rem; }
.avatar.none { background: transparent; color: var(--ink-3); border: 1.5px dashed var(--line-2); }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--canvas); }
.avatars .avatar + .avatar { margin-left: -7px; }

.pri { display: inline-flex; align-items: center; gap: 6px; font-size: .8667rem; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.pri .icon { width: 15px; height: 15px; stroke-width: 2.2; }
.pri[data-p="urgent"] .icon { color: var(--bad); }
.pri[data-p="high"] .icon { color: var(--c-orange); }
.pri[data-p="medium"] .icon { color: var(--c-amber); }
.pri[data-p="low"] .icon { color: var(--c-blue); }
.pri[data-p="none"] .icon { color: var(--ink-3); }

.due { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.due .icon { width: 13px; height: 13px; }
.due.is-late { color: var(--bad); font-weight: 600; }
.due.is-soon { color: var(--warn); font-weight: 600; }

.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pad { padding: 18px; }
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px; border-radius: var(--r); background: var(--info-soft); font-size: .9rem; }
.banner > .icon { margin-top: 1px; color: var(--info); }
.banner-warn { background: var(--warn-soft); }
.banner-warn > .icon { color: var(--warn); }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--v, 0%); background: var(--brand); border-radius: inherit; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 44px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); text-align: center; color: var(--ink-2); }
.empty b { font-size: 1.05rem; color: var(--ink); }
.empty p { max-width: 44ch; }
.tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--sunk); border: 1px solid var(--line); }
.tabs button, .tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border-radius: 6px; font-size: .8667rem; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs [aria-pressed="true"], .tabs [aria-selected="true"], .tabs [aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; background: var(--c, var(--sw)); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.swatch[aria-pressed="true"], .swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }

/* 4. App shell: sidebar, top bar ----------------------------------------- */
.app-body { height: 100vh; height: 100dvh; overflow: hidden; }
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); height: 100%; }
.app.is-side-closed { grid-template-columns: minmax(0, 1fr); }
.app.is-side-closed .side { display: none; }

.side { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--side); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--brand); color: var(--brand-ink); }
.logo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.side-nav { flex: 1; min-height: 0; padding: 4px 8px 12px; }
.side-nav a, .side-nav button.side-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 9px; border-radius: var(--r-sm); font-weight: 600; font-size: .9333rem; color: var(--ink-2); text-decoration: none; }
.side-nav a:hover, .side-nav button.side-link:hover { background: var(--hover); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.side-nav a[aria-current="page"] .icon { color: var(--brand-text); }
.side-nav .count { margin-left: auto; font-size: .76rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side-label { display: flex; align-items: center; justify-content: space-between; margin: 16px 9px 4px; font-size: .76rem; font-weight: 700; color: var(--ink-3); }
.proj { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 9px; border-radius: var(--r-sm); font-weight: 600; font-size: .9333rem; color: var(--ink-2); }
.proj:hover { background: var(--hover); color: var(--ink); }
.proj[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.proj .dot { width: 10px; height: 10px; border-radius: 3px; margin: 0 4px; }
.proj span.truncate { flex: 1; }
.side-foot { display: flex; align-items: center; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.side-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: var(--r); }
.side-user:hover { background: var(--hover); }
.side-user b { display: block; font-size: .8667rem; line-height: 1.2; }
.side-user small { display: block; font-size: .74rem; color: var(--ink-3); line-height: 1.2; }
.side-user > span:last-child { min-width: 0; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.top { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 20px 0 14px; background: var(--canvas); }
.top h1 { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.top h1 .dot { width: 12px; height: 12px; border-radius: 4px; }
.top h1 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.only-mobile { display: none; }

.viewbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 0 20px 12px 20px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.views { display: flex; gap: 2px; }
.views a { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border-radius: var(--r-sm); font-weight: 600; font-size: .9333rem; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.views a:hover { background: var(--hover); color: var(--ink); }
.views a[aria-current="page"] { color: var(--ink); }
.views a[aria-current="page"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -13px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.views a .icon { width: 16px; height: 16px; }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.filters .input-icon { width: 190px; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); font-size: .8667rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fbtn:hover { background: var(--hover); color: var(--ink); }
.fbtn .icon { width: 14px; height: 14px; }
.fbtn.is-on { border-color: var(--brand-text); color: var(--brand-text); background: var(--brand-soft); }

.view { flex: 1; min-height: 0; position: relative; }
.page-in { max-width: 1160px; margin: 0 auto; padding: 24px 24px 60px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.6rem; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.page-head p { margin-top: 5px; max-width: 62ch; color: var(--ink-2); }
.h2 { font-size: 1rem; font-weight: 700; letter-spacing: -.005em; }

/* 5. Board ---------------------------------------------------------------- */
.board { display: flex; align-items: flex-start; gap: var(--gap); height: 100%; padding: 16px 20px 20px; }
.col { flex: 0 0 var(--col-w); display: flex; flex-direction: column; max-height: 100%; min-height: 0; border-radius: var(--r-lg); background: var(--lane); }
.col-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 12px; }
.col-head .dot { border-radius: 50%; }
.col-head h2 { min-width: 0; font-size: .9333rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-count { font-size: .8rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-count.is-over { color: var(--bad); background: var(--bad-soft); padding: 1px 7px; border-radius: 99px; }
.col-rename { flex: 1; min-width: 0; min-height: 30px; padding: 2px 8px; font-weight: 700; font-size: .9333rem; }
.col-body { flex: 1; min-height: 34px; display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.col-foot { padding: 0 8px 8px; }
.add-card { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 34px; padding: 0 8px; border-radius: var(--r); font-weight: 600; font-size: .8667rem; color: var(--ink-3); }
.add-card:hover { background: var(--hover); color: var(--ink); }
.composer { display: grid; gap: 7px; padding: 9px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--brand-text); box-shadow: var(--focus); }
.composer textarea { width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; resize: none; line-height: 1.4; }
.composer textarea:focus-visible { outline: none; }
.composer .row { justify-content: flex-end; gap: 6px; }

.card { position: relative; display: grid; gap: 7px; padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.card:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.card.is-done .card-title { color: var(--ink-3); }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.card-title { display: block; width: 100%; padding-right: 18px; font-size: .9333rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer; border-radius: 4px; }
.card-title:hover { color: var(--brand-text); }
.card-meta { display: flex; align-items: center; gap: 9px; min-height: 22px; color: var(--ink-3); font-size: .8rem; }
.card-meta .pri span { display: none; }
.card-meta .avatar { margin-left: auto; }
.card-stat { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-stat .icon { width: 13px; height: 13px; }
.card-stat.is-full { color: var(--ok); }
.card-menu { position: absolute; top: 5px; right: 5px; opacity: 0; background: var(--surface); }
.card:hover .card-menu, .card:focus-within .card-menu, .card-menu[aria-expanded="true"] { opacity: 1; }

/* dragging */
.card.is-source { opacity: .35; }
.card.is-ghost { position: fixed; z-index: 90; margin: 0; pointer-events: none; rotate: 2deg; box-shadow: var(--shadow-3); cursor: grabbing; }
.drop-slot { flex: none; border-radius: var(--r); border: 2px dashed var(--brand-text); background: var(--brand-soft); }
.is-dragging, .is-dragging * { cursor: grabbing !important; }
.col.is-target { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 45%, transparent); }

.col.is-collapsed { flex-basis: 44px; cursor: pointer; }
.col.is-collapsed .col-head { flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; min-height: 160px; }
.col.is-collapsed h2 { writing-mode: vertical-rl; overflow: visible; }
.col.is-collapsed .col-body, .col.is-collapsed .col-foot, .col.is-collapsed .col-menu { display: none; }
.col-new { flex: 0 0 auto; }
.col-new .btn { background: transparent; border-style: dashed; }
.col-new form { display: flex; gap: 6px; width: var(--col-w); padding: 8px; border-radius: var(--r-lg); background: var(--lane); }

/* swimlanes: one row of columns per group */
.board.has-lanes { display: block; }
.lane-heads { position: sticky; top: 0; z-index: 4; display: flex; gap: var(--gap); width: max-content; padding-bottom: 8px; background: var(--canvas); }
.lane-heads .col { max-height: none; border-radius: var(--r); }
.lane-heads .col-head { min-height: 38px; }
.swim { width: max-content; min-width: 100%; margin-bottom: 14px; }
.swim-head { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 8px 0 4px; font-weight: 700; font-size: .9333rem; border-radius: var(--r-sm); }
.swim-head:hover { background: var(--hover); }
.swim-head .chev { transition: rotate .15s; color: var(--ink-3); }
.swim-head[aria-expanded="true"] .chev { rotate: 90deg; }
.swim-head small { font-weight: 600; color: var(--ink-3); }
.swim-cols { display: flex; gap: var(--gap); margin-top: 4px; }
.swim-cols .col { max-height: none; }
.swim-cols .col-body { overflow: visible; padding-top: 8px; }
.swim-cols .col.is-collapsed .col-head { display: none; }
.swim-cols .col.is-collapsed { min-height: 44px; }

.board-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.board-empty .empty { pointer-events: auto; background: var(--surface); }

/* 6. Task dialog ---------------------------------------------------------- */
.task { display: grid; grid-template-columns: minmax(0, 1fr) 260px; min-height: 0; flex: 1; overflow: hidden; }
.task-main { display: grid; gap: 18px; align-content: start; padding: 4px 22px 22px; overflow-y: auto; min-width: 0; }
.task-side { display: grid; gap: 13px; align-content: start; padding: 4px 18px 22px; border-left: 1px solid var(--line); background: var(--sunk); overflow-y: auto; }
.task-title { width: 100%; padding: 4px 8px; margin-left: -8px; border: 1px solid transparent; border-radius: var(--r); background: transparent; font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; resize: none; overflow: hidden; }
.task-title:hover { border-color: var(--line); }
.task-title:focus-visible { outline: none; border-color: var(--brand-text); box-shadow: var(--focus); background: var(--surface); }
.task-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px 22px; }
.task-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .9333rem; font-weight: 700; }
.task-section h3 small { font-weight: 600; color: var(--ink-3); }
.task-side .field { gap: 4px; }
.task-side .label { color: var(--ink-3); font-size: .78rem; }
.task-side .input, .task-side .select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: .9rem; }
.task-labels { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.task-labels .chip { cursor: default; }
.task-info { font-size: .78rem; color: var(--ink-3); line-height: 1.5; }
.task-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }

.checks { display: grid; gap: 2px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 5px 6px; margin: 0 -6px; border-radius: var(--r-sm); }
.check-row:hover { background: var(--sunk); }
.check-row input[type="checkbox"] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand); flex: none; }
.check-row label { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.check-row.is-done label { color: var(--ink-3); text-decoration: line-through; }
.check-row .icon-btn { opacity: 0; }
.check-row:hover .icon-btn, .check-row:focus-within .icon-btn { opacity: 1; }
.check-add { display: flex; gap: 6px; margin-top: 6px; }

.comments { display: grid; gap: 14px; }
.comment { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; font-size: .8667rem; }
.comment-head span { color: var(--ink-3); font-size: .78rem; }
.comment p { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.comment-form .textarea { min-height: 62px; }
.comment-form .row { justify-content: flex-end; margin-top: 6px; }

/* 7. List view ------------------------------------------------------------ */
.list-in { min-width: 0; padding: 14px 20px 40px; }
.list-bar { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 10px; flex-wrap: wrap; }
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; padding: 4px 6px 4px 12px; border-radius: var(--r); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); }
.list-bar > .row { flex-wrap: wrap; min-width: 0; gap: 8px; }
.bulk b { font-size: .9rem; margin-right: 4px; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow-x: auto; }
.tbl { width: 100%; min-width: 720px; font-size: .9333rem; }
.tbl th, .tbl td { padding: 0 10px; height: 44px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
[data-density="compact"] .tbl th, [data-density="compact"] .tbl td { height: 36px; }
.tbl thead th { position: sticky; top: 0; z-index: 2; height: 38px; background: var(--sunk); font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.tbl tbody:last-child tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 60%, var(--surface)); }
.tbl tr.is-selected td { background: var(--brand-soft); }
.th-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 6px; margin-left: -6px; border-radius: var(--r-sm); font-weight: 700; }
.th-btn:hover { background: var(--hover); color: var(--ink); }
.th-btn .icon { color: var(--ink-3); }
th[aria-sort] .th-btn, th[aria-sort] .th-btn .icon { color: var(--brand-text); }
.c-sel { width: 38px; padding-right: 0 !important; }
.c-sel .cb { margin: 0; display: block; }
.c-title { width: 40%; white-space: normal !important; min-width: 220px; }
.t-open { display: inline; font-weight: 600; text-align: left; line-height: 1.3; border-radius: 4px; overflow-wrap: anywhere; }
.t-open:hover { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
.t-open.is-done { color: var(--ink-3); }
.cell-btn { display: inline-flex; align-items: center; gap: 7px; max-width: 170px; min-height: 30px; padding: 0 7px; margin-left: -7px; border-radius: var(--r-sm); }
.cell-btn:hover { background: var(--hover); }
.cell-date { min-height: 30px; padding: 0 6px; margin-left: -6px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; font-size: .8667rem; color: var(--ink-2); width: 132px; }
.cell-date:hover { border-color: var(--line-2); }
.cell-date:focus-visible { outline: none; border-color: var(--brand-text); box-shadow: var(--focus); background: var(--surface); }
.cell-date.is-late { color: var(--bad); font-weight: 600; }
.cell-date[value=""]:not(:focus) { color: var(--ink-3); }
.c-labels .card-labels { flex-wrap: nowrap; }
.group-row th { height: 38px !important; background: var(--canvas); border-bottom: 1px solid var(--line); }
.group-row .muted { margin-left: 4px; font-weight: 600; }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .8667rem; }

/* 8. Calendar ------------------------------------------------------------- */
.cal-in { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; padding: 14px 20px 30px; min-height: 100%; }
.cal-main { min-width: 0; }
.cal-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-bar h2 { margin: 0 6px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.015em; white-space: nowrap; }
.cal { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-row + .cal-row { border-top: 1px solid var(--line); }
.cal-dow { padding: 8px 10px; font-size: .78rem; font-weight: 700; color: var(--ink-3); background: var(--sunk); }
.cal-day { position: relative; min-height: 112px; padding: 5px 6px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day + .cal-day { border-left: 1px solid var(--line); }
.cal-day.is-weekend { background: color-mix(in srgb, var(--sunk) 55%, var(--surface)); }
.cal-day.is-out .cal-num { color: var(--ink-3); font-weight: 500; }
.cal-day.is-target { box-shadow: inset 0 0 0 2px var(--brand-text); background: var(--brand-soft); }
.cal-num { align-self: flex-start; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 99px; font-size: .8667rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-num:hover { background: var(--hover); }
.cal-day.is-today .cal-num { background: var(--brand); color: var(--brand-ink); }
.cal-dots { display: none; }
.cal-evs { display: grid; gap: 3px; min-width: 0; }
.ev { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; min-height: 22px; padding: 1px 7px; border-radius: 5px; font-size: .78rem; font-weight: 600; text-align: left; cursor: grab; user-select: none; -webkit-user-select: none;
  background: color-mix(in srgb, var(--c, var(--c-slate)) var(--tint), var(--surface)); color: color-mix(in srgb, var(--c, var(--c-slate)) var(--shade), var(--ink)); border-left: 3px solid var(--c, var(--c-slate)); }
.ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev:hover { filter: brightness(.97); }
[data-theme="dark"] .ev:hover { filter: brightness(1.15); }
.ev.is-done { background: var(--sunk); color: var(--ink-2); border-left-color: var(--line-2); }
.ev.is-done span { text-decoration: line-through; }
.ev.is-late { border-left-color: var(--bad); }
.ev.is-source { opacity: .35; }
.ev.is-ghost { position: fixed; z-index: 90; pointer-events: none; box-shadow: var(--shadow-3); rotate: 2deg; }
.cal-more { justify-self: start; padding: 0 7px; min-height: 20px; border-radius: 5px; font-size: .76rem; font-weight: 600; color: var(--ink-3); }
.cal-more:hover { background: var(--hover); color: var(--ink); }
.cal-side { display: grid; gap: 14px; position: sticky; top: 14px; }
.cal-panel { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.cal-panel h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .9333rem; font-weight: 700; }
.cal-panel h2 small { font-weight: 600; color: var(--ink-3); }
.cal-list { display: grid; gap: 4px; }
.cal-list .ev { min-height: 28px; }
.cal-agenda { display: none; }

/* 9. Timeline ------------------------------------------------------------- */
.tl-wrap { display: flex; flex-direction: column; height: 100%; padding: 14px 20px 20px; }
.tl-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tl { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); --name: 280px; }
.tl-in { width: calc(var(--name) + var(--w)); min-height: 100%; display: flex; flex-direction: column; }
.tl-row { display: flex; min-height: 40px; }
.tl-name { position: sticky; left: 0; z-index: 3; flex: 0 0 var(--name); display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .9rem; min-width: 0; }
.tl-name .t-open { flex: 1; min-width: 0; display: block; }
.tl-track { position: relative; flex: 0 0 var(--w); border-bottom: 1px solid var(--line); }
.tl-head { position: sticky; top: 0; z-index: 5; min-height: 54px; }
.tl-head .tl-name { z-index: 6; background: var(--sunk); font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.tl-head .tl-track { background: var(--sunk); }
.tl-months, .tl-days { display: flex; }
.tl-month { flex: none; height: 26px; border-right: 1px solid var(--line); overflow: hidden; overflow: clip; }
.tl-month span { position: sticky; left: calc(var(--name) + 10px); display: inline-block; padding: 5px 10px 0; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tl-d { flex: none; display: grid; justify-items: center; align-content: center; height: 28px; font-size: .72rem; font-weight: 600; color: var(--ink-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tl-d small { font-size: .62rem; font-weight: 600; color: var(--ink-3); }
.tl-d.is-weekend { color: var(--ink-3); }
.tl-d.is-today { background: var(--brand); color: var(--brand-ink); border-radius: 6px; }
.tl-d.is-today small { color: inherit; }
.tl-body { position: relative; flex: 1; }
.tl-bg { position: absolute; top: 0; bottom: 0; left: var(--name); width: var(--w); pointer-events: none; }
.tl-bg i { position: absolute; top: 0; bottom: 0; }
.tl-we { background: color-mix(in srgb, var(--sunk) 70%, var(--surface)); }
.tl-wk { width: 1px; background: var(--line); }
.tl-now { width: 2px; margin-left: -1px; background: var(--bad); opacity: .8; }
.tl-group .tl-name { gap: 8px; background: var(--canvas); font-weight: 700; }
.tl-group .tl-track { background: color-mix(in srgb, var(--canvas) 60%, transparent); }
.tl-group { min-height: 34px; }
.bar { position: absolute; top: 7px; z-index: 1; display: flex; align-items: center; height: 26px; min-width: 14px; padding: 0 9px; border-radius: 7px; font-size: .78rem; font-weight: 600; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  background: color-mix(in srgb, var(--c, var(--c-slate)) 26%, var(--surface)); color: color-mix(in srgb, var(--c, var(--c-slate)) 45%, var(--ink)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--c-slate)) 55%, transparent); }
[data-theme="dark"] .bar { background: color-mix(in srgb, var(--c, var(--c-slate)) 30%, var(--surface)); color: color-mix(in srgb, var(--c, var(--c-slate)) 55%, #fff); }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.bar:hover, .bar.is-moving { box-shadow: inset 0 0 0 2px var(--c, var(--c-slate)), var(--shadow-2); z-index: 2; }
.bar.is-short { padding: 0; }
.bar.is-short span { position: absolute; left: calc(100% + 7px); color: var(--ink-2); overflow: visible; }
.bar.is-done, [data-theme="dark"] .bar.is-done { background: var(--sunk); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.bar.is-done span { text-decoration: line-through; }
.bar.is-late { box-shadow: inset 0 0 0 2px var(--bad); }
.bar-h { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; touch-action: none; }
.bar-l { left: 0; } .bar-r { right: 0; }
.bar:hover .bar-h::after, .bar:focus-visible .bar-h::after { content: ''; position: absolute; top: 7px; bottom: 7px; left: 3px; width: 2px; border-radius: 2px; background: currentColor; opacity: .6; }
.tl-set, .tl-jump { position: absolute; top: 8px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px dashed var(--line-2); border-radius: 7px; font-size: .76rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; background: var(--surface); }
.tl-set { opacity: 0; }
.tl-row:hover .tl-set, .tl-set:focus-visible { opacity: 1; }
.tl-set:hover, .tl-jump:hover { color: var(--ink); border-color: var(--ink-3); }
.tl-jump { position: sticky; }

/* 10. Overview, team, wizard, settings, sign in --------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { display: grid; gap: 2px; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.stat-label { font-size: .8667rem; font-weight: 600; color: var(--ink-2); }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value.is-bad { color: var(--bad); }
.stat-note { font-size: .8rem; color: var(--ink-3); }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ov-grid .h2 { margin-bottom: 12px; }
.stack-bar { display: flex; gap: 3px; height: 14px; margin-bottom: 12px; }
.stack-bar i { min-width: 6px; border-radius: 4px; background: var(--c); }
.legend { display: grid; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.legend b { font-variant-numeric: tabular-nums; }
.legend .muted { width: 38px; text-align: right; font-size: .8rem; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 6px; }
.bars-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; min-width: 0; }
.bars-col i { width: 100%; max-width: 30px; min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--brand); }
.bars-col i.is-zero { background: var(--line); }
.bars-col span { font-size: .7rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.trows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0 -8px; }
.trow { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 38px; padding: 0 8px; border-radius: var(--r-sm); font-size: .9333rem; font-weight: 500; }
.trow:hover { background: var(--sunk); }
.loads { display: grid; gap: 9px; }
.load { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 22px 62px; align-items: center; gap: 12px; font-size: .9rem; }
.load b { text-align: right; font-variant-numeric: tabular-nums; }
.load .pill { min-height: 20px; padding: 0 7px; font-size: .72rem; justify-self: start; }
.feed { display: grid; gap: 12px; }
.feed li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; font-size: .9rem; }
.feed p { overflow-wrap: anywhere; }
.feed .muted { font-size: .78rem; }
.link-quiet { text-align: left; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; border-radius: 3px; }
.link-quiet:hover { color: var(--brand-text); text-decoration-color: currentColor; }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 15px 14px 12px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.person h2 { font-size: 1rem; font-weight: 700; }
.person p { font-size: .8667rem; }
.person-foot { display: flex; align-items: center; gap: 8px; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); font-size: .8667rem; }

.page-in--narrow { max-width: 760px; }
.wz-steps { display: flex; gap: 6px; margin-bottom: 14px; counter-reset: step; }
.wz-step { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 12px; border-radius: var(--r); background: var(--sunk); font-size: .9rem; font-weight: 600; color: var(--ink-3); }
.wz-step span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-num { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: .76rem; font-weight: 700; }
.wz-step.is-now { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--brand-text); }
.wz-step.is-now .wz-num { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.wz-step.is-done { color: var(--ink-2); }
.wz-step.is-done .wz-num { background: var(--brand-soft); border-color: transparent; color: var(--brand-text); }
.wz-panel { padding: 22px 22px 8px; }
.wz-panel h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.015em; }
.wz-panel h2 + p { margin-top: -10px; }
.wz-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; margin-top: 12px; border-top: 1px solid var(--line); }
.wz-templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wz-tpl { display: grid; gap: 2px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.wz-tpl:hover { border-color: var(--ink-3); }
.wz-tpl[aria-checked="true"] { border-color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-text); background: var(--brand-soft); }
.wz-tpl b { font-size: .9333rem; }
.wz-tpl span { font-size: .8rem; color: var(--ink-3); }
.wz-dots { display: flex; gap: 4px; margin-top: 5px; }
.wz-dots .dot { width: 22px; height: 6px; border-radius: 3px; }
.wz-cols { display: grid; gap: 6px; }
.wz-col { display: flex; align-items: center; gap: 8px; }
.wz-col .key { width: 14px; text-align: right; }
.wz-people { display: grid; gap: 2px; margin: 0 -8px; }
.wz-person { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 8px; border-radius: var(--r-sm); cursor: pointer; font-size: .9333rem; }
.wz-person:hover { background: var(--sunk); }
.wz-person .cb { margin: 0; }
.wz-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.wz-chips:focus-within { border-color: var(--brand-text); box-shadow: var(--focus); }
.wz-chips .input { flex: 1; min-width: 180px; border: 0; box-shadow: none !important; min-height: 28px; }
.wz-chips .pill { padding-right: 3px; }
.wz-review { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px 16px; align-items: start; padding: 4px 0 10px; }
.wz-review dt { font-size: .8667rem; font-weight: 600; color: var(--ink-3); padding-top: 2px; }
.wz-review dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; overflow-wrap: anywhere; }

.set { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.set-nav { display: grid; gap: 2px; position: sticky; top: 16px; }
.set-nav button { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--r-sm); font-weight: 600; font-size: .9333rem; color: var(--ink-2); }
.set-nav button:hover { background: var(--hover); color: var(--ink); }
.set-nav button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.set-nav button[aria-selected="true"] .icon { color: var(--brand-text); }
.set-panel { padding: 22px; gap: 16px; }
.set-panel h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.015em; }
.set-panel h2 + p { margin-top: -10px; }
.set-panel form.stack { max-width: 520px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting b { display: block; font-size: .9333rem; }
.setting small { display: block; font-size: .8rem; color: var(--ink-3); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin-top: 6px; border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); border-radius: var(--r); }
.rows { display: grid; gap: 6px; }
.srow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.srow-move { display: flex; flex-direction: column; }
.srow-move .icon-btn { height: 18px; }
.srow-limit { display: flex; align-items: center; gap: 6px; }
.srow-limit .input { width: 58px; }
.srow-count { width: 62px; text-align: right; font-size: .8rem; white-space: nowrap; }
.srow .swatch { width: 18px; height: 18px; }
.srow .swatches { gap: 5px; flex-wrap: nowrap; }

.auth-body { min-height: 100vh; min-height: 100dvh; }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth-form { display: flex; flex-direction: column; gap: 22px; width: 100%; max-width: 440px; margin: 0 auto; padding: 30px 28px; }
.auth-view { display: grid; gap: 16px; margin: auto 0; }
.auth-view h1 { font-size: 1.8rem; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; }
.auth-view h1 + p { margin-top: -10px; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 40px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; translate: 0 -50%; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .8rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-switch { text-align: center; color: var(--ink-2); }
.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .8rem; }
.auth-side { display: grid; align-content: center; justify-items: center; gap: 28px; padding: 40px; background: var(--brand); color: var(--brand-ink); overflow: hidden; }
.auth-board { display: flex; gap: 12px; align-items: flex-start; rotate: -3deg; color: var(--ink); }
.auth-board .col { flex: 0 0 240px; box-shadow: var(--shadow-3); }
.auth-board .card { cursor: default; }
.auth-line { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; text-align: center; max-width: 18ch; text-wrap: balance; }

/* 11. Menus, dialogs, toasts ------------------------------------- */
.menu { position: fixed; z-index: 110; min-width: 200px; max-width: min(320px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); overflow-y: auto; padding: 5px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--raised); box-shadow: var(--shadow-3); }
.menu[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 7px; text-align: left; font-size: .9063rem; color: var(--ink); text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; box-shadow: none; }
.menu-item .icon { width: 16px; height: 16px; color: var(--ink-3); }
.menu-item.danger, .menu-item.danger .icon { color: var(--bad); }
.menu-item small { display: block; font-size: .75rem; color: var(--ink-3); line-height: 1.3; }
.menu-item .check { margin-left: auto; color: var(--ink); visibility: hidden; }
.menu-item[aria-checked="true"] .check { visibility: visible; }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.menu-label { padding: 6px 10px 3px; font-size: .75rem; font-weight: 600; color: var(--ink-3); }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(12, 15, 22, .55); animation: lw-fade .14s ease-out; }
.modal[hidden] { display: none; }
.modal-box { display: flex; flex-direction: column; width: 100%; max-width: 480px; max-height: min(720px, calc(100dvh - 32px)); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: lw-rise .18s ease-out; }
.modal-box.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 20px; }
.modal-head h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes lw-fade { from { opacity: 0; } }
@keyframes lw-rise { from { opacity: 0; translate: 0 10px; } }

.toasts { position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 8px 16px; border-radius: 99px; background: var(--ink); color: var(--canvas); font-size: .9063rem; font-weight: 500; box-shadow: var(--shadow-3); animation: lw-rise .18s ease-out; pointer-events: auto; }
.toast .icon { width: 16px; height: 16px; }
.toast.is-out { opacity: 0; translate: 0 6px; transition: opacity .2s, translate .2s; }

.scrim { position: fixed; inset: 0; z-index: 69; background: rgba(12, 15, 22, .5); }

.toast-act { margin-left: 4px; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--canvas) 18%, transparent); color: inherit; font-weight: 700; font-size: .8667rem; }
.toast-act:hover { background: color-mix(in srgb, var(--canvas) 30%, transparent); }
.toast-act:focus-visible { outline-color: var(--canvas); }
.modal-box.wide { max-width: 920px; }
.keys { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 20px; align-items: center; font-size: .9333rem; }
.keys dd { display: flex; gap: 4px; justify-content: flex-end; }

/* 12. Responsive, print, reduced motion ----------------------------------- */
.scrim { display: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.side-buy { color: var(--brand-text) !important; }
.top--line { border-bottom: 1px solid var(--line); }
.top-title { font-weight: 700; font-size: 1rem; }

@media (max-width: 900px) {
  .app, .app.is-side-closed { grid-template-columns: minmax(0, 1fr); }
  .side, .app.is-side-closed .side { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 70; width: min(300px, 86vw); translate: -102% 0; transition: translate .2s ease-out; box-shadow: var(--shadow-3); visibility: hidden; }
  .is-side-open .side { translate: 0 0; visibility: visible; }
  .is-side-open .scrim { display: block; }
  .only-mobile { display: inline-grid; }
  .hide-mobile { display: none !important; }
  .top { padding: 0 12px 0 8px; }
  .viewbar { padding: 0 12px 10px; }
  .filters { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .input-icon { width: 150px; flex: none; }
  .views { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .views a[aria-current="page"]::after { bottom: 0; }
  .board { padding: 12px; }
  .page-in { padding: 18px 14px 50px; }
  .task { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .task-main, .task-side { overflow: visible; }
  .task-side { border-left: 0; border-top: 1px solid var(--line); grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 16px; }
  .task-side .task-info { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .cal-in { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; }
}
@media (max-width: 700px) {
  .cal-in { padding: 12px; }
  .cal-day { min-height: 54px; align-items: center; padding: 6px 2px; cursor: pointer; }
  .cal-num { align-self: center; }
  .cal-evs { display: none; }
  .cal-dots { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-text); font-size: .68rem; font-weight: 700; }
  .cal-day.is-picked { box-shadow: inset 0 0 0 2px var(--brand-text); }
  .cal-dow { padding: 6px 2px; text-align: center; }
  .cal-agenda { display: block; margin-top: 12px; }
  .cal-bar h2 { font-size: 1rem; }
  .tl-wrap { padding: 12px; }
  .tl { --name: 150px; }
  .tl-name .avatar { display: none; }
  .list-in { padding: 12px 12px 30px; }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .set { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .set-nav button { flex: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .srow { flex-wrap: wrap; }
  .srow > .input { flex: 1 1 160px; }
}
@media (max-width: 560px) {
  .wz-step span:last-child { display: none; }
  .wz-step { justify-content: center; }
  .wz-templates { grid-template-columns: minmax(0, 1fr); }
  .wz-panel { padding: 18px 16px 6px; }
  .wz-foot { padding: 12px 16px; flex-wrap: wrap; }
  .wz-review { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .wz-review dd { margin-bottom: 8px; }
  .setting, .danger-zone { flex-wrap: wrap; }
  .set-panel { padding: 16px; }
  .load { grid-template-columns: minmax(0, 1fr) 70px 22px; }
  .load .pill, .load > span:last-child:empty { display: none; }
  .people { grid-template-columns: minmax(0, 1fr); }
  .auth-form { padding: 22px 18px; }
  .hide-xs { display: none !important; }
  :root { --col-w: 272px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 0; align-items: end; }
  .modal-box { max-width: none; max-height: 94dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .task-main { padding: 4px 16px 18px; }
  .task-side { padding: 14px 16px 20px; }
  .task-head { padding: 12px 8px 4px 16px; }
  .page-head h1 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .side, .top .icon-btn, .viewbar, .toasts, .scrim, #newTask { display: none !important; }
  .app-body { height: auto; overflow: visible; }
  .app { display: block; height: auto; }
  .view { overflow: visible; }
}
