:root {
    color-scheme: dark;
    --line: rgb(255 255 255 / 25%);
    --ink: #f4eee4;
    --muted: #b4c3ca;
    --accent: #efadb4;
    --blue: #add4ff;
    --red: #ffb1b9;
    --split-panel: linear-gradient(90deg, #1a2b3d 50%, #35242e 50%);
    --split-row: linear-gradient(90deg, #182838 50%, #30222c 50%);
    --split-alt: linear-gradient(90deg, #1e3042 50%, #382832 50%);
    --split-hover: linear-gradient(90deg, #273e54 50%, #4a3040 50%);
    --split-control: linear-gradient(90deg, #253f5a 50%, #493040 50%);
    --control-fill: #ddeaff13;
    --control-border: rgb(255 255 255 / 25%);
    --border-strong: rgb(255 255 255 / 25%);
    --focus-ring: rgb(255 255 255 / 25%);
    --control-shadow: 0 2px 5px #00000060;
    --field-fill: #0c121b65;

    --danger: #ffb8b2;
    --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(90deg, #142334, #111b26 50%, #221922 50%, #2a1b24);
    min-height: 100%;
    color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.shell { width: min(1200px, 100% - 72px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #192e43, #171e2a 50%, #2d1e28 50%, #3a202e); }
.navigation { display: flex; align-items: center; gap: 32px; min-height: 63px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.brand img { width: 35px; height: 35px; padding: 4px; object-fit: contain; border: 1px solid var(--control-border); border-radius: 9px; background: var(--control-fill); box-shadow: var(--control-shadow); }
nav { display: flex; align-items: center; align-self: stretch; gap: 27px; margin-inline: auto; }
nav a { display: grid; place-items: center; color: var(--muted); border-bottom: 2px solid transparent; font-size: .9rem; font-weight: 650; }
nav a:hover, nav a[aria-current] { color: var(--ink); border-color: var(--border-strong); }
nav a[aria-current] { color: var(--blue); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 7px; font-size: .875rem; font-weight: 720; line-height: 1.2; white-space: nowrap; }
.quiet { color: var(--ink); background: var(--control-fill); border-color: var(--control-border); box-shadow: var(--control-shadow); }
.quiet:hover:not(:disabled) { border-color: var(--border-strong); background: #ddeaff24; }
.primary { color: #2b1a14; background: #b0d6ff; border-color: var(--control-border); box-shadow: var(--control-shadow); }
.primary:hover:not(:disabled) { background: #cee7ff; }
.danger { color: var(--danger); background: #d6586e33; border-color: var(--control-border); box-shadow: var(--control-shadow); }
.danger:hover:not(:disabled) { background: #d6586e55; }
.board { border: 1px solid var(--line); border-radius: 12px; background: var(--split-panel); overflow: hidden; }
.board-tools, .section-head { background: var(--split-alt); }
.section-head { padding: 22px 24px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head h2, dialog h2 { font-size: 1.55rem; letter-spacing: -.045em; }
.section-head p { font-size: .875rem; color: var(--muted); }
.search { display: flex; align-items: center; gap: 9px; min-width: min(245px, 100%); padding-inline: 11px; color: var(--muted); border: 1px solid var(--control-border); background: var(--field-fill); border-radius: 7px; box-shadow: inset 0 1px 4px #080b1259, 0 1px #dee9fd0d; }
.icon { width: 17px; height: 17px; flex: none; }
.search .icon, .search input::placeholder { color: var(--muted); }
.search input { min-height: 39px; color: var(--ink); width: 100%; border: 0; background: transparent; }
.search:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.search input:focus { outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 24px 17px; }
.filters button { min-height: 34px; background: #7fbaff1a; }
.filters button:hover:not(:disabled) { background: #7fbaff30; }
.filters [aria-pressed=true] { border-color: var(--border-strong); color: #eef7ff; background: #6ca8ec4a; }
.filters [aria-pressed=true]:hover:not(:disabled) { background: #6ca8ec61; }
.table-wrap { overflow-x: auto; }
.score-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; white-space: nowrap; }
.score-table th { padding: 12px 16px; background: transparent; text-transform: uppercase; font: 700 .76rem var(--mono); color: var(--muted); letter-spacing: .075em; }
.score-table td { padding: 9px 16px; height: 55px; border-top: 1px solid var(--line); font-size: .9rem; }
.score-table :is(th, td):first-child { padding-left: 24px; }
.score-table :is(th, td):last-child { padding-right: 24px; }
.score-table thead { background: var(--split-control); }
.score-table tbody tr { background: var(--split-row); }
.score-table tbody tr:nth-child(even) { background: var(--split-alt); }
.score-table tbody tr:hover { background: var(--split-hover); }
.score-table .rank { color: var(--muted); font: 700 .95rem var(--mono); }
.rank-number { display: inline-block; min-width: 2ch; text-align: right; }
.score-table .rank-top { color: #b9d7df; }
.score-table .leader .rank { color: var(--accent); }
.score-table tr.leader { background: linear-gradient(90deg, #283b50 50%, #4a303e 50%); }
.score-table tr.leader:hover { background: linear-gradient(90deg, #314964 50%, #573847 50%); }
.score-table tr.leader > td:first-child { box-shadow: inset 3px 0 var(--border-strong); }
.score-table :is(td, th):last-child { text-align: right; }
.score-table [data-action=proof] { gap: 6px; color: #e5eafa; border-color: var(--control-border); background: #df8a9d33; }
.score-table [data-action=proof]:hover:not(:disabled) { color: var(--ink); border-color: var(--border-strong); background: #df8a9d53; }
.score-table .player { font-weight: 750; }
.score-table .points { color: var(--ink); font: 750 .95rem var(--mono); font-variant-numeric: tabular-nums; }
.tank { display: inline-flex; align-items: center; gap: 8px; color: #d9e5e6; }
.tank-icon-pending { visibility: hidden; }
.tank img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.tag, .record { display: inline-block; border-radius: 4px; padding: 3px 7px; background: #dce8fa16; color: #e0e6ef; font: 700 .75rem var(--mono); }
.tag[data-mode="2TDM"] { color: #c5e3fb; background: #76b6ee35; }
.tag[data-mode="4TDM"] { color: #f5c9ce; background: #da79964a; }
.tag[data-mode="FFA"] { color: #f1d1c2; background: #e4ab8040; }
.tag[data-mode="HUNTS"], .tag[data-mode="MAZE"] { color: #e3d5f0; background: #b48be54c; }
.record { margin-left: 7px; color: #ffced5; background: #df8a9d40; }
.table-empty { height: 100px !important; text-align: center !important; color: var(--muted); }
dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 26px); border: 1px solid var(--control-border); border-top-color: var(--border-strong); border-radius: 13px; padding: 0; color: var(--ink); background: var(--split-panel); }
dialog::backdrop { background: transparent; backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 16px 21px; border-bottom: 1px solid var(--line); background: var(--split-alt); }
.dialog-content { padding: 20px 21px; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; }
.proof-dialog {
    width: min(1080px, calc(100% - 48px));
    background: var(--split-panel);
    border: 1px solid #434951;
    border-radius: 15px;
    box-shadow: 0 20px 60px #0008;
}
.proof-header, .proof-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
}
.proof-header { border-bottom: 1px solid #343a43; }
.proof-identity { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 3px 11px; }
.proof-identity h2 { font-size: 1.06rem; overflow-wrap: anywhere; }
#proof-score { color: #becadb; font: 650 .9rem var(--mono); }
.proof-close { display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border-color: var(--control-border); background: #df8a9d33; }
.proof-close:hover:not(:disabled) { background: #df8a9d53; }
.proof-stage { position: relative; background: linear-gradient(90deg, #101b28 50%, #21151e 50%); }
#proof-status { min-height: 180px; display: grid; place-items: center; padding: 20px; color: var(--muted); text-align: center; }
#proof-status:empty { display: none; }
.proof-frame { display: grid; place-items: center; min-height: min(46vh, 420px); overflow: hidden; }
.proof-frame :is(img, video, iframe) { width: 100%; display: block; border: 0; margin: auto; }
.proof-frame img { height: auto; max-height: min(68dvh, 680px); object-fit: contain; }
.proof-frame :is(video, iframe) { aspect-ratio: 16 / 9; max-height: 68dvh; }
.proof-frame p { padding: 18px; text-align: center; }
.proof-footer { flex-direction: column; justify-content: center; border-top: 1px solid #343a43; }
.proof-dialog.proof-fit-image {
    --proof-image-reserve: 96px;
    width: min(1080px, calc(100% - 18px), calc((100dvh - var(--proof-image-reserve)) * var(--proof-image-ratio)));
    overflow: hidden;
    border-inline: 0;
}
.proof-fit-image:has(.proof-footer:not([hidden])) { --proof-image-reserve: 144px; }
.proof-fit-image .proof-identity { flex-wrap: nowrap; overflow: hidden; }
.proof-fit-image .proof-identity h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proof-fit-image #proof-score { white-space: nowrap; }
.proof-fit-image .proof-frame { min-height: 0; }
.proof-fit-image .proof-frame img { max-height: none; }
.proof-navigation {
    position: absolute;
    inset-inline: clamp(8px, 2vw, 22px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.proof-arrow {
    display: grid;
    place-items: center;
    width: clamp(40px, 5vw, 52px);
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b7dbff;
    pointer-events: auto;
}
.proof-arrow-next { color: #ffbecd; }
.proof-arrow:hover { color: #edf6ff; }
.proof-arrow-next:hover { color: #fff0f4; }
.proof-arrow .icon {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 1px 1px #000) drop-shadow(0 2px 3px #000b);
}
@media (hover: hover) and (pointer: fine) {
    .proof-arrow { opacity: 0; pointer-events: none; }
    .proof-stage:hover .proof-arrow, .proof-stage:focus-within .proof-arrow { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: no-preference) {
    .proof-arrow { transition: opacity 160ms ease, color 140ms ease; }
}
.proof-source { color: #c5d7ed; font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 555px) {
    .proof-dialog { width: calc(100% - 18px); }
    .proof-header, .proof-footer { padding: 10px; }
    .proof-frame { min-height: min(35vh, 240px); }
}
.fields { display: grid; gap: 15px; }
.fields label { display: grid; gap: 5px; font-size: .875rem; color: #e0e6e4; font-weight: 650; }
.fields :is(input, select) { min-height: 41px; width: 100%; padding: 8px 10px; color: var(--ink); background: var(--field-fill); border: 1px solid var(--control-border); box-shadow: inset 0 1px 4px #080b1259; border-radius: 6px; font-size: 1rem; }
.fields small, .hint { color: var(--muted); font-size: .875rem; font-weight: 500; }
.form-status { color: var(--danger); font-size: .9rem; }
.form-status:empty { display: none; }
.admin-page { min-height: 70vh; }
.admin-head { display: flex; justify-content: space-between; align-items: end; gap: 15px; padding-block: 29px 21px; }
.admin-head h1 { font-size: clamp(1.95rem, 4vw, 2.8rem); letter-spacing: -.045em; line-height: 1.06; margin-top: 7px; }
.admin-table .actions { flex-wrap: nowrap; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 7px; min-width: 0; margin: 0; padding: 12px; }
legend { padding-inline: 6px; font-size: .9rem; }
fieldset .fields { gap: 8px; }
fieldset > button { margin-top: 10px; }
.video-field { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
@media (max-width: 780px) {
    .shell { width: calc(100% - 32px); }
    .score-table :is(th, td) { padding-inline: 10px; }
    .score-table :is(th, td):first-child { padding-left: 14px; }
    .score-table :is(th, td):last-child { padding-right: 14px; }
    .section-head { padding-inline: 14px; }
    .filters { padding-inline: 14px; }
}
@media (max-width: 555px) {
    .shell { width: calc(100% - 24px); }
    .navigation { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding-block: 10px 0; }
    .navigation > .button { grid-column: 2; grid-row: 1; }
    nav { grid-row: 2; grid-column: 1 / -1; margin: 4px 0 0; gap: 22px; }
    nav a { min-height: 36px; }
    .section-head { flex-wrap: wrap; gap: 9px; padding-block: 12px; }
    .score-table td { height: 47px; }
    .score-table .tank img { width: 20px; height: 20px; border-radius: 5px; }
    .admin-head { padding-block: 24px 16px; align-items: start; }
    .admin-head .button { margin-top: 14px; }
}
@media (max-width: 555px) {
    .score-table, .score-table tbody { display: block; }
    .score-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .score-table tr { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto auto; align-items: center; gap: 5px 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
    .score-table tr td { border: 0; padding: 0 !important; height: auto; white-space: normal; overflow-wrap: anywhere; }
    .score-table tr td:nth-child(1) { grid-area: 1 / 1; }
    .score-table tr td:nth-child(2) { grid-area: 1 / 2; }
    .score-table tr td:nth-child(3) { grid-area: 2 / 2; }
    .score-table tr td:nth-child(4) { grid-area: 2 / 3; }
    .score-table tr td:nth-child(5) { grid-area: 1 / 3; }
    .score-table tr td:nth-child(6) { grid-area: 1 / 4 / span 2; }
    .score-table tr .table-empty { grid-area: 1 / 1 / auto / -1; display: grid; place-items: center; }
    .score-table .button { min-height: 35px; padding-inline: 6px; }
    .score-table [data-action=proof] { gap: 4px; font-size: .75rem; }
    .score-table [data-action=proof] .icon { width: 14px; height: 14px; }
    .score-table .record { margin-inline: 0 2px; }
    .score-table tr.leader { box-shadow: inset 3px 0 var(--border-strong); }
    .score-table tr.leader > td:first-child { box-shadow: none; }
    .admin-table tr { grid-template-columns: minmax(0, 1fr) auto; }
    .admin-table tr td:nth-child(3) { grid-area: 2 / 2; }
    .admin-table tr td:nth-child(4) { grid-area: 2 / 1; }
    .admin-table tr td:nth-child(5) { grid-area: 3 / 1 / auto / -1; }
}
.image-manager-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.image-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 11px; }
.image-previews:empty { display: none; }
.image-preview {
    --photo-surface: #13273a;
    --photo-control: #254563;
    --photo-hover: #365978;
    min-width: 0;
    padding: 6px;
    border: 1px solid #585b63;
    border-radius: 8px;
    background: var(--photo-surface);
}
.image-preview:nth-child(even) {
    --photo-surface: #30202b;
    --photo-control: #563348;
    --photo-hover: #70435a;
}
.image-preview-stage { display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 5px; background: #0e131a; text-align: center; }
.image-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-preview-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.image-preview-actions .button { min-height: 32px; padding-inline: 7px; }

main.shell { padding-bottom: 36px; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 220px; display: grid; align-items: center; margin-block: 23px 16px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(90deg, #213a55, #192733 50%, #30252f 50%, #4a2d3b); }
.hero-copy { position: relative; z-index: 1; padding: 25px 28px; }
.hero h1 { text-shadow: 0 2px 14px #0b151c99; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.04; letter-spacing: -.065em; }
.stats { display: flex; gap: clamp(14px, 4vw, 38px); margin: 20px 0 0; }
.stats div { min-width: 0; padding-left: 11px; border-left: 2px solid var(--control-border); }
.stats div:first-child { border-color: var(--border-strong); }
.stats dt { color: var(--muted); font-size: .8125rem; }
.stats div:first-child dd { color: var(--accent); }
.stats dd { margin: 3px 0 0; color: var(--ink); font: 700 clamp(.95rem, 2.2vw, 1.28rem)/1.25 var(--mono); }
.auth-page { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.auth-layout {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    padding: 34px 20px;
    overflow: hidden;
    background: linear-gradient(90deg, #25415b, #152636 50%, #321f2c 50%, #4e2c3e);
}
.auth-layout::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, #0b12185c 14%, transparent 66%);
}
.auth-layout .hero-battle { opacity: .46; filter: saturate(.65); }
.auth-card {
    position: relative;
    z-index: 1;
    width: min(450px, 100%);
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid var(--control-border);
    border-radius: 13px;
    background: linear-gradient(90deg, rgb(23 44 64 / 88%) 50%, rgb(53 35 46 / 88%) 50%);
    box-shadow: 0 22px 58px #080c13a0, 0 2px 8px #080a12aa;
}
.auth-card h1 { margin: 0 0 24px; font-size: clamp(1.95rem, 4vw, 2.55rem); letter-spacing: -.055em; }
.auth-card .fields { gap: 17px; }
.auth-card .fields input {
    min-height: 47px;
    padding-inline: 12px;
    background: linear-gradient(90deg, #102337 50%, #301c29 50%);
    border-color: #55545a;
}
:is(.auth-card, #editor) .fields :is(input, select):focus {
    border-color: #e5e1e3;
    outline: 1px solid #e5e1e3;
    outline-offset: 0;
    box-shadow: none;
}
:is(.auth-card, #editor, .admin-head) .primary {
    margin-top: 5px;
    min-height: 44px;
    color: #fff3f5;
    background: #753b50;
    border-color: #9c5d72;
}
:is(.auth-card, #editor, .admin-head) .primary:hover:not(:disabled) { background: #87475d; }
#editor .fields :is(input, select) { background: #102337; border-color: #55545a; }
#editor .field-grid label:nth-child(even) :is(input, select) { background: #301c29; }
#editor :is(#add-video, #add-images) { background: #253f5a; border-color: #55545a; }
#editor #close-editor, #editor [data-action="remove-video"] { background: #4c2b3b; border-color: #595058; }
#editor :is(#add-video, #add-images):hover:not(:disabled) { background: #31516e; }
#editor :is(#close-editor, [data-action="remove-video"]):hover { background: #62364a; }
#editor button:focus-visible {
    outline: 1px solid #e5e1e3;
    outline-offset: 2px;
}
@media (max-width: 555px) {
    .auth-layout { padding: 24px 12px; }
    .auth-layout .hero-battle { opacity: .36; }
    .auth-card { padding: 24px 19px; }
}
@media (max-width: 555px) {
    .hero { margin-top: 16px; }
    .hero-copy { padding: 20px 15px; }
    .stats { margin-top: 15px; gap: 10px; }
    .stats div { padding-left: 7px; }
    .section-head .search { flex: 1; min-width: 175px; }
    .admin-head { align-items: center; }
    .admin-head .button { margin-top: 0; }
}
.board-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: center; padding: 14px 24px; }
.board-tools .filters { padding: 0; }
.board-tools p { color: var(--muted); font-size: .875rem; grid-column: 1 / -1; }
.board-tools p:empty { display: none; }
@media (max-width: 780px) { .board-tools { padding-inline: 14px; } }
@media (max-width: 555px) {
    .board-tools { grid-template-columns: minmax(0, 1fr); }
    .board-tools .search { grid-row: 1; }
}

.hero-battle { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #13222bf5 0%, #13222bdc 24%, #13222b42 56%, transparent 75%); }
@media (max-width: 555px) {
    .hero { min-height: 185px; }
    .hero::after { background: linear-gradient(90deg, #13222bf1, #13222ba8 57%, #13222b20); }
}

#feed-edge, #admin-feed-edge { height: 1px; }
.feed-feedback { display: flex; align-items: center; gap: 12px; padding: 14px 24px; color: var(--muted); }
.feed-skeleton td > span {
    display: block;
    width: min(100%, 85px);
    height: .8rem;
    border-radius: 5px;
    background: #dce7ff20;
}
.feed-skeleton td:first-child > span { width: 1.25rem; }
.feed-skeleton td:last-child > span { width: min(100%, 125px); height: 34px; margin-left: auto; }
@media (max-width: 555px) {
    .feed-skeleton td:nth-child(2) > span { width: 60%; }
    .feed-skeleton td:nth-child(5) > span { width: 3.4rem; }
    .feed-skeleton td:last-child > span { width: 5.5rem; }
}

/* Search feedback occupies a fixed slot so the filters and input stay still. */
@media (min-width: 1024px) {
    .board-tools { grid-template-columns: minmax(0, 1fr) 8rem auto; }
    .board-tools .search { grid-column: 3; grid-row: 1; }
    .board-tools #run-status { grid-column: 2; grid-row: 1; }
}
@media (max-width: 1023px) {
    .board-tools #run-status {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}
.table-wrap { overflow-y: hidden; }

@media (prefers-reduced-motion: no-preference) {
    main.shell { animation: page-in 230ms cubic-bezier(.2, .65, .35, 1) backwards; }
    @keyframes page-in { from { opacity: 0; transform: translateY(4px); } }

    .button, .search, .fields :is(input, select), nav a {
        transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease,
            box-shadow 150ms ease, transform 150ms cubic-bezier(.2, .65, .35, 1);
    }
    .button:active:not(:disabled) { transform: translateY(1px); }
    .search:focus-within, .fields :is(input, select):focus-visible {
        box-shadow: 0 0 0 3px #fff2, inset 0 1px 4px #080b1259;
    }

    .score-table tbody { transition: opacity 160ms ease; }
    .score-table tbody.feed-replacing { opacity: .65; }
    .feed-arrival { animation: reveal-content 190ms ease-out; }
    .proof-frame, #proof-media :is(video, iframe) { animation: reveal-content 190ms ease-out both; }
    .feed-skeleton td > span { animation: skeleton-pulse 1.35s ease-in-out infinite alternate; }
    @keyframes reveal-content { from { opacity: 0; } }
    @keyframes skeleton-pulse { from { opacity: .5; } to { opacity: 1; } }

    dialog { animation: dialog-in 190ms cubic-bezier(.2, .65, .35, 1) both; }
    dialog::backdrop { animation: backdrop-in 160ms ease-out both; }
    @keyframes dialog-in { from { opacity: 0; transform: translateY(7px) scale(.99); } }
    @keyframes backdrop-in { from { opacity: 0; } }

    @supports (transition-behavior: allow-discrete) {
        dialog {
            animation: none;
            opacity: 0;
            transform: translateY(7px) scale(.99);
            transition: opacity 170ms ease, transform 190ms cubic-bezier(.2, .65, .35, 1),
                display 190ms allow-discrete, overlay 190ms allow-discrete;
        }
        dialog[open] { opacity: 1; transform: none; }
        dialog:not([open]), dialog:not([open])::backdrop { pointer-events: none; }
        dialog::backdrop {
            animation: none;
            opacity: 0;
            transition: opacity 170ms ease, display 190ms allow-discrete, overlay 190ms allow-discrete;
        }
        dialog[open]::backdrop { opacity: 1; }
        @starting-style {
            dialog[open] { opacity: 0; transform: translateY(7px) scale(.99); }
            dialog[open]::backdrop { opacity: 0; }
        }
    }
}

.editor-mode { display: grid; gap: 5px; color: #e0e6e4; font-size: .875rem; font-weight: 650; }
.editor-select { position: relative; min-width: 0; }
#mode-trigger {
    width: 100%;
    min-height: 41px;
    justify-content: space-between;
    padding: 8px 11px;
    color: var(--ink);
    background: #102337;
    border-color: #55545a;
    font-size: 1rem;
}
#mode-trigger::after {
    content: "";
    width: 7px;
    height: 7px;
    margin: -4px 3px 0 0;
    border-right: 2px solid #b6cbdf;
    border-bottom: 2px solid #b6cbdf;
    transform: rotate(45deg);
}
#mode-trigger[aria-expanded=true]::after { transform: rotate(225deg); margin-top: 3px; }
#mode-options {
    position: absolute;
    top: calc(100% + 5px);
    inset-inline: 0;
    z-index: 2;
    padding: 4px;
    border: 1px solid #62636a;
    border-radius: 8px;
    background: #142b40;
    box-shadow: 0 8px 18px #080b1280;
}
#mode-options .button {
    width: 100%;
    min-height: 34px;
    justify-content: start;
    color: #edf2f8;
    background: transparent;
    border-color: transparent;
}
#mode-options .button:hover, #mode-options .button:focus-visible { background: #2c4963; outline-offset: -2px; }
#mode-options [aria-selected=true] { background: #263d56; }
#mode-options [aria-selected=true]::after { content: "✓"; margin-left: auto; color: #c5def7; }
#editor .image-preview-actions .button { background: var(--photo-control); border-color: #62616a; }
#editor .image-preview-actions .button:hover { background: var(--photo-hover); }
#editor .image-preview-actions .danger { color: #f3c9cf; background: var(--photo-surface); }
