/* Tasks + Agents: a quiet, neutral look. Greys do the work; colour only marks what needs attention. */
:root {
  --bg: #ffffff;
  --side: #f7f7f5;
  --text: #1f1f1d;
  --muted: #73726e;
  --faint: #a3a29d;
  --line: #e9e8e4;
  --hover: #f1f0ec;
  --sel: #ebeae5;
  --strong: #1f1f1d;
  --on-strong: #ffffff;
  --late: #c4402f;
  --wait: #a86a00;
  --wait-bg: #fbf1dc;
  --run: #2f6b4f;
  --run-bg: #e4f1ea;
  --chip: #efeeea;
  --shadow: 0 12px 40px rgba(0, 0, 0, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1b1a; --side: #151514; --text: #ecebe7; --muted: #a09f99; --faint: #6f6e69; --line: #2c2c2a; --hover: #252523; --sel: #2e2e2b;
    --strong: #ecebe7; --on-strong: #1b1b1a; --late: #f0806f; --wait: #e2b35a; --wait-bg: #3a2f17; --run: #86c9a6; --run-bg: #1d3329; --chip: #2a2a28;
    --shadow: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #1b1b1a; --side: #151514; --text: #ecebe7; --muted: #a09f99; --faint: #6f6e69; --line: #2c2c2a; --hover: #252523; --sel: #2e2e2b;
    --strong: #ecebe7; --on-strong: #1b1b1a; --late: #f0806f; --wait: #e2b35a; --wait-bg: #3a2f17; --run: #86c9a6; --run-bg: #1d3329; --chip: #2a2a28;
    --shadow: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
h1, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; border-radius: 6px; }

/* Layout */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.shell.with-panel { grid-template-columns: 264px minmax(0, 1fr) 400px; }
.main { overflow-y: auto; }
.page { max-width: 760px; margin: 0 auto; padding: 36px 40px 96px; }

/* Sidebar */
.side { background: var(--side); border-right: 1px solid var(--line); padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { font-weight: 650; font-size: 15px; padding: 4px 8px 12px; letter-spacing: -.01em; }
.add-main { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px; justify-content: flex-start; }
.add-main kbd { margin-left: auto; font: inherit; font-size: 11px; opacity: .6; border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; color: var(--text); }
.nav:hover { background: var(--hover); }
.nav.on { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 550; }
.nav.on .ico { color: var(--accent); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.ico.hash { color: var(--faint); font-weight: 500; }
.count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 4px 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.projects { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; padding: 10px 8px 2px; border-top: 1px solid var(--line); margin-top: 8px; }
.me-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--chip); color: var(--muted); font-size: 10px; font-weight: 600; display: grid; place-items: center; }

/* Buttons */
.btn { border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; background: var(--bg); font-weight: 500; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { opacity: .88; background: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.ghost { color: var(--muted); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.ghost:hover { background: var(--hover); color: var(--text); }
.plus { font-size: 16px; line-height: 1; font-weight: 400; }

/* View header */
.view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.view-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.view-title h1 { font-size: 24px; font-weight: 680; letter-spacing: -.02em; min-width: 0; }
.sub { color: var(--muted); font-size: 13px; }
.title-edit { font: inherit; border: 0; background: none; padding: 0; margin: 0; max-width: 100%; field-sizing: content; border-radius: 6px; }
.title-edit:disabled { opacity: 1; }
.menu-btn { display: none; font-size: 18px; padding: 2px 6px; }
.seg { display: flex; background: var(--chip); border-radius: 8px; padding: 2px; flex: none; }
.seg button { padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* Groups and rows */
.group { margin-bottom: 22px; }
.group-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; min-height: 30px; }
.group-title { font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.group-note { color: var(--muted); font-size: 12px; }
.group-tools { margin-left: auto; opacity: 0; display: flex; gap: 2px; }
.group-head:hover .group-tools, .group-tools:focus-within { opacity: 1; }
.group-edit { font-weight: 650; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--bg); }
.caret { color: var(--faint); font-size: 11px; width: 12px; transition: transform .12s; display: inline-block; }
.caret.closed { transform: rotate(-90deg); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 6px; margin: 0 -6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--sel); }
.row-main { flex: 1; min-width: 0; }
.row-title { overflow-wrap: anywhere; }
.row.done .row-title { color: var(--faint); text-decoration: line-through; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-meta:empty { display: none; }
.row-meta .place { margin-left: auto; color: var(--faint); }
.row-result { color: var(--muted); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.late { color: var(--late); }
.pill { background: var(--chip); border-radius: 5px; padding: 0 6px; font-size: 11.5px; line-height: 18px; color: var(--muted); }
.pill.s-waiting { background: var(--wait-bg); color: var(--wait); }
.pill.s-in-progress { background: var(--run-bg); color: var(--run); }
.pill.agent { display: inline-flex; align-items: center; gap: 3px; }
.empty { color: var(--faint); padding: 10px 0; }
.muted { color: var(--muted); }

/* The round check */
.check { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; transition: background .1s, border-color .1s; }
.check.diamond { border-radius: 4px; transform: rotate(45deg) scale(.86); }
.check.diamond svg { transform: rotate(-45deg); }
.check svg { width: 12px; height: 12px; fill: none; stroke: var(--on-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.check:hover:not(:disabled) { border-color: var(--text); background: var(--hover); }
.check:hover:not(:disabled) svg { opacity: .5; stroke: var(--text); }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on svg, .check.on:hover svg { opacity: 1; stroke: var(--on-accent); }

/* Adding */
.add-inline { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--muted); width: 100%; }
.add-inline:hover { color: var(--text); }
.add-inline .plus { width: 18px; text-align: center; }
.add-inline.section { font-weight: 600; margin-bottom: 22px; }
.add-form { display: flex; gap: 8px; padding: 6px 0; }
.add-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--bg); }
.side-add { padding: 4px 0; }

/* Task panel */
.panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-where { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > span { color: var(--muted); font-size: 12px; }
.field > span:empty { display: none; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--bg); min-height: 32px; }
.field textarea { resize: vertical; line-height: 1.45; }
.panel-body > .field:first-child textarea { border-color: transparent; font-size: 18px; font-weight: 620; letter-spacing: -.01em; padding: 2px 4px; margin: -2px -4px; resize: none; field-sizing: content; }
.panel-body > .field:first-child textarea:hover, .panel-body > .field:first-child textarea:focus { border-color: var(--line); }
.link-row { display: flex; align-items: flex-end; gap: 8px; }
.link-row .field { flex: 1; }
.activity h3 { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.activity p { font-size: 12.5px; color: var(--muted); padding: 2px 0; }
.activity b { color: var(--text); font-weight: 550; }
.when { color: var(--faint); margin-left: 6px; }
.fine { color: var(--faint); font-size: 11.5px; }

/* Dialog, toast, sign-in */
.scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .28); z-index: 20; }
.scrim.show { display: block; }
.dialog { position: fixed; z-index: 21; top: 18vh; left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dialog-title { border: 0; background: none; font-size: 17px; font-weight: 600; padding: 4px 2px; outline: none; }
.dialog-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-field { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; color: var(--muted); font-size: 13px; }
.chip-field input, .chip-field select { border: 0; background: none; color: var(--text); max-width: 190px; }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.toast { position: fixed; z-index: 30; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--strong); color: var(--on-strong); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.card { max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.card h1 { font-size: 22px; letter-spacing: -.02em; }
.card p { color: var(--muted); }
.card .btn { align-self: flex-start; padding: 9px 18px; }

/* Narrow windows and phones */
@media (max-width: 1100px) {
  .shell.with-panel { grid-template-columns: 264px minmax(0, 1fr); }
  .panel { position: fixed; z-index: 15; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .shell, .shell.with-panel { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 25; top: 0; bottom: 0; left: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .18s; padding-top: max(16px, env(safe-area-inset-top)); }
  .side.show { transform: none; box-shadow: var(--shadow); }
  .side ~ .scrim { display: block; z-index: 24; }
  .menu-btn { display: block; }
  .page { padding: 18px 16px 96px; }
  .view-title h1 { font-size: 21px; }
  .group-tools { opacity: 1; }
  .row { padding: 11px 6px; }
  .fields { grid-template-columns: 1fr; }
}

/* Drag and drop */
.row[draggable="true"] { -webkit-user-drag: element; }
.row.dragging { opacity: .4; }
.row.drop-before { box-shadow: inset 0 2px 0 var(--text); }
.row.drop-after { box-shadow: inset 0 -2px 0 var(--text); }
.group.drop-into > .group-head { border-bottom-color: var(--text); }
.group.drop-into { background: var(--hover); border-radius: 8px; outline: 6px solid var(--hover); }

/* Project extras */
.project-desc { color: var(--muted); margin: -10px 0 20px; }
.nav.quiet { color: var(--muted); width: 100%; text-align: left; }
.dialog .dialog-title { font-size: 17px; font-weight: 600; }
.dialog .field.wide { grid-column: 1 / -1; }

/* Wider pages, shared small pieces */
.page.wide { max-width: none; padding-left: 28px; padding-right: 28px; }
.page.mid { max-width: 1040px; }
.tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.tools .btn { margin-left: 6px; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: var(--bg); width: 170px; }
.stats { display: flex; align-items: center; gap: 8px; margin: -8px 0 18px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.spacer { flex: 1; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; color: var(--muted); }
.chip:hover { background: var(--hover); }
.chip.late { color: var(--late); }
.load { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.load.over { color: var(--late); }
.bar { display: inline-block; width: 44px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar.wide { width: 120px; }
.bar.full { display: block; width: 100%; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--muted); border-radius: 2px; }
.load.over .bar i { background: var(--late); }
.clip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { margin-left: auto; }
.faint { color: var(--faint); }
.side-link { border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.side-link:hover, .side-link.on { background: var(--hover); color: var(--text); }

/* Task cards (Week, Deadlines) */
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tcard { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; min-width: 0; }
.tcard:hover { background: var(--hover); }
.tcard.sel { background: var(--sel); }
.tcard { border-left: 3px solid var(--pj, var(--line)); }
.tcard .row-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .row-meta { gap: 2px 8px; }
.tcard .row-meta > span { flex: none; }
.tcard .row-meta > .clip { flex: 0 1 auto; max-width: 100%; }
.tcard[draggable="true"] { -webkit-user-drag: element; }
.tcard.dragging { opacity: .4; }
.tcard.drop-before { box-shadow: 0 -2px 0 var(--text); }
.tcard.drop-after { box-shadow: 0 2px 0 var(--text); }

/* Week */
.week { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; min-height: 60vh; }
.day { flex: 1 1 0; min-width: 190px; padding: 10px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.day:first-child { border-left: 0; }
.day.folded { flex: 0 0 46px; min-width: 46px; align-items: center; color: var(--faint); font-size: 12px; padding: 12px 4px; gap: 2px; }
.day.folded b { font-weight: 500; font-size: 14px; }
.day > header { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 12.5px; }
.day > header b { color: var(--text); font-size: 15px; font-weight: 620; }
.day > header .load { margin-left: auto; }
.day.now { background: var(--side); }
.day.now > header b { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 7px; }
.day.drop-into, .cell.drop-into, .pcol.drop-into { background: var(--hover); }
.day .add-inline { padding: 4px 0; font-size: 13px; }

/* Deadlines */
.month { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dow { padding: 6px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.cell { min-height: 118px; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cell:nth-child(7n + 1), .month[style*="5"] .cell:nth-child(5n + 1) { border-left: 0; }
.month[style*="5"] .cell:nth-child(7n + 1) { border-left: 1px solid var(--line); }
.month[style*="5"] .cell:nth-child(5n + 1) { border-left: 0; }
.dow + .cell, .dow ~ .cell:nth-child(-n + 14) { border-top: 0; }
.month[style*="5"] .dow ~ .cell:nth-child(n + 11) { border-top: 1px solid var(--line); }
.cell.out { color: var(--faint); }
.cell.out .tcard { opacity: .6; }
.cell.now { background: var(--side); }
.cell.now .cell-head b { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 7px; }
.cell-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; min-height: 22px; }
.cell-head b { font-weight: 500; }
.cell-add { opacity: 0; }
.cell:hover .cell-add, .cell-add:focus-visible { opacity: 1; }
.cell .tcard { padding: 5px 6px; gap: 6px; }
.cell .tcard .row-title { -webkit-line-clamp: 2; font-size: 12.5px; }
.cell .ghost { align-self: flex-start; font-size: 12px; }

/* Projects board */
.pboard { display: grid; grid-template-columns: repeat(var(--ncol, 1), minmax(230px, 320px)); gap: 8px 16px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.pcol { flex: 1 0 240px; max-width: 320px; display: flex; flex-direction: column; gap: 8px; border-radius: 10px; padding: 4px; margin: -4px; }
.pcol > header { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.pcol > header b { font-weight: 650; }
.pcard { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.pcard:hover { background: var(--hover); }
.pcard.done { opacity: .6; }
.pcard-title { font-weight: 620; overflow-wrap: anywhere; }
.pcard-desc { color: var(--muted); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .row-meta { margin-top: 8px; }

/* Team */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding-top: 12px; }
.person { display: flex; align-items: flex-start; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.person:hover:not(:disabled) { background: var(--hover); }
.person:disabled { opacity: 1; }
.face { width: 40px; height: 40px; flex: none; font-size: 13px; position: relative; overflow: hidden; }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; color: var(--muted); font-size: 12.5px; }
.person-main b { color: var(--text); font-size: 14px; font-weight: 600; }
.tick { display: flex; align-items: center; gap: 8px; }

/* Archive: done is the point here, so no strike-through */
.archive .row.done .row-title { color: var(--text); text-decoration: none; }

@media (max-width: 760px) {
  .page.wide { padding-left: 16px; padding-right: 16px; }
  .view-head { flex-wrap: wrap; }
  .week { flex-direction: column; min-height: 0; }
  .day { border-left: 0; border-top: 1px solid var(--line); min-width: 0; }
  .day:first-child { border-top: 0; }
  .day.folded { display: none; }
  .month { display: block; }
  .dow, .cell.out { display: none; }
  .cell { min-height: 0; border-left: 0; }
  .cell:not(:has(.tcard)) { display: none; }
  .pboard { grid-template-columns: repeat(var(--ncol, 1), minmax(240px, 1fr)); }
  .pcol { max-width: none; width: 100%; flex: none; }
}

/* Menu at the top */
.shell.top { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.shell.top.with-panel { grid-template-columns: minmax(0, 1fr) 400px; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: var(--bg); min-width: 0; }
.topbar .brand { padding: 0; flex: none; }
.topbar nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar .nav { padding: 5px 10px; gap: 6px; flex: none; }
.topbar .nav .ico:empty { display: none; }
.topbar .nav-label { flex: none; }
.shell.top .menu-btn { display: none; }
.gear { display: grid; place-items: center; padding: 4px; flex: none; }

/* Settings */
.settings section { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 12px; }
.settings h3 { font-size: 13px; font-weight: 650; }
.settings .fields { width: 100%; }
.settings .seg { align-self: flex-start; }
.fine.ok { color: var(--run); }

/* Focus timer */
.focus-btn { opacity: 0; flex: none; }
.row:hover .focus-btn, .focus-btn:focus-visible, .row.timing .focus-btn { opacity: 1; }
.row.timing { box-shadow: inset 2px 0 0 var(--accent); }
.pomo { position: fixed; z-index: 18; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px 8px 14px; }
.pomo-time { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pomo.over .pomo-time { color: var(--late); }
.pomo.paused .pomo-time { color: var(--faint); }
.pomo-task { min-width: 0; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); text-align: left; margin-right: 4px; }
.pomo-task:hover { color: var(--text); }
.toast { bottom: 76px; }
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .brand { display: none; }
  .focus-btn { opacity: 1; }
  .pomo { flex-wrap: wrap; justify-content: center; }
}

/* Icons */
.sfi { flex: none; vertical-align: -2px; }
.ico { display: grid; place-items: center; }
.hash { color: var(--faint); font-weight: 500; }
.with-ico { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
a.with-ico:hover { color: var(--text); }
.proj-ico { color: var(--muted); margin-right: 8px; vertical-align: -3px; border-radius: 6px; }
.proj-ico:disabled { opacity: 1; }
.icon-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 32px; text-align: left; color: var(--muted); }
.ipick { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.ipick-head { display: flex; gap: 8px; align-items: center; }
.ipick-head .search { flex: 1; }
.ipick-list { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.icat { font-size: 11.5px; color: var(--muted); font-weight: 600; margin: 8px 2px 4px; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; }
.igrid button { height: 34px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.igrid button:hover { background: var(--hover); color: var(--text); }
.igrid button.on { background: var(--sel); color: var(--text); }

/* Dialogs can be taller than the window */
.dialog { top: 8vh; max-height: 84vh; overflow-y: auto; }
.dialog.settings { width: min(680px, calc(100vw - 32px)); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.set-grid section { border-top: 1px solid var(--line); padding: 12px 0; }
.settings h3:not(:first-child) { margin-top: 8px; }
.tick.inline input { width: 64px; margin-left: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: var(--bg); }
.settings footer { gap: 8px; }
@media (max-width: 760px) { .set-grid { grid-template-columns: 1fr; } }

/* Tambour colours. The ten palette colours (TambourKit's TambourPalette), light and dark. */
:root {
  --c-terracotta: #D9644A; --c-amber: #C9922E; --c-olive: #8A8F3A; --c-sage: #5E9A6E; --c-teal: #3E8F8C;
  --c-sky: #4F8DBA; --c-indigo: #5D6BB8; --c-lavender: #8C74C0; --c-rose: #C2647E; --c-slate: #6E7A86;
  --accent: var(--strong); --on-accent: #ffffff;
  --run: color-mix(in srgb, var(--c-sage) 72%, var(--text)); --run-bg: color-mix(in srgb, var(--c-sage) 16%, transparent);
  --wait: color-mix(in srgb, var(--c-amber) 72%, var(--text)); --wait-bg: color-mix(in srgb, var(--c-amber) 18%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-terracotta: #EB7A5E; --c-amber: #E0AA4A; --c-olive: #A9AE55; --c-sage: #79B488; --c-teal: #5AAAA6;
    --c-sky: #6EA8D3; --c-indigo: #8090D6; --c-lavender: #A894D6; --c-rose: #D9809A; --c-slate: #93A0AC;
    --on-accent: #1b1b1a;
  }
}
:root[data-theme="dark"] {
  --c-terracotta: #EB7A5E; --c-amber: #E0AA4A; --c-olive: #A9AE55; --c-sage: #79B488; --c-teal: #5AAAA6;
  --c-sky: #6EA8D3; --c-indigo: #8090D6; --c-lavender: #A894D6; --c-rose: #D9809A; --c-slate: #93A0AC;
  --on-accent: #1b1b1a;
}
input[type="checkbox"] { accent-color: var(--accent); }
:focus-visible { outline-color: var(--accent); }
.pill.agent { background: color-mix(in srgb, var(--c-lavender) 16%, transparent); color: color-mix(in srgb, var(--c-lavender) 72%, var(--text)); }
.bar i { background: var(--pj, var(--muted)); }

/* A project's colour, wherever the project shows */
.pj-ico { display: inline-grid; place-items: center; color: var(--pj, var(--muted)); }
.pj-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pj); display: block; }
.proj-ico .pj-dot { width: 14px; height: 14px; }
.pcard { border-top: 3px solid var(--pj, var(--line)); }
.icon-field .sfi { color: var(--pj, var(--muted)); }

/* Swatches: none, then the ten */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; background: var(--sw); position: relative; }
.swatch.none { border: 1.5px solid var(--faint); background: linear-gradient(135deg, transparent 46%, var(--faint) 46%, var(--faint) 54%, transparent 54%); }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--sw, var(--muted)); }

/* Projects board: type columns cut into priority bands */
.phead { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); }
.phead b { font-weight: 650; }
.pband { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.prio-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--faint); flex: none; }
.prio-dot.p-high { background: var(--c-terracotta); }
.prio-dot.p-medium { background: var(--c-amber); }
.prio-dot.p-low { background: var(--c-slate); }
.pcell { display: flex; flex-direction: column; gap: 8px; min-height: 40px; border-radius: 10px; padding: 4px; margin: -4px; align-self: stretch; }
.pcell-add { align-self: flex-start; opacity: 0; font-size: 15px; }
.pcell:hover .pcell-add, .pcell-add:focus-visible { opacity: 1; }

/* Projects timeline */
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 12px; margin: -6px 0 12px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .tl-mk { position: static; transform: rotate(45deg); }
.tl-legend .tl-mk.dl { transform: none; }
.tl-key.span { width: 22px; height: 8px; border-radius: 4px; border: 1px dashed var(--faint); }
.tl-key.now { width: 2px; height: 12px; background: var(--accent); }
.tl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: calc(100dvh - 190px); }
.tl-head, .tl-row { display: flex; }
.tl-head { position: sticky; top: 0; z-index: 4; background: var(--bg); border-bottom: 1px solid var(--line); }
.tl-corner, .tl-name { flex: 0 0 220px; width: 220px; position: sticky; left: 0; z-index: 3; background: var(--bg); border-right: 1px solid var(--line); }
.tl-scale { position: relative; height: 30px; }
.tl-mo { position: absolute; top: 7px; padding-left: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tl-wk { position: absolute; top: 16px; padding-left: 3px; font-size: 10px; color: var(--faint); }
.tl-scale:has(.tl-wk) .tl-mo { top: 1px; }
.tl-body { position: relative; }
.tl-grid { position: absolute; left: 220px; top: 0; bottom: 0; pointer-events: none; }
.tl-gm, .tl-gw, .tl-now { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-gw { opacity: .5; }
.tl-now { width: 2px; background: var(--accent); z-index: 1; }
.tl-row { min-height: 36px; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-name { display: flex; align-items: center; gap: 8px; padding: 0 10px; min-width: 0; }
a.tl-name:hover { background: var(--hover); }
.tl-name small { margin-left: auto; color: var(--faint); font-size: 11.5px; flex: none; }
.tl-group { min-height: 30px; background: var(--side); }
.tl-group .tl-name { background: var(--side); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tl-track { position: relative; flex: none; }
.tl-bar { position: absolute; top: 7px; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--pj, var(--muted)) 26%, var(--bg)); border: 1px solid var(--pj, var(--muted));
  display: flex; align-items: center; cursor: grab; overflow: hidden; touch-action: none; z-index: 2; }
.tl-bar span { padding: 0 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-bar.late { border-color: var(--late); }
.tl-bar.open-start { border-left-style: dashed; }
.tl-bar.open-end { border-right-style: dashed; }
.tl-bar.derived { background: none; border: 1px dashed var(--pj, var(--faint)); border-radius: 11px; }
.tl-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.tl-h.s { left: 0; } .tl-h.e { right: 0; }
.tl-set { position: absolute; top: 6px; font-size: 12px; z-index: 2; }
.tl-mk { position: absolute; top: 13px; width: 10px; height: 10px; margin-left: -5px; background: var(--bg); border: 2px solid var(--pj, var(--muted)); transform: rotate(45deg); z-index: 3; padding: 0; }
.tl-mk.dl { transform: none; border-radius: 50%; border-color: var(--late); }
.tl-mk.done { opacity: .45; }
@media (max-width: 760px) { .tl-corner, .tl-name { flex-basis: 130px; width: 130px; } .tl-grid { left: 130px; } .tl-name small { display: none; } }

/* Dropdowns: one quiet chevron everywhere */
.field select, .chip-field select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
.chip-field select { padding-right: 22px; background-position: right 2px center; }
.more-btn { align-self: flex-start; display: flex; align-items: center; gap: 4px; margin-left: -6px; }

/* Full screen focus */
.zen { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.zen-bg i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .28; animation: zen-drift 38s ease-in-out infinite alternate; }
.zen-bg i:nth-child(1) { background: var(--accent); top: -22vmax; left: -14vmax; }
.zen-bg i:nth-child(2) { background: var(--c-lavender); bottom: -26vmax; right: -16vmax; animation-duration: 47s; animation-direction: alternate-reverse; }
.zen-bg i:nth-child(3) { background: var(--c-teal); top: 30%; left: 46%; width: 38vmax; height: 38vmax; opacity: .16; animation-duration: 58s; }
.zen.brk .zen-bg i:nth-child(1) { background: var(--c-sage); }
.zen.over .zen-bg i:nth-child(1) { background: var(--c-terracotta); }
@keyframes zen-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(7vmax, 5vmax) scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .zen-bg i { animation: none; } }
.zen-min { position: absolute; top: 18px; right: 18px; padding: 8px; z-index: 1; }
.zen-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; text-align: center; max-width: min(640px, 92vw); }
.zen-label { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.zen-ring { position: relative; width: min(340px, 64vmin); aspect-ratio: 1; display: grid; place-items: center; }
.zen-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.zen-ring circle { fill: none; stroke-width: 3; }
.zt { stroke: var(--line); }
.zp { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.zen.brk .zp { stroke: var(--c-sage); }
.zen.over .zp { stroke: var(--c-terracotta); }
.zen.paused .zp { stroke: var(--faint); }
.zen-time { font-size: clamp(44px, 12vmin, 76px); font-weight: 620; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.zen.paused .zen-time { color: var(--faint); }
.zen-task { font-size: 20px; font-weight: 620; letter-spacing: -.01em; overflow-wrap: anywhere; }
.zen-sub { color: var(--muted); margin-top: -8px; }
.zen-ctl { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.zen-ctl .btn { padding: 7px 16px; font-size: 14px; }

/* Right-click menu */
.scrim.clear { background: transparent; z-index: 34; }
.pop { position: fixed; z-index: 35; width: min(340px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pop-title { font-weight: 620; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pop-title.with-ico { display: flex; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-sec { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.pop-label { flex: 0 0 100%; color: var(--muted); font-size: 12px; }
.pop .fields { border-top: 1px solid var(--line); padding-top: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pillbtn { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
.pillbtn:hover { background: var(--hover); }
.pillbtn.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); }
input.mini { border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; background: var(--bg); font-size: 12.5px; color: var(--muted); }

/* Project dropdown with icons */
.ppick { position: relative; min-width: 0; }
.ppick-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 28px 6px 8px; background: var(--bg); text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.chip-field .ppick-btn { border: 0; min-height: 0; padding: 0 22px 0 0; background-position: right 2px center; color: var(--text); max-width: 200px; }
.ppick-list { position: absolute; z-index: 36; top: calc(100% + 4px); left: 0; width: max(100%, 250px); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.ppick-list .search { width: 100%; margin-bottom: 4px; }
.ppick-items { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; }
.ppick-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; text-align: left; min-width: 0; }
.ppick-item:hover { background: var(--hover); }
.ppick-item.on { background: var(--sel); }
.ppick-item small { margin-left: auto; color: var(--faint); font-size: 11.5px; flex: none; }

/* Team load, and a person's page */
.load-bar { width: 56px; height: 4px; }
.load-bar i { background: var(--c-sage); }
.load-bar.full i { background: var(--c-amber); }
.load-bar.over i { background: var(--late); }
.person .load { margin: 3px 0 1px; }
.back { color: var(--muted); font-size: 13px; display: inline-block; margin-bottom: 12px; }
.back:hover { color: var(--text); }
.person-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.person-head h1 { font-size: 24px; font-weight: 680; letter-spacing: -.02em; color: var(--text); }
.person-head .person-main { flex: 1; gap: 3px; font-size: 13px; }
.person-head .load b { color: var(--text); font-weight: 600; }
.face.big { width: 64px; height: 64px; font-size: 20px; }
.seg.tabs { display: inline-flex; margin-bottom: 20px; }
.pop { overflow: visible; max-height: none; }

/* Project type columns carry a colour */
.phead { border-bottom: 2px solid var(--ty, var(--line)); background: color-mix(in srgb, var(--ty, transparent) 10%, transparent); border-radius: 8px 8px 0 0; padding: 8px 10px; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ty, var(--faint)); flex: none; }
.pcell { background: color-mix(in srgb, var(--ty, transparent) 5%, transparent); padding: 6px; margin: 0; }
.pcell.drop-into { background: color-mix(in srgb, var(--ty, var(--muted)) 16%, transparent); }

/* Week, calendar layout: Google Calendar events and time blocks */
.cal-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.calwrap { display: flex; gap: 16px; align-items: flex-start; }
.cal-rail { flex: 0 0 230px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 150px); overflow-y: auto; padding-right: 2px; }
.cal-rail h3 { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.cal-rail .cards { display: flex; flex-direction: column; gap: 6px; }
.tcard.rail { cursor: grab; }
.tcard.rail .blocked { color: var(--run); }
.cal { flex: 1 1 0; min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: calc(100vh - 150px); position: relative; background: var(--bg); }
.cal-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line); min-width: max-content; }
.cal-head, .cal-body { min-width: 100%; }
.cal-gutter { flex: 0 0 52px; position: relative; }
.cal-gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10.5px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-dayhead { flex: 1 1 0; min-width: 110px; padding: 8px 8px 6px; border-left: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; color: var(--muted); font-size: 12.5px; }
.cal-dayhead b { color: var(--text); font-size: 15px; font-weight: 620; }
.cal-dayhead.now b { background: var(--accent); color: var(--on-accent, #fff); border-radius: 999px; padding: 0 7px; }
.cal-allday { flex: 1 0 100%; font-size: 11.5px; background: var(--chip); color: var(--text); border-radius: 5px; padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-body { display: flex; position: relative; }
.cal-col { flex: 1 1 0; min-width: 110px; position: relative; border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 44px; }
.cal-col.weekend { background-color: color-mix(in srgb, var(--side) 60%, transparent); }
.cal-ev { position: absolute; box-sizing: border-box; border-radius: 6px; padding: 2px 6px; overflow: hidden; font-size: 11.5px; line-height: 1.25; cursor: pointer;
  background: var(--chip); color: var(--muted); border-left: 3px solid var(--faint); display: flex; flex-direction: column; }
.cal-ev b { font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-ev.short { flex-direction: row; gap: 6px; align-items: center; }
.cal-ev.short b { white-space: nowrap; }
.cal-ev.free { opacity: .6; }
.cal-ev.block { background: color-mix(in srgb, var(--pj, var(--accent)) 20%, var(--bg)); border-left-color: var(--pj, var(--accent)); cursor: grab; z-index: 1; }
.cal-ev.block.done b { text-decoration: line-through; color: var(--muted); }
.cal-ev.saving { opacity: .55; }
.cal-x { position: absolute; top: 1px; right: 2px; width: 16px; height: 16px; line-height: 14px; border-radius: 4px; color: var(--muted); display: none; background: var(--bg); }
.cal-ev:hover .cal-x { display: block; }
.cal-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
.cal-ghost { position: absolute; box-sizing: border-box; border: 1.5px dashed var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, transparent); pointer-events: none; z-index: 2; font-size: 11px; color: var(--muted); padding: 1px 5px; }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid var(--accent); pointer-events: none; z-index: 2; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
@media (max-width: 760px) {
  .calwrap { flex-direction: column; }
  .cal-rail { flex: none; width: 100%; max-height: 30vh; }
  .cal { flex: none; width: 100%; height: 70vh; max-height: none; }
}
