/* tad's window. The palette, the type and the logo are the site's (internal/relayd/site/index.html):
   dark is the brand; light is paper with the yellow as a highlighter. */
@font-face { font-family: "Caveat"; font-weight: 400 700; font-display: block; src: url("fonts/Caveat.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 100 900; font-display: swap; src: url("fonts/Geist.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 100 900; font-display: swap; src: url("fonts/GeistMono.woff2") format("woff2"); }

:root {
  --bg: #0b0b0c; --bg-2: #0f0f11; --panel: #131316; --panel-2: #18181c;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.12); --line-3: rgba(255,255,255,.2);
  --fg: #ededef; --fg-hi: #fff; --muted: #a0a0ab; --dim: #6e6e78;
  --accent: #ffc53d; --marker: #ffc53d; --accent-soft: rgba(255,197,61,.14); --accent-ink: #1d1600;
  --green: #3dd68c; --blue: #70b8ff; --violet: #b4a4ff; --red: #ff6f6f; --orange: #ff9f5a;
  --hover: rgba(255,255,255,.05); --glass: rgba(255,255,255,.02); --sunk: rgba(0,0,0,.18); --nav-bg: rgba(11,11,12,.72);
  --app-1: #151518; --app-2: #111113; --dot: #2a2a2f; --chip: #3a3a44; --primary-sub: #55555e;
  --app-shadow: 0 40px 120px -40px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.4);
  --float-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
  --green-soft: rgba(61,214,140,.06); --green-line: rgba(61,214,140,.3);
  --red-soft: rgba(255,111,111,.07); --red-line: rgba(255,111,111,.32);
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #fbfaf7; --bg-2: #f4f3ef; --panel: #fff; --panel-2: #fff;
  --line: rgba(24,20,8,.09); --line-2: rgba(24,20,8,.15); --line-3: rgba(24,20,8,.28);
  --fg: #16161a; --fg-hi: #000; --muted: #55555f; --dim: #7b7b85;
  --accent: #a36700; --marker: #ffc53d; --accent-soft: rgba(255,197,61,.45);
  --green: #16925a; --blue: #1f6fb8; --violet: #6a55d0; --red: #d64545; --orange: #cc6a14;
  --hover: rgba(24,20,8,.04); --glass: rgba(255,255,255,.7); --sunk: rgba(24,20,8,.025); --nav-bg: rgba(251,250,247,.78);
  --app-1: #fff; --app-2: #fdfcfa; --dot: #e3e1db; --chip: #e7e5df; --primary-sub: #a0a0ab;
  --app-shadow: 0 40px 100px -40px rgba(60,48,16,.22), 0 0 0 1px rgba(24,20,8,.02);
  --float-shadow: 0 30px 70px -24px rgba(40,32,10,.35);
  --green-soft: rgba(22,146,90,.07); --green-line: rgba(22,146,90,.3);
  --red-soft: rgba(214,69,69,.06); --red-line: rgba(214,69,69,.3);
  color-scheme: light;
} }
:root[data-theme="light"] {
  --bg: #fbfaf7; --bg-2: #f4f3ef; --panel: #fff; --panel-2: #fff;
  --line: rgba(24,20,8,.09); --line-2: rgba(24,20,8,.15); --line-3: rgba(24,20,8,.28);
  --fg: #16161a; --fg-hi: #000; --muted: #55555f; --dim: #7b7b85;
  --accent: #a36700; --marker: #ffc53d; --accent-soft: rgba(255,197,61,.45);
  --green: #16925a; --blue: #1f6fb8; --violet: #6a55d0; --red: #d64545; --orange: #cc6a14;
  --hover: rgba(24,20,8,.04); --glass: rgba(255,255,255,.7); --sunk: rgba(24,20,8,.025); --nav-bg: rgba(251,250,247,.78);
  --app-1: #fff; --app-2: #fdfcfa; --dot: #e3e1db; --chip: #e7e5df; --primary-sub: #a0a0ab;
  --app-shadow: 0 40px 100px -40px rgba(60,48,16,.22), 0 0 0 1px rgba(24,20,8,.02);
  --float-shadow: 0 30px 70px -24px rgba(40,32,10,.35);
  --green-soft: rgba(22,146,90,.07); --green-line: rgba(22,146,90,.3);
  --red-soft: rgba(214,69,69,.06); --red-line: rgba(214,69,69,.3);
  color-scheme: light;
}
/* Terminals stay terminals in either theme. */
.term, .console {
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.12); --hover: rgba(255,255,255,.05);
  --fg: #ededef; --muted: #a0a0ab; --dim: #6e6e78; --accent: #ffc53d; --green: #3dd68c; --red: #ff6f6f; --dot: #2a2a2f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; display: flex; flex-direction: column; cursor: default; -webkit-user-select: none; user-select: none; }
