/* PolyWorker.ai — dark only. Jobs are coloured lanes; everything else stays quiet. */
:root {
  color-scheme: dark;
  --bg: #141826;
  --surface: #1C2133;
  --raised: #252B40;
  --line: #343B55;
  --line-soft: #2A3047;
  --text: #E4E7F1;
  --muted: #9AA2BD;
  --faint: #6C7491;
  --signal: #82A8FF;
  --signal-ink: #0F1630;
  --amber: #F2B356;
  --coral: #F07A78;
  --mint: #7FD1A8;
  --lane: var(--signal);
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.4rem;
  --step-3: 1.85rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* Auth screens opt out: iPhone browsers (Brave included) treat 100vh as taller
   than the visible page, so a 100%-tall body plus a 100vh card sits low. */
html:has(.auth-wrap),
html:has(.auth-wrap) body { height: auto; min-height: 100vh; min-height: 100svh; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-1); }
h3 { font-size: var(--step-0); }
p { margin: 0 0 1em; max-width: 72ch; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--step--1); }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; word-break: break-word; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 1.5rem 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
  padding: 1.1rem .8rem;
  display: flex; flex-direction: column; gap: 1.1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 650; font-size: 1.05rem; color: var(--text); padding: 0 .5rem; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; gap: 2px; }
.brand-mark i { width: 4px; height: 18px; border-radius: 2px; display: block; }
.brand-mark i:nth-child(1) { background: #82A8FF; }
.brand-mark i:nth-child(2) { background: #F2B356; height: 14px; margin-top: 4px; }
.brand-mark i:nth-child(3) { background: #7FD1A8; height: 10px; margin-top: 8px; }
.brand-name { line-height: 1; }
.brand small { color: var(--faint); font-weight: 400; font-size: .8em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--muted); padding: .42rem .6rem; border-radius: var(--radius-s);
  display: flex; justify-content: space-between; align-items: center;
}
.nav a:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--raised); color: var(--text); }
.nav-group-title { color: var(--faint); font-size: var(--step--1); padding: 0 .6rem .2rem; }
.nav .lane-link { border-left: 3px solid var(--lane); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding-left: .55rem; }
.nav .lane-link .live { width: 7px; height: 7px; border-radius: 50%; background: var(--lane); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lane) 25%, transparent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }

