
/* ============================================
   LOCUTUS STYLESHEET
   One stylesheet for the whole web app. Every colour is a token below, with a dark set for dark-mode browsers.
   Signed-in pages use the app shell (body.app-page); signed-out pages use body.auth.
   ============================================ */
:root {
  --bg: #f3f4fa;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --line: #e2e4ef;
  --line-strong: #cfd3e6;
  --fg: #2b2e3d;
  --muted: #6a6e86;
  --accent: #667eea;
  --accent-strong: #5568d3;
  --accent-2: #764ba2;
  --accent-tint: #eef0fd;
  --on-accent: #ffffff;
  --ok: #2c9466;
  --ok-tint: #e6f5ee;
  --warn: #b97b0b;
  --warn-tint: #fdf3df;
  --bad: #dc3545;
  --bad-tint: #fdecee;
  --idle: #7d8199;
  --idle-tint: #eef0f5;
  --av1: #667eea; --av2: #2c9466; --av3: #c0602a; --av4: #764ba2; --av5: #2b7fa8; --av6: #a8456b;
  --shadow: 0 8px 24px rgba(40, 44, 80, .12);
  --shadow-lg: 0 18px 40px rgba(30, 20, 70, .25);
  --grad-a: #667eea;
  --grad-b: #764ba2;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --indent: 20px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #14151e; --surface: #1c1e2a; --surface-2: #222434; --line: #2e3145; --line-strong: #3d4160;
  --fg: #e5e6f0; --muted: #9a9db5; --accent: #8c9cf6; --accent-strong: #a6b2f8; --accent-2: #a77fd0;
  --accent-tint: #262b4f; --on-accent: #12131c;
  --ok: #4fc58d; --ok-tint: #173326; --warn: #e2ab43; --warn-tint: #382a10; --bad: #f06b78; --bad-tint: #3a1a20;
  --idle: #9a9db5; --idle-tint: #2a2c3c;
  --av1: #7c8df0; --av2: #3fae7b; --av3: #d27a46; --av4: #9a6fc4; --av5: #4a9cc4; --av6: #c4668c;
  --shadow: 0 8px 24px rgba(0, 0, 0, .45); --shadow-lg: 0 18px 40px rgba(0, 0, 0, .5); --grad-a: #3b3f8f; --grad-b: #4a2d68; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #14151e; --surface: #1c1e2a; --surface-2: #222434; --line: #2e3145; --line-strong: #3d4160;
  --fg: #e5e6f0; --muted: #9a9db5; --accent: #8c9cf6; --accent-strong: #a6b2f8; --accent-2: #a77fd0;
  --accent-tint: #262b4f; --on-accent: #12131c;
  --ok: #4fc58d; --ok-tint: #173326; --warn: #e2ab43; --warn-tint: #382a10; --bad: #f06b78; --bad-tint: #3a1a20;
  --idle: #9a9db5; --idle-tint: #2a2c3c;
  --av1: #7c8df0; --av2: #3fae7b; --av3: #d27a46; --av4: #9a6fc4; --av5: #4a9cc4; --av6: #c4668c;
  --shadow: 0 8px 24px rgba(0, 0, 0, .45); --shadow-lg: 0 18px 40px rgba(0, 0, 0, .5); --grad-a: #3b3f8f; --grad-b: #4a2d68; color-scheme: dark;
}
* { box-sizing: border-box; }
html { height: 100%; }
body.app-page { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 6px; padding: 6px 9px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ============================================
   APP SHELL (signed in)
   ============================================ */
.app { height: 100%; display: grid; grid-template-rows: 52px 1fr; }
.top { display: flex; align-items: center; gap: 18px; padding-block: 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.tabs { display: flex; gap: 2px; }
.tab { border: 0; background: none; padding: 7px 13px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tab:hover { background: var(--surface-2); color: var(--fg); }
.tab[aria-selected="true"] { background: var(--accent-tint); color: var(--accent-strong); }
.top .spacer { flex: 1; }
.search { width: 280px; max-width: 30vw; }
.bell { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 5px 10px; cursor: pointer; display: flex; gap: 6px; align-items: center; color: var(--muted); }
.bell b { background: var(--bad); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; line-height: 17px; }
.who-me { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 2px 4px; border-radius: 6px; font-weight: 500; }
.who-me:hover { background: var(--surface-2); }
.me { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: var(--av4); }

.view { min-height: 0; }
.view[hidden] { display: none !important; }

/* Tasks workspace */
.ws { height: 100%; display: grid; grid-template-columns: 236px minmax(0, 1fr) 430px; }
.pane { min-height: 0; overflow: auto; }
.rail { background: var(--surface-2); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 18px; }
.rail h6 { margin: 0 8px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; }
.navitem { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.navitem:hover { background: var(--surface); }
.navitem[aria-current="true"] { background: var(--accent-tint); color: var(--accent-strong); font-weight: 600; }
.navitem .ct { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.navitem .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.person { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; border: 1.5px dashed transparent; }
.person:hover { background: var(--surface); }
.person { position: relative; }
.person.over { border-color: var(--accent); background: var(--accent-tint); }
.dz { display: none; position: absolute; inset: 2px 2px 2px 34px; gap: 3px; }
.rail.dnd .person.over .dz { display: flex; }
.dz span { flex: 1; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; border-radius: 5px; border: 1.5px dashed var(--accent); background: var(--surface); color: var(--accent-strong); }
.dz span.drop { background: var(--accent); color: var(--on-accent); border-style: solid; }
.seg { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.person[aria-current="true"] { background: var(--accent-tint); }
.person .load { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.rail .hint { font-size: 11.5px; color: var(--muted); margin: 6px 8px 0; }
.teamlabel { font-size: 11.5px; color: var(--muted); margin: 8px 8px 2px; }

.av { width: 22px; height: 22px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.av.lg { width: 44px; height: 44px; font-size: 16px; }
.av.c1 { background: var(--av1); } .av.c2 { background: var(--av2); } .av.c3 { background: var(--av3); }
.av.c4 { background: var(--av4); } .av.c5 { background: var(--av5); } .av.c6 { background: var(--av6); }
.av.sys { background: var(--idle); }

/* Tree */
.main { display: flex; flex-direction: column; background: var(--surface); overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; flex: none; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; min-width: 0; flex: 1; flex-wrap: wrap; }
.crumb { border: 1.5px dashed transparent; background: none; padding: 3px 6px; border-radius: 5px; cursor: pointer; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb:hover { background: var(--surface-2); color: var(--fg); }
.crumb.cur { color: var(--fg); font-weight: 600; }
.crumb.drop { border-color: var(--accent); background: var(--accent-tint); }
.sep { color: var(--line-strong); }
.btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; padding: 5px 11px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 3px 8px; font-size: 12.5px; }
a.btn { color: inherit; text-decoration: none; display: inline-block; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }

.thead, .row { display: grid; grid-template-columns: minmax(280px, 1fr) 150px 96px 130px 100px; align-items: center; }
.thead { padding: 6px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.tree { flex: 1; min-height: 0; overflow: auto; }
.rows { min-width: 780px; padding-bottom: 40px; }
.row { padding: 0 16px; min-height: 36px; border-bottom: 1px solid var(--line); cursor: default; position: relative; }
.row:hover { background: var(--surface-2); }
.row.sel { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.row.dim .nm { color: var(--muted); }
.row.drop-into { box-shadow: inset 0 0 0 2px var(--accent); }
.row.done .nm { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.row.remote .nm { font-style: italic; color: var(--muted); }
.cell { min-width: 0; padding: 6px 8px 6px 0; }
.namecell { display: flex; align-items: center; gap: 6px; }
.guides { flex: none; align-self: stretch; margin: -6px 0; width: calc(var(--d) * var(--indent)); background: repeating-linear-gradient(to right, transparent 0 9px, var(--line-strong) 9px 10px, transparent 10px var(--indent)); }
.caret { flex: none; width: 18px; height: 18px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); border-radius: 4px; display: grid; place-items: center; }
.caret:hover { background: var(--line); color: var(--fg); }
.caret svg { transition: transform .12s; }
.caret[aria-expanded="true"] svg { transform: rotate(90deg); }
.caret.leaf { visibility: hidden; }
.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-input { flex: 1; padding: 3px 7px; }
.unv { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.chip { font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 0 6px; flex: none; font-variant-numeric: tabular-nums; }
.lvl { font-size: 10.5px; color: var(--accent-strong); background: var(--accent-tint); border-radius: 4px; padding: 0 5px; flex: none; font-weight: 600; }
.lock { font-size: 11px; color: var(--muted); flex: none; }
.with { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.with .arrow { color: var(--line-strong); }
.due { font-size: 12.5px; white-space: nowrap; }
.due small { display: block; color: var(--muted); font-size: 11px; }
.due.late { color: var(--bad); }
.bar { position: relative; height: 7px; background: var(--line); border-radius: 4px; width: 84px; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.bar > s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg); opacity: .55; border-radius: 1px; }
.prog { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.r-on-track { color: var(--ok); background: var(--ok-tint); }
.r-at-risk { color: var(--warn); background: var(--warn-tint); }
.r-overdue { color: var(--bad); background: var(--bad-tint); }
.r-unbounded { color: var(--idle); background: var(--idle-tint); }
.r-complete { color: var(--ok); background: transparent; border: 1px solid var(--ok); }
.acts { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; padding: 3px 4px 3px 24px; background: linear-gradient(to right, transparent, var(--surface-2) 22px); opacity: 0; pointer-events: none; transition: opacity .1s; }
.row.sel .acts { background: linear-gradient(to right, transparent, var(--accent-tint) 22px); }
/* Show a row's actions on hover only where there is a real mouse.  On iPhone/iPad, a tap on something whose :hover
   reveals content is treated as a hover first, so the row needed a second tap to open.  Touch screens show the
   actions on the selected row instead. */
.row:focus-within .acts { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .row:hover .acts { opacity: 1; pointer-events: auto; } }
@media (hover: none) { .row.sel .acts { opacity: 1; pointer-events: auto; } }
.act { border: 0; background: none; padding: 4px 6px; border-radius: 5px; cursor: pointer; color: var(--muted); font-size: 12px; white-space: nowrap; }
.act:hover { background: var(--surface); color: var(--accent-strong); box-shadow: 0 0 0 1px var(--line-strong); }
.empty { padding: 40px 16px; color: var(--muted); text-align: center; }

/* Detail panel */
.detail { border-left: 1px solid var(--line); background: var(--surface); padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.dpath { display: flex; flex-wrap: wrap; gap: 2px 4px; font-size: 12px; color: var(--muted); }
.dpath button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); }
.dpath button:hover { color: var(--accent-strong); text-decoration: underline; }
.dtitle { margin: 2px 0 0; font-size: 20px; line-height: 1.3; font-weight: 650; text-wrap: balance; border-radius: 5px; padding: 2px 4px; margin-left: -4px; }
.dtitle[contenteditable="true"]:hover { background: var(--surface-2); }
.dtitle[contenteditable="true"]:focus { outline: 2px solid var(--accent); background: var(--surface); }
.banner { font-size: 13px; border-radius: 8px; padding: 9px 12px; background: var(--surface-2); border-left: 3px solid var(--accent); color: var(--fg); }
.banner.warn { border-left-color: var(--warn); }
.sect h5 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; display: flex; flex-direction: column; gap: 7px; }
.role .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.role .who { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.role .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stat { background: var(--surface); padding: 9px 11px; }
.stat .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 500; }
.pace { font-size: 13px; margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .plan { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.chart .actual { stroke: var(--accent); stroke-width: 2.25; fill: none; stroke-linejoin: round; }
.chart .area { fill: var(--accent); opacity: .1; }
.chart .proj { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 4; fill: none; opacity: .8; }
.chart .today { stroke: var(--fg); stroke-width: 1; opacity: .35; }
.chart .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 5px; }
.legend i.p { border-top: 1.5px dashed var(--muted); }
.legend i.j { border-top: 1.5px dotted var(--accent); }
.logform { border: 1px solid var(--line); border-radius: 8px; padding: 11px; display: grid; grid-template-columns: 90px 1fr; gap: 8px 10px; align-items: center; background: var(--surface-2); }
.logform label { font-size: 12.5px; color: var(--muted); }
.logform .slider { display: flex; align-items: center; gap: 10px; }
.logform input[type=range] { flex: 1; padding: 0; border: 0; background: none; accent-color: var(--accent); box-shadow: none; }
.logform textarea { grid-column: 1 / -1; resize: vertical; min-height: 54px; }
.logform .go { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.desc { font-size: 13.5px; color: var(--fg); white-space: pre-wrap; border-radius: 5px; padding: 4px; margin: -4px; }
.desc.can-edit { cursor: text; }
.desc.can-edit:hover, .desc[contenteditable="true"] { background: var(--surface-2); }
.desc a, .entry .note a { color: var(--accent-strong); text-decoration: underline; overflow-wrap: anywhere; }
.subs { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sub { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.sub:last-child { border-bottom: 0; }
.sub:hover { background: var(--surface-2); }
.sub .nm { flex: 1; }
.hist { display: flex; flex-direction: column; gap: 0; }
.entry { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.entry:last-child { border-bottom: 0; }
.entry .meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.entry .meta b { color: var(--fg); font-weight: 600; }
.entry .note { margin-top: 2px; }
.entry.declined .note { color: var(--bad); }

/* People page */
.ppl { height: 100%; display: grid; grid-template-columns: 250px minmax(0, 1fr) 380px; }
.teams { background: var(--surface-2); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.teamitem { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; cursor: pointer; border: 1.5px dashed transparent; }
.teamitem:hover { background: var(--surface); }
.teamitem[aria-current="true"] { background: var(--accent-tint); color: var(--accent-strong); font-weight: 600; }
.teamitem.drop { border-color: var(--accent); background: var(--accent-tint); }
.teamitem .ct { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.teamitem .root { font-size: 11px; color: var(--muted); font-weight: 400; }
.pmain { background: var(--surface); padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 18px; }
.phead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phead h2 { margin: 0; font-size: 20px; font-weight: 650; flex: 1; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; }
.card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 650; }
.invite { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.invite input[type=email] { flex: 1; min-width: 220px; }
.small { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.invrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.invrow:first-of-type { border-top: 0; }
.invrow .who { flex: 1; min-width: 160px; }
.invrow .who small { display: block; color: var(--muted); font-size: 12px; }
.callout { border: 1px solid var(--accent); background: var(--accent-tint); }
.mtable { width: 100%; border-collapse: collapse; }
.mtable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mtable td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mtable tr.m { cursor: pointer; }
.mtable tr.m:hover td { background: var(--surface-2); }
.mtable tr.m.sel td { background: var(--accent-tint); }
.mtable .nmcell { display: flex; align-items: center; gap: 9px; }
.mtable .nmcell small { display: block; color: var(--muted); font-size: 12px; }
.tablewrap { overflow-x: auto; }
.status { font-size: 11.5px; border-radius: 9px; padding: 1px 8px; font-weight: 600; }
.s-active { color: var(--ok); background: var(--ok-tint); }
.s-sent { color: var(--warn); background: var(--warn-tint); }
.s-system { color: var(--idle); background: var(--idle-tint); }
.pside { border-left: 1px solid var(--line); background: var(--surface); padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.phero { display: flex; align-items: center; gap: 12px; }
.phero h3 { margin: 0; font-size: 18px; }
.phero small { color: var(--muted); }
.confirm { border: 1px solid var(--bad); background: var(--bad-tint); border-radius: 8px; padding: 11px 13px; font-size: 13px; display: flex; flex-direction: column; gap: 9px; }
.confirm .btns { display: flex; gap: 8px; }
.inline-new { display: flex; gap: 6px; padding: 4px 4px; }
.inline-new input { flex: 1; min-width: 0; }

/* Simple pages */
.page { height: 100%; overflow: auto; padding-block: 24px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page .inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page h2 { margin: 0; font-size: 22px; }
.form { display: grid; grid-template-columns: 200px 1fr; gap: 12px 16px; align-items: center; }
.kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface-2); white-space: nowrap; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; align-items: baseline; }

/* Overlays */
.scrim { position: fixed; inset: 0; background: rgba(15, 16, 30, .4); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: 86vh; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal h3 { margin: 0; font-size: 17px; }
.modal .sub-h { font-size: 13px; color: var(--muted); margin: -6px 0 0; }
.picklist { border: 1px solid var(--line); border-radius: 8px; max-height: 280px; overflow: auto; }
.pick { display: flex; align-items: center; gap: 9px; padding: 8px 11px; cursor: pointer; border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--surface-2); }
.pick[aria-selected="true"] { background: var(--accent-tint); }
.pick small { color: var(--muted); margin-left: auto; font-size: 12px; }
.pickteam { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 7px 11px 3px; background: var(--surface-2); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; }
.ctx { position: fixed; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 5px; min-width: 210px; }
.ctx button { display: flex; width: 100%; border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 5px; cursor: pointer; justify-content: space-between; gap: 16px; }
.ctx button:hover { background: var(--accent-tint); }
.ctx button:disabled { color: var(--muted); cursor: default; background: none; }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--surface); padding: 9px 16px; border-radius: 8px; font-size: 13px; z-index: 40; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

@media (max-width: 1280px) { .ws { grid-template-columns: 210px minmax(0, 1fr) 380px; } .ppl { grid-template-columns: 220px minmax(0, 1fr) 330px; } }
@media (max-width: 960px) {
  .app { height: auto; min-height: 100%; }
  .ws, .ppl { grid-template-columns: minmax(0, 1fr); height: auto; }
  .pane { overflow: visible; }
  .detail, .pside { border-left: 0; border-top: 1px solid var(--line); }
  .top { flex-wrap: wrap; padding-block: 8px; height: auto; }
  .search { display: none; }
  .form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* ============================================
   SIGNED-OUT PAGES (body.auth)
   Purple gradient with a centred card: sign in, check your e-mail, link verified, welcome, signed out, errors.
   ============================================ */
body.auth { min-height: 100%; height: auto; background: linear-gradient(135deg, var(--grad-a), var(--grad-b)) fixed; background-color: var(--grad-a); font-size: 15px; line-height: 1.5; }
.auth .stage { min-height: 100vh; display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth .wrap { width: min(460px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth .brand { justify-content: center; color: #fff; font-size: 22px; gap: 10px; }
.auth .brand .mark { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); font-size: 16px; }
.auth .panel { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 30px 32px; display: flex; flex-direction: column; gap: 16px; }
.auth h1 { margin: 0; font-size: 22px; line-height: 1.25; text-wrap: balance; }
.auth p { margin: 0; }
.auth .lead { color: var(--muted); }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 5px; }
.auth input[type=email], .auth input[type=text] { width: 100%; padding: 10px 12px; border-width: 2px; border-color: var(--line); }
.auth input.code { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.auth .btn { padding: 11px 16px; font-weight: 600; text-align: center; text-decoration: none; display: inline-block; transition: transform .15s, background .15s; }
.auth .btn.primary:hover { transform: translateY(-2px); }
.auth .btn:disabled { opacity: .55; cursor: default; transform: none; }
.auth .link { background: none; border: 0; color: var(--accent-strong); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; font: inherit; }
.auth .fine { font-size: 12.5px; color: var(--muted); }
.auth .callout { border-left: 4px solid var(--accent); background: var(--accent-tint); border-radius: 6px; padding: 10px 13px; font-size: 13.5px; }
.auth .callout.bad { border-left-color: var(--bad); background: var(--bad-tint); }
.auth .icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-strong); }
.auth .icon.ok { background: var(--ok-tint); color: var(--ok); }
.auth .icon.bad { background: var(--bad-tint); color: var(--bad); }
.auth .addr { font-weight: 600; word-break: break-all; }
.auth .steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.auth .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.auth .waiting { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.auth .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.auth .divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.auth .divider::before, .auth .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth .progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.auth .progress i { display: block; height: 100%; background: var(--ok); width: 0; animation: fill 2.5s linear forwards; }
@keyframes fill { to { width: 100%; } }
.auth .foot { text-align: center; color: rgba(255, 255, 255, .8); font-size: 12.5px; }
.auth .foot a { color: #fff; }
.auth .field-err { color: var(--bad); font-size: 12.5px; margin-top: 5px; }
@media (max-width: 480px) { .auth .panel { padding: 24px 20px; } }
@media (prefers-reduced-motion: reduce) { .auth .pulse, .auth .progress i { animation: none; } .auth .progress i { width: 100%; } }