.sel, pre, code, input, textarea, .issue h3, .issue .about, .events, .note-box { -webkit-user-select: text; user-select: text; }
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: var(--marker); color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: content-box; border: 3px solid transparent; }

/* the strip under the macOS traffic lights */
.titlebar { display: none; flex: none; height: 28px; align-items: center; justify-content: center; padding: 0 84px; background: var(--bg); font-size: 12px; color: var(--dim); }
:root[data-shell="mac"] .titlebar { display: flex; }
.crumbs { display: flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; }
.crumbs b { color: var(--muted); font-weight: 500; }

/* top bar */
.top { flex: none; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 18px 0 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
:root[data-shell="mac"] .top { height: 52px; padding-bottom: 6px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* logo: handwritten, lowercase, with a marker stroke under it */
.logo { position: relative; display: inline-block; font: 700 34px/1 var(--hand); letter-spacing: .01em; color: var(--fg); padding: 0 4px 4px 2px; cursor: pointer; }
.logo svg { position: absolute; left: -2px; right: -4px; bottom: -2px; width: calc(100% + 6px); height: 12px; overflow: visible; }
.logo path { stroke: var(--marker); stroke-width: 4; fill: none; stroke-linecap: round; }

.who-am-i { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--muted); background: var(--glass); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill b { font-weight: 500; color: var(--accent-ink); background: var(--marker); border-radius: 999px; padding: 1px 8px; font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 10px; font: 500 13px/1 var(--sans); border: 1px solid var(--line-2); color: var(--fg); background: transparent; cursor: pointer; transition: background .15s, border-color .15s, transform .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--line-3); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { background: var(--fg-hi); transform: translateY(-1px); }
.btn.sm { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.btn.danger:hover { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); background: var(--hover); border-color: transparent; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* is `tad start` running */
.engine { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 7px; font: 12px var(--mono); color: var(--green); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(61,214,140,.6); animation: pulse 1.8s infinite; }
.live.off { color: var(--dim); }
.live.off::before { background: var(--dim); animation: none; }
.live.bad { color: var(--orange); }
.live.bad::before { background: var(--orange); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(61,214,140,0); } 100% { box-shadow: 0 0 0 0 rgba(61,214,140,0); } }

/* Claude usage: a pill in the top bar and a panel under it */
.usage { position: relative; }
.usage .btn { white-space: nowrap; }
.usage .btn.dim { color: var(--dim); }
.usage .btn.warn { color: var(--orange); border-color: var(--orange); }
.usage .btn.bad { color: var(--red); border-color: var(--red-line); }
.meter { display: inline-block; flex: none; width: 40px; height: 5px; border-radius: 3px; background: var(--dim); overflow: hidden; position: relative; }
.meter { background: color-mix(in srgb, var(--dim) 35%, transparent); }
.meter i { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.meter.warn i { background: var(--orange); }
.meter.bad i { background: var(--red); }
.usage-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 300px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); box-shadow: 0 8px 28px rgba(0,0,0,.28); display: grid; gap: 12px; font-size: 12.5px; color: var(--muted); max-height: 70vh; overflow-y: auto; }
.usage-panel .meter { width: 100%; height: 6px; margin: 6px 0; display: block; }
.u-head { display: flex; justify-content: space-between; gap: 10px; }
.u-head b { font-weight: 500; color: var(--fg); }
.u-head .warn { color: var(--orange); }
.u-head .bad { color: var(--red); }
.u-foot { display: flex; justify-content: space-between; gap: 10px; color: var(--dim); font-size: 12px; }
.u-note { margin: 0; color: var(--dim); font-size: 12px; line-height: 1.4; }
.u-note.warn { color: var(--orange); }
.u-plan { margin: 0; color: var(--dim); font-size: 12px; line-height: 1.4; }
.u-activity { display: grid; gap: 6px; }
.u-activity h4 { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--fg); }
.u-activity h4 small, .u-period small { color: var(--dim); font-size: 11.5px; font-weight: 400; }
.u-period b { font-weight: 500; color: var(--fg); }
.u-period small { display: block; line-height: 1.4; }
@media (max-width: 760px) { .usage .lbl { display: none; } }
.account { position: relative; }
.avatar-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: var(--glass); cursor: pointer; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--accent); }
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; background: var(--marker); color: var(--accent-ink); font-size: calc(var(--s) * .4); font-weight: 600; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 300px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); box-shadow: 0 8px 28px rgba(0,0,0,.28); display: grid; font-size: 12.5px; color: var(--muted); overflow: hidden; }
.acct-head { display: grid; gap: 4px; justify-items: start; min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.acct-head b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--accent-ink); background: var(--marker); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.acct-head span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-width: 0; }
.acct-who { flex: 1; min-width: 0; display: grid; }
.acct-who .svc { font-size: 11.5px; color: var(--dim); }
.acct-who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.acct-status { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.acct-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.acct-status.ok { color: var(--green); } .acct-status.ok i { background: var(--green); }
.acct-status.warn { color: var(--orange); } .acct-status.warn i { background: var(--orange); }
.acct-out { width: 100%; padding: 11px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--red); font: 500 13px var(--sans); text-align: left; cursor: pointer; }
.acct-out:hover { background: var(--red-soft); }