.timer {
  border: 1px solid var(--line); border-left: 4px solid var(--lane);
  border-radius: var(--radius-s); padding: .6rem .7rem; background: var(--bg);
}
.timer .t { font: 600 1.25rem/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.timer .who { font-size: var(--step--1); color: var(--muted); margin-bottom: .2rem; }
.timer form { display: inline; }
.timer .row { display: flex; gap: .4rem; margin-top: .45rem; }

.main { padding: 1.8rem 2.2rem 4rem; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: .3rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.btn.menu-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
  font: 500 var(--step--1)/1 var(--font); color: var(--text);
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: .55rem .85rem; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--coral); }
.btn.danger:hover { border-color: var(--coral); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--line); }
.btn.sm { padding: .35rem .6rem; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--signal); cursor: pointer; padding: 0; font: inherit; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field label { font-size: var(--step--1); color: var(--muted); }
.field .help { font-size: var(--step--1); color: var(--faint); }
.field .err { font-size: var(--step--1); color: var(--coral); }
.field.check { flex-direction: row; align-items: center; gap: .5rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], input:not([type]), select, textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: .55rem .65rem; font: inherit; font-size: var(--step-0);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgb(130 168 255 / .18); }
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
input[type=color] { width: 3rem; height: 2.3rem; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); }
.color-pair { display: flex; align-items: center; gap: .5rem; }
.color-pair input[type="color"] { flex: none; }
.color-pair input[type="text"] { flex: 1; width: auto; min-width: 0; }
input[type=checkbox] { accent-color: var(--signal); width: 1rem; height: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 1.1rem; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset { border: 0; border-top: 1px solid var(--line-soft); padding: 1.1rem 0 0; margin: 0 0 1rem; }
legend { color: var(--text); font-weight: 600; padding-right: .6rem; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }
.inline-form .grow { flex: 1 1 220px; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.filters select, .filters input { width: auto; min-width: 9rem; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-m); padding: 1.1rem 1.2rem; }
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.panel-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.stack > * + * { margin-top: 1rem; }

/* ---------- lanes (the signature element) ---------- */
.lanes { display: flex; flex-direction: column; gap: .55rem; }
.lane {
  display: grid; grid-template-columns: 6px minmax(140px, 1.1fr) minmax(170px, 1fr) minmax(0, 2fr) auto;
  gap: 1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-m);
  padding: .85rem 1rem .85rem 0; overflow: hidden;
}
.lane.is-live { border-color: color-mix(in srgb, var(--lane) 55%, var(--line)); }
.lane-bar { align-self: stretch; background: var(--lane); margin: -.85rem 0; }
.lane-name { font-weight: 600; }
.lane-name a { color: var(--text); }
.lane-meta { font-size: var(--step--1); color: var(--muted); }
.lane-ctx { font-size: var(--step--1); color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lane-ctx em { color: var(--faint); font-style: normal; }
.hours { display: flex; flex-direction: column; gap: .3rem; }
.hours-track { height: 6px; background: var(--raised); border-radius: 3px; position: relative; overflow: hidden; }
.hours-fill { position: absolute; inset: 0 auto 0 0; background: var(--lane); border-radius: 3px; }
.hours-fill.over { background: repeating-linear-gradient(-45deg, var(--lane), var(--lane) 4px, var(--amber) 4px, var(--amber) 8px); }
.core { display: inline-flex; align-items: center; gap: .3rem; }
.core::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.core.in::before { background: var(--mint); }

.capacity { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.capacity .big { font-size: var(--step-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.capacity-track { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--raised); margin: .6rem 0 .2rem; }
.capacity-track span { display: block; height: 100%; background: var(--lane); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .6rem 0; border-top: 1px solid var(--line-soft); display: flex; gap: .7rem; align-items: flex-start; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lane); flex: none; margin-top: .45rem; }
.tag { display: inline-block; font-size: .75rem; padding: .08rem .45rem; border-radius: 999px; background: var(--raised); color: var(--muted); border: 1px solid var(--line-soft); }
.tag.job { border-color: color-mix(in srgb, var(--lane) 50%, transparent); color: var(--text); }
.tag.job::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lane); margin-right: .35rem; vertical-align: 1px; }
.tag.urgent, .tag.overdue { color: var(--coral); border-color: rgb(240 122 120 / .4); }
.tag.high { color: var(--amber); border-color: rgb(242 179 86 / .4); }
.tag.blocked { color: var(--amber); }
.tag.done { color: var(--mint); }
.tag.ai { color: var(--signal); border-color: rgb(130 168 255 / .4); }
.status-form select {
  width: auto; min-width: 6.6rem; padding: .2rem .15rem; font-size: var(--step--1);
  background: transparent; border-color: transparent; color: var(--muted); cursor: pointer;
}
.status-form select:hover, .status-form select:focus { background: var(--bg); border-color: var(--line); color: var(--text); }

.list > li.task { align-items: center; gap: .85rem; padding-left: .7rem; border-left: 3px solid var(--lane); }
.task .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-top: .12rem; color: var(--faint); font-size: var(--step--1); }
.task .who, .log .who { color: var(--muted); }
.task .ref { color: var(--faint); }
.task .facts {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: .05rem;
  min-width: 7.4rem; text-align: right; font-size: var(--step--1); line-height: 1.35;
  font-variant-numeric: tabular-nums; color: var(--muted);
}
.task .facts .overdue { color: var(--coral); }
.task .facts .when:empty { min-height: 1.2em; }
.task .facts .est { color: var(--faint); }

