/* Home tasks — page styles.
   Font: Montserrat (fonts/, SIL Open Font License, see fonts/OFL.txt). Icon: img/icon.svg.
   One accent colour for actions and selection, colour for state only, aligned columns. */

@font-face { font-family: "Montserrat"; src: url("fonts/Montserrat-VF.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fonts/Montserrat-Italic-VF.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --blue: #2f5f8a;             /* primary action, links, selection */
  --blue-hover: #003866;
  --blue-light: #5b9bd5;       /* focus ring only */
  --ink: #1b2733;
  --ink-2: #3d4a57;
  --ink-3: #5f6b78;            /* secondary text, 5.4:1 on white */
  --ink-4: #8a95a1;            /* icons and decoration only */
  --line: #e4e7eb;
  --line-2: #eff1f3;
  --line-3: #d3d8de;           /* control borders */
  --hover: #f6f7f9;
  --fill: #f1f3f5;
  --sel: #edf3f9;
  --font: "Montserrat", "Segoe UI", system-ui, sans-serif;

  /* names app.js and older markup use */
  --bg: #ffffff;
  --panel: #ffffff;
  --text: var(--ink);
  --muted: var(--ink-3);
  --accent: var(--blue);
  --accent-soft: var(--sel);
  --warn: #8a5300;  --warn-soft: #fdf4dc;
  --bad: #b42335;   --bad-soft: #fcebec;
  --ok: #1f7a45;    --ok-soft: #e6f3eb;
  --star: #b07c00;
  --radius: 6px;

  --topbar-h: 56px;
  --viewbar-h: 44px;
  --chrome-h: calc(var(--topbar-h) + var(--viewbar-h));
  --pad-x: 24px;
  --focus: 0 0 0 3px rgba(46, 147, 202, .28);
  font-size: 14px;

  /* 16px line icons, used as masks so they take the text colour */
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M8 3v10M3 8h10'/%3E%3C/svg%3E");
  --i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14'/%3E%3C/svg%3E");
  --i-import: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v7.5M5 6.8 8 9.8l3-3M2.5 10v2.5a1 1 0 0 0 1 1h9a1 1 0 0 0 1-1V10'/%3E%3C/svg%3E");
  --i-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M2.5 3.5a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v6.5a1 1 0 0 1-1 1H7L4 13.5V11h-.5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
  --i-history: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.8 8a5.2 5.2 0 1 0 1.5-3.7M2.5 2.5V5H5M8 5.2v3l2 1.3'/%3E%3C/svg%3E");
  --i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.2 8 9.8l3.5-3.6'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.4 6.8 11 12 5.4'/%3E%3C/svg%3E");
  --i-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4.5 8h7'/%3E%3C/svg%3E");
  --i-clip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 7.6 8.3 12.3a3 3 0 0 1-4.3-4.2L9 3a2 2 0 0 1 2.9 2.8L7 10.7a1 1 0 0 1-1.5-1.4l4.4-4.4'/%3E%3C/svg%3E");
  --i-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M3.5 1.8h5.3l3.7 3.7v8.7H3.5zM8.8 1.8v3.7h3.7M5.8 8.5h4.4M5.8 11h4.4'/%3E%3C/svg%3E");
  --i-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M6.8 9.2a2.6 2.6 0 0 0 3.7 0l2.2-2.2A2.6 2.6 0 0 0 9 3.3l-.8.8M9.2 6.8a2.6 2.6 0 0 0-3.7 0L3.3 9a2.6 2.6 0 0 0 3.7 3.7l.8-.8'/%3E%3C/svg%3E");
  --i-block: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5.6'/%3E%3Cpath d='m4.1 11.9 7.8-7.8'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5.6'/%3E%3Cpath d='M8 5v3.5M8 11h.01'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 13px; font-weight: 450; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--line-3); border-radius: var(--radius); padding: 6px 10px; background: #fff; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--ink-4); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #b9c1ca; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-light); box-shadow: var(--focus); }
input[type=checkbox] { accent-color: var(--blue); width: 15px; height: 15px; margin: 0; flex: none; cursor: pointer; }
input[type=checkbox]:focus { box-shadow: none; }
textarea { width: 100%; resize: vertical; min-height: 60px; }
select { cursor: pointer; }
option { color: var(--ink); background: #fff; }
:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
b, strong { font-weight: 600; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
* { scrollbar-width: thin; scrollbar-color: #cdd3da transparent; }

/* icon helper: any element with --ic set gets a 16px icon in currentColor */
#btn-import::before, #btn-ask::before, #btn-log::before, .n-comments::before, .n-results::before,
.res::before, .flags .chip.bad::before, .col-due.bad::before, .capture::before, .filters::before {
  content: ""; flex: none; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-3); border-radius: var(--radius); background: #fff; color: var(--ink); font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; transition: background .08s, border-color .08s; }
.btn:hover { background: var(--hover); border-color: #b9c1ca; }
.btn:active { background: var(--fill); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--fill); }
.btn.link { height: auto; padding: 2px 6px; border-color: transparent; background: none; color: var(--blue); font-weight: 550; }
.btn.link:hover { background: var(--sel); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #e6aeb5; }
.btn.link.danger { color: var(--ink-4); font-size: 13px; }
.btn.link.danger:hover { color: var(--bad); background: var(--bad-soft); }

/* ------------------------------------------------------------------ top bar */
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 16px; height: var(--topbar-h); padding: 0 var(--pad-x); background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; font-size: 14px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.brand::before { content: ""; width: 23px; height: 20px; background: url("img/icon.svg") center / contain no-repeat; }
.capture { --ic: var(--i-plus); position: relative; flex: 1; min-width: 0; max-width: 620px; margin-left: 24px; display: flex; align-items: center; }
.capture::before { position: absolute; left: 11px; color: var(--ink-3); pointer-events: none; }
.capture input { width: 100%; height: 36px; padding: 0 12px 0 34px; border-color: transparent; background: var(--fill); font-size: 13px; }
.capture input:hover { border-color: var(--line-3); }
.capture input:focus { background: #fff; border-color: var(--blue-light); }
.capture-hint { position: absolute; left: 0; top: calc(100% + 6px); z-index: 7; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); color: var(--ink-2); font-size: 12px; }
.capture-hint:empty { display: none; }
.top-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
#btn-import { --ic: var(--i-import); }
#btn-ask { --ic: var(--i-chat); }
#btn-log { --ic: var(--i-history); }
.top-actions .btn::before { color: var(--ink-3); }
.me { display: flex; align-items: center; gap: 12px; padding-left: 16px; border-left: 1px solid var(--line); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.me #me-name { color: var(--ink); font-weight: 600; font-size: 13px; }
.me-links { display: flex; gap: 12px; }
.me a { color: var(--ink-3); }
.me a:hover { color: var(--ink); }
.sync { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; color: var(--ink-3); }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.sync::after { content: "Live"; }
.sync.bad { color: var(--bad); font-weight: 600; }
.sync.bad::before { background: var(--bad); }
.sync.bad::after { content: "Offline"; }
.claude-light { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.claude-light:hover { border-color: var(--ink-3); }
.claude-light::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.claude-light.ok::before { background: var(--ok); }
.claude-light.todo { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.claude-light.todo::before { background: var(--warn); }
.claude-light.off { color: var(--ink-3); font-weight: 500; }
.setup-steps { margin: 12px 0 0; padding-left: 22px; font-size: 13.5px; line-height: 1.5; }
.setup-steps li { margin-bottom: 10px; }
.setup-cmd { display: flex; gap: 8px; margin-top: 6px; }
.setup-cmd input { flex: 1; min-width: 0; font-family: Consolas, monospace; font-size: 12.5px; }
.setup-wait { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--hover); color: var(--ink-2); font-size: 13px; }
.setup-wait::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: setup-pulse 1.4s ease-in-out infinite; }
.setup-wait.done { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.setup-wait.done::before { background: var(--ok); animation: none; }
@keyframes setup-pulse { 50% { opacity: .25; } }
.offline { position: sticky; top: var(--topbar-h); z-index: 6; padding: 8px var(--pad-x); background: var(--bad); color: #fff; font-size: 13px; font-weight: 550; }

/* ------------------------------------------------------------------ view bar (former sidebar) */
.sidebar { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; align-items: stretch; gap: 16px; height: var(--viewbar-h); padding: 0 var(--pad-x); background: #fff; border-bottom: 1px solid var(--line); }
#views { display: flex; align-items: stretch; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.view-btn { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: none; background: none; color: var(--ink-3); font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.view-btn:hover { color: var(--ink); }
.view-btn.active { color: var(--ink); }
.view-btn.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--blue); }
.view-btn .count { color: var(--ink-4); font-size: 12px; font-weight: 500; }
.view-btn.active .count { color: var(--ink-3); }
.view-btn.attention .count { color: var(--warn); font-weight: 650; }
.view-btn:focus-visible { outline-offset: -4px; }
.filters { --ic: var(--i-search); position: relative; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filters::before { position: absolute; left: 10px; color: var(--ink-4); pointer-events: none; width: 14px; height: 14px; }
.filters input, .filters select { height: 30px; font-size: 12.5px; border-color: var(--line); }
#search { width: 200px; padding-left: 30px; background: var(--fill); border-color: transparent; }
#search:hover { border-color: var(--line-3); }
#search:focus { background: #fff; border-color: var(--blue-light); }
.filters select { max-width: 150px; padding: 0 8px; color: var(--ink-2); }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); font-size: 12px; color: var(--ink-4); }
.sidebar-foot a { color: var(--ink-3); }

/* ------------------------------------------------------------------ list */
.layout { display: flex; min-height: calc(100vh - var(--chrome-h)); }
.list { flex: 1; min-width: 0; padding: 0 0 96px; container-type: inline-size; container-name: list; }
.view-intro { margin: 0; padding: 18px var(--pad-x) 6px; max-width: 110ch; color: var(--ink-3); font-size: 12.5px; }
.list h2 { position: sticky; top: var(--chrome-h); z-index: 2; display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 22px var(--pad-x) 8px; background: #fff; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 650; letter-spacing: .02em; color: var(--ink-2); }
.empty { padding: 96px var(--pad-x); text-align: center; color: var(--ink-3); }
.loading { padding: 24px 0; color: var(--ink-3); }

.row { position: relative; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 var(--pad-x) 0 calc(var(--pad-x) - 8px); border-bottom: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.row:hover { background: var(--hover); }
.row.selected { background: var(--sel); }
.row.selected::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--blue); }

.twisty, .twisty-space { width: 16px; height: 16px; flex: none; }
.twisty { padding: 0; border: none; border-radius: 4px; background: var(--ink-4); color: transparent; font-size: 0; cursor: pointer; -webkit-mask: var(--i-chevron) center / 14px no-repeat; mask: var(--i-chevron) center / 14px no-repeat; transition: transform .12s; }
.twisty:hover { background: var(--ink); }
.twisty[title="Show follow-ups"] { transform: rotate(-90deg); }
.check { position: relative; width: 16px; height: 16px; flex: none; padding: 0; border: 1.5px solid #9aa4ae; border-radius: 50%; background: #fff; color: transparent; font-size: 0; cursor: pointer; }
.check::after { content: ""; position: absolute; inset: 0; background: #fff; -webkit-mask: var(--i-check) center / 11px no-repeat; mask: var(--i-check) center / 11px no-repeat; opacity: 0; }
.check:hover { border-color: var(--ok); }
.check:hover::after { background: var(--ok); opacity: .7; }
.check.done { background: var(--ok); border-color: var(--ok); }
.check.done::after { background: #fff; opacity: 1; }
.check.dropped { background: #9aa4ae; border-color: #9aa4ae; }
.check.dropped::after { background: #fff; opacity: 1; -webkit-mask-image: var(--i-dash); mask-image: var(--i-dash); }

/* columns: #id · title · flags · area · owner · due · counts */
.row-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 44px minmax(200px, 1fr) fit-content(45%) 100px 112px 56px 56px; column-gap: 14px; align-items: center; padding: 8px 0; }
.meta { display: contents; }
.tid { grid-row: 1; grid-column: 1; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.row-title { grid-row: 1; grid-column: 2; min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title .star { margin-right: 6px; }
.flags { grid-row: 1; grid-column: 3; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; min-width: 0; }
.flags:empty { display: none; }
.col-area { grid-row: 1; grid-column: 4; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-owner { grid-row: 1; grid-column: 5; display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-owner::before { content: attr(data-i); flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #dfe9f3; color: var(--blue); font-size: 10px; font-weight: 700; }
.col-owner.nobody { color: var(--ink-4); }
.col-owner.nobody::before { background: transparent; border: 1px dashed #b9c1ca; }
.col-due { grid-row: 1; grid-column: 6; display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.col-due.bad { --ic: var(--i-alert); color: var(--bad); font-weight: 600; }
.col-due.bad::before { width: 13px; height: 13px; }
.col-counts { grid-row: 1; grid-column: 7; display: flex; justify-content: flex-end; gap: 10px; font-size: 12px; color: var(--ink-3); }
.n-comments, .n-results { display: inline-flex; align-items: center; gap: 3px; }
.n-comments { --ic: var(--i-chat); }
.n-results { --ic: var(--i-clip); }
.n-comments::before, .n-results::before { width: 13px; height: 13px; color: var(--ink-4); }
.outcome-line { grid-row: 2; grid-column: 2 / -1; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star { color: var(--star); font-size: 12px; }

.row.closed .row-title { color: var(--ink-3); }
.row.closed.done .row-title { text-decoration: line-through; text-decoration-color: #9aa4ae; }
.row.closed.dropped .row-title { font-style: italic; }
.row.context .row-main, .row.context .check, .row.context .twisty { opacity: .5; }
.row.dragging { opacity: .35; }
.row.drop-target { background: var(--sel); box-shadow: inset 0 0 0 2px var(--blue-light); }
.drop-top { display: none; margin: 10px var(--pad-x); padding: 10px; border: 1px dashed var(--line-3); border-radius: var(--radius); text-align: center; color: var(--ink-3); font-size: 12.5px; }
body.drag-on .drop-top { display: block; }
.drop-top.drop-target { border-color: var(--blue-light); background: var(--sel); color: var(--blue); }

/* tags — only for state; plain text everywhere else */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
div.chip, p.chip { display: flex; height: auto; padding: 5px 9px; white-space: normal; align-self: flex-start; line-height: 1.4; }
.chip.warn { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.chip.bad { border-color: transparent; background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.chip.ok { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.chip.owner { border-color: transparent; background: var(--sel); color: var(--blue); font-weight: 600; }
.chip.nobody { border-style: dashed; color: var(--ink-3); }
.flags .chip { display: inline-block; flex: none; min-width: 0; max-width: 100%; line-height: 20px; overflow: hidden; text-overflow: ellipsis; }
.flags .chip.bad::before { display: inline-block; vertical-align: -2px; margin-right: 5px; }
.flags .chip.bad { --ic: var(--i-block); }
.flags .chip.bad::before { width: 13px; height: 13px; }

/* ------------------------------------------------------------------ inspector */
.detail { position: sticky; top: var(--chrome-h); width: 440px; flex: none; height: calc(100vh - var(--chrome-h)); overflow-y: auto; padding: 0 var(--pad-x) 48px; background: #fff; border-left: 1px solid var(--line); }
.detail-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 44px; margin: 0 calc(-1 * var(--pad-x)); padding: 0 12px 0 var(--pad-x); background: #fff; border-bottom: 1px solid var(--line-2); color: var(--ink-3); font-size: 12px; }
#d-head { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.detail-head > span:last-child { display: flex; align-items: center; gap: 8px; flex: none; }
.detail-head .btn.link { color: var(--ink-3); font-size: 15px; padding: 2px 8px; }
.detail-head .btn.link:hover { background: var(--fill); color: var(--ink); }
.detail .title-input { width: calc(100% + 16px); min-height: 0; margin: 16px -8px 4px; padding: 4px 8px; border-color: transparent; background: transparent; font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -.015em; color: var(--ink); resize: none; }
.detail .title-input:hover { background: var(--hover); }
.detail .title-input:focus { background: #fff; border-color: var(--blue-light); }

.fields { display: flex; flex-direction: column; gap: 0; margin: 4px 0 8px; }
.fields > label { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; column-gap: 8px; min-height: 34px; font-size: 12.5px; color: var(--ink-3); }
.fields > label > select, .fields > label > input:not([type=checkbox]) { width: 100%; height: 30px; padding: 0 8px; border-color: transparent; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink); }
.fields > label > select:hover, .fields > label > input:not([type=checkbox]):hover { background: var(--hover); }
.fields > label > select:focus, .fields > label > input:not([type=checkbox]):focus { background: #fff; border-color: var(--blue-light); }
.fields > .toggle { display: flex; align-items: center; gap: 8px; min-height: 34px; padding-left: 120px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.fields > #d-tick { order: -1; margin: 0 0 10px; }
.fields > #d-tick:empty { display: none; }
#d-tick .btn { margin-top: 0 !important; height: 32px; padding: 0 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; font-size: 12.5px; color: var(--ink-3); }
.field > * { font-size: 13px; color: var(--ink); }
.field > textarea { line-height: 1.55; }
.detail .field > textarea, .detail .field > input { background: var(--hover); border-color: transparent; }
.detail .field > textarea:hover, .detail .field > input:hover { border-color: var(--line); }
.detail .field > textarea:focus, .detail .field > input:focus { background: #fff; border-color: var(--blue-light); }

.section { margin: 0 calc(-1 * var(--pad-x)); padding: 18px var(--pad-x) 20px; border-top: 1px solid var(--line-2); }
.section:empty { display: none; }
.section h3, .modal h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.section.results .field:first-of-type { margin-top: 0; }
.section > .small.muted, #d-links > .small.muted { margin: 12px 0 2px; }
.section > h3 + .small.muted, #d-links > .small.muted:first-child { margin-top: 0; }
.linkrow { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 0; font-size: 13px; }
.linkrow > .chip { flex: none; min-width: 64px; justify-content: center; height: 20px; font-size: 11.5px; }
.linkrow .tlink { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.linkrow .tlink:hover { color: var(--blue); }
#d-results .linkrow { align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
#d-results .linkrow .tlink > .small { margin: 1px 0 0 22px; }
#d-results .linkrow .tlink > .small[title] { color: var(--ink-2); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }
#d-results > .small { padding: 4px 0; }
.res { display: inline-flex; align-items: flex-start; gap: 7px; font-weight: 550; }
.res::before { margin-top: 1px; color: var(--ink-3); }
.res-document { --ic: var(--i-doc); }
.res-session { --ic: var(--i-chat); }
.res-link { --ic: var(--i-link); }
.add-link { display: flex; gap: 6px; margin-top: 8px; }
.add-link input { flex: 1; min-width: 0; }
.add-link select { flex: none; max-width: 46%; }
.add-link input, .add-link select, .add-link .btn { height: 30px; font-size: 12.5px; }
.result-add { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.result-add .add-link { margin-top: 0; }
.result-add > .small { color: var(--ink-3); }
.comment { position: relative; margin: 14px 0; padding-left: 32px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment::before { content: attr(data-i); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #dfe9f3; color: var(--blue); font-size: 10.5px; font-weight: 700; }
.comment .who { margin-bottom: 1px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: normal; }
details > summary { cursor: pointer; font-size: 13px !important; font-weight: 600; color: var(--ink) !important; list-style-position: outside; }
.history { margin: 10px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink-3); }
.history li { margin: 4px 0; }
.saved { color: var(--ok); font-size: 12px; font-weight: 600; }
.quote { margin: 6px 0; padding: 6px 0 6px 12px; border-left: 2px solid var(--line-3); color: var(--ink-2); font-size: 13px; font-style: italic; overflow-wrap: anywhere; }
.danger-zone { padding-top: 16px; }
.danger-zone .btn.danger { border-color: transparent; padding: 0 8px; margin-left: -8px; }

/* ------------------------------------------------------------------ dialogs */
.backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: start center; padding: 10vh 16px; overflow-y: auto; background: rgba(16, 24, 40, .40); }
.modal { width: min(600px, 100%); padding: 0 24px; border-radius: 10px; background: #fff; box-shadow: 0 24px 64px rgba(16, 24, 40, .24); overflow: hidden; }
.modal.wide { width: min(920px, 100%); }
.modal > h2 { margin: 0 -24px 0; padding: 20px 24px 6px; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.modal > h2 + * { margin-top: 0; }
.modal > p { margin: 0 0 14px; }
.modal > h2 + p.muted { margin-bottom: 18px; }
.modal > h2 + :not(p) { margin-top: 14px; }
.modal h3 { margin-top: 16px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.modal > .modal-actions, .modal > div:last-child > .modal-actions:last-child { margin: 24px -24px 0; padding: 14px 24px; border-top: 1px solid var(--line-2); }
.modal-actions .left { margin-right: auto; }
.fu-row { display: flex; gap: 6px; margin-bottom: 6px; }
.fu-row input { flex: 1; min-width: 0; }
.fu-row select { width: 150px; }
.conflict-box { max-height: 180px; overflow-y: auto; margin: 4px 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--hover); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* import review */
.proposal { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.proposal:first-of-type { border-top: 1px solid var(--line-2); }
.proposal > input[type=checkbox] { margin-top: 8px; }
.proposal.off { opacity: .45; }
.proposal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.proposal-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.proposal-fields select, .proposal-fields input[type=date] { height: 28px; padding: 0 8px; font-size: 12.5px; }
.proposal-fields label { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; color: var(--ink-2); }
.proposal .title-in { width: calc(100% + 8px); margin-left: -8px; padding: 4px 8px; border-color: transparent; background: transparent; font-size: 14px; font-weight: 600; }
.proposal .title-in:hover { background: var(--hover); }
.proposal .title-in:focus { background: #fff; border-color: var(--blue-light); }

/* Ask */
.chat { display: flex; flex-direction: column; gap: 18px; max-height: 56vh; overflow-y: auto; margin: 4px 0 16px; padding: 2px; }
.msg { line-height: 1.6; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.q { align-self: flex-end; max-width: 75%; padding: 8px 14px; border-radius: 14px 14px 4px 14px; background: var(--fill); color: var(--ink); }
.msg.a { align-self: stretch; max-width: none; padding: 0 0 0 32px; position: relative; }
.msg.a::before { content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: #dfe9f3 url("img/icon.svg") center / 13px no-repeat; }
.msg.a.muted { color: var(--ink-3); font-style: italic; }
.msg .tref { font-weight: 600; }
.msg .basis { margin-top: 8px; font-size: 12px; color: var(--ink-3); white-space: normal; }
.chat-input { display: flex; gap: 8px; align-items: stretch; padding: 8px; border: 1px solid var(--line-3); border-radius: 10px; }
.chat-input:focus-within { border-color: var(--blue-light); box-shadow: var(--focus); }
.chat-input textarea { min-height: 40px; padding: 4px 6px; border: none; box-shadow: none !important; resize: none; }
.chat-input .btn { align-self: flex-end; }
.proposals { margin-top: 14px; white-space: normal; }
.proposals:not(.done) { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.proposals:not(.done) > .small.muted:first-child { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--hover); color: var(--ink-2); font-weight: 600; }
.proposals.done { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--ok); font-weight: 600; }
.proposals.done.muted { color: var(--ink-3); font-weight: 500; }
.proposals .modal-actions { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--hover); }
.proposals > b { display: block; margin-bottom: 6px; }
.proposals > input { width: 100%; margin: 4px 0 8px; }
.proposal-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; font-size: 13px; cursor: pointer; }
.proposal-row + .proposal-row { border-top: 1px solid var(--line-2); }
.proposal-row:hover { background: var(--hover); }
.proposal-row.invalid { opacity: .6; cursor: default; }
.proposal-row.invalid:hover { background: none; }
.proposal-row > input { margin-top: 2px; }
.proposal-row > div { flex: 1; min-width: 0; }
.diff { margin-top: 6px; padding: 6px 10px; border-radius: var(--radius); background: var(--hover); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
del { padding: 0 2px; border-radius: 3px; background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
ins { padding: 0 2px; border-radius: 3px; background: var(--ok-soft); color: var(--ok); text-decoration: underline dotted; text-underline-offset: 3px; }
.tref { color: var(--blue); font-weight: 550; cursor: pointer; }
.tref:hover { text-decoration: underline; text-underline-offset: 2px; }

/* change log */
.changelog { max-height: 62vh; overflow-y: auto; margin: 0 -24px; padding: 0 24px; }
.cl-batch { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.cl-batch:first-child { border-top: 1px solid var(--line-2); }
.cl-batch.undone { opacity: .5; }
.cl-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-3); }
.cl-head b { color: var(--ink); }
.cl-head .chip { margin-left: 8px; height: 20px; font-size: 11.5px; }
.cl-head .btn { height: 26px; padding: 0 10px; font-size: 12px; }
.cl-batch ul { margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.cl-batch li { padding: 2px 0; overflow-wrap: anywhere; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 30; max-width: 90vw; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; box-shadow: 0 12px 32px rgba(16, 24, 40, .28); }
.toast.bad { background: var(--bad); }

/* ------------------------------------------------------------------ login and first-time setup */
.auth-page { display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 24px 16px; background: var(--hover); }
.auth-card { display: flex; flex-direction: column; gap: 16px; width: min(380px, 100%); padding: 36px 32px 32px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.auth-card::before { content: ""; height: 28px; margin-bottom: 14px; background: url("img/icon.svg") left center / auto 28px no-repeat; }
.auth-card h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.auth-card p { margin: 0; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.auth-card label input { height: 38px; font-size: 13.5px; font-weight: 450; color: var(--ink); }
.auth-card .btn.primary { height: 38px; margin-top: 6px; font-size: 13.5px; }
.auth-error { margin: 0; padding: 9px 12px; border-radius: var(--radius); background: var(--bad-soft); color: var(--bad); font-size: 12.5px; font-weight: 500; }

/* ------------------------------------------------------------------ Knowledge */
.kcard { display: grid; grid-template-columns: minmax(0, 680px) minmax(220px, 340px); justify-content: start; column-gap: 56px; padding: 18px var(--pad-x) 20px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.kcard:hover { background: var(--hover); }
.kcard-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.kcard-head b { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.kcard-head .small { color: var(--ink-3); }
.kcard-summary { grid-column: 1; max-width: 80ch; margin: 0; font-size: 13px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.kcard-links { grid-column: 2; grid-row: 2 / span 2; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.kcard-links br { display: none; }
.kcard-links .res { margin-top: 6px; }
.kcard-links .res:first-child { margin-top: 0; }
.kcard-links .small { margin-left: 22px; color: var(--ink-3); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11px; }
.kcard > .small.muted:last-child { grid-column: 1; margin-top: 10px; }

/* the list narrows when the task panel is open: drop the least important columns first */
@container list (max-width: 1040px) {
  .row-main { grid-template-columns: 44px minmax(180px, 1fr) fit-content(45%) 112px 56px 56px; }
  .col-area { display: none; }
  .col-owner { grid-column: 4; } .col-due { grid-column: 5; } .col-counts { grid-column: 6; }
}
@container list (max-width: 760px) {
  .row-main { grid-template-columns: 40px minmax(140px, 1fr) fit-content(160px) 56px; }
  .col-owner, .col-counts { display: none; }
  .col-due { grid-column: 4; }
}

/* ------------------------------------------------------------------ narrow screens */
@media (max-width: 1180px) {
  .claude-light { font-size: 0; gap: 0; }
  .claude-light::after { content: "Claude"; margin-left: 6px; font-size: 12px; }
  .sidebar-foot { display: none; }
  #search { width: 160px; }
}
@media (max-width: 900px) {
  :root { --pad-x: 14px; --viewbar-h: 88px; }
  .brand, .me, .top-actions .btn { font-size: 0; gap: 0; }
  .brand { gap: 0; }
  .me { display: none; }
  .capture { margin-left: 0; }
  .sidebar { flex-direction: column; gap: 0; height: auto; }
  #views { height: 44px; }
  .filters { margin-left: 0; height: 44px; }
  .filters > * { flex: 1 1 0; min-width: 0; max-width: none; }
  #search { flex: 1.4 1 0; width: auto; }
  .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .detail { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 10; width: auto; height: auto; border-left: none; }
  .row-main { grid-template-columns: 36px minmax(0, 1fr) 54px; }
  .flags, .col-area, .col-counts { display: none; }
  .col-owner { display: none; }
  .col-due { grid-column: 3; }
  .kcard { grid-template-columns: 1fr; }
  .kcard-links { grid-column: 1; grid-row: auto; margin-top: 10px; }
}

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


/* Needs a look: why a task is listed and the buttons that clear it (added after v3) */
.look-hint { display: flex; flex-direction: column; gap: 6px; padding: 2px var(--pad-x) 12px calc(var(--pad-x) + 74px); border-bottom: 1px solid var(--line-2); background: #fff; }
.look-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; color: var(--ink-2); }
.look-text { position: relative; padding-left: 12px; }
.look-text::before { content: ""; position: absolute; left: 0; top: .45em; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.look-fixes { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.look-fixes .btn.small, .look-fixes select.small, .look-fixes input.small { height: 26px; padding: 0 10px; font-size: 12px; }
.look-fixes input.small { padding: 0 6px; }
.look-hint.in-panel { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--warn-soft); border-left: 3px solid var(--warn); border-radius: var(--radius); background: var(--warn-soft); }
.look-head { font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: var(--warn); text-transform: uppercase; }
.look-hint.in-panel .look-text::before { display: none; }
.look-hint.in-panel .look-text { padding-left: 0; }
@container list (max-width: 760px) { .look-hint { padding-left: calc(var(--pad-x) + 40px); } }


/* Adjustable task panel: drag handle on its left edge (added after v3) */
.detail-grip { position: sticky; top: var(--chrome-h); z-index: 3; flex: none; width: 9px; margin: 0 -5px 0 -4px; height: calc(100vh - var(--chrome-h)); cursor: col-resize; touch-action: none; }
.detail-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 3px; background: transparent; transition: background .1s; }
.detail-grip:hover::after, body.resizing .detail-grip::after { background: var(--blue-light); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .list, body.resizing .detail { pointer-events: none; }
.detail { max-width: 66vw; }
@media (max-width: 900px) { .detail-grip { display: none !important; } .detail { max-width: none; width: auto !important; } }


/* Tick-off question: list of the open subtasks (added after v3) */
.subtask-list { margin: 4px 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); max-height: 40vh; overflow-y: auto; font-size: 13px; }
.subtask-line { padding: 3px 0; color: var(--ink-2); }


/* What's new window (added after v3) */
.news-list { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 6px; }
.news-item b { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink); margin-bottom: 2px; }
.news-item .small { line-height: 1.45; }


/* Add subtasks: + between number and title, inline input line, right-click menu (added after v3) */
.add-sub { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 8px; padding: 0; border: 1px solid var(--line-3); border-radius: 4px; background: #fff; color: var(--ink-3); font-size: 13px; line-height: 1; vertical-align: 1px; cursor: pointer; opacity: 0; transition: opacity .08s; }
.row:hover .add-sub, .add-sub:focus-visible { opacity: 1; }
.add-sub:hover { border-color: var(--blue); color: var(--blue); background: var(--sel); }
@media (hover: none) { .add-sub { opacity: 1; } }
.row.sub-adder { cursor: default; gap: 10px; padding-top: 6px; padding-bottom: 6px; background: var(--sel); }
.row.sub-adder:hover { background: var(--sel); }
.sub-adder-mark { width: 16px; flex: none; text-align: center; color: var(--blue); font-weight: 650; }
.sub-input { flex: 1; min-width: 0; height: 30px; font-size: 13px; }
.panel-sub-adder { margin: -8px 0 4px; }
.ctx-menu { position: fixed; z-index: 40; min-width: 200px; max-width: 320px; padding: 4px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(16, 24, 40, .14); }
.ctx-menu .ctx-head { padding: 6px 14px 6px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.ctx-menu button { display: block; width: 100%; padding: 7px 14px; border: none; background: none; text-align: left; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--hover); }


/* Steps in order (added after v3) */
.add-sub.add-step { margin-left: -4px; }
.step-no { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 18px; height: 18px; margin-right: 8px; padding: 0 4px; border-radius: 9px; background: var(--sel); color: var(--blue); font-size: 11px; font-weight: 650; vertical-align: 1px; }
.row.closed .step-no { background: var(--hover); color: var(--ink-3); }
.chip.later { border-style: dashed; color: var(--ink-3); }
.row.later .row-title { color: var(--ink-3); }
.row.later .step-no { background: var(--hover); color: var(--ink-3); }
.fu-row select.fu-kind { width: 110px; }

.row.drop-target.drop-step { background: var(--ok-soft); box-shadow: inset 0 -3px 0 var(--ok); }
.drop-hint { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }


/* Projects, name menu, Settings (added after v3) */
.project-btn { padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: var(--radius); background: none; font-family: inherit; cursor: pointer; }
.project-btn:hover, .me-btn:hover { border-color: var(--line); background: var(--hover); }
.caret { margin-left: 4px; font-size: 10px; color: var(--ink-3); }
.me-btn { padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius); background: none; font-family: inherit; cursor: pointer; }
.ctx-menu .ctx-sep { height: 1px; margin: 4px 0; background: var(--line-2); }
.ctx-menu button.current::before { content: "✓"; display: inline-block; width: 16px; margin-left: -4px; color: var(--blue); }
.ctx-menu button.indent { padding-left: 26px; }
.tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 8px 12px; border: none; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tabs button.on { border-bottom-color: var(--blue); color: var(--ink); font-weight: 600; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.form-row input, .form-row select { flex: 1; min-width: 140px; }
.no-project { max-width: 460px; margin: 60px auto; text-align: center; color: var(--ink-2); }
@media (max-width: 900px) { .me.me-btn { display: flex; font-size: 13px; } .me-btn #me-name { display: none; } }
.settings-modal { max-height: 90vh; overflow-y: auto; }

/* Steps: a line through the step circles, forking into a step's subtasks (added after v3) */
.list { position: relative; }
.chain-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.chain-seg { position: absolute; background: var(--blue-light); border-radius: 1px; }
.chain-seg.done { background: var(--ok); opacity: .55; }
.chain-seg.fork { opacity: .7; }
.backup-warn { position: sticky; top: var(--topbar-h); z-index: 6; padding: 8px var(--pad-x); background: var(--bad-soft); color: var(--bad); border-bottom: 1px solid #e6aeb5; font-size: 13px; }

/* "?" help next to the tabs; outcome of the step before in the panel (added after v3) */
.help-btn { flex: none; width: 22px; height: 22px; margin: auto 0 auto 6px; padding: 0; border: 1px solid var(--line-3); border-radius: 50%; background: #fff; color: var(--ink-3); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.help-btn:hover { border-color: var(--blue); color: var(--blue); }
.outcome-line.step-before { margin: -2px 0 6px 76px; }
.chip.after-done { border-style: dashed; color: var(--ink-3); background: #fff; }

/* Milestones and My week */
.list h2 .count-inline { color: var(--ink-3); font-weight: 500; letter-spacing: 0; text-transform: none; }
.list h2.droppable { cursor: default; }
.list h2.drop-target { background: var(--sel); box-shadow: inset 0 0 0 2px var(--blue-light); }
.list h2.ms-head { flex-wrap: wrap; align-items: center; cursor: pointer; }
.list h2.ms-head:hover { background: var(--hover); }
.list h2.ms-head .chip { letter-spacing: 0; text-transform: none; }
.ms-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; text-transform: none; }
.ms-bar { display: inline-block; width: 110px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.ms-bar i { display: block; height: 100%; background: var(--blue-light); }
.group-empty { padding: 10px var(--pad-x); border-bottom: 1px solid var(--line-2); color: var(--ink-3); font-size: 12.5px; }
.group-empty:empty { display: none; }
.week-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px var(--pad-x) 4px; font-size: 13px; }
.ms-elsewhere { margin: 2px var(--pad-x) 6px; font-size: 12.5px; color: var(--ink-3); }
.ms-elsewhere .tlink { margin-right: 10px; color: var(--blue); cursor: pointer; }
.chip.ms-other { border-style: dashed; color: var(--blue); }
.fields > label[hidden], .field[hidden] { display: none; }

/* Decisions, risks and estimates (merge step 2b) */
.risk-box { margin: 10px var(--pad-x) 4px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--bad); border-radius: var(--radius); background: #fff; font-size: 13px; }
.risk-box.empty-box { border-left-color: var(--line-3); color: var(--ink-3); }
.risk-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.risk-line { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; cursor: pointer; }
.risk-line:hover .risk-title { text-decoration: underline; }
.risk-score { flex: none; min-width: 34px; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-weight: 650; font-size: 12px; text-align: center; }
.risk-score.s6, .risk-score.s9 { background: var(--bad-soft); color: var(--bad); }
.risk-title { flex: 1; min-width: 0; }
.risk-box details { margin-top: 6px; }
.decision-log .dec-line { padding: 8px var(--pad-x); border-bottom: 1px solid var(--line-2); font-size: 13px; cursor: pointer; }
.decision-log .dec-line:hover { background: var(--hover); }
.dec-date { display: inline-block; min-width: 70px; color: var(--ink-3); font-size: 12px; }
.chip.kind-decision { border-color: transparent; background: var(--sel); color: var(--blue); }
.chip.kind-risk { border-color: transparent; background: var(--bad-soft); color: var(--bad); }
.chip.kind-assumption { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.week-load { color: var(--ink-3); }
.week-load.over { color: var(--warn); font-weight: 650; }
