/* Taskboard. Calm and dense: neutral surfaces, one warm accent, light and dark. */
:root {
  color-scheme: light;
  --bg: #f6f6f8; --panel: #fafafb; --surface: #ffffff; --raised: #ffffff;
  --text: #1c1c24; --muted: #6b6b7c; --faint: #9c9cac;
  --line: #e8e8ee; --line-strong: #d9d9e3; --hover: #efeff3; --press: #e7e7ed;
  --accent: #24242e; --accent-ink: #ffffff; --accent-soft: #ececf1; --accent-line: #cdcdd8;
  --danger: #c93a3a; --danger-soft: #fdecec; --ok: #23875a; --ok-soft: #e6f5ee; --info: #3d63dd; --info-soft: #eaf0ff;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05); --shadow-lg: 0 12px 40px rgba(20, 20, 40, .16), 0 2px 8px rgba(20, 20, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --r: 8px; --side: 236px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #111116; --panel: #14141a; --surface: #1a1a22; --raised: #20202a;
  --text: #ececf2; --muted: #9b9bae; --faint: #6a6a7e;
  --line: #26262f; --line-strong: #33333f; --hover: #20202a; --press: #282833;
  --accent: #ececf2; --accent-ink: #15151b; --accent-soft: #2a2a35; --accent-line: #4a4a5c;
  --danger: #ff7b72; --danger-soft: #3a1b1b; --ok: #5fcf96; --ok-soft: #14301f; --info: #8aa5ff; --info-soft: #1a2244;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111116; --panel: #14141a; --surface: #1a1a22; --raised: #20202a;
  --text: #ececf2; --muted: #9b9bae; --faint: #6a6a7e;
  --line: #26262f; --line-strong: #33333f; --hover: #20202a; --press: #282833;
  --accent: #ececf2; --accent-ink: #15151b; --accent-soft: #2a2a35; --accent-line: #4a4a5c;
  --danger: #ff7b72; --danger-soft: #3a1b1b; --ok: #5fcf96; --ok-soft: #14301f; --info: #8aa5ff; --info-soft: #1a2244;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
}

/* Graphite: no colour accent, so links are underlined instead. */
.md a, .agent a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.ic { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--mono); font-size: .88em; letter-spacing: -.01em; }
[hidden] { display: none !important; }

