/* Ora in NOVA's "Dimension" system (deskwithnova.com): dusk-lit, graphite panels with a faint light edge,
   DM Sans at quiet medium weights, white pills for the one action, a floating frosted pill nav. Dark first; the light
   theme mirrors it in bone and white. Mint means live or good, soft red means stop or bad; nothing else is coloured. */

:root {
  --canvas: #0a0a0a; --panel: #161616; --raised: #1d1d1d; --glass: rgba(212, 212, 212, .08); --glass-hover: rgba(212, 212, 212, .13);
  --edge: rgba(229, 229, 229, .14); --edge-soft: rgba(229, 229, 229, .07); --edge-strong: rgba(229, 229, 229, .26);
  --bone: #ededed; --ash: #c2c2c2; --slate: #9c9c9c;
  --pill: #ffffff; --pill-ink: #161616; --pill-hover: #e6e6e6;
  --mint: #8fe0bd; --mint-bg: rgba(47, 125, 98, .22); --mint-edge: rgba(143, 224, 189, .3);
  --rose: #ffb4b4; --rose-bg: rgba(150, 45, 45, .24); --rose-edge: rgba(255, 180, 180, .28);
  --amber: #f3cf8e; --amber-bg: rgba(150, 105, 25, .24); --amber-edge: rgba(243, 207, 142, .28);
  --glow: rgba(230, 230, 235, .17); --glow-2: rgba(120, 120, 130, .06);
  --nav-bg: rgba(22, 22, 22, .7); --nav-shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --radius: 24px; --radius-md: 18px; --radius-sm: 12px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
/* light is a choice (the theme button in the nav), not the system default: NOVA is dusk-lit like deskwithnova.com */
:root[data-theme="light"] {
    --canvas: #efefed; --panel: #ffffff; --raised: #f6f6f4; --glass: rgba(17, 17, 17, .05); --glass-hover: rgba(17, 17, 17, .08);
    --edge: rgba(17, 17, 17, .11); --edge-soft: rgba(17, 17, 17, .07); --edge-strong: rgba(17, 17, 17, .24);
    --bone: #111111; --ash: #3d3d3d; --slate: #63635f;
    --pill: #161616; --pill-ink: #ffffff; --pill-hover: #333333;
    --mint: #1d7350; --mint-bg: rgba(47, 125, 98, .12); --mint-edge: rgba(29, 115, 80, .28);
    --rose: #a8261f; --rose-bg: rgba(200, 50, 40, .09); --rose-edge: rgba(168, 38, 31, .25);
    --amber: #8a5a07; --amber-bg: rgba(200, 140, 20, .12); --amber-edge: rgba(138, 90, 7, .25);
    --glow: rgba(255, 255, 255, .9); --glow-2: rgba(255, 255, 255, .3);
    --nav-bg: rgba(255, 255, 255, .78); --nav-shadow: 0 10px 40px rgba(0, 0, 0, .08);
    color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100svh; background: var(--canvas); color: var(--bone); font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: clip; position: relative; isolation: isolate; }
/* the dusk glow: behind the work, never on it */
body::before { content: ""; position: fixed; left: 50%; top: -12vh; width: min(1500px, 130vw); height: 78vh; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), var(--glow-2) 55%, transparent); pointer-events: none; z-index: -1; } /* taste-skill-ignore: NOVA Dimension's dusk glow, a brand commitment */
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.025em; line-height: 1.15; text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--bone); color: var(--canvas); }
input, textarea { caret-color: var(--bone); }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; border-radius: 12px; }
* { scrollbar-width: thin; scrollbar-color: var(--edge-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--edge-strong); border-radius: 9999px; border: 3px solid transparent; background-clip: padding-box; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--slate); }
.ash { color: var(--ash); }
.small { font-size: 13px; line-height: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- the floating pill nav ---------- */
.topbar { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 30; width: max-content; max-width: calc(100vw - 32px); }
.navpill { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 18px; border-radius: 22px; background: var(--nav-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--edge), var(--nav-shadow); }
.word { display: inline-flex; align-items: center; gap: 9px; margin-right: 12px; font-weight: 600; letter-spacing: .05em; font-size: 15px; text-decoration: none; white-space: nowrap; }
.word span { font-weight: 500; letter-spacing: 0; color: var(--slate); }
.nav { display: flex; gap: 2px; }
.nav a { font-size: 14px; color: var(--ash); text-decoration: none; padding: 8px 14px; border-radius: 9999px; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { background: var(--glass); color: var(--bone); }
.nav a[aria-current="page"] { background: var(--glass-hover); color: var(--bone); }
.scope select { height: 36px; max-width: 200px; margin-left: 6px; padding: 0 30px 0 14px; border: 0; border-radius: 9999px; background-color: var(--glass);
  box-shadow: inset 0 0 0 1px var(--edge); font-size: 14px; font-weight: 500; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); /* taste-skill-ignore: draws the select chevron, not a gradient fill */
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.scope select option { background: var(--panel); color: var(--bone); }
.who { font-size: 13px; color: var(--slate); padding: 0 8px 0 10px; white-space: nowrap; }
.menu-toggle { display: none !important; }
.theme-in-nav { display: none !important; }

.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 96px 24px 64px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.title-row h1 { font-size: 32px; letter-spacing: -.035em; line-height: 1.08; }
.title-row .sub { margin-top: 10px; color: var(--ash); max-width: 72ch; font-size: 16px; }
.title-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- panels ---------- */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--edge); min-width: 0; }
.card-pad { padding: 24px 26px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.card-head h2 { font-size: 18px; }
.card-head .meta { color: var(--slate); font-size: 13px; }
.card-body { padding: 16px 24px 24px; }
.well { background: var(--glass); border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--edge-soft); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px; border: 0; border-radius: 9999px;
  background: var(--pill); color: var(--pill-ink); font-weight: 500; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .15s var(--ease), opacity .15s; }
