
:root {
  color-scheme: dark;
  --ink: #f4f5f7;
  --muted: #adb2bd;
  --bg: #101114;
  --edge: #2d3038;
  --panel: #1b1d23;
  --input: #22252c;
  --accent: #c4d7c3;
  --warning: #e2bd93;
  --danger: #f4bdb7;
  --pad-start: max(1rem, env(safe-area-inset-left), var(--tg-safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px));
  --pad-end: max(1rem, env(safe-area-inset-right), var(--tg-safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px));
  --safe-top: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  --tabs-height: calc(49px + var(--safe-bottom));
  font: 100%/1.42 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 42rem; min-height: 100dvh; background: var(--bg); color: var(--ink); }
body:has(dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { min-height: 44px; border: 0; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, select { min-height: 44px; width: 100%; min-width: 0; padding: .55rem .75rem; border: 1px solid var(--edge); border-radius: .7rem; background: var(--input); }
input::placeholder { color: var(--muted); }
input[type="search"] { appearance: none; }
input[type="number"] { appearance: textfield; }
input[type="range"] { accent-color: var(--accent); background: transparent; border: 0; padding: .5rem 0; }
input::-webkit-inner-spin-button { appearance: none; }
main { padding-bottom: calc(1rem + var(--tabs-height)); }
main:has(#search-page:not([hidden]) #version-actions:not([hidden])) { padding-bottom: calc(4.4rem + var(--tabs-height)); }
.telegram-session { padding-top: var(--safe-top); }
.keyboard-open .tabs, .keyboard-open .version-actions { visibility: hidden; }
.keyboard-open main { padding-bottom: 1rem; }
.telegram-session .app-header { display: none; }
.app-header { display: flex; justify-content: center; align-items: center; min-height: 2.75rem; padding: max(.35rem, env(safe-area-inset-top)) var(--pad-end) .35rem var(--pad-start); border-bottom: 1px solid var(--edge); font-weight: 700; }
.content { padding: 0 var(--pad-end) 0 var(--pad-start); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: .85rem 0 .65rem; font-size: clamp(1.65rem, 7vw, 1.9rem); line-height: 1.14; letter-spacing: -.026em; }
h2 { margin: 0; font-size: 1.07rem; line-height: 1.25; }
h3 { margin: 0; font-size: .95rem; line-height: 1.25; }
p { margin: .35rem 0 .65rem; }
small, .muted, .notice { color: var(--muted); font-size: .82rem; }
.notice:empty { display: none; }
.source-coverage { color: var(--muted); font-size: .78rem; }
.source-coverage summary { min-height: 44px; padding: .75rem 0; cursor: pointer; }
.source-coverage ul { margin: 0 0 .6rem; padding-left: 1.15rem; overflow-wrap: anywhere; }
.source-coverage li { margin: .22rem 0; }
.warning { color: var(--warning); }
.positive { color: var(--accent); }
#connection { margin: 1rem var(--pad-end) 0 var(--pad-start); }
.search-form { display: grid; grid-template-columns: minmax(5rem, 1fr) auto auto; gap: .4rem; margin: 1rem 0; }
.search-form input { display: block; }
.year-field { width: 4.2rem; }
.primary, .secondary, .danger { padding: .55rem .8rem; border-radius: .7rem; font-weight: 700; text-align: center; }
.primary { background: var(--accent); color: #18221b; }
.secondary { background: #292c34; }
.danger { background: #3a2423; color: var(--danger); }
.primary:disabled, .secondary:disabled, .danger:disabled { background: #252830; color: var(--muted); }
.link { padding: .25rem .25rem; background: none; color: var(--muted); font-size: .87rem; }
.link:hover { color: var(--ink); }
.between { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.heading { margin-top: .3rem; }
.heading h1 { margin-right: auto; }
.section-title { margin: 1rem 0 .4rem; }
.section-title:first-child { margin-top: .85rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: .25rem 0; width: 100%; min-height: 44px; background: transparent; border-bottom: 1px solid var(--edge); text-align: left; }
.row > span:first-child { display: grid; gap: .08rem; min-width: 0; }
.row strong { font-size: .92rem; line-height: 1.22; overflow-wrap: anywhere; }
.row small { font-size: .73rem; line-height: 1.2; overflow-wrap: anywhere; }
.row .aside { display: grid; gap: .08rem; text-align: right; flex: 0 0 auto; font-size: .77rem; }
.work-row { min-height: 64px; }
.work-row > span:first-child { display: flex; gap: .75rem; align-items: center; }
.work-marker { width: 2.3rem; height: 2.7rem; flex: 0 0 auto; border-radius: .42rem; background: linear-gradient(145deg, #353d3e, #24272a); }
.work-label { display: grid; gap: .18rem; }
.chevron { color: var(--muted); font-size: 1.18rem; }
.version-back { display: flex; position: sticky; top: var(--safe-top); z-index: 2; align-items: center; gap: .75rem; min-height: 44px; background: var(--bg); }
#collapsed-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; font-weight: 650; }
.version-actions { position: fixed; bottom: var(--tabs-height); z-index: 3; left: 50%; transform: translateX(-50%); width: min(100%, 42rem); display: flex; gap: .5rem; align-items: stretch; padding-top: .45rem; padding-bottom: .45rem; background: var(--bg); border-top: 1px solid var(--edge); }
.version-actions button { flex: 1; }
.version-ready { border-radius: .55rem; padding-inline: .4rem; background: #25302a; }
.hero { position: relative; isolation: isolate; display: flex; align-items: end; min-height: 6.1rem; padding: .65rem var(--pad-end) .8rem var(--pad-start); background: linear-gradient(123deg, #262c2d, #1c2024 65%, #141519); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 37%; z-index: -2; }
.hero::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, #101114e6, #10111436), linear-gradient(0deg, #10111480, transparent 64%); z-index: -1; }
.hero-copy h1 { margin: .16rem 0 0; }
.hero-copy p { margin: 0; }
.card { margin: .65rem 0; background: var(--panel); border: 1px solid var(--edge); border-radius: .8rem; padding: .82rem; }
.card p:last-child { margin-bottom: 0; }
.card p, .info-line { margin: .32rem 0; }
.card .row:last-child { border-bottom: 0; }
.job-compact { margin: .15rem 0; padding: .15rem 0 .6rem; border: 0; border-bottom: 1px solid var(--edge); border-radius: 0; background: transparent; }
.job-compact .job-heading { border: 0; min-height: 44px; }
.job-compact .info-line { min-height: 1rem; }
.job-compact .progress { height: 2px; margin: .3rem 0; }
.job-header { display: flex; align-items: start; gap: .5rem; }
.job-header .job-heading { flex: 1; }
.job-control { min-width: 44px; }
.preset-current { background: #304036; color: var(--accent); }
.time-shortcuts.with-custom { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.time-shortcuts.with-custom button { padding-inline: .25rem; font-size: .82rem; }
.job-heading { font-size: .98rem; font-weight: 700; }
.stack { display: grid; gap: .55rem; margin: 1rem 0 .15rem; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: .8rem 0 .25rem; }
.actions:has(> :only-child) { grid-template-columns: 1fr; }
.info-line { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; min-height: 1.75rem; font-size: .88rem; }
.info-line > :last-child { text-align: right; }
.progress { appearance: none; display: block; width: 100%; height: .35rem; margin: .75rem 0 .65rem; border: 0; border-radius: .3rem; overflow: hidden; background: #383c45; color: var(--accent); }
.progress::-webkit-progress-bar { background: #383c45; }
.progress::-webkit-progress-value { background: var(--accent); }
.progress::-moz-progress-bar { background: var(--accent); }
.tabs { position: fixed; z-index: 3; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 42rem); display: grid; grid-template-columns: repeat(3, 1fr); padding: .25rem var(--pad-end) var(--safe-bottom) var(--pad-start); background: #15171b; border-top: 1px solid var(--edge); }
.tabs button { display: grid; justify-items: center; align-content: center; gap: .2rem; padding: .35rem .15rem; background: transparent; color: var(--muted); font-size: .73rem; font-weight: 650; }
.tabs button[aria-current="page"] { color: var(--accent); }
.icon { display: block; width: 1rem; height: 1rem; position: relative; }
.icon-search::before { content: ""; position: absolute; top: .06rem; left: .02rem; width: .57rem; height: .57rem; border: .09rem solid currentColor; border-radius: 100%; }
.icon-search::after { content: ""; position: absolute; width: .41rem; height: .09rem; background: currentColor; top: .69rem; left: .62rem; transform: rotate(45deg); }
.icon-download { border-bottom: .09rem solid currentColor; }
.icon-download::before { content: ""; position: absolute; top: 0; left: .45rem; width: .09rem; height: .62rem; background: currentColor; }
.icon-download::after { content: ""; position: absolute; top: .29rem; left: .27rem; width: .36rem; height: .36rem; border: solid currentColor; border-width: 0 .09rem .09rem 0; transform: rotate(45deg); }
.icon-pause::before, .icon-pause::after { content: ''; position: absolute; inset-block: 9%; width: 29%; border-radius: .06em; background: currentColor; }
.icon-pause::before { left: 10%; }
.icon-pause::after { right: 10%; }
.icon-play::before { content: ''; position: absolute; inset: 8% 0 8% 15%; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.remote-primary, .job-control { display: grid; place-items: center; }
.remote-primary .icon { width: 1.52rem; height: 1.52rem; }
.icon-tv::before { content: ""; position: absolute; width: .85rem; height: .58rem; left: 0; top: .03rem; border: .09rem solid currentColor; border-radius: .09rem; }
.icon-tv::after { content: ""; position: absolute; bottom: 0; left: .28rem; width: .46rem; height: .09rem; background: currentColor; }
dialog { position: fixed; inset: auto 0 0; width: min(100%, 42rem); max-width: none; max-height: min(90dvh, var(--ui-visible-height, var(--tg-viewport-stable-height, 100dvh))); padding: 0; margin: 0 auto; border: 1px solid var(--edge); border-bottom: 0; border-radius: 1.3rem 1.3rem 0 0; color: var(--ink); background: var(--panel); overscroll-behavior: contain; }
dialog::backdrop { background: #06070ab5; }
.sheet-inner { position: relative; padding: 1.55rem var(--pad-end) max(1rem, var(--safe-bottom)) var(--pad-start); }
.sheet-inner::before { content: ""; width: 2.8rem; height: .24rem; border-radius: 1rem; background: #636871; position: absolute; left: calc(50% - 1.4rem); top: .48rem; }
.sheet-close { width: 44px; position: absolute; right: .42rem; top: .75rem; font-size: 1.4rem; }
.hero h1:focus, #sheet-title:focus { outline: none; }
#sheet-title { font-size: 1.4rem; padding-right: 2.3rem; margin: .25rem 0 .4rem; }
.sheet-subtitle { margin: 0 0 .9rem; }
.sheet-inner h3 { margin: 1rem 0 .35rem; }
.time-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: .55rem 0; }
.time-shortcuts button { padding: .35rem .2rem; }
.field-label { display: grid; gap: .25rem; margin: .7rem 0; font-size: .86rem; }
.remote-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; margin-top: .7rem; }
.tv-device { display: grid; gap: .7rem; padding: .9rem; border-color: transparent; }
.tv-device-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .75rem; }
.tv-device-main .tv-device-label { min-width: 0; }
.tv-device-label h3 { font-size: 1.12rem; }
.tv-device-badge { font-weight: 650; text-align: right; }
.tv-device > .info-line { border-top: 1px solid var(--edge); padding-top: .55rem; }
.tv-device-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border-radius: .55rem; background: var(--input); color: var(--muted); }
.tv-device-label p { font-size: .82rem; }
.remote-hero { margin-inline: calc(-1 * var(--pad-start)) calc(-1 * var(--pad-end)); min-height: 6.6rem; }
.remote-hero h2 { margin-top: .2rem; font-size: 1.75rem; }
.remote-session { padding: 1rem 0 .35rem; }
.remote-session > .info-line { min-height: 1.35rem; }
.remote-session input[type="range"] { margin: .25rem 0 0; }
.remote-buttons { align-items: center; margin: .55rem 0 1rem; }
.remote-primary { min-width: 56px; min-height: 56px; border-radius: 1rem; font-size: 1.2rem; }
.remote-buffer { margin: .95rem 0; padding: .85rem .05rem .35rem; border-block: 1px solid var(--edge); }
.remote-buffer .progress { margin: .55rem 0 .25rem; }
#check-tv-link { margin-top: .35rem; }
#tv:has(.remote-session) > #check-tv-link { font-size: .8rem; }

.search-form { display: flex; align-items: center; gap: 0; margin: 1rem 0; border: 1px solid var(--edge); border-radius: .66rem; background: var(--input); }
.search-form .field { flex: 1 1 auto; min-width: 0; }
.search-form .year-field { flex: 0 0 3.8rem; padding-inline: .12rem; }
.search-form input { display: block; width: 100%; padding-inline: 0; border: 0; border-radius: 0; background: transparent; }
.search-form .year-field input { text-align: center; border-inline-start: 1px solid var(--edge); font-size: .86rem; }
.search-form input::-webkit-search-cancel-button { appearance: none; }
.search-submit, .search-clear { display: grid; place-items: center; flex: 0 0 44px; color: var(--muted); background: transparent; }
.search-clear { font-size: 1.13rem; }
.work-row { min-height: 70px; }
.work-marker { position: relative; isolation: isolate; overflow: hidden; width: 2.5rem; height: 3.44rem; background: #354750; }
.work-row:nth-of-type(2) .work-marker { background: #475A55; }
.work-row:nth-of-type(3) .work-marker { background: #625649; }
.work-marker::before { content: ''; position: absolute; top: 18%; left: 22%; width: 52%; aspect-ratio: 1; border: 1px solid #a8afa9; border-radius: 50%; }
.work-marker::after { content: ''; position: absolute; inset: 42% 0 0; background: #282f32; clip-path: polygon(50% 0,100% 80%,100% 100%,0 100%,0 80%); }
.work-label { gap: .13rem; min-width: 0; }
.catalog-file-check .secondary { margin-top: .45rem; }
.catalog-file-check [role="status"]:empty, .catalog-file-actions:empty { display: none; }
.catalog-file-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.work-go { color: #8f95a0; }
.version-back { align-items: stretch; padding-block: .2rem .35rem; }
.version-lookup { display: flex; align-items: center; gap: .7rem; width: 100%; padding: 0 .75rem; border-radius: .64rem; background: var(--input); }
.version-lookup .icon, .lookup-close { flex: 0 0 auto; color: var(--muted); }
#lookup-title { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#version-context { margin: 0; padding-block: .18rem 0; color: var(--muted); font-size: .76rem; font-weight: 650; }
#version-summary { min-height: 34px; }
#version-context { text-align: center; }
#version-summary h2, #version-summary .link { flex: 0 0 auto; }
#version-summary .link { min-height: 44px; margin-block: -5px; font-size: .76rem; }
.version-group-title { font-size: .72rem; color: var(--muted); padding: .16rem 0 .12rem; }
.version-group[data-version-group="ready"] .version-group-title { color: var(--accent); }
.version-group[data-version-group="recommendation"] { position: relative; }
#hero { align-items: start; padding-top: .9rem; }
#hero img { object-position: center top; }
#versions .section-title { min-height: 34px; margin: 0; padding-block: .45rem; }
#versions .row { min-height: 44px; }
#versions .version-ready { min-height: 60px; box-shadow: inset 2px 0 var(--accent); padding-inline: .58rem; }
.version-state { color: var(--accent); font-weight: 650; }
.version-actions { gap: .45rem; padding-block: .2rem; }
.version-actions .secondary { background: transparent; font-size: .85rem; }
.hero { min-height: 6.15rem; }
.hero-copy { max-width: 100%; }
.hero-copy h1 { text-wrap: balance; }
.queue-section-title { min-height: 44px; margin: 1.1rem 0 .28rem; display: flex; align-items: center; }
#queue-summary { min-height: .9rem; margin: 0 0 .85rem; }
#queue-summary:empty { min-height: 0; margin: 0; }
.queue-active-heading { margin-top: 1.12rem; }
#downloads .active-job { margin: .2rem 0 .55rem; padding: .55rem .8rem .8rem; border-color: transparent; }
#downloads .queue-section-title { min-height: 34px; margin: .9rem 0 .2rem; }
.active-job .job-header + p { margin: .15rem 0 0; }
.active-job .job-heading { border: 0; font-size: 1.12rem; }
.active-job .job-control { background: none; }
.active-job .progress { margin: .74rem 0 .45rem; }
.active-job .job-numbers { font-size: .79rem; gap: .35rem; align-items: start; }
.active-job .queue-live-metrics { margin: .17rem 0 0; font-size: .76rem; }
.active-job > div:not([class]) .info-line,
.active-job > div:not([class]) p { margin: .17rem 0 0; min-height: auto; font-size: .76rem; }
.queue-row { min-height: 55px; }
.queue-row small { font-weight: 400; }
.queue-saved { position: relative; }
dialog:has(.deadline-form) { min-height: min(61dvh, var(--ui-visible-height, 100dvh)); }
body:has(.deadline-sheet[open]) #versions-view :is(.version-back,#version-context,#version-summary,#versions,#version-actions,#version-coverage) { display: none !important; }
body:has(.deadline-sheet[open]) #versions-view #deadline-preview { display: block !important; padding-top: .6rem; }
body:has(.deadline-sheet[open]) #versions-view #hero { min-height: 140px; padding-top: 2.15rem; }
.sheet-inner:has(.deadline-form) { padding-bottom: max(3.55rem, calc(var(--safe-bottom) + 2.75rem)); }
.deadline-form { padding-top: .4rem; }
.deadline-form .deadline-label { margin-top: 1.1rem; }
.deadline-form .deadline-label h3 { margin: 0; }
.deadline-form .row { min-height: 58px; margin-top: 1rem; border-block: 1px solid var(--edge); }
.deadline-form .info-line { font-weight: 650; margin-top: .8rem; }
.deadline-drives { color: var(--muted); font-size: .81rem; }
.deadline-drives summary { min-height: 44px; padding-top: .64rem; cursor: pointer; }
.tv-section-title { margin-top: 2rem; margin-bottom: .55rem; }
.tv-offline { min-height: 90px; margin-top: 1.7rem; border-color: transparent; }
.tv-offline h3, .tv-recent h3 { font-size: 1.12rem; }
.tv-offline .warning { text-align: right; font-weight: 650; }
.tv-offline p { margin-top: .63rem; }
.tv-offline + .tv-section-title { margin-top: 2.45rem; }
.tv-offline ~ .row { min-height: 56px; }
.tv-recent-title { margin-top: 2.9rem; }
.tv-recent { min-height: 90px; background: #21252d; border-color: transparent; }
.tv-recent p { margin-top: .55rem; }
.remote-hero { align-items: start; min-height: 145px; padding-top: .9rem; }
.remote-hero .hero-copy { display: flex; flex-direction: column; min-height: 119px; }
.remote-hero .hero-copy .remote-media { margin-top: auto; padding-bottom: .12rem; }
.remote-state { min-height: 29px; margin-bottom: .3rem; }
.remote-session > .info-line { min-height: 1.35rem; margin-top: .05rem; }
.remote-position + .remote-times { margin-top: -.3rem; }
.remote-session > input[type="range"] { display: block; min-height: 44px; margin: 0; }
.remote-position { appearance: none; }
.remote-position::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--played), #383c45 var(--played)); }
.remote-position::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; margin-top: -4px; border-radius: 50%; background: var(--accent); opacity: 0; }
.remote-position:is(:focus,:active)::-webkit-slider-thumb { opacity: 1; }
.remote-buttons { justify-content: space-evenly; margin: .5rem 0 2rem; }
.remote-buttons button { min-width: 65px; min-height: 54px; }
.remote-buttons .remote-primary { min-width: 74px; min-height: 64px; border-radius: 1.32rem; font-size: 1.48rem; }
.remote-tracks, .seek-evidence { border-top: 1px solid var(--edge); }
.seek-evidence { margin-top: 1.15rem; }
.seek-evidence .row { min-height: 52px; }
.remote-tracks .row { min-height: 57px; }
.remote-tracks .aside { display: block; max-width: 44%; overflow-wrap: anywhere; }
.remote-tracks button .aside { color: var(--muted); font-weight: 650; }
.remote-buffer { margin: 1.45rem 0 .8rem; padding: .4rem 0 .12rem; border: 0; }
.remote-buffer .progress { margin-top: .7rem; }
.remote-buffer .progress::-webkit-progress-value, .storage-buffer .progress::-webkit-progress-value { border-radius: .3rem; }
.storage-buffer { padding: .9rem; margin-top: 1.15rem; border-color: transparent; }
.storage-section-title { margin: 1.6rem 0 .35rem; }
.storage-file { min-height: 55px; }
.storage-file strong { overflow-wrap: anywhere; }
.storage-drives { margin: 1.05rem 0 .5rem; color: var(--muted); }
.storage-drives summary { display: list-item; min-height: 44px; padding-block: .65rem; cursor: pointer; }
.remote-buffer .remote-buffer-note { color: #9297a2; font-size: .76rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 340px) {
  .search-form .year-field { flex-basis: 3rem; }
  .info-line { flex-wrap: wrap; }
}

.catalog-file-heading { margin: 14px 0 3px; font-size: 14px; }
.catalog-files { margin: 0 0 12px; padding: 0; list-style: none; }
.catalog-file { padding: 8px 0; border-bottom: 1px solid var(--edge); }
.catalog-file .between { align-items: flex-start; gap: 8px; font-size: 13px; }
.catalog-file .between > span { flex-shrink: 0; }
.catalog-file small { display: block; margin-top: 3px; }

.artwork-credit { margin: 0 16px 10px; padding: 8px 0; color: var(--muted); border-bottom: 1px solid var(--edge); }
.artwork-credit h2 { display: inline; margin-right: 8px; font-size: 12px; }
.artwork-credit img { width: 64px; height: auto; vertical-align: middle; }
.artwork-credit p { font-size: 11px; line-height: 1.3; margin: 4px 0 0; }
