:root {
  color-scheme: dark;
  --bg: #080a0c;
  --panel: #101418;
  --panel-soft: #151b20;
  --line: #29323a;
  --line-bright: #41505b;
  --text: #f1f4f5;
  --muted: #8d9aa3;
  --cyan: #58e1ef;
  --cyan-deep: #123f46;
  --detail-process: #9b8cff;
  --red: #f35050;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  font-family: Inter, "Segoe UI", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -10%, rgba(49, 129, 139, 0.18), transparent 31rem),
    linear-gradient(180deg, #0c1013 0, var(--bg) 34rem);
}

button, input { font: inherit; }
button { color: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: -0.03em; }
h2 { font-size: 28px; letter-spacing: -0.03em; }

.app-shell { width: calc(100% - 48px); max-width: 1580px; margin: 0 auto; padding: 8px 0 18px; }
.replay-lab-title { margin: 0; font-size: 28px; letter-spacing: -.03em; line-height: 1.2; }
.replay-scope-home { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-weight: inherit; letter-spacing: inherit; line-height: inherit; }
.replay-scope-home:hover { color: var(--cyan); }
.replay-scope-home:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.eyebrow { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.17em; line-height: 1.4; text-transform: uppercase; }

.home-view-switch { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); margin-bottom: 12px; border: 1px solid var(--line-bright); background: #090d0f; }
.home-view-switch[hidden] { display: none; }
.home-view-switch button { position: relative; min-height: 48px; overflow: hidden; padding: 0 22px; border: 0; border-right: 1px solid var(--line-bright); background: #10161a; color: var(--cyan); cursor: pointer; font-size: 16px; font-weight: 900; letter-spacing: .04em; }
.home-view-switch button:last-child { border-right: 0; }
.home-view-switch button[aria-selected="true"] { background: var(--cyan-deep); box-shadow: inset 0 -4px 0 var(--cyan); color: #fff; }
.home-view-switch button:hover { color: var(--cyan); }
.home-view-switch button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--cyan); outline-offset: 2px; }
#home-view-notes { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; place-content: center; align-items: center; gap: 10px; text-align: center; }
#home-view-notes > span { display: grid; height: 24px; place-items: center; line-height: 1; }
.home-view-notes-count { display: grid; box-sizing: border-box; min-width: 28px; height: 24px; place-items: center; padding: 0 7px; border: 1px solid currentColor; color: inherit; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; line-height: 1; transform: translateY(1px); }
#home-view-notes[aria-selected="true"] .home-view-notes-count { background: rgba(4, 16, 18, .35); }
#home-view-notes[aria-selected="false"] { animation: notes-tab-attention-text 7.2s ease-in-out infinite; }
#home-view-notes[aria-selected="false"]::after { content: ""; position: absolute; right: auto; bottom: 0; left: 0; width: 34%; height: 3px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--cyan) 88%, white), transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 58%, transparent); opacity: 0; transform: translateX(-130%); animation: notes-tab-attention-line 7.2s ease-in-out infinite; }
@keyframes notes-tab-attention-text {
  0%, 100% { text-shadow: none; }
  18%, 82% { text-shadow: 0 0 5px color-mix(in srgb, var(--cyan) 20%, transparent); }
  48% { text-shadow: 0 0 9px color-mix(in srgb, var(--cyan) 38%, transparent); }
}
@keyframes notes-tab-attention-line {
  0% { opacity: 0; transform: translateX(-130%); }
  8% { opacity: .18; }
  24% { opacity: .38; }
  50% { opacity: .9; }
  76% { opacity: .38; }
  92% { opacity: .18; }
  100% { opacity: 0; transform: translateX(360%); }
}

.drop-zone { display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 150px; gap: 24px; padding: 22px 40px; border: 1px dashed #3a4851; background: rgba(14, 19, 22, 0.78); box-shadow: var(--shadow); transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.drop-zone[hidden] { display: none; }
.drop-zone.is-dragging { border-color: var(--cyan); background: rgba(24, 66, 71, 0.42); transform: translateY(-2px); }
.drop-zone.is-compact { display: none; }
.drop-zone h2 { margin-bottom: 8px; font-size: clamp(20px, 2.5vw, 30px); }
.drop-zone p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.7; }
.drop-icon { display: grid; width: 76px; height: 76px; place-items: center; border: 1px solid var(--line); background: #0b0e11; }
.drop-icon svg { width: 34px; fill: none; stroke: var(--cyan); stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.5; }
.drop-actions { display: grid; gap: 10px; min-width: 224px; }
.drop-actions .button { width: 100%; }
.steam-open-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; align-items: stretch; gap: 0; }
.steam-open-row .button-accent { min-width: 0; border-right: 0; }
.steam-recording-info { display: grid; width: 46px; min-height: 50px; place-items: center; padding: 0; border: 0; border-left: 1px solid rgba(4, 16, 18, .32); border-radius: 0; background: var(--cyan); color: #041012; cursor: pointer; font-family: Georgia, serif; font-size: 20px; font-weight: 800; line-height: 1; transition: filter .16s ease; }
.steam-recording-info:hover { filter: brightness(1.12); }
.steam-recording-info:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
#change-file { display: none; }

.recording-library { margin-top: 14px; padding: 18px; border: 1px solid var(--line); background: rgba(14, 19, 22, .86); box-shadow: var(--shadow); }
.recording-library[hidden] { display: none; }
.recording-library > header { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.recording-library > header strong { color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .07em; }
.recording-library-tools, .note-context-library-tools { display: flex; align-items: center; gap: 12px; }
.note-context-search { width: 240px; height: 34px; padding: 0 11px; border: 1px solid var(--line-bright); border-radius: 0; background: #0a0f12; color: #f1f5f6; font-size: 14px; font-weight: 750; }
.note-context-search::placeholder { color: #77858c; }
.note-context-search:hover { border-color: #64747c; }
.note-context-search:focus { border-color: var(--cyan); outline: 2px solid color-mix(in srgb, var(--cyan) 28%, transparent); outline-offset: 1px; }
.recording-library-tools select, .note-context-library-tools select { height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line-bright); border-radius: 0; background: #11181c; color: #dbe4e7; cursor: pointer; font-size: 12px; font-weight: 800; }
.recording-library-tools select:hover, .note-context-library-tools select:hover { border-color: var(--cyan); }
.recording-library-tools select:focus-visible, .note-context-library-tools select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.recording-library-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.recording-library-card { display: grid; grid-template-columns: minmax(180px, 38%) minmax(0, 1fr); min-height: 132px; overflow: hidden; border: 1px solid var(--line); background: #0d1215; }
.recording-library-card img, .recording-library-thumb-empty { width: 100%; height: 100%; min-height: 132px; object-fit: cover; background: #050708; }
.recording-library-thumb-empty { display: grid; place-items: center; color: #718087; font-size: 12px; letter-spacing: .08em; }
.recording-library-info { display: flex; flex-direction: column; padding: 15px; }
.recording-library-title-row { display: flex; min-width: 0; align-items: center; gap: 8px; }
.recording-library-info h3 { min-width: 0; margin: 0; overflow: hidden; font-size: 19px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.recording-title-edit { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid transparent; background: transparent; color: #91a0a8; cursor: pointer; }
.recording-title-edit:hover { border-color: var(--line-bright); color: var(--cyan); }
.recording-title-edit:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.recording-title-edit svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.8; }
.recording-title-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; }
.recording-title-form[hidden] { display: none; }
.recording-title-form input { min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--cyan); background: #080c0e; color: var(--text); font-size: 14px; font-weight: 750; }
.recording-title-form button { min-height: 32px; padding: 0 8px; border: 1px solid var(--line-bright); background: #192127; color: #dce5e8; cursor: pointer; font-size: 11px; font-weight: 800; }
.recording-title-form button[type="submit"] { border-color: var(--cyan); background: var(--cyan); color: #041012; }
.recording-library-info p { margin-top: 7px; color: #b1bcc1; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.recording-library-info span { margin-top: 5px; color: #87959c; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.recording-library-info .recording-library-source-summary { font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.recording-library-info .recording-library-date { color: #b7c1c6; }
.recording-library-actions { display: grid; grid-template-columns: minmax(160px, 1fr) 76px; align-items: stretch; gap: 8px; margin-top: auto; padding-top: 10px; }
.recording-library-actions .button { min-height: 38px; padding-inline: 18px; font-size: 12px; }
.recording-delete-button { min-height: 38px; padding: 0 10px; border: 1px solid #74434a; background: #1b1114; color: #ff9ca5; cursor: pointer; font-size: 14px; font-weight: 850; }
.recording-delete-button:hover { border-color: #ff7c7c; background: #2a1519; color: #ffd6da; }
.recording-delete-button:focus-visible { outline: 2px solid #ff9ca5; outline-offset: 2px; }

.note-context-library { margin-top: 14px; padding: 18px; border: 1px solid var(--line); background: rgba(14, 19, 22, .86); box-shadow: var(--shadow); }
.note-context-library[hidden] { display: none; }
.note-context-library > header { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.note-context-library > header strong { color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .07em; }
.note-context-title-row { display: flex; align-items: baseline; gap: 14px; }
.note-context-list { display: flex; flex-direction: column; margin-top: 13px; border-top: 1px solid var(--line); }
.note-context-library-empty { max-width: 760px; margin: 32px auto 24px; color: var(--muted); font-size: 14px; line-height: 1.9; text-align: center; }
.note-context-card { min-width: 0; padding: 16px 20px; border: 1px solid var(--line); border-top: 0; background: #0d1215; }
.note-context-derived { display: flex; min-width: 0; align-items: baseline; gap: 15px; color: #dfe8eb; }
.note-context-derived strong { display: flex; min-width: 0; flex: 0 1 auto; align-items: baseline; gap: 8px; overflow: hidden; font-size: 18px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.perspective-self-badge { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 1px 4px; border: 1px solid #718087; color: #c8d2d6; font-family: "Cascadia Mono", Consolas, monospace; font-size: inherit; font-weight: 900; line-height: 1.1; letter-spacing: .04em; }
.note-context-vs { color: #dfe8eb; }
.note-context-character.is-winner { color: var(--cyan); }
.note-context-result { flex: 0 0 auto; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; letter-spacing: .04em; }
.note-context-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px; margin-top: 11px; }
.note-context-text { margin: 0; color: #fff; font-size: 21px; font-weight: 720; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-context-text.is-empty { color: #89969c; }
.note-context-date { flex: 0 0 auto; color: #aeb9be; font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; }
.note-context-actions { display: flex; align-items: stretch; gap: 8px; }
.note-context-edit-button, .note-context-delete-button, .note-context-edit-actions button { min-width: 72px; min-height: 40px; padding: 0 13px; border: 1px solid var(--line-bright); background: transparent; color: #cbd4d7; cursor: pointer; font-size: 15px; font-weight: 850; }
.note-context-edit-button:hover, .note-context-edit-button:focus-visible { border-color: var(--cyan); color: var(--cyan); }
.note-context-delete-button { border-color: #75444a; color: #ff9ca5; }
.note-context-delete-button:hover, .note-context-delete-button:focus-visible { border-color: #ff7f8b; background: rgba(255, 93, 108, .08); color: #ffb0b7; }
.note-context-actions button:disabled, .note-context-edit-actions button:disabled { cursor: wait; opacity: .5; }
.note-context-body.is-editing { align-items: end; }
.note-context-inline-edit { display: grid; min-width: 0; gap: 8px; }
.note-context-edit-text { min-height: 72px; resize: vertical; padding: 10px 12px; border: 1px solid var(--cyan); background: #080d0f; color: #fff; font: 700 18px/1.45 system-ui, sans-serif; }
.note-context-edit-actions { display: flex; align-items: end; gap: 8px; }
.note-context-edit-actions .note-context-edit-save { border-color: var(--cyan); color: var(--cyan); }
.note-context-details { position: relative; flex: 0 0 auto; }
.note-context-details summary { display: grid; min-width: 72px; min-height: 40px; place-items: center; padding: 0 13px; border: 1px solid var(--line-bright); color: #cbd4d7; cursor: pointer; font-size: 15px; font-weight: 850; list-style: none; }
.note-context-details summary::-webkit-details-marker { display: none; }
.note-context-details[open] summary { border-color: var(--cyan); color: var(--cyan); }
.note-context-details > div { position: absolute; z-index: 12; right: 0; bottom: calc(100% + 6px); display: grid; min-width: 260px; gap: 7px; padding: 12px 14px; border: 1px solid var(--line-bright); background: #11191d; box-shadow: 0 12px 28px rgba(0,0,0,.42); color: #aeb9be; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.note-context-details > div code { color: #edf3f4; font-family: inherit; font-size: 15px; }
.note-context-details > div strong { color: #cfd8db; font-size: 14px; }
.note-context-watch { flex: 0 0 auto; min-height: 40px; padding: 0 15px; border: 1px solid var(--cyan); background: transparent; color: var(--cyan); cursor: pointer; font-size: 15px; font-weight: 850; }
.note-context-watch:hover { background: var(--cyan); color: #041012; }
.note-context-watch.is-source-unavailable { border-color: #465057; background: #151a1d; color: #727c81; }
.note-context-watch.is-source-unavailable:hover { border-color: #59646a; background: #1a2024; color: #90999d; }
.note-context-watch:focus-visible, .note-inline-player button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.note-inline-slot { margin-top: 16px; }
.note-inline-slot[hidden] { display: none; }
.note-inline-player { overflow: hidden; border: 1px solid var(--line-bright); background: #080c0e; }
.note-inline-player > header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 43px; padding: 7px 10px 7px 13px; border-bottom: 1px solid var(--line); }
.note-inline-player > header strong { color: #fff; font-size: 15px; }
.note-inline-status { overflow: hidden; color: #9dabb1; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.note-inline-close { min-height: 30px; padding: 0 8px; border: 0; background: transparent; color: #c9d2d5; cursor: pointer; font-size: 14px; font-weight: 800; }
.note-inline-video-wrap { width: min(100%, 820px); margin: 0 auto; aspect-ratio: 16 / 9; background: #020304; }
.note-inline-video-wrap[hidden] { display: none; }
.note-inline-video-wrap video { display: block; width: 100%; height: 100%; object-fit: contain; background: #020304; }
.note-inline-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #0d1316; }
.note-inline-controls[hidden] { display: none; }
.note-inline-controls button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line-bright); background: #151d21; color: #edf3f4; cursor: pointer; font-size: 15px; font-weight: 820; }
.note-inline-controls button:hover { border-color: var(--cyan); color: var(--cyan); }
.note-inline-controls > span { margin-left: auto; color: #aeb9be; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.note-inline-controls > span strong { color: var(--cyan); font-size: 15px; }
.note-inline-offline { display: flex; align-items: center; gap: 16px; padding: 16px; }
.note-inline-offline[hidden] { display: none; }
.note-inline-offline img { width: 160px; height: 90px; flex: 0 0 auto; object-fit: cover; filter: brightness(.66) saturate(.76); }
.note-inline-offline p { margin: 0; color: #c5ced2; font-size: 16px; line-height: 1.5; }

.button { min-height: 50px; padding: 0 22px; border: 1px solid transparent; border-radius: 0; cursor: pointer; font-size: 14px; font-weight: 850; letter-spacing: 0.06em; transition: filter 140ms ease, border-color 140ms ease, background 140ms ease; }
.button:hover:not(:disabled) { filter: brightness(1.12); }
.button:focus-visible, .text-button:focus-visible, .quiet-button:focus-visible, input:focus-visible, .match-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: 0.32; }
.button-primary { background: #edf3f4; color: #0c1114; }
.button-secondary { border-color: var(--line-bright); background: #1b2329; }
.button-accent { min-width: 192px; background: var(--cyan); color: #041012; }
.text-button, .quiet-button { border: 0; background: transparent; color: #bdc7cc; cursor: pointer; font-size: 13px; font-weight: 750; }
.text-button { padding: 9px 0; border-bottom: 1px solid #46535c; }
.quiet-button { padding: 9px 0; color: #8b989f; letter-spacing: 0.05em; }
.quiet-button:hover { color: var(--cyan); }

.workspace[hidden] { display: none; }
.workspace.is-source-offline .source-player-disclosure { display: none; }
.panel { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.source-section { position: relative; isolation: isolate; overflow: hidden; padding: 12px 16px; }
.source-offline { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; margin-top: 8px; padding: 8px 11px; border: 1px solid #6c5a2e; border-left: 4px solid #e8c45d; background: rgba(106, 80, 20, .12); }
.source-offline { display: none !important; }
.source-offline[hidden] { display: none; }
.source-offline span { color: #a99a70; font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.source-offline > div { display: flex; min-width: 0; align-items: center; }
.source-offline strong { display: inline-block; margin-left: 9px; color: #f0d981; font-size: 15px; letter-spacing: .06em; }
.source-offline p { display: inline; margin-left: 12px; overflow: hidden; color: #b8b09b; font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.source-offline .button { min-height: 36px; padding-inline: 15px; font-size: 12px; }
.recording-reconnect-status { flex: 0 1 auto; margin: 0 0 0 auto; color: #eaffff; font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; font-weight: 900; letter-spacing: .04em; text-align: right; white-space: nowrap; }
.recording-reconnect-status[hidden] { display: none; }
.workspace.is-source-offline:not(.is-source-reconnecting) .recording-reconnect-status { color: #f0d981; }
.recording-heading, .virtual-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.recording-heading { flex-wrap: wrap; }
.recording-process-stages { display: flex; min-height: 34px; flex: 0 1 460px; align-self: flex-end; align-items: flex-end; gap: 10px; min-width: 350px; color: #657279; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; font-weight: 850; letter-spacing: .05em; line-height: 1.2; white-space: nowrap; }
.recording-process-stage { color: inherit; transition: color 120ms ease; }
.recording-process-stage-separator { display: inline-block; min-width: 26px; flex: 1 1 auto; color: #3f5058; font-size: 18px; font-weight: 800; letter-spacing: 0; line-height: 1; text-align: center; transform: scaleX(1.45); transform-origin: center bottom; }
.recording-process-stage.is-active { color: var(--cyan); font-weight: 950; text-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 34%, transparent); }
.recording-process-stages.is-processing .recording-process-stage.is-active { animation: recording-process-stage-pulse 1.4s ease-in-out infinite; }
@keyframes recording-process-stage-pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 38%, transparent); }
  50% { opacity: .38; text-shadow: 0 0 4px color-mix(in srgb, var(--cyan) 18%, transparent); }
}
.recording-process-status { --process-color: var(--cyan); --process-fill: 0%; position: relative; width: 100%; overflow: hidden; padding: 9px 12px 8px; border: 1px solid color-mix(in srgb, var(--process-color) 44%, #29343a); background: #0d1418; isolation: isolate; }
.recording-process-status[hidden] { display: none; }
.recording-process-status::before { content: ""; position: absolute; z-index: -1; inset: 0 auto 0 0; width: var(--process-fill); background: color-mix(in srgb, var(--process-color) 18%, transparent); transition: width 140ms linear; }
.recording-process-status[data-stage="detail"] { --process-color: var(--detail-process); }
.recording-process-status[data-stage="complete"] { --process-color: #79d8c7; }
.recording-process-status[data-stage="error"] { --process-color: #ff8d8d; }
.recording-process-status > header, .recording-process-status > footer { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.recording-process-status > header strong { color: #f4f7f8; font-size: 17px; font-weight: 950; letter-spacing: .035em; }
.recording-process-status > header span { color: var(--process-color); font-family: "Cascadia Mono", Consolas, monospace; font-size: 16px; font-weight: 900; white-space: nowrap; }
.recording-process-meter { height: 10px; margin: 7px 0 6px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--process-color) 42%, #334047); background: #10171a; }
.recording-process-meter span { display: block; width: var(--process-fill); height: 100%; background: var(--process-color); box-shadow: 0 0 16px color-mix(in srgb, var(--process-color) 52%, transparent); transition: width 140ms linear; }
.recording-process-status > footer { color: #bdc7cb; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; font-weight: 750; }
.recording-process-status > footer strong { color: #e4e9eb; font-size: inherit; }
.recording-process-stages[data-active-stage="timeline"] ~ .recording-process-status:not([hidden]) #recording-process-detail { animation: timeline-progress-breathe 2.8s ease-in-out infinite; }
@keyframes timeline-progress-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .42; } }
.recording-process-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.recording-process-actions button { min-height: 34px; padding: 0 13px; border: 1px solid var(--cyan); background: var(--cyan); color: #041012; cursor: pointer; font-size: 12px; font-weight: 900; letter-spacing: .055em; }
.recording-process-actions button:hover:not(:disabled) { filter: brightness(1.1); }
.recording-process-actions button:disabled { cursor: not-allowed; opacity: .42; }
.recording-process-actions button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.recording-title-line { display: flex; align-items: flex-end; gap: 14px; }
.recording-title-editor { min-width: 0; }
.recording-title-heading { display: flex; min-width: 0; align-items: center; gap: 6px; }
.recording-title-line h2 { max-width: min(60vw, 700px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recording-title-line > span { color: #56636a; }
.recording-title-line > strong { font-family: "Cascadia Mono", Consolas, monospace; font-size: 17px; }
.source-details { margin-top: 5px; color: #87949b; font-size: 12px; font-weight: 750; letter-spacing: 0.09em; }
.mode-actions { display: flex; align-items: flex-end; gap: 16px; }
.recording-background-status { --background-state-color: var(--cyan); display: inline-flex; min-height: 30px; align-items: center; gap: 7px; margin: 0; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--background-state-color) 50%, #344047); background: color-mix(in srgb, var(--background-state-color) 9%, #0b1114); color: #aebbc0; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 850; letter-spacing: .055em; white-space: nowrap; }
.recording-background-status[hidden] { display: none; }
.recording-background-status strong { color: var(--background-state-color); font-size: inherit; }
.recording-background-status[data-state="complete"] { --background-state-color: #79d8c7; }
.recording-background-status[data-state="stopped"] { --background-state-color: #ff8d8d; }
.recording-background-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--background-state-color); box-shadow: 0 0 9px color-mix(in srgb, var(--background-state-color) 70%, transparent); }
.recording-background-status[data-state="active"] .recording-background-dot { animation: recording-background-pulse 1.1s ease-in-out infinite; }
@keyframes recording-background-pulse { 50% { opacity: .35; transform: scale(.75); } }
.back-link-button { display: inline-flex; align-items: flex-end; gap: 9px; padding-bottom: 0; border-bottom: 0; font-size: 14px; transition: color 140ms ease, text-shadow 140ms ease; }
.back-link-button:hover { color: var(--cyan); text-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 58%, transparent); }
.back-link-icon { display: grid; width: 32px; height: 24px; place-items: center; color: var(--cyan); transition: filter 140ms ease; }
.back-link-button:hover .back-link-icon { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--cyan) 74%, transparent)); }
.back-link-icon svg { width: 32px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; stroke-width: 2.6; }
.mode-badge { padding: 8px 11px; border: 1px solid var(--line-bright); color: #b9c3c8; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 800; letter-spacing: 0.11em; }
.mode-badge.is-virtual { border-color: var(--cyan); background: var(--cyan-deep); color: var(--cyan); }
.mode-badge.is-steam-raw { border-color: #4ebac5; background: #102c31; color: var(--cyan); }

.analysis-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 300px) 48px auto; align-items: center; gap: 14px; min-height: 54px; margin-top: 10px; padding: 9px 12px; border: 1px solid var(--line); background: #0a0e11; }
.analysis-panel[hidden] { display: none; }
.analysis-copy { display: flex; align-items: baseline; min-width: 0; gap: 12px; }
.analysis-copy span { flex: 0 0 auto; color: #85939a; font-size: 12px; font-weight: 850; letter-spacing: 0.1em; }
.analysis-copy strong { flex: 0 0 auto; font-size: 15px; letter-spacing: 0.06em; }
.analysis-copy small { overflow: hidden; color: #9da8ad; font-size: 13px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.analysis-meter { height: 8px; overflow: hidden; border: 1px solid #344047; background: #12181c; }
.analysis-meter span { display: block; width: 0; height: 100%; background: var(--cyan); box-shadow: 0 0 14px rgba(88, 225, 239, 0.48); transition: width 120ms linear; }
.analysis-panel > strong { color: #aeb9bf; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; text-align: right; }
.analysis-panel[data-state="complete"] .analysis-copy strong { color: var(--cyan); }
.analysis-panel[data-state="error"] .analysis-copy strong { color: #ff7c7c; }
.reanalyze-button { padding-inline: 4px; white-space: nowrap; }

.steam-raw-panel { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); background: #0a0e11; }
.steam-raw-panel[hidden] { display: none; }
.steam-raw-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.steam-raw-heading > div { display: flex; align-items: baseline; gap: 14px; }
.steam-raw-heading span { color: #8f9ca3; font-size: 13px; font-weight: 850; letter-spacing: 0.1em; }
.steam-raw-heading strong { font-size: 16px; letter-spacing: 0.055em; }
.raw-phase { padding: 5px 8px; border: 1px solid #3e4a51; font-family: "Cascadia Mono", Consolas, monospace; }
.steam-raw-panel[data-state="ready"] .raw-phase,
.steam-raw-panel[data-state="ready"] .steam-raw-heading strong { color: var(--cyan); border-color: #3b7076; }
.steam-raw-panel[data-state="error"] .raw-phase,
.steam-raw-panel[data-state="error"] .steam-raw-heading strong { color: #ff7c7c; border-color: #753f3f; }
.steam-raw-detail { margin-top: 7px; overflow: hidden; color: #a3adb2; font-size: 14px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.steam-raw-diagnostics { display: grid; grid-template-columns: 2.4fr repeat(4, 1fr); gap: 1px; margin-top: 10px; background: var(--line); }
.steam-raw-diagnostics dl { min-width: 0; margin: 0; padding: 9px 10px; background: #0d1215; }
.steam-raw-diagnostics dt { color: #829097; font-size: 13px; font-weight: 850; letter-spacing: 0.09em; }
.steam-raw-diagnostics dd { margin: 5px 0 0; overflow: hidden; color: #e3e8ea; font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.steam-codecs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 9px; }
.steam-codecs p { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px; border: 1px solid #283138; background: #090c0e; }
.steam-codecs span { color: #929fa6; font-size: 13px; font-weight: 850; letter-spacing: 0.1em; }
.steam-codecs code { overflow: hidden; color: #cbd3d6; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.steam-codecs strong { color: #ff7c7c; font-size: 13px; letter-spacing: 0.05em; }
.steam-codecs strong[data-supported="true"] { color: var(--cyan); }
.steam-raw-error { margin-top: 9px; padding: 9px 11px; border-left: 3px solid #ff6969; background: rgba(111, 31, 31, 0.22); color: #ffaaaa; font-size: 14px; line-height: 1.45; }
.steam-raw-error[hidden] { display: none; }

.raw-scan-panel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.raw-scan-panel[hidden], .raw-scan-progress[hidden], .raw-scan-result[hidden], .accuracy-panel[hidden], .refinement-panel[hidden], .harvest-live[hidden], .harvest-ready[hidden] { display: none; }
.progressive-harvest { min-height: 78px; margin: 8px 0 0; padding: 10px 12px; border: 1px solid #3d545b; background: linear-gradient(115deg, rgba(88, 225, 239, .075), rgba(10, 14, 16, .95) 48%); }
.progressive-harvest[hidden] { display: none; }
.progressive-harvest > .progressive-preflight dl:not(.harvest-estimate),
.progressive-harvest > .self-ring-name-setting,
.progressive-harvest > .character-harvest-panel,
.progressive-harvest > .progressive-poc-result { display: none; }
.progressive-harvest > .progressive-preflight { grid-template-columns: minmax(220px, 1fr); max-width: 360px; background: transparent; }
.progressive-harvest > .progressive-preflight .harvest-estimate { border: 1px solid var(--line); }
body:has(.development-debug[open]) .progressive-harvest > .progressive-preflight { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(180px, 1.25fr); max-width: none; background: var(--line); }
body:has(.development-debug[open]) .progressive-harvest > .progressive-preflight dl:not(.harvest-estimate),
body:has(.development-debug[open]) .progressive-harvest > .self-ring-name-setting,
body:has(.development-debug[open]) .progressive-harvest > .character-harvest-panel:not([hidden]) { display: grid; }
.progressive-harvest > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.progressive-harvest > header .button { display: none; }
body:has(.development-debug[open]) .progressive-harvest > header .button:not([hidden]) { display: inline-flex; }
.progressive-harvest:has(.harvest-live:not([hidden])) > header,
.progressive-harvest:has(.harvest-live:not([hidden])) > .progressive-preflight,
.progressive-harvest:has(.harvest-ready:not([hidden])) > header,
.progressive-harvest:has(.harvest-ready:not([hidden])) > .progressive-preflight { display: none; }
.progressive-harvest > header > div { display: flex; align-items: baseline; gap: 13px; }
.progressive-harvest > header span { color: #91a0a7; font-size: 13px; font-weight: 850; letter-spacing: .1em; }
.progressive-harvest > header strong { font-size: 17px; letter-spacing: .045em; }
.progressive-preflight { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(180px, 1.25fr); gap: 1px; margin-top: 12px; background: var(--line); }
.progressive-preflight dl { min-width: 0; margin: 0; padding: 10px; background: #0c1114; }
.progressive-preflight dt { color: #829097; font-size: 12px; font-weight: 850; letter-spacing: .075em; }
.progressive-preflight dd { margin: 5px 0 0; overflow: hidden; color: #e3e8ea; font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.progressive-preflight .harvest-estimate dd { color: var(--cyan); }
.self-ring-name-setting { display: grid; grid-template-columns: auto minmax(180px, 320px) auto 1fr; align-items: center; gap: 9px; margin-top: 10px; }
.self-ring-name-setting label { color: #98a5aa; font-size: 12px; font-weight: 850; letter-spacing: .09em; }
.self-ring-name-setting input { min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); background: #080c0e; color: var(--text); font-size: 14px; }
.self-ring-name-setting span { color: #7f8d93; font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.harvest-live { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; margin-top: 7px; }
.harvest-progress { height: 11px; overflow: hidden; border: 1px solid #3b4b52; background: #10171a; }
.harvest-progress span { display: block; width: 0; height: 100%; background: var(--cyan); box-shadow: 0 0 16px rgba(88,225,239,.55); transition: width 120ms linear; }
.harvest-live > strong { min-width: 46px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; text-align: right; }
.harvest-live > p { display: flex; justify-content: space-between; color: #a9b4b8; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.harvest-countdown { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 2px; }
.harvest-countdown span { color: #93a0a6; font-size: 22px; font-weight: 850; letter-spacing: .08em; }
.harvest-countdown strong { color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 22px; }
.harvest-ready { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 18px; margin: 0; padding: 9px 11px; border-left: 3px solid var(--detail-process); background: color-mix(in srgb, var(--detail-process) 18%, #0d1418); }
.harvest-ready > div { display: flex; flex-direction: column; gap: 3px; }
.harvest-ready > div strong { font-size: 19px; letter-spacing: .04em; }
.harvest-ready > div span { color: var(--detail-process); font-size: 13px; font-weight: 850; letter-spacing: .09em; }
.harvest-ready > p { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.harvest-ready > p[hidden] { display: none; }
.harvest-ready > p span { color: #e0e6e8; font-size: 14px; font-weight: 850; }
.harvest-ready > p strong { color: #aeb9bd; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.character-harvest-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid #344249; }
.character-harvest-panel[hidden], .character-harvest-metrics[hidden] { display: none; }
.character-harvest-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.character-harvest-panel > header > div { display: flex; align-items: baseline; gap: 11px; }
.character-harvest-panel > header span { color: #8e9aa1; font-size: 12px; font-weight: 850; letter-spacing: .09em; }
.character-harvest-panel > header strong { font-size: 15px; letter-spacing: .045em; }
.character-harvest-panel > p { margin-top: 8px; color: #a4afb4; font-size: 13px; }
.character-harvest-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin-top: 10px; background: var(--line); }
.character-harvest-metrics dl { margin: 0; padding: 8px 9px; background: #0d1215; }
.character-harvest-metrics dt { color: #829097; font-size: 11px; font-weight: 850; letter-spacing: .07em; }
.character-harvest-metrics dd { margin: 4px 0 0; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; font-weight: 800; }
.ring-name-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 8px; background: var(--line); }
.ring-name-metrics[hidden] { display: none; }
.ring-name-metrics dl { margin: 0; padding: 8px 9px; background: #0d1215; }
.ring-name-metrics dt { color: #829097; font-size: 11px; font-weight: 850; letter-spacing: .07em; }
.ring-name-metrics dd { margin: 4px 0 0; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; font-weight: 800; }
.ground-truth-builder { margin-bottom: 12px; padding: 11px; border: 1px solid #334047; background: #0a0e10; }
.ground-truth-builder header, .accuracy-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ground-truth-builder header > div, .accuracy-panel > header > div { display: flex; align-items: baseline; gap: 12px; }
.ground-truth-builder header span, .accuracy-panel header span { color: #8e9aa1; font-size: 13px; font-weight: 850; letter-spacing: .09em; }
.ground-truth-builder header strong, .accuracy-panel header strong { font-size: 15px; letter-spacing: .035em; }
.ground-truth-builder header > p { color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; font-weight: 800; }
.ground-truth-actions { display: grid; grid-template-columns: auto minmax(115px, .7fr) auto minmax(115px, .7fr) minmax(190px, 1fr); gap: 8px; margin-top: 10px; }
.ground-truth-actions .button { min-height: 40px; padding: 8px 13px; font-size: 12px; }
.ground-truth-actions > p { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 5px 9px; border: 1px solid #2f3a40; background: #101619; }
.ground-truth-actions > p span { color: #819097; font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.ground-truth-actions > p strong { margin-top: 2px; color: #e3e8ea; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.ground-truth-help { margin-top: 7px; color: #87949a; font-size: 13px; }
.ground-truth-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.ground-truth-item { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 9px; padding: 7px 8px 7px 10px; border-left: 3px solid #e8edf0; background: #151b1f; }
.ground-truth-item strong { font-size: 13px; letter-spacing: .05em; }
.ground-truth-item span { grid-column: 1; color: #bec8cc; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.ground-truth-item button { grid-column: 2; grid-row: 1 / 3; border: 0; background: transparent; color: #8e9aa1; cursor: pointer; font-size: 17px; }
.accuracy-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.refinement-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.refinement-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.refinement-panel > header > div { display: flex; align-items: baseline; gap: 12px; }
.refinement-panel header span { color: #8e9aa1; font-size: 13px; font-weight: 850; letter-spacing: .09em; }
.refinement-panel header strong { font-size: 15px; letter-spacing: .035em; }
.refinement-panel > header .button { min-height: 38px; font-size: 12px; }
.refinement-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 9px; background: var(--line); }
.refinement-metrics dl { margin: 0; padding: 8px 9px; background: #0d1215; }
.refinement-metrics dt { color: #829097; font-size: 12px; font-weight: 850; letter-spacing: .07em; }
.refinement-metrics dd { margin: 4px 0 0; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; font-weight: 800; }
.refinement-table td { white-space: nowrap; }
.accuracy-panel > header .button { min-height: 38px; font-size: 12px; }
.accuracy-table { margin-top: 10px; }
.accuracy-timeline { margin-top: 10px; padding: 10px; border: 1px solid #2d383e; background: #080b0d; }
.accuracy-timeline-row { display: grid; grid-template-columns: 122px minmax(0, 1fr); align-items: center; gap: 10px; margin: 5px 0; }
.accuracy-timeline-row > span { color: #95a1a7; font-size: 12px; font-weight: 850; letter-spacing: .05em; }
.accuracy-timeline-track { position: relative; height: 18px; background: #151b1e; }
.accuracy-timeline-block { position: absolute; top: 3px; bottom: 3px; min-width: 2px; background: #e9eef0; }
.accuracy-timeline-row.detector .accuracy-timeline-block { background: var(--cyan); }
.accuracy-timeline-scale { display: flex; justify-content: space-between; margin-left: 132px; color: #6f7d84; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; }
.accuracy-sweep { margin-top: 9px; }
.accuracy-sweep summary { color: #aab4b9; cursor: pointer; font-size: 13px; font-weight: 850; letter-spacing: .06em; }
.failure-gallery-section { margin-top: 12px; }
.failure-gallery-section h3 { font-size: 14px; letter-spacing: .075em; }
.failure-gallery-section h3 span { margin-left: 8px; color: #819097; font-size: 12px; }
.failure-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.failure-card { overflow: hidden; border: 1px solid #303a40; background: #0b1012; }
.failure-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.failure-card div { padding: 8px; }
.failure-card strong { display: block; color: #ffb46a; font-size: 13px; letter-spacing: .05em; }
.failure-card p { margin-top: 3px; color: #bdc7cb; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.raw-scan-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.raw-scan-heading > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.raw-scan-heading span { color: #8e9aa1; font-size: 13px; font-weight: 850; letter-spacing: 0.08em; }
.raw-scan-heading strong { font-size: 15px; letter-spacing: 0.045em; }
.raw-scan-controls { display: flex; align-items: center; gap: 12px; }
.raw-scan-controls .button { min-height: 38px; padding-inline: 15px; font-size: 12px; }
.raw-scan-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; margin-top: 9px; }
.raw-scan-progress > div { height: 9px; overflow: hidden; border: 1px solid #354148; background: #12181c; }
.raw-scan-progress > div span { display: block; width: 0; height: 100%; background: var(--cyan); box-shadow: 0 0 14px rgba(88, 225, 239, 0.5); transition: width 120ms linear; }
.raw-scan-progress > strong { min-width: 42px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; text-align: right; }
.raw-scan-progress p { grid-column: 1 / -1; display: flex; justify-content: space-between; color: #a4afb4; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.raw-scan-result { margin-top: 10px; }
.raw-scan-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.raw-scan-metrics dl { margin: 0; padding: 8px 9px; background: #0d1215; }
.raw-scan-metrics dt { color: #829097; font-size: 12px; font-weight: 850; letter-spacing: 0.07em; }
.raw-scan-metrics dd { margin: 4px 0 0; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; font-weight: 800; }
.raw-scan-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.raw-scan-table th, .raw-scan-table td { padding: 6px 9px; border: 1px solid var(--line); text-align: right; }
.raw-scan-table th:first-child, .raw-scan-table td:first-child { text-align: left; }
.raw-scan-table th { color: #87949b; font-size: 12px; letter-spacing: 0.06em; }
.raw-scan-extrapolation { margin-top: 7px; color: #a5b0b5; font-size: 13px; line-height: 1.45; }

.video-frame { position: relative; overflow: hidden; width: min(100%, 700px); margin: 10px auto 0; border: 1px solid #20272c; background: #000; aspect-ratio: 16 / 9; }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.source-time { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.source-time > span:first-child { margin-right: auto; color: #a5b0b6; font-size: 12px; font-weight: 850; letter-spacing: 0.14em; }
.source-time strong { font-family: "Cascadia Mono", Consolas, monospace; font-size: 31px; font-variant-numeric: tabular-nums; }
.source-time small, .source-time > span:last-child { color: #929ea5; font-family: "Cascadia Mono", Consolas, monospace; font-size: 17px; }

.source-player-disclosure { margin-top: 8px; border: 1px solid var(--line); background: #0a0e11; }
.source-player-disclosure > summary { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; color: #a8b4b9; cursor: pointer; list-style: none; }
.source-player-disclosure > summary::-webkit-details-marker { display: none; }
.source-player-disclosure > summary span { font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.source-player-disclosure > summary strong { color: #d7dfe2; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.source-player-toggle::after { content: "OPEN SOURCE"; color: var(--cyan); font-size: 12px; letter-spacing: .08em; }
.source-player-disclosure[open] .source-player-toggle::after { content: "CLOSE SOURCE"; }
.source-player-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.source-player-body { padding: 0 12px 10px; }

.manual-tools { max-width: 1080px; margin: 7px auto 0; border-top: 1px solid var(--line); }
.manual-tools summary { width: max-content; padding: 10px 0 4px; color: #aab5ba; cursor: pointer; font-size: 14px; font-weight: 800; letter-spacing: 0.04em; list-style: none; }
.manual-tools summary::-webkit-details-marker { display: none; }
.manual-tools summary:hover { color: var(--cyan); }
.manual-tools[open] summary { color: var(--cyan); }

.source-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(200px, 0.75fr); align-items: stretch; gap: 14px; max-width: 1080px; margin: 14px auto 0; }
.capture-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.capture-step p { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 8px 14px; border: 1px solid var(--line); background: #090c0e; }
.capture-step p span { color: #8b979e; font-size: 12px; font-weight: 850; letter-spacing: 0.11em; }
.capture-step p strong { margin-top: 4px; overflow: hidden; color: #aeb8bd; font-family: "Cascadia Mono", Consolas, monospace; font-size: 16px; text-overflow: ellipsis; }
.capture-step p.is-set { border-color: #39555a; }
.capture-step p.is-set strong { color: var(--cyan); }
.capture-arrow { align-self: center; color: #66747c; font-size: 17px; }
.add-match-button { min-height: 58px; }
.source-footnote { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1080px; margin: 7px auto 0; }
.source-footnote > p:not(.error-message) { color: #87949b; font-size: 13px; line-height: 1.65; }
.error-message { color: #ff7c7c; font-size: 14px; line-height: 1.5; }

.virtual-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-bright); }

.development-debug { margin-top: 12px; border: 1px solid #26323a; background: #0a0e11; }
.development-debug > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 13px 15px; color: #9ba8ae; cursor: pointer; list-style: none; }
.development-debug > summary::-webkit-details-marker { display: none; }
.development-debug > summary span { font-size: 13px; font-weight: 900; letter-spacing: .1em; }
.development-debug > summary small { color: #6f7e85; font-size: 12px; }
.development-debug > summary::after { content: "+"; color: var(--cyan); font-size: 18px; }
.development-debug[open] > summary::after { content: "−"; }
.development-debug[open] > summary { border-bottom: 1px solid var(--line); color: var(--cyan); }
.development-debug-content { padding: 12px; }
.development-debug-content > :first-child { margin-top: 0; }
.development-debug-content .manual-tools { max-width: none; }
.development-code-fingerprint { margin-bottom: 10px; padding: 12px; border: 1px solid #36535b; background: #091114; }
.development-code-fingerprint > strong { color: #f1f5f6; font-size: 13px; letter-spacing: .08em; }
.development-code-fingerprint dl { display: grid; gap: 5px; margin: 8px 0 0; }
.development-code-fingerprint dl > div { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 10px; }
.development-code-fingerprint dt { color: #77878e; font-size: 11px; font-weight: 850; letter-spacing: .06em; }
.development-code-fingerprint dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #8f9ca2; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; }
.development-code-fingerprint dd[data-state="success"] { color: var(--cyan); }
.development-code-fingerprint dd[data-state="failure"] { color: #ff8c8c; }
.display-metadata-regeneration { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; padding: 12px; border: 1px solid #36535b; background: #091114; }
.display-metadata-regeneration > div { display: grid; gap: 5px; }
.display-metadata-regeneration strong { color: #f1f5f6; font-size: 13px; letter-spacing: .08em; }
.display-metadata-regeneration output { color: #8f9ca2; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; white-space: pre-line; }
.display-metadata-regeneration output[data-state="success"] { color: var(--cyan); }
.display-metadata-regeneration output[data-state="failure"] { color: #ff8c8c; }
.display-metadata-regeneration .button { flex: 0 0 auto; min-height: 42px; }
.raw-boundary-review { margin-bottom: 10px; padding: 12px; border: 1px solid #36535b; background: #091114; }
.raw-boundary-review > header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.raw-boundary-review > header > div { display: flex; align-items: baseline; gap: 12px; }
.raw-boundary-review > header span { color: #83939a; font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.raw-boundary-review > header strong { color: #f1f5f6; font-size: 16px; letter-spacing: .045em; }
.raw-boundary-review > header p { margin: 0; color: #8f9ca2; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 850; }
.raw-boundary-review.is-connected > header p { color: var(--cyan); }
.raw-boundary-review-actions { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: end; gap: 9px; margin-top: 10px; }
.raw-boundary-review-actions .button { min-height: 42px; padding-inline: 14px; font-size: 12px; }
.raw-boundary-review-actions label { display: grid; gap: 5px; color: #8d9aa1; font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.raw-boundary-review-actions input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-bright); background: #080c0f; color: #f2f6f7; font-family: "Cascadia Mono", Consolas, monospace; font-size: 16px; }
.raw-boundary-review-actions input[aria-invalid="true"] { border-color: #ff7c7c; }
.raw-boundary-review-body[hidden] { display: none; }
.raw-boundary-review-video-slot { width: min(100%, 960px); margin: 12px auto 0; aspect-ratio: 16 / 9; }
.raw-boundary-review-video-slot > p { display: grid; height: 100%; margin: 0; place-items: center; color: #66757c; font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.raw-boundary-review-video-slot:has(video) > p { display: none; }
.raw-boundary-review-video-slot video { width: 100%; height: 100%; object-fit: contain; }
.match-player-frame.is-boundary-review-detached { display: none; }
.raw-boundary-review-controls { display: grid; grid-template-columns: auto auto auto minmax(220px, 1fr); align-items: center; gap: 8px; width: min(100%, 960px); margin: 8px auto 0; }
.raw-boundary-review-controls button, .raw-boundary-review-presets button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line-bright); background: #151d21; color: #e8eef0; cursor: pointer; font-size: 12px; font-weight: 850; }
.raw-boundary-review-controls button:hover, .raw-boundary-review-presets button:hover { border-color: var(--cyan); color: var(--cyan); }
.raw-boundary-review-controls > p { display: flex; align-items: baseline; justify-content: flex-end; gap: 9px; margin: 0; color: #87959c; font-family: "Cascadia Mono", Consolas, monospace; }
.raw-boundary-review-controls > p span { font-size: 11px; }
.raw-boundary-review-controls > p strong { color: var(--cyan); font-size: 18px; }
.raw-boundary-review-controls > p small { font-size: 12px; }
.raw-boundary-review-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: min(100%, 960px); margin: 8px auto 0; }
.raw-boundary-review-presets > span { margin-left: 8px; color: #8f9ca2; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 900; }
.raw-boundary-review-presets > span:first-child { margin-left: 0; }
.raw-boundary-review-presets button { min-height: 34px; padding-inline: 9px; font-family: "Cascadia Mono", Consolas, monospace; }
.virtual-heading { align-items: center; }
.virtual-heading-actions { display: flex; align-items: center; gap: 10px; }
.virtual-heading-actions .button { min-height: 42px; }
.virtual-heading h2 { font-size: clamp(27px, 2.4vw, 34px); }
.virtual-summary { margin-top: 5px; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; font-weight: 800; letter-spacing: 0.05em; }
.virtual-empty { display: grid; min-height: 128px; place-content: center; gap: 9px; margin-top: 16px; border: 1px dashed var(--line); background: rgba(14, 18, 21, 0.5); text-align: center; }
.virtual-empty strong { font-size: 19px; }
.virtual-empty p { color: #9ba6ac; font-size: 15px; line-height: 1.6; }
.virtual-content[hidden], .virtual-empty[hidden], .button[hidden] { display: none; }
.virtual-content { margin-top: 7px; }
.virtual-time-row { display: flex; align-items: baseline; justify-content: space-between; padding: 5px 12px; border: 1px solid var(--line); border-bottom: 0; background: var(--panel); }
.virtual-time-row > span { color: #a5b0b6; font-size: 12px; font-weight: 850; letter-spacing: 0.14em; }
.virtual-time-row strong { font-family: "Cascadia Mono", Consolas, monospace; font-size: 20px; }
.virtual-time-row small { color: #7f8c93; font-size: 16px; }
.virtual-time-row strong span { color: var(--text); }
.virtual-track { position: relative; display: flex; height: 22px; overflow: hidden; border: 1px solid var(--line); background: #090c0e; }
.timeline-segment { position: relative; min-width: 2px; overflow: hidden; border-right: 2px solid var(--bg); background: #202b31; }
.timeline-segment:last-of-type { border-right: 0; }
.timeline-segment span { position: absolute; top: 50%; left: 10px; z-index: 2; color: #c1cacf; font-size: 12px; font-weight: 750; transform: translateY(-50%); }
.virtual-fill { position: absolute; inset: 0 auto 0 0; z-index: 1; width: 0; background: rgba(88, 225, 239, 0.32); pointer-events: none; transition: width 80ms linear; }
.card-help { display: none; }
body:has(.development-debug[open]) .card-help { display: block; margin: 5px 0 7px; color: #929da3; font-size: 13px; line-height: 1.5; text-align: right; }

.match-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.match-card { position: relative; display: block; min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: border-color 140ms ease, transform 140ms ease, background 140ms ease; }
.match-card:hover { border-color: var(--line-bright); background: #141a1e; transform: translateY(-2px); }
.match-card.is-active { border-color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(88, 225, 239, 0.22); }
.match-card[data-status="rough"] { border-style: dashed; }
.match-card[data-status="refining"] { border-color: #d8bd67; }
.match-status { display: inline-flex; width: max-content; margin-top: 8px; padding: 3px 6px; border: 1px solid #536168; color: #aeb8bd; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.match-status.is-rough { border-color: #65727a; color: #c4cdd1; }
.match-status.is-refining { border-color: #8a7845; color: #f1d77f; }
.match-status.is-refined { border-color: #37666b; color: var(--cyan); }
.match-status.is-ready { border-color: #37666b; color: var(--cyan); }
.thumbnail-wrap { position: relative; min-height: 0; overflow: hidden; background: #050708; aspect-ratio: 16 / 9; }
.thumbnail-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumbnail-wrap::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(8, 10, 12, 0.72)); pointer-events: none; }
.thumbnail-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #8a979e; font-size: 13px; letter-spacing: 0.1em; }
.match-info { padding: 10px; }
.match-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.match-title { font-size: 15px; font-weight: 900; letter-spacing: 0.07em; }
.match-duration { color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.match-range { margin-top: 9px; color: #d9dfe2; font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; white-space: nowrap; }
.match-characters { margin-top: 6px; overflow: hidden; color: #f1f4f5; font-size: 13px; font-weight: 850; letter-spacing: .035em; text-overflow: ellipsis; white-space: nowrap; }
.match-characters .unknown { color: #87949a; }
.match-winner { margin-top: 4px; color: #99a6ac; font-size: 12px; font-weight: 750; }
.match-winner strong { color: var(--cyan); letter-spacing: .06em; }
.match-winner strong.unknown { color: #87949a; }
.match-ring-names { margin-top: 6px; color: #b9c4c8; font-size: 12px; font-weight: 750; }
.match-ring-names .unknown { color: #75838a; }
.match-outcome { display: none; margin-top: 6px; padding: 3px 7px; border: 1px solid #43545b; color: #87949a; font-size: 12px; font-weight: 900; letter-spacing: .1em; }
body:has(.development-debug[open]) .match-outcome { display: inline-block; }
.match-outcome.is-win { border-color: var(--cyan); color: var(--cyan); }
.match-outcome.is-loss { border-color: #b86169; color: #ff9ca5; }
.match-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.match-action-buttons { display: flex; min-width: 0; align-items: center; gap: 6px; }
.play-match { flex: 1; padding: 6px 9px; border: 1px solid var(--cyan); background: var(--cyan-deep); color: var(--cyan); cursor: pointer; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.edit-match { padding: 7px 0; border: 0; border-bottom: 1px solid #5a676e; background: transparent; color: #bac3c7; cursor: pointer; font-size: 13px; font-weight: 850; letter-spacing: 0.08em; }
.edit-match { display: none; }
.match-ring-names, .match-range { display: none; }
body:has(.development-debug[open]) .edit-match { display: inline-block; }
body:has(.development-debug[open]) .match-ring-names,
body:has(.development-debug[open]) .match-range { display: block; }
.keep-video { padding: 6px 8px; border: 1px solid #49626a; background: #121a1e; color: #d2dadd; cursor: pointer; font-size: 10px; font-weight: 900; letter-spacing: .05em; white-space: nowrap; }
.keep-video:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.keep-video:disabled { cursor: not-allowed; opacity: .42; }
.keep-video.is-complete { border-color: #37666b; color: var(--cyan); }
.keep-video-status { display: block; margin-top: 7px; color: #9eabb0; font-size: 11px; line-height: 1.4; }
.keep-video-status.is-error { color: #ff9ca5; }
.match-editor { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.match-editor[hidden] { display: none; }
.match-editor > span { padding-bottom: 11px; color: #829097; font-size: 13px; }
.match-time-group label { display: block; margin-bottom: 7px; color: #929ea4; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }
.match-time-input { width: 100%; min-width: 0; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 0; background: #090c0e; color: var(--text); font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; }
.match-time-input.is-invalid { border-color: var(--red); }
.match-metadata-editor { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.match-metadata-editor label { color: #929ea4; font-size: 11px; font-weight: 800; letter-spacing: .07em; }
.match-meta-input { width: 100%; min-width: 0; height: 38px; margin-top: 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: 0; background: #090c0e; color: var(--text); font-size: 13px; }
.editor-footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 4px; }
.delete-match { padding: 7px 0; border: 0; background: transparent; color: #a7b1b6; cursor: pointer; font-size: 12px; }
.delete-match:hover { color: #ff7c7c; }

.match-note-count { display: inline-flex; width: max-content; align-items: center; margin-top: 7px; padding: 4px 7px; border: 1px solid rgba(88, 225, 239, .48); background: rgba(88, 225, 239, .11); color: #e2fbff; font-size: 12px; font-weight: 900; letter-spacing: .035em; }
.match-note-count::before { content: "●"; margin-right: 6px; color: var(--cyan); font-size: 8px; }
.match-media-source { display: inline-flex; width: max-content; margin-top: 7px; padding: 3px 6px; border: 1px solid #44535a; color: #95a2a8; font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.match-media-source.is-local-clip { border-color: #3c7b82; color: var(--cyan); }
.match-media-source.is-steam-raw { border-color: #4a626c; color: #b8c8ce; }
.match-media-source.is-offline { border-color: #6f484d; color: #d48b92; }
.mode-badge.is-local-clip { border-color: #3c7b82; color: var(--cyan); }
.annotation-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line-bright); }
.annotation-section[hidden] { display: none; }
.annotation-section > header { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.annotation-section h3 { margin: 0; font-size: 25px; letter-spacing: .04em; }
.annotation-section > header > strong { color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .08em; }
.annotation-empty { margin-top: 10px; padding: 18px; border: 0; color: #c3cdd1; font-size: 16px; line-height: 1.5; text-align: center; }
.annotation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.annotation-card { display: grid; grid-template-columns: minmax(150px, 42%) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.annotation-card:hover { border-color: var(--cyan); }
.annotation-card.is-out-of-range { border-color: #806c39; background: #18150d; }
.annotation-card > img { width: 100%; height: 100%; min-height: 118px; object-fit: cover; background: #000; }
.annotation-card-body { display: flex; flex-direction: column; min-width: 0; padding: 13px; }
.annotation-card-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.annotation-card-topline strong { font-size: 15px; letter-spacing: .065em; }
.annotation-card-topline code { color: var(--cyan); font-size: 14px; }
.annotation-boundary-status { margin: 4px 0 0; color: #e5cb71; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; font-weight: 800; }
.annotation-card-context { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 3px; }
.annotation-card-context span { overflow: hidden; color: #b9c5c9; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.annotation-card-context b { flex: 0 0 auto; color: #fff; font-size: 13px; }
.annotation-card-text { flex: 1; margin-top: 8px; color: #e2e7e9; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.annotation-card-text.is-empty { color: #7f8c92; }
.annotation-card-actions { display: flex; justify-content: flex-end; gap: 13px; margin-top: 9px; }
.annotation-card-actions button { padding: 4px 0; border: 0; border-bottom: 1px solid #526168; background: transparent; color: #aeb8bd; cursor: pointer; font-size: 12px; font-weight: 800; }
.annotation-card-actions .collect-annotation { display: none; margin-right: auto; color: var(--cyan); border-bottom-color: rgba(55, 219, 239, .52); }
.annotation-card-actions .collect-annotation.is-collected { color: #80d69c; border-bottom-color: rgba(128, 214, 156, .45); cursor: default; }
.annotation-card-actions .collect-annotation:disabled { opacity: .7; }
.annotation-card-actions .delete-annotation:hover { color: #ff7c7c; }
.annotation-edit { display: grid; gap: 8px; margin-top: 8px; }
.annotation-edit textarea, .annotation-composer textarea { width: 100%; resize: vertical; border: 1px solid var(--line-bright); border-radius: 0; background: #090c0e; color: var(--text); font: inherit; line-height: 1.5; }
.annotation-edit textarea { min-height: 72px; padding: 8px; }
.annotation-edit-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (min-width: 1400px) {
  .match-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1600px) {
  .match-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

body:has(.development-debug[open]) .match-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.annotation-composer { width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 1px solid var(--line-bright); background: #0f1417; color: var(--text); box-shadow: 0 26px 90px rgba(0,0,0,.7); }
.annotation-composer::backdrop { background: rgba(1, 4, 6, .78); backdrop-filter: blur(4px); }
.annotation-composer form { padding: 18px; }
.annotation-composer header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.annotation-composer header h2 { font-size: 27px; }
.annotation-close { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; color: #bdc7cc; cursor: pointer; font-size: 24px; }
.annotation-composer img { display: block; width: 100%; margin-top: 14px; border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; object-fit: contain; }
.annotation-capture-meta { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; margin-top: 11px; }
.annotation-capture-meta strong { font-size: 17px; letter-spacing: .07em; }
.annotation-capture-meta > span { display: flex; min-width: 0; align-items: baseline; gap: 7px; color: #b8c2c6; font-size: 14px; }
.annotation-capture-meta > span > span:not(.perspective-self-badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annotation-capture-meta code { color: var(--cyan); font-size: 16px; }
.annotation-text-label { display: block; margin-top: 14px; color: #a8b3b8; font-size: 13px; font-weight: 850; letter-spacing: .08em; }
.annotation-composer textarea { min-height: 92px; margin-top: 7px; padding: 10px; }
.annotation-composer footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 13px; }

.steam-recording-help { width: min(560px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-bright); background: #0f1417; color: var(--text); box-shadow: 0 26px 90px rgba(0,0,0,.7); }
.steam-recording-help::backdrop { background: rgba(1, 4, 6, .78); backdrop-filter: blur(4px); }
.steam-recording-help form { padding: 22px; }
.steam-recording-help header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.steam-recording-help header h2 { font-size: 25px; }
.steam-recording-help-intro { margin-top: 15px; color: #b9c4c8; font-size: 14px; }
.steam-recording-help ol { display: grid; gap: 7px; margin: 15px 0 0; padding: 0; list-style: none; }
.steam-recording-help li { display: grid; grid-template-columns: 30px 1fr; align-items: center; min-height: 42px; padding: 6px 10px; border: 1px solid #344249; background: #0a0f12; }
.steam-recording-help li > span { display: grid; width: 22px; height: 22px; place-items: center; background: rgba(88,225,239,.14); color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.steam-recording-help li strong { font-size: 15px; }
.steam-recording-help li b { color: var(--cyan); font-size: 17px; }
.steam-recording-help-note { margin-top: 15px; padding-left: 11px; border-left: 3px solid var(--cyan); color: #c8d2d6; font-size: 13px; line-height: 1.65; }
.steam-recording-path-example { display: block; margin-top: 6px; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-weight: 800; letter-spacing: .03em; }
.steam-recording-path-example b { padding: 0 5px; color: #89979e; font-size: 15px; }
.steam-recording-help footer { display: flex; justify-content: flex-end; margin-top: 17px; }
.steam-recording-help footer .button { min-width: 120px; }

.recording-delete-dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 1px solid #74434a; background: #0f1417; color: var(--text); box-shadow: 0 26px 90px rgba(0,0,0,.76); }
.recording-delete-dialog::backdrop { background: rgba(1, 4, 6, .82); backdrop-filter: blur(4px); }
.recording-delete-dialog form { padding: 22px; }
.recording-delete-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.recording-delete-dialog header h2 { font-size: 25px; }
.recording-delete-target { margin-top: 20px; color: #edf3f4; font-size: 18px; line-height: 1.5; }
.recording-delete-target strong { color: var(--cyan); }
.recording-delete-scope { margin-top: 12px; padding: 13px 14px; border-left: 4px solid var(--cyan); background: rgba(88, 225, 239, .07); color: #c5d0d4; font-size: 16px; line-height: 1.65; }
.recording-delete-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.recording-delete-dialog footer .button { min-width: 130px; min-height: 44px; }
.recording-delete-confirm { border-color: #a24f59; background: #a83f4b; color: #fff; }
.recording-delete-confirm:hover:not(:disabled) { background: #c14c59; }

.perspective-dialog { width: min(620px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-bright); background: #0f1417; color: var(--text); box-shadow: 0 26px 90px rgba(0,0,0,.76); }
.perspective-dialog::backdrop { background: rgba(1, 4, 6, .82); backdrop-filter: blur(4px); }
.perspective-dialog form { padding: 22px; }
.perspective-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.perspective-once-note { margin: 8px 0 4px; color: #c3cdd1; font-size: 15px; font-weight: 750; line-height: 1.45; }
.perspective-dialog header h2 { font-size: 28px; }
.perspective-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.perspective-choices button { min-height: 56px; padding: 10px 14px; border: 1px solid var(--cyan); background: #12333a; color: #effeff; cursor: pointer; font-size: 17px; font-weight: 900; }
.perspective-choices button:hover { background: var(--cyan); color: #041012; }
.perspective-choices button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 920px) {
  .recording-process-stages { order: 3; flex-basis: 100%; width: 100%; }
  .recording-process-status { order: 4; }
  .analysis-panel { grid-template-columns: minmax(0, 1fr) 48px auto; }
  .analysis-copy { grid-column: 1 / -1; }
  .analysis-meter { grid-column: 1; }
  .source-actions { grid-template-columns: 1fr auto 1fr; }
  .add-match-button { grid-column: 1 / -1; }
  .source-actions > .capture-arrow:nth-of-type(2) { display: none; }
  .match-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recording-library-list { grid-template-columns: 1fr; }
  .annotation-list { grid-template-columns: 1fr; }
  .match-card { grid-template-columns: 1fr; }
  .thumbnail-wrap { min-height: 0; aspect-ratio: 16 / 9; }
  .steam-raw-diagnostics { grid-template-columns: repeat(3, 1fr); }
  .steam-raw-diagnostics dl:first-child { grid-column: span 2; }
  .progressive-preflight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progressive-preflight .harvest-estimate { grid-column: 1 / -1; }
  .character-harvest-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ring-name-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .self-ring-name-setting { grid-template-columns: 1fr auto; }
  .self-ring-name-setting label, .self-ring-name-setting span { grid-column: 1 / -1; }
}

@media (min-width: 1000px) and (max-height: 1000px) {
  .app-shell { padding-top: 10px; }
  .source-section { padding: 14px 18px; }
  .analysis-panel { min-height: 48px; margin-top: 8px; padding-block: 7px; }
  .steam-raw-panel { margin-top: 8px; padding-block: 9px; }
  .steam-raw-diagnostics { margin-top: 8px; }
  .steam-raw-diagnostics dl { padding-block: 7px; }
  .steam-codecs { margin-top: 7px; }
  .steam-codecs p { padding-block: 6px; }
  .raw-scan-panel { margin-top: 8px; padding-top: 8px; }
  .raw-scan-result { margin-top: 8px; }
  .raw-scan-metrics dl { padding-block: 6px; }
  .video-frame { width: min(100%, 620px); margin-top: 8px; }
  .source-time { padding: 8px 0; }
  .source-actions { margin-top: 10px; }
  .source-footnote { margin-top: 6px; }
  .virtual-section { margin-top: 14px; padding-top: 12px; }
  .virtual-content { margin-top: 8px; }
  .virtual-time-row { padding-block: 7px; }
  .virtual-track { height: 26px; }
  .card-help { margin: 5px 0 7px; }
  .match-card, .thumbnail-wrap { min-height: 118px; }
}

@media (max-width: 680px) {
  .app-shell { width: min(100% - 24px, 1240px); padding-top: 18px; }
  .drop-zone { grid-template-columns: 1fr; padding: 26px; text-align: center; }
  .drop-actions { width: 100%; }
  .drop-icon { margin: 0 auto; }
  .recording-library { padding: 14px; }
  .recording-library > header { align-items: stretch; flex-direction: column; gap: 12px; }
  .recording-library-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .recording-library-tools select { width: 100%; min-width: 0; }
  .source-section { padding: 14px; }
  .recording-heading, .virtual-heading { align-items: flex-start; flex-direction: column; }
  .recording-process-stages { min-width: 0; align-self: flex-start; gap: 7px; font-size: 12px; }
  .source-offline { grid-template-columns: 1fr; }
  .source-offline .button { width: 100%; }
  .virtual-heading-actions { width: 100%; }
  .virtual-heading-actions .button { flex: 1; min-width: 0; }
  .recording-title-line h2 { max-width: 70vw; font-size: 23px; }
  .mode-actions { width: 100%; justify-content: space-between; gap: 10px; }
  .recording-background-status { margin-right: auto; }
  .analysis-panel { grid-template-columns: 1fr auto; }
  .analysis-copy { align-items: flex-start; flex-direction: column; gap: 4px; }
  .analysis-copy small { white-space: normal; }
  .analysis-meter { grid-column: 1; }
  .steam-raw-heading, .steam-raw-heading > div { align-items: flex-start; flex-direction: column; gap: 6px; }
  .steam-raw-detail { white-space: normal; }
  .steam-raw-diagnostics, .steam-codecs { grid-template-columns: 1fr; }
  .steam-raw-diagnostics dl:first-child { grid-column: auto; }
  .raw-scan-heading, .raw-scan-heading > div:first-child { align-items: flex-start; flex-direction: column; gap: 7px; }
  .raw-scan-controls { width: 100%; }
  .raw-scan-controls .button { flex: 1; }
  .raw-scan-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raw-scan-table { font-size: 12px; }
  .ground-truth-actions { grid-template-columns: 1fr 1fr; }
  .ground-truth-actions .button:last-child { grid-column: 1 / -1; }
  .accuracy-panel > header, .refinement-panel > header, .ground-truth-builder header { align-items: flex-start; flex-direction: column; }
  .refinement-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .failure-gallery { grid-template-columns: 1fr; }
  .source-time strong { font-size: 26px; }
  .source-actions { grid-template-columns: 1fr; gap: 10px; }
  .capture-step { grid-template-columns: 142px 1fr; }
  .capture-arrow { display: none; }
  .add-match-button { grid-column: auto; }
  .source-footnote { align-items: flex-start; flex-direction: column; }
  .virtual-heading .button-accent { width: 100%; }
  .annotation-card { grid-template-columns: 1fr; }
  .annotation-card > img { aspect-ratio: 16 / 9; min-height: 0; }
  .annotation-capture-meta { grid-template-columns: 1fr auto; }
  .annotation-capture-meta > span { grid-column: 1 / -1; grid-row: 2; }
  .match-list { grid-template-columns: 1fr; }
  .recording-library-card { grid-template-columns: 1fr; }
  .recording-library-card img, .recording-library-thumb-empty { aspect-ratio: 16 / 9; min-height: 0; }
  .virtual-empty { min-height: 160px; padding: 30px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  #home-view-notes[aria-selected="false"], #home-view-notes[aria-selected="false"]::after { animation: none; }
  .recording-background-status[data-state="active"] .recording-background-dot { animation: none; }
  .recording-process-stages.is-processing .recording-process-stage.is-active { animation: none; }
  .recording-process-stages[data-active-stage="timeline"] ~ .recording-process-status:not([hidden]) #recording-process-detail { animation: none; }
}

@media (max-width: 680px) {
  .note-context-library { padding: 14px; }
  .note-context-library > header { align-items: stretch; flex-direction: column; }
  .note-context-library-tools { flex-wrap: wrap; justify-content: space-between; }
  .note-context-search { width: 100%; }
  .note-context-card { padding: 18px 15px; }
  .note-context-derived strong { font-size: 17px; }
  .note-context-text { font-size: 19px; }
  .note-context-body { grid-template-columns: 1fr; align-items: stretch; gap: 12px; }
  .note-context-actions { width: 100%; flex-wrap: wrap; }
  .note-context-edit-actions { justify-content: flex-end; }
  .note-context-details, .note-context-watch { flex: 1 1 0; }
  .note-context-details summary, .note-context-watch { width: 100%; }
  .note-context-details > div { right: auto; left: 0; min-width: min(260px, calc(100vw - 58px)); }
  .note-inline-player > header { grid-template-columns: minmax(0, 1fr) auto; }
  .note-inline-status { grid-column: 1 / -1; grid-row: 2; }
  .note-inline-controls button { flex: 1 1 auto; }
  .note-inline-controls > span { width: 100%; margin-left: 0; text-align: right; }
  .note-inline-offline { align-items: flex-start; flex-direction: column; }
  .perspective-choices { grid-template-columns: 1fr; }
}

/* Replay Lab session detail: the user works with one selected Match at a time. */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.source-section { padding: 12px 16px 10px; }
.recording-heading { align-items: flex-end; }
@media (max-width: 680px) {
  .recording-heading { align-items: flex-start; }
}
.recording-date { margin-bottom: 3px; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; font-weight: 900; letter-spacing: .08em; }
.recording-library-info .recording-library-date { margin: 0 0 4px; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; letter-spacing: .08em; }
.recording-title-line { align-items: flex-end; gap: 14px; }
.recording-title-line h2 { max-width: min(65vw, 900px); font-size: 25px; }
.recording-detail-title-form { width: min(620px, 65vw); margin-top: 2px; }
.session-summary { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; margin: 0; color: #9aa7ad; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; font-weight: 800; white-space: nowrap; }
.session-summary strong { color: #dbe3e6; font-size: inherit; }
.session-summary > span:nth-child(even) { color: #536067; }

.analysis-panel { grid-template-columns: minmax(210px, auto) minmax(220px, 1fr) 52px; min-height: 46px; margin-top: 8px; padding: 7px 10px; }
.analysis-copy span, .analysis-copy small, .analysis-panel .reanalyze-button { display: none; }
.analysis-copy strong { font-size: 14px; }
.progressive-harvest { min-height: 0; margin-top: 8px; padding: 8px 10px; }
.progressive-harvest > header, .progressive-harvest > .progressive-preflight, .progressive-harvest > .self-ring-name-setting { display: none !important; }
.harvest-live { margin: 0; padding: 0; border: 0; }
.harvest-ready { min-height: 0; padding: 0; border: 0; background: transparent; }
.harvest-ready > div { display: none; }
.harvest-ready > p { width: 100%; min-height: 30px; flex-direction: row; align-items: center; justify-content: space-between; padding: 5px 7px; border-left: 3px solid var(--detail-process); background: color-mix(in srgb, var(--detail-process) 18%, #0d1418); }
.harvest-ready > p .button { min-height: 30px; padding: 5px 12px; font-size: 11px; }

.virtual-section.session-detail { margin-top: 10px; padding: 0; border: 0; }
.session-two-pane { display: grid; grid-template-columns: minmax(0, .75fr) minmax(600px, 1.25fr); gap: 12px; margin-top: 0; }
.match-viewer, .match-browser { min-width: 0; border: 1px solid var(--line); background: rgba(14, 19, 22, .9); box-shadow: var(--shadow); }
.match-viewer { position: relative; align-self: start; padding: 8px 14px 14px; }
.match-browser { padding: 8px 13px 13px; }
.match-viewer-heading, .match-index-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.match-viewer-heading h2, .match-index-heading h2 { margin: 0; font-size: 22px; line-height: 1; }
.match-viewer-title-row { display: flex; align-items: baseline; gap: 12px; }
.selected-match-status { margin: 5px 0 0; color: #e5cb71; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.selected-match-status[hidden] { display: none; }
.selected-match-edit { display: inline-block; padding: 0; border-bottom: 0; line-height: 1; }
.selected-match-edit:disabled { cursor: default; opacity: .38; }
.match-player-frame.video-frame { width: min(100%, 680px); max-width: 680px; margin: 8px auto 0; }
.match-player-frame video.is-match-switching { visibility: hidden; }
.match-player-controls { display: grid; width: min(100%, 680px); margin: 0 auto; box-sizing: border-box; grid-template-columns: 40px 58px minmax(100px, 1fr) 58px 120px; align-items: center; gap: 9px; min-height: 48px; padding: 7px 8px; border: 1px solid var(--line); border-top: 0; background: #080b0d; }
.match-player-controls > span { color: #c8d1d5; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; text-align: center; }
.match-player-play { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid var(--cyan); background: var(--cyan); color: #041012; cursor: pointer; font-size: 13px; font-weight: 900; }
.match-player-controls input[type="range"] { width: 100%; accent-color: var(--cyan); cursor: pointer; }
.match-player-audio { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 6px; }
.match-player-mute { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 1px solid var(--line-bright); background: #151c20; color: var(--cyan); cursor: pointer; }
.match-player-mute:hover { border-color: var(--cyan); }
.match-player-mute:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.match-player-mute svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: square; stroke-linejoin: miter; stroke-width: 1.8; }
.match-player-mute .audio-speaker { fill: currentColor; stroke: none; }
.match-player-mute .audio-slash { display: none; stroke-width: 2.3; }
.match-player-mute.is-muted .audio-waves { display: none; }
.match-player-mute.is-muted .audio-slash { display: block; }
.match-timeline { width: 100%; margin: 8px auto 0; padding: 10px 12px 11px; border: 1px solid var(--line); background: #0a0e11; box-sizing: border-box; }
.match-timeline[hidden] { display: none; }
.match-timeline > header { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.match-timeline > header h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 950; letter-spacing: .1em; }
.match-timeline-summary { display: flex; gap: 10px; margin: 0; color: #aeb9be; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 850; letter-spacing: .04em; }
.match-timeline-summary strong:last-child { color: var(--cyan); }
.match-timeline-axis { display: flex; justify-content: space-between; margin: 7px 3px 2px 54px; color: #9ca9af; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; font-weight: 750; }
.match-timeline-chart { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: stretch; gap: 6px; }
.match-timeline-labels { display: grid; grid-template-rows: 1fr 1fr; color: #8e9ba1; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; font-weight: 950; letter-spacing: .04em; text-align: right; }
.match-timeline-labels > span { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-timeline-labels > span:first-child { color: #7bc8ff; }
.match-timeline-labels > span:last-child { color: #a79cff; }
.match-timeline-labels .perspective-self-badge { padding-inline: 2px; border-color: currentColor; color: inherit; }
.match-timeline-character { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.match-timeline-track { --timeline-progress: 0%; position: relative; height: 62px; border: 1px solid #273239; background: #070a0c; cursor: crosshair; }
.match-timeline-track::before { content: ""; position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: #344147; }
.match-timeline-track::after { content: ""; position: absolute; z-index: 2; top: 2px; bottom: 2px; left: var(--timeline-progress); width: 1px; background: rgba(88, 225, 239, .58); pointer-events: none; }
.match-timeline-scope-band { position: absolute; z-index: 1; top: 0; bottom: 0; left: var(--timeline-start); width: var(--timeline-width); pointer-events: none; }
.match-timeline-scope-band.is-excluded { background: rgba(125, 136, 142, .12); box-shadow: inset 1px 0 rgba(180, 190, 195, .18), inset -1px 0 rgba(180, 190, 195, .18); }
.match-timeline-scope-band.is-unknown { background: repeating-linear-gradient(135deg, rgba(223, 178, 71, .14) 0 6px, rgba(223, 178, 71, .04) 6px 12px); box-shadow: inset 1px 0 rgba(223, 178, 71, .35), inset -1px 0 rgba(223, 178, 71, .35); }
.match-timeline-marker { position: absolute; z-index: 2; top: 50%; left: var(--timeline-position); display: block; padding: 0; border: 0; transform: translate(-50%, -50%); cursor: pointer; }
.match-timeline-marker:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.match-timeline-marker.is-damage { left: var(--timeline-start); width: var(--timeline-width); min-width: 3px; height: max(2px, var(--timeline-delta-height)); background: #7bc8ff; box-shadow: 0 0 0 1px rgba(5, 8, 10, .9); transform: none; transform-origin: center bottom; }
.match-timeline-marker.is-damage[data-attacker-side="left"] { top: auto; bottom: 50%; }
.match-timeline-marker.is-damage[data-attacker-side="right"] { top: 50%; background: #a79cff; transform-origin: center top; }
.match-timeline-marker.is-note { z-index: 4; width: 14px; height: 14px; border: 2px solid #061013; background: var(--cyan); box-shadow: 0 0 0 2px var(--cyan), 0 0 12px rgba(88, 225, 239, .72); transform: translate(-50%, -50%) rotate(45deg); }
.match-timeline-marker.is-note:hover, .match-timeline-marker.is-note:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(88, 225, 239, .58); }
.match-timeline-marker.is-damage:hover, .match-timeline-marker.is-damage:focus-visible { background: #fff; }
.match-timeline-marker.is-damage.is-sequence-related { filter: brightness(1.22); box-shadow: 0 0 0 1px rgba(255, 255, 255, .78), 0 0 7px rgba(88, 225, 239, .34); }
.match-timeline-empty { margin: 7px 0 0 92px; color: #96a3a9; font-size: 12px; }
.match-viewer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.match-viewer-actions .button { min-width: 0; min-height: 42px; font-size: 12px; }
.match-viewer-actions .button[hidden] { display: block; visibility: hidden; }
.match-viewer-actions .is-complete { border-color: #39747b; background: #112a2e; color: var(--cyan); }
.match-viewer > .keep-video-status { min-height: 16px; margin: 5px 0 0; }

.source-info { position: relative; margin-top: 8px; border-color: #465761; background: #172128; }
.workspace.is-source-offline .source-player-disclosure.source-info { display: block; }
.source-info .source-player-toggle::after { content: "+"; }
.source-info[open] .source-player-toggle::after { content: "−"; }
.source-info-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; padding: 8px; background: #465761; }
.source-info-body dl { min-width: 0; margin: 0; padding: 8px 9px; background: #202c34; }
.source-info .source-offline { margin: 0; border-top: 0; }
.source-info-body dt { color: #718087; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.source-info-body dd { margin: 4px 0 0; overflow: hidden; color: #c3cdd1; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.source-info-body .mode-badge { display: inline-flex; padding: 2px 5px; font-size: 10px; }

.match-index-heading { margin-bottom: 8px; }
.match-index-heading .virtual-summary { margin: 0; line-height: 1; }
.match-list.match-index { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; max-height: 390px; padding-right: 7px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.match-index-card { min-width: 0; overflow: hidden; border: 1px solid #303a40; background: #0a0e11; cursor: pointer; transition: border-color .14s ease, transform .14s ease; }
.match-index-card:hover { border-color: #607078; transform: translateY(-1px); }
.match-index-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.match-index-card.is-active { border-width: 5px; border-color: var(--cyan); box-shadow: none; }
.match-index-card.is-background-processing:not(.is-active) { border-style: dashed; border-color: var(--cyan); }
.match-index-thumb { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #050708; }
.match-index-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter .16s ease; }
.match-index-card:not(.is-active) .match-index-thumb img { filter: brightness(.62) saturate(.78); }
.match-index-card.is-active .match-index-thumb img { filter: none; }
.match-index-note { position: absolute; top: 5px; right: 5px; padding: 3px 6px; background: var(--cyan); color: #041012; font-size: 13px; font-weight: 950; line-height: 1; }
.match-index-status { position: absolute; bottom: 4px; left: 4px; padding: 2px 4px; background: rgba(8,10,12,.88); color: #d9c572; font-size: 9px; font-weight: 900; }
.match-index-info { min-height: 40px; padding: 5px 7px 6px; transition: background-color .16s ease; }
.match-index-card[data-status="rough"] .match-index-info { background: #182026; }
.match-index-card[data-status="refining"] .match-index-info { background: rgba(122, 101, 37, .34); }
.match-index-card[data-status="ready"] .match-index-info { background: rgba(36, 105, 112, .32); }
.match-index-card.is-review-open { border-color: #806c39; }
.match-index-card.is-review-open .match-index-info { background: rgba(111, 88, 35, .34); }
.match-index-label { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0; }
.match-index-label strong { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.match-index-label .perspective-self-badge { padding-inline: 3px; font-size: 10px; }
.match-index-label .match-index-character { min-width: 0; overflow: hidden; color: #d2dadd; font-size: 10px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.match-index-label .match-index-character.is-winner { color: var(--cyan); }
.match-index-label > small { flex: 0 0 auto; color: #8f9ba1; font-size: 8px; font-weight: 850; }
.match-index-winner { margin: 3px 0 0 27px; color: #8f9ba1; font-family: "Cascadia Mono", Consolas, monospace; font-size: 9px; font-weight: 800; letter-spacing: .03em; }
.match-index-winner.is-review-open { color: #f0d47b; }
.timeline-segment[data-review-open="true"] { background: #4b3d20; }
.match-index-winner strong { color: #e2e8ea; }

.selected-metadata-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.selected-metadata-editor[hidden] { display: none; }
.selected-metadata-editor label { color: #aab5ba; font-size: 12px; font-weight: 850; letter-spacing: .06em; }
.match-viewer-metadata-editor { position: absolute; z-index: 5; top: 51px; right: 14px; width: min(520px, calc(100% - 28px)); margin: 0; padding: 10px; border: 1px solid var(--line-bright); background: #0b0f12; box-shadow: 0 12px 34px rgba(0, 0, 0, .62); }
.debug-selected-match-editor { margin-bottom: 10px; padding: 11px; border: 1px solid var(--line); background: #090c0e; }
.debug-selected-match-editor:empty { display: none; }
.debug-selected-match-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.debug-selected-match-editor > header span { color: #85939a; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.debug-boundary-fields { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 8px; margin-top: 9px; }
.debug-boundary-fields label { color: #8d9aa1; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.debug-boundary-fields .delete-match { height: 42px; padding-inline: 10px; }

.match-browser .annotation-section { margin-top: 10px; padding-top: 10px; }
.match-browser .annotation-section h3 { font-size: 20px; }
.match-browser .annotation-list { grid-template-columns: 1fr; grid-auto-rows: max-content; align-content: start; max-height: 280px; overflow-y: auto; }
.match-browser .annotation-card { grid-template-columns: 144px minmax(0, 1fr); align-items: start; }
.match-browser .annotation-card > img {
  width: 144px;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  align-self: start;
  object-fit: cover;
  filter: brightness(.62) saturate(.78);
}
.match-browser .annotation-card-body { min-height: 81px; padding: 7px 10px; }
.match-browser .annotation-card-text {
  display: -webkit-box;
  flex: 0 1 auto;
  max-height: 2.7em;
  margin-top: 3px;
  overflow: hidden;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.match-browser .annotation-card-actions { margin-top: auto; padding-top: 3px; }
.match-browser .annotation-empty { padding: 12px; }

@media (min-width: 1700px) {
  .session-two-pane { grid-template-columns: minmax(0, .75fr) minmax(680px, 1.25fr); }
  .match-list.match-index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The two-pane workspace needs enough width for both the player controls and Match browser. */
@media (max-width: 1239px) {
  .session-two-pane { grid-template-columns: minmax(0, 1fr); }
}

/* In the normal session view, the workspace owns the full viewport height. */
@media (min-width: 1240px) {
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) { overflow: hidden; }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .app-shell {
    display: flex;
    height: 100dvh;
    flex-direction: column;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .workspace:not([hidden]) {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .virtual-section.session-detail {
    min-height: 0;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .virtual-content.session-two-pane {
    height: 100%;
    min-height: 0;
    align-items: stretch;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-viewer,
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-browser {
    height: 100%;
    min-height: 0;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-viewer {
    display: flex;
    align-self: stretch;
    flex-direction: column;
    overflow-y: auto;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-viewer-actions {
    margin-top: auto;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .source-info[open] {
    z-index: 20;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .source-info[open] .source-info-body {
    position: absolute;
    right: -1px;
    bottom: calc(100% + 1px);
    left: -1px;
    max-height: min(240px, calc(100dvh - 140px));
    overflow-y: auto;
    border: 1px solid #465761;
    box-shadow: 0 -16px 36px rgba(0, 0, 0, .54);
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-timeline:not([hidden]) {
    display: flex;
    width: 100%;
    min-height: 0;
    flex: 1 1 0;
    flex-direction: column;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-timeline-chart {
    flex: 1 1 0;
    min-height: 52px;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-timeline-track {
    height: auto;
    min-height: 52px;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-browser {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-browser .annotation-section:not([hidden]) {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-browser .annotation-empty:not([hidden]) {
    display: grid;
    flex: 1;
    min-height: 72px;
    place-items: center;
  }
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .match-browser .annotation-list {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
}

/* Keep the complete session workspace in one desktop viewport. */
@media (min-width: 1240px) and (max-height: 900px) {
  .app-shell { padding-top: 5px; padding-bottom: 6px; }
  .app-shell .replay-lab-header { margin-bottom: 5px; }
  .replay-lab-title { font-size: 24px; }

  .source-section { padding: 7px 12px 6px; }
  .recording-date { margin-bottom: 1px; font-size: 11px; }
  .recording-title-line { gap: 10px; }
  .recording-title-line h2 { font-size: 20px; }
  .recording-title-edit { flex-basis: 26px; width: 26px; height: 26px; }
  .recording-title-edit svg { width: 15px; }
  .session-summary { gap: 7px; font-size: 11px; }
  .recording-process-stages { flex-basis: 380px; min-width: 310px; gap: 17px; font-size: 12px; }
  .back-link-button { gap: 7px; font-size: 12px; }
  .back-link-icon, .back-link-icon svg { width: 28px; height: 22px; }

  .virtual-section.session-detail { margin-top: 7px; }
  .session-two-pane { gap: 9px; }
  .match-viewer, .match-browser { padding: 7px 9px 9px; }
  .match-viewer-heading, .match-index-heading { min-height: 0; }
  .match-viewer-heading h2, .match-index-heading h2 { font-size: 18px; line-height: 1.1; }
  .match-viewer-title-row { gap: 9px; }
  .match-player-frame.video-frame {
    width: min(100%, 680px, max(340px, calc((100dvh - 484px) * 16 / 9)));
    max-width: 680px;
    margin-top: 3px;
  }
  .match-player-controls { width: min(100%, 680px, max(340px, calc((100dvh - 484px) * 16 / 9))); min-height: 36px; grid-template-columns: 32px 50px minmax(80px, 1fr) 50px 100px; gap: 6px; padding: 3px 5px; }
  .match-player-controls > span { font-size: 10px; }
  .match-player-play { width: 28px; height: 28px; }
  .match-player-audio { grid-template-columns: 28px minmax(0, 1fr); gap: 4px; }
  .match-player-mute { width: 28px; height: 28px; }
  .match-player-mute svg { width: 17px; height: 17px; }

  .match-timeline { width: 100%; margin-top: 4px; padding: 5px 8px 6px; }
  .match-timeline > header { align-items: center; }
  .match-timeline > header h3 { font-size: 12px; line-height: 1.2; }
  .match-timeline-summary { gap: 8px; font-size: 12px; }
  .match-timeline-axis { margin: 4px 2px 2px 54px; font-size: 11px; line-height: 1.1; }
  .match-timeline-chart { grid-template-columns: 48px minmax(0, 1fr); gap: 6px; }
  .match-timeline-labels { font-size: 11px; }
  .match-timeline-track { height: 52px; }
  .match-timeline-marker.is-note { width: 11px; height: 11px; }
  .match-timeline-empty { margin: 4px 0 0 54px; font-size: 11px; line-height: 1.3; }

  .match-viewer-actions { gap: 6px; margin-top: auto; }
  .match-viewer-actions .button { min-height: 32px; font-size: 10px; }
  .match-viewer > .keep-video-status { min-height: 0; margin-top: 2px; font-size: 9px; line-height: 1.2; }
  .source-info { margin-top: 4px; }
  .source-player-disclosure > summary { min-height: 29px; padding: 4px 8px; }
  .source-player-disclosure > summary span { font-size: 10px; }
  .match-viewer .source-offline { gap: 4px 8px; margin-top: 4px; padding: 4px 7px; }
  .match-viewer .source-offline strong { margin-left: 0; font-size: 11px; }
  .match-viewer .source-offline .button { min-height: 28px; padding-inline: 10px; font-size: 10px; }

  .match-index-heading { margin-bottom: 5px; }
  .match-list.match-index { gap: 6px; max-height: clamp(207px, calc(100dvh - 513px), 390px); }
  .match-index-info { min-height: 34px; padding: 4px 6px; }
  .match-index-label { gap: 5px; }
  .match-index-label strong { font-size: 11px; }
  .match-index-label .perspective-self-badge { font-size: 9px; }
  .match-index-label .match-index-character { font-size: 9px; }
  .match-index-winner { margin-top: 2px; margin-left: 22px; font-size: 8px; }

  .match-viewer-metadata-editor { top: 44px; right: 9px; width: calc(100% - 18px); padding: 8px; }

  .match-browser .annotation-section { margin-top: 6px; padding-top: 6px; }
  .match-browser .annotation-section h3 { font-size: 16px; }
  .annotation-section > header > strong { font-size: 11px; }
  .match-browser .annotation-empty { margin-top: 5px; padding: 8px; font-size: 16px; }
  .match-browser .annotation-list { max-height: 105px; margin-top: 5px; gap: 5px; }

  .development-debug { margin-top: 7px; }
  .development-debug > summary { padding: 6px 11px; }
  .development-debug > summary span { font-size: 11px; }
  .development-debug > summary small { font-size: 10px; }
  .development-debug > summary::after { font-size: 14px; }
}
.replay-lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(122, 205, 255, 0.32);
  border-radius: 999px;
  background: rgba(6, 14, 22, 0.72);
  color: rgba(225, 240, 248, 0.58);
  font: 700 12px/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
}

html.is-vfprep-embedded #btnLang {
  display: none;
}

.lang-pill span + span::before {
  content: "/";
  margin-right: 8px;
  color: rgba(225, 240, 248, 0.26);
}

html[data-lang="jp"] .lang-pill span:first-child,
html[data-lang="en"] .lang-pill span:last-child {
  color: #8ddcff;
  text-shadow: 0 0 10px rgba(79, 202, 255, 0.45);
}

.vfp-shell-header {
  width: 100%;
  border-bottom: 1px solid rgba(88, 225, 239, .16);
  background:
    linear-gradient(180deg, rgba(5, 10, 14, .98), rgba(8, 14, 18, .94));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.vfp-shell-header-inner {
  display: flex;
  width: calc(100% - 48px);
  max-width: 1580px;
  min-height: 68px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vfp-shell-brand {
  display: inline-flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.vfp-shell-brand:link,
.vfp-shell-brand:visited {
  color: var(--text);
  text-decoration: none;
}

.vfp-shell-logo {
  display: block;
  width: 44px;
  height: 44px;
  max-width: 44px;
  flex: 0 0 auto;
  border-radius: 9px;
  object-fit: contain;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

.vfp-shell-tagline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.05;
  white-space: nowrap;
}

.vfp-shell-tagline-line {
  display: block;
}

.vfp-shell-tagline-accent {
  color: var(--cyan);
}

.vfp-shell-brand:hover .vfp-shell-logo {
  filter: brightness(1.08);
}

.vfp-shell-brand:hover .vfp-shell-tagline {
  color: var(--text);
}

.vfp-shell-brand:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

@media (min-width: 1240px) {
  body:has(.workspace:not([hidden])):not(:has(.development-debug[open])) .app-shell {
    height: calc(100dvh - 68px);
  }
}

.vfp-shell-footer {
  width: 100%;
  margin: 48px auto 0;
  padding: 28px 24px 34px;
  border-top: 1px solid rgba(141, 154, 163, .22);
  background: rgba(5, 9, 12, .48);
  color: var(--muted);
  text-align: center;
}

.vfp-shell-footer-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.vfp-shell-footer p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.7;
}

.vfp-shell-footer .vfp-shell-copyright {
  color: var(--text);
  font-weight: 700;
}

.vfp-shell-footer-links {
  padding-top: 4px;
}

.vfp-shell-footer a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration-color: rgba(88, 225, 239, .42);
  text-underline-offset: 3px;
}

.vfp-shell-footer a:visited {
  color: var(--cyan);
}

.vfp-shell-footer a:hover {
  color: #9cf4fb;
}

.vfp-shell-footer a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .vfp-shell-header-inner {
    width: calc(100% - 24px);
    min-height: 60px;
    gap: 10px;
  }

  .vfp-shell-brand {
    gap: 8px;
  }

  .vfp-shell-logo {
    width: 40px;
    height: 40px;
    max-width: 40px;
  }

  .vfp-shell-tagline {
    font-size: 14px;
  }

  .vfp-shell-footer {
    margin-top: 36px;
    padding: 24px 16px 28px;
  }
}

/* First-visit function tutorial */
.function-tutorial-open {
  min-height: 36px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: #b8c4c9;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1em;
}
.function-tutorial-open:hover { border-color: var(--cyan); color: var(--cyan); }
.function-tutorial-open:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.function-tutorial {
  width: min(940px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #4a5c66;
  border-radius: 0;
  background: #0b1013;
  color: var(--text);
  box-shadow: 0 34px 120px rgba(0, 0, 0, .78);
}
.function-tutorial::backdrop {
  background: rgba(2, 5, 7, .88);
  backdrop-filter: blur(7px);
}
.function-tutorial form { display: flex; max-height: calc(100dvh - 34px); flex-direction: column; }
.function-tutorial-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 23px 27px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(20, 63, 70, .28), transparent 55%);
}
.function-tutorial-header h2 { font-size: 27px; line-height: 1.2; }
.function-tutorial-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-bright);
  background: #11181c;
  color: #d8e1e4;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}
.function-tutorial-close:hover { border-color: var(--cyan); color: var(--cyan); }
.function-tutorial-close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.function-tutorial-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: #080c0e;
}
.function-tutorial-progress > span {
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  color: #75838a;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.function-tutorial-progress > span:last-child { border-right: 0; }
.function-tutorial-progress b {
  color: #647279;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  letter-spacing: .04em;
}
.function-tutorial-progress > .is-complete { color: #a7b4b9; }
.function-tutorial-progress > .is-complete b::before { content: "✓"; }
.function-tutorial-progress > .is-complete b { font-size: 0; color: var(--cyan); }
.function-tutorial-progress > .is-complete b::before { font-size: 14px; }
.function-tutorial-progress > .is-active {
  box-shadow: inset 0 -3px 0 var(--cyan);
  background: rgba(18, 63, 70, .55);
  color: #fff;
}
.function-tutorial-progress > .is-active b { color: var(--cyan); }

.function-tutorial-body { min-height: 0; flex: 1 1 auto; overflow: auto; }
.function-tutorial-step {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(380px, 1.06fr);
  min-height: 390px;
}
.function-tutorial-step[hidden] { display: none; }
.function-tutorial-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 40px 30px 42px;
}
.function-tutorial-number {
  margin-bottom: 15px;
  color: var(--cyan);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
}
.function-tutorial-copy h3 {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(27px, 3.4vw, 38px);
  line-height: 1.25;
  letter-spacing: -.035em;
}
.function-tutorial-copy > p:not(.function-tutorial-number):not(.function-tutorial-assurance):not(.function-tutorial-hint) {
  color: #c2ccd0;
  font-size: 16px;
  line-height: 1.85;
}
.function-tutorial-assurance {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  color: #d9f8fa;
  font-size: 15px;
  font-weight: 800;
}
.function-tutorial-assurance span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(88, 225, 239, .55);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 14px;
}
.function-tutorial-hint {
  margin-top: 20px;
  padding: 12px 14px;
  border-left: 3px solid var(--cyan);
  background: rgba(88, 225, 239, .07);
  color: #afbdc2;
  font-size: 14px;
  line-height: 1.65;
}

.function-tutorial-visual {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(rgba(88, 225, 239, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 225, 239, .045) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(40, 137, 148, .25), transparent 62%),
    #090e11;
  background-size: 28px 28px, 28px 28px, auto, auto;
}
.function-tutorial-visual::after {
  position: absolute;
  inset: 0;
  border: 18px solid rgba(5, 8, 10, .35);
  content: "";
  pointer-events: none;
}

.function-tutorial-visual-overview { display: grid; place-items: center; }
.function-orbit { width: 220px; height: 220px; border: 1px solid rgba(88, 225, 239, .32); border-radius: 50%; box-shadow: 0 0 55px rgba(88, 225, 239, .09), inset 0 0 40px rgba(88, 225, 239, .06); }
.function-orbit::before, .function-orbit::after { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(141, 154, 163, .17); border-radius: 50%; content: ""; transform: translate(-50%, -50%); }
.function-orbit::before { width: 304px; height: 304px; }
.function-orbit::after { width: 132px; height: 132px; }
.function-orbit-core { position: absolute; color: #cbd7da; font-family: "Cascadia Mono", Consolas, monospace; font-size: 15px; line-height: 1.2; text-align: center; letter-spacing: .08em; }
.function-orbit-core strong { color: #fff; font-size: 25px; letter-spacing: .02em; }
.function-orbit-node { position: absolute; display: grid; min-width: 74px; min-height: 38px; place-items: center; border: 1px solid var(--line-bright); background: #11191d; color: #cbd6da; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.function-orbit-node::before { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(88, 225, 239, .8); content: ""; }
.function-orbit-node-1 { top: 42px; left: 48px; }
.function-orbit-node-1::before { right: -4px; bottom: -4px; }
.function-orbit-node-2 { top: 42px; right: 48px; }
.function-orbit-node-2::before { bottom: -4px; left: -4px; }
.function-orbit-node-3 { right: 48px; bottom: 42px; }
.function-orbit-node-3::before { top: -4px; left: -4px; }
.function-orbit-node-4 { bottom: 42px; left: 48px; }
.function-orbit-node-4::before { top: -4px; right: -4px; }

.function-tutorial-visual-input { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 54px 28px 76px; }
.tutorial-input-card { display: flex; width: 145px; min-height: 172px; flex-direction: column; justify-content: center; padding: 20px 16px; border: 1px solid var(--line-bright); background: #11181c; }
.tutorial-input-card.is-primary { border-color: rgba(88, 225, 239, .72); background: #113b41; }
.tutorial-input-card > span { margin-bottom: 19px; color: var(--cyan); font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; font-weight: 900; }
.tutorial-input-card strong { color: #fff; font-size: 16px; line-height: 1.35; letter-spacing: .02em; }
.tutorial-input-card small { margin-top: 14px; color: #aab6bb; font-size: 13px; }
.tutorial-input-join { display: flex; width: 34px; flex-direction: column; align-items: center; gap: 8px; color: #77868d; font-size: 12px; }
.tutorial-input-join i { width: 1px; height: 35px; background: var(--line-bright); }
.tutorial-local-badge { position: absolute; right: 50%; bottom: 35px; padding: 8px 13px; border: 1px solid rgba(88, 225, 239, .35); color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: .1em; transform: translateX(50%); white-space: nowrap; }

.function-tutorial-visual-review { padding: 62px 40px 35px; }
.tutorial-stage-flow { display: flex; align-items: center; color: #708087; font-size: 12px; font-weight: 850; }
.tutorial-stage-flow span { padding: 6px 8px; border: 1px solid var(--line); background: #0c1215; }
.tutorial-stage-flow span.is-done { border-color: rgba(88, 225, 239, .42); color: var(--cyan); }
.tutorial-stage-flow span.is-current { border-color: #8f81ea; color: #c9c2ff; }
.tutorial-stage-flow i { min-width: 13px; height: 1px; flex: 1 1 auto; background: var(--line-bright); }
.tutorial-player { position: relative; display: grid; min-height: 145px; margin-top: 25px; place-items: center; border: 1px solid var(--line-bright); background: radial-gradient(circle at 50% 40%, #20323a, #070a0c 70%); }
.tutorial-player-play { display: grid; width: 52px; height: 52px; place-items: center; padding-left: 4px; border: 1px solid var(--cyan); border-radius: 50%; background: rgba(9, 20, 23, .78); color: var(--cyan); font-size: 19px; }
.tutorial-player strong { position: absolute; top: 13px; left: 14px; color: #fff; font-size: 14px; }
.tutorial-player small { position: absolute; right: 14px; bottom: 12px; color: #c6d1d4; font-size: 13px; font-weight: 800; }
.tutorial-player small b { margin: 0 5px; color: var(--cyan); }
.tutorial-timeline { position: relative; height: 8px; margin-top: 18px; background: #263037; }
.tutorial-timeline span { display: block; width: 61%; height: 100%; background: var(--cyan); }
.tutorial-timeline i { position: absolute; top: -4px; width: 3px; height: 16px; background: #fff; }
.tutorial-timeline .at-1 { left: 21%; }.tutorial-timeline .at-2 { left: 46%; }.tutorial-timeline .at-3 { left: 78%; }
.tutorial-match-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 16px; }
.tutorial-match-strip b { display: grid; height: 36px; place-items: center; border: 1px solid var(--line); background: #11181c; color: #77868d; font-size: 12px; }
.tutorial-match-strip b.is-active { border-color: var(--cyan); background: var(--cyan-deep); color: #fff; }

.function-tutorial-visual-note { padding: 43px 40px 34px; }
.tutorial-note-frame { position: relative; height: 154px; overflow: hidden; border: 1px solid var(--line-bright); background: linear-gradient(154deg, #54342e 0 24%, #141d22 25% 55%, #2b4b55 56% 100%); }
.tutorial-note-frame::before, .tutorial-note-frame::after { position: absolute; bottom: 18px; width: 84px; height: 72px; border-radius: 50% 50% 15% 15%; background: #090d0f; content: ""; transform: rotate(-16deg); }
.tutorial-note-frame::before { left: 58px; }.tutorial-note-frame::after { right: 50px; transform: rotate(20deg); }
.tutorial-note-frame > span { position: absolute; right: 10px; bottom: 9px; z-index: 2; padding: 4px 7px; background: rgba(2, 4, 5, .82); color: #fff; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.tutorial-note-hit { position: absolute; z-index: 2; top: 13px; left: 13px; color: #fff; font-size: 17px; font-weight: 950; font-style: italic; letter-spacing: .08em; text-shadow: 3px 3px 0 #b52d30; }
.tutorial-note-card { display: flex; position: relative; z-index: 3; width: calc(100% - 36px); min-height: 116px; margin: -22px auto 0; flex-direction: column; justify-content: center; padding: 15px 18px; border: 1px solid rgba(88, 225, 239, .48); background: #10171b; box-shadow: 0 13px 34px rgba(0, 0, 0, .45); }
.tutorial-note-card small { color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.tutorial-note-card strong { margin-top: 7px; color: #fff; font-size: 18px; line-height: 1.4; }
.tutorial-note-card span { margin-top: 7px; color: #89979d; font-size: 12px; font-weight: 800; }
.tutorial-note-save { margin-top: 15px; color: #aab7bc; font-size: 12px; font-weight: 900; letter-spacing: .07em; text-align: right; }
.tutorial-note-save b { margin-left: 8px; color: var(--cyan); font-size: 18px; }

.function-tutorial-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  flex: 0 0 auto;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #0d1316;
}
.function-tutorial-footer > strong { color: #aebbc0; font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .08em; }
.function-tutorial-footer > div { display: flex; justify-content: flex-end; gap: 9px; }
.function-tutorial-footer .button { min-width: 122px; min-height: 46px; padding-inline: 18px; font-size: 14px; }
.function-tutorial-footer #next-function-tutorial { min-width: 178px; }
.function-tutorial-skip { justify-self: start; min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: #9aa8ae; cursor: pointer; font-size: 14px; font-weight: 800; text-decoration: underline; text-decoration-color: #526067; text-underline-offset: 4px; }
.function-tutorial-skip:hover { color: #fff; }
.function-tutorial-skip:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

@media (max-width: 760px) {
  .function-tutorial { width: min(620px, calc(100% - 20px)); max-height: calc(100dvh - 20px); }
  .function-tutorial form { max-height: calc(100dvh - 22px); }
  .function-tutorial-header { padding: 18px 19px 14px; }
  .function-tutorial-header h2 { font-size: 23px; }
  .function-tutorial-header .eyebrow { font-size: 12px; }
  .function-tutorial-progress > span { min-height: 44px; justify-content: center; padding: 0 7px; }
  .function-tutorial-progress > span > span { display: none; }
  .function-tutorial-progress b { font-size: 14px; }
  .function-tutorial-step { grid-template-columns: 1fr; min-height: 0; }
  .function-tutorial-copy { padding: 26px 22px 24px; }
  .function-tutorial-copy h3 { margin-bottom: 13px; font-size: clamp(26px, 7.3vw, 34px); }
  .function-tutorial-copy > p:not(.function-tutorial-number):not(.function-tutorial-assurance):not(.function-tutorial-hint) { font-size: 16px; line-height: 1.72; }
  .function-tutorial-number { margin-bottom: 10px; }
  .function-tutorial-assurance { margin-top: 16px; }
  .function-tutorial-hint { margin-top: 15px; font-size: 14px; }
  .function-tutorial-visual { min-height: 248px; border-top: 1px solid var(--line); border-left: 0; }
  .function-tutorial-visual-overview { min-height: 260px; }
  .function-orbit { width: 150px; height: 150px; }
  .function-orbit::before { width: 216px; height: 216px; }
  .function-orbit::after { width: 96px; height: 96px; }
  .function-orbit-core { font-size: 12px; }
  .function-orbit-core strong { font-size: 19px; }
  .function-orbit-node { min-width: 63px; min-height: 32px; font-size: 11px; }
  .function-orbit-node-1 { top: 25px; left: 34px; }.function-orbit-node-2 { top: 25px; right: 34px; }
  .function-orbit-node-3 { right: 34px; bottom: 25px; }.function-orbit-node-4 { bottom: 25px; left: 34px; }
  .function-tutorial-visual-input { min-height: 270px; padding: 30px 18px 61px; }
  .tutorial-input-card { width: min(39%, 150px); min-height: 150px; padding: 16px 12px; }
  .tutorial-input-card strong { font-size: 14px; }
  .function-tutorial-visual-review { min-height: 282px; padding: 32px 24px 24px; }
  .tutorial-player { min-height: 122px; margin-top: 17px; }
  .function-tutorial-visual-note { min-height: 300px; padding: 26px 24px 22px; }
  .tutorial-note-frame { height: 132px; }
  .function-tutorial-footer { grid-template-columns: auto 1fr; gap: 10px; padding: 12px 14px; }
  .function-tutorial-footer > strong { display: none; }
  .function-tutorial-footer > div { min-width: 0; }
  .function-tutorial-footer .button { min-width: 88px; min-height: 46px; padding-inline: 13px; }
  .function-tutorial-footer #next-function-tutorial { min-width: min(184px, 100%); }
}

@media (max-width: 430px) {
  .function-tutorial-open { min-height: 34px; padding-inline: 11px; }
  .function-tutorial-header { padding: 15px 16px 12px; }
  .function-tutorial-header h2 { font-size: 21px; }
  .function-tutorial-close { width: 40px; height: 40px; flex-basis: 40px; }
  .function-tutorial-copy { padding: 22px 18px 20px; }
  .function-tutorial-copy h3 { font-size: 26px; }
  .function-tutorial-visual { min-height: 236px; }
  .function-tutorial-visual-overview { min-height: 240px; }
  .function-tutorial-hint { padding: 10px 12px; }
  .function-orbit-node-1 { left: 22px; }.function-orbit-node-2 { right: 22px; }
  .function-orbit-node-3 { right: 22px; }.function-orbit-node-4 { left: 22px; }
  .function-tutorial-visual-input { min-height: 255px; padding-inline: 13px; }
  .tutorial-input-card { width: 41%; }
  .tutorial-input-join { width: 24px; }
  .function-tutorial-visual-review, .function-tutorial-visual-note { padding-right: 18px; padding-left: 18px; }
  .function-tutorial-footer { grid-template-columns: auto minmax(0, 1fr); }
  .function-tutorial-skip { padding-inline: 5px; }
  .function-tutorial-footer > div { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .function-tutorial-footer #next-function-tutorial { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .function-tutorial *, .function-tutorial *::before, .function-tutorial *::after { scroll-behavior: auto !important; }
}

/* Simplified tutorial composition */
.function-tutorial { width: min(760px, calc(100% - 32px)); }
.function-tutorial-header {
  padding: 20px 24px 17px;
  border-bottom: 0;
  background: #0b1013;
}
.function-tutorial-header h2 { font-size: 24px; }
.function-tutorial-header .eyebrow { margin-bottom: 5px; }
.function-tutorial-close { width: 40px; height: 40px; flex-basis: 40px; border-color: var(--line); background: transparent; font-size: 24px; }
.function-tutorial-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 0 24px 18px;
  border-bottom: 1px solid var(--line);
  background: #0b1013;
}
.function-tutorial-progress > span,
.function-tutorial-progress > .is-complete,
.function-tutorial-progress > .is-active {
  display: block;
  min-height: 3px;
  padding: 0;
  border: 0;
  background: #283239;
  box-shadow: none;
}
.function-tutorial-progress > .is-complete { background: #47727a; }
.function-tutorial-progress > .is-active { background: var(--cyan); }

.function-tutorial-step { grid-template-columns: minmax(0, 1fr) 250px; min-height: 350px; }
.function-tutorial-copy { padding: 34px 24px 36px; }
.function-tutorial-copy h3 { margin-bottom: 14px; font-size: clamp(27px, 3.2vw, 34px); }
.function-tutorial-copy > p:not(.function-tutorial-number):not(.function-tutorial-assurance):not(.function-tutorial-hint) { max-width: 520px; line-height: 1.75; }
.function-tutorial-assurance { margin-top: 18px; }
.function-tutorial-assurance span { width: auto; height: auto; border: 0; }
.function-tutorial-hint {
  margin-top: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #91a0a7;
  line-height: 1.65;
}
.function-tutorial-visual,
.function-tutorial-visual-overview,
.function-tutorial-visual-input,
.function-tutorial-visual-review,
.function-tutorial-visual-note {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 32px 24px;
  border-left: 0;
  background: #0d1316;
  background-size: auto;
}
.function-tutorial-visual::after { display: none; }

.tutorial-simple-flow { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tutorial-simple-flow span { display: grid; width: 150px; min-height: 42px; place-items: center; border: 1px solid var(--line-bright); color: #dbe5e8; font-size: 13px; font-weight: 900; letter-spacing: .07em; }
.tutorial-simple-flow i { color: var(--cyan); font-size: 18px; font-style: normal; line-height: 1; transform: rotate(90deg); }
.tutorial-simple-choice { display: flex; width: 100%; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
.tutorial-simple-choice strong { display: grid; min-height: 48px; place-items: center; border: 1px solid var(--line-bright); color: #fff; font-size: 14px; }
.tutorial-simple-choice span { color: #829096; font-size: 13px; }
.function-tutorial-visual > p { color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.tutorial-simple-matches { display: grid; width: 100%; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.tutorial-simple-matches span { display: grid; min-height: 38px; place-items: center; border: 1px solid var(--line); color: #75838a; font-size: 12px; font-weight: 900; }
.tutorial-simple-matches .is-active { border-color: var(--cyan); color: var(--cyan); }
.tutorial-simple-player { display: flex; width: 100%; min-height: 80px; align-items: center; justify-content: space-between; padding: 16px; border: 1px solid var(--line-bright); }
.tutorial-simple-player strong { font-size: 14px; }
.tutorial-simple-player button { display: grid; width: 40px; height: 40px; place-items: center; padding: 0 0 0 3px; border: 1px solid var(--cyan); border-radius: 50%; background: transparent; color: var(--cyan); font-size: 15px; }
.tutorial-simple-timeline { position: relative; width: 100%; height: 5px; background: #29343a; }
.tutorial-simple-timeline span { display: block; width: 62%; height: 100%; background: var(--cyan); }
.tutorial-simple-timeline i { position: absolute; top: -5px; left: 62%; width: 2px; height: 15px; background: #fff; }
.tutorial-simple-note { display: flex; width: 100%; min-height: 150px; flex-direction: column; justify-content: center; padding: 18px; border-left: 3px solid var(--cyan); background: #11181c; }
.tutorial-simple-note small { color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: .05em; }
.tutorial-simple-note strong { margin-top: 10px; color: #fff; font-size: 17px; line-height: 1.45; }
.tutorial-simple-note span { margin-top: 10px; color: #849299; font-size: 12px; font-weight: 800; }

.function-tutorial-footer { padding: 14px 20px; }
.function-tutorial-footer .button { min-width: 108px; }
.function-tutorial-footer #next-function-tutorial { min-width: 150px; }

@media (max-width: 650px) {
  .function-tutorial { width: min(540px, calc(100% - 20px)); }
  .function-tutorial-header { padding: 17px 18px 14px; }
  .function-tutorial-header h2 { font-size: 22px; }
  .function-tutorial-progress { padding: 0 18px 14px; }
  .function-tutorial-step { grid-template-columns: 1fr; }
  .function-tutorial-copy { padding: 26px 18px 22px; }
  .function-tutorial-copy h3 { font-size: 27px; }
  .function-tutorial-visual,
  .function-tutorial-visual-overview,
  .function-tutorial-visual-input,
  .function-tutorial-visual-review,
  .function-tutorial-visual-note { min-height: 142px; padding: 20px 18px; border-top: 1px solid var(--line); }
  .tutorial-simple-flow { width: 100%; flex-direction: row; gap: 7px; }
  .tutorial-simple-flow span { width: auto; min-width: 0; min-height: 38px; flex: 1 1 0; font-size: 11px; }
  .tutorial-simple-flow i { flex: 0 0 auto; transform: none; }
  .tutorial-simple-choice { flex-direction: row; align-items: center; }
  .tutorial-simple-choice strong { min-width: 0; flex: 1 1 0; font-size: 13px; }
  .tutorial-simple-choice span { flex: 0 0 auto; }
  .function-tutorial-visual-input > p { margin-top: -5px; }
  .tutorial-simple-player { min-height: 64px; }
  .tutorial-simple-note { min-height: 126px; }
  .function-tutorial-footer { padding: 12px 14px; }
}

@media (max-width: 430px) {
  .function-tutorial-copy { padding: 23px 18px 20px; }
  .function-tutorial-copy h3 { font-size: 26px; }
  .function-tutorial-visual,
  .function-tutorial-visual-overview,
  .function-tutorial-visual-input,
  .function-tutorial-visual-review,
  .function-tutorial-visual-note { min-height: 126px; }
}

/* In-place guided tour: explain the existing screen instead of replacing it. */
.function-tutorial-scrim {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(2, 5, 7, .58);
}
.function-tutorial-scrim[hidden],
.function-tutorial[hidden] { display: none; }
.is-function-tutorial-target {
  position: relative !important;
  z-index: 91 !important;
  pointer-events: none;
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(88, 225, 239, .12), 0 18px 55px rgba(0, 0, 0, .62) !important;
}
.function-tutorial {
  position: fixed;
  z-index: 92;
  right: auto;
  bottom: 22px;
  left: 50%;
  width: min(560px, calc(100% - 32px));
  max-height: none;
  margin: 0;
  overflow: visible;
  border: 1px solid var(--line-bright);
  background: #0d1316;
  box-shadow: 0 22px 72px rgba(0, 0, 0, .72);
  transform: translateX(-50%);
}
.function-tutorial form { display: block; max-height: none; }
.function-tutorial-header,
.function-tutorial-progress,
.function-tutorial-visual { display: none !important; }
.function-tutorial-body { min-height: 0; overflow: visible; }
.function-tutorial-step { display: block; min-height: 0; }
.function-tutorial-step[hidden] { display: none; }
.function-tutorial-copy { display: block; padding: 21px 22px 19px; }
.function-tutorial-number { margin-bottom: 7px; font-size: 13px; }
.function-tutorial-copy h3 { margin-bottom: 8px; font-size: 25px; line-height: 1.3; }
.function-tutorial-copy > p:not(.function-tutorial-number) { color: #bdc8cc; font-size: 16px; line-height: 1.7; }
.function-tutorial-footer { grid-template-columns: 1fr auto auto; gap: 13px; padding: 12px 14px; }
.function-tutorial-footer > strong { display: block; }
.function-tutorial-footer > div { display: flex; }
.function-tutorial-footer .button { min-width: 92px; min-height: 44px; }
.function-tutorial-footer #next-function-tutorial { min-width: 126px; }

@media (max-width: 560px) {
  .function-tutorial { bottom: 10px; width: calc(100% - 20px); }
  .function-tutorial-copy { padding: 18px 17px 16px; }
  .function-tutorial-copy h3 { font-size: 23px; }
  .function-tutorial-footer { grid-template-columns: auto 1fr; }
  .function-tutorial-footer > strong { display: none; }
  .function-tutorial-footer > div { min-width: 0; }
  .function-tutorial-footer .button { min-width: 78px; }
  .function-tutorial-footer #next-function-tutorial { min-width: 112px; }
}
