/* Wild West Lviv look: near-black surfaces, one amber accent, pill buttons, condensed uppercase headings. */
@font-face {
  font-family: "Oswald"; font-style: normal; font-weight: 200 700; font-display: swap;
  src: url(/fonts/oswald-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Oswald"; font-style: normal; font-weight: 200 700; font-display: swap;
  src: url(/fonts/oswald-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pill: 999px; --radius: 12px; --control-radius: 999px; --field-radius: 8px; --badge-radius: 999px; --toast-radius: 999px;
  --heading-case: uppercase; --heading-tracking: .05em; --heading-weight: 500; --h1-size: 30px; --h2-size: 18px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* dark, the default */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f; --panel: #181818; --raised: #222; --text: #f5f5f5; --muted: #9b9b9b;
  --line: #2c2c2c; --line-strong: #474747;
  --accent: #c9882a; --accent-strong: #e0a040; --accent-text: #e0a040; --on-accent: #0f0f0f; --select: rgba(201, 136, 42, .16);
  --timer: #e5484d; --shot: #e0a040; --danger: #ff6b6b; --ok: #4cc38a; --running: #e0a040;
  /* canvas colours, read by js/colors.js */
  --track: #333; --progress: #d9d9d9; --playhead: #f5f5f5; --on-playhead: #0f0f0f; --hover: #8ab4f8; --on-hover: #0f0f0f; --tick: #5c5c5c;
  --wave: #d9d9d9; --ratio: #4cc38a; --search-edge: rgba(34, 211, 238, .8);
  --scroll-track: #1a1a1a; --plot: #222; --zoom-fill: rgba(201, 136, 42, .16);
  --trim: #4cc38a; --trim-outside: rgba(0, 0, 0, .55);
}
/* light: warm paper, the same amber (darker where it is text) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ee; --panel: #fff; --raised: #ece7df; --text: #1a1a1a; --muted: #6b645a;
  --line: #ded8ce; --line-strong: #bdb5a8;
  --accent: #c9882a; --accent-strong: #b87514; --accent-text: #8f5a0c; --on-accent: #0f0f0f; --select: rgba(201, 136, 42, .18);
  --timer: #d12f35; --shot: #c9882a; --danger: #c62828; --ok: #1b7f4f; --running: #8f5a0c;
  --track: #d8d2c8; --progress: #3a342b; --playhead: #1a1a1a; --on-playhead: #fff; --hover: #2563eb; --on-hover: #fff; --tick: #a39b8e;
  --wave: #3a342b; --ratio: #1b7f4f; --search-edge: rgba(8, 145, 178, .9);
  --scroll-track: #e4ded3; --plot: #ece7df; --zoom-fill: rgba(201, 136, 42, .18);
  --trim: #1b7f4f; --trim-outside: rgba(58, 52, 43, .35);
}
/* classic: the look before the restyle (grey and blue, square-ish controls, system fonts) */
:root[data-theme="classic"] {
  color-scheme: light;
  --bg: #f5f6f8; --panel: #fff; --raised: #e5e7eb; --text: #1f2937; --muted: #6b7280;
  --line: #d9dde3; --line-strong: #d9dde3;
  --accent: #2563eb; --accent-strong: #2563eb; --accent-text: #2563eb; --h1-color: #1f2937; --on-accent: #fff; --select: #dbeafe;
  --timer: #e11d48; --shot: #f97316; --danger: #b91c1c; --ok: #15803d; --running: #1d4ed8;
  --track: #e5e7eb; --progress: #93c5fd; --playhead: #1f2937; --on-playhead: #fff; --hover: #2563eb; --on-hover: #fff;
  --tick: #9ca3af; --wave: #2563eb; --ratio: #16a34a; --search-edge: rgba(34, 211, 238, .8);
  --plot: #fff; --zoom-fill: rgba(37, 99, 235, .08);
  --trim: #15803d; --trim-outside: rgba(31, 41, 55, .3);
  --radius: 8px; --control-radius: 6px; --field-radius: 6px; --badge-radius: 10px; --toast-radius: 8px;
  --heading-case: none; --heading-tracking: 0; --heading-weight: 700; --h1-size: 20px; --h2-size: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --display: var(--sans);
}
:root[data-theme="classic"] body { line-height: 1.45; }
:root[data-theme="classic"] header { background: #1f2937; border-bottom: 0; padding: 8px 16px; gap: 24px; }
:root[data-theme="classic"] header .brand { font: 600 14px/1.45 var(--sans); text-transform: none; letter-spacing: 0; color: #fff; }
:root[data-theme="classic"] header nav a { color: #d1d5db; font-weight: 400; padding: 4px 10px; }
:root[data-theme="classic"] header nav a:hover, :root[data-theme="classic"] header nav a.active { background: #374151; color: #fff; }
:root[data-theme="classic"] header .who { color: #d1d5db; }
:root[data-theme="classic"] main { padding: 16px; }
:root[data-theme="classic"] h1 { margin-bottom: 12px; }
:root[data-theme="classic"] h2 { margin: 16px 0 8px; }
:root[data-theme="classic"] button, :root[data-theme="classic"] .button { font-weight: 400; padding: 5px 12px; background: var(--panel); transition: none; }
:root[data-theme="classic"] button:hover:not(:disabled), :root[data-theme="classic"] .button:hover { border-color: #9ca3af; color: var(--text); }
:root[data-theme="classic"] button.primary, :root[data-theme="classic"] .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="classic"] button.danger { color: var(--danger); }
:root[data-theme="classic"] button.link, :root[data-theme="classic"] button.x { background: none; padding: 0 4px; }
:root[data-theme="classic"] .zoom-row button, :root[data-theme="classic"] .seek-row .icon-button { padding: 0; }
:root[data-theme="classic"] header .theme-toggle { background: none; border-color: #4b5563; color: #d1d5db; }
:root[data-theme="classic"] header .theme-toggle:hover { border-color: #9ca3af; color: #fff; }
:root[data-theme="classic"] header .language-select { background: #1f2937; border-color: #4b5563; color: #d1d5db; }
:root[data-theme="classic"] input, :root[data-theme="classic"] select { padding: 4px 8px; background: #fff; }
:root[data-theme="classic"] .shots-wrap td { padding: 3px 8px; }
:root[data-theme="classic"] .shots-wrap input { padding: 1px 4px; }
:root[data-theme="classic"] .panel { padding: 12px; }
:root[data-theme="classic"] th, :root[data-theme="classic"] td { padding: 5px 8px; }
:root[data-theme="classic"] th { font-size: 12px; letter-spacing: .03em; }
:root[data-theme="classic"] tr.clickable:hover { background: #f3f4f6; }
:root[data-theme="classic"] .badge { font-weight: 400; padding: 1px 8px; background: #e5e7eb; }
:root[data-theme="classic"] .badge.READY, :root[data-theme="classic"] .badge.SUCCEEDED { background: #dcfce7; }
:root[data-theme="classic"] .badge.FAILED { background: #fee2e2; }
:root[data-theme="classic"] .badge.QUEUED, :root[data-theme="classic"] .badge.PROCESSING, :root[data-theme="classic"] .badge.RUNNING { background: #dbeafe; }
:root[data-theme="classic"] .progress { border-radius: 4px; }
:root[data-theme="classic"] #toast { background: #111827; color: #fff; border: 0; padding: 8px 16px; }
:root[data-theme="classic"] #toast.error { background: var(--danger); color: #fff; }
:root[data-theme="classic"] .tabs button.active { background: var(--select); border-color: var(--accent); color: var(--text); }
/* the site's thin scroll bar: an amber thumb on a dark track (classic keeps the browser's own) */
:root:not([data-theme="classic"]) { scrollbar-width: thin; scrollbar-color: var(--accent) var(--scroll-track); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.5 var(--sans); background: var(--bg); color: var(--text); }
a { color: var(--accent-text); }
header { --bg: #0f0f0f; --text: #f5f5f5; --muted: #9b9b9b; --line: #2c2c2c; --line-strong: #474747; --accent-text: #e0a040;
  display: flex; align-items: center; gap: 32px; padding: 10px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
header .brand { font: 600 20px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
header nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
header nav a { color: var(--text); font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: var(--control-radius); }
header nav a:hover { color: var(--accent-text); }
header nav a.active { background: var(--accent); color: var(--on-accent); }
header .who { color: var(--muted); white-space: nowrap; }
main { padding: 24px; max-width: 1500px; margin: 0 auto; }
h1, h2 { font-family: var(--display); font-weight: var(--heading-weight); text-transform: var(--heading-case); letter-spacing: var(--heading-tracking); line-height: 1.2; }
h1 { font-size: var(--h1-size); margin: 0 0 16px; color: var(--h1-color, var(--accent-text)); }
/* a video name may be one long word (IMG_9915_stage4_…): break it anywhere rather than push the page wider */
.file-name { overflow-wrap: anywhere; }
.user-name { white-space: nowrap; }
h2 { font-size: var(--h2-size); margin: 20px 0 10px; }
button, .button { font: 600 14px/1.4 var(--sans); padding: 6px 16px; border: 1px solid var(--line-strong); background: transparent; border-radius: var(--control-radius); cursor: pointer; color: var(--text); text-decoration: none; display: inline-block; transition: border-color .15s, color .15s, background .15s; }
button:hover:not(:disabled), .button:hover { border-color: var(--accent); color: var(--accent-text); }
button:disabled { opacity: .4; cursor: default; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
button.danger { color: var(--danger); }
button.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
button.link { border: 0; background: none; color: inherit; text-decoration: underline; padding: 0 4px; font-weight: 400; }
input, select { font: inherit; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--field-radius); background: var(--bg); color: var(--text); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.mono { font-family: var(--mono); }
/* a wide table scrolls sideways inside its own panel on a narrow screen, so the page itself never does */
.table-scroll { overflow-x: auto; }
/* there a name keeps a readable width; the table scrolls rather than squeeze it to a letter per line */
.table-scroll .file-name { display: inline-block; min-width: 12em; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--raised); }
tr.selected, tr.selected:hover { background: var(--select); }
.badge { display: inline-block; padding: 1px 10px; border-radius: var(--badge-radius); font-size: 12px; font-weight: 600; background: var(--raised); color: var(--muted); }
.badge.READY, .badge.SUCCEEDED { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.FAILED { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.badge.QUEUED, .badge.PROCESSING, .badge.RUNNING { background: var(--select); color: var(--running); }
.badge.CANCELLED { background: var(--raised); color: var(--muted); }
.progress { width: 140px; height: 8px; background: var(--raised); border-radius: var(--pill); overflow: hidden; display: inline-block; vertical-align: middle; }
.progress > div { height: 100%; background: var(--accent); }
#toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--raised); color: var(--text); border: 1px solid var(--accent); padding: 10px 20px; border-radius: var(--toast-radius); max-width: 90vw; z-index: 10; }
#toast.error { background: var(--raised); border-color: var(--danger); color: var(--danger); }
#toast .x { color: var(--muted); }

/* sign-in */
.login { max-width: 340px; margin: 10vh auto; }
.login form { display: grid; gap: 10px; }
.login label { display: grid; gap: 4px; }

/* account */
.account { max-width: 400px; display: grid; gap: 10px; }
.account h2 { margin: 0; }
.account label { display: grid; gap: 4px; }
.account button { justify-self: start; }
.account p:empty { display: none; }
.account + .account { margin-top: 16px; }
.account .button { justify-self: start; }
.telegram p { margin: 0; }
/* Download and, with Telegram tied, the small Send to Telegram button beside it */
.export-actions { display: inline-flex; gap: 6px; align-items: center; }
.telegram-send { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; align-self: stretch; }
.telegram-send .icon { display: block; }

/* video page */
.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; }
@media (max-width: 1000px) { .video-layout { grid-template-columns: 1fr; } }
.player { background: #000; border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; }
.player { position: relative; min-height: 120px; }
.player video { width: 100%; height: auto; max-height: 62vh; display: block; }
.player-message { position: absolute; inset: auto 0 0 0; padding: 10px 14px; background: rgba(15, 15, 15, .85); color: #f5f5f5; }
.player .player-message button, .player .player-message button:hover:not(:disabled) { color: inherit; border-color: currentColor; background: transparent; }
/* a 38 px track plus two 15 px rows of shot-number bubbles under it */
.seek { width: 100%; height: 69px; display: block; cursor: pointer; touch-action: none; }
.seek-row { display: grid; grid-template-columns: 44px auto 1fr auto; gap: 8px; align-items: start; margin: 6px 0; }
.seek-row .theme-toggle { padding: 4px 14px; font-size: 13px; line-height: 1.3; }
.language-select { padding: 5px 8px; font-size: 13px; }
.floating-switches { position: fixed; top: 12px; right: 16px; z-index: 5; display: flex; gap: 8px; }
#topbar:not([hidden]) ~ .floating-switches { display: none; }
.icon-button { height: 38px; padding: 0; }
.seek-row .time { font-size: 13px; line-height: 38px; }

.shots-head { margin: 16px 0 12px; }
.shots-head h2 { margin: 0; }
.zoom-row { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; align-items: stretch; }
.zoom-row button { padding: 0; }
.zoom { width: 100%; height: 62px; display: block; cursor: pointer; touch-action: none; }
.transport { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.time { font-family: var(--mono); }
/* as tall as its contents, not stretched to the height of the player column */
.side { align-self: start; }
.side h2:first-child { margin-top: 0; }
.shots-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.shots-wrap table { font-variant-numeric: tabular-nums; }
.shots-wrap td { padding: 3px 8px; }
.shots-wrap input { width: 90px; padding: 1px 4px; }
.x { border: 0; background: none; color: var(--muted); padding: 0 4px; }
.x:hover { color: var(--danger); }
.exports { list-style: none; margin: 0; padding: 0; max-height: 24vh; overflow: auto; }
.export-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.export-file { display: grid; min-width: 0; }
/* a long name wraps, broken anywhere, onto up to three lines; anything longer is cut with … (full name in the tooltip) */
.export-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.export-size { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { display: inline-flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.legend .timer-swatch { background: var(--timer); }
.legend .shot-swatch { background: var(--shot); }
.spectro { margin-top: 16px; }
.spectro canvas { width: 100%; height: 460px; display: block; background: var(--panel); border-radius: var(--radius); touch-action: none; cursor: grab; }
.spectro canvas:focus { outline: 2px solid var(--accent); }
.spectro-stage, .bars-stage { position: relative; }
.shot-popup { position: absolute; z-index: 2; min-width: 180px; padding: 8px 10px; background: var(--panel); color: var(--text); border: 1px solid var(--hover); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
.shot-popup[hidden] { display: none; }
.shot-popup dl { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.shot-popup dt { color: var(--muted); }
.shot-popup dd { margin: 0; text-align: right; }
.shot-popup .row { gap: 6px; flex-wrap: nowrap; }
.shot-popup .row button:not(.x) { padding: 4px 10px; }
.status-line { margin: 8px 0; }

/* the video page's export edit mode: the trim fields and the shot list drawn over the player as the export draws it */
.export-editor { margin: 8px 0; padding: 10px 12px; }
.export-editor[hidden], .overlay-preview[hidden] { display: none; }
.export-editor .row { gap: 8px; flex-wrap: wrap; }
.export-editor .trim-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--trim); vertical-align: -1px; }
.export-editor p { margin: 0 0 6px; }
.export-editor .trim-summary { font-variant-numeric: tabular-nums; }
.export-editor .font-size-choice { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; }
button.editing { border-color: var(--trim); color: var(--trim); }
.seek.over-trim-line { cursor: ew-resize; }
.overlay-preview { position: absolute; pointer-events: none; }
.overlay-box { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; outline: 2px dashed var(--trim); outline-offset: 2px; }
.overlay-box.dragging { cursor: grabbing; }
/* grips on the shot list's edges: dragging one changes how many shots a column holds */
.overlay-edge { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; }
.overlay-edge.top, .overlay-edge.bottom { left: 0; right: 0; height: 12px; cursor: ns-resize; }
.overlay-edge.top { top: 0; }
.overlay-edge.bottom { bottom: 0; }
.overlay-edge.left, .overlay-edge.right { top: 0; bottom: 0; width: 12px; cursor: ew-resize; }
.overlay-edge.left { left: 0; }
.overlay-edge.right { right: 0; }
.overlay-edge::after { content: ""; background: var(--trim); border-radius: 3px; }
.overlay-edge.top::after, .overlay-edge.bottom::after { width: 24px; height: 6px; }
.overlay-edge.left::after, .overlay-edge.right::after { width: 6px; height: 24px; }
/* the export's font: Arial (Liberation Sans on the server), bold, white with a black edge */
.overlay-line { position: absolute; white-space: pre; color: #fff; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; font-weight: 700; line-height: normal; }
/* lines of shots still to come, faint, so the list's full size shows while it is placed */
.overlay-line.upcoming { opacity: .5; }
.overlay-line.off-picture { opacity: .45; text-decoration: line-through; }
.stale-notice { color: var(--accent-text); font-weight: 600; }
/* Upload limits of an account (sign-up form, videos page) and the sign-up form's good news. */
.limits-notice { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--raised); }
.limits-notice p { margin: 4px 0; }
/* The sign-up form's trap field: out of sight for people, still in the form for bots. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.limits-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
.limits-form label { display: grid; gap: 2px; font-size: 12px; }
.limit-input { width: 90px; }
tr.awaiting td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.overlay-warning { margin: 8px 0 0; }
.disk-critical, .disk-full { color: var(--danger); }
.storage-meter { width: 100%; max-width: 480px; accent-color: var(--accent); }

/* settings */
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tabs button.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.settings td input { width: 100px; }
.settings td.value { white-space: nowrap; }
.settings tr.changed td.value input { font-weight: 700; }
.settings td.desc { color: var(--muted); max-width: 560px; }
/* settings legend window */
.legend-dialog { width: min(1080px, 96vw); max-height: 94vh; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--text); background: var(--panel); }
.legend-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.legend-dialog h2 { margin: 0; }
.legend-figure svg { width: 100%; height: auto; display: block; font: 12px var(--sans); }
.legend-key { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 4px 16px; }
.legend-key li { cursor: pointer; display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 6px; border-radius: 8px; }
.legend-key li:focus { outline: 2px solid var(--accent); }
.legend-key li.highlight { background: var(--select); }
.legend-number { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.legend-dialog.focusing .legend-mark:not(.highlight), .legend-dialog.focusing .legend-key li:not(.highlight) { opacity: .25; }
.legend-mark { transition: opacity .15s; cursor: pointer; }
.legend-plot { fill: var(--plot); stroke: var(--line-strong); }
.legend-plot.dark { fill: #0d0829; stroke: #0d0829; }
.legend-title { fill: var(--text); font-weight: 600; }
.legend-tick { fill: var(--muted); font-size: 11px; }
.legend-axis { stroke: var(--muted); }
.legend-label { fill: var(--text); }
.on-dark .legend-label { fill: var(--text); }
.on-dark .legend-label.outside { fill: var(--text); }
.legend-line { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.on-dark .legend-line { stroke: #67e8f9; }
.on-dark .legend-line.outside { stroke: var(--accent); }
.legend-line.dashed { stroke-dasharray: 6 4; }
.legend-line.dotted { stroke-dasharray: 2 3; }
.legend-line.strong { stroke-width: 3; }
.legend-line.edge { stroke: var(--timer); stroke-dasharray: 4 3; }
.legend-line.cross { stroke: var(--danger); stroke-width: 2.5; }
.legend-line.arrow { stroke-width: 2; }
.legend-line.leader { stroke-width: 1; }
.legend-line.faint { stroke-dasharray: 1 4; opacity: .6; }
.legend-line.dark-ink { stroke: var(--text); }
.legend-badge circle { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; }
.legend-badge text { fill: var(--on-accent); font-size: 11px; font-weight: 600; }
.legend-dot { fill: var(--timer); }
.heat-noise { fill: #51127c; }
.heat-rumble { fill: #b73779; opacity: .55; }
.heat-tone { stroke: #fcfdbf; stroke-width: 6; fill: none; stroke-linecap: round; }
.heat-tone-bar { fill: #fcfdbf; }
.heat-crack { fill: #fe9f6d; }
.heat-boom { fill: #fcfdbf; }
.tone-band { fill: #67e8f9; opacity: .18; }
.tolerance { fill: #67e8f9; opacity: .45; }
.crack-band { fill: #67e8f9; opacity: .08; }
.boom-band { fill: #67e8f9; opacity: .2; }
.exclusion { fill: #9ca3af; opacity: .28; }
.frame { fill: var(--select); stroke: var(--accent); }
.frame.ghost { fill: none; stroke-dasharray: 3 3; }
.raw-curve { fill: none; stroke: var(--muted); stroke-width: 1; }
.smooth-curve { fill: none; stroke: var(--shot); stroke-width: 2.5; }
.share-curve { fill: none; stroke: var(--ratio); stroke-width: 2.5; }
.drop { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--select); }

.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; }
.icon { display: block; }

/* tablets and phones: the top bar puts its menu on a row of its own, under the name, theme and sign-out */
@media (max-width: 900px) {
  #topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  #topbar .brand { flex: 1; }
  #topbar nav { order: 1; flex-basis: 100%; }
}
/* phones: the menu spreads over the width, the page and its panels keep a 16 px edge, and each detection setting
   becomes a card (name and Restore default on top, the value and the explanation under them) */
@media (max-width: 640px) {
  :root:not([data-theme="classic"]) { --h1-size: 24px; }
  #topbar nav a { flex: 1 1 auto; text-align: center; padding: 6px; }
  main { padding: 16px; }
  .legend-dialog { padding: 14px; }
  .settings thead { display: none; }
  .settings tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .settings td { display: block; padding: 0; border: 0; }
  .settings td.parameter { grid-column: 1; }
  .settings td.restore { grid-column: 2; grid-row: 1; }
  .settings td.value, .settings td.desc { grid-column: 1 / -1; max-width: none; }
}
