:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0a0b0d;
  --panel: #111316;
  --panel-2: #181b1f;
  --line: rgba(255,255,255,.09);
  --muted: #8e959e;
  --text: #f4f4f1;
  --lime: #d8ff4f;
  --orange: #ff754a;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button { color: inherit; }
.shell { display: grid; grid-template-rows: 58px 1fr; height: 100%; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(10,11,13,.94); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { width: 24px; height: 24px; border: 1px solid rgba(216,255,79,.55); border-radius: 50%; position: relative; }
.brand-mark::before { content: ''; position: absolute; inset: 6px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 16px var(--lime); }
.deck-name { min-width: 0; color: #c5c8cc; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.spacer { flex: 1; }
.segmented { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #08090a; }
.segmented button, .quiet-button, .primary-button, .icon-button { border: 0; border-radius: 7px; background: transparent; cursor: pointer; transition: .18s ease; }
.segmented button { padding: 7px 12px; color: var(--muted); font-size: 12px; }
.segmented button.active { background: #24282d; color: white; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.quiet-button { border: 1px solid var(--line); padding: 8px 12px; color: #c8ccd0; font-size: 12px; }
.quiet-button:hover, .icon-button:hover { background: #24282d; color: white; }
.primary-button { padding: 9px 14px; background: var(--lime); color: #10120c; font-size: 12px; font-weight: 750; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.workspace { min-height: 0; display: grid; grid-template-columns: 186px minmax(0, 1fr) 290px; }
.workspace.presenter-layout { grid-template-columns: 1fr; }
.workspace.presenter-layout .rail, .workspace.presenter-layout .inspector { display: none; }
.workspace.presenter-layout .stage-wrap { padding: 22px 48px 34px; background: #070809; }
.workspace.presenter-layout .stage { width: min(100%, calc((100vh - 115px) * var(--slide-ratio, 1.7778))); }
.rail, .inspector { min-height: 0; background: var(--panel); }
.rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.inspector { border-left: 1px solid var(--line); overflow-y: auto; }
.rail-header, .inspector-header { height: 48px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); color: #a9afb6; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.thumb-list { overflow: auto; padding: 10px; }
.thumb { display: grid; grid-template-columns: 20px 1fr; gap: 7px; align-items: start; padding: 8px 6px; margin-bottom: 5px; border-radius: 9px; cursor: pointer; color: #777f87; }
.thumb:hover { background: rgba(255,255,255,.035); }
.thumb.active { color: var(--lime); background: rgba(216,255,79,.06); }
.thumb-number { text-align: right; font-size: 10px; padding-top: 4px; }
.thumb-image { aspect-ratio: 16/9; border-radius: 3px; overflow: hidden; background: #202328; box-shadow: 0 2px 10px rgba(0,0,0,.28); outline: 1px solid rgba(255,255,255,.08); }
.thumb.active .thumb-image { outline: 2px solid var(--lime); }
.thumb-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stage-wrap { min-width: 0; min-height: 0; position: relative; display: grid; place-items: center; padding: 44px; background-color: #0d0f11; background-image: radial-gradient(rgba(255,255,255,.055) .7px, transparent .7px); background-size: 15px 15px; }
.stage { width: min(100%, calc((100vh - 146px) * var(--slide-ratio, 1.7778))); aspect-ratio: var(--slide-ratio, 1.7778); position: relative; background: white; box-shadow: 0 24px 80px rgba(0,0,0,.48); overflow: hidden; cursor: crosshair; user-select: none; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.empty-stage { position: absolute; inset: 0; display: grid; place-items: center; background: #15181b; color: #9da3aa; text-align: center; }
.region {
  position: absolute;
  border: 2px solid rgba(255,255,255,.96);
  outline: 1px solid rgba(0,0,0,.92);
  outline-offset: 1px;
  background: repeating-linear-gradient(135deg, rgba(0,0,0,.055) 0 5px, rgba(255,255,255,.055) 5px 10px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), 0 1px 5px rgba(0,0,0,.28);
  cursor: pointer;
  transition: background .15s, box-shadow .15s, filter .15s;
}
.region::after { content: attr(data-order); position: absolute; left: -2px; top: -23px; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 5px; border: 1px solid white; border-radius: 6px 6px 0 0; background: #090a0b; color: white; box-shadow: 0 0 0 1px rgba(0,0,0,.9), 0 2px 7px rgba(0,0,0,.4); font: 750 10px/1 Inter, sans-serif; }
.region:hover, .region.active { background: repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 6px, rgba(0,0,0,.10) 6px 12px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.7), 0 0 0 3px rgba(255,255,255,.42), 0 3px 12px rgba(0,0,0,.38); }
.present-mode .region { border-color: transparent; outline-color: transparent; background: transparent; box-shadow: none; }
.present-mode .region::after { opacity: .12; }
.present-mode .region:hover, .present-mode .region.active { border-color: rgba(255,255,255,.9); outline-color: rgba(0,0,0,.9); background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px rgba(0,0,0,.55), 0 0 0 2px rgba(255,255,255,.28); }
.draft-region { position: absolute; border: 2px dashed white; outline: 1px dashed black; outline-offset: 1px; background: repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 6px, rgba(0,0,0,.10) 6px 12px); box-shadow: 0 2px 9px rgba(0,0,0,.35); pointer-events: none; }
.script-popover { position: absolute; z-index: 12; max-width: min(460px, 48%); padding: 16px 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 15px; background: rgba(10,11,13,.9); color: white; box-shadow: 0 18px 50px rgba(0,0,0,.5); backdrop-filter: blur(18px); pointer-events: none; }
.script-popover .eyebrow { margin-bottom: 7px; color: var(--lime); font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.script-popover .script { font-size: clamp(14px, 1.7vw, 24px); line-height: 1.42; letter-spacing: -.02em; }
.script-popover.full .script { font-size: clamp(13px, 1.45vw, 21px); }
.present-hud { position: absolute; inset: auto 16px 14px 16px; display: flex; justify-content: space-between; pointer-events: none; color: rgba(255,255,255,.72); font-size: 11px; text-shadow: 0 1px 8px black; z-index: 10; }
.laser { position: absolute; z-index: 15; width: 16px; height: 16px; transform: translate(-50%,-50%); border: 2px solid rgba(255,255,255,.95); background: var(--orange); border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,77,53,.17), 0 0 22px #ff3d22; pointer-events: none; }
.inspector-body { padding: 16px; }
.empty-inspector { color: #838a92; font-size: 13px; line-height: 1.65; padding: 8px 2px; }
.field { margin-bottom: 16px; }
.field label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #9ba1a8; font-size: 11px; font-weight: 650; }
.field label span { color: #60676f; font-weight: 500; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; background: #0b0d0f; color: white; outline: none; resize: vertical; line-height: 1.45; font-size: 12px; }
.field textarea:focus, .field input:focus { border-color: rgba(216,255,79,.48); box-shadow: 0 0 0 3px rgba(216,255,79,.06); }
.field textarea.short { min-height: 74px; }
.field textarea.full { min-height: 135px; }
.inspector-actions { display: flex; gap: 8px; }
.delete-button { flex: 1; border: 1px solid rgba(255,117,74,.2); border-radius: 8px; padding: 8px; background: rgba(255,117,74,.04); color: #ff9b7d; cursor: pointer; font-size: 11px; }
.status-strip { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 8px; align-items: center; padding: 8px 11px; border: 1px solid var(--line); border-radius: 20px; background: rgba(11,13,15,.88); color: #aab0b6; font-size: 11px; backdrop-filter: blur(12px); }
.status-strip i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.loading { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; background: rgba(5,6,7,.82); backdrop-filter: blur(8px); }
.loading-card { width: 340px; padding: 26px; border: 1px solid var(--line); background: #121417; border-radius: 18px; text-align: center; box-shadow: 0 30px 90px black; }
.loading-ring { width: 30px; height: 30px; margin: 0 auto 16px; border: 2px solid #33373c; border-top-color: var(--lime); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 100; transform: translateX(-50%); padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #1a1d21; color: #e9eaeb; font-size: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.45); }
.audience-body { margin: 0; overflow: hidden; background: black; }
.audience-stage { position: fixed; inset: 0; display: grid; place-items: center; background: black; }
.audience-canvas { position: relative; width: 100vw; height: 56.25vw; max-height: 100vh; max-width: 177.777vh; overflow: hidden; background: black; }
.audience-canvas img { width: 100%; height: 100%; object-fit: contain; display: block; }
.audience-wait { text-align: center; color: #73777c; }
.audience-wait span { display: block; width: 10px; height: 10px; margin: 0 auto 22px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 20px var(--lime); }
.audience-wait h1 { color: #d6d8da; font-size: 20px; font-weight: 580; }
.audience-wait p { font-size: 13px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 120px minmax(0,1fr); }
  .inspector { position: fixed; z-index: 40; top: 58px; right: 0; bottom: 0; width: 290px; box-shadow: -20px 0 50px rgba(0,0,0,.45); }
  .stage-wrap { padding: 24px; }
}
