:root {
  --bg: #f7f6fa; --surface: #ffffff; --sunken: #efedf4; --line: #dedbe7;
  --text: #25232d; --muted: #646170;
  --accent: #6d3fc4; --accent-ink: #ffffff; --accent-soft: #ece5fa; --chip-ink: #55309a;   /* all at least 4.5:1 */
  --ok: #2f7a4d; --ok-soft: #e0f0e5; --warn: #8f6210; --warn-soft: #f6ebd3; --bad: #b03a2b; --bad-soft: #f7ddd7;
  --radius: 8px; --shadow: none;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* light is the default; dark is a choice (the Light/Dark button in the top bar), not the browser's setting */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #18161d; --surface: #211f28; --sunken: #29262f; --line: #3a3644;
  --text: #ece9f2; --muted: #a29eb0;
  --accent: #a98bf0; --accent-ink: #16131c; --accent-soft: #342b4d; --chip-ink: #c9b5f8;
  --ok: #7bb78a; --ok-soft: #27382b; --warn: #d9ad5b; --warn-soft: #3b3220; --bad: #ec8573; --bad-soft: #42251f;
  --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
h1 + p, h1 + .muted { margin-top: .35rem; }
select.period { width: auto; min-width: 11rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: inherit; }
code, pre, .mono { font-family: var(--mono); font-size: .9em; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .pad { padding: 3rem 1rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--bg); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* top bar */
.top { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 650; text-decoration: none; letter-spacing: .01em; }
#nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
/* line icons beside the words in menus, tabs and buttons */
.ico { display: inline-flex; width: 1.05em; height: 1.05em; margin-right: .45em; vertical-align: -.17em; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#nav a, .tabs a { display: inline-flex; align-items: center; }
#nav a.only-phone { display: none; }
.popmenu button { display: flex; align-items: center; }
.popmenu button .ico { margin-right: .6rem; opacity: .75; }
button .ico, a.btn .ico { margin-right: .4rem; }
#nav a { text-decoration: none; padding: .35rem .75rem; border-radius: 8px; color: var(--muted); }
#nav a:hover { background: var(--sunken); color: var(--text); }
#nav a[aria-current="page"] { color: var(--text); background: var(--sunken); }
.who { color: var(--muted); font-size: .85rem; }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem; }
main:focus, main:focus-visible { outline: none; }          /* focus moves here on navigation; no box around the whole page */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

/* buttons and fields */
button, .btn { font: inherit; cursor: pointer; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: .45rem .9rem; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; box-shadow: var(--shadow); }
button:hover, .btn:hover { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover, button.primary:hover { filter: brightness(1.06); }
button.danger { color: var(--bad); }
button.go { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
button.halt { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
button.go:hover, button.halt:hover { filter: brightness(.96); }
button.quiet { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
button.quiet:hover { color: var(--text); background: var(--sunken); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .65rem; width: 100%; }
select:not([multiple]):not([size]) { -webkit-appearance: none; appearance: none; padding-right: 2rem; min-height: 2.25rem; line-height: 1.3; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23858195' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 12px 8px; }
select:not([multiple]):not([size]):hover { border-color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--accent); }
.field { margin-bottom: .9rem; }
.nowrap { white-space: nowrap; }
.row.nowrap { flex-wrap: nowrap; gap: .3rem; }
table.people td.acts { text-align: right; width: 1%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.form-grid .field { margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.form-grid .field.wide { grid-column: 1 / -1; }
.form-grid input { width: 100%; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.card h3 { margin: .4rem 0 0; font-size: 1rem; }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }

/* cards, pills, tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
a.computer { text-decoration: none; display: block; transition: border-color .15s; }
a.computer:hover { border-color: var(--accent); }
.computer .name { font-weight: 600; font-size: 1.05rem; word-break: break-all; }
.computer .meta { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.card.computer { padding: 1.1rem 1.2rem; }
.computer .lastchat { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; font-size: .9rem; color: var(--text); text-decoration: none; overflow: hidden; }
.computer .lastchat:hover { text-decoration: underline; }
.computer .lastchat .chip { flex: none; }
.chip.attn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.computer > * + * { margin-top: .7rem; }
.computer > .meta { margin-top: .2rem; }
.computer > .meta + .meta { margin-top: .05rem; }
.computer .row:empty { display: none; }
.only-phone { display: none; }
#logout { white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .1rem .55rem; border-radius: 99px; background: var(--sunken); color: var(--muted); }
.pill::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pill.running { background: var(--ok-soft); color: var(--ok); }
.pill.starting { background: var(--warn-soft); color: var(--warn); }
.pill.error { background: var(--bad-soft); color: var(--bad); }
.chip { font-size: .78rem; padding: .05rem .5rem; border-radius: 6px; background: var(--accent-soft); color: var(--chip-ink); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.bar { height: 8px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
kbd { font-family: var(--mono); background: var(--sunken); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3rem; font-size: .85em; }
.codeblock { position: relative; background: var(--sunken); border: 1px solid var(--line); border-radius: 6px; padding: .7rem .9rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.notice { border-radius: 6px; padding: .6rem .85rem; background: var(--warn-soft); color: var(--warn); font-size: .9rem; }
.notice.info { background: var(--accent-soft); color: var(--text); }

/* tabs (underline, like the reference) */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.1rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs a { padding: .65rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .98rem; }
.tabs.wrap { flex-wrap: wrap; overflow: visible; gap: .1rem .25rem; }
.tabs.wrap a { margin-bottom: 0; padding: .5rem .8rem; border-bottom: 0; border-radius: 8px; }
.tabs.wrap a[aria-current="page"] { background: var(--sunken); color: var(--text); font-weight: 600; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

/* the cat: one pose for each state */
.cat { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.scene { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.5rem 1rem 1rem; }
.scene .cat { width: min(300px, 70%); }
.scene .status { display: flex; justify-content: center; gap: 1.2rem; width: min(360px, 90%); font-size: 1.05rem; }
.scene .status .timer { color: var(--muted); font-variant-numeric: tabular-nums; }
.cat.small { width: min(160px, 50%); margin-bottom: .8rem; }
.typing { align-items: center; }
.typing .typing-cat { width: 34px; height: auto; margin: 0 .3rem 0 0; }
:root[data-theme="dark"] .cat { background: radial-gradient(closest-side, var(--accent-soft) 70%, transparent 71%); background-size: 88% 88%; background-position: center; background-repeat: no-repeat; }

/* computer detail */
.shot { width: 100%; border-radius: 6px; border: 1px solid var(--line); background: var(--sunken); display: block; aspect-ratio: 16 / 10; object-fit: contain; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.termbox { background: #1c1a22; border-radius: 10px; padding: .7rem .5rem .9rem .8rem; border: 1px solid #2e2b36; }
main.termwide { max-width: 1600px; }
.termwrap { display: flex; flex-direction: column; gap: .5rem; }
.termbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.termbar-l { gap: .7rem; min-width: 0; flex-wrap: wrap; }
.termbar-r { gap: .15rem; margin-left: auto; }
.termbtn { min-width: 2.2rem; padding: .25rem .5rem; font-weight: 600; }
.termsize { font: .8rem var(--mono); color: var(--muted); min-width: 1.6rem; text-align: center; }
.termbox .xterm-viewport { scrollbar-width: thin; scrollbar-color: #4a4656 #1c1a22; }
.termbox .xterm-viewport::-webkit-scrollbar { width: 10px; }
.termbox .xterm-viewport::-webkit-scrollbar-track { background: #1c1a22; }
.termbox .xterm-viewport::-webkit-scrollbar-thumb { background: #4a4656; border-radius: 6px; border: 2px solid #1c1a22; }
.termbox:focus-within { border-color: #6d5aa8; }
.termwrap.full { background: #1c1a22; padding: .8rem; height: 100vh; box-sizing: border-box; }
.termwrap.full .termbar { color: #e8e6ee; }
.termwrap.full .termbar .muted, .termwrap.full .termsize { color: #a7a3b5; }
.termwrap.full .termbtn { color: #e8e6ee; }
.termwrap.full .termbox { flex: 1; height: auto !important; min-height: 0; border-color: transparent; }
.termbox .xterm { height: 100%; }
iframe.desk { width: 100%; height: min(72vh, 620px); border: 1px solid var(--line); border-radius: 6px; background: #000; }
.spark { width: 100%; height: 90px; display: block; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path.area { fill: var(--accent-soft); stroke: none; }
.spark line { stroke: var(--line); stroke-width: 1; }
.stat { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.logbox { background: #1c1a22; color: #e8e6ee; border-radius: 6px; padding: .8rem 1rem; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: var(--mono); font-size: .82rem; }

/* dialogs and toasts */
dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); padding: 1.3rem 1.4rem; width: min(520px, 94vw); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(24, 18, 40, .5); }
dialog h2 { margin-bottom: .75rem; }
dialog .actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; }
dialog { max-height: calc(100vh - 2rem); overflow-y: auto; }
dialog .actions { position: sticky; bottom: -1.3rem; background: var(--surface); padding: .7rem 0 1.3rem; margin-bottom: -1.3rem; border-top: 1px solid var(--line); }
.sizes { display: grid; gap: .5rem; }
.sizes label { display: flex; gap: .7rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; color: var(--text); margin: 0; font-size: .95rem; }
.sizes label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 1100; max-width: min(420px, 92vw); }
.toast { background: var(--text); color: var(--bg); padding: .65rem .9rem; border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--bad); color: #fff; }

/* agent chat */
.msg.user .step { font-size: .88rem; color: var(--muted); padding-left: .25rem; }
textarea { resize: vertical; }
.ctl { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; color: var(--muted); margin: 0; }
.ctl select { width: auto; font-size: .88rem; padding: .3rem .55rem; color: var(--text); }
fieldset.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem 1.4rem; }
fieldset.kinds legend { grid-column: 1 / -1; }
@media (max-width: 700px) { fieldset.kinds { grid-template-columns: 1fr; } }
.tiles.tiles3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .tiles.tiles3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.1rem 2rem; padding: .9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tile { display: flex; flex-direction: column; min-width: 0; }
.tile .n { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .l { order: -1; font-size: .84rem; color: var(--muted); margin: 0 0 .15rem; }
.tile .sub { margin-top: .15rem; }
span.bad { color: var(--bad); }
table.people td, table.people th { padding-right: 1rem; vertical-align: top; }
.fold > summary { cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { display: inline; }
.fold[open] > summary { margin-bottom: .6rem; }
.section-h { margin: 1.2rem 0 -.2rem; font-size: .95rem; font-weight: 600; color: var(--muted); }
.stack > .section-h:first-child { margin-top: 0; }
table.plain td, table.plain th { padding-right: 1rem; vertical-align: top; }
.sched .prompt { margin: 0; white-space: pre-wrap; word-break: break-word; }
.tagrow { gap: .3rem; margin-top: .3rem; }
.wb-home { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem; overflow-y: auto; }
.wb-home .empty { text-align: center; }
.checklist { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 1rem 1.4rem; align-items: center; }
.checklist h2 { margin: 0; }
.checklist .cl-count { margin: .15rem 0 0; }
.checklist .bar { height: 8px; border-radius: 999px; }
.checklist .bar > span { border-radius: 999px; }
.checklist .steps { list-style: none; margin: .55rem 0 0; padding: 0; display: grid; gap: .25rem; }
.checklist .step { display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.checklist a.step:hover { background: var(--sunken); }
.checklist .next .step { font-weight: 600; }
.checklist .step .chip { margin-left: .2rem; }
.checklist .step .go { margin-left: auto; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.checklist .tick { width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; color: var(--accent-ink); flex: none; }
.checklist .done .tick { background: var(--accent); border-color: var(--accent); }
.checklist .done .step { color: var(--muted); }
.checklist .cl-cat { width: 150px; justify-self: center; }
@media (max-width: 700px) { .checklist { grid-template-columns: 1fr; } .checklist .cl-cat { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.typing { display: flex; gap: 5px; padding: .1rem .9rem; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; opacity: .6; } }

[hidden] { display: none !important; }

/* workbench */
main.wide { max-width: none; padding: 1rem; }
.wb { display: grid; grid-template-columns: 250px minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; height: calc(100vh - 92px); min-height: 480px; }
.wb.nopanel { grid-template-columns: 250px minmax(0, 1fr); }
.wb.nopanel .wb-panel { display: none; }
.wb-side, .wb-chat, .wb-panel { min-height: 0; display: flex; flex-direction: column; gap: .6rem; }
.wb-side { overflow-y: auto; }
.wb-chat, .wb-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.wb-head { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: .5rem; }
.wb-head > .row { justify-content: flex-start; flex-wrap: wrap; }
.wb-head.home { flex-direction: row; align-items: center; justify-content: space-between; }
.wb-home { padding-top: .2rem; }
.wb-home > .start { padding-top: .4rem; }
.wb-h { font-size: 1.05rem; word-break: break-word; }
.wb-chatbox { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.wb-chatbox > .stack.chatcol { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wb-chatbox .chatlist { flex: 1; max-height: none; min-height: 120px; }
.wb-panelbody { flex: 1; min-height: 0; overflow: auto; }
.wb-tabs { margin: 0; }
.wb-panel .termbox { height: min(70vh, 640px); }
.wb-panel iframe.desk { height: min(62vh, 560px); }
.wb-group { font-size: .85rem; color: var(--muted); margin: .6rem 0 .2rem; font-weight: 600; }
.wb-list { display: flex; flex-direction: column; gap: .15rem; }
/* on a computer only the chat list scrolls: New chat, search and sort stay at the top, clear of the scrollbar */
@media (min-width: 1001px) {
  .wb:not(.phone) .wb-side { overflow: hidden; }
  .wb:not(.phone) .wb-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin;
    padding-right: .4rem; margin-right: -.2rem; overscroll-behavior: contain; border-top: 1px solid var(--line); padding-top: .15rem; }
  .wb:not(.phone) .wb-list .wb-group:first-child { margin-top: .2rem; }
  /* 2. group headings stay in view while their chats scroll under them */
  .wb:not(.phone) .wb-list .wb-group { position: sticky; top: 0; z-index: 1; background: var(--bg); margin: 0; padding: .55rem .2rem .25rem; }
  /* 6. folded: a thin strip with Show, New chat (icon only) and how many chats need you */
  .wb.sidefolded { grid-template-columns: 3rem minmax(0, 1.15fr) minmax(0, 1fr); }
  .wb.sidefolded.nopanel { grid-template-columns: 3rem minmax(0, 1fr); }
  .wb.sidefolded .wb-side > :not(.wb-newrow):not(.wb-foldlist) { display: none; }
  .wb.sidefolded .wb-foldlist { display: flex; }
  .wb.sidefolded .wb-newrow { flex-direction: column; align-items: center; }
  .wb.sidefolded .wb-new { flex: none; width: 2.5rem; height: 2.5rem; padding: 0; justify-content: center; }
  .wb.sidefolded .wb-new .lbl, .wb.sidefolded .wb-fold { display: none; }
  .wb:not(.sidefolded) .wb-foldneeds { display: none; }
  .wb .wb-fold, .wb .wb-unfold { display: inline-flex; }
  .wb.sidefolded .wb-fold, .wb:not(.sidefolded) .wb-unfold { display: none; }
}
.wb-newrow { display: flex; gap: .35rem; align-items: stretch; }
.wb-newrow .wb-new { flex: 1; }
.wb-fold, .wb-unfold { display: none; font-size: 1.15rem; line-height: 1; padding: .3rem .55rem; align-items: center; justify-content: center; }
.wb-foldneeds { min-width: 1.5rem; padding: .1rem .4rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); font-size: .8rem; font-weight: 700; text-align: center; }
.wb-foldneeds[hidden] { display: none; }
.wb-foldlist { display: none; flex-direction: column; align-items: center; gap: .45rem; padding-top: .4rem; margin-top: .2rem; border-top: 1px solid var(--line); overflow-y: auto; }
.wb-fchip { position: relative; display: grid; place-items: center; flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--sunken); color: var(--text);
  font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-decoration: none; border: 2px solid transparent; }
.wb-fchip:hover { border-color: var(--line); }
.wb-fchip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.wb-fchip .fdot { position: absolute; right: -1px; bottom: -1px; width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--bg); background: var(--muted); }
.wb-fchip .fdot.on { background: var(--ok); }
.wb-fchip .fdot.working { background: var(--accent); animation: fpulse 1.4s ease-in-out infinite; }
.wb-fchip .fdot.needs { background: var(--warn); }
@keyframes fpulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .wb-fchip .fdot.working { animation: none; } }
/* 1. a chat that needs you: a tinted row and a bold line, so it stands out in the list */
.wb-row.needs .wb-item { background: var(--warn-soft); }
/* 5. pinned chats carry a small pin; 8. a line of the matching message, in italics */
.wb-pin { display: inline-flex; margin-right: .3rem; color: var(--muted); vertical-align: -.12em; }
.wb-pin svg { width: .85em; height: .85em; }
.wb-item .hit { font-style: italic; overflow-wrap: anywhere; }
.wb-item { display: flex; flex-direction: column; text-decoration: none; padding: .45rem .6rem; border-radius: 6px; }
.wb-item:hover { background: var(--sunken); }
.wb-item.on { background: var(--sunken); font-weight: 600; }
.sdot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); opacity: .55; margin-right: .5rem; vertical-align: .08em; }
.sdot.running { background: var(--ok); opacity: 1; }
.sdot.starting, .sdot.creating { background: var(--warn); opacity: 1; }
.sdot.error { background: var(--bad); opacity: 1; }
.wb-wake { position: absolute; right: .3rem; bottom: .15rem; padding: .05rem .5rem; font-size: .8rem; opacity: 0; }
.wb-row:hover .wb-wake, .wb-row:focus-within .wb-wake { opacity: 1; }
@media (hover: none) { .wb-wake { opacity: 1; } }
.wb-row { position: relative; }
.wb-row .wb-item { padding-right: 2.1rem; }
.wb-row.on .wb-item { background: var(--sunken); font-weight: 600; }
.wb-more { position: absolute; right: .2rem; top: .3rem; padding: .05rem .5rem; opacity: 0; font-size: 1.1rem; line-height: 1.4; }
.wb-row:hover .wb-more, .wb-row:focus-within .wb-more, .wb-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .wb-more { opacity: 1; } }
.wb-filter { gap: .2rem; margin: -.2rem 0 .1rem; }
.wb-whose { flex-wrap: nowrap; gap: 0; }
.wb-whose button.filt { padding-inline: .5rem; white-space: nowrap; }
.popmenu { position: fixed; z-index: 80; min-width: 13rem; padding: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(20, 18, 30, .16); }
.popmenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .5rem .7rem; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; }
.popmenu button:hover, .popmenu button:focus-visible { background: var(--sunken); outline: none; }
.popmenu button.danger { color: var(--bad); }
button.go { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
button.halt { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
button.go:hover, button.halt:hover { filter: brightness(.96); }
.popmenu hr { border: 0; border-top: 1px solid var(--line); margin: .25rem 0; }
.dot { display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); margin-left: .4rem; vertical-align: middle; }
.chatdlg { max-height: 66vh; overflow-y: auto; min-width: 0; }
.chatdlg .facts { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .35rem .8rem; margin: .3rem 0 0; }
.chatdlg .facts dt { color: var(--muted); }
.chatdlg .facts dd { margin: 0; overflow-wrap: anywhere; }
.chatdlg .table-wrap { overflow-x: auto; }
dialog:has(.chatdlg) { width: min(600px, 94vw); }
.chatdlg textarea { width: 100%; resize: vertical; }
.chatdlg h3 { margin: .4rem 0 0; font-size: 1rem; }

.wb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.need { color: var(--accent); font-weight: 600; }
.termtab .x { padding: .2rem .45rem; }
input[type=search] { width: 100%; }
@media (max-width: 1000px) {
  .wb, .wb.nopanel { grid-template-columns: minmax(0, 1fr); height: auto; }
  .wb-chatbox { max-height: 70vh; }
}

.row select, .row input[type=search] { width: auto; max-width: 100%; }
.themebtn { padding: .25rem .6rem; font-size: .85rem; }
.notes { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.note-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: .8rem; align-items: start; padding: .85rem .3rem; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.note-row:hover { background: var(--sunken); }
.note-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: .5rem; }
.note-row.read .dot { background: transparent; }
.note-row .ttl { font-weight: 600; }
.note-row.read .ttl { font-weight: 400; }
.note-row .when { white-space: nowrap; padding-top: .15rem; }
#bell.has { color: var(--accent); font-weight: 600; }
.row td, td.row { display: table-cell; }
.limits-strip { padding: 0 .1rem; }
.limits-strip .bar { height: 6px; }
.limits-strip .limits { grid-template-columns: repeat(auto-fit, minmax(200px, 340px)); }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
button.filt[aria-pressed="true"] { background: transparent; color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 6px; }
button.filt .count { margin-left: .5rem; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
input[type=time] { width: auto; }
.agentrow { border-top: 1px solid var(--line); padding-top: .6rem; }
.agentrow:first-child { border-top: none; padding-top: 0; }
.agentrow details { margin-top: .3rem; }
.brand .logo { height: 28px; width: auto; display: block; }

/* phones: compact top bar with a menu button that opens the navigation, tighter padding, no sideways page scroll */
html, body { overflow-x: hidden; }
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }      /* clip, not hidden: hidden makes the body a scroller and breaks sticky tabs */
#menu { display: none; }
@media (max-width: 700px) {
  body { font-size: 16px; }
  .top { display: grid; grid-template-columns: auto 1fr auto auto auto; grid-template-areas: "brand . bell theme menu" "nav nav nav nav nav" "who who who who who"; gap: .35rem .4rem; padding: .6rem .9rem; align-items: center; position: relative; }
  #logout { display: none; }
  .only-phone { display: block; }
  #nav a.only-phone { display: flex; align-items: center; }
  #nav a.signout { border-top: 1px solid var(--line); margin-top: .2rem; padding-top: .9rem; border-radius: 0; }
  .brand { grid-area: brand; } #bell { grid-area: bell; } #theme { grid-area: theme; } #menu { grid-area: menu; display: inline-flex; padding: .3rem .5rem; } .who { grid-area: who; font-size: .8rem; }
  /* one balanced row: the logo at the left; credit, notices, theme and menu as same-height buttons at the right; the name is in the menu */
  .top { grid-template-columns: auto 1fr auto auto auto auto; grid-template-areas: "brand . credit bell theme menu" "nav nav nav nav nav nav"; gap: .3rem; padding: .5rem .75rem; }
  .top .who { display: none; }
  #credit { grid-area: credit; }
  #bell, #theme, #menu, #credit { height: 40px; min-height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding: 0 .55rem; margin: 0; border-radius: 10px; }
  #bell, #theme, #menu { width: 40px; padding: 0; border: 1px solid var(--line); background: var(--surface); }
  #credit { border: 1px solid var(--line); background: var(--surface); font-size: .85rem; font-weight: 600; }
  #bell { position: relative; }
  #bell .belltxt { display: none; }
  #bell .bellcount { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
    font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid var(--bg); }
  .nav-who { padding: .5rem .9rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; color: var(--muted); font-size: .88rem; }
  #nav { grid-area: nav; display: none; flex-direction: column; gap: .15rem; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
  #nav.open { display: flex; position: absolute; top: 100%; left: .9rem; right: .9rem; z-index: 30; }
  #nav a { padding: .8rem .9rem; font-size: 1.05rem; }
  main { padding: 1rem .9rem 2rem; }
  h1 { font-size: 1.4rem; }
  .page-head { margin-bottom: .9rem; }
  button, .btn { min-height: 40px; }
  input, select, textarea { font-size: 16px; }            /* stops iOS zooming in on a field */
  .grid, .limits { grid-template-columns: 1fr; }
  .card { padding: .85rem .9rem; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form .field { width: 100%; }
  .row select, .row input[type=search], input[type=search] { width: 100%; }
  dialog { padding: 1rem; width: 96vw; max-height: 92vh; overflow-y: auto; }
  dialog .actions { flex-wrap: wrap; }
  table { font-size: .88rem; }
  pre, .mono { overflow-x: auto; max-width: 100%; }
  .wb-chatbox { max-height: 60vh; }
  .tabs a { padding: .6rem .7rem; }
  iframe.desk, .wb-panel iframe.desk { height: 56vh; }
  /* the file list: the name on its own line, then size and date, then the buttons */
  table.files thead { display: none; }
  table.files, table.files tbody { display: block; }
  table.files tr { display: flex; flex-wrap: wrap; gap: .25rem .9rem; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
  table.files tbody tr:last-child { border-bottom: 0; }
  table.files td { display: block; border: 0; padding: 0; overflow-wrap: anywhere; }
  table.files td:first-child, table.files td:last-child { flex: 1 1 100%; }
  table.files td:empty { display: none; }
  table.files td.row { margin-left: -.5rem; }          /* the quiet buttons' own padding: their words line up with the name */
  /* the people table becomes one block per person */
  table.people thead { display: none; }
  table.people, table.people tbody { display: block; }
  table.people tr { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
  table.people td { display: block; border: 0; padding: 0; }
  table.people td:first-child, table.people td:last-child { grid-column: 1 / -1; }
  table.people td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--muted); }
  table.sitepages thead { display: none; }
  table.sitepages, table.sitepages tbody { display: block; }
  table.sitepages tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
  table.sitepages td { display: block; border: 0; padding: 0; }
  table.sitepages td:first-child, table.sitepages td:last-child { grid-column: 1 / -1; }
  table.sitepages td.acts { text-align: left; }
  table.sitepages td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--muted); }
}

.linkcell { display: flex; align-items: center; gap: .3rem .6rem; min-width: 14rem; }
.linkcell a { min-width: 0; overflow-wrap: anywhere; }
.linkcell button, .linkcell span { flex: none; }

/* the daily streak on the Account page: one pip per step from the first day's credit to the most a day */
.streak-pips { display: flex; gap: .35rem; flex-wrap: wrap; }
.streak-pips span { min-width: 2.1rem; padding: .2rem .35rem; border-radius: 999px; text-align: center; font-size: .8rem; background: var(--line); color: var(--muted); }
.streak-pips span.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.invite input { flex: 1 1 auto; min-width: 0; font-family: var(--mono, monospace); font-size: .9rem; }
.meter { display: flex; height: .7rem; border-radius: 999px; overflow: hidden; background: var(--line); }
.meter .seg { display: block; height: 100%; }
.meter .computers { background: var(--accent); }
.meter .assets { background: #3f8f7b; }
.meter .recordings { background: #d29a2d; }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; color: var(--accent); }
.chart .l { color: var(--ink, inherit); font-size: .92rem; }
.chart svg { width: 100%; height: 70px; display: block; }
.tile.bad .n { color: var(--bad, #b3261e); }
.tile.attn .n { color: var(--warn, #9a6700); }
.card.attention { border-color: var(--warn); }
.row.wrap { flex-wrap: wrap; gap: .4rem; }

/* the agent's replies: formatted, roomy and plain, so a first-time user sees a message and not symbols */
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: .5rem 0; }
.md ul, .md ol { margin: .5rem 0; padding-left: 1.4rem; }
.md li { margin: .35rem 0; } .md li > ul, .md li > ol { margin: .25rem 0; }
.md strong { font-weight: 650; }
.md code { font-family: var(--mono, ui-monospace, monospace); font-size: .88em; background: var(--sunken); padding: .08em .38em; border-radius: 6px; word-break: break-all; }
.md code.path { cursor: copy; }
.md code.path:hover { text-decoration: underline; }
.md .mdh { font-weight: 650; margin: .9rem 0 .35rem; } .md .mdh1 { font-size: 1.12rem; } .md .mdh2 { font-size: 1.05rem; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: .8rem 0; }
.md .mdquote { background: var(--sunken); border-radius: 6px; padding: .1rem .8rem; margin: .5rem 0; color: var(--muted); }
.md .mdcode { position: relative; margin: .6rem 0; }
.md .mdcode pre { margin: 0; padding: .8rem 1rem; background: var(--sunken); border-radius: 6px; overflow-x: auto; font-size: .88rem; line-height: 1.5; }
.md .mdcode code { background: none; padding: 0; word-break: normal; }
.md .mdcode .copy { position: absolute; top: .35rem; right: .45rem; font-size: .8rem; }
.md table { font-size: .92rem; }

/* the welcome steps for someone who signed up and is not approved yet */
.welcome { max-width: 600px; margin: 2.5rem auto; }
.wsteps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: .2rem 0 .8rem; padding: 0; }
.wsteps li { display: flex; align-items: center; gap: .4rem; padding: .25rem .7rem .25rem .3rem; border-radius: 99px; background: var(--sunken); color: var(--muted); font-size: .9rem; }
.wsteps li.now { background: var(--accent-soft); color: var(--chip-ink); font-weight: 600; }
.wsteps li.done { color: var(--ok); }
.wsteps .num { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--surface); font-size: .8rem; }
.sizes label .grow { flex: 1; }
.sizes .rate { white-space: nowrap; align-self: flex-start; font-size: .9rem; }
dl.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem 1rem; margin: .8rem 0 .4rem; }
dl.summary dt { color: var(--muted); font-size: .85rem; }
dl.summary dd { margin: .1rem 0 0; }
.sizes label.locked { opacity: .55; cursor: not-allowed; }
p.warn { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: .55rem .8rem; }

ul.plain-list { margin: .2rem 0; padding-left: 1.2rem; } ul.plain-list li { margin: .25rem 0; }
#credit { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- own domain card (Links and domains tab): flat list, hairlines, no tinted boxes or side stripes ---- */
.card > p.muted { max-width: 92ch; }
.card .table-wrap table { font-size: .93rem; }
.card .table-wrap tbody tr:hover td { background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.card th { text-transform: none; letter-spacing: 0; }
button.tiny, a.btn.tiny { padding: .1rem .5rem; font-size: .8rem; border-radius: 6px; }
.note { margin: 0; font-size: .88rem; color: var(--muted); max-width: 80ch; }
.note strong { color: var(--text); font-weight: 600; }
.note.bad, .note.bad strong { color: var(--bad); }
.od > * + * { margin-top: 1rem; }
.od-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.od-top .od-desc { margin: 0; max-width: 92ch; }
.od-top .chip { white-space: nowrap; }
.od-add { padding-top: .9rem; border-top: 1px solid var(--line); }
.od-fields { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.od-fields .field { margin: 0; }
.od-fields .field.grow { flex: 1 1 15rem; }
.od-fields .field.grow input { width: 100%; }
.od-form > * + * { margin-top: .6rem; }
.od-empty { display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; padding: .8rem 0; border-top: 1px solid var(--line); }
.od-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.od-item + .od-item { border-top: 1px solid var(--line); }
.od-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .7rem 1rem; }
.od-title { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-width: 0; }
.od-name { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
a.od-name { color: var(--text); text-decoration-color: var(--line); text-underline-offset: 3px; }
a.od-name:hover { text-decoration-color: var(--accent); }
.od-body { border-top: 1px solid var(--line); padding: .9rem 1rem 1rem; }
.od-body > * { margin: 0; }
.od-body > * + * { margin-top: .85rem; }
.od-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; flex-wrap: wrap; }
.od-steps li { display: flex; align-items: center; gap: .5rem; padding-right: 1rem; color: var(--muted); font-size: .88rem; }
.od-steps li + li::before { content: ""; width: 1.4rem; height: 1px; background: var(--line); margin-right: .55rem; }
.od-steps .dot { width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface); flex: none; }
.od-steps li.done { color: var(--text); } .od-steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.od-steps li.done + li::before { background: var(--ok); }
.od-steps li.now { color: var(--text); font-weight: 600; } .od-steps li.now .dot { border-color: var(--text); color: var(--text); }
.od-steps li.bad { color: var(--bad); font-weight: 600; } .od-steps li.bad .dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.recs { border-top: 1px solid var(--line); }
.rec { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) minmax(0, 1.35fr); gap: .3rem .9rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.rec.head { color: var(--muted); font-size: .8rem; font-weight: 500; padding: .4rem 0; }
.rec .cell { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.rec .cell code { overflow-wrap: anywhere; min-width: 0; flex: 1 1 auto; font-size: .84rem; }
.rec .cell button { flex: none; }
.rec .chip.mono { font-family: var(--mono); font-size: .75rem; }
@media (max-width: 700px) {
  .od-top { flex-direction: column; }
  .rec { grid-template-columns: 1fr; padding: .7rem 0; }
  .rec.head { display: none; }
  .rec .cell::before { content: attr(data-label); color: var(--muted); font-size: .75rem; width: 3rem; flex: none; }
  .od-steps li { padding-right: .6rem; font-size: .82rem; } .od-steps li + li::before { width: .8rem; }
}

/* ---- chat: a log of turns, not bubbles; one flat composer ---- */
.chatbar { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.chatpick { display: flex; gap: .5rem; align-items: center; flex: 1 1 16rem; min-width: 0; }
.chatpick select { flex: 1 1 auto; width: auto; min-width: 10rem; max-width: 28rem; }
.chatpick button { flex: none; white-space: nowrap; }
.chatopts { display: flex; gap: .4rem 1rem; align-items: center; flex-wrap: wrap; }
.chatlist { display: flex; flex-direction: column; gap: 0; min-height: 200px; max-height: calc(100vh - 31rem); overflow-y: auto; padding: 0 0 .9rem; }   /* room under the last message, so the token meter never covers its last line */
.turn { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.turn:first-child { border-top: 0; padding-top: .5rem; }
.turn .who { color: var(--muted); font-size: .8rem; font-weight: 600; padding-top: .2rem; }
.turn.user .who { color: var(--text); }
.turn .tbody { min-width: 0; max-width: 76ch; }
.turn .tbody > * + * { margin-top: .75rem; }
.turn .say { margin: 0; white-space: pre-wrap; word-break: break-word; font-weight: 500; }
.turn.agent .md { line-height: 1.6; }
.acts { margin-top: .2rem; }
.act { display: flex; flex-direction: column; gap: .15rem; padding: .5rem .8rem; border-top: 1px solid var(--line); font-size: .88rem; }
.act-head { display: flex; align-items: baseline; gap: .8rem; }
.act-title { flex: 1; min-width: 0; }
.act.failed .act-title { color: var(--bad); }
.act-time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act .cmd { white-space: pre-wrap; word-break: break-all; background: none; padding: 0; color: var(--muted); font-size: .76rem; }
.act .shot { display: block; max-width: 360px; }
.act .shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; margin: .25rem 0; }
.act summary { cursor: pointer; font-size: .78rem; color: var(--muted); }
.act summary:hover { color: var(--text); } .act summary.bad { color: var(--bad); }
.act details pre { margin: .35rem 0 .1rem; background: var(--sunken); padding: .55rem .7rem; border-radius: 6px; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-all; color: var(--text); font-size: .8rem; }
.starter { max-width: 42rem; padding: 1.1rem 0 .3rem; }
.starter h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.starter p { margin: 0; }
.ideas { margin-top: .9rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.idea { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: left; font-weight: 400; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: .7rem .15rem; color: var(--text); }
.idea:hover { background: var(--sunken); border-color: var(--line); }
.idea .use { color: var(--muted); font-size: .8rem; opacity: 0; }
.idea:hover .use, .idea:focus-visible .use { opacity: 1; }
.approval { border: 1px solid var(--warn); border-radius: 6px; padding: .75rem 1rem; background: var(--surface); font-size: .93rem; }
.approval .lead { color: var(--warn); }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: .5rem 0 .15rem; }
.wb-chat .composer { background: var(--surface); }
.composer-box { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .65rem .75rem .55rem; }
.composer-box:focus-within { border-color: var(--accent); }
.composer-box textarea { border: 0; box-shadow: none; outline: none; padding: 0; min-height: 2.7rem; resize: none; background: transparent; width: 100%; }
table.comps td { vertical-align: middle; }
table.comps tr.hot td { background: color-mix(in srgb, var(--bad, #c0392b) 7%, transparent); }
table.comps .metric-now { font-weight: 600; font-variant-numeric: tabular-nums; }
table.comps .metric-now.bad { color: var(--bad, #c0392b); }
table.comps .cspark { display: block; color: var(--accent); margin-top: .15rem; line-height: 0; }
table.comps .cspark.hot { color: var(--bad, #c0392b); }
table.comps .cspark .lvl { stroke: currentColor; stroke-opacity: .35; stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
table.comps .act-cell { text-align: right; }
@media (max-width: 700px) {
  table.comps thead { display: none; }
  table.comps, table.comps tbody { display: block; }
  table.comps tr { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; padding: .8rem .2rem; border-bottom: 1px solid var(--line); }
  table.comps td { display: block; border: 0; padding: 0; }
  table.comps td:first-child { grid-column: 1 / -1; }
  table.comps td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--muted); }
  table.comps .act-cell { text-align: left; }
}
.fileapp h3 { margin: 0; }
.fa-row { display: grid; grid-template-columns: 6rem 1fr auto; gap: .6rem; align-items: center; }
.fa-row code { overflow-wrap: anywhere; }
@media (max-width: 560px) { .fa-row { grid-template-columns: 1fr auto; } .fa-row > span { grid-column: 1 / -1; } }
.wb-sortrow { display: flex; align-items: center; gap: .5rem; }
.wb-sortrow select { flex: 1; min-width: 0; }
.att-tray { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .55rem; }
.att { position: relative; width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunken); overflow: hidden; }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; line-height: 1; font-size: 15px;
  background: rgba(20, 18, 28, .72); color: #fff; border: 0; display: grid; place-items: center; }
.att-x:hover { background: rgba(20, 18, 28, .9); }
.att-note { margin: 0 0 .5rem; }
.composer-box.dropping { border-color: var(--accent); border-style: dashed; }
.composer-foot .attach { display: inline-flex; align-items: center; gap: .35rem; }
.turn .pics { display: flex; flex-wrap: wrap; gap: .5rem; margin: .35rem 0; }
.turn .pic img { display: block; max-width: 220px; max-height: 180px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunken); }
.turn .saved-note { margin: .15rem 0 0; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: .55rem; flex-wrap: wrap; }
.composer-foot .status { color: var(--muted); font-size: .82rem; margin: 0; min-width: 0; flex: 1 1 14rem; }
@media (max-width: 700px) { .turn { grid-template-columns: 1fr; gap: .15rem; } .chatlist { max-height: none; } }

/* ---- computer pages: overview side panel, terminal tabs, files, settings list ---- */
td a.btn.quiet { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
td a.btn.quiet:hover { color: var(--text); background: var(--sunken); }
.psec { padding: 1rem 0; border-top: 1px solid var(--line); }
.sidepanel > .psec:first-child { border-top: 0; padding-top: 0; }
.psec h2 { font-size: .95rem; margin: 0 0 .6rem; }
details.psec > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
details.psec > summary::-webkit-details-marker { display: none; }
details.psec > summary h2 { margin: 0; }
details.psec[open] > summary { margin-bottom: .7rem; }
.addr { list-style: none; margin: 0; padding: 0; }
.addr li { display: flex; gap: .6rem; align-items: baseline; padding: .25rem 0; flex-wrap: wrap; }
.termtabs { gap: 0; border-bottom: 1px solid var(--line); margin-bottom: .7rem; }
.termtab { display: inline-flex; align-items: center; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.termtab.on { background: none; border-bottom-color: var(--text); }
.termtab.on button:first-child { color: var(--text); }
.term-status { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.term-status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.term-status[data-s="ok"]::before { background: var(--ok); } .term-status[data-s="bad"]::before { background: var(--bad); }
.termbox { height: max(300px, calc(100vh - 21rem)); }
.filebar { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-family: var(--mono); font-size: .9rem; min-width: 0; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs .sep { color: var(--muted); opacity: .6; }
.files-box { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.files-box table { margin: 0; } .files-box tbody tr:last-child td { border-bottom: 0; }
.pickname { display: inline-flex; align-items: center; gap: .55rem; }
.pickname input[type=checkbox] { margin: 0; width: 1rem; height: 1rem; flex: none; }
.selbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .45rem .5rem .45rem .85rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--sunken); position: sticky; top: 0; z-index: 2; }
.selbar[hidden] { display: none; }
.files-drop { position: relative; border-radius: 8px; }
.files-drop.dropping { outline: 2px dashed var(--accent); outline-offset: 4px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.files-drop.dropping::after { content: 'Drop to upload here'; position: absolute; left: 50%; top: 1rem; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink); padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; pointer-events: none; }
.files-box tr.droptarget td, .crumbs a.droptarget { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.crumbs a.droptarget { outline: 2px solid var(--accent); border-radius: 4px; }
.files-box tr.dragging { opacity: .45; }
.files-box tr[draggable=true] { cursor: default; }
.drophint { margin: .4rem 0 0; }
.filesearch input { width: 15rem; max-width: 100%; }
.searchhead { padding: .1rem .2rem .5rem; gap: .5rem; flex-wrap: wrap; }
.viewer { position: fixed; inset: 0; z-index: 1000; background: #17141f; display: flex; flex-direction: column; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .6rem 1rem;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.viewer-title { display: flex; align-items: baseline; gap: .7rem; min-width: 0; }
.viewer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar button[aria-label] { font-size: 1.3rem; line-height: 1; padding: .2rem .7rem; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; color: #eee; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 16px 16px; box-shadow: 0 4px 24px rgba(0,0,0,.4); }
.viewer-pdf { width: min(1100px, 100%); height: 100%; border: 0; background: #fff; border-radius: 4px; }
@media (max-width: 700px) { .filesearch, .filesearch input { width: 100%; } .viewer-stage { padding: .4rem; } }
.edhead { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.edhead strong { overflow-wrap: anywhere; }
@media (min-width: 701px) { .files-box td.row { text-align: right; white-space: nowrap; } }
@media (hover: none) { .drophint { display: none; } }
textarea.editor { width: 100%; min-height: 65vh; resize: vertical; font-size: .88rem; line-height: 1.45; tab-size: 4; padding: .75rem .85rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; white-space: pre; overflow-wrap: normal; overflow: auto; }
.files-box tbody tr:hover td { background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.sgroup h2 { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1.9rem 0 .55rem; }
.sgroup:first-child h2 { margin-top: .4rem; }
/* each group is a card, like the Account page; rows inside are separated by hairlines */
.srows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 1.15rem; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); gap: .7rem 2rem; align-items: center; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.s-text h3 { font-size: .98rem; font-weight: 600; margin: 0 0 .2rem; }
.s-text p { margin: 0; max-width: 62ch; line-height: 1.5; }
.s-text p strong { color: var(--text); font-weight: 600; }
.s-ctl { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.s-ctl > form, .s-ctl > .row, .s-ctl > .stack { width: 100%; }
.s-ctl .row { flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
.s-ctl .row > input:not([type=checkbox]), .s-ctl .row > select { flex: 1 1 auto; min-width: 0; width: auto; }
.s-ctl select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.s-ctl button, .s-extra button, .s-ctl .btn { white-space: nowrap; flex: none; }
.with-unit { display: inline-flex; align-items: center; gap: .45rem; flex: none; }
.with-unit input { width: 6rem !important; flex: none !important; text-align: right; }
.s-extra { grid-column: 1 / -1; padding-top: .1rem; }
.s-extra .row { gap: .6rem .9rem; flex-wrap: wrap; align-items: center; } .s-extra .row input:not([type=checkbox]) { width: auto; } .s-extra .row #sc-tz { min-width: 14rem; }
.s-extra .inline-form { margin-top: .2rem; }
.s-extra .row > label { margin: 0; align-self: center; }
/* on/off settings are switches */
input.switch { appearance: none; -webkit-appearance: none; width: 2.6rem; height: 1.5rem; margin: 0; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; }
input.switch::before { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(1.1rem); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::before { transition: none; } }
/* days of the hours schedule as chips */
.daychip { position: relative; display: inline-flex; align-items: center; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; cursor: pointer; user-select: none; background: var(--surface); }
.daychip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.daychip:has(input:checked) { background: var(--accent-soft); border-color: transparent; color: var(--chip-ink); font-weight: 600; }
.daychip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the Delete group stands apart */
.sgroup.danger h2 { color: var(--bad); }
.sgroup.danger .srows { border-color: var(--bad-soft); background: color-mix(in srgb, var(--bad-soft) 35%, var(--surface)); }
@media (max-width: 700px) {
  .srows { padding: 0 .9rem; }
  .srow { grid-template-columns: 1fr; gap: .6rem; }
  .s-ctl { justify-content: flex-start; }
  .s-ctl .row { flex-wrap: wrap; justify-content: flex-start; }
  .s-ctl .row > input:not([type=checkbox]), .s-ctl .row > select { flex-basis: 100%; }
  .s-ctl input:not([type=checkbox]):not(.switch) { min-width: 0; }
}

/* ---- previews sections, metrics strip ---- */
.subtabs { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; font-size: .92rem; }
.subtabs a { color: var(--muted); text-decoration: none; padding: .15rem 0; border-bottom: 1px solid transparent; }
.subtabs a:hover { color: var(--text); }
.subtabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem 2rem; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { min-width: 0; }
.metric > p.muted:first-child { margin: 0 0 .1rem; font-size: .84rem; }
.metric > p { margin: 0; }
.term-status[data-s="warn"]::before { background: var(--warn); }

/* ---- lists of computers and schedules (one row each), welcome steps, notices ---- */
.xlist { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.xrow { display: flex; justify-content: space-between; align-items: center; gap: .8rem 1.5rem; flex-wrap: wrap; padding: .85rem 1rem; }
.xrow + .xrow { border-top: 1px solid var(--line); }
.xgroup { padding: .55rem 1rem .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--sunken); }
.xgroup + .xrow, .xrow + .xgroup { border-top: 1px solid var(--line); }
.xlist > .xgroup:first-child { border-radius: 6px 6px 0 0; }
.xsort { flex-wrap: nowrap; gap: .45rem; }
.xsort select { min-width: 9rem; }
.xcontrols .xpick { margin-left: auto; }
@media (max-width: 700px) { .xcontrols .xpick { margin-left: 0; width: 100%; } .xcontrols .xpick > * { flex: 1 1 10rem; } .xsort select { flex: 1; min-width: 0; } }
.xmain { min-width: 0; flex: 1 1 24rem; }
.xtitle { display: flex; align-items: center; gap: .5rem .6rem; flex-wrap: wrap; }
.xtitle .name { font-weight: 600; font-size: 1rem; word-break: break-all; text-decoration-color: var(--line); text-underline-offset: 3px; }
.xtitle .name:hover { text-decoration-color: var(--accent); }
.xrow .meta { color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.xrow .lastchat { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; font-size: .9rem; color: var(--text); text-decoration: none; overflow: hidden; }
.xrow .lastchat:hover { text-decoration: underline; }
.xrow .lastchat .chip { flex: none; }
.xrow .prompt { margin: .35rem 0 0; font-size: .92rem; max-width: 80ch; white-space: pre-wrap; }
.xact { flex: none; }
.xact button.danger.quiet { color: var(--bad); }   /* Delete in a computer's row: red like every delete, but quiet beside Open and Start */
@media (max-width: 700px) { .xact .danger .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .xact .danger { min-width: 44px; justify-content: center; } }   /* Delete: the bin only on a phone, so the row stays one line */
.xempty { margin: 0; padding: .9rem 0; border-top: 1px solid var(--line); }
.wsteps { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: .2rem 0 .8rem; padding: 0; }
.wsteps li { display: flex; align-items: center; gap: .5rem; padding: 0 1rem 0 0; border-radius: 0; background: none; color: var(--muted); font-size: .9rem; }
.wsteps li + li::before { content: ""; width: 1.4rem; height: 1px; background: var(--line); margin-right: .55rem; }
.wsteps li.now { background: none; color: var(--text); font-weight: 600; }
.wsteps li.now .num { border-color: var(--text); color: var(--text); }
.wsteps li.done { color: var(--text); }
.wsteps li.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.wsteps .num { width: 1.3rem; height: 1.3rem; border: 1px solid var(--line); background: var(--surface); }
.notice { background: var(--surface); border: 1px solid var(--warn); color: var(--text); }
.notice.info { border-color: var(--line); }

/* invoices and receipts: the document page, printed on its own */
.doc-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.doc { max-width: 46rem; }
.doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.doc-head h1 { margin: 0; }
.doc-no { text-align: right; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.doc-lines .num, .doc-lines th.num { text-align: right; white-space: nowrap; }
.doc-lines tfoot th { border-top: 1px solid var(--line, currentColor); }
@media (max-width: 640px) { .doc-parties { grid-template-columns: 1fr; } }
@media print {
  header.top, .skip, .doc-actions, #toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .doc.card { border: 0; box-shadow: none; padding: 0; max-width: none; }
}

/* domain wizard */
.wz-steps { margin-bottom: .5rem; }
.wz-opts { display: grid; gap: .6rem; }
.wz-opt { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.wz-opt.locked { opacity: .6; cursor: not-allowed; }
.wz-opt input { margin-top: .25rem; }
.wz-checks { list-style: none; margin: .4rem 0; padding: 0; display: grid; gap: .5rem; }
.wz-checks li { display: flex; gap: .7rem; align-items: flex-start; }
.wz-mark { width: 1.3rem; text-align: center; font-weight: 700; flex: none; }
.wz-checks .ok .wz-mark { color: var(--ok); } .wz-checks .warn .wz-mark { color: var(--text); } .wz-checks .fail .wz-mark { color: var(--bad); }
.wz-nav { margin-top: 1rem; align-items: center; }
.wz-rec { grid-template-columns: 4.2rem minmax(0, 1.3fr) minmax(0, 1fr) 10.5rem; }
.wz-rec .wz-n code { overflow-wrap: normal; word-break: normal; }   /* names break only after a dot (see wizard.js) */
.wz-rec .chip.plain { background: var(--sunken); color: var(--muted); }
.wz-rec .cell button.tiny { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.wz-rec .cell button.tiny:hover { background: var(--sunken); }
.wz-note { margin: .6rem 0 0; padding: .65rem .8rem; border-radius: 8px; background: var(--warn-soft); overflow-wrap: anywhere; }
.wz-note ul { margin: .35rem 0; padding-left: 1.1rem; } .wz-note code { font-size: .82rem; }
/* choices as cards you can tap anywhere on */
.wz-opt { border: 1px solid var(--line); border-radius: 10px; padding: .85rem .95rem; border-bottom-width: 1px; transition: border-color .12s, background .12s; }
.wz-opt:not(.locked):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.wz-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.wz-opt input { accent-color: var(--accent); }
.wz-mini { display: none; }
@media (max-width: 720px) {
  /* the step list becomes one short line with a bar */
  .wz-progress .wz-steps { display: none; }
  .wz-mini { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; align-items: baseline; margin-bottom: .3rem; }
  .wz-mini > span:first-child { color: var(--muted); font-size: .82rem; }
  .wz-mini strong { font-size: .9rem; }
  .wz-bar { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: .35rem; }
  .wz-bar i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
  .wz-bar i.done { background: var(--ok); } .wz-bar i.now { background: var(--accent); }
  /* each DNS record: type and status on one line, then name and value full width, each with its own Copy */
  .wz-rec { grid-template-columns: auto 1fr; grid-template-areas: "t s" "n n" "v v"; gap: .45rem .6rem; padding: .85rem 0; }
  .wz-rec .wz-t { grid-area: t; } .wz-rec .wz-s { grid-area: s; justify-self: end; text-align: right; }
  .wz-rec .wz-n { grid-area: n; } .wz-rec .wz-v { grid-area: v; }
  .wz-rec .cell { display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; align-items: center; background: var(--sunken); border-radius: 8px; padding: .45rem .6rem; }
  .wz-rec .cell::before { grid-column: 1 / -1; width: auto; }
  .wz-rec .cell code { background: none; padding: 0; word-break: break-all; }
  .wz-rec .wz-n code { word-break: normal; overflow-wrap: anywhere; }   /* after a dot first, anywhere only if a part is too long */
  .wz-rec .cell button.tiny { padding: .3rem .7rem; }
  /* buttons share the row; Back stays small */
  .wz-nav { flex-wrap: nowrap; gap: .5rem; }
  .wz-nav > .row { flex: 1; justify-content: flex-end; flex-wrap: nowrap; }
  .wz-nav > .row > * { flex: 1 1 0; max-width: 12rem; justify-content: center; text-align: center; }
  .wz { padding: .9rem .85rem; }
}

/* support view: a plain bar across the top while an admin is in someone's dashboard */
.support-bar { display: flex; gap: .75rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .45rem 1rem; background: var(--text, #222); color: var(--bg, #fff); font-size: .9rem; position: sticky; top: 0; z-index: 50; }
.support-bar button { background: transparent; color: inherit; border: 1px solid currentColor; padding: .15rem .6rem; }

.keylist { list-style: none; margin: 0; padding: 0; }
.keylist li { padding: .6rem 0; border-top: 1px solid var(--line); }
.keylist li:first-child { border-top: 0; }

dialog:has(.limitsdlg) { width: min(560px, 94vw); }
.limitsdlg h3 { margin: .2rem 0 0; font-size: 1rem; }
.limitsdlg .row > input { flex: 1; min-width: 0; }
.limitsdlg h3:not(:first-child) { margin-top: 1rem; }

/* Usage: AI tokens per day (aiTokensCard in extras.js) */
.aidays { display: flex; align-items: flex-end; gap: .35rem; height: 5rem; }
.aiday { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.aiday .aibar { width: 100%; max-width: 1.4rem; background: var(--accent); border-radius: 3px 3px 0 0; }

/* the sign-in page (signInPage in app.js) */
.signin { max-width: 27rem; margin: clamp(1.5rem, 6vh, 4.5rem) auto 2rem; padding: 0 1rem; }
.signin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem 1.75rem 1.6rem; text-align: center; }
.signin-cat { width: 7.5rem; height: auto; margin: -.25rem auto .6rem; display: block; }
.signin h1 { font-size: 1.6rem; margin: 0 0 .4rem; }
.signin-card > p.muted { margin: 0 auto 1.4rem; max-width: 22rem; }
.signin-error { border: 1px solid var(--bad); background: var(--bad-soft); color: var(--text); border-radius: 6px; padding: .6rem .8rem; font-size: .92rem; text-align: left; margin: 0 0 1rem; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: .7rem; width: 100%; min-height: 2.9rem; padding: .6rem 1rem; border-radius: 6px;
  border: 1px solid #dadce0; background: #fff; color: #1f1f1f; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; }
.gbtn:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(60, 64, 67, .18); }
.gbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gbtn.busy { opacity: .7; cursor: progress; }
.gbtn svg { flex: none; }
.signin-new { text-align: left; margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.signin-new h2 { font-size: 1rem; margin: 0 0 .5rem; }
.signin-new ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .93rem; color: var(--muted); }
.signin-foot { text-align: center; margin-top: 1rem; line-height: 1.6; }
.signin-foot a { white-space: nowrap; }

/* Notices page: which emails, under "Email me my notices" */
.emailkinds { border: 0; margin: 0; padding: 0 0 0 1.6rem; gap: .35rem; }
.emailkinds legend { padding: 0; margin-bottom: .2rem; }

/* Sign in with Microsoft: the second button, and the "check your email" notice */
.signin-card .gbtn + .gbtn { margin-top: .6rem; }
.signin-sent { background: var(--accent-soft, #ece5fa); border-radius: 6px; padding: .7rem .9rem; margin: 0 0 1rem; }

/* Admin, Sign-in: the redirect address selects in one click */
code.select { user-select: all; word-break: break-all; }

/* agent steps: one line per batch ("Changed 2 files, ran 4 commands · 2m 40s"); open it for the steps */
details.acts { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; max-width: 46rem; }
details.acts > summary.acts-sum { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .45rem .8rem; cursor: pointer; list-style: none; font-size: .9rem; color: var(--text); }
details.acts > summary.acts-sum::-webkit-details-marker { display: none; }
details.acts > summary.acts-sum::after { content: ''; width: .5rem; height: .5rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; margin: 0 .2rem 0 .1rem; transition: transform .15s; }
details.acts[open] > summary.acts-sum::after { transform: rotate(45deg); }
details.acts > summary.acts-sum:hover { background: var(--sunken); }
.acts-txt { flex: 1; min-width: 0; }
.acts-txt .bad { color: var(--bad); }
.acts-time { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acts-ico { width: 1rem; height: 1rem; flex: none; border-radius: 50%; position: relative; }
.acts-ico.ok::before { content: ''; position: absolute; left: .32rem; top: .12rem; width: .28rem; height: .55rem; border-right: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(45deg); }
.acts-ico.bad::before, .acts-ico.bad::after { content: ''; position: absolute; left: .44rem; top: .1rem; width: 2px; height: .8rem; background: var(--bad); transform: rotate(45deg); }
.acts-ico.bad::after { transform: rotate(-45deg); }
.acts-ico.busy { border: 2px solid var(--line); border-top-color: var(--accent); animation: actspin 1s linear infinite; }
@keyframes actspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .acts-ico.busy { animation: none; } }

/* the agent's turn: how long it worked, under "Agent" */
.turn .who .tdur { display: block; font-weight: 400; font-variant-numeric: tabular-nums; margin-top: .1rem; }
.turn .who .tdur:empty { display: none; }

/* the message box: the model and "Ask me before" as chips beside the picture button; each chip is the real menu */
.composer { position: sticky; }
.composer-foot .chips { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.cchip { position: relative; display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--sunken); color: var(--text); font-size: .82rem; font-weight: 500; cursor: pointer; max-width: 15rem; }
.cchip .chip-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cchip .chip-caret { width: .4rem; height: .4rem; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translate(-1px, -1px); flex: none; }
.cchip .ico { margin: 0; width: 14px; height: 14px; }
.cchip select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.cchip:hover { border-color: var(--muted); }
.cchip:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.cchip.mode[data-mode="never"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.composer-foot .sendrow { margin-left: auto; }
.composer-foot .stopbtn { display: inline-flex; align-items: center; gap: .35rem; }
.composer-foot .stopbtn[hidden] { display: none; }
.composer > .status { color: var(--muted); font-size: .8rem; margin: .35rem .1rem 0; }
/* Latest: back to the newest message; its own row above the message box, so it never covers the text */
.latest { display: flex; align-items: center; gap: .35rem; width: fit-content; min-height: 36px; margin: 0 auto .45rem; padding: 0 1rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .85rem; box-shadow: 0 2px 8px rgba(29, 26, 43, .1); }
.latest[hidden] { display: none; }
@media (max-width: 700px) {
  .attach .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .composer-foot .attach { min-width: 40px; min-height: 40px; justify-content: center; padding: 0; }
  .composer-foot { flex-wrap: nowrap; gap: .4rem; }
  .composer-foot .chips { flex-wrap: nowrap; overflow: hidden; flex: 1 1 auto; }
  .cchip { max-width: 9.5rem; padding: 0 .6rem; }
  .composer-foot .chips > .cchip { min-width: 0; flex: 0 1 auto; }          /* chips shrink and end in "...", never cut mid-word */
  .composer-foot .sendrow { flex: none; flex-wrap: nowrap; gap: .35rem; }    /* Stop and Send stay side by side */
  .composer-foot .stopbtn { min-width: 40px; min-height: 40px; padding: 0; justify-content: center; }
  .composer-foot .stopbtn .ico { margin: 0; }
  .composer-box.busy.empty .sendrow button[type=submit] { display: none; }   /* Send comes back as soon as something is typed */
  .composer-foot .stopbtn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .composer > .status { display: none; }
  .act .cmd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
  /* on a phone the agent's turn shows a small header with its time; your own turn needs no label */
  body.wb-phone-chat .turn.agent > .who { display: flex; gap: .4rem; align-items: baseline; grid-area: auto; font-size: .85rem; }   /* the top bar's .who rule must not place it */
  body.wb-phone-chat .turn.agent .who .tdur { display: inline; }
  body.wb-phone-chat .turn.agent .who .tdur::before { content: '· '; }
  body.wb-phone-chat .turn.agent .who .tdur:empty { display: none; }
  details.acts > summary.acts-sum { font-size: .88rem; }
}

/* workbench on a phone: one thing at a time */
.wb-ptabs { display: none; }
@media (max-width: 700px) {
  /* the list of chats: its own screen; New chat floats at the bottom */
  .wb.phone.in-list { display: block; height: auto; }
  .wb.phone.in-list .wb-chat, .wb.phone.in-list .wb-panel { display: none; }
  .wb.phone.in-list .wb-side { overflow: visible; padding-bottom: 5rem; }
  .wb.phone.in-list .wb-side > button.primary { position: fixed; right: 1rem; bottom: calc(1.2rem + env(safe-area-inset-bottom)); z-index: 20; border-radius: 999px;
    padding: .9rem 1.3rem; box-shadow: 0 6px 18px rgba(60, 30, 140, .28); }
  .wb.phone .wb-item { padding: .7rem .6rem; }

  /* a chat: the whole screen under the top bar; the message box stays at the bottom; the tools are tabs below it */
  body.wb-phone-chat main.wide { padding: 0; }
  body.wb-phone-chat .who { display: none; }
  .wb.phone.in-chat { display: flex; flex-direction: column; gap: 0; height: calc(100dvh - var(--toph, 60px)); min-height: 0; }
  .wb.phone.in-chat .wb-side { display: none; }
  .wb.phone.in-chat .wb-chat, .wb.phone.in-chat .wb-panel { flex: 1; min-height: 0; border: 0; border-radius: 0; padding: 0; gap: 0; }
  .wb.phone.in-chat[data-ptab="chat"] .wb-panel { display: none; }
  .wb.phone.in-chat[data-ptab="tool"] .wb-chat { display: none; }
  .wb.phone.in-chat .wb-panel .wb-tabs { display: none; }
  .wb.phone.in-chat .wb-panelbody { padding: .5rem; }
  .wb.phone.in-chat .wb-panel .termbox { height: 100%; min-height: 260px; }
  .wb.phone.in-chat .wb-panel iframe.desk { height: 100%; min-height: 260px; }
  .wb.phone .wb-head { flex-direction: row; align-items: center; gap: .2rem; padding: .3rem .4rem .3rem .2rem; border-bottom: 1px solid var(--line); }
  .wb.phone .wb-back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 2rem; line-height: 1; text-decoration: none; color: var(--text); flex: none; }
  .wb.phone .wb-ptitle { flex: 1; min-width: 0; }
  .wb.phone .wb-ptitle .wb-h { font-size: 1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wb.phone .wb-ptitle p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wb.phone .wb-pmore { width: 44px; height: 44px; flex: none; font-size: 1.3rem; padding: 0; }
  .wb.phone.in-chat .wb-chatbox { max-height: none; padding: 0 .8rem; }
  .wb.phone.in-chat .chatbar { display: none; }
  .wb.phone.in-chat .chatlist { min-height: 0; padding-right: .45rem; }
  .wb.phone.in-chat .composer { position: sticky; bottom: 0; background: var(--surface); padding: .4rem 0 .5rem; border-top: 1px solid var(--line); }
  .wb.phone.in-chat .composer textarea { font-size: 16px; }
  .wb.phone.in-chat .wb-ptabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); flex: none; border-top: 1px solid var(--line); background: var(--surface);
    padding-bottom: env(safe-area-inset-bottom); }
  .wb-ptab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 54px; border: 0; background: none; border-radius: 0;
    color: var(--muted); font: inherit; font-size: .72rem; padding: .3rem 0; }
  .wb-ptab svg { width: 22px; height: 22px; }
  .wb-ptab[aria-pressed="true"] { color: var(--accent); font-weight: 600; }
  .wb-sheet .chatbar, .wb-sheet .chatopts { display: flex; flex-direction: column; align-items: stretch; gap: .8rem; }
  .wb-sheet .ctl { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; text-align: left; }
  .wb-sheet .chatbar { border: 0; padding: 0; }
  .wb.phone.in-chat > .wb-head { flex: none; background: var(--surface); }
  .wb-sheet select { width: 100%; min-height: 44px; }
}

/* quick answers to the agent's yes-or-no question */
.quick { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.quickbtn { min-height: 40px; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; }
.quickbtn.yes { border-color: var(--accent); color: var(--accent); }

/* extra terminal keys: only on touch screens and phones */
.termkeys { display: none; }
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .termkeys { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    position: sticky; bottom: var(--awx-kbd, 0px); z-index: 5; background: var(--bg); }   /* always on screen, above the phone keyboard */
  .termkey { min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: #2e2b36; color: #f2f0f7; font-family: var(--mono); font-size: .78rem; font-weight: 600; }
  .termkey[aria-pressed="true"] { background: var(--accent); color: #fff; }
  .termkey { display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; color: #f2f0f7; }
  .termkey.arrow { font-family: system-ui, sans-serif; font-size: 1.15rem; font-weight: 500; }
  .termkey.enter { background: var(--accent); color: #fff; }
}
@media (max-width: 480px) {
  .termkeys { grid-template-columns: repeat(5, minmax(0, 1fr)); }   /* two rows of five on a phone: keys big enough to tap */
  .termkey { min-height: 40px; }
  .termbtn { min-width: 2.6rem; min-height: 2.4rem; }
}
@media (max-width: 700px) {
  .termhint { display: none; }
  /* the terminal fills the tab, with the key row under it */
  .wb.phone.in-chat .wb-panelbody { display: flex; flex-direction: column; }
  .wb.phone.in-chat .wb-panelbody > .stack { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .wb.phone.in-chat .termholder { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .wb.phone.in-chat .termholder .termwrap { flex: 1; min-height: 0; gap: .35rem; }
  .wb.phone.in-chat .wb-panel .termholder .termbox { flex: 1; height: auto; min-height: 160px; }
}

/* phones: tables as two-line lists (extras.js mlist) */
.mlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mlist li { padding: .7rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.mlist .mrow { display: flex; align-items: baseline; gap: .8rem; }
.mlist .mtitle { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.mlist .mright { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.mlist .msub { margin-top: .2rem; overflow-wrap: anywhere; }
.mlist-more { margin-top: .6rem; width: 100%; min-height: 44px; }
@media (max-width: 700px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
  .tile .n { font-size: 1.3rem; }
  .card .row.between > h2 { margin: 0; }
}

/* page tabs (Usage, Account): on a phone they share the width and stay at the top while the page scrolls */
h2 .count { margin-left: .5rem; font-weight: 400; }
.tabs .tl-short { display: none; }
@media (max-width: 700px) {
  .ptabs { position: sticky; top: 0; z-index: 15; background: var(--bg); margin: 0 -.9rem .4rem; padding: 0 .4rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .ptabs a { justify-content: center; gap: .3rem; padding: .7rem .2rem; font-size: .9rem; min-height: 44px; }
  .ptabs a svg { width: 16px; height: 16px; flex: none; }
  .ptabs .tl-long { display: none; }
  .ptabs .tl-short { display: inline; }
  .page-head:has(+ .ptabs) { margin-bottom: .4rem; }
}

/* a form that folds behind its button on a phone (open, with the button hidden, on a computer) */
details.pfold > summary { display: none; }
@media (max-width: 700px) {
  details.pfold > summary { display: inline-flex; align-items: center; gap: .4rem; list-style: none; cursor: pointer; min-height: 44px; }
  details.pfold > summary::-webkit-details-marker { display: none; }
  details.pfold[open] > summary { margin-bottom: .6rem; }
}

/* Use your key: a switch between the three setups on a phone; all three on a computer (the switch is the card's first div) */
.ukeys .seg { display: none; }
@media (max-width: 700px) {
  .ukeys .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .ukeys .seg button { min-height: 44px; border: 0; border-radius: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: .88rem; padding: 0 .3rem; }
  .ukeys .seg button + button { border-left: 1px solid var(--line); }
  .ukeys .seg button { display: flex; align-items: center; justify-content: center; text-align: center; }
  .ukeys .seg button[aria-pressed="true"] { background: var(--sunken); color: var(--text); font-weight: 600; }
  .ukeys[data-k="0"] .ukey:not(:nth-of-type(2)), .ukeys[data-k="1"] .ukey:not(:nth-of-type(3)), .ukeys[data-k="2"] .ukey:not(:nth-of-type(4)) { display: none; }
}

/* the theme button: a sun or a moon with its words; on a phone only the picture */
.themebtn { display: inline-flex; align-items: center; gap: .35rem; }
.themeico { display: inline-flex; }
@media (max-width: 700px) { .themetxt { display: none; } .themebtn { padding: .4rem .5rem; min-width: 40px; min-height: 40px; justify-content: center; } }

/* Notices, Email settings: each choice is a comfortable tap on a phone */
@media (max-width: 700px) {
  .emailkinds label.check, .card > label.check { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .1rem 0; }
  .emailkinds label.check input, .card > label.check input { width: 20px; height: 20px; flex: none; }
}

/* Workbench home: the ask box and ideas */
.start { display: flex; flex-direction: column; gap: 1.1rem; max-width: 46rem; width: 100%; margin: 0 auto; padding: 1.6rem 0 .4rem; }
.start-hi { display: flex; align-items: center; gap: .9rem; }
.start-hi h2 { margin: 0; font-size: 1.35rem; line-height: 1.25; }
.start:not(.fresh) .start-hi h2 { font-size: 1.1rem; }
.start-hi p { margin: .3rem 0 0; }
.awi-face { width: 56px; height: 56px; border-radius: 50%; flex: none; background: var(--accent-soft, #efe9fd); }
.start:not(.fresh) .awi-face { width: 40px; height: 40px; }
.start-box { display: flex; flex-direction: column; gap: .6rem; padding: .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 2px 10px rgba(40, 20, 90, .06); }
.start-box textarea { border: 0; padding: .2rem; resize: vertical; font-size: 16px; background: transparent; box-shadow: none; outline: none; min-height: 3rem; }
.start-foot { display: flex; align-items: center; gap: .6rem; justify-content: space-between; flex-wrap: wrap; }
.start-where { flex: 1 1 16rem; min-width: 0; max-width: 26rem; }
.start-where select { font-size: .92rem; width: 100%; min-height: 44px; border-radius: 22px; padding: .5rem 2.3rem .5rem 1rem; background-color: var(--sunken); border-color: transparent; background-position: right 1rem center; }
.start-where select:hover, .start-where select:focus { border-color: var(--line); }
.start-foot button.primary { min-height: 44px; padding: 0 1.4rem; border-radius: 22px; }
.start-ideas { display: flex; flex-direction: column; gap: .5rem; }
.start-ideas .chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.idea-chip { min-height: 40px; padding: 0 .95rem; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; font-weight: 400; }
.idea-chip:hover { border-color: var(--accent); }
.start-note { margin: 0; padding: .8rem .9rem; border-radius: 12px; background: var(--sunken); color: var(--text); line-height: 1.5; }
.idea-sheet textarea { width: 100%; font-size: 15px; line-height: 1.5; }
.idea-sheet select { width: 100%; }
@media (max-width: 700px) {
  .wb-phonehome { margin-bottom: 1rem; }
  .start { padding-top: .4rem; }
  .start-hi h2 { font-size: 1.25rem; }
  .start-where { flex: 1; min-width: 0; }
  .start-where select { width: 100%; }
}
@media (max-width: 700px) {
  .wb.phone.in-list.nochats .wb-side > button.primary, .wb.phone.in-list.nochats .wb-side > input[type=search],
  .wb.phone.in-list.nochats .wb-sortrow, .wb.phone.in-list.nochats .wb-filter, .wb.phone.in-list.nochats .wb-list { display: none; }
}
/* people with chats: the ideas on one row that scrolls sideways, so the list stays close */
.start:not(.fresh) .idea-chip { flex: none; }

#bell .bellcount { display: none; }
@media (max-width: 700px) { #bell .bellcount { display: block; } }

/* the chat's AI token circle, over the message box: a ring filled to today's share of the limit */
.aimeter { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .45rem; text-decoration: none; color: var(--muted); font-size: .78rem; }
.aimeter-ring { --p: 0%; --c: var(--accent); width: 18px; height: 18px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--c) var(--p), var(--sunken) 0); -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px); mask: radial-gradient(circle, transparent 5px, #000 5.5px); }
.aimeter[data-level="high"] .aimeter-ring { --c: var(--warn); }
.aimeter[data-level="full"] .aimeter-ring { --c: var(--bad); }
.aimeter[data-level="full"] { color: var(--bad); }
.aimeter:hover { color: var(--text); }

/* the Workbench home must fit its column at every width: a one-line row of ideas (people with chats) reports its full width,
   and without these it pushed the middle column wider than its slot (iPad and other widths around 1000-1200 px) */
.wb-chatbox > *, .wb-home, .wb-home > *, .start, .start > *, .start-ideas, .start-ideas .chips, .start-box, .start-foot { min-width: 0; max-width: 100%; }
.start-box textarea { width: 100%; box-sizing: border-box; }
.start-where { min-width: 0; flex: 1 1 12rem; }
.start-where select { width: 100%; }
/* the Getting started card follows the width of its column, not of the screen: in a narrow middle column it drops Awi's picture */
.wb-home { container-type: inline-size; width: 100%; }   /* a size container takes no width from its contents, so give it the column's */
.wb-chatbox > .wb-home { max-width: 50rem; margin-inline: auto; }
@media (max-width: 700px) {      /* phones: the ideas stay one row you can swipe, fading at the edge so it is clear there is more */
  .start:not(.fresh) .start-ideas .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .start:not(.fresh) .start-ideas .chips::-webkit-scrollbar { display: none; }
  .start:not(.fresh) .idea-chip { flex: none; }
}   /* a readable column, centred, now that the start page can be wide */
@container (max-width: 560px) { .checklist { grid-template-columns: minmax(0, 1fr); } .checklist .cl-cat { display: none; } }

/* Admin: sections as a grouped side menu; a menu at the top on phones */
.adminlay { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.adminnav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .9rem; }
.adminnav .ghead { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 .6rem .25rem; }
.adminnav a { display: flex; align-items: center; gap: .55rem; padding: .4rem .6rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .93rem; }
.adminnav a:hover { background: var(--sunken); }
.adminnav a[aria-current=page] { background: var(--accent-soft); color: var(--chip-ink); font-weight: 600; }
.adminnav a svg { width: 1.05em; height: 1.05em; flex: none; opacity: .8; }
.adminnav .albl { flex: 1; min-width: 0; }
.abadge { min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); font-size: .75rem; font-weight: 700; text-align: center; }
.abadge[hidden] { display: none; }
.adminbody > .asec { margin: 0; font-size: 1.25rem; }
.adminpickrow { display: none; }
@media (max-width: 800px) {
  .adminlay { grid-template-columns: minmax(0, 1fr); }
  .adminnav { display: none; }
  .adminpickrow { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .2rem; }
  .adminpick { width: 100%; }
}

/* ---------- Admin > Messages: a mailbox like Gmail's (dashboard/static/messages.js) ---------- */
.mbox { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1.1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  height: calc(100vh - 13rem); min-height: 480px; overflow: hidden; }
.mb-side { border-right: 1px solid var(--line); padding: .6rem .45rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.mb-item { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: none; color: var(--text); text-align: left; padding: .45rem .7rem; border-radius: 999px; font-size: .92rem; cursor: pointer; box-shadow: none; }
.mb-item:hover { background: var(--sunken); }
.mb-item.on { background: var(--accent-soft); color: var(--chip-ink); font-weight: 600; }
.mb-item .ico { margin: 0; opacity: .8; }
.mb-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-n { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-item.on .mb-n { color: inherit; }
.mb-head { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .9rem .7rem .3rem; }
.mdot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; }
.mdot.k-problem { background: var(--bad); } .mdot.k-request { background: var(--accent); } .mdot.k-feedback { background: var(--ok); }
.mb-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.mb-top { display: flex; gap: .4rem; padding: .55rem .6rem; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.mb-top input[type=search] { flex: 1; min-width: 0; border-radius: 999px; }
.mb-top select { width: auto; }
.mb-bar { display: flex; align-items: center; gap: .15rem; padding: .3rem .5rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 2.6rem; }
.mb-bar input[type=checkbox] { margin: 0 .35rem 0 .2rem; }
.mb-bar .ico { margin-right: .3rem; }
.mb-count { margin-left: auto; }
.mrows { overflow-y: auto; flex: 1; min-height: 0; }
.mrow { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "box star from date" ". . main main"; align-items: center; gap: .2rem .55rem; padding: .55rem .7rem;
  border-bottom: 1px solid var(--line); cursor: pointer; background: var(--sunken); font-size: .9rem; }
.mrow.unread { background: var(--surface); }
.mrow.unread .mfrom, .mrow.unread .mdate, .mrow.unread .msnip { font-weight: 700; color: var(--text); }
.mrow:hover { box-shadow: inset 0 -1px 0 var(--line), 0 1px 3px rgba(29, 26, 43, .12); position: relative; }
.mrow.open { background: var(--accent-soft); }
.mrow input[type=checkbox] { margin: 0; }
.mrow > input[type=checkbox] { grid-area: box; } .mrow > .mstar { grid-area: star; } .mrow > .mfrom { grid-area: from; } .mrow > .mdate { grid-area: date; } .mrow > .mmain { grid-area: main; }
.mstar { border: 0; background: none; box-shadow: none; padding: 0 .15rem; font-size: 1.05rem; line-height: 1; color: var(--muted); cursor: pointer; }
.mstar.on { color: #d59b16; }
.mfrom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmain { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.msnip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); min-width: 0; }
.mdate { font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mchip { flex: none; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 5px; background: var(--sunken); color: var(--muted); }
.mchip.k-problem { background: var(--bad-soft); color: var(--bad); } .mchip.k-request { background: var(--accent-soft); color: var(--chip-ink); }
.mchip.k-feedback { background: var(--ok-soft); color: var(--ok); } .mchip.replied { background: var(--ok-soft); color: var(--ok); }
.mchip.draft { background: var(--warn-soft); color: var(--warn); }
.mb-read { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mb-read .mb-back { display: none; }
.mb-empty { margin: auto; }
.mb-msg { overflow-y: auto; padding: 1rem 1.2rem 1.4rem; display: flex; flex-direction: column; gap: .8rem; }
.msubj { margin: 0; font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere; }
.mmeta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; font-size: .9rem; }
.mbody { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; background: var(--sunken); border-radius: 10px; padding: .8rem .95rem; }
.mreply .mbody { background: var(--ok-soft); }
.mreply { display: grid; gap: .3rem; }
.mcompose { display: grid; gap: .5rem; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.mcompose textarea { min-height: 11rem; resize: vertical; }
.mc-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.mnote { margin: 0; }
button.linkish { border: 0; background: none; box-shadow: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.ct-form { max-width: 720px; }
.ct-kinds { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.ct-kinds legend { font-weight: 600; margin-bottom: .5rem; }
.ct-kinds label { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; cursor: pointer; }
.ct-kinds label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ct-kinds input { accent-color: var(--accent); margin: 0 0 .2rem; }
.ct-form textarea { min-height: 9rem; }
.ct-status { margin: 0; font-weight: 600; color: var(--ok); min-height: 1.3em; }
@media (max-width: 900px) {
  /* one pane at a time: boxes as chips on top, then the list; an open message replaces them */
  .mbox { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; overflow: visible; }
  .mb-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); gap: .3rem; padding: .5rem; scrollbar-width: none; }
  .mb-side::-webkit-scrollbar { display: none; }
  .mb-item { width: auto; flex: none; border: 1px solid var(--line); padding: .35rem .75rem; }
  .mb-head { display: none; }
  .mb-list { border-right: 0; }
  .mrows { overflow: visible; }
  .mb-read { display: none; }
  .mbox.reading .mb-side, .mbox.reading .mb-list { display: none; }
  .mbox.reading .mb-read { display: flex; }
  .mb-read .mb-back { display: inline-flex; }
  .mb-msg { overflow: visible; padding: .9rem .8rem 1.2rem; }
  .ct-kinds { grid-template-columns: 1fr; }
}
.mb-read > .mb-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.mb-read > .mb-bar button { flex: none; }
.cchip[hidden] { display: none; }

/* ---------- Admin > Insights (dashboard/static/insights.js): one measure per chart, thin accent bars, a tooltip and a table ---------- */
.ins-head { align-items: center; gap: .6rem; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.seg button { border: 0; box-shadow: none; background: none; padding: .3rem .7rem; border-radius: 6px; font-size: .88rem; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.ins-tile { gap: .15rem; }
.ins-num { font-size: 1.55rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ins-lbl { font-size: .85rem; color: var(--muted); order: -1; }
.ins-chg { font-size: .78rem; font-weight: 600; }
.ins-chg.up { color: var(--ok); } .ins-chg.down { color: var(--bad); }
.ins-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; }
.ins-chart h3, .ins-grid2 h3 { margin: 0; font-size: 1rem; }
.ins-plot { position: relative; }
.ins-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ins-bar { fill: var(--accent); }
.ins-grid { stroke: var(--line); stroke-width: 1; }
.ins-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ins-hit { fill: transparent; cursor: default; outline: none; }
.ins-hit:hover, .ins-hit:focus { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.ins-tip { position: absolute; top: -.4rem; transform: translate(-50%, -100%); background: var(--text); color: var(--bg); font-size: .8rem; padding: .3rem .55rem;
  border-radius: 6px; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); z-index: 2; }
.ins-tip[hidden] { display: none; }
.ins-table summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.ins-table table { margin-top: .4rem; font-size: .88rem; }
.ins-rank, .ins-funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.ins-rank li, .ins-funnel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "b b"; gap: .2rem .8rem; align-items: baseline; }
.ins-funnel li { grid-template-areas: "l v" "b b" "p p"; }
.ins-rl { grid-area: l; min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.ins-rv { grid-area: v; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .92rem; }
.ins-rb { grid-area: b; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.ins-rb i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.ins-pct { grid-area: p; }
.ins-cohort td, .ins-cohort th { white-space: nowrap; }
.ins-cell { background: color-mix(in srgb, var(--accent) var(--a), var(--surface)); }
.ins-cell.strong { color: var(--accent-ink); font-weight: 600; }   /* text on the darker cells */
/* near the daily AI limit: bring your own key */
.byo-hint { display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 .5rem; padding: .5rem .7rem; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: .85rem; line-height: 1.45; }
.byo-hint[hidden] { display: none; }
.byo-hint a { font-weight: 600; white-space: nowrap; }
.byo-hint > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.byo-x { flex: none; padding: 0 .35rem; line-height: 1.2; font-size: 1rem; }
.byo-sub { color: var(--muted); }
.byo-sub code { font-size: .8rem; padding: 0 .25rem; border-radius: 4px; background: var(--surface); color: var(--text); }
.byo-sub a { font-weight: 600; }
.nbody { white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
/* the live check under a custom name (Links and domains, Custom names) */
.name-says { display: block; margin-top: -.1rem; color: var(--muted); min-height: 1.2em; }
.name-says[data-s="ok"] { color: var(--ok); }
.name-says[data-s="bad"] { color: var(--bad); }
