/* P-Pod — one small stylesheet, system fonts, no framework. */
/* Dark by default: it's a stage. [data-theme="light"] restores the light palette. */
:root {
  --bg: #090e0d; --surface: #111a18; --surface-2: #172321; --line: #23322e;
  --text: #eaf4ee; --muted: #93a89f;
  --pod: #6fe3a5; --pod-ink: #06281a; --pod-soft: #163a2b;
  --air: #ff6b4a; --air-ink: #2a0b04; --air-soft: #3a1d16;
  --warn: #f3b54a; --warn-soft: #3a2c12;
  --glow-pod: rgb(111 227 165 / .16); --glow-air: rgb(255 107 74 / .12);
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 8px 28px rgb(0 0 0 / .3);
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f8f4; --surface: #ffffff; --surface-2: #edf2ee; --line: #d9e3dc;
  --text: #0d1514; --muted: #55665f;
  --pod: #138a55; --pod-ink: #ffffff; --pod-soft: #ddf5e6;
  --air: #e0452a; --air-ink: #ffffff; --air-soft: #fde4de;
  --warn: #9a6200; --warn-soft: #fff1d6;
  --glow-pod: transparent; --glow-air: transparent;
  --shadow: 0 1px 2px rgb(13 21 20 / .06), 0 6px 20px rgb(13 21 20 / .06);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); min-height: 100vh;
  background: radial-gradient(900px 500px at 10% -10%, var(--glow-pod), transparent 70%),
              radial-gradient(800px 500px at 100% 0%, var(--glow-air), transparent 70%), var(--bg); background-repeat: no-repeat; }
a { color: var(--pod); }
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .88em; }
[hidden] { display: none !important; }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.topbar .grow { flex: 1; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; }
.brand img { width: 30px; height: 30px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.spacer { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-title h2, .section-title h3 { margin: 0; }

/* buttons */
.btn { --b: var(--surface-2); --c: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--b); color: var(--c);
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .06s, filter .15s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--pod) 55%, transparent); outline-offset: 2px; }
.btn.primary { --b: var(--pod); --c: var(--pod-ink); border-color: transparent; }
.btn.air { --b: var(--air); --c: var(--air-ink); border-color: transparent; }
.btn.ghost { --b: transparent; }
.btn.danger { --b: transparent; --c: var(--air); border-color: color-mix(in srgb, var(--air) 45%, transparent); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.on { --b: var(--pod-soft); --c: var(--pod); border-color: var(--pod); }

/* forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: 15px/1.4 var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; }
textarea { min-height: 96px; resize: vertical; }
.field + .field { margin-top: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { width: auto; margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; color: var(--muted); font: 600 13px var(--font); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font: 700 12px/20px var(--font);
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.live { background: var(--air); color: var(--air-ink); border-color: transparent; }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.badge.pod { background: var(--pod-soft); color: var(--pod); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--air); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0;
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
dialog.wide { width: min(1040px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(5 10 9 / .55); }
dialog .dlg-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
dialog .dlg-head h2 { margin: 0; flex: 1; font-size: 1.1rem; }
dialog .dlg-body { padding: 18px; }

/* toast */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: up .2s ease-out; }
.toast.err { background: var(--air); color: var(--air-ink); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* audio meter */
.meter { position: relative; height: 6px; width: 72px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: none; }
.meter > i { position: absolute; inset: 0; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--pod); border-radius: inherit; transition: transform .09s linear; }
.onair .meter > i { background: var(--air); }

/* video / stage */
.screen { position: relative; background: #050908; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; width: min(100%, calc(64vh * 16 / 9)); margin-inline: auto; }
.screen video { width: 100%; height: 100%; object-fit: contain; }
.screen .overlay { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; }
.screen .empty { position: absolute; inset: 0; display: grid; place-items: center; color: #8fb8a2; text-align: center; padding: 16px; }
.stage { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 70px; }
.tile video { border-radius: 8px; aspect-ratio: 4 / 3; object-fit: cover; background: #050908; width: 100%; }
.tile .who { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.tile.speaking { border-color: var(--pod); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pod) 35%, transparent); }
.tile.onair.speaking { border-color: var(--air); box-shadow: 0 0 0 2px color-mix(in srgb, var(--air) 35%, transparent); }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 13px var(--font); background: var(--pod-soft); color: var(--pod); }
.onair .avatar { background: var(--air-soft); color: var(--air); }

/* host console */
.console { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); padding: 16px; max-width: 1500px; margin: 0 auto; }
@media (max-width: 900px) { .console { grid-template-columns: 1fr; } }
.caller { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.caller + .caller { margin-top: 8px; }
.caller .meta { min-width: 0; }
.caller .meta b { display: block; }
.caller .meta small { display: block; }
.caller .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.caller.onair { border-color: color-mix(in srgb, var(--air) 50%, var(--line)); background: color-mix(in srgb, var(--air-soft) 45%, var(--surface)); }
.caller.solo { border-color: var(--pod); }
.caller video { width: 96px; border-radius: 6px; grid-column: 1 / -1; }
.empty-note { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); }

/* reactions */
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.reactions button { font-size: 20px; width: 44px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.float-layer { position: fixed; right: 24px; bottom: 90px; width: 80px; height: 60vh; pointer-events: none; z-index: 50; }
.float-layer span { position: absolute; bottom: 0; font-size: 28px; animation: floatup 2.4s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-55vh) scale(1.3); opacity: 0; } }

/* call bar (viewer) */
.callbar { position: sticky; bottom: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.callbar .wrap { display: flex; gap: 10px; align-items: center; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.status-chip { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); }
.status-chip.queue { background: var(--pod-soft); color: var(--pod); }
.status-chip.onair { background: var(--air); color: var(--air-ink); }

/* landing */
.hero { padding: 56px 0 28px; }
.hero .logo { width: min(320px, 70vw); margin-bottom: 18px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.feature { padding: 16px; }
.feature b { display: block; margin-bottom: 4px; }
.live-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.live-item:last-child { border-bottom: 0; }
.swatch { height: 64px; border-radius: 10px; border: 1px solid var(--line); }
.logo-light { display: none; } .logo-dark { display: block; }
[data-theme="light"] .logo-light { display: block; } [data-theme="light"] .logo-dark { display: none; }
footer.foot { color: var(--muted); font-size: 13px; padding: 32px 16px; text-align: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
