/* Voptrack Console. Local assets, semantic HTML and CSS; no scripts. */
:root {
  color-scheme: light;
  --ink: #202724; --muted: #616b66; --line: #e3e7e4;
  --bg: #ffffff; --card: #ffffff; --subtle: #f6f8f6; --sidebar: #f7f9f7;
  --accent: #176b56; --accent-soft: #e8f2ec; --button: #253d33; --button-ink: #fff;
  --warn: #78500d; --warnbg: #fff7e5; --danger: #ad352e;
  --focus: #227b63; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e9eeeb; --muted: #a7b4ac; --line: #303c35;
    --bg: #151b18; --card: #1a221d; --subtle: #202a23; --sidebar: #18201b;
    --accent: #93d9b6; --accent-soft: #293e31; --button: #b5ddc6; --button-ink: #18261d;
    --warn: #edcf91; --warnbg: #342b1b; --danger: #aa3d35; --focus: #9ce0bd;
  }
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: absolute; z-index: 50; top: .5rem; left: 1rem; padding: .7rem 1rem; border-radius: 6px; background: var(--card); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.sidebar { grid-row: 1 / 3; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 1.75rem; padding: 1.75rem 1rem; border-right: 1px solid var(--line); background: var(--sidebar); }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--ink); font-weight: 720; font-size: 1.2rem; letter-spacing: -.045em; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--button-ink); background: var(--button); font-size: 1.5rem; line-height: 1; font-weight: 650; letter-spacing: -.07em; padding-right: 2px; }
.sidebar .brand { padding: 0 .65rem; }
.workspace-name { padding: 0 .7rem; color: var(--muted); font-size: .75rem; letter-spacing: .025em; }
.sidebar-foot { margin-top: auto; padding: .75rem; color: var(--muted); font-size: .75rem; line-height: 1.65; border-top: 1px solid var(--line); }
.desktop-nav { display: flex; flex-direction: column; gap: .3rem; }
.desktop-nav a, .mobile-nav nav a { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .6rem .8rem; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.desktop-nav a:hover, .mobile-nav nav a:hover { background: var(--subtle); color: var(--ink); }
.desktop-nav a[aria-current="page"], .mobile-nav nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-icon { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
header.bar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; padding: .75rem 2.5rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.app-shell header.bar { grid-column: 2; }
.signed-in .header-brand { display: none; }
.workspace-label { color: var(--muted); font-size: .8rem; }
.tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .3rem 1.1rem; }
.language-menu { position: relative; margin: 0; }
.language-menu summary { display: flex; gap: .4rem; align-items: center; min-height: 44px; padding: .4rem .6rem; color: var(--muted); border-radius: 6px; font-size: .8rem; list-style: none; }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after { content: "⌄"; }
.language-menu[open] summary { background: var(--subtle); }
.language-code { text-transform: uppercase; font-weight: 600; }
.langs { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 44px); gap: .25rem; padding: .5rem; border: 1px solid var(--line); border-radius: 9px; background: var(--card); box-shadow: 0 8px 28px #00000012; }
.language-menu:not([open]) .langs { display: none; }
.langs a { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; color: var(--muted); border-radius: 5px; font-size: .8rem; text-transform: uppercase; text-decoration: none; }
.langs a:hover { background: var(--subtle); }
.langs a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mobile-nav { display: none; }
main { min-width: 0; width: 100%; max-width: 1440px; margin: 0 auto; padding: 2.5rem 2.5rem 5rem; }
.app-shell main { grid-column: 2; }
.public-shell main { max-width: 1180px; }
h1 { margin: 0 0 1rem; font-size: clamp(1.65rem, 2.6vw, 2rem); font-weight: 650; line-height: 1.25; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { margin: 0 0 .85rem; font-size: 1.1rem; font-weight: 650; line-height: 1.4; letter-spacing: -.015em; overflow-wrap: anywhere; }
h3 { margin: 1.4rem 0 .6rem; color: var(--muted); font-size: .82rem; font-weight: 550; }
p { margin: .75rem 0 1.25rem; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
main > h1 + p.muted { max-width: 70ch; margin-top: -.25rem; }
main > p:first-child:has(> a) { margin-top: 0; font-size: .85rem; }
.notice { padding: 1rem 1.2rem; border: 1px solid var(--warn); border-inline-start-width: 3px; border-radius: 8px; background: var(--warnbg); color: var(--warn); }
.hero { max-width: 640px; margin: clamp(2rem, 12vh, 8rem) auto; padding: 2rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); }
.hero p { color: var(--muted); }
.button, button.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; max-width: 100%; gap: .5rem; padding: .6rem 1rem; border: 1px solid transparent; border-radius: 7px; background: var(--button); color: var(--button-ink); font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; }
.button:hover { filter: brightness(.94); text-decoration: underline; }
.button.danger, button.button.danger { background: var(--danger); color: #fff; }
button.link { min-height: 44px; padding: .5rem .25rem; border: 0; background: none; color: var(--accent); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
a.quiet { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .8rem; }
form { display: inline; margin: 0; }
.stores { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 1rem 0 1.75rem; }
.chip { display: inline-block; max-width: 100%; padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 7px; background: var(--subtle); font-size: .85rem; overflow-wrap: anywhere; }
a.chip { display: inline-flex; align-items: center; min-height: 44px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 32rem), 1fr)); gap: 1.5rem; }
.card { min-width: 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.chart-scroll { max-width: 100%; overflow-x: auto; padding-bottom: .5rem; }
.chart { display: block; width: 100%; min-width: 720px; height: auto; }
.chart .grid { stroke: var(--line); }
.chart .tick, .chart .axis, .chart .val { fill: var(--muted); font-size: 13px; }
.chart .bar { fill: var(--accent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot { fill: var(--accent); }
.chart-hint { margin: .5rem 0; font-size: .78rem; color: var(--muted); }
form.spec { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; padding: 1.25rem; margin-bottom: 1.5rem; border: 1px solid var(--line); border-radius: 9px; background: var(--subtle); }
form.spec label { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: .4rem; font-size: .8rem; font-weight: 550; }
select, input:not([type="checkbox"]):not([type="hidden"]), textarea { min-width: 0; max-width: 100%; min-height: 44px; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; }
textarea { width: 100%; resize: vertical; }
input[type="checkbox"] { width: 20px; height: 20px; margin: .2rem 0; flex: 0 0 20px; accent-color: var(--accent); }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
table.data { border-collapse: collapse; width: 100%; background: var(--card); font-size: .875rem; }
table.data th, table.data td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { color: var(--muted); background: var(--subtle); font-size: .75rem; font-weight: 550; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data td:has(form) { padding-block: .25rem; }
table.data tbody tr:hover { background: var(--subtle); }
table.data tbody th[scope="row"] { color: var(--ink); background: transparent; font-size: inherit; font-weight: 500; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data a { text-decoration: none; }
table.data a:hover { text-decoration: underline; }
table.participants { min-width: 54rem; }
table.participants td[data-account], table.participants td[data-last], table.participants td:nth-child(3) { white-space: nowrap; }
.status { display: inline-block; padding: .2rem .6rem; border-radius: 6px; font-size: .75rem; font-weight: 550; background: var(--subtle); color: var(--muted); }
.status-open { color: var(--accent); background: var(--accent-soft); }
.status-draft { border: 1px solid var(--line); }
.status-closed { color: var(--warn); background: var(--warnbg); }
[data-state="state_suspended"], [data-state="state_withdrawn"] { color: var(--warn); }
h2.spaced, main > h2 { margin-top: 2rem; }
code { font-size: .875em; overflow-wrap: anywhere; }
code.link { display: block; min-width: min(240px, 100%); font-size: .85rem; overflow-wrap: anywhere; user-select: all; }
form.leave { display: block; margin: 1rem 0; }
.qr { display: inline-block; max-width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr svg { display: block; max-width: 100%; height: auto; }
form.study, form.sharing, form.designer { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; max-width: 820px; }
form.study, form.sharing { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
form.study label, form.designer > fieldset > label:not(.inline) { display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; font-weight: 550; }
form.study label:has(input[type="checkbox"]), label.track, label.inline { display: flex; flex-direction: row; gap: .65rem; align-items: flex-start; min-height: 44px; padding: .5rem 0; }
form.sharing label.track { border-bottom: 1px solid var(--line); }
form.study > .button, form.sharing > .button, form.designer > .button { align-self: flex-start; min-width: 120px; }
fieldset { min-width: 0; margin: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
legend { padding: 0 .5rem; font-weight: 600; }
form.designer table { min-width: 700px; }
form.designer table input:not([type="checkbox"]), form.designer table select { width: 100%; }
.study-page { max-width: 760px; margin-inline: auto; }
.study-page h2 { margin-top: 2rem; }
.study-page p { white-space: pre-line; }
.lead { color: var(--muted); font-size: 1.1rem; }
.consent { padding: 1.5rem; border: 1px solid var(--line); border-radius: 9px; background: var(--subtle); }
details { margin-top: 1.5rem; }
summary { padding: .75rem 0; cursor: pointer; color: var(--accent); }
pre { max-width: 100%; overflow-x: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle); font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.field-error { color: var(--warn); font-size: .85rem; font-weight: 500; }
[aria-invalid="true"] { border-color: var(--warn) !important; }
@media (max-width: 959px) {
  .app-shell { display: block; }
  .sidebar, .workspace-label { display: none; }
  .signed-in .header-brand { display: inline-flex; }
  header.bar { display: flex; flex-wrap: wrap; padding: .75rem 1.25rem; gap: .5rem 1rem; }
  .tools { margin-left: auto; }
  .mobile-nav { display: block; flex-basis: 100%; margin: 0; }
  .mobile-nav summary { min-height: 44px; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 6px; background: var(--subtle); font-size: .85rem; }
  .mobile-nav nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; padding-top: .5rem; }
  .mobile-nav:not([open]) nav { display: none; }
  .mobile-nav nav a { overflow-wrap: anywhere; }
  main { padding: 2rem 1.5rem 4rem; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  select, input:not([type="checkbox"]):not([type="hidden"]), textarea { font-size: 16px; }
  header.bar { padding: .75rem 1rem; }
  .tools { gap: .25rem .65rem; }
  .signed-in .tools { width: 100%; justify-content: flex-start; order: 3; margin: 0; }
  .language-menu { margin-left: auto; }
  .signed-in .language-menu { order: 3; }
  .account-link { margin-right: .4rem; }
  main { padding: 1.75rem 1rem 3rem; }
  .card, form.spec, form.study, form.sharing, fieldset { padding: 1rem; }
  form.spec label { flex-basis: calc(50% - .5rem); }
  form.spec > .button { width: 100%; }
  .button { margin-block: .15rem; }
  table.data th, table.data td { padding: .75rem; }
  form.designer table, form.designer tbody { min-width: 0; display: block; }
  form.designer thead { display: none; }
  form.designer tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: 1rem; border-bottom: 1px solid var(--line); }
  form.designer tbody tr:last-child { border-bottom: 0; }
  form.designer tbody td { display: flex; flex-direction: column; gap: .4rem; padding: 0; border: 0; }
  form.designer td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 550; }
  form.designer td:empty { display: none; }
}
@media (max-width: 480px) { form.designer tbody tr { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 400px) { form.spec label { flex-basis: 100%; } }
@media (forced-colors: active) {
  .desktop-nav a[aria-current="page"], .mobile-nav nav a[aria-current="page"], .langs a[aria-current] { outline: 2px solid Highlight; }
  .button, .status { border: 1px solid ButtonText; }
}

/* Saved study setup uses the existing form and responsive designer. */
.setup-progress { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; padding-left: 1.5rem; max-width: 820px; }
.setup-progress a, .setup-checklist a { display: inline-flex; align-items: center; min-height: 44px; }
.setup-progress a[aria-current="step"] { font-weight: 750; text-decoration-thickness: 3px; }
.setup-progress li { max-width: 100%; overflow-wrap: anywhere; }
.study-page, form.study { overflow-wrap: anywhere; }

form.designer th:last-child { min-width: 6rem; }

/* Moderation identifies stores by opaque ID; long authorized names must wrap. */
.moderation dd { margin: .3rem 0 1rem; overflow-wrap: anywhere; }
.moderation dt { font-weight: 600; }
.moderation .card { margin-block: 1rem; }

.backup-status h2 { margin-top: 2rem; }
.backup-status pre { max-width: 100%; overflow-x: auto; padding: 1rem; background: var(--subtle); }
.backup-status code { overflow-wrap: anywhere; }
.backup-status table { min-width: 780px; }
.backup-status th:first-child { min-width: 260px; }
.backup-status th:last-child { min-width: 220px; }
.backup-settings-form { display: grid; gap: .6rem; max-width: 36rem; }
.backup-settings-form label { display: block; margin-top: .5rem; }
.backup-settings-form input, .backup-settings-form select { width: 100%; min-width: 0; }
.backup-settings-form button { justify-self: start; max-width: 100%; margin-top: .5rem; }

.backup-status [data-off-machine-state] { overflow-wrap: anywhere; }

.backup-status pre:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
