/* lowtide admin: a desktop workspace (sidebar, pages, tables), light and neutral like the tools staff already use.
   Self-contained: it doesn't load the app's stylesheet. */
@font-face { font-family: "Instrument Sans"; src: url("/fonts/InstrumentSans.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
:root {
  --bg: #F6F7F9; --surface: #FFFFFF; --tile: #F2F3F6; --hover: #F4F5F8; --line: #E6E8EC; --line-strong: #D5D8DE;
  --text: #111827; --muted: #6B7280; --faint: #9CA3AF;
  --accent: #2348FF; --accent-text: #FFFFFF; --accent-soft: #EEF1FF; --dark: #111827;
  --ok: #15803D; --ok-soft: #E8F6EE; --warn: #B45309; --warn-soft: #FEF3E2; --error: #DC2626; --error-soft: #FDECEC;
  --lime: #B6FF00; --on-lime: #182300;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.05); --shadow-pop: 0 12px 32px rgb(16 24 40 / 0.14), 0 2px 6px rgb(16 24 40 / 0.06);
  --r: 12px; --side: 248px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Instrument Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
pre { margin: 0; }

/* ---------- shell: sidebar + page ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.side-brand:hover { text-decoration: none; }
.side-ws { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 10px; box-shadow: var(--shadow); }
.ws-avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #2348FF, #7C3AED); color: #fff; font-weight: 700; }
.side-ws small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.side-ws b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.side-h { margin: 14px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: #374151; font-size: 14px; }
.side nav button svg { width: 18px; height: 18px; flex: none; color: #6B7280; }
.side nav button:hover { background: var(--hover); }
.side nav button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side nav button[aria-selected="true"] svg { color: var(--accent); }
.side-foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--muted); }
.main { min-width: 0; }
.wrap { max-width: 1600px; margin: 0 auto; padding: 24px 24px 48px; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h1 { font-size: 22px; font-weight: 700; }
.page-h .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 9px; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: #1B3AE0; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.dark:hover { background: #000; }
.btn:disabled { opacity: 0.45; cursor: default; }
select, input:not([type="checkbox"]):not([type="radio"]), textarea { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 9px; padding: 7px 10px; font-size: 13px; outline: none; }
select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236B7280' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 9px center / 14px; cursor: pointer; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.muted, .muted { color: var(--muted); font-size: 13px; }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-pop); z-index: 100; }

/* ---------- cards, tables, KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.cards { display: flex; flex-direction: column; gap: 12px; }
.card h3 { font-size: 15px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 10px; }
.cols h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.cols ul { margin: 0; padding-left: 18px; }
.cols a { overflow-wrap: anywhere; }
.addr { white-space: pre-line; }
.events { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; padding-left: 16px; }
.events li { margin: 2px 0; }
.mail-text { white-space: pre-wrap; font-size: 12px; max-height: 220px; overflow: auto; background: var(--tile); border-radius: 8px; padding: 8px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; box-shadow: var(--shadow); }
table.users { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.users th { text-align: left; font-weight: 500; color: var(--muted); background: #FAFAFB; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
table.users td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.users tr:last-child td { border-bottom: 0; }
.rtable tbody tr { cursor: pointer; }
.rtable tbody tr:hover td { background: var(--hover); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.kpi span { font-size: 12px; color: var(--muted); }
.rgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.rgrid .card h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.bars { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bars div { display: grid; grid-template-columns: 1fr auto; gap: 8px; position: relative; padding: 3px 8px; border-radius: 6px; overflow: hidden; }
.bars div i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); z-index: 0; }
.bars div span, .bars div b { position: relative; z-index: 1; overflow-wrap: anywhere; }
.rh { margin: 22px 0 10px; font-size: 15px; font-weight: 600; }
.status { display: inline-block; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 10px; background: var(--tile); color: #374151; white-space: nowrap; }
.status.s-invoiced, .status.s-shipping_invoiced { background: var(--accent-soft); color: var(--accent); }
.status.s-delivered, .status.s-paid, .status.s-shipping_paid { background: var(--ok-soft); color: var(--ok); }
.status.s-cancelled { color: var(--faint); }
.o-answered { color: var(--ok); } .o-error, .o-stopped { color: var(--error); } .o-no_result, .o-no_offers { color: var(--warn); }
.st-verified { color: var(--ok); } .st-rejected { color: var(--faint); } .st-unreadable { color: var(--warn); }
.chk-ok { color: var(--ok); } .chk-bad { color: var(--error); }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgb(17 24 39 / 0.35); }
dialog.rdetail { width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.rd-body { padding: 20px 22px; font-size: 13.5px; }
.rd-body h3 { font-size: 17px; }
.rd-body h4 { margin: 16px 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.rd-body pre { white-space: pre-wrap; background: var(--tile); border-radius: 8px; padding: 10px; max-height: 280px; overflow: auto; font-size: 12px; }
.rd-body table { font-size: 12.5px; }

/* ---------- playbook editor: prompt | settings | test ---------- */
.pb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pb-top h1 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.pb-badge { font-size: 11px; font-weight: 700; background: var(--lime); color: var(--on-lime); border-radius: 999px; padding: 2px 8px; letter-spacing: 0.02em; }
.pb-badge.draft { background: var(--warn-soft); color: var(--warn); }
.pb-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.pb-meta b { color: var(--text); font-weight: 600; text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.pb-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px 340px; gap: 14px; align-items: start; }
#tab-playbook { margin: -8px -8px 0; }
@media (max-width: 1360px) { :root { --side: 216px; } }
@media (max-width: 1180px) { .pb-cols { grid-template-columns: minmax(0, 1fr) 300px; } .pb-test { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .pb-cols { grid-template-columns: 1fr; } }
.pb-main { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.pb-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.model-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 10px 5px 8px; cursor: pointer; font-size: 13px; box-shadow: var(--shadow); max-width: 260px; }
.model-pill:hover { background: var(--hover); }
.model-pill.is-default { border-style: dashed; box-shadow: none; }
.model-pill .name { max-width: 150px; }
.model-pill .role { color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.model-pill .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pill .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; }
.model-pop { position: absolute; z-index: 60; width: 380px; max-height: 440px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden; }
.model-pop input { margin: 10px; }
.model-pop .list { overflow-y: auto; padding: 0 6px 6px; }
.model-pop .grp { padding: 8px 8px 4px; font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.model-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 8px; border-radius: 8px; text-align: left; cursor: pointer; font-size: 13px; }
.model-pop button:hover, .model-pop button[aria-selected="true"] { background: var(--hover); }
.model-pop .tag { font-size: 11px; background: var(--tile); color: var(--muted); border-radius: 6px; padding: 1px 6px; }
.model-pop .price { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.pb-jump { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #FAFAFB; }
.pb-jump button { border: 1px solid transparent; background: none; color: var(--muted); border-radius: 7px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.pb-jump button:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
textarea#pbBody { display: block; width: 100%; min-height: calc(100vh - 330px); border: 0; border-radius: 0; resize: vertical; padding: 16px 18px; font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); tab-size: 2; box-shadow: none; }
textarea#pbBody:focus { box-shadow: none; }
.pb-savebar { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: #FAFAFB; align-items: start; }
.pb-savebar textarea { min-height: 36px; resize: vertical; }
.pb-err { grid-column: 1 / -1; color: var(--error); font-size: 12.5px; white-space: pre-line; }
.pb-err:empty { display: none; }
.pb-side { display: flex; flex-direction: column; gap: 10px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: var(--text); font-weight: 600; font-size: 13.5px; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; margin-right: 4px; }
.panel[open] > summary::after { transform: rotate(-135deg); }
.panel > summary .sum-icon { display: inline-flex; align-items: center; gap: 8px; }
.panel > summary svg { width: 16px; height: 16px; color: var(--muted); }
.panel-body { padding: 0 14px 14px; }
.pb-versions { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow: auto; }
.pb-versions button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.pb-versions button:hover { background: var(--hover); }
.pb-versions button[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pb-versions small { display: block; color: var(--muted); font-size: 12px; }
.diff { font: 11.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; background: var(--tile); border-radius: 8px; padding: 8px; max-height: 50vh; overflow: auto; }
.diff .d-add { background: #DCFCE7; display: block; }
.diff .d-del { background: #FEE2E2; display: block; text-decoration: line-through; }
.diff .d-skip { color: var(--faint); display: block; }

/* Try a query: a live check on this version, streamed like the app */
.pb-test { padding: 0; display: flex; flex-direction: column; min-height: 420px; max-height: calc(100vh - 170px); position: sticky; top: 16px; }
.pb-test-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pb-test-h h3 { font-size: 14px; }
.seg { display: inline-flex; background: var(--tile); border-radius: 9px; padding: 3px; }
.seg span { padding: 4px 10px; border-radius: 7px; font-size: 12.5px; color: var(--muted); }
.seg span.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }
.tq-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #FAFAFB; }
.tq-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; max-width: 240px; }
.tq-empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.tq-user { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; padding: 7px 12px; max-width: 85%; font-size: 13px; }
.tq-steps { font-size: 12px; color: var(--muted); border-left: 2px solid var(--line-strong); padding-left: 10px; display: flex; flex-direction: column; gap: 2px; }
.tq-bot { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 12px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tq-meta { font-size: 11.5px; color: var(--faint); }
.tq-bot { white-space: normal; }
.tq-bot > div { margin: 2px 0; }
.tq-h { font-weight: 600; margin-top: 8px !important; }
.tq-table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 11.5px; }
.tq-table th, .tq-table td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.tq-table th { color: var(--muted); font-weight: 500; }
.tq-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.tq-form select { width: 74px; flex: none; }
.tq-form input { flex: 1; min-width: 0; }

/* ratings, suggestions, case form */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips label { border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; background: var(--surface); }
.chips input { margin-right: 4px; }
.rate-up[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.rate-down[aria-pressed="true"] { background: var(--error); border-color: var(--error); color: #fff; }
.suggest { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: var(--surface); }
.case-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.case-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.case-form .cols { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 0; }

/* ---------- orders (Shopify-style list and order page) ---------- */
.nowrap { white-space: nowrap; }
.btn.icon { padding: 6px 9px; min-width: 32px; justify-content: center; }
.btn.link { border: 0; background: none; box-shadow: none; color: var(--accent); padding: 0; }
.chip { display: inline-block; font-size: 11.5px; background: var(--tile); border-radius: 6px; padding: 1px 7px; color: #374151; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; flex: none; }
.tone-wait { background: #FFF4CC; color: #7A5A00; }
.tone-attn { background: #FFE4CC; color: #8A4B00; }
.tone-act { background: #E0E7FF; color: #2F3FB7; }
.tone-info { background: #E0F2FE; color: #075985; }
.tone-done { background: #E7F6EC; color: #166534; }
.tone-off { background: var(--tile); color: #4B5563; }
.okpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
@media (max-width: 1100px) { .okpis { grid-template-columns: repeat(3, 1fr); } }
.okpi { display: flex; flex-direction: column; gap: 1px; text-align: left; border: 0; border-right: 1px solid var(--line); background: none; padding: 12px 16px; cursor: pointer; }
.okpi:last-child { border-right: 0; }
.okpi:hover { background: var(--hover); }
.okpi.on { background: var(--accent-soft); }
.okpi span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.okpi b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.okpi small { font-size: 11.5px; color: var(--faint); }
.o-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.o-views { display: flex; gap: 2px; flex-wrap: wrap; }
.o-views button { border: 0; background: none; border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; color: #374151; }
.o-views button:hover { background: var(--hover); }
.o-views button[aria-selected="true"] { background: var(--tile); font-weight: 600; color: var(--text); }
.o-views button span { color: var(--faint); font-weight: 500; margin-left: 2px; }
.o-bar input { width: 280px; max-width: 100%; }
.otable td { vertical-align: middle; }
.otable tbody tr { cursor: pointer; }
.otable tbody tr:hover td { background: var(--hover); }
.otable tr.o-cancelled td { color: var(--faint); text-decoration: line-through; }
.o-item { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.o-item img, .o-thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: contain; background: var(--tile); border: 1px solid var(--line); flex: none; }
.o-thumb.big, .od-item img { width: 56px; height: 56px; }
.od-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.od-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.od-title h1 { font-size: 22px; margin-right: 4px; }
.od-h .sub { color: var(--muted); font-size: 13px; margin: 4px 0 0 44px; }
.od-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; max-width: 1180px; }
@media (max-width: 980px) { .od-cols { grid-template-columns: 1fr; } }
.od-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.od-main .rh { margin: 8px 0 0; }
.od-next { background: var(--accent-soft); color: #1E2A7A; border-radius: var(--r); padding: 10px 14px; font-size: 13.5px; }
.od-next b { margin-right: 6px; }
.od-card { padding: 12px; }
.od-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.od-items { border: 1px solid var(--line); border-radius: 10px; }
.od-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.od-item:last-child { border-bottom: 0; }
.od-item a { font-weight: 600; color: var(--text); }
.pay-inv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pay-inv.void { opacity: 0.55; }
.pay-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13.5px; align-items: center; }
.pay-row.total { font-weight: 700; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; }
.pay-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pay-new { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; }
.tl-box { padding: 10px 12px; }
.tl-new { display: flex; gap: 10px; align-items: center; }
.tl-new input { flex: 1; border: 0; box-shadow: none !important; padding: 8px 4px; }
.ws-avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; background: #16A34A; }
.timeline { list-style: none; margin: 6px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); margin-left: 15px; }
.timeline li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -28px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #9CA3AF; border: 2px solid var(--bg); }
.timeline li time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.timeline li.tl-day { color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 12px; }
.timeline li.tl-day::before { display: none; }
.timeline li.tl-comment span { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.od-side { display: flex; flex-direction: column; gap: 12px; }
.od-side .card h4 { margin: 12px 0 4px; font-size: 13px; font-weight: 600; }
.od-side .card h4:first-child, .od-side-h h4 { margin-top: 0 !important; }
.od-side-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* Users: a person's conversation with lowtide, their messages on the left and lowtide's answers on the right. */
table.rows tbody tr { cursor: pointer; }
table.rows tbody tr:hover td { background: var(--hover); }
.chat-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chat-h h1 { font-size: 22px; }
.chat-h .sub { color: var(--muted); font-size: 13px; width: 100%; }
.chat { display: flex; flex-direction: column; gap: 8px; max-width: 820px; }
.chat .day { align-self: center; color: var(--faint); font-size: 12px; margin: 10px 0 2px; }
.chat .thread { margin: 14px 0 4px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.chat .thread b { font-weight: 600; }
.cm { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.cm.in { align-self: flex-start; }
.cm.out { align-self: flex-end; align-items: flex-end; }
.cm .bub { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm.in .bub { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.cm.out .bub { background: var(--accent-soft); color: #1E2A7A; border-bottom-right-radius: 4px; }
.cm.out .bub.err { background: var(--error-soft); color: var(--error); }
.cm .meta { color: var(--faint); font-size: 11.5px; padding: 0 4px; }
.cm .meta b { font-weight: 500; color: var(--muted); }
.cm .offer { display: block; margin-top: 6px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 13px; }
.cm .offer small { color: var(--muted); display: block; }
.cm .photos { display: flex; gap: 6px; flex-wrap: wrap; }
.cm .photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.chat .empty { color: var(--muted); padding: 24px 0; }

/* Tests: per-run overrides (models, effort, mode) */
.t-opts { margin: -6px 0 14px; font-size: 13px; }
.t-opts summary { cursor: pointer; color: var(--muted); }
.t-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 14px; margin-top: 10px; }
.t-grid label { display: grid; grid-template-columns: 56px 1fr 92px; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.t-grid input, .t-grid select { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); min-width: 0; }
.t-mode { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.t-mode input, .t-mode select { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); }
.cfg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted); }

/* Bench */
.bench-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 900px) { .bench-grid { grid-template-columns: 1fr; } }
.bench-h { margin: 0 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.bench-scatter svg { width: 100%; height: auto; display: block; }
.bench-scatter .dot { cursor: pointer; }
.bench-scatter .dot:hover circle, .bench-scatter .dot[aria-selected="true"] circle { stroke: var(--text); stroke-width: 2; }
.bench-scatter text { font-size: 11px; fill: var(--muted); }
.bench-scatter .axis { stroke: var(--line-strong); }
.bench-scatter .grid { stroke: var(--line); }
.bench-table td { white-space: nowrap; }
.bench-table tr[aria-selected="true"] td { background: var(--accent-soft); }
.bench-table .ref { color: var(--accent); font-weight: 600; }
.range { color: var(--faint); font-size: 11px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 110px; gap: 8px; align-items: center; font-size: 12px; margin: 4px 0; }
.bar-row .bars { display: flex; height: 8px; background: var(--tile); border-radius: 4px; overflow: hidden; }
.bar-row .bars i { display: block; height: 100%; }
.bar-row .b1 { background: var(--line-strong); } .bar-row .b2 { background: var(--accent); opacity: 0.5; } .bar-row .b3 { background: var(--ok); }