/* theme: system · light · dark, and a handwritten note saying where it landed */
.awake .btn[aria-checked="true"].off { opacity: .6; }
.awake .btn.warn { color: var(--red); border-color: var(--red-line); background: transparent; }
.theme-wrap { position: relative; display: inline-flex; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--dim); font: 500 12px/1 var(--sans); cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--fg); }
.seg button[aria-checked="true"] { background: var(--hover); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-note { position: absolute; top: calc(100% + 6px); right: 4px; z-index: 30; font: 700 20px/1 var(--hand); color: var(--accent); white-space: nowrap; pointer-events: none; transform: rotate(-4deg) translateY(-4px); opacity: 0; transition: opacity .2s, transform .2s; }
.theme-note.on { opacity: 1; transform: rotate(-4deg); }

/* layout */
.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg-2); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 10px 10px; }
.side-foot { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); display: grid; gap: 8px; }
.side-foot .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-foot .mono { font-size: 11.5px; }
.work { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main { flex: 1; min-height: 0; overflow: auto; padding: 22px 24px 24px; display: flex; flex-direction: column; }

.kicker { font: 500 12px/1 var(--mono); color: var(--accent); letter-spacing: .02em; display: inline-flex; gap: 8px; align-items: center; }
.kicker::before { content: ""; width: 14px; height: 1px; background: currentColor; opacity: .6; }
.side .kicker { padding: 4px 10px 10px; }

/* sidebar: repos, and under each the issues it's building */
.repo { margin-bottom: 10px; }
.repo-head, .job { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; text-align: left; border-radius: 9px; cursor: pointer; }
.repo-head { padding: 7px 10px; font: 500 13px/1.2 var(--mono); color: var(--fg); }
.repo-head:hover, .job:hover { background: var(--hover); }
.repo-head[aria-current="true"], .job[aria-current="true"] { background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-2); }
.repo-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-head .name span { color: var(--dim); }
.repo-head svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--dim); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side .repo-row { display: flex; align-items: center; gap: 2px; }
.side .repo-row .repo-head { flex: 1; min-width: 0; }
.side .repo-fold { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--dim); cursor: pointer; }
.side .repo-fold:hover { background: var(--hover); color: var(--fg); }
.side .repo-fold svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.side .repo.folded .repo-fold svg { transform: rotate(-90deg); }
.side .repo-head .count { flex: none; font: 12px var(--mono); color: var(--dim); }
.repo-head .warn { color: var(--orange); font: 12px var(--mono); }
.job { padding: 6px 10px 6px 14px; font-size: 13px; color: var(--muted); }
.job .ref { font: 12.5px var(--mono); color: var(--fg); white-space: nowrap; }
.job .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--dim); text-align: right; }
.none { padding: 4px 10px 4px 34px; font-size: 12.5px; color: var(--dim); }
.add { margin-top: 6px; width: 100%; justify-content: flex-start; color: var(--muted); border-style: dashed; }

