/* Kivora workspace: the "Studio" look. One sidebar (base.html), calm neutral surfaces, one violet accent. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --side: #fbfbfa;
  --text: #17171a;
  --muted: #5f5f66;
  --border: #e7e6e2;
  --line: #efeeeb;
  --field: #dad9d4;
  --accent: #5847d8;
  --accent-text: #ffffff;
  --accent-soft: #eeedf9;
  --accent-strong: #2d2390;
  --danger: #b42318;
  --ok: #1d6b40;
  --ok-bg: #e7f4ec;
  --info-bg: #eeedf9;
  --warn-bg: #fff6e0;
  --warn-border: #ebcb7a;
  --error-bg: #fdecea;
  --error-border: #e7a39d;
  --radius: 12px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #17171b;
  --surface: #232329;
  --side: #1d1d22;
  --text: #f1f0f5;
  --muted: #b8b6c1;
  --border: #3a3943;
  --line: #33323a;
  --field: #504e5a;
  --accent: #9688ff;
  --accent-text: #15131e;
  --accent-soft: #322f51;
  --accent-strong: #c2baff;
  --danger: #ff9b90;
  --ok: #73d39c;
  --ok-bg: #1e3a2b;
  --info-bg: #302e4d;
  --warn-bg: #423719;
  --warn-border: #77612a;
  --error-bg: #482a2a;
  --error-border: #824744;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: #4b3bc9; }
a:hover { color: #36289c; }
h1 { font-size: 1.625rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 .5rem; }
h3 { font-size: .95rem; font-weight: 600; }
code { font-size: .85em; word-break: break-word; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* App frame: sidebar + page ------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; background: var(--side); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-logo { display: block; flex: none; width: 32px; height: 32px; object-fit: contain; }
.brand-studio { position: relative; top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; gap: 16px; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 0 8px 6px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 8px; border-radius: 7px;
  color: var(--text); text-decoration: none; }
.side-nav a:hover { background: #f0efec; color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
.side-nav svg { flex: none; }
.side-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; }
.side-nav .nav-count { margin-left: auto; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px;
  background: var(--avatar, #1d1d1f); color: #fff; font-size: 10px; font-weight: 700; }
.avatar.user { width: 30px; height: 30px; border-radius: 50%; background: #e3e1f7; color: var(--accent-strong); font-size: 12px; font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.side-foot .side-text { flex: 1; }
.side-foot a, .side-foot button.link { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.side-foot a:hover, .side-foot button.link:hover { color: var(--text); }

.page { min-width: 0; width: 100%; max-width: 1240px; padding: 22px clamp(16px, 3vw, 32px) 48px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }

@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-nav { order: 3; width: 100%; flex-direction: row; gap: 4px; overflow-x: auto; }
  .side-group { flex-direction: row; gap: 4px; }
  .side-label { display: none; }
  .side-nav a { white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-foot .avatar, .side-foot .side-text { display: none; }
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }.sidebar-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; }.sidebar-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: -22px clamp(-32px, -3vw, -16px) 20px; padding: 7px clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); }.topbar-title { color: var(--muted); font-size: 12px; font-weight: 500; }.topbar nav { display: flex; align-items: center; gap: 8px; }.topbar nav a, .topbar nav button.link { padding: 5px 9px; border-radius: 7px; color: var(--muted); font-size: 12px; text-decoration: none; }.topbar nav a:hover, .topbar nav button.link:hover { background: var(--accent-soft); color: var(--accent-strong); }.theme-toggle { display: grid; place-items: center; width: 31px; min-height: 31px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }.theme-toggle:hover { background: var(--accent-soft); color: var(--accent-strong); }
.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }.sidebar-collapsed .sidebar { padding-inline: 10px; }.sidebar-collapsed .brand-row { justify-content: center; }.sidebar-collapsed .brand { padding: 2px 0; }.sidebar-collapsed .brand:not(:has(.brand-mark)) { font-size: 0; }.sidebar-collapsed .brand { font-size: 0; }.sidebar-collapsed .sidebar-toggle { position: absolute; top: 18px; right: -10px; z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.12); }.sidebar-collapsed .side-label, .sidebar-collapsed .side-text { display: none; }.sidebar-collapsed .side-nav a { justify-content: center; padding-inline: 0; }.sidebar-collapsed .side-foot { justify-content: center; padding-inline: 0; }.sidebar-collapsed .side-foot .side-text { display: none; }
.topbar-user { display: inline-flex; align-items: center; gap: 6px; padding-right: 5px; color: var(--muted); font-size: 12px; }.topbar-user .avatar.user { width: 24px; height: 24px; font-size: 10px; }
.sidebar-collapsed .brand-name, .sidebar-collapsed .brand-studio { display: none; }
.sidebar-collapsed .sidebar { overflow-x: hidden; }.sidebar-collapsed .side-nav, .sidebar-collapsed .side-group { width: 100%; min-width: 0; }.sidebar-collapsed .side-nav a { min-width: 0; overflow: hidden; }.sidebar-collapsed .brand-row { min-width: 0; }
@media (max-width: 860px) { .brand-row { width: auto; }.sidebar-toggle { display: none; }.topbar { margin: -10px -16px 16px; }.sidebar-collapsed { display: block; }.sidebar-collapsed .side-text { display: inline; }.sidebar-collapsed .side-label { display: none; } }

/* Page heading and toolbar ------------------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 9px; background: #edece8; }
.segmented button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #4a4a50; font-size: 12.5px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.segmented button:hover { background: rgba(255, 255, 255, .6); }

/* Cards, forms, buttons ---------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; }
.card > h2:first-child { margin-top: 0; }
.narrow { max-width: 460px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-logo { display: block; width: 72px; height: 72px; margin: 0 0 14px; object-fit: contain; }

label { display: block; font-weight: 500; font-size: 13px; margin: .75rem 0 .3rem; }
label.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 38px; padding: .45rem .7rem; border: 1px solid var(--field); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=file] { max-width: 100%; font: inherit; }
.help { color: var(--muted); font-size: 12.5px; margin: .25rem 0 .5rem; }
.field-error { color: var(--danger); font-size: 13px; margin: .25rem 0; }
.req { color: var(--danger); }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: #f4f3f0; color: var(--text); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary:hover, .button.primary:hover { background: #4a3ac6; border-color: #4a3ac6; color: var(--accent-text); }
button.danger, .button.danger { color: var(--danger); border-color: #f0c4bf; background: var(--surface); }
button.danger:hover { background: #fdf1ef; }
button.small, .button.small { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
button.link { min-height: 0; border: 0; background: none; color: #4b3bc9; padding: 0; }
button.link:hover { background: none; text-decoration: underline; }
button.icon { width: 32px; min-height: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); }
button.icon:hover { background: #f0efec; color: var(--text); }
button.icon.danger:hover { background: #fdf1ef; color: var(--danger); }
button:disabled { opacity: .55; cursor: not-allowed; }
.wide { width: 100%; margin-top: 1.25rem; }
form.inline { display: inline; }

.notice { padding: .7rem 1rem; border-radius: 10px; margin: 0 0 14px; border: 1px solid var(--border); background: var(--surface); }
.notice.error { background: var(--error-bg); border-color: var(--error-border); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.notice.success { background: var(--ok-bg); border-color: #b9dfc8; }
.notice ul { margin: .4rem 0 0; padding-left: 1.2rem; }

/* Status pills: a dot and a word. */
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: #f0efec; color: #55555c; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.warn, .state-completed_no_file { background: var(--warn-bg); color: #7a5400; }
.state-completed, .badge.live { background: var(--ok-bg); color: var(--ok); }
.state-failed, .state-timed_out, .state-upload_abandoned { background: #fdecea; color: var(--danger); }
.state-cancelled, .badge.draft { background: #f0efec; color: #55555c; }
.state-uploading, .state-queued, .state-running { background: var(--info-bg); color: #3b2fb0; }

/* Tables ------------------------------------------------------------------------------------ */
.table-wrap { position: relative; overflow-x: auto; }
table.jobs { width: 100%; border-collapse: collapse; background: var(--surface); }
table.jobs th { padding: 10px 8px; color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
table.jobs td { padding: 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.jobs th:first-child, table.jobs td:first-child { padding-left: 14px; }
table.jobs th:last-child, table.jobs td:last-child { padding-right: 14px; }
table.jobs tbody tr:hover td { background: #fafaf9; }
table.jobs .num { text-align: right; font-variant-numeric: tabular-nums; }
img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 9px; display: block; background: #f4f3f0; }
table.jobs tr.fresh td { animation: fresh-row 2.5s ease-out; }
@keyframes fresh-row { from { background: var(--accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { table.jobs tr.fresh td { animation: none; } }
table.kv { border-collapse: collapse; width: 100%; }
table.kv th, table.kv td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv th { width: 30%; color: var(--muted); font-weight: 500; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.panel-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.panel-foot .grow { flex: 1; }

/* Inbox -------------------------------------------------------------------------------------- */
.inbox-compose { max-width: 680px; }
.inbox-compose textarea { resize: vertical; }
.inbox-compose button { margin-top: 14px; }
.inbox-list { max-width: 860px; }
.inbox-message { padding: 18px; border-bottom: 1px solid var(--line); }
.inbox-message:last-child { border-bottom: 0; }
.inbox-message.unread { border-left: 3px solid var(--accent); padding-left: 15px; background: #fcfbff; }
.inbox-message-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.inbox-message-head h2 { margin: 0; font-size: 15px; }
.inbox-message-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.inbox-body { margin-top: 12px; white-space: normal; }
.inbox-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 13px; }

/* Dark-theme surface adjustments for the neutral utility shades above. */
:root[data-theme="dark"] .side-nav a:hover, :root[data-theme="dark"] button:hover, :root[data-theme="dark"] .button:hover { background: #2d2c34; }
:root[data-theme="dark"] table.jobs tbody tr:hover td { background: #292831; }
:root[data-theme="dark"] .inbox-message.unread { background: #292640; }

/* History ------------------------------------------------------------------------------------ */
.job-cell { display: flex; align-items: center; gap: 12px; }
.job-cell a { color: var(--text); font-weight: 500; text-decoration: none; }
.job-cell a:hover { text-decoration: underline; }
.job-cell small { display: block; color: var(--muted); font-size: 12px; }
.job-thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9px; background: var(--accent-soft); color: #4b3bc9; flex: none; overflow: hidden; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; white-space: nowrap; }

/* Job page ---------------------------------------------------------------------------------- */
.job-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.job-head h1 { margin: 0; }
.inputs { display: flex; flex-wrap: wrap; gap: .75rem; }
.inputs figure { margin: 0; width: 140px; }
.inputs img { width: 140px; height: 140px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #f4f3f0; }
.inputs figcaption { text-align: center; font-size: 12.5px; color: var(--muted); }
model-viewer { width: 100%; height: min(70vh, 560px); background: #f4f3f0; border-radius: 10px; }
.viewer-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .75rem; }
.menu-use { display: grid; gap: .6rem; margin-top: 1rem; }
.menu-use form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.waiting { display: flex; align-items: center; gap: 1rem; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* New 3D model ------------------------------------------------------------------------------ */
.new-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.new-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.new-main > .card { margin: 0; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title h2 { margin: 0; font-size: 15px; }
.card-title span { color: var(--muted); font-size: 12px; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.photo-angles { flex: 1 1 280px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-slot { position: relative; flex: 1 1 280px; display: flex; flex-direction: column; margin: 0; border: 1.5px dashed #d4d2cc;
  border-radius: 12px; background: #fbfbfa; overflow: hidden; cursor: pointer; font-weight: 500; }
.photo-slot:hover { border-color: #b9b6ae; }
.photo-slot:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.photo-slot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-slot .preview { flex: 1; display: grid; place-items: center; min-height: 120px; color: var(--muted); font-size: 12.5px; text-align: center; padding: 8px; }
.photo-slot .preview img { width: 100%; height: 100%; max-height: 240px; object-fit: contain; }
.photo-slot.front .preview { min-height: 240px; }
.photo-slot:has(img) { border-style: solid; border-color: var(--field); background: #f4f3f0; }
.slot-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.slot-foot .grow { flex: 1; color: var(--muted); font-weight: 400; font-size: 12px; }
.slot-plus { display: grid; place-items: center; gap: 4px; }
.photo-hint { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
details.advanced { padding: 0 18px; }
details.advanced > summary { display: flex; align-items: center; gap: 10px; padding: 16px 0; cursor: pointer; list-style: none; }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary strong { flex: 1; font-size: 15px; font-weight: 600; }
details.advanced > summary span { color: var(--muted); font-size: 12.5px; }
details.advanced > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; }
details.advanced[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.adv-body { display: flex; flex-direction: column; gap: 16px; padding-bottom: 18px; }
.adv-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.summary { flex: 1 1 280px; max-width: 360px; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.summary h2 { margin: 0; font-size: 15px; }
.checklist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.checklist li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checklist li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #cfcdc7; box-sizing: border-box; }
.checklist li.done { color: var(--text); }
.checklist li.done::before { border: 0; background: #1f9d55 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.summary button.primary { min-height: 44px; font-size: 14px; font-weight: 600; border-radius: 10px; }
@media (max-width: 860px) { .summary { position: static; max-width: none; } }
.job-cell a, table.jobs .num, table.jobs .badge { white-space: nowrap; }
table.jobs.history { min-width: 620px; }

/* Tooltips: an "i" next to an option's name; its explanation shows on hover, keyboard focus or tap. */
.opt-label { position: relative; display: flex; align-items: center; gap: 6px; }
.opt-label label { margin: 0; }
.adv-numbers .opt-label { margin-bottom: 6px; }
.adv-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 24px; }
.adv-checks .opt-label { padding: 9px 0; border-top: 1px solid var(--line); }
.adv-checks label.check { font-weight: 400; }
button.tip { position: relative; flex: none; width: 18px; min-height: 18px; height: 18px; padding: 0; border: 1px solid #c9c7c1;
  border-radius: 50%; background: var(--surface); color: var(--muted); font: 600 11px/1 Geist, system-ui, sans-serif; cursor: help; }
button.tip:hover, button.tip:focus-visible, button.tip:focus { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
button.tip::after { content: attr(data-tip); display: none; position: absolute; z-index: 30; left: -10px; top: calc(100% + 8px);
  width: max-content; max-width: min(280px, 78vw); padding: 8px 10px; border-radius: 8px; background: #17171a; color: #fff;
  font: 400 12.5px/1.45 Geist, system-ui, sans-serif; text-align: left; white-space: normal; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
button.tip:hover::after, button.tip:focus-visible::after, button.tip.open::after { display: block; }
.adv-checks .opt-label:nth-child(even) button.tip::after, .adv-numbers > div:nth-child(n+4) button.tip::after { left: auto; right: -10px; }
@media (max-width: 600px) {   /* phones: the explanation is a strip along the bottom of the screen */
  button.tip::after, .adv-checks .opt-label:nth-child(even) button.tip::after, .adv-numbers > div:nth-child(n+4) button.tip::after {
    position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-width: none; }
}
