:root {
  --ink: #161916;
  --muted: #6e756d;
  --line: #e2e5dd;
  --panel: #f6f7f3;
  --paper: #ffffff;
  --night: #111511;
  --green: #234f3a;
  --green-2: #2d6a4f;
  --lime: #b8f34a;
  --gold: #ffb82e;
  --danger: #d94d3f;
  --shadow: 0 18px 60px rgba(27, 39, 30, .09);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--panel); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 68px 300px minmax(760px, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; background: var(--night); display: flex; flex-direction: column; align-items: center; padding: 18px 0; color: white; z-index: 4; }
.brand-mark { width: 38px; height: 38px; border: 0; border-radius: 11px; color: var(--night); background: var(--lime); font-weight: 900; font-size: 18px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.rail-nav { display: grid; gap: 10px; margin-top: 52px; }
.rail-button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: transparent; color: #929a91; font-size: 20px; transition: .18s ease; }
.rail-button:hover, .rail-button.is-active { background: #263027; color: var(--lime); }
.avatar { margin-top: auto; width: 36px; height: 36px; border: 1px solid #4b554c; background: #2a322b; color: white; border-radius: 50%; font-weight: 750; font-size: 11px; }

.device-panel { position: sticky; top: 0; height: 100vh; overflow: auto; background: #fbfcf9; border-right: 1px solid var(--line); padding: 25px 18px 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.eyebrow, .section-kicker { display: block; margin: 0 0 5px; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: #7a8378; }
.panel-heading h1 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.icon-button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: white; font-size: 22px; line-height: 1; }
.fleet-summary { margin: 22px 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px; border-radius: 14px; background: #eff2eb; }
.fleet-summary div { display: grid; gap: 2px; text-align: center; border-right: 1px solid #d8ddd2; }
.fleet-summary div:last-child { border-right: 0; }
.fleet-summary strong { font-size: 17px; }
.fleet-summary span { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.section-label { display: flex; justify-content: space-between; align-items: center; margin: 0 5px 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #727a70; }
.section-label button { border: 0; color: #747c73; background: transparent; font-size: 10px; text-transform: none; letter-spacing: 0; }
.device-list { display: grid; gap: 7px; }
.device-card { width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 13px; padding: 11px 10px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; transition: .18s ease; }
.device-card:hover { background: #f0f2ed; }
.device-card.is-active { background: white; border-color: #dfe3da; box-shadow: 0 8px 24px rgba(32,45,34,.07); }
.device-thumb { width: 40px; height: 28px; background: #222a24; border-radius: 5px; display: grid; place-items: center; color: var(--lime); font-size: 12px; border: 2px solid #3b443c; box-shadow: 0 2px 0 #7e847d; }
.device-card strong { display: block; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.device-card small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.device-state { width: 8px; height: 8px; border-radius: 50%; background: #57bd70; box-shadow: 0 0 0 3px #e5f6e9; }
.device-state.warn { background: #e69b34; box-shadow: 0 0 0 3px #fff0d8; }
.pair-button { width: 100%; margin-top: 14px; border: 1px dashed #cfd5ca; background: transparent; color: #5f685d; border-radius: 12px; padding: 12px; font-size: 11px; font-weight: 700; }
.pair-button span { font-size: 16px; vertical-align: -1px; margin-right: 5px; }

.workspace { min-width: 0; padding: 0 30px 30px; }
.topbar { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.breadcrumbs { display: flex; gap: 8px; font-size: 10px; color: #8b9189; margin-bottom: 8px; }
.breadcrumbs strong { color: #596158; }
.title-row { display: flex; align-items: center; gap: 12px; }
.title-row h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 20px; background: #e6f4e7; color: #327044; font-size: 10px; font-weight: 750; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: #51af68; }
.status-pill.warn { background: #fff0da; color: #996220; }
.status-pill.warn i { background: #e99d38; }
.top-actions { display: flex; gap: 9px; }
.button { border: 0; border-radius: 10px; padding: 10px 14px; font-size: 11px; font-weight: 750; transition: .18s ease; }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button.ghost { border: 1px solid #d9ded5; background: white; color: #4c544c; }
.button.ghost:hover { background: #f3f5f0; }
.button.power-button { border-color: #b9cbbd; color: var(--green); }
.button.power-button:hover { background: #edf4ee; border-color: #90aa96; }
.button.primary { background: var(--green); color: white; box-shadow: 0 8px 18px rgba(35,79,58,.18); }
.button.primary:hover { background: #1c432f; transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none !important; }

.main-grid { display: grid; grid-template-columns: minmax(560px, 1fr) 300px; gap: 20px; align-items: start; }
.stage-column { min-width: 0; display: grid; gap: 18px; }
.stage-card, .mode-section, .settings-panel, .activity-card { background: var(--paper); border: 1px solid #e3e6df; border-radius: 18px; box-shadow: 0 7px 30px rgba(30,42,32,.035); }
.stage-card { padding: 18px 18px 14px; }
.card-heading, .section-title-row, .settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-heading h3, .section-title-row h3, .settings-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.preview-meta { display: flex; align-items: center; gap: 14px; font-size: 9px; color: #7b837a; }
.preview-meta span { display: inline-flex; align-items: center; gap: 5px; }
.preview-meta button { border: 0; background: transparent; color: var(--green-2); font-weight: 750; font-size: 9px; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #57bd70; box-shadow: 0 0 0 3px #e3f4e6; }
.tv-frame { margin-top: 14px; background: #171a17; padding: 8px; border-radius: 12px; box-shadow: 0 14px 35px rgba(16,20,17,.16), inset 0 0 0 1px rgba(255,255,255,.08); }
.tv-screen { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0d110e; border-radius: 5px; color: white; position: relative; }
.stage-footer { display: flex; justify-content: space-between; margin-top: 10px; font-size: 9px; color: #899087; }

.mode-section { padding: 18px; }
.unsaved-badge { border: 1px solid #d7ddd2; background: #f6f8f4; color: #697167; border-radius: 20px; padding: 5px 8px; font-size: 9px; }
.unsaved-badge.saved { background: #e7f4e8; color: #2d7041; border-color: #cde5d1; }
.mode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.mode-card { min-width: 0; border: 1px solid #e0e4dc; background: #fbfcfa; border-radius: 13px; padding: 13px 8px 11px; display: grid; justify-items: start; text-align: left; transition: .18s ease; }
.mode-card:hover { border-color: #aeb8aa; transform: translateY(-1px); }
.mode-card.is-active { border-color: var(--green); box-shadow: 0 0 0 2px rgba(35,79,58,.08); background: #f7faf6; }
.mode-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #edf1ea; color: #3f5b49; margin-bottom: 10px; font-size: 14px; }
.mode-card.is-active .mode-icon { background: var(--green); color: var(--lime); }
.mode-card strong { font-size: 10px; }
.mode-card small { margin-top: 3px; color: #81887f; font-size: 8px; }

.activity-card { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 13px 15px; }
.activity-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #e7f5e9; color: #317144; font-weight: 800; }
.activity-card strong, .activity-card span { display: block; }
.activity-card strong { font-size: 10px; }
.activity-card span { margin-top: 3px; font-size: 9px; color: #7f877e; }
.activity-card button { border: 0; background: transparent; color: var(--green-2); font-size: 9px; font-weight: 800; }

.settings-panel { padding: 18px; min-height: 640px; }
.more-button { border: 0; background: #f0f2ed; border-radius: 9px; width: 32px; height: 30px; color: #6b7369; }
.setting-group { margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf0e9; }
.setting-group:first-child { border-top: 0; padding-top: 0; }
.setting-group > label, .field > label { display: block; margin-bottom: 8px; color: #70786f; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.field { margin-top: 14px; }
.control, .setting-group select, .setting-group input { width: 100%; border: 1px solid #dce1d8; background: #fafbf9; border-radius: 10px; padding: 10px 11px; color: #3e463d; font-size: 10px; outline: none; }
.setting-group input:focus, .setting-group select:focus { border-color: #74967f; box-shadow: 0 0 0 3px rgba(45,106,79,.08); }
.segmented { display: grid; grid-template-columns: repeat(2,1fr); padding: 3px; border-radius: 10px; background: #eff2ed; }
.segmented.three { grid-template-columns: repeat(3,1fr); }
.segmented button { padding: 8px 5px; border: 0; border-radius: 8px; background: transparent; color: #737b72; font-size: 9px; font-weight: 700; }
.segmented button.is-active { background: white; color: #2c4b38; box-shadow: 0 2px 8px rgba(30,43,33,.08); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.toggle-row strong { display: block; font-size: 10px; }
.toggle-row small { display: block; font-size: 8px; color: #8a9188; margin-top: 3px; }
.toggle { position: relative; width: 34px; height: 20px; border: 0; border-radius: 20px; background: #d8ddd5; flex: 0 0 auto; }
.toggle::after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: .18s ease; }
.toggle.on { background: var(--green-2); }
.toggle.on::after { transform: translateX(14px); }
.mini-source { display: flex; gap: 9px; align-items: center; border: 1px solid #dce1d8; background: #fafbf9; padding: 10px; border-radius: 10px; }
.source-dot { width: 8px; height: 8px; border-radius: 50%; background: #53b86b; box-shadow: 0 0 0 3px #e2f3e5; }
.mini-source strong { font-size: 10px; }
.mini-source small { display: block; margin-top: 2px; font-size: 8px; color: #838a82; }
.quick-actions { border-top: 1px solid #edf0e9; margin-top: 20px; padding-top: 18px; }
.quick-actions > button { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; border: 0; background: transparent; padding: 10px 3px; text-align: left; }
.quick-actions > button > span { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #eef1eb; color: #4a654f; }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions strong { font-size: 10px; }
.quick-actions small { font-size: 8px; margin-top: 3px; color: #899087; }
.quick-actions b { color: #a0a69e; }

/* TV renderers */
.clock-view { height: 100%; display: grid; grid-template-rows: 90% 10%; background: #080b09; }
.clock-hero { position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 50%, #294837 0, #102218 42%, #070a08 80%); }
.clock-hero::before { content: ""; position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, transparent 0deg 9deg, rgba(184,243,74,.055) 10deg 11deg); animation: spin 24s linear infinite; }
.clock-hero::after { content: ""; position: absolute; width: 44%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(184,243,74,.36); box-shadow: 0 0 0 32px rgba(184,243,74,.025), 0 0 0 64px rgba(184,243,74,.018), 0 0 80px rgba(184,243,74,.12); animation: breathe 3.5s ease-in-out infinite; }
.hero-wordmark { position: relative; z-index: 2; text-align: center; }
.hero-wordmark .l-mark { width: 74px; height: 74px; margin: auto; display: grid; place-items: center; border: 2px solid var(--lime); border-radius: 22px; color: var(--lime); font-size: 42px; font-weight: 900; transform: rotate(-4deg); box-shadow: 0 0 30px rgba(184,243,74,.18); }
.hero-wordmark strong { display: block; margin-top: 14px; font-size: clamp(14px, 2.4vw, 28px); letter-spacing: .24em; text-transform: uppercase; }
.hero-wordmark span { display: block; color: var(--lime); margin-top: 5px; font-size: clamp(6px, .8vw, 10px); letter-spacing: .28em; text-transform: uppercase; }
.clock-strip { position: relative; z-index: 3; background: #f3f5ed; color: #111511; padding: .6% 3%; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 2.5%; }
.strip-team { min-width: 0; height: 100%; display: flex; align-items: center; gap: 7%; }
.strip-team.away { justify-content: flex-end; text-align: right; }
.strip-team > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(6px, .82vw, 12px); font-weight: 850; letter-spacing: .07em; }
.mini-logo { height: 76%; max-height: 54px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #bdc5b7; border-radius: 50%; font-size: clamp(6px, .75vw, 11px); font-weight: 900; }
.clock-strip .vs { font-size: clamp(5px, .55vw, 8px); color: #7c8378; font-weight: 800; text-transform: uppercase; }
.clock-time { height: 72%; min-width: 14%; padding-left: 3%; border-left: 1px solid #ccd2c8; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; font-variant-numeric: tabular-nums; }
.clock-time strong { display: block; font-size: clamp(11px, 1.6vw, 23px); line-height: .92; letter-spacing: -.07em; }
.clock-time span { display: block; margin-bottom: 2px; font-size: clamp(4px, .48vw, 7px); color: #6e766c; text-transform: uppercase; letter-spacing: .12em; }

.menu-view { height: 100%; padding: 4.5% 5%; color: #182018; background: linear-gradient(125deg,#f4ead1 0,#fffaf0 48%,#dfe9d5 100%); position: relative; overflow: hidden; }
.menu-view::after { content: ""; position: absolute; width: 38%; height: 150%; right: -15%; top: -25%; transform: rotate(14deg); background: repeating-linear-gradient(90deg,rgba(31,79,52,.05) 0 6px,transparent 6px 22px); }
.menu-header { display: flex; align-items: end; justify-content: space-between; border-bottom: 3px solid #244d36; padding-bottom: 2.4%; position: relative; z-index: 1; }
.menu-header h4 { margin: 0; font-family: Georgia,serif; font-size: clamp(18px,4vw,45px); font-style: italic; letter-spacing: -.04em; }
.menu-header span { color: #44604c; font-size: clamp(6px,.9vw,11px); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.menu-columns { display: grid; grid-template-columns: repeat(3,1fr); gap: 5%; margin-top: 3%; position: relative; z-index: 1; }
.menu-section h5 { margin: 0 0 8%; color: #a45c23; font-size: clamp(8px,1.35vw,15px); text-transform: uppercase; letter-spacing: .12em; }
.menu-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 0 0 7%; font-size: clamp(7px,1.1vw,13px); font-weight: 700; }
.menu-item span:last-child { font-variant-numeric: tabular-nums; color: #244d36; }
.menu-note { position: absolute; left: 5%; bottom: 4%; font-size: clamp(5px,.7vw,9px); color: #697467; letter-spacing: .08em; text-transform: uppercase; }

.image-view { height: 100%; display: grid; place-items: center; text-align: center; position: relative; overflow: hidden; background: linear-gradient(145deg,#151f19,#294d38 48%,#d29732); }
.image-view::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(circle at 30% 20%,rgba(184,243,74,.2),transparent 25%), radial-gradient(circle at 70% 80%,rgba(255,184,46,.23),transparent 28%); filter: blur(10px); }
.neutral-card { position: relative; width: 62%; padding: 6% 8%; border: 1px solid rgba(255,255,255,.35); background: rgba(8,14,10,.52); backdrop-filter: blur(14px); border-radius: 14px; box-shadow: 0 20px 80px rgba(0,0,0,.25); }
.neutral-card span { color: var(--lime); font-size: clamp(6px,.8vw,10px); letter-spacing: .18em; text-transform: uppercase; }
.neutral-card h4 { margin: 4% 0 1%; font-size: clamp(20px,5vw,58px); letter-spacing: -.05em; }
.neutral-card p { margin: 0; font-size: clamp(8px,1.2vw,15px); color: #d8e1d9; }

.video-view { height: 100%; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(rgba(7,10,8,.25),rgba(7,10,8,.6)), linear-gradient(135deg,#738a78,#1f3327 48%,#151b16); }
.field-lines { position: absolute; inset: 0; opacity: .5; background: linear-gradient(90deg,transparent 49.6%,rgba(255,255,255,.5) 49.8% 50.2%,transparent 50.4%), repeating-linear-gradient(90deg,transparent 0 9%,rgba(255,255,255,.18) 9.1% 9.35%,transparent 9.45% 10%); transform: perspective(350px) rotateX(56deg) scale(1.4); transform-origin: center 80%; }
.live-chip { position: absolute; left: 4%; top: 6%; border-radius: 4px; padding: 4px 7px; background: #df3b32; font-size: clamp(5px,.7vw,9px); font-weight: 900; letter-spacing: .12em; }
.play-orbit { width: 17%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); background: rgba(15,23,17,.35); backdrop-filter: blur(7px); font-size: clamp(14px,3vw,32px); }
.stream-caption { position: absolute; left: 4%; right: 4%; bottom: 5%; display: flex; justify-content: space-between; font-size: clamp(5px,.7vw,9px); color: rgba(255,255,255,.82); }

.web-view { height: 100%; background: #f3f5f0; color: #182019; padding: 3.4%; }
.web-bar { height: 10%; display: flex; align-items: center; gap: 4%; border-bottom: 1px solid #d5dbd1; font-size: clamp(6px,.8vw,10px); }
.web-bar strong { color: #275039; }
.web-stats { display: grid; grid-template-columns: 1.1fr 1.9fr; gap: 3%; height: 83%; padding-top: 3%; }
.web-score { border-radius: 8px; background: #183924; color: white; padding: 9%; display: flex; flex-direction: column; justify-content: space-between; }
.web-score span { font-size: clamp(5px,.7vw,9px); color: #b9cbbb; text-transform: uppercase; letter-spacing: .13em; }
.web-score strong { font-size: clamp(18px,4.5vw,52px); font-variant-numeric: tabular-nums; }
.web-score small { color: var(--lime); font-size: clamp(7px,1vw,12px); }
.stats-table { background: white; border: 1px solid #dce1d8; border-radius: 8px; padding: 4%; }
.stats-table h4 { margin: 0 0 4%; font-size: clamp(8px,1.25vw,14px); }
.stat-row { display: grid; grid-template-columns: 1.5fr repeat(4,1fr); padding: 2.2% 1%; border-top: 1px solid #edf0eb; font-size: clamp(5px,.74vw,9px); }
.stat-row.header { color: #778077; font-weight: 800; text-transform: uppercase; }

.soft-off-view { height: 100%; display: grid; place-items: center; background: #000; color: #697069; text-align: center; }
.soft-off-view strong { display: block; color: #a0a6a0; font-size: clamp(10px,1.6vw,18px); }
.soft-off-view small { display: block; margin-top: 5px; font-size: clamp(5px,.7vw,8px); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .65; } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%,20px); background: #162019; color: white; padding: 11px 16px; border-radius: 10px; box-shadow: 0 12px 35px rgba(0,0,0,.25); font-size: 11px; opacity: 0; pointer-events: none; transition: .22s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
dialog { border: 0; padding: 0; border-radius: 18px; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,15,11,.62); backdrop-filter: blur(4px); }
.dialog-card { width: min(430px, calc(100vw - 32px)); padding: 28px; position: relative; background: white; }
.dialog-close { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #eff2ed; font-size: 20px; }
.dialog-symbol { width: 44px; height: 44px; display: grid; place-items: center; background: var(--green); color: var(--lime); border-radius: 12px; margin-bottom: 18px; font-size: 20px; }
.dialog-card h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.dialog-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; font-size: 12px; }
.dialog-card .preview-code-note { margin: 7px 0 0; color: #6d756c; font-size: 10px; }
.dialog-card .preview-code-note strong { color: var(--green); letter-spacing: .09em; }
.dialog-card label { display: block; margin-top: 15px; font-size: 10px; font-weight: 800; color: #596157; }
.dialog-card input, .dialog-card textarea, .dialog-card select { width: 100%; margin-top: 7px; border: 1px solid #d9ded5; border-radius: 10px; padding: 11px; outline: none; }
.dialog-card input:focus, .dialog-card textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,106,79,.1); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.device-empty { margin: 16px 4px; padding: 20px 18px; border: 1px dashed #c6cec4; border-radius: 12px; color: #546057; background: rgba(255,255,255,.42); }
.device-empty strong, .device-empty small { display: block; }
.device-empty small { margin-top: 7px; line-height: 1.45; }
#authDialog::backdrop { background: rgba(8,12,9,.72); backdrop-filter: blur(8px); }
#authDialog .dialog-card { min-width: min(420px,88vw); }
.form-note { margin: 9px 0 0 !important; color: #7c847a !important; font-size: 10px !important; line-height: 1.45 !important; }
.account-dialog-card { width: min(680px, calc(100vw - 32px)); max-height: min(820px, calc(100vh - 40px)); overflow: auto; }
.account-dialog-card > #accountEmail { margin: 5px 0 0; }
.account-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid #e8ebe5; }
.account-section-heading { display: flex; justify-content: space-between; gap: 16px; }
.account-section h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.account-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.user-list { display: grid; gap: 7px; margin-top: 13px; }
.user-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid #e4e8e0; border-radius: 11px; background: #fafbf9; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e6eee6; color: var(--green); font-size: 10px; font-weight: 850; }
.user-row strong, .user-row small { display: block; }
.user-row strong { font-size: 11px; }
.user-row small { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 9px; white-space: nowrap; }
.user-row em { color: #718073; font-size: 9px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.remove-user-button { border: 0; background: transparent; color: #a5443b; font-size: 9px; font-weight: 800; }
.account-form { margin-top: 16px; padding: 15px; border-radius: 12px; background: #f3f5f0; }
.account-form h3 { margin-bottom: 11px; }
.account-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account-form label { margin-top: 10px; }
.account-form-grid label { margin-top: 0; }
.account-form .button { margin-top: 13px; }
.compact-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.compact-form label, .compact-form .button { margin-top: 0; }
.account-section summary { cursor: pointer; color: var(--green); font-size: 11px; font-weight: 800; }
.account-actions { justify-content: space-between; }
.danger-button { color: #a5443b !important; }
.fullscreen-dialog { width: min(96vw, 1500px); max-width: none; background: #080b09; border-radius: 12px; overflow: hidden; }
.fullscreen-dialog #fullscreenPreview { width: 100%; aspect-ratio: 16/9; color: white; }
.fullscreen-close { position: absolute; right: 14px; top: 14px; z-index: 10; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(0,0,0,.5); color: white; font-size: 24px; }

@media (max-width: 1360px) {
  .app-shell { grid-template-columns: 62px 250px minmax(680px,1fr); }
  .workspace { padding: 0 20px 25px; }
  .main-grid { grid-template-columns: minmax(500px,1fr) 275px; }
  .mode-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 920px) {
  .app-shell { display: block; }
  .rail { position: fixed; bottom: 0; top: auto; width: 100%; height: 62px; flex-direction: row; padding: 8px 14px; }
  .rail-nav { display: flex; margin: 0 auto; }
  .avatar { margin-top: 0; }
  .device-panel { position: static; width: 100%; height: auto; padding-bottom: 10px; }
  .device-list { grid-template-columns: repeat(2,1fr); }
  .pair-button, .fleet-summary { display: none; }
  .workspace { padding-bottom: 85px; }
  .main-grid { grid-template-columns: 1fr; }
  .settings-panel { min-height: auto; }
}
@media (max-width: 620px) {
  .workspace { padding: 0 12px 80px; }
  .topbar { align-items: flex-start; padding: 20px 0; flex-direction: column; }
  .top-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .top-actions .primary, .top-actions .tv-app-link { grid-column: 1/-1; }
  .preview-meta span:nth-child(2) { display: none; }
  .device-list { display: flex; overflow-x: auto; }
  .device-card { min-width: 230px; }
  .mode-grid { grid-template-columns: repeat(2,1fr); }
  .stage-footer { gap: 10px; }
  .stage-footer span:last-child { text-align: right; }
  .account-form-grid, .compact-form { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 32px minmax(0,1fr); }
  .user-row > :last-child { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
