/* Thamar identity: the application layout and inspection workflow stay intact. */
@font-face{font-family:Alexandria;src:url('/static/fonts/Alexandria.ttf') format('truetype');font-style:normal;font-weight:100 900;font-display:swap}
:root{--bg:#201d1b;--panel:#2c2723;--line:#594c41;--text:#f6ede2;--muted:#c7b7a7;--green:#b0c08a;--amber:#ebbc76;--red:#f0a18e;--surface:#25211e;--elevated:#362e28;--secondary:#393129;--active:#50372b;--primary-text:#fffaf4;--stage:#171513;--brand-paper:#fffaf2;--accent:#edab83;--action:#9c442c;--background-opacity:.07;color-scheme:dark}
:root[data-theme='light']{--bg:#f5f0e6;--panel:#fffdf8;--line:#ddd1c4;--text:#332d28;--muted:#74665a;--green:#586b38;--amber:#91600b;--red:#b34735;--surface:#f7f1e8;--elevated:#f1e5d7;--secondary:#f7eee3;--active:#f5dfcd;--primary-text:#fffaf4;--stage:#ede7de;--accent:#9c442c;--action:#9c442c;--background-opacity:.7;color-scheme:light}
body{font-family:Thmanyah,Tahoma,Arial,sans-serif;line-height:1.75;background:var(--bg);isolation:isolate}
body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:url('/static/brand/editorial-background.webp') center/cover no-repeat;opacity:var(--background-opacity)}
header{background:var(--panel);border-bottom:1px solid var(--line)}
main{max-width:1440px}
.card{box-shadow:0 6px 24px #281b1008;border-radius:14px}
.intro h2{letter-spacing:-.5px;line-height:1.5}
.tabs{padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:12px;width:fit-content}
.tabs .tab{border-color:transparent;background:transparent}
.tabs .tab.active{background:var(--active);border-color:var(--line);color:var(--accent)}
.pill{color:var(--accent);letter-spacing:0}
button,input,select,textarea{font:inherit}
button{background:var(--secondary)}
.primary,.video-download{background:var(--action);border-color:var(--action);color:var(--primary-text)}
.primary:hover,.video-download:hover{filter:brightness(1.08);border-color:var(--accent)}
button:hover{border-color:var(--accent)}
button:focus-visible,input:focus-visible,select:focus-visible{outline-color:var(--accent)}
.brand{gap:14px;min-width:0}
.logo{width:64px;height:64px;flex:0 0 64px;border-radius:16px;background:var(--brand-paper);border:1px solid var(--line);overflow:hidden}
.logo img{display:block;width:100%;height:100%;object-fit:contain;padding:8px}
.brand h1{font-size:27px;font-weight:700}
.brand h1 span{font-size:15px}
.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-shrink:0}
.theme-toggle{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:9px 13px;font-size:12px;white-space:nowrap}
.theme-toggle-icon{font-family:Arial,sans-serif;font-size:19px;line-height:1}
.tab.active,.item-row.active{background:var(--active)}
.cardhead{background:var(--elevated)}
.stage,.stage video{background:var(--stage)}
input,select,textarea,.stat,.crop{background:var(--surface)}
.bar{background:var(--line)}
.note,.route,.decision-note,.item-row,.insight-legend,#playbackBar{background:var(--surface)!important}
.alert{background:var(--elevated)}
.summary-count b{font-family:Thmanyah,Tahoma,Arial,sans-serif;font-weight:700}
@media(max-width:950px){header,.has-source header{padding:16px;flex-wrap:wrap}.header-actions{margin-inline-start:auto}.brand p{max-width:42ch}.logo{width:56px;height:56px;flex-basis:56px}}
@media(max-width:550px){.brand{gap:10px}.brand h1{font-size:23px}.brand h1 span{font-size:12px}.brand p{font-size:11px}.header-actions{width:100%}.theme-toggle{font-size:12px}}

.language-toggle{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:9px;padding:10px 14px;color:var(--text);background:var(--surface);text-decoration:none;font-size:13px}.language-toggle:hover{border-color:var(--green)}.language-toggle:focus-visible{outline:2px solid var(--green);outline-offset:3px}

@font-face{font-family:Thmanyah;src:url('/static/fonts/thmanyahsans-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:Thmanyah;src:url('/static/fonts/thmanyahsans-Medium.woff2') format('woff2');font-weight:500 600;font-style:normal;font-display:swap}
@font-face{font-family:Thmanyah;src:url('/static/fonts/thmanyahsans-Bold.woff2') format('woff2');font-weight:700 900;font-style:normal;font-display:swap}
.header-actions{gap:8px}
.header-actions .language-toggle,.header-actions .theme-toggle{position:relative;width:42px;height:42px;min-height:42px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid var(--line);background:var(--panel);color:var(--text);box-shadow:0 2px 8px #2b1c1005;transition:transform .28s cubic-bezier(.2,.8,.2,1.4),background-color .2s,border-color .2s,box-shadow .2s;flex:0 0 42px}
.header-actions .language-toggle{font-size:18px;font-weight:500;line-height:1;text-decoration:none}
.header-actions .language-toggle:hover,.header-actions .theme-toggle:hover{transform:translateY(-3px) rotate(-6deg);border-color:var(--accent);background:var(--active);color:var(--accent);box-shadow:0 5px 12px #56321912}
.header-actions .language-toggle:active,.header-actions .theme-toggle:active{transform:scale(.9);box-shadow:none}
#themeLabel{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.theme-toggle-icon{display:block;position:relative;width:21px;height:21px}
.theme-toggle-icon svg{position:absolute;inset:0;display:block;width:21px;height:21px;transition:opacity .25s ease,transform .45s cubic-bezier(.2,.8,.2,1.2)}
.theme-moon{opacity:1;transform:rotate(-8deg) scale(1)}
.theme-sun{opacity:0;transform:rotate(80deg) scale(.3)}
:root[data-theme='dark'] .theme-moon{opacity:0;transform:rotate(-100deg) scale(.3)}
:root[data-theme='dark'] .theme-sun{opacity:1;transform:rotate(0) scale(1)}
@media(prefers-reduced-motion:reduce){.header-actions .language-toggle,.header-actions .theme-toggle,.theme-toggle-icon svg{transition:none}.header-actions .language-toggle:hover,.header-actions .theme-toggle:hover{transform:none}}
/* Dedicated dark artwork; the ivory composition remains exclusive to light mode. */
:root[data-theme='dark']{--bg:#1c1917;--panel:#26211e;--line:#51443a;--text:#f5ede3;--muted:#c4b3a3;--surface:#211d1a;--elevated:#302720;--secondary:#352b24;--active:#493125;--accent:#e4ad85;--action:#97432c;--stage:#171412;--background-opacity:.72}
:root[data-theme='dark'] body::before{background-image:url('/static/brand/editorial-dark-background.webp')}
:root[data-theme='dark'] .card{box-shadow:0 10px 32px #00000020}
:root[data-theme='dark'] header{background:#211c19}
/* Let the warm paper artwork continue behind the light-mode masthead. */
:root[data-theme='light'] header{background:transparent;border-bottom-color:transparent}
:root[data-theme='light'] .header-actions .language-toggle,:root[data-theme='light'] .header-actions .theme-toggle{background:var(--surface)}
/* Keep media at a presentation-friendly size instead of growing with its aspect ratio. */
.grid{grid-template-columns:minmax(0,1.7fr) minmax(350px,1fr);align-items:start}
.grid>.card{min-width:0}
.stage{height:clamp(260px,43vh,440px);min-height:0;display:flex;align-items:center;justify-content:center;padding:8px}
.stage canvas{width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;flex:none}
.stage video{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;flex:none}
.video-job{padding:20px;max-height:100%;overflow:auto}
.empty{padding:24px}
.settings{gap:10px;padding:14px}
.settings>div{min-width:135px}
@media(min-width:951px){aside.card{max-height:calc(100dvh - 145px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}}
@media(max-width:950px){.grid{grid-template-columns:1fr}.stage{height:clamp(240px,44vh,390px);min-height:0}.stage canvas{max-height:100%}}
@media(max-width:550px){.stage{height:clamp(220px,38vh,320px);min-height:0}.settings>div{min-width:calc(50% - 10px)}.empty{padding:18px}}
/* Keep the live totals next to the media on phones as a compact summary strip. */
@media(max-width:950px){
 .grid{display:flex;flex-direction:column;gap:12px}
 .grid>aside.card{display:contents}
 .grid>aside>.cardhead{display:none}
 .grid>aside>.summary{order:-1;width:100%;background:var(--panel);border:1px solid var(--line);border-radius:14px;display:grid;grid-template-columns:auto 1fr;gap:0 16px;align-items:center;padding:10px 12px}
 .summary-title{font-size:11px}.summary-count{grid-column:1}.summary-count b{font-size:32px}.summary>small{display:none}
 .summary .stats{grid-column:2;grid-row:1/3;padding:0;gap:5px}.summary .stat{font-size:10px;padding:6px 3px}.summary .stat b{font-size:23px}.summary .stat small{display:none}
 .grid>.card{width:100%}.grid>aside>.detail{width:100%;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:12px}
 .stage{height:clamp(230px,39dvh,360px)}
 .toolbar{gap:6px}.toolbar button,.toolbar a{padding:8px;font-size:12px}
}
