/* Task tool styles. Brand fonts (Work Sans, Lora) and blue accent in a compact layout. Light + dark. */
@font-face { font-family: 'Work Sans'; src: url('/fonts/WorkSans.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/fonts/Lora.ttf') format('truetype'); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #ffffff; --bg-side: #f6f7f9; --bg-raised: #ffffff; --bg-hover: #eef1f5; --bg-sunken: #f3f5f8;
  --border: #e3e6eb; --border-strong: #cfd4dc; --text: #1c2330; --muted: #677182; --faint: #9aa3b2;
  --accent: #2f74d0; --accent-hover: #2664b8; --accent-soft: #e7f2fb; --on-accent: #ffffff;
  --danger: #c93b33; --warn-bg: #fdf1e4; --warn-text: #8a4b10; --ok: #3fa66b;
  --shadow: 0 8px 28px rgba(20, 30, 50, .14), 0 1px 3px rgba(20, 30, 50, .08);
  --radius: 8px; --side-w: 256px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171c; --bg-side: #101317; --bg-raised: #1b1f26; --bg-hover: #222831; --bg-sunken: #181c22;
    --border: #2a303a; --border-strong: #3a424f; --text: #e6e9ee; --muted: #97a1b1; --faint: #6b7585;
    --accent: #5a9ff0; --accent-hover: #74aef3; --accent-soft: #1b2a3d; --on-accent: #0c1420;
    --danger: #f0776f; --warn-bg: #33261a; --warn-text: #f3be85; --shadow: 0 8px 28px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171c; --bg-side: #101317; --bg-raised: #1b1f26; --bg-hover: #222831; --bg-sunken: #181c22;
  --border: #2a303a; --border-strong: #3a424f; --text: #e6e9ee; --muted: #97a1b1; --faint: #6b7585;
  --accent: #5a9ff0; --accent-hover: #74aef3; --accent-soft: #1b2a3d; --on-accent: #0c1420;
  --danger: #f0776f; --warn-bg: #33261a; --warn-text: #f3be85; --shadow: 0 8px 28px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 24px 0 8px; display: flex; align-items: center; gap: 8px; }
.serif { font-family: 'Lora', Georgia, serif; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12px; } .spacer { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.struck { text-decoration: line-through; color: var(--muted); }
.icon { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
::placeholder { color: var(--faint); }

/* ---------- layout ---------- */
#root, .app { height: 100%; }
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.main { min-width: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.splash, .empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.topbar { display: none; }
.scrim, .drawer-scrim { display: none; }
.offline { background: var(--warn-bg); color: var(--warn-text); padding: 6px 16px; font-size: 13px; text-align: center; }

.sidebar { background: var(--bg-side); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 12px 8px 8px; gap: 1px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; font-size: 17px; }
.logo-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.logo-mark.small { width: 24px; height: 24px; border-radius: 7px; }
.logo-mark .icon { stroke-width: 2.2; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--text); width: 100%; min-height: 32px; }
.nav-item:hover { background: var(--bg-hover); text-decoration: none; }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav-item .icon { color: var(--muted); } .nav-item.on .icon { color: var(--accent); }
.nav-item.search { color: var(--muted); border: 1px solid var(--border); background: var(--bg); margin-bottom: 6px; }
.nav-item.subtle { color: var(--muted); }
.nav-item.user { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; padding-top: 10px; }
.nav-item.user .ellipsis { flex: 1; }
.nav-item.project { padding-left: 10px; }
.nav-item.project .ellipsis { flex: 1; }
kbd { margin-left: auto; font: 11px ui-monospace, monospace; color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.nav-scroll { flex: 1; overflow-y: auto; margin-top: 8px; min-height: 0; }
.nav-area { margin-bottom: 12px; }
.nav-area-head { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); min-height: 28px; }
.nav-area-head .ellipsis { flex: 1; }
.nav-area-head.as-button { width: 100%; gap: 8px; } .nav-area-head.as-button span:nth-child(2) { flex: 1; }
.nav-empty { padding: 4px 10px; color: var(--faint); font-size: 13px; }
.count { color: var(--faint); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.badge { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; border-radius: 9px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.btn .badge { margin-left: 2px; }
.badge.dot { position: absolute; top: 6px; right: 6px; min-width: 8px; width: 8px; height: 8px; padding: 0; }
.proj-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; display: inline-block; }
.proj-dot.big { width: 12px; height: 12px; border-radius: 4px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--bg-raised); font-weight: 500; white-space: nowrap; min-height: 32px; }
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { padding: 3px 9px; min-height: 28px; font-size: 13px; font-weight: 400; border-color: var(--border); }
.btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.link { border-color: transparent; background: none; color: var(--muted); }
.btn.link:hover { color: var(--text); background: var(--bg-hover); }
.btn.danger { color: var(--danger); }
.btn.big { padding: 10px 20px; font-size: 15px; justify-content: center; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: default; pointer-events: none; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.tiny { width: 22px; height: 22px; }
.caret { display: inline-grid; place-items: center; transition: transform .12s; color: var(--muted); }
.caret.open { transform: rotate(90deg); }
.icon-btn.caret { width: 20px; height: 20px; }
.rot-up { transform: rotate(-90deg); display: block; } .rot-down { transform: rotate(90deg); display: block; }
.input, .select { border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; background: var(--bg); width: 100%; min-height: 34px; }
.input.big { font-size: 15px; padding: 9px 12px; }
.select { width: auto; padding-right: 6px; }
.select.small { min-height: 28px; padding: 2px 4px; font-size: 13px; border-color: var(--border); color: var(--muted); max-width: 190px; }
textarea.input { resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; }
.check.small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.note { background: var(--bg-sunken); border-radius: 6px; padding: 8px 12px; color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.note.warn { background: var(--warn-bg); color: var(--warn-text); }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
.avatar.more { background: var(--bg-hover); color: var(--muted); font-size: 10px; }
.avatars { display: inline-flex; } .avatars .avatar + .avatar { margin-left: -6px; }
.status-dot { display: inline-grid; place-items: center; border: 2px solid; border-radius: 50%; flex: none; position: relative; }
.status-dot svg { width: 100%; height: 100%; }
.status-dot i { position: absolute; inset: 2px; border-radius: 50%; clip-path: inset(0 50% 0 0); }
.status-dot i.three { clip-path: polygon(50% 50%, 50% 0, 0 0, 0 100%, 100% 100%, 100% 50%); }
.status-dot i.bar { inset: 40% 18%; border-radius: 1px; clip-path: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 500; background: var(--bg-hover); }
.status-pill { background: color-mix(in srgb, var(--c) 16%, transparent); }
.state-invited { background: var(--warn-bg); color: var(--warn-text); } .state-active { background: color-mix(in srgb, var(--ok) 18%, transparent); } .state-disabled { color: var(--muted); }
.chip { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 11.5px; line-height: 19px; font-weight: 500; white-space: nowrap; flex: none;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 62%, var(--text)); }
.prio { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.prio-urgent .icon { color: #d93f36; fill: #d93f36; } .prio-high .icon { color: #e0902b; fill: #e0902b; }
.prio-normal .icon { color: #3c8be8; fill: #3c8be8; } .prio-low .icon { color: var(--faint); fill: var(--faint); }
.due { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.overdue, .overdue-text { color: var(--danger); font-weight: 500; } .due.today { color: var(--accent); font-weight: 500; }
.meta { display: inline-flex; align-items: center; gap: 3px; color: var(--faint); font-size: 12px; flex: none; }
.meta.warn { color: #d08a2c; }
.ghost { color: var(--border-strong); display: inline-grid; place-items: center; }
.row-key { font: 11.5px ui-monospace, 'SF Mono', Menlo, monospace; color: var(--faint); white-space: nowrap; flex: none; }

/* ---------- screens ---------- */
.screen { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.screen-head { padding: 16px 24px 0; border-bottom: 1px solid var(--border); flex: none; }
.title-line { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.title-line h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-line h1.serif { font-size: 24px; }
.subline { color: var(--muted); margin-top: 2px; }
.screen-head > :last-child { margin-bottom: 12px; }
.progress { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress .bar { width: 72px; height: 5px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--bg-sunken); border-radius: 7px; padding: 2px; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 5px; color: var(--muted); min-height: 26px; font-size: 13px; }
.tabs button.on { background: var(--bg-raised); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.search-box { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; min-height: 28px; color: var(--muted); }
.search-box input { border: 0; background: none; outline: none; width: 150px; font-size: 13px; }
.search-box:focus-within { border-color: var(--accent); }
.screen-body { flex: 1; overflow: auto; min-height: 0; }
.screen-body.board { overflow: hidden; display: flex; }

/* ---------- list ---------- */
.list { --cols: 20px 26px 62px minmax(0, 1fr) 84px 92px 40px; padding-bottom: 80px; min-width: 0; }
.list-head, .row { display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 4px; padding: 0 24px 0 12px; }
.list-head { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--faint); min-height: 30px; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 14px 24px 6px 12px; font-weight: 600; width: 100%; font-size: 13.5px; }
.group-head.static { cursor: default; padding-left: 24px; }
.group.overdue .group-head { color: var(--danger); }
.row { min-height: 36px; border-bottom: 1px solid var(--border); cursor: pointer; padding-left: calc(12px + var(--depth, 0) * 24px); }
.row:hover { background: var(--bg-sunken); }
.row.done .row-title-text { color: var(--muted); text-decoration: line-through; }
.row-caret { display: grid; place-items: center; }
.row-status { display: grid; place-items: center; width: 26px; height: 28px; border-radius: 6px; }
.row-status:hover { background: var(--bg-hover); }
.row-status.big { width: 34px; height: 34px; flex: none; }
.row-title { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.row-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-project { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; flex: none; }
.row-cell { display: flex; align-items: center; min-height: 30px; border-radius: 6px; padding: 0 4px; }
.row-cell:hover { background: var(--bg-hover); }
.row-cell .ghost { opacity: 0; } .row:hover .row-cell .ghost, .row-cell:focus-visible .ghost { opacity: 1; }
.inline-add { display: flex; align-items: center; gap: 6px; color: var(--faint); padding: 6px 24px 6px calc(40px + var(--depth, 0) * 24px); width: 100%; font-size: 13px; min-height: 32px; }
.inline-add:hover { color: var(--accent); }
.inline-add.open input, .sub-add input { flex: 1; border: 0; outline: 0; background: none; padding: 4px 0; min-width: 0; }
.inline-add.open { border-bottom: 1px solid var(--accent); }

/* ---------- board ---------- */
.board { display: flex; gap: 12px; padding: 16px 24px; overflow-x: auto; flex: 1; align-items: stretch; min-height: 0; }
.column { flex: 0 0 286px; background: var(--bg-sunken); border-radius: 10px; display: flex; flex-direction: column; min-height: 0; border: 1px solid transparent; }
.column.over { border-color: var(--accent); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; font-weight: 600; font-size: 13.5px; border-top: 3px solid var(--c); border-radius: 10px 10px 0 0; }
.column-body { padding: 4px 8px 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.column .inline-add { padding: 6px 8px; }
.card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; cursor: pointer; box-shadow: 0 1px 2px rgba(20, 30, 50, .05); }
.card:hover { border-color: var(--border-strong); }
.card.dragging { opacity: .35; }
.card.done .card-title { color: var(--muted); }
.card-labels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.card-title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 20px; }
.drop-line { height: 3px; border-radius: 2px; background: var(--accent); flex: none; }

/* ---------- popover + menus ---------- */
.popover { position: fixed; z-index: 60; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 190px; max-width: calc(100vw - 16px); }
.menu { padding: 4px; display: flex; flex-direction: column; }
.menu.pad { padding: 10px; }
.menu-scroll { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; width: 100%; min-height: 32px; }
.menu-item:hover { background: var(--bg-hover); }
.menu-item.danger { color: var(--danger); }
.menu-check { margin-left: auto; color: var(--accent); display: grid; }
.menu-search { border: 0; border-bottom: 1px solid var(--border); outline: 0; background: none; padding: 8px; margin: -4px -4px 4px; width: calc(100% + 8px); }
.menu.quick-new .menu-search, .date-menu .menu-search { border-bottom: 0; margin-bottom: -4px; }
.date-menu .menu-search { border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-empty { padding: 10px 8px; color: var(--muted); font-size: 13px; }
.menu-head { padding: 8px 8px 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- modal + forms ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 30, .45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { background: var(--bg-raised); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 460px; }
.modal.wide { max-width: 620px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-body { padding: 8px 20px 20px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row.two { display: flex; gap: 12px; } .form-field.grow { flex: 1; } .form-field.key { width: 96px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field > span:first-child { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: -8px; }
.form-field .form-hint { margin-top: 0; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg-raised), 0 0 0 4px var(--text); }
.swatch-btn { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.status-editor { display: flex; flex-direction: column; gap: 6px; }
.status-line { display: flex; align-items: center; gap: 6px; }
.status-line .input { flex: 1; min-width: 0; }
.status-editor .inline-add { padding-left: 4px; }
.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.checklist .check { color: var(--text); font-size: 14px; padding: 4px 0; gap: 8px; }
.search-results { margin-top: 8px; display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }

/* ---------- task drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(700px, 100%); background: var(--bg-raised); border-left: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.drawer-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(15, 20, 30, .18); }
.drawer-head { display: flex; align-items: center; gap: 4px; padding: 10px 12px 6px 24px; flex: none; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.sep { color: var(--faint); }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 24px 32px; }
.title-row { display: flex; align-items: flex-start; gap: 6px; margin-left: -8px; }
.title-edit { flex: 1; font-size: 21px; font-weight: 600; line-height: 1.3; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; background: none; resize: none; overflow: hidden; outline: 0; }
.title-edit:hover { border-color: var(--border); } .title-edit:focus { border-color: var(--accent); }
.drawer-body .note { margin: 6px 0 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin-top: 14px; }
.field { display: flex; align-items: center; min-height: 34px; min-width: 0; }
.field-label { width: 96px; flex: none; color: var(--muted); font-size: 13px; }
.field-value { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; min-height: 30px; padding: 2px 6px; border-radius: 6px; flex-wrap: wrap; }
button.field-value:hover { background: var(--bg-hover); }
.names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; padding: 8px 10px; border-radius: 6px; border: 1px solid transparent; min-height: 40px; cursor: text; line-height: 1.55; }
.desc:hover { border-color: var(--border); } .desc.placeholder { color: var(--faint); }
.desc-edit { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--bg); outline: 0; resize: none; overflow: hidden; line-height: 1.55; min-height: 80px; }
.subtasks { display: flex; flex-direction: column; }
.linked { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 6px; border-radius: 6px; cursor: pointer; }
.linked:hover { background: var(--bg-hover); }
.linked .ellipsis { flex: 1; }
.sub-add { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; color: var(--faint); min-height: 34px; }
.drawer .inline-add { padding-left: 12px; }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.comment-head .icon-btn { opacity: 0; margin-left: auto; } .comment:hover .icon-btn, .comment .icon-btn:focus-visible { opacity: 1; }
.time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.mention { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.activity { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; padding-left: 9px; }
.activity .time { margin-left: auto; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; margin-right: 9px; }
.composer { position: relative; display: flex; align-items: flex-end; gap: 10px; padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex: none; background: var(--bg-raised); }
.composer textarea { flex: 1; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; resize: none; background: var(--bg); outline: 0; min-height: 34px; max-height: 200px; }
.composer textarea:focus { border-color: var(--accent); }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-list { position: absolute; bottom: 100%; left: 60px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; min-width: 220px; }

/* ---------- inbox, people ---------- */
.inbox { display: flex; flex-direction: column; }
.notice { display: flex; align-items: center; gap: 12px; padding: 10px 24px; border-bottom: 1px solid var(--border); width: 100%; }
.notice:hover { background: var(--bg-sunken); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.notice.read .unread-dot { background: transparent; } .notice.read .notice-text { font-weight: 400; color: var(--muted); }
.notice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notice-text { font-weight: 500; }
.notice-task { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.people { --pcols: minmax(200px, 2fr) 90px minmax(120px, 2fr) 110px 150px; }
.people-head, .people-row { display: grid; grid-template-columns: var(--pcols); gap: 12px; align-items: center; padding: 8px 24px; width: 100%; }
.people-head { font-size: 11.5px; color: var(--faint); border-bottom: 1px solid var(--border); }
.people-row { border-bottom: 1px solid var(--border); min-height: 52px; }
.people-row:hover { background: var(--bg-sunken); } .people-row.disabled { opacity: .55; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.person small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* ---------- login, toast ---------- */
.login { min-height: 100%; display: grid; place-items: center; background: var(--bg-side); padding: 16px; }
.login-card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: var(--shadow); }
.login-card h1 { font-size: 26px; margin-top: 6px; } .login-card p { margin: 0; } .login-card .btn.big { width: 100%; margin-top: 14px; }
.dev-login { display: flex; gap: 8px; width: 100%; margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--border); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: calc(100vw - 32px); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .18s ease; padding-top: calc(12px + env(safe-area-inset-top)); }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(15, 20, 30, .4); }
  .topbar { display: flex; align-items: center; gap: 6px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; border-bottom: 1px solid var(--border); flex: none; font-size: 16px; }
  .topbar .icon-btn { width: 40px; height: 40px; }
  .nav-item { min-height: 40px; } kbd { display: none; }
  .screen-head { padding: 12px 16px 0; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .toolbar > * { flex: none; } .toolbar .spacer { display: none; }
  .search-box input { width: 110px; }
  .list { --cols: 18px 28px minmax(0, 1fr) auto auto; }
  .list-head { display: none; }
  .row, .list-head { padding-right: 12px; padding-left: calc(6px + var(--depth, 0) * 16px); }
  .row { min-height: 44px; }
  .row .row-key, .row .row-prio, .row .row-project { display: none; }
  .row-cell .ghost { display: none; }
  .row-title .chip { display: none; }
  .group-head { padding-left: 8px; padding-right: 12px; } .group-head.static { padding-left: 16px; }
  .inline-add { padding-left: calc(34px + var(--depth, 0) * 16px); min-height: 40px; }
  .board { padding: 12px 16px; gap: 10px; scroll-snap-type: x mandatory; }
  .column { flex-basis: 82vw; scroll-snap-align: center; }
  .drawer { width: 100%; border-left: 0; }
  .drawer-head { padding-left: 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .drawer-body { padding: 4px 16px 24px; }
  .composer { padding-left: 16px; padding-right: 16px; }
  .composer > .avatar { display: none; }
  .fields { grid-template-columns: 1fr; }
  .field { min-height: 40px; }
  .crumbs a { max-width: 130px; }
  .notice { padding: 12px 16px; align-items: flex-start; } .notice-time { display: none; }
  .people-head { display: none; }
  .people { --pcols: minmax(0, 1fr) auto; } .people-row { padding: 10px 16px; }
  .people-row > :nth-child(3), .people-row > :nth-child(5), .people-row > :nth-child(2) { display: none; }
  .overlay { padding-top: 16px; }
  .input, .select, .composer textarea, .menu-search, .inline-add.open input, .sub-add input, .search-box input { font-size: 16px; } /* stops iOS zooming on focus */
  .menu-item { min-height: 40px; }
  .icon-btn { width: 36px; height: 36px; } .icon-btn.tiny { width: 30px; height: 30px; } .icon-btn.caret { width: 18px; height: 28px; }
}