/* a job's status, as the site draws an issue's */
.st { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--dim); }
.st[data-s="queued"] { border-color: var(--muted); }
.st[data-s="running"] { border-color: var(--orange); background: conic-gradient(var(--orange) 50%, transparent 0); animation: turn 2.4s linear infinite; }
.st[data-s="waiting_input"] { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.st[data-s="waiting_deps"] { border-color: var(--blue); background: conic-gradient(var(--blue) 25%, transparent 0); }
.st[data-s="waiting_usage"] { border-color: var(--accent); background: conic-gradient(var(--accent) 25%, transparent 0); }
.st[data-s="in_pr"] { border-color: var(--violet); background: var(--violet); }
.st[data-s="done"] { border-color: var(--green); background: var(--green); }
.st[data-s="failed"], .st[data-s="crashed"] { border-color: var(--red); background: var(--red); }
.st[data-s="stopped"] { border-color: var(--dim); border-style: dashed; }
@keyframes turn { to { transform: rotate(360deg); } }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }

/* the product: an issue on the left, its agent session on the right */
.app { flex: 1; min-height: 360px; display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, var(--app-1), var(--app-2)); box-shadow: var(--app-shadow); overflow: hidden; }
.app-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.issue { padding: 24px 26px; border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.issue .id { font: 13px var(--mono); color: var(--dim); display: flex; align-items: center; gap: 10px; }
.issue .id a { color: var(--muted); border-bottom: 1px solid var(--line-2); cursor: pointer; }
.issue .id a:hover { color: var(--fg); }
.issue h3 { font-size: 22px; line-height: 1.2; margin: 8px 0 4px; }
.issue .about { color: var(--muted); margin: 0; font-size: 14px; }
.props { display: grid; grid-template-columns: 96px 1fr; gap: 9px 12px; margin: 18px 0; font-size: 13px; align-items: center; }
.props dt { color: var(--dim); }
.props dd { margin: 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.who .av { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--marker); color: var(--accent-ink); font: 700 14px/1 var(--hand); }
.tag { font: 12px/1 var(--mono); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.qa { color: var(--green); border-color: var(--green-line); }
.tag.ask { color: var(--accent); border-color: var(--accent); }

/* the four stages, and you */
.track { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-2); margin: 4px 0 18px; }
.track div { padding: 10px 10px 11px; border-right: 1px solid var(--line); font-size: 12.5px; color: var(--dim); min-width: 0; }
.track div:last-child { border-right: 0; }
.track .n { font: 11px var(--mono); display: block; margin-bottom: 3px; }
.track b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; }
.track .was { color: var(--muted); }
.track .was .n { color: var(--green); }
.track .now { color: var(--fg); background: linear-gradient(180deg, rgba(255,197,61,.09), transparent 80%); }
.track .now .n { color: var(--accent); }
.track .hand { font: 700 19px/0.8 var(--hand); color: var(--accent); }

