/* Industrial dashboard inspired by the supplied selective-lighting reference. */
.tv-settings { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.tv-settings > div { flex:1 1 100%; }
.tv-settings h2 { margin:0 0 6px; font-size:20px; }
.tv-settings p,.tv-help { color:var(--muted); font-size:12px; line-height:1.6; }
.tv-settings label { display:grid; gap:6px; font-size:11px; font-weight:700; }
.tv-settings input,.tv-settings select { max-width:200px; }
.tv-stage { --tv-white:#f4fbff; --tv-muted:#a9bfce; position:relative; isolation:isolate; container-type:inline-size; aspect-ratio:16/9; overflow:hidden; background:#071422; color:var(--tv-white); border-radius:14px; box-shadow:0 18px 55px #06132130; }
.tv-stage *, .tv-stage *::before { box-sizing:border-box; }
.tv-scene { position:absolute; inset:0; z-index:-3; background:url('/assets/tv-scene.png') center/cover no-repeat; }
.tv-spot { position:absolute; inset:0; z-index:-2; background:rgba(3,11,21,var(--tv-darkness,.68)); }
.tv-focused .tv-spot { background:radial-gradient(ellipse var(--tv-spot-rx,18%) var(--tv-spot-ry,25%) at var(--tv-spot-x,50%) var(--tv-spot-y,50%),rgba(3,11,21,.08) 15%,rgba(3,11,21,.25) 55%,rgba(3,11,21,var(--tv-focus-darkness,.82)) 100%); }
.tv-header { position:absolute; top:3%; left:2%; right:2%; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.tv-brand,.tv-live { display:flex; align-items:center; gap:1cqw; padding:.6cqw .9cqw; background:#071827dd; border:1px solid #a6e5ff35; border-radius:.5cqw; }
.tv-brand img { width:7cqw; }
.tv-brand span,.tv-live { font-size:.75cqw; letter-spacing:.08em; }
#tv-demo { color:#ffbd72; }
#tv-clock { color:#e9f5ff; font-size:1cqw; font-variant-numeric:tabular-nums; }
.tv-frame { position:absolute; inset:0; }
.tv-dashboard-title { position:absolute; left:20%; top:11%; width:60%; text-align:center; text-shadow:0 2px 15px #021019; }
.tv-dashboard-title p { display:inline-block; background:#061b2bdd; border:1px solid #7ce7ff40; border-radius:20px; color:#aeeeff; padding:.4cqw .9cqw; margin:0; font-size:.75cqw; font-weight:700; letter-spacing:.14em; }
.tv-dashboard-title h2 { color:#fff; font-size:2.5cqw; line-height:1.15; margin:.6cqw 0 .4cqw; }
.tv-dashboard-title > span { font-size:.95cqw; color:#d4e9f5; }
.tv-dashboard-grid { position:absolute; left:19%; top:28%; width:62%; height:55%; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); grid-template-rows:1fr 1fr; gap:1cqw; }
.tv-dashboard-card { min-width:0; min-height:0; overflow:hidden; padding:1cqw 1.1cqw; background:linear-gradient(145deg,#091c2cf5,#081421ef); border:1px solid #84d8ff46; border-radius:1cqw; box-shadow:0 12px 32px #030d1c80; position:relative; display:flex; flex-direction:column; }
.tv-dashboard-card::before { content:''; position:absolute; top:0; left:1cqw; width:3cqw; height:2px; background:#6ce4ff; box-shadow:0 0 12px #6ce4ff; }
.tv-dashboard-card > header { display:flex; align-items:baseline; justify-content:space-between; gap:.5cqw; }
.tv-dashboard-card h3 { color:#f4fbff; font-size:1cqw; margin:0; font-weight:700; }
.tv-dashboard-card > header > span { color:#a9bfce; font-size:.65cqw; white-space:nowrap; }
.tv-card-period { margin:.35cqw 0 .6cqw; color:#9fb9ca; font-size:.59cqw; }
.tv-score-content { flex:1; min-height:0; display:flex; align-items:center; gap:1cqw; }
.tv-score-dial { width:9cqw; aspect-ratio:1; position:relative; flex-shrink:0; }
.tv-score-dial svg { width:100%; height:100%; transform:rotate(-90deg); }
.tv-score-dial circle { fill:none; stroke-width:9; }
.tv-score-dial .tv-dial-track { stroke:#29414f; }
.tv-score-dial .tv-dial-value { stroke:#55dfff; stroke-linecap:round; }
.tv-score-dial > div { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; flex-direction:column; }
.tv-score-dial strong { font-size:2.7cqw; line-height:1.1; color:#fff; }
.tv-score-dial span { font-size:.68cqw; color:#a9bfce; }
.tv-score-rows { flex:1; display:grid; gap:.45cqw; }
.tv-score-rows > div { display:grid; grid-template-columns:1fr auto; gap:.15cqw .4cqw; font-size:.75cqw; }
.tv-score-rows b { font-weight:600; color:#e9f9ff; }
.tv-score-rows svg { grid-column:1/-1; width:100%; height:.25cqw; border-radius:4px; }
.tv-score-rows .tv-dial-track { fill:#24394a; }
.tv-pie-content { display:flex; gap:.8cqw; align-items:center; flex:1; min-height:0; }
.tv-pie-content > svg { width:9cqw; flex-shrink:0; max-height:100%; }
.tv-pie-content text { fill:#bcd4e3; font-size:11px; }
.tv-pie-content text.tv-pie-total { fill:#fff; font-size:17px; font-weight:700; }
.tv-pie-legend { flex:1; min-width:0; max-height:100%; overflow:auto; display:grid; gap:.35cqw; }
.tv-pie-legend > div { display:grid; grid-template-columns:.6cqw minmax(0,1fr) auto; align-items:center; gap:.4cqw; font-size:.65cqw; }
.tv-pie-legend svg { width:.6cqw; height:.6cqw; }
.tv-pie-legend b { color:#fff; }
.tv-objectives-chart,.tv-burndown-chart { display:block; width:100%; flex:1; min-height:0; }
.tv-objectives-chart text,.tv-burndown-chart text { fill:#b6cfdf; font-family:inherit; font-size:17px; }
.tv-objectives-chart .tv-chart-value { fill:#f4fbff; font-weight:700; }
.tv-bar-track { fill:#24394a; }
.tv-grid-line { stroke:#91b5cb33; stroke-width:1; }
.tv-real-line { fill:none; stroke:#55dfff; stroke-width:3; }
.tv-ideal-line { fill:none; stroke:#ffb866; stroke-width:3; stroke-dasharray:8 5; }
.tv-today-line { stroke:#b8cbd5; stroke-dasharray:3 5; }
.tv-burn-values { color:#c4dce9; font-size:.68cqw; }
.tv-burn-values b { color:#fff; }
.tv-burn-legend { display:flex; gap:1cqw; font-size:.65cqw; }
.tv-burn-legend span:first-child { color:#55dfff; }.tv-burn-legend span:last-child { color:#ffb866; }
.tv-chart-empty { flex:1; display:grid; align-content:center; text-align:center; padding:2cqw; color:#b9d1e1; font-size:.9cqw; }
.tv-frame > .tv-chart-empty { position:absolute; inset:30% 20%; background:#071827e8; border:1px solid #84d8ff46; border-radius:12px; }
.tv-footer { position:absolute; bottom:2%; left:2%; right:2%; padding:.7cqw .8cqw 1cqw; display:flex; align-items:center; flex-wrap:wrap; gap:.7cqw; background:#071725f2; border:1px solid #a1dfff40; border-radius:.7cqw; }
#tv-dots { display:flex; gap:.4cqw; flex:1; min-width:0; overflow:auto; }
#tv-dots button,.tv-controls button { background:#142b3b; color:#c2d8e7; border:1px solid #b2ddf033; border-radius:.4cqw; padding:.55cqw .7cqw; font-size:.75cqw; font-weight:700; white-space:nowrap; }
#tv-dots button[aria-current='true'] { background:#123f55; border-color:#60dcff; color:#e0faff; box-shadow:0 0 13px #47cfff33; }
.tv-controls { display:flex; gap:.4cqw; }
.tv-controls button { font-size:1cqw; padding:.3cqw .8cqw; }
.tv-footer-meta { display:flex; gap:.8cqw; color:#9fb7c7; font-size:.6cqw; width:100%; }
#tv-freshness { margin-left:auto; }
#tv-countdown { position:absolute; height:3px; bottom:0; left:1%; width:98%; border:0; accent-color:#55dfff; background:#304656; }
#tv-countdown::-webkit-progress-bar { background:#304656; }#tv-countdown::-webkit-progress-value { background:#55dfff; }
.tv-help { margin-top:12px; }
body.tv-mode { overflow:hidden; }
body.tv-mode .sidebar,body.tv-mode .topbar,body.tv-mode .tv-settings,body.tv-mode .tv-help { display:none!important; }
body.tv-mode .app-shell,body.tv-mode .workspace { display:block; width:100vw; height:100vh; }
body.tv-mode main { padding:0; }
body.tv-mode .tv-stage { position:fixed; inset:0; width:100vw; height:100vh; aspect-ratio:auto; border-radius:0; z-index:50; }
@media(max-width:700px) {
 .tv-stage { aspect-ratio:auto; padding:16px; min-height:1100px; overflow:auto; }
 .tv-header { position:relative; top:auto; left:auto; right:auto; gap:8px; margin-bottom:18px; }
 .tv-brand,.tv-live { padding:7px; gap:6px; }.tv-brand img { width:65px; }.tv-brand span { font-size:8px; }#tv-clock { font-size:11px; }#tv-demo { font-size:8px; }
 .tv-frame { position:static; }.tv-dashboard-title { position:static; width:auto; }.tv-dashboard-title p { font-size:9px; padding:6px 10px; }.tv-dashboard-title h2 { font-size:24px; margin:12px 0; }.tv-dashboard-title > span { font-size:12px; }
 .tv-dashboard-grid { position:static; width:auto; height:auto; grid-template-columns:1fr; grid-template-rows:none; gap:14px; margin-top:20px; }
 .tv-dashboard-card { padding:15px; min-height:235px; border-radius:10px; }.tv-dashboard-card h3 { font-size:14px; }.tv-dashboard-card > header > span,.tv-card-period { font-size:10px; }.tv-card-period { margin:8px 0; }
 .tv-score-dial { width:120px; }.tv-score-dial strong { font-size:32px; }.tv-score-dial span { font-size:10px; }.tv-score-content { gap:15px; }.tv-score-rows { gap:9px; }.tv-score-rows > div { font-size:11px; gap:4px; }.tv-score-rows svg { height:4px; }
 .tv-pie-content { gap:15px; }.tv-pie-content > svg { width:115px; }.tv-pie-legend { gap:7px; }.tv-pie-legend > div { grid-template-columns:8px 1fr auto; gap:5px; font-size:10px; }.tv-pie-legend svg { width:8px; height:8px; }
 .tv-burn-values,.tv-burn-legend { font-size:10px; }.tv-burndown-chart,.tv-objectives-chart { min-height:145px; }.tv-chart-empty { font-size:12px; }
 .tv-footer { position:relative; left:auto; right:auto; bottom:auto; padding:12px; margin-top:20px; gap:10px; border-radius:9px; }#tv-dots { flex-wrap:wrap; flex:1 1 100%; }#tv-dots button,.tv-controls button { font-size:11px; padding:8px; }.tv-footer-meta { font-size:9px; gap:8px; }#tv-slide-label { display:none; }
}
@media(prefers-reduced-motion:reduce) { .tv-stage * { scroll-behavior:auto!important; } }
/* Editor uses the browser's modal layer so it also works over fullscreen TV. */
#tv-editor { width:min(1160px,96vw); max-width:none; max-height:94vh; padding:0; border:1px solid #396277; border-radius:17px; background:#0b1c2a; color:#f4fbff; box-shadow:0 25px 100px #000a; font:14px Inter,Segoe UI,Arial,sans-serif; }
#tv-editor::backdrop { background:#020912df; backdrop-filter:blur(9px); }
#tv-editor * { box-sizing:border-box; }
.tve-window { display:flex; flex-direction:column; max-height:92vh; }
.tve-header,.tve-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:17px 23px; background:#102637; flex-shrink:0; }
.tve-header { border-bottom:1px solid #315164; }.tve-header h2 { margin:4px 0; font-size:26px; color:#f4fbff; }.tve-header p { margin:0; color:#a9c0cf; font-size:13px; }.tve-header span { font-size:10px; letter-spacing:2px; color:#69ddf5; font-weight:800; }
.tve-body { display:grid; grid-template-columns:290px minmax(0,1fr); overflow:auto; min-height:0; }
.tve-settings,.tve-detail { padding:18px 22px; min-width:0; }.tve-settings { background:#0a1724; border-right:1px solid #315164; }
#tv-editor h3 { font-size:14px; color:#9aeaff; margin:0 0 12px; }.tve-settings h3:not(:first-child) { margin-top:24px!important; }
#tv-editor label { display:block; color:#b8d0df; font-size:12px; font-weight:600; margin-bottom:11px; }
#tv-editor input:not([type=range]):not([type=file]),#tv-editor select { display:block; width:100%; padding:8px 10px; margin-top:5px; border-radius:6px; border:1px solid #3b596d; background:#07131f; color:#fff; font:14px inherit; min-width:0; height:auto; }
#tv-editor input[type=range] { width:100%; accent-color:#5ce0fa; }#tv-editor input[type=file] { width:100%; font-size:11px; margin-top:8px; }
#tv-editor button { font:700 12px Inter,Segoe UI,Arial,sans-serif; padding:9px 12px; border:1px solid #496778; border-radius:7px; background:#162e40; color:#e0f4ff; cursor:pointer; }
#tv-editor button:hover { border-color:#64e4ff; }#tv-editor button:disabled { opacity:.4; cursor:not-allowed; }#tv-editor button.tve-primary { background:#58daf2; color:#062333; border-color:#75e9fc; font-size:14px; }#tv-editor button.tve-danger { color:#ff9da8; border-color:#844554; }
#tv-editor button:focus-visible,#tv-editor input:focus-visible,#tv-editor select:focus-visible,#tve-ellipse:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.tve-note { font-size:12px; color:#a9c0cf; line-height:1.5; margin-top:13px; }
#tve-team-list { display:grid; gap:5px; max-height:250px; overflow:auto; margin-bottom:9px; }#tve-team-list button { text-align:left; background:#142839; border-color:#294657; color:#cfdeea; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }#tve-team-list button.active { border-color:#62dfff; background:#174256; color:#fff; }
#tve-count { color:#88aabd; font-weight:400; }.tve-preview-head { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }.tve-preview-head span { font-size:11px; color:#9bb3c2; }
#tve-preview { position:relative; aspect-ratio:16/9; width:100%; background-position:center; background-size:cover; border:1px solid #4b788a; border-radius:9px; overflow:hidden; touch-action:none; user-select:none; }
#tve-shade { position:absolute; inset:0; pointer-events:none; }#tve-ellipse { position:absolute; border:2px solid #79eaff; box-shadow:0 0 15px #57dfff80; border-radius:50%; cursor:move; touch-action:none; }
.tve-handle { position:absolute; width:16px; height:16px; border:2px solid #fff; background:#45bdda; border-radius:50%; z-index:2; }.tve-hx { right:0; top:50%; transform:translate(50%,-50%); cursor:ew-resize; }.tve-hy { bottom:0; left:50%; transform:translate(-50%,50%); cursor:ns-resize; }.tve-cross { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); color:#fff; font-size:24px; pointer-events:none; }
.tve-coordinates { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-top:10px; }.tve-fields { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; }.tve-wide { grid-column:1/-1; }.tve-actions { display:flex; gap:7px; flex-wrap:wrap; align-items:center; }.tve-footer { border-top:1px solid #315164; flex-wrap:wrap; }.tve-end { margin-left:auto; justify-content:flex-end; }#tve-status { max-width:300px; font-size:12px; color:#ffd29b; }#tve-dark-value { float:right; color:#fff; }
@media(max-width:780px) { .tve-body { grid-template-columns:1fr; }.tve-settings { border-right:0; border-bottom:1px solid #315164; }.tve-header,.tve-footer,.tve-settings,.tve-detail { padding:12px; }.tve-end { margin-left:0; }.tve-preview-head { flex-wrap:wrap; }.tve-header h2 { font-size:22px; }.tve-coordinates { grid-template-columns:1fr 1fr; } }

#tv-score-card { grid-column:1/4; grid-row:1; }
#tv-burndown-card { grid-column:4/7; grid-row:1; }
#tv-alignment-card { grid-column:1/3; grid-row:2; }
#tv-objectives-card { grid-column:3/5; grid-row:2; }
#tv-activity-card { grid-column:5/7; grid-row:2; }
.tv-alignment-chart { display:block; width:100%; flex:1; min-height:0; }
.tv-alignment-values { color:#b6cfdf; text-align:center; font-size:.55cqw; margin:.2cqw 0 0; }
@media(max-width:700px) {
 #tv-score-card,#tv-burndown-card,#tv-alignment-card,#tv-objectives-card,#tv-activity-card { grid-column:1/-1; grid-row:auto; }
 .tv-alignment-chart { min-height:180px; }
 .tv-alignment-values { font-size:10px; }
}