.dayhead {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin: 1.25rem 0 .15rem; font-size: var(--step-0); font-weight: 600; color: var(--text);
}
h2 + .dayhead { margin-top: .15rem; }
.dayhead .total { color: var(--muted); font-weight: 500; }
.log { list-style: none; margin: 0; padding: 0; }
.log > li {
  position: relative;
  display: grid; grid-template-columns: 7.6rem 4.8rem minmax(0, 1fr);
  gap: .25rem .8rem; align-items: start;
  padding: .55rem .15rem .55rem .7rem; border-top: 1px solid var(--line-soft); border-left: 3px solid var(--lane);
}
.log > li:first-child { border-top: 0; }
.log .when { color: var(--muted); padding-top: .08rem; }
.log .dur { font-weight: 600; padding-top: .08rem; }
.log .what { min-width: 0; }
.log .line { display: flex; gap: .75rem; align-items: baseline; min-width: 0; }
.log .work { min-width: 0; }
.log .note { color: var(--faint); font-size: var(--step--1); }
.log .who { margin-left: auto; flex: none; font-size: var(--step--1); white-space: nowrap; }
.log form {
  position: absolute; right: .15rem; top: .4rem; opacity: 0; pointer-events: none;
  background: var(--surface); padding-left: .45rem;
}
.log > li:hover form, .log > li:focus-within form { opacity: 1; pointer-events: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th { text-align: left; color: var(--faint); font-weight: 500; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table-wrap { overflow-x: auto; }

/* ---------- schedule ---------- */
.page-schedule { overflow: hidden; }
.page-schedule .shell,
.page-schedule .main { height: 100vh; }
.page-schedule .main {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding-bottom: 1.2rem;
}
.page-schedule .main > * { flex: none; }
.page-schedule .cal { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cal { border: 1px solid var(--line-soft); border-radius: var(--radius-m); background: var(--surface); }
.cal-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.cal-head, .cal-body { display: grid; grid-template-columns: 3.6rem repeat(7, minmax(8.25rem, 1fr)); min-width: 62rem; }
.cal-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-gutter, .cal-times { position: sticky; left: 0; z-index: 3; background: var(--surface); }
.cal-gutter { z-index: 5; }
.cal-dayhead { text-align: center; padding: .45rem .25rem .55rem; border-left: 1px solid var(--line-soft); }
.cal-dayhead .dow { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; }
.cal-dayhead .dom { display: inline-flex; align-items: center; justify-content: center; min-width: 1.7rem; height: 1.7rem; margin-top: .1rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-dayhead.today .dow { color: var(--signal); }
.cal-dayhead.today .dom { color: var(--signal-ink); background: var(--signal); border-radius: 999px; }
.cal-col { position: relative; border-left: 1px solid var(--line-soft); }
.cal-col.today { background: color-mix(in srgb, var(--signal) 8%, transparent); }
.cal-slot { border-top: 1px solid var(--line-soft); box-sizing: border-box; }
.cal-hour { box-sizing: border-box; border-top: 1px solid transparent; color: var(--faint); font-size: .68rem; text-align: right; padding: .15rem .4rem 0 0; font-variant-numeric: tabular-nums; }
.cal-ev { position: absolute; z-index: 1; overflow: hidden; box-sizing: border-box; background: var(--lane); border-radius: 4px; padding: 2px 5px; font-size: .72rem; line-height: 1.25; }
.cal-ev:hover { text-decoration: none; filter: brightness(1.08); }
.cal-ev .t { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev .m, .cal-ev .why { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.cal-ev.hard { outline: 2px solid var(--coral); outline-offset: -2px; }
.cal-ev.soft { outline: 1px solid var(--amber); outline-offset: -1px; }
.cal-now { position: absolute; left: 0; right: 0; z-index: 2; height: 2px; background: var(--coral); pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -1px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.agenda .when { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 6.5rem; font-size: var(--step--1); padding-top: .1rem; }
.clash-text { color: var(--coral); font-size: var(--step--1); }
.clash-text.soft { color: var(--amber); }

.dayboard-scale, .dayrow { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .6rem; align-items: center; }
.dayboard-scale { margin-bottom: .15rem; }
.dayboard-scale .scale { position: relative; height: 1rem; }
.dayboard-scale .scale span { position: absolute; top: 0; color: var(--faint); font-size: .7rem; font-variant-numeric: tabular-nums; transform: translateX(-50%); }
.dayboard-scale .scale span:first-child { transform: none; }
.dayrow { margin: .3rem 0; }
.dayrow .name { color: var(--text); font-size: var(--step--1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dayrow .track { position: relative; height: 1.75rem; background: var(--bg); border-radius: 4px; }
.dayrow .coreband { position: absolute; top: 0; bottom: 0; background: var(--raised); border-radius: 3px; }
.dayrow .block { position: absolute; top: 3px; bottom: 3px; z-index: 1; overflow: hidden; white-space: nowrap; color: var(--text); font-size: .7rem; line-height: 1.35rem; padding: 0 .35rem; border-radius: 3px; border-left: 3px solid var(--lane); background: color-mix(in srgb, var(--lane) 42%, var(--bg)); }
.dayrow .block.hard { outline: 1px solid var(--coral); }
.dayrow .block.soft { outline: 1px solid var(--amber); }
.dayrow .block:hover { text-decoration: none; }
.dayrow .now { position: absolute; top: 0; bottom: 0; z-index: 2; width: 1px; background: var(--text); }
.switch-card { border-left: 4px solid var(--lane); background: var(--bg); border-radius: var(--radius-s); padding: .75rem .9rem; margin-bottom: 1rem; }
.switch-facts { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: var(--step--1); }
.switch-facts li + li { margin-top: .15rem; }

/* ---------- flashes ---------- */
.flashes { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.2rem; }
.flash { padding: .65rem .9rem; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; }
.flash.success { border-left-color: var(--mint); }
.flash.error { border-left-color: var(--coral); }
.flash.warning { border-left-color: var(--amber); }
.flash.info { border-left-color: var(--signal); }

.empty { color: var(--muted); padding: 1.2rem 0; }
.empty a { font-weight: 500; }

/* ---------- auth & landing ---------- */
.auth-wrap {
  min-height: 100vh;
  min-height: 100svh; /* visible height while the mobile toolbar is open; 100vh includes it */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}
.auth { width: 100%; max-width: 400px; margin-block: auto; }
.auth .brand { justify-content: center; margin-bottom: 1.5rem; font-size: 1.25rem; }
.auth .panel { padding: 1.6rem; }
.auth h1 { font-size: var(--step-2); }
.auth-foot { text-align: center; margin-top: 1rem; color: var(--muted); font-size: var(--step--1); }

.landing { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.5rem 5rem; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4.5rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.05; letter-spacing: -0.025em; margin-bottom: 1.1rem; }
.hero p { color: var(--muted); font-size: var(--step-1); }
.hero-demo { display: flex; flex-direction: column; gap: .5rem; }
.demo-lane { display: grid; grid-template-columns: 6px 1fr auto; gap: .9rem; align-items: center; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-m); padding: .75rem 1rem .75rem 0; overflow: hidden; }
.demo-lane .lane-bar { margin: -.75rem 0; }
.demo-lane .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--step--1); }
.demo-clash { color: var(--coral); font-size: var(--step--1); padding-left: 1.2rem; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; margin-top: 5rem; }
.features h3 { font-size: var(--step-1); margin-bottom: .4rem; }
.features p { color: var(--muted); }

/* ---------- chat ---------- */
.chat-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.2rem; height: calc(100vh - 3.6rem); }
.chat-list { overflow-y: auto; }
.chat-list a { display: block; padding: .45rem .6rem; border-radius: var(--radius-s); color: var(--muted); font-size: var(--step--1); border-left: 3px solid var(--lane); margin-bottom: 2px; }
.chat-list a.btn { border-left: 1px solid var(--line); color: var(--text); margin-bottom: .8rem; }
.chat-list a.on, .chat-list a:not(.btn):hover { background: var(--surface); color: var(--text); text-decoration: none; }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-m); }
.chat-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.chat-top .scope { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.chat-top .scope .dot { margin: 0; }
.chat-top form { display: flex; gap: .4rem; align-items: center; }
.chat-top select { width: auto; padding: .35rem .5rem; font-size: var(--step--1); }
.messages { flex: 1; overflow-y: auto; padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.msg { max-width: 760px; }
.msg.user { align-self: flex-end; background: var(--raised); padding: .65rem .9rem; border-radius: var(--radius-m) var(--radius-m) 2px var(--radius-m); }
.msg.assistant { align-self: flex-start; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.msg .body code { font-family: var(--font-mono); font-size: .88em; background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.msg .acts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.act { font-size: .75rem; padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.act.write { color: var(--signal); border-color: rgb(130 168 255 / .45); }
.act.fail { color: var(--coral); border-color: rgb(240 122 120 / .45); }
.msg.pending .body { color: var(--faint); }
.composer { border-top: 1px solid var(--line-soft); padding: .8rem; display: flex; gap: .6rem; align-items: flex-end; }
.composer textarea { min-height: 2.8rem; max-height: 12rem; }
.suggest { display: flex; flex-wrap: wrap; gap: .4rem; }
.suggest button { font: inherit; font-size: var(--step--1); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .75rem; cursor: pointer; }
.suggest button:hover { color: var(--text); border-color: var(--muted); }
.chat-empty { margin: auto; text-align: center; max-width: 460px; color: var(--muted); }
.chat-empty .suggest { justify-content: center; margin-top: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
  .lane { grid-template-columns: 6px 1fr 1fr; }
  .lane-ctx { grid-column: 2 / -1; }
  .lane .actions { grid-column: 2 / -1; }
  .hero { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .45); }
  .btn.menu-toggle { display: inline-flex; margin-bottom: 1rem; }
  .main { padding: 1.1rem 1rem 3rem; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-list { display: none; }
  .chat-main { height: calc(100vh - 7rem); }
  .lane { grid-template-columns: 6px 1fr; }
  .lane > :not(.lane-bar) { grid-column: 2; }
  .list > li.task { flex-wrap: wrap; }
  .task .grow { flex: 1 1 calc(100% - 1rem); }
  .task .facts { flex-direction: row; gap: .7rem; min-width: 0; align-items: center; }
  .status-form { margin-left: auto; }
  .log > li { grid-template-columns: 6.8rem 4.4rem minmax(0, 1fr); }
  .log .line { flex-wrap: wrap; }
  .log .who { margin-left: 0; }
  .log form { position: static; opacity: 1; pointer-events: auto; grid-column: 1 / -1; justify-self: start; background: none; padding-left: 0; }
  .features { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .log form {
    position: static; opacity: 1; pointer-events: auto; background: none;
    grid-column: 1 / -1; justify-self: start; padding-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.cols > .panel + .panel { margin-top: 0; }
