:root {
  --bg: #0b0c0f;
  --bg-2: #12141a;
  --card: #16181f;
  --line: rgba(255, 244, 220, 0.12);
  --text: #f4efe6;
  --muted: #a79b8b;
  --gold: #e2b15a;
  --ink: #1a1408;
  --danger: #e07a72;
  --ok: #7dcaa5;
  --input: #0e1014;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3efe7;
  --bg-2: #fffaf3;
  --card: #fffdf9;
  --line: rgba(40, 28, 12, 0.12);
  --text: #221c14;
  --muted: #6d6256;
  --gold: #8d6416;
  --ink: #fffaf1;
  --danger: #a33b34;
  --ok: #1d7a50;
  --input: #fff;
  --shadow: 0 18px 40px rgba(70, 48, 16, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(226, 177, 90, 0.18), transparent 55%),
    var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3 { font-family: Palatino, "Iowan Old Style", Georgia, serif; font-weight: 600; letter-spacing: -0.03em; }
a { color: var(--gold); }

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.auth-story, .auth-card { padding: 48px; }
.auth-story { display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.auth-story h1 { font-size: clamp(46px, 6vw, 84px); line-height: 0.92; margin: 0; }
.auth-card {
  margin: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  align-self: center;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--gold); margin: 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab, .chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
}
.tab.on, .chip.on { background: var(--gold); color: var(--ink); border-color: transparent; }
label { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
textarea { min-height: 90px; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small, .icon-btn { padding: 8px 12px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.hint, .muted { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); min-height: 1.2em; }
.ok { color: var(--ok); }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 220px 1fr; }
.side {
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100dvh;
}
.brand {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  background: #1a1408; color: var(--gold);
  font-family: Palatino, Georgia, serif; font-size: 20px;
}
html[data-theme="light"] .brand { background: #221c14; }
.side-nav, .tabbar { display: flex; flex-direction: column; gap: 6px; }
.nav-btn {
  text-align: left; border: 0; background: transparent; color: var(--muted);
  border-radius: 12px; padding: 10px 12px;
}
.nav-btn.on { background: var(--card); color: var(--text); }
.workspace { padding: 22px 22px 96px; }
.top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.top h2 { margin: 4px 0 0; }
.grid { display: grid; gap: 14px; }
.channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card, .channel, .video, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}
.channel { display: grid; grid-template-columns: 72px 1fr; gap: 14px; text-align: left; width: 100%; }
.channel img, .avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #2a2418;
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; }
.stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stats span { color: var(--muted); font-size: 12px; }
.video img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 14px; background: #111; }
.video.short img { aspect-ratio: 9/16; max-height: 280px; object-fit: cover; }
.video h3 { font-size: 16px; margin: 10px 0 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bars { display: grid; gap: 8px; }
.bar { height: 8px; border-radius: 99px; background: rgba(226, 177, 90, 0.18); }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.stage {
  position: relative; background: #050505; border-radius: 22px; overflow: hidden;
  min-height: 280px; aspect-ratio: 16/9;
}
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .6s ease; }
.stage video.on { opacity: 1; }
.toast, .floats {
  position: absolute; left: 16px; right: 16px; z-index: 2; text-align: center;
}
.toast { top: 16px; font-size: 22px; font-family: Palatino, Georgia, serif; }
.floats { bottom: 16px; display: grid; gap: 6px; }
.floats span, .toast {
  background: rgba(0, 0, 0, 0.55); color: white; border-radius: 999px; padding: 6px 12px;
}
.asset, .msg, .log { border-top: 1px solid var(--line); padding: 10px 0; }
.msg.admin { color: var(--gold); }
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg-2); border-top: 1px solid var(--line);
  flex-direction: row; justify-content: flex-start; gap: 4px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 5; overflow-x: auto;
}
.tabbar .nav-btn { text-align: center; font-size: 12px; flex: 0 0 auto; white-space: nowrap; }
.steps { margin: 8px 0 0; padding-left: 18px; }
.steps li { margin: 6px 0; }
.comment { border-top: 1px solid var(--line); padding: 10px 0; }
.comment p { margin: 4px 0; }
.browser {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
}
.browser-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(226, 177, 90, 0.12);
  font-size: 13px;
}
.mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: #1a1408; color: var(--gold);
  font-size: 11px; font-weight: 800; flex: 0 0 auto;
}
input[type="file"] {
  width: 100%;
  padding: 8px;
  background: var(--input);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.toolbar { display: grid; gap: 10px; }
.wizard { width: min(760px, 100%); margin: 0 auto; display: grid; gap: 16px; }
.ask { min-height: 280px; display: grid; align-content: center; justify-items: start; gap: 12px; }
.ask h2 { margin: 0; font-size: clamp(36px, 6vw, 64px); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  min-height: 180px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-family: Palatino, Georgia, serif;
  font-size: 36px;
}
.choice.slim { min-height: 88px; font-size: 28px; }
.choice.on { border-color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.dropzone.compact { min-height: 160px; }
.dropzone {
  position: relative;
  min-height: 300px;
  border-radius: 28px;
  border: 1.5px dashed var(--gold);
  background: rgba(226, 177, 90, 0.08);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 28px;
  cursor: pointer;
}
.dropzone b { font-family: Palatino, Georgia, serif; font-size: clamp(28px, 5vw, 40px); }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.crumb-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.form-line { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.form-line input, .form-line select { width: 100%; margin: 0; }
.files { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.platforms .check { margin: 0; }
.track { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
.cover, .cover-empty {
  width: 96px; height: 96px; border-radius: 16px; object-fit: cover; background: #2a2418;
}
.cover-empty { display: grid; place-items: center; color: var(--gold); font-size: 12px; border: 1px dashed var(--line); }
audio { width: 100%; margin: 8px 0; }
.smart { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.smart main { width: min(460px, 100%); text-align: center; }
.smart img { width: 180px; height: 180px; object-fit: cover; border-radius: 24px; }
.links { display: grid; gap: 8px; margin-top: 18px; }
.go, .soon {
  display: block; padding: 12px 14px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--line); background: var(--card);
}
.go { color: var(--ink); background: var(--gold); font-weight: 700; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
.check input { width: auto; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-story, .auth-card { padding: 22px; }
  .auth-card { margin: 0 12px 24px; }
  .auth-story h1 { font-size: 48px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .tabbar { display: flex; }
  .channels, .split, .files, .form-line, .stats, .choices { grid-template-columns: 1fr !important; }
  .choice { min-height: 120px; font-size: 32px; }
  .track { grid-template-columns: 72px minmax(0, 1fr); }
  .cover, .cover-empty { width: 72px; height: 72px; }
  .workspace { padding: 16px 14px 108px; }
  .top { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .stage video { transition: none; }
}