.btn:hover { background: var(--pill-hover); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1px var(--edge); }
.btn.ghost:hover { background: var(--glass); }
.btn.stop { background: transparent; color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose-edge); }
.btn.stop:hover { background: var(--rose-bg); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.theme { width: 36px; padding: 0; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.link { height: auto; padding: 0; background: none; color: var(--bone); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--edge-strong); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; font-weight: 500; color: var(--ash); }
.field .help { color: var(--slate); font-size: 13px; line-height: 18px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=time], input[type=search], select.input, textarea {
  width: 100%; height: 44px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge);
  transition: box-shadow .15s, background .15s; }
textarea { height: auto; min-height: 96px; padding: 12px 16px; line-height: 22px; resize: vertical; }
input:hover, textarea:hover { box-shadow: inset 0 0 0 1px var(--edge-strong); }
input:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--bone); background: var(--glass-hover); }
input::placeholder, textarea::placeholder { color: var(--slate); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ash); font-size: 14px; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--bone); }

.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: 9999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge-soft); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 9999px; background: none; color: var(--ash); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--bone); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--pill); color: var(--pill-ink); }
.segmented .count { opacity: .7; margin-left: 4px; }

/* ---------- chips and rows ---------- */
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 9999px; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; color: var(--ash); background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge); }
.chip.good { color: var(--mint); background: var(--mint-bg); box-shadow: inset 0 0 0 1px var(--mint-edge); }
.chip.bad { color: var(--rose); background: var(--rose-bg); box-shadow: inset 0 0 0 1px var(--rose-edge); }
.chip.wait { color: var(--amber); background: var(--amber-bg); box-shadow: inset 0 0 0 1px var(--amber-edge); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slate); flex: none; }
.dot.live { background: var(--mint); box-shadow: 0 0 0 4px var(--mint-bg); animation: breathe 2.4s var(--ease) infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px transparent; } }
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.rows > .row + .row { border-top: 1px solid var(--edge-soft); }
.row .grow { flex: 1; min-width: 0; }
.line2 { color: var(--slate); font-size: 13px; line-height: 18px; margin-top: 2px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 400; font-size: 13px; color: var(--slate); padding: 0 10px 10px; white-space: nowrap; }
td { padding: 14px 10px; border-top: 1px solid var(--edge-soft); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }

/* ---------- states ---------- */
.empty { display: grid; place-items: center; gap: 6px; padding: 28px 20px; border-radius: var(--radius-md); background: var(--glass);
  color: var(--slate); text-align: center; grid-column: 1 / -1; }
.empty strong { color: var(--bone); font-weight: 500; font-size: 16px; }
.status { color: var(--slate); font-size: 14px; }
.status:empty { display: none; }
.status.err { color: var(--rose); }
.status.ok { color: var(--mint); }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-edge); }
.secret { display: grid; gap: 10px; margin-top: 14px; padding: 16px; border-radius: var(--radius-md); background: var(--amber-bg); box-shadow: inset 0 0 0 1px var(--amber-edge); color: var(--amber); }
.secret code { display: block; padding: 10px 12px; border-radius: 10px; background: var(--canvas); color: var(--bone); font: 13px/20px ui-monospace, Consolas, monospace; word-break: break-all; }
.skeleton { background: var(--glass); border-radius: 8px; }

/* ---------- settings rows ---------- */
.setting { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 20px 48px; padding: 32px 0; }
.setting + .setting { border-top: 1px solid var(--edge-soft); }
.setting > header h2 { font-size: 20px; letter-spacing: -.03em; }
.setting > header p { margin-top: 8px; color: var(--slate); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; } }