.section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.section h4 { margin: 0 0 8px; font-size: 13px; color: var(--fg); letter-spacing: 0; }
.section ol { margin: 0; padding-left: 18px; }
.section li { margin: 3px 0; }
.section li::marker { color: var(--dim); font-family: var(--mono); font-size: 12px; }
.note-box { border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); padding: 10px 12px; font-size: 13px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-box.bad { border-color: var(--red-line); background: var(--red-soft); color: var(--fg); }
.ask-box { border: 1px solid var(--accent); border-radius: 12px; padding: 14px; background: linear-gradient(180deg, rgba(255,197,61,.07), transparent 70%); color: var(--fg); }
.ask-box .hand { font: 700 22px/1 var(--hand); color: var(--accent); display: inline-block; transform: rotate(-3deg); margin-bottom: 6px; }
.ask-box ol { margin: 4px 0 12px; }
textarea, input[type="text"], input[type="password"] { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); color: var(--fg); font: 13.5px/1.5 var(--sans); padding: 9px 11px; resize: vertical; }
textarea:focus, input[type="text"]:focus, input[type="password"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.mono { font-family: var(--mono); font-size: 13px; }
::placeholder { color: var(--dim); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.history { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 12px var(--mono); color: var(--dim); }
.history .ok { color: var(--green); }
.history .back { color: var(--orange); }

.graph-card { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 16px 18px 14px; }
.graph-card h4 { margin: 0; font-size: 13px; color: var(--fg); letter-spacing: 0; }
.graph-card .graph-head a { cursor: pointer; border-bottom: 1px solid var(--line-2); }
.graph-card .graph-head a:hover { color: var(--fg); }
/* build order: an issue's project as rows (or columns) of issues, each row
   waiting on rows before it, lines from each blocker to what it blocks */
.graph-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.graph-head h4 { margin: 0; }
.graph-head h4 span { color: var(--dim); font-weight: 500; }
.graph-head .seg button { height: 22px; padding: 0 8px; font-size: 13px; }
.graph { position: relative; display: flex; flex-direction: column; gap: 30px; padding: 4px 2px 6px; overflow: auto; }
.graph.lr { flex-direction: row; gap: 44px; align-items: flex-start; padding-bottom: 30px; }
.graph .edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.edges path { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.edges path.split { stroke: var(--line-3); stroke-dasharray: 4 3; opacity: .6; }
.edges .met { stroke: var(--green-line); }
.edges .open { stroke: var(--line-3); stroke-dasharray: 4 4; }
.layer { position: relative; display: flex; gap: 18px; align-items: flex-start; }
.graph.lr .layer { flex-direction: column; gap: 10px; }
.wave { flex: none; width: 20px; height: 20px; margin-top: 12px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: 11px var(--mono); color: var(--dim); background: var(--bg-2); }
.graph.lr .wave { margin: 0 0 0 8px; }
.nodes { display: flex; gap: 10px; }
.graph.lr .nodes { flex-direction: column; }
.gnode { position: relative; z-index: 1; flex: none; display: flex; flex-direction: column; gap: 2px; width: 152px; padding: 8px 10px 9px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); text-align: left; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.gnode:hover { border-color: var(--line-3); }
.gnode[aria-current="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.gref { font: 500 12px var(--mono); color: var(--fg); }
.gtitle { color: var(--fg); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gsay { font: 11.5px var(--mono); color: var(--dim); overflow-wrap: break-word; }
.gnode.done { border-color: var(--green-line); background: var(--green-soft); }
.gnode.done .gsay, .gnode.done .gref { color: var(--green); }
.gnode.ready { border-color: var(--accent); }
.gnode.ready .gsay { color: var(--accent); }
.gnode.blocked { border-style: dashed; }
.gnode.outside, .gnode.canceled { border-style: dashed; background: transparent; opacity: .75; }
.gnode.canceled .gtitle { text-decoration: line-through; }
.gnode.s-running, .gnode.started, .gnode.split { border-color: var(--orange); }
.gnode.s-running .gsay, .gnode.started .gsay, .gnode.split .gsay { color: var(--orange); }
.gnode.s-waiting_input { border-color: var(--accent); background: var(--accent-soft); }
.gnode.s-in_pr { border-color: var(--violet); }
.gnode.s-in_pr .gsay { color: var(--violet); }
.gnode.s-failed, .gnode.s-crashed, .gnode.cycle { border-color: var(--red-line); background: var(--red-soft); }
.gnode.s-failed .gsay, .gnode.s-crashed .gsay, .gnode.cycle .gsay { color: var(--red); }
.graph-note { margin: 10px 0 0; font-size: 12.5px; color: var(--dim); }
/* An issue's own page: what it waits on, it, and what waits on it. */
.graph.near { gap: 22px; padding-top: 2px; }
.graph.near .layer { flex-direction: column; gap: 6px; }
.graph.near .wave { width: auto; height: auto; margin: 0; border: 0; border-radius: 0; background: none; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; place-items: start; }
.graph.near .nodes { flex-wrap: wrap; }
.graph.near .gnode { width: 144px; }
.graph.near .gnode[aria-current="true"] { cursor: default; }
.graph-note .warn { color: var(--orange); }

/* agent session */
.feed { display: flex; flex-direction: column; background: var(--sunk); min-height: 0; }
.feed-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.feed-head b { color: var(--fg); font-weight: 500; }
.events { list-style: none; margin: 0; padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; flex: 1; overflow-y: auto; min-height: 0; }
.events li { display: flex; gap: 10px; align-items: baseline; line-height: 1.45; min-width: 0; }
.events li.new { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.events li > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.events .k { flex: none; width: 16px; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 12px; }
.events .thought { color: var(--dim); font-style: italic; }
.events .act b { font-weight: 500; color: var(--fg); margin-right: 6px; }
.events .act code { font-size: 12.5px; color: var(--muted); }
.events .ev-stage { margin-top: 6px; }
.events .ev-stage:first-child { margin-top: 0; }
.events .ev-stage b { color: var(--fg); font-weight: 600; }
.events .ev-stage small { color: var(--dim); font: 11.5px var(--mono); margin-left: 8px; }
.events .ev-stage .ok { color: var(--green); font-family: var(--mono); font-size: 12.5px; }
.events .ev-stage .summary { display: block; color: var(--muted); margin-top: 2px; }
.events .done { border: 1px solid var(--green-line); background: var(--green-soft); border-radius: 10px; padding: 10px 12px; color: var(--fg); }
.events .done .k { color: var(--green); }
.events .done code, .events .done a { color: var(--green); cursor: pointer; }
.events .bad { border: 1px solid var(--red-line); background: var(--red-soft); border-radius: 10px; padding: 10px 12px; color: var(--fg); }
.events .bad .k { color: var(--red); }
.quiet { margin: auto; text-align: center; color: var(--dim); font-size: 13.5px; max-width: 34ch; padding: 24px; }
.quiet .hand { display: block; font: 700 26px/1.1 var(--hand); color: var(--accent); transform: rotate(-3deg); margin-bottom: 10px; }

/* a repo's page */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head h2 { font-size: 26px; letter-spacing: -0.03em; }
.page-head h2 span { color: var(--dim); }
.page-head .path { margin-top: 4px; font: 12.5px var(--mono); color: var(--dim); overflow-wrap: anywhere; }
.page-head .actions { margin-top: 2px; flex-wrap: nowrap; }
.banner { border: 1px solid var(--red-line); background: var(--red-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 20px; display: flex; flex-direction: column; }
.card h3 { font-size: 16px; margin: 0 0 6px; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.card .grow { flex: 1; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.table { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 18px; background: var(--bg-2); }
.table button { display: grid; grid-template-columns: 16px 22px 100px 210px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; font-size: 13px; color: var(--muted); cursor: pointer; }
.table button:first-child { border-top: 0; }
.table button:hover { background: var(--hover); }
.table .ref { font: 13px var(--mono); color: var(--fg); }
.table .stage { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .notes { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.table .when { font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.table .row-n { font: 11px var(--mono); color: var(--dim); text-align: center; }

/* first run: the same steps the site lists */
.welcome { max-width: 760px; margin: 0 auto; padding: 16px 0 24px; width: 100%; }
.welcome h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.035em; margin-top: 16px; }
.welcome h1 .soft { color: var(--dim); }
.welcome .lead { color: var(--muted); font-size: 16px; max-width: 58ch; margin: 16px 0 34px; }
.mark { background: linear-gradient(transparent 58%, var(--accent-soft) 58%, var(--accent-soft) 92%, transparent 92%); padding: 0 .08em; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 26px 52px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: 500 13px var(--mono); color: var(--fg); background: var(--bg); }
.steps li.ok::before { content: "✓"; color: var(--green); border-color: var(--green-line); }
.steps li::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 16px; letter-spacing: -0.01em; margin: 3px 0 4px; }
.steps p { margin: 0 0 10px; color: var(--muted); font-size: 14px; max-width: 60ch; }
.steps code, .card code, .dialog code { font-size: 12.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* the terminal: tad start's log */
.term { flex: none; display: flex; flex-direction: column; margin: 0 24px 18px; border: 1px solid var(--line-2); border-radius: 12px; background: #0a0a0b; box-shadow: var(--float-shadow); font: 12px/1.65 var(--mono); overflow: hidden; color: var(--muted); }
.term .bar { flex: none; height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--dim); font: 11px var(--mono); cursor: pointer; width: 100%; text-align: left; }
.term .bar:hover { background: var(--hover); }
.term .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.term .bar span { margin-left: 8px; }
.term .bar .bar-hint { margin-left: auto; color: var(--dim); }
.term .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-left: 8px; transition: transform .2s; }
.term pre { margin: 0; padding: 10px 14px 12px; height: 124px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; }
.term.closed pre { display: none; }
.term.closed .bar { border-bottom: 0; }
.term.closed .chev { transform: rotate(180deg); }
.term .g, .console .g { color: var(--green); } .term .y, .console .y { color: var(--accent); } .term .d, .console .d { color: var(--dim); } .term .f, .console .f { color: var(--fg); } .term .r, .console .r { color: var(--red); }

/* dialogs */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 24px; animation: fade .15s ease both; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: 100%; max-width: 480px; max-height: 100%; overflow: auto; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); box-shadow: var(--float-shadow); padding: 24px; }
.dialog.wide { max-width: 680px; }
.dialog h3 { font-size: 19px; margin-bottom: 8px; }
.dialog p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.dialog .actions { justify-content: flex-end; margin-top: 20px; }
.dialog label { display: block; font-size: 12.5px; color: var(--dim); margin: 12px 0 6px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.choice button { text-align: left; border: 1px solid var(--line-2); border-radius: 12px; background: transparent; padding: 12px 14px; cursor: pointer; }
.choice button:hover { background: var(--hover); }
.choice button[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(180deg, rgba(255,197,61,.08), transparent 80%); }
.choice b { display: block; font-weight: 500; font-size: 14px; margin-bottom: 3px; }
.choice small { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: block; }
.console { border: 1px solid var(--line-2); border-radius: 12px; background: #0a0a0b; overflow: hidden; }
.console .bar { height: 32px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--dim); font: 11.5px var(--mono); }
.console .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.console .bar span { margin-left: 8px; }
.console pre { margin: 0; padding: 14px 16px 16px; font: 12.5px/1.7 var(--mono); color: var(--muted); min-height: 120px; max-height: 46vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* a command run for the person: what it says, and what it asks */
.transcript { border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); padding: 12px 16px 14px; min-height: 120px; max-height: 42vh; overflow: auto; font-size: 13.5px; color: var(--muted); }
.transcript h4 { font: 500 12px/1 var(--mono); color: var(--accent); letter-spacing: .02em; margin: 14px 0 8px; }
.transcript h4:first-child { margin-top: 2px; }
.t-line { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.t-line.dim { color: var(--dim); }
.t-line.good { color: var(--green); }
.t-line.bad { color: var(--red); }
.t-line.warn { color: var(--orange); }
.t-line a { color: var(--accent); cursor: pointer; border-bottom: 1px solid currentColor; }
.t-answer { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; margin: 6px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--glass); }
.t-answer span { color: var(--dim); min-width: 0; }
.t-answer b { font-weight: 500; color: var(--fg); text-align: right; white-space: pre-wrap; overflow-wrap: anywhere; }
.question { margin-top: 14px; border: 1px solid var(--accent); border-radius: 12px; padding: 14px; background: linear-gradient(180deg, rgba(255,197,61,.07), transparent 70%); }
.question .q-label { font-weight: 500; font-size: 14px; color: var(--fg); margin-bottom: 10px; }
.question .q-hint { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.question .q-hint b { color: var(--muted); font-weight: 500; }
.question .actions { margin-top: 12px; justify-content: flex-start; }
.q-options { display: grid; gap: 6px; }
.q-options label { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 13.5px; color: var(--fg); cursor: pointer; }
.q-options label:hover { background: var(--hover); }
.q-options label:has(input:checked) { border-color: var(--accent); }
.q-options input { margin: 3px 0 0; accent-color: var(--marker); }
.t-state { margin-right: auto; color: var(--dim); font-size: 12.5px; display: inline-flex; align-items: center; gap: 8px; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--accent); animation: turn .8s linear infinite; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { max-width: 420px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel-2); box-shadow: var(--float-shadow); padding: 10px 14px; font-size: 13px; color: var(--fg); animation: rise .25s ease both; }
.toast.bad { border-color: var(--red-line); }
.toast small { display: block; color: var(--muted); }

@media (max-width: 1080px) {
  .seg span, .awake span { display: none; }
  .app-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(260px, 1fr); overflow-y: auto; }
  .issue { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; min-height: auto; }
  .feed { min-height: 260px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 34vh; }
  .side-foot { display: none; }
  .who-am-i { display: none; }
  .account-menu { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
  .main { padding: 16px; }
  .term { margin: 0 16px 14px; }
  .page-head { flex-direction: column; }
  .table button { grid-template-columns: 16px 22px 96px minmax(0, 1fr) auto; }
  .table .stage { display: none; }
  .track { grid-template-columns: 1fr 1fr; }
  .choice { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .events li.new, .toast, .scrim { animation: none; }
  .live::before, .st[data-s="running"] { animation: none; }
  .theme-note, .side .repo-fold svg { transition: none; }
}

/* tad's own tracker: a repo's board, by state. */
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack input, .stack textarea { width: 100%; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 12px; margin-top: 18px; overflow-x: auto; padding-bottom: 4px; }
.bcol { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.bcol h4 { margin: 0 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.bcol h4 .count { font-weight: 400; }
.bcard { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bcard-main { all: unset; display: flex; flex-direction: column; gap: 4px; width: 100%; cursor: pointer; }
.bcard-main:disabled { cursor: default; }
.bcard .ref { font: 12px var(--mono, ui-monospace, monospace); color: var(--dim); display: flex; align-items: center; gap: 6px; }
.bcard .title { font-size: 13px; color: var(--fg); }
.bcard .labels { display: flex; flex-wrap: wrap; gap: 4px; }
.plan { white-space: pre-wrap; font-size: 13px; color: var(--muted); }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comments .who { font-size: 12px; color: var(--dim); }
.comments .who span { margin-left: 6px; }
.comments .body { white-space: pre-wrap; font-size: 13px; }
.diffstat { font: 12px/1.5 var(--mono, ui-monospace, monospace); color: var(--muted); white-space: pre-wrap; margin: 8px 0; }
.diff summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.diff pre { font: 12px/1.45 var(--mono, ui-monospace, monospace); max-height: 420px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