/* ── layout */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100dvh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 12px 8px calc(8px + env(safe-area-inset-bottom)); padding-left: calc(8px + env(safe-area-inset-left)); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px; margin-bottom: 10px; border-radius: 7px; align-self: flex-start; user-select: none; -webkit-user-select: none; font-weight: 650; letter-spacing: -.01em; font-size: 14px; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.brand .mark svg { width: 13px; height: 13px; stroke-width: 2.4; }
.nav { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; }
.nav-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 6px; color: var(--muted); text-align: left; min-height: 28px; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.on { background: var(--press); color: var(--text); font-weight: 550; }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .n { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav-item .badge { font-size: 10.5px; font-weight: 650; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-item.sub { padding-left: 27px; font-size: 13px; }
.nav-item .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; margin: 0 3px; }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.nav-add { color: var(--faint); border-radius: 5px; width: 20px; height: 20px; display: grid; place-items: center; margin: -3px -2px -3px 0; }
.nav-add:hover { background: var(--line-strong); color: var(--text); }
.side-foot { display: flex; align-items: center; gap: 2px; padding: 8px 4px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.side-foot .status { flex: 1; font-size: 11.5px; color: var(--faint); display: flex; align-items: center; gap: 6px; padding-left: 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.led { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.led.ok { background: var(--ok); }
.icon-btn { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.seg { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 5px 7px; border-radius: 6px; letter-spacing: .03em; }
.seg:hover { background: var(--hover); color: var(--text); }

/* ── top bar */
.top { display: flex; align-items: center; gap: 10px; padding: 12px 20px 10px; padding-right: calc(20px + env(safe-area-inset-right)); min-height: 54px; }
.top h1 { font-size: 16px; font-weight: 650; letter-spacing: -.015em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .crumb { color: var(--faint); font-weight: 450; }
.top .spacer { flex: 1; }
.top .menu-btn { display: none; }
.tfilters { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: 6px; padding-left: 14px; border-left: 1px solid var(--line); height: 22px; }
.tfilters .fwrap { height: 30px; border-color: transparent; background: none; }
.tfilters .fwrap:hover { border-color: var(--line); background: var(--surface); }
.tfilters .fwrap.on { background: var(--accent-soft); border-color: var(--accent-line); }
.search { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; height: 30px; width: 210px; color: var(--faint); }
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { border: 0; background: none; outline: 0; width: 100%; min-width: 0; color: var(--text); }
.search kbd { font: 10.5px var(--mono); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 550; white-space: nowrap; box-shadow: var(--shadow); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.small { height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ── dashboard */
:root { --s-created: #2a78d6; --s-done: #17a070; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s-created: #3987e5; --s-done: #199e70; } }
:root[data-theme="dark"] { --s-created: #3987e5; --s-done: #199e70; }
.dash { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px calc(40px + env(safe-area-inset-bottom)); scrollbar-width: thin; }
.dash-inner { max-width: 1120px; display: grid; gap: 22px; }
.dash h2 { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 0; }
.tile { padding: 12px 14px 11px; }
.tile .tl { color: var(--muted); font-size: 12.5px; }
.tile .tv { font-size: 30px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .ts { color: var(--faint); font-size: 11.5px; margin-top: 1px; }
.tile.warn .tv { color: var(--danger); }
.panel { padding: 14px 16px; }
.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.legend { display: flex; gap: 14px; margin-left: auto; font-size: 12px; color: var(--muted); }
.legend i, .tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2.5px; margin-right: 6px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 180px; margin-top: 44px; border-bottom: 1px solid var(--line-strong); border-top: 1px dashed var(--line); position: relative; }
.ymax { position: absolute; top: -17px; left: 0; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bcol { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; position: relative; border-radius: 6px 6px 0 0; outline-offset: -2px; }
.bcol:hover, .bcol:focus-visible { background: var(--hover); }
.bar { width: min(13px, 36%); border-radius: 4px 4px 0 0; }
.bar.c { background: var(--s-created); } .bar.d { background: var(--s-done); }
.tip { display: none; position: absolute; top: -8px; left: 50%; transform: translate(-50%, -100%); background: var(--raised); color: var(--text); border: 1px solid var(--line-strong); padding: 7px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; z-index: 3; pointer-events: none; box-shadow: var(--shadow-lg); }
.tip b { display: block; font-weight: 600; margin-bottom: 3px; } .tip span { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.bcol.first .tip { left: 0; transform: translateY(-100%); } .bcol.last .tip { left: auto; right: 0; transform: translateY(-100%); }
.bcol:hover .tip, .bcol:focus-visible .tip { display: block; }
.xlabels { display: flex; gap: 2px; margin-top: 6px; }
.xlabels span { flex: 1; min-width: 0; text-align: center; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.xlabels .cur { color: var(--text); font-weight: 600; }
.dtable { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.dtable th, .dtable td { text-align: right; padding: 3px 14px 3px 0; font-weight: 400; } .dtable th { color: var(--faint); } .dtable :is(th, td):first-child { text-align: left; }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.brow:last-child, .drow:last-child { border-bottom: 0; }
.brow .nm { display: flex; align-items: center; gap: 8px; font-weight: 550; } .brow .nm i { width: 8px; height: 8px; border-radius: 3px; }
.num { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.brow .track { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; } .track i { display: block; height: 100%; border-radius: 2px; }
.brow:hover .nm, .drow:hover .tt { text-decoration: underline; text-underline-offset: 2px; }
.drow { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.drow .id { color: var(--faint); flex: none; } .drow .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash.chatting { overflow: hidden; padding-bottom: 0; display: flex; }
.chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; max-width: 860px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 2px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.msg { display: flex; flex-direction: column; max-width: min(680px, 92%); }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; }
.bubble { padding: 9px 13px; border-radius: 14px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.user .bubble a { color: inherit; }
.msg.assistant .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.bubble.working { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.bubble.working .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
.msg-meta { font-size: 11px; color: var(--faint); margin: 3px 4px 0; }
.chat-sys { align-self: center; font-size: 11.5px; color: var(--faint); padding: 2px 10px; border: 1px solid var(--line); border-radius: 10px; }
.chat-empty { color: var(--muted); max-width: 56ch; margin: 18px 0; line-height: 1.55; }
.chat-box { display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 calc(16px + env(safe-area-inset-bottom)); }
.chat-box textarea { max-height: 40vh; padding: 9px 12px; font-size: 14px; line-height: 20px; }
.settings { max-width: 760px; gap: 14px; }
.settings .panel { padding: 14px 18px 12px; }
.settings .panel-head { margin-bottom: 4px; }
.settings .lead { color: var(--muted); margin: 4px 0 10px; max-width: 68ch; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .sl .hint { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 52ch; }
.srow .sc { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.settings label.f { display: block; margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.settings label.f > input { display: block; margin-top: 4px; font-weight: 400; color: var(--text); }
.settings .row-btns { margin-top: 12px; }
.settings input[type="time"].text { width: 132px !important; }
.settings select.text { height: 30px; border: 1px solid var(--line-strong); border-radius: 7px; background-color: var(--surface); padding: 0 24px 0 8px; max-width: 240px; }
.settings input.text { height: 30px; }
.ssub { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.switch { position: relative; display: inline-block; width: 34px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: var(--line-strong); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ngrid { display: grid; grid-template-columns: minmax(0, 1fr) 64px 78px; gap: 10px 8px; align-items: center; padding: 6px 0 12px; border-bottom: 1px solid var(--line); }
.ngrid.nomail { grid-template-columns: minmax(0, 1fr) 78px; }
.ngrid .nh { font-size: 11.5px; color: var(--faint); }
.ngrid .switch, .ngrid .nh:not(:first-child) { justify-self: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.chips span { padding: 2px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.wa-link { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.wa-link .qr { margin: 4px 0; width: 190px; height: 190px; flex: none; border: 1px solid var(--line); }
.wa-link > div { flex: 1; min-width: 220px; }
.side-foot .icon-btn.on { background: var(--press); color: var(--text); }
.task { padding: 10px 14px; }
.task.off .task-name { color: var(--muted); }
.task-head { display: flex; align-items: center; gap: 12px; }
.task-main { flex: 1; min-width: 0; text-align: left; display: grid; gap: 1px; }
.task-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-main .num { overflow: hidden; text-overflow: ellipsis; }
.task-status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.task-status.s-failed { color: var(--danger); }
.task-status.s-late { color: var(--danger); }
.task-status.s-today { color: var(--text); font-weight: 600; }
.task-ic { width: 44px; display: grid; place-items: center; color: var(--muted); flex: none; }
.dec-list > .ssub:first-of-type { margin-top: 4px; }
.dec-list > .ssub + .hint { margin: -2px 0 4px; font-size: 12px; color: var(--faint); }
.task-status .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
.task-body { margin-top: 8px; padding-top: 2px; border-top: 1px solid var(--line); }
.task-prompt { white-space: pre-wrap; font: 12px/1.5 var(--mono); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; margin: 8px 0 0; overflow-wrap: anywhere; }
.daychips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.daychip { position: relative; cursor: pointer; }
.daychip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.daychip span { display: block; padding: 4px 11px; border: 1px solid var(--line-strong); border-radius: 14px; font-size: 12.5px; color: var(--muted); }
.daychip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.daychip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) { .task-head { flex-wrap: wrap; } .task-main { flex-basis: 60%; } }
.dec-list { max-width: 860px; gap: 12px; }
.dec { padding: 14px 16px 12px; }
.dec-head { display: flex; gap: 11px; align-items: flex-start; }
.dec-head .grow { flex: 1; min-width: 0; }
.dec-head .num { padding-top: 2px; }
.dec-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--hover); color: var(--muted); }
.dec.k-question .dec-ic, .dec.k-plan .dec-ic { background: var(--accent); color: var(--accent-ink); }
.dec.k-failed .dec-ic { background: var(--danger-soft); color: var(--danger); }
.dec-kind { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.dec-title { font-weight: 600; font-size: 14.5px; text-align: left; letter-spacing: -.005em; line-height: 1.3; }
.dec-title:hover { text-decoration: underline; text-underline-offset: 2px; }
.dec-title .mono { color: var(--faint); font-weight: 400; }
.dec-text { margin: 10px 0 0 37px; padding: 9px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.dec-text.clip { max-height: 150px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.dec .reply { display: flex; gap: 6px; align-items: flex-end; margin: 10px 0 0 37px; }
.dec-actions { margin: 10px 0 0 37px; }
@media (max-width: 860px) { .srow { grid-template-columns: 1fr; gap: 6px; } .srow .sc { justify-content: flex-start; } }
@media (max-width: 860px) { .dec-text, .dec .reply, .dec-actions { margin-left: 0; } .dec-head .num { display: none; } }
.nav-gap { flex: 1; min-height: 14px; }
.dash .lead { color: var(--muted); margin: 0; max-width: 70ch; }
.dash .drow .btn { flex: none; }
div.drow { cursor: pointer; align-items: center; }
.dash .none { color: var(--faint); margin: 2px 0; }
.segs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; background: var(--surface); }
.segs button { padding: 3px 12px; border-radius: 6px; font-weight: 550; color: var(--muted); font-size: 12.5px; height: 24px; }
.segs button.on { background: var(--accent); color: var(--accent-ink); }

/* ── parent filter row */
.filters { display: flex; gap: 6px; padding: 0 20px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.filters::-webkit-scrollbar { display: none; }
.filters { align-items: center; gap: 8px; }
.fwrap { position: relative; display: inline-flex; align-items: center; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.fwrap:hover { border-color: var(--line-strong); }
.fwrap.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.fwrap > svg.ic { position: absolute; left: 9px; width: 13px; height: 13px; pointer-events: none; }
.fsel { field-sizing: content; appearance: none; -webkit-appearance: none; height: 100%; border: 0; background: none; outline: 0; padding: 0 26px 0 28px; font-size: 12.5px; font-weight: 550; color: inherit; max-width: min(360px, 70vw); text-overflow: ellipsis; cursor: pointer; border-radius: 8px;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 13px) 12px, calc(100% - 9px) 12px; background-size: 4px 4px; background-repeat: no-repeat; }
.fsel:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.fchip { display: inline-flex; align-items: center; height: 26px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); white-space: nowrap; flex: none; font-size: 12.5px; }
.fchip:hover { border-color: var(--line-strong); color: var(--text); }
.fchip .fmain { display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; height: 100%; border-radius: 13px; }
.fchip .n { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fchip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); font-weight: 550; }
.fchip .fmain svg.ic { width: 13px; height: 13px; color: var(--faint); }
.row-btns { align-items: center; }
.fchip .fedit { width: 22px; height: 22px; margin: 0 2px 0 -7px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.fchip .fedit:hover { background: var(--accent-line); color: var(--text); }
.fchip .fedit svg.ic { width: 12px; height: 12px; }
.fchip.add { border-style: dashed; padding: 0 11px 0 8px; gap: 4px; background: none; }
.fchip.add svg.ic { width: 12px; height: 12px; }
.top h1 .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 9px; vertical-align: 1px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.sw span { transition: transform .1s; } .sw:hover span { transform: scale(1.08); }
.sw { width: 24px; height: 24px; border-radius: 50%; position: relative; display: block; cursor: pointer; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sw span { display: block; width: 100%; height: 100%; border-radius: 50%; }
.sw span { display: grid; place-items: center; }
.sw:has(input:checked) span::after { content: ""; width: 10px; height: 5.5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.sw:has(input:focus-visible) span { box-shadow: 0 0 0 2px var(--raised), 0 0 0 4px var(--text); }
.row-btns { display: flex; gap: 6px; margin-top: 12px; }

/* ── board */
.board { flex: 1; min-height: 0; display: flex; gap: 6px; padding: 0 14px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.col { flex: 1 1 0; min-width: 226px; max-width: 420px; display: flex; flex-direction: column; min-height: 0; border-radius: 10px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px 8px; min-height: 36px; }
.col-head .name { font-weight: 600; font-size: 13px; }
.col-head .count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.col-head .spacer { flex: 1; }
.glyph { width: 14px; height: 14px; flex: none; }
.col-body { flex: 1; overflow-y: auto; min-height: 60px; padding: 0 6px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; border-radius: 8px; }
.col.over .col-body { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.col-empty { color: var(--faint); font-size: 12.5px; padding: 18px 8px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.quick { background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 8px 10px; box-shadow: 0 0 0 3px var(--accent-soft); }
.quick textarea { width: 100%; border: 0; outline: 0; resize: none; background: none; display: block; min-height: 20px; font-weight: 500; }
.quick-row { display: flex; gap: 6px; align-items: flex-start; }
.quick-row textarea { flex: 1; min-width: 0; padding-top: 4px; }
.quick .att-btn { width: 28px; height: 28px; border-color: transparent; background: none; }
.quick .att-btn:hover { background: var(--hover); }
.quick .att-chips { margin-top: 8px; }
.quick-actions { display: flex; gap: 6px; margin-top: 8px; }
.quick .hint { font-size: 11px; color: var(--faint); margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px 8px; box-shadow: var(--shadow); cursor: default; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: border-color .12s, transform .12s; position: relative; }
.card:hover { border-color: var(--line-strong); }
.card.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-hover { position: absolute; top: 5px; right: 5px; display: flex; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .12s; }
.card:hover .card-hover, .card:focus-within .card-hover { opacity: 1; pointer-events: auto; }
.card-hover .icon-btn { width: 26px; height: 26px; }
.card-hover .icon-btn.danger:hover { color: var(--danger); }
@media (hover: none) { .card-hover { display: none; } }
.card-title { font-weight: 520; line-height: 1.35; overflow-wrap: anywhere; letter-spacing: -.003em; }
.card-ctx { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 11.5px; min-width: 0; white-space: nowrap; overflow: hidden; }
.card-meta .id { color: var(--faint); font-family: var(--mono); font-size: 10.5px; flex: none; }
.card-ctx .chip { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex: 0 1 auto; }
.card-ctx .chip { overflow: hidden; }
.card-ctx .chip.board { flex-shrink: 0; } /* the board name stays whole; a long parent name is the one that gets cut */
.card-ctx .chip svg.ic { flex: none; }
.card-ctx svg.ic { width: 12.5px; height: 12.5px; }
.card-folder { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--muted); font-size: 11.5px; min-width: 0; }
.card-folder svg.ic { width: 12.5px; height: 12.5px; flex: none; color: var(--faint); }
.card-folder .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-folder { gap: 12px; }
.card-folder .fp { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.card-folder .fp.repo { flex: 0 1 auto; }
.card-ctx .prog { display: inline-flex; align-items: center; flex: none; color: var(--muted); }
.card-ctx .card-side { margin-left: auto; }
.card-meta .plan { color: var(--faint); }
.card-meta .id { display: inline-flex; align-items: center; gap: 6px; }
.card-meta .bdot { width: 7px; height: 7px; border-radius: 2.5px; flex: none; }
.card-meta .bname { gap: 5px; }
/* The assignee badge sits bottom right, next to the last line of details. A state pill ("Agent working") is wide:
   then the details keep their natural width and the pill takes its own line when they do not fit side by side,
   instead of squeezing the details into a narrow column under it. */
.card-foot { display: flex; align-items: flex-end; gap: 6px 8px; margin-top: 8px; min-height: 18px; }
.card-foot.wide { flex-wrap: wrap; align-items: center; }
.card-foot.wide .card-meta { flex: 1 1 auto; max-width: 100%; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; flex: 1 1 0; min-width: 0; color: var(--muted); font-size: 11.5px; min-height: 18px; }
.card-meta > * { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-meta svg.ic { width: 12.5px; height: 12.5px; }
.card-side { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.chip { max-width: none; }
.chip .txt { overflow: hidden; text-overflow: ellipsis; }
.chip i { width: 7px; height: 7px; border-radius: 2.5px; flex: none; }
.av { width: 18px; height: 18px; border-radius: 50%; background: var(--hover); color: var(--muted); font-size: 10px; font-weight: 700; justify-content: center; flex: none; }
.card-side .av { display: grid; place-items: center; }
.av.bot { background: var(--accent-soft); color: var(--accent); } /* not ".agent": that is the agent panel and has padding */
.av svg.ic { width: 11px; height: 11px; display: block; }
.props .av { display: inline-flex; align-items: center; }
.due.late { color: var(--danger); font-weight: 600; }
.due.today { color: var(--accent); font-weight: 600; }
.prog { gap: 5px !important; }
.prog .bar { width: 30px; height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--ok); border-radius: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 10.5px; font-weight: 650; padding: 1px 7px 1px 6px; border-radius: 9px; letter-spacing: .01em; }
.pill.run { background: var(--info-soft); color: var(--info); }
.pill.wait { background: var(--accent-soft); color: var(--accent); }
.pill .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.col[data-status="done"] .card { background: transparent; box-shadow: none; }
.col[data-status="done"] .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.card.drag-src { opacity: .28; border-style: dashed; box-shadow: none; }
.card.ghost { position: fixed; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); transform: rotate(1.6deg) scale(1.02); border-color: var(--accent-line); margin: 0; }
body.dragging { cursor: grabbing; }
body.dragging * { cursor: grabbing !important; }

/* ── celebration when a card reaches Done: a graphite sweep from left to right and a check, no confetti */
.card.cele { overflow: hidden; animation: cele-card .55s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(0ms - var(--el, 0ms)); }
.col[data-status="done"] .card.cele { background: var(--surface); }
.cele-layer { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; overflow: hidden; }
.cele-sweep { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 0%, color-mix(in srgb, var(--text) 16%, transparent) 42%, color-mix(in srgb, var(--text) 6%, transparent) 58%, transparent 100%); transform: translateX(-115%); animation: cele-sweep 1s cubic-bezier(.25, .7, .2, 1) both; animation-delay: calc(40ms - var(--el)); }
.cele-check { position: absolute; right: 12px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 3px 12px color-mix(in srgb, var(--text) 22%, transparent); animation: cele-pop 1.75s cubic-bezier(.2, 1.5, .35, 1) both; animation-delay: calc(120ms - var(--el)); }
.cele-check path { fill: none; stroke: var(--accent-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 15; stroke-dashoffset: 15; animation: cele-draw .34s ease-out both; animation-delay: calc(330ms - var(--el)); }
.cele-ring { position: absolute; right: 12px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; border: 1.5px solid var(--text); opacity: 0; animation: cele-ring .8s ease-out both; animation-delay: calc(260ms - var(--el)); }
@keyframes cele-card { 0% { transform: scale(.975); } 55% { transform: scale(1.012); } 100% { transform: none; } }
@keyframes cele-sweep { to { transform: translateX(115%); } }
@keyframes cele-pop { 0% { transform: scale(0); opacity: 0; } 14% { transform: scale(1.18); opacity: 1; } 24% { transform: scale(1); } 82% { transform: scale(1); opacity: 1; } 100% { transform: scale(.5); opacity: 0; } }
@keyframes cele-draw { to { stroke-dashoffset: 0; } }
@keyframes cele-ring { 0% { transform: scale(.9); opacity: 0; } 2% { transform: scale(.9); opacity: .45; } 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cele-layer { display: none; } }

/* ── drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 20, .28); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 30; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(102%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); z-index: 40; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.d-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); padding-top: calc(10px + env(safe-area-inset-top)); }
.d-head .id { color: var(--faint); }
.d-head .spacer { flex: 1; }
.d-head .del-btn:hover { background: var(--danger-soft); color: var(--danger); }
.d-body { flex: 1; overflow-y: auto; padding: 18px 20px calc(40px + env(safe-area-inset-bottom)); scrollbar-width: thin; }
.d-title { width: 100%; border: 0; outline: 0; background: none; resize: none; font-size: 20px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; padding: 0; display: block; overflow: hidden; }
.props { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 2px 8px; margin: 14px 0 6px; align-items: center; }
.props dt { color: var(--muted); font-size: 12.5px; }
.props dd { margin: 0; min-width: 0; display: flex; align-items: center; gap: 2px; }
.pslot { width: 22px; height: 22px; display: grid; place-items: center; flex: none; color: var(--faint); }
.pslot .av { width: 18px; height: 18px; display: grid; place-items: center; }
.bdot { width: 9px; height: 9px; border-radius: 3px; }
.field { height: 28px; border: 1px solid transparent; border-radius: 6px; background: none; padding: 0 7px; max-width: 100%; min-width: 0; outline: 0; }
.props .field { width: min(250px, 100%); font-size: 13.5px; }
.field:hover { background: var(--hover); }
.field:focus { border-color: var(--accent-line); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
select.field { appearance: none; -webkit-appearance: none; padding-right: 22px; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 13px) 12px, calc(100% - 9px) 12px; background-size: 4px 4px; background-repeat: no-repeat; text-overflow: ellipsis; }
input[type="date"].field { font-variant-numeric: tabular-nums; appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; font-family: inherit; }
input[type="date"].field::-webkit-datetime-edit, input[type="date"].field::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type="date"].field::-webkit-date-and-time-value { text-align: left; }
input[type="date"].field::-webkit-datetime-edit { flex: 1; }
input[type="date"].field::-webkit-calendar-picker-indicator { opacity: .45; margin: 0; padding: 0; cursor: pointer; }
.field.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.field.empty { color: var(--faint); }
.sect { margin-top: 22px; }
.sect-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sect-head h3 { margin: 0; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sect-head .spacer { flex: 1; }
.sect-head .sub { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.notes-view { min-height: 44px; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--line); cursor: text; overflow-wrap: anywhere; }
.notes-view:hover { border-color: var(--line-strong); }
.notes-view.empty { color: var(--faint); }
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; }
.md ul { margin: 0 0 8px; padding-left: 18px; } .md li { margin: 1px 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--hover); padding: 1px 4px; border-radius: 4px; }
.md h4 { margin: 10px 0 4px; font-size: 13.5px; }
.md ol { margin: 0 0 8px; padding-left: 20px; }
.md pre { margin: 0 0 8px; padding: 8px 10px; background: var(--hover); border-radius: 6px; overflow-x: auto; font-size: 12px; line-height: 1.45; }
.md pre code { background: none; padding: 0; }
.mdt-wrap { overflow-x: auto; margin: 2px 0 8px; }
.mdt { border-collapse: collapse; width: 100%; font-size: 12.5px; line-height: 1.4; }
.mdt th, .mdt td { text-align: left; vertical-align: top; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); }
.mdt th { font-weight: 600; font-size: 11.5px; color: var(--muted); border-bottom-color: var(--line-strong); }
.mdt tr:last-child td { border-bottom: 0; }
.mdt td:first-child, .mdt th:first-child { white-space: nowrap; }
.mdt th:last-child, .mdt td:last-child { padding-right: 0; }
.msg.user .mdt th { color: inherit; }
.summary.md, .dec-text.md { white-space: normal; }
textarea.area { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); padding: 8px 10px; outline: 0; resize: vertical; min-height: 44px; display: block; line-height: 1.45; }
textarea.area:focus, input.text:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
input.text { width: 100%; height: 30px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); padding: 0 9px; outline: 0; }

.cl-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.cl-bar i { display: block; height: 100%; background: var(--ok); border-radius: 2px; transition: width .25s; }
.cl-group { margin-top: 12px; }
.cl-group > .gh { display: flex; align-items: baseline; gap: 8px; padding: 2px 0 4px; border-bottom: 1px solid var(--line); }
.cl-group > .gh b { font-weight: 600; font-size: 13px; }
.cl-group > .gh span { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cl-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto auto; gap: 8px; align-items: start; padding: 5px 0 5px 1px; border-bottom: 1px solid var(--line); }
.cl-item:last-of-type { border-bottom: 0; }
.cl-item input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 2px 0 0; border: 1.5px solid var(--line-strong); border-radius: 4.5px; background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; }
.cl-item input[type="checkbox"]:hover { border-color: var(--muted); }
.cl-item input[type="checkbox"]:checked { background: var(--ok); border-color: var(--ok); }
.cl-item input[type="checkbox"]:checked::after { content: ""; width: 8px; height: 4.5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-1px); }
.cl-item .tx { outline: 0; border-radius: 4px; overflow-wrap: anywhere; }
.cl-item .tx:focus { background: var(--hover); box-shadow: 0 0 0 3px var(--hover); }
.cl-item .nt { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.cl-item.done .tx { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.cl-item.done .nt { opacity: .6; }
.who { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 9px; background: var(--hover); color: var(--muted); margin-top: 1px; cursor: pointer; }
.who.other { background: var(--accent-soft); color: var(--accent); }
.who.self { opacity: 0; background: none; color: var(--faint); }
.cl-item:hover .who.self, .who.self:focus-visible { opacity: 1; }
.col-empty small { display: block; margin-top: 4px; font-size: 11.5px; }
.cl-item .del { opacity: 0; color: var(--faint); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; }
.cl-item:hover .del, .cl-item .del:focus-visible { opacity: 1; }
.cl-item .del:hover { background: var(--danger-soft); color: var(--danger); }
.cl-item .del.up:hover { background: var(--hover); color: var(--text); }
.cl-item .del svg.ic { width: 13px; height: 13px; }
.cl-add { display: flex; gap: 6px; margin-top: 8px; }
.cl-add input { flex: 1; min-width: 0; }

.agent { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--panel); }
.agent.live { border-color: var(--accent-line); background: var(--accent-soft); }
.agent-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-row .grow { flex: 1; min-width: 120px; }
.agent .state { font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.agent .meta { color: var(--muted); font-size: 12px; }
.agent .summary { margin-top: 10px; padding: 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; max-height: 260px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.agent .reply { display: flex; gap: 6px; margin-top: 10px; align-items: flex-end; }
/* attachments in the message boxes */
.att-btn { padding: 0; width: 34px; height: 34px; justify-content: center; flex: none; color: var(--muted); }
/* Message rows (agent reply, Decisions, comments, Chat): text box, paperclip and Send share one height and corner,
   and line up at the bottom when the text box grows. */
.reply, .composer { --msg-h: 38px; --msg-r: 8px; }
.chat-box { --msg-h: 40px; --msg-r: 12px; }
:is(.reply, .composer, .chat-box) textarea { flex: 1; min-width: 0; min-height: var(--msg-h); padding: 8px 11px; line-height: 20px; border-radius: var(--msg-r); resize: none; }
:is(.reply, .composer, .chat-box) .btn { height: var(--msg-h); border-radius: var(--msg-r); flex: none; }
:is(.reply, .composer, .chat-box) .att-btn { width: var(--msg-h); }
:is(.reply, .composer, .chat-box) .btn:not(.att-btn) { padding: 0 14px; }
.att-btn svg.ic { width: 16px; height: 16px; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.att-chips[hidden] { display: none; }
.agent .att-chips + .reply, .att-chips + .composer { margin-top: 6px; }
.dec .att-chips { margin-left: 37px; }
.dec .att-chips + .reply { margin-top: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; padding: 3px 6px 3px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 12px; text-decoration: none; }
.att-chip svg.ic { width: 12.5px; height: 12.5px; flex: none; color: var(--muted); }
.att-chip .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip.busy { color: var(--muted); }
.att-chip.bad { border-color: var(--danger); color: var(--danger); }
.att-chip .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; flex: none; margin: 0 4px; }
.att-x { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; flex: none; }
.att-x:hover { background: var(--panel); color: var(--text); }
.att-x svg.ic { width: 11px; height: 11px; }
a.att-chip { padding-right: 8px; }
a.att-chip:hover { border-color: var(--muted); }
.chat > .att-chips { margin: 0 0 2px; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.msg.user .msg-files { justify-content: flex-end; }
@media (max-width: 860px) { .dec .att-chips { margin-left: 0; } }
/* files on a card */
.file-list { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.file-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 11px; }
.file-row + .file-row { border-top: 1px solid var(--line); }
.file-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--panel); color: var(--muted); flex: none; }
.file-ic svg.ic { width: 15px; height: 15px; }
.file-main { flex: 1; min-width: 0; }
.file-name { display: block; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-weight: 550; color: var(--text); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.file-name { cursor: pointer; }
button.file-name:hover { text-decoration: underline; }
.file-meta { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row.off .file-name { color: var(--muted); }
.file-row.bad .file-meta { color: var(--danger); }
.file-row a.btn { text-decoration: none; }
@media (max-width: 520px) { .file-row .btn.small { padding-left: 7px; padding-right: 7px; font-size: 0; gap: 0; } .file-row .btn.small svg.ic { width: 15px; height: 15px; } }
.dialog.file-dialog { width: min(1100px, 100%); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.file-view { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 34px); }
.file-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); flex: none; }
.file-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-head a.btn { text-decoration: none; }
.file-body { padding: 12px 18px 18px; overflow: auto; min-height: 120px; }
.file-body img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 6px; }
.file-count { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.file-scroll { overflow: auto; max-height: calc(100dvh - 190px); border: 1px solid var(--line); border-radius: 8px; }
.file-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.file-table th, .file-table td { text-align: left; padding: 6px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.file-table th { position: sticky; top: 0; background: var(--panel); font-weight: 600; font-size: 11.5px; color: var(--muted); border-bottom-color: var(--line-strong); }
.file-table tr:last-child td { border-bottom: 0; }
.file-pre { margin: 0; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.runs { margin-top: 8px; font-size: 12px; color: var(--muted); }
.runs summary { cursor: pointer; }
.runs li { margin: 3px 0; }

.comment { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; padding: 8px 0; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--hover); color: var(--muted); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.avatar.claude { background: var(--accent-soft); color: var(--accent); }
.comment .hd { font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.comment .hd b { color: var(--text); font-weight: 600; }
.composer { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; }

/* ── dialogs, toasts */
.dialog-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(10, 10, 20, .36); animation: fade .15s; }
.dialog { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 18px; animation: pop .16s cubic-bezier(.2, .8, .2, 1); }
.dialog h2 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.015em; }
.dialog .lead { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.dialog label.f { display: block; margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dialog label.f > :is(input, select, textarea) { display: block; margin-top: 4px; font-weight: 400; color: var(--text); }
.dialog select.text { width: 100%; height: 30px; border: 1px solid var(--line-strong); border-radius: 7px; background-color: var(--surface); padding: 0 24px 0 7px; }
.qr { display: block; width: 220px; height: 220px; margin: 10px auto; border-radius: 10px; background: #fff; padding: 6px; }
.paircode { font-size: 24px; letter-spacing: .12em; text-align: center; margin: 10px 0 0; font-weight: 650; }
.ok-line { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ok); margin: 4px 0; }
.with-btn { display: flex; gap: 6px; margin-top: 4px; }
.with-btn input { flex: 1; min-width: 0; }
.with-btn .btn { height: 30px; flex: none; }
.dialog .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.dialog .hint:empty { display: none; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.dialog .actions .spacer { flex: 1; }
.checks { display: grid; gap: 1px; margin-top: 6px; }
.checks .grp { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin: 10px 0 2px; }
.check { display: flex; align-items: flex-start; gap: 9px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-weight: 400; color: var(--text); font-size: 13px; }
.check:hover { background: var(--hover); }
.dialog form > .check, .dialog > div > .check { padding: 4px 0; margin-top: 16px !important; align-items: center; }
.dialog form > .check:hover { background: none; }
.dialog form > .check input { margin: 0; }
.dialog label.f { margin-top: 16px; }
.dialog h2 + label.f, .dialog .lead + label.f { margin-top: 14px; }
.row-btns { margin-top: 16px; }
.check input { margin: 2px 0 0; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.radio-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; margin-top: 6px; }
.radio-row label { border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; cursor: pointer; display: block; }
.radio-row label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row b { display: block; font-weight: 600; font-size: 13px; }
.radio-row span { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.radio-row.stack { grid-template-columns: 1fr; }
.radio-row.two { grid-template-columns: 1fr 1fr; }
.sched-box { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.sched-box label.f { margin-top: 12px; }
.sched-box select.text, .sched-box input.text { width: 100%; }
.sched-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12.5px; min-height: 26px; }
.sched-row .grow { flex: 1; min-width: 0; }
.sched-row > svg.ic { color: var(--faint); }
.radio-row.stack label { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.warnbox { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--danger); border-radius: 8px; background: var(--danger-soft); font-size: 12.5px; }
.warnbox p { margin: 0 0 6px; }
.warnbox .check { padding: 3px 0; font-weight: 600; }
.warnbox .check:hover { background: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 7px 13px; border-radius: 8px; font-weight: 550; font-size: 13px; box-shadow: var(--shadow-lg); animation: pop .16s; }
.note-toast { pointer-events: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; max-width: min(640px, calc(100vw - 24px)); padding: 9px 9px 9px 14px; }
.note-toast .note-text { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.note-toast .note-btn { font: inherit; font-size: 12.5px; font-weight: 600; color: inherit; background: color-mix(in srgb, var(--bg) 16%, transparent); border: 0; border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.note-toast .note-btn:hover { background: color-mix(in srgb, var(--bg) 26%, transparent); }
.note-toast .note-x { display: grid; place-items: center; width: 26px; height: 26px; color: inherit; background: none; border: 0; border-radius: 6px; cursor: pointer; opacity: .7; }
.note-toast .note-x:hover { opacity: 1; }
.note-toast .note-x svg.ic { width: 14px; height: 14px; }
.login { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 90; padding: 20px; text-align: center; color: var(--muted); }

/* ── small screens */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: min(280px, 84vw); z-index: 35; transform: translateX(-102%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); padding-top: calc(12px + env(safe-area-inset-top)); }
  .side.on { transform: none; }
  .nav-item { min-height: 36px; font-size: 14.5px; }
  .top { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 6px; }
  .top .menu-btn { display: grid; }
  .filters { padding: 0 12px 8px; }
  .dash { padding: 4px 12px calc(32px + env(safe-area-inset-bottom)); }
  .xlabels span:nth-last-child(even) { visibility: hidden; }
  .segs button { height: 28px; }
  .search { width: 34px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .search input, .search kbd { display: none; }
  .search:focus-within, .search.open { width: 100%; padding: 0 8px; border-color: var(--accent-line); background: var(--surface); position: absolute; left: 12px; right: 12px; width: auto; z-index: 2; }
  .search:focus-within input, .search.open input { display: block; }
  .btn .wide { display: none; }
  .board { scroll-snap-type: x mandatory; padding: 0 6px; gap: 0; scroll-padding: 0 6px; }
  .col { min-width: 86vw; max-width: 86vw; scroll-snap-align: start; }
  .card { padding: 11px 12px 10px; }
  .card-title { font-size: 14.5px; }
  body { font-size: 14.5px; }
  .drawer { width: 100vw; border-left: 0; }
  .field, input.text, .btn, .dialog select.text { height: 34px; }
  .cl-item .del, .who.self { opacity: 1; }
  .props { grid-template-columns: 82px minmax(0, 1fr); }
  .props .field { width: 100%; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Dropdown menu in the board's style for every <select> (T-83, `openSelm` in app.js). The closed select keeps its
   own look; selects that still showed the browser's arrow get the same chevron as select.field. */
select.text { appearance: none; -webkit-appearance: none; padding-right: 24px; text-overflow: ellipsis; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
select.text:focus-visible { outline: 0; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.selm { position: fixed; z-index: 200; max-width: min(420px, calc(100vw - 16px)); overflow-y: auto; overscroll-behavior: contain; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; font-size: 13px; animation: selm-in .12s cubic-bezier(.2, .8, .2, 1); }
@keyframes selm-in { from { opacity: 0; transform: translateY(-3px); } }
.selm-opt { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 5px 9px; border-radius: 6px; cursor: pointer; color: var(--text); user-select: none; -webkit-user-select: none; }
.selm-opt.hl { background: var(--hover); }
.selm-opt.on { font-weight: 600; }
.selm-opt.off { color: var(--faint); cursor: default; }
.selm-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selm-opt > svg.ic { width: 14px; height: 14px; flex: none; color: var(--text); }
.selm-grp { padding: 8px 9px 3px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); user-select: none; -webkit-user-select: none; }
.selm-grp:first-child { padding-top: 4px; }
.selm-sub { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-family: var(--mono); font-size: 11.5px; }