/* ---------- smaller screens: the pill nav folds into a menu ---------- */
@media (max-width: 960px) {
  .topbar { left: 16px; right: 16px; transform: none; width: auto; }
  .navpill { padding-left: 16px; }
  .nav { display: none; }
  .menu-toggle { display: inline-flex !important; margin-left: auto; }
  .who { display: none; }
  .navpill > .theme { display: none; }
  .topbar.open .nav .theme-in-nav { display: block !important; }
  .topbar.open .nav { display: grid; position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 8px; border-radius: 22px; background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--edge), var(--nav-shadow); }
  .topbar.open .nav a { padding: 13px 16px; font-size: 16px; }
  .setting { grid-template-columns: 1fr; gap: 16px; padding: 26px 0; }
  .page { padding-top: 88px; }
}
@media (max-width: 560px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .word span { display: none; }
  .scope select { max-width: 140px; margin-left: 0; }
  .title-row h1 { font-size: 28px; }
  .btn { height: 44px; }
  .btn.sm { height: 38px; }
}

/* ---------- phones: a bottom tab bar in thumb reach, clear of the home indicator ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topbar { top: calc(12px + env(safe-area-inset-top)); }
  .page { padding-top: calc(84px + env(safe-area-inset-top)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .menu-toggle { display: inline-flex !important; margin-left: auto; }  /* the tab bar has the five places; the menu keeps sign out, theme and NOVA admin */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--panel); box-shadow: inset 0 1px 0 var(--edge); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 3px; padding: 6px 0 4px; min-height: 48px; border: 0; background: none;
    color: var(--slate); font: inherit; font-size: 11px; font-weight: 500; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; border-radius: 14px; transition: color var(--t-hover, .15s) ease; }
  .tabbar a[aria-current="page"] { color: var(--bone); }
  .tabbar a:active, .tabbar button:active { background: var(--glass); }
  .tabbar a:focus-visible, .tabbar button:focus-visible { outline: 1.5px solid var(--bone); outline-offset: -2px; }
}
@media (display-mode: standalone) { body { -webkit-user-select: none; user-select: none; } input, textarea, .transcript, p { -webkit-user-select: text; user-select: text; } }

/* ---------- the same components under the names the other screens use ---------- */
:root {
  --text: var(--bone); --muted: var(--slate); --faint: var(--slate); --border: var(--edge); --rule: var(--edge-soft); --surface: var(--panel);
  --active: var(--glass-hover); --control: var(--edge-strong); --primary: var(--pill); --on-primary: var(--pill-ink);
  --accent: var(--mint); --accent-soft: var(--mint-bg); --positive: var(--mint); --negative: var(--rose);
  --radius-card: var(--radius); --radius-control: 14px; --radius-chip: 9999px; --gap: 16px; --card-pad: 24px;
  --field-height: 44px; --control-height: 40px; --fs-small: 13px; --fs-section: 18px; --fs-body: 15px;
  --pill-warning-bg: var(--amber-bg); --pill-warning-ink: var(--amber); --notice-border: var(--amber-edge);
}
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--edge); min-width: 0; }
.panel-pad { padding: 24px 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 4px; min-height: 0; border: 0; }
.panel-head h2 { font-size: 18px; }
.panel-head .meta { color: var(--slate); font-size: 13px; }
.panel-body { padding: 14px 24px 24px; }
h2.section, h3.section { font-size: 16px; font-weight: 500; }
.btn.primary { background: var(--pill); color: var(--pill-ink); }
.btn.outline { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1px var(--edge); }
.btn.outline:hover { background: var(--glass); }
.btn.danger { background: transparent; color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose-edge); }
.btn.danger:hover { background: var(--rose-bg); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.text { height: auto; padding: 0; background: none; color: var(--bone); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--edge-strong); }
.btn.block { width: 100%; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 9999px; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; color: var(--ash); background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge); }
.pill.good, .pill.data { color: var(--mint); background: var(--mint-bg); box-shadow: inset 0 0 0 1px var(--mint-edge); }
.pill.bad { color: var(--rose); background: var(--rose-bg); box-shadow: inset 0 0 0 1px var(--rose-edge); }
.pill.wait { color: var(--amber); background: var(--amber-bg); box-shadow: inset 0 0 0 1px var(--amber-edge); }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 9999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--edge-soft); }
.tabs button { height: 32px; padding: 0 14px; border: 0; border-radius: 9999px; background: none; color: var(--ash); font-weight: 500; font-size: 13px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--pill); color: var(--pill-ink); }
select.input, .picker select, .call-tools select { appearance: none; }
.picker select { height: 40px; padding: 0 34px 0 16px; border: 0; border-radius: 9999px; background-color: var(--glass); box-shadow: inset 0 0 0 1px var(--edge);
  background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); /* taste-skill-ignore: draws the select chevron, not a gradient fill */
  background-position: calc(100% - 19px) 18px, calc(100% - 14px) 18px; background-size: 5px 5px; background-repeat: no-repeat; font-weight: 500; cursor: pointer; }
.picker select option, select.input option { background: var(--panel); }
select.input { padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); /* taste-skill-ignore: draws the select chevron, not a gradient fill */
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* readable measure for prose inside wide panels */
.setting .panel p, .setting .panel .line2, .setting details p, .about { max-width: 600px; }
.setting .panel .line2 { max-width: 500px; }
