:root {
  --navy: #0b1f3a;
  --deep-blue: #123b7a;
  --blue: #2f80ed;
  --light-blue: #eaf4ff;
  --gold: #d6a84f;
  --gold-bright: #ffe17a;
  --gold-deep: #9b6a18;
  --ink: #061426;
  --bg: #f7fafc;
  --surface: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  --success: #12b76a;
  --warning: #f79009;
  --error: #f04438;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  color: #fff;
  background: linear-gradient(180deg, var(--navy), #061426);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(214, 168, 79, 0.55);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 225, 122, 0.34);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 24px rgba(214, 168, 79, 0.22);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-stack a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 650;
}

.nav-stack a.admin-only,
.nav-stack a.super-admin-only,
.nav-stack a.owner-console-only {
  display: none;
}

.nav-stack a.active,
.nav-stack a:hover {
  color: #fff;
  background: rgba(47, 128, 237, 0.28);
}

.support-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.support-panel p {
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.5;
}

.main {
  min-width: 0;
  padding: 28px;
}

.public-route .app-shell {
  display: block;
}

.public-route .sidebar,
.public-route .topbar {
  display: none;
}

.public-route .main {
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h1,
.auth-copy h2,
.login-panel h3,
.section-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.15;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.membership-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--navy);
  background: #fff6dc;
  border: 1px solid rgba(214, 168, 79, 0.45);
  font-size: 13px;
  font-weight: 800;
}

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--navy);
  background: var(--surface);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: var(--blue);
}

.btn-gold {
  position: relative;
  overflow: hidden;
  color: #08182d;
  background:
    linear-gradient(135deg, #fff7b8 0%, #f6cf57 28%, #d69a22 55%, #fff0a4 78%, #b06f10 100%);
  border-color: rgba(255, 225, 122, 0.62);
  box-shadow:
    0 12px 26px rgba(214, 168, 79, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(104, 58, 2, 0.26);
}

.btn-gold::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.42) 42%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.btn-gold:hover::after {
  transform: translateX(120%);
}

.btn-soft {
  color: var(--deep-blue);
  background: var(--light-blue);
  border-color: rgba(47, 128, 237, 0.18);
}

.btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-glass {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 225, 122, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-google {
  gap: 10px;
  color: var(--navy);
  background: #fff;
  border-color: var(--border);
}

.btn-google span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: var(--light-blue);
  font-weight: 900;
}

.btn-block {
  width: 100%;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.stat-card {
  display: grid;
  gap: 10px;
}

.gold-card {
  border-color: rgba(214, 168, 79, 0.4);
  background: linear-gradient(180deg, #fffaf0, #fff);
}

.stat-card strong {
  font-size: 30px;
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.agent-prompt-list {
  display: grid;
  gap: 16px;
}

.agent-prompt-card {
  display: grid;
  gap: 16px;
}

.agent-prompt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.agent-prompt-block {
  display: grid;
  gap: 8px;
}

.agent-prompt-block pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: #182230;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice-strip {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.45;
}

.notice-strip.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.agent-prompt-editor {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.agent-prompt-editor label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.agent-prompt-editor textarea {
  min-height: 130px;
  resize: vertical;
  font-family: Consolas, "Noto Sans Thai", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.agent-prompt-editor input,
.agent-prompt-editor textarea {
  width: 100%;
  min-width: 0;
}

.agent-prompt-inspector {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.agent-prompt-inspector section {
  min-width: 0;
}

.agent-prompt-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.agent-prompt-history-head p {
  margin: 0;
}

.provider-readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.provider-readiness-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.provider-readiness-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.provider-readiness-head div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.provider-readiness-head strong,
.provider-readiness-head span,
.provider-readiness-card p {
  overflow-wrap: anywhere;
}

.provider-readiness-head strong {
  font-size: 15px;
}

.provider-readiness-head div span {
  color: var(--muted);
  font-size: 12px;
}

.provider-missing,
.provider-ok {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.provider-missing {
  color: #b42318;
}

.provider-ok {
  color: #047857;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 12px;
}

.section-title h2 {
  font-size: 20px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 26px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(11, 31, 58, 0.96), rgba(18, 59, 122, 0.9) 58%, rgba(47, 128, 237, 0.82)),
    var(--navy);
  box-shadow: var(--shadow);
}

.hero-band h2 {
  max-width: 680px;
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
}

.hero-band p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-meter {
  display: grid;
  align-content: center;
  min-height: 180px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
}

.hero-meter strong {
  color: var(--gold);
  font-size: 46px;
  line-height: 1;
}

.ai-tools-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  min-height: 224px;
  padding: 28px 34px;
  border: 1px solid rgba(214, 168, 79, 0.3);
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 30%, rgba(255, 225, 122, 0.16), transparent 24%),
    linear-gradient(135deg, #061426, #0b1f3a 56%, #123b7a 150%);
  box-shadow: 0 18px 46px rgba(6, 20, 38, 0.18);
}

.ai-tools-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.11;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 34px 34px;
}

.ai-tools-hero > * { position: relative; z-index: 1; }
.ai-tools-hero h2 { max-width: 690px; margin: 8px 0; font-size: clamp(30px, 3.1vw, 44px); line-height: 1.08; letter-spacing: 0; }
.ai-tools-hero p { max-width: 620px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.55; }
.ai-tools-hero .eyebrow { color: var(--gold-bright); }

.ai-tools-proof { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.ai-tools-proof span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: rgba(255,255,255,.78); background: rgba(255,255,255,.05); font-size: 10px; font-weight: 800; }

.ai-tools-orbit { position: relative; display: grid; min-height: 174px; place-items: center; }
.ai-tools-orbit::before, .ai-tools-orbit::after { position: absolute; width: 172px; height: 172px; border: 1px solid rgba(255,225,122,.2); border-radius: 50%; content: ""; }
.ai-tools-orbit::after { width: 126px; height: 126px; border-color: rgba(47,128,237,.45); }
.suite-core { z-index: 2; display: grid; width: 92px; height: 92px; place-content: center; border: 1px solid rgba(255,225,122,.48); border-radius: 20px; text-align: center; background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.03)); box-shadow: 0 0 34px rgba(214,168,79,.2); transform: rotate(5deg); }
.suite-core span, .suite-core small { color: var(--gold-bright); font-size: 7px; font-weight: 900; letter-spacing: .14em; }
.suite-core strong { margin: -2px 0; font-size: 38px; line-height: 1; }
.suite-dot { position: absolute; z-index: 3; width: 9px; height: 9px; border: 2px solid #07182c; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 16px rgba(255,225,122,.7); }
.suite-dot.dot-one { top: 20px; right: 54px; }
.suite-dot.dot-two { bottom: 34px; left: 32px; background: #2f80ed; }
.suite-dot.dot-three { right: 15px; bottom: 60px; }

.ai-tools-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 22px 0 10px; }
.ai-tools-section-head h2 { margin: 2px 0 3px; font-size: 22px; }
.ai-tools-section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.ai-tools-section-head > span { color: #8a5d12; font-size: 10px; font-weight: 900; letter-spacing: .08em; }

.ai-tool-controls { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.7fr) auto; gap: 10px; align-items: center; margin-bottom: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 6px 18px rgba(16,24,40,.04); }
.ai-tool-search { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; min-height: 36px; padding: 0 9px; border: 1px solid #d0d5dd; border-radius: 8px; background: #f9fafb; }
.ai-tool-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,128,237,.1); background: #fff; }
.ai-tool-search > span { color: #667085; font-size: 18px; line-height: 1; }
.ai-tool-search input { width: 100%; min-height: 34px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.ai-tool-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-tool-filters button { min-height: 30px; padding: 5px 9px; border: 1px solid transparent; border-radius: 999px; color: #667085; background: #f2f4f7; font-size: 10px; font-weight: 900; cursor: pointer; }
.ai-tool-filters button:hover { color: var(--navy); border-color: #d0d5dd; }
.ai-tool-filters button.active { color: #fff; border-color: var(--navy); background: var(--navy); box-shadow: 0 4px 10px rgba(11,31,58,.14); }
.ai-tool-result-count { color: #8a5d12; font-size: 10px; font-weight: 900; white-space: nowrap; }

.ai-tool-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.studio-tool-card[hidden] { display: none; }
.studio-tool-card { overflow: hidden; min-width: 0; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff; box-shadow: 0 8px 24px rgba(16,24,40,.05); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.studio-tool-card.is-available:hover { border-color: rgba(214,168,79,.64); box-shadow: 0 14px 32px rgba(6,20,38,.12); transform: translateY(-2px); }
.studio-tool-card.is-coming { opacity: .78; }
.studio-tool-visual { position: relative; overflow: hidden; display: grid; min-height: 118px; place-items: center; background: #0b1f3a; }
.studio-tool-visual::before { position: absolute; inset: 0; content: ""; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 32px 32px; }
.video-tool-visual { background: radial-gradient(circle at 65% 25%, rgba(214,168,79,.36), transparent 25%), linear-gradient(140deg, #061426, #123b7a); }
.clip-tool-visual { background: radial-gradient(circle at 50% 45%, rgba(47,128,237,.4), transparent 30%), linear-gradient(140deg, #07182c, #173f70); }
.image-tool-visual { background: radial-gradient(circle at 50% 40%, rgba(214,168,79,.32), transparent 34%), linear-gradient(140deg, #0d1d34, #3b3151); }
.voice-tool-visual { background: radial-gradient(circle at 50% 50%, rgba(47,128,237,.34), transparent 34%), linear-gradient(140deg, #061426, #174a58); }
.story-tool-visual { background: linear-gradient(140deg, #06261b, #0b1f3a 52%, #123b7a); }
.tool-state { position: absolute; z-index: 3; top: 10px; right: 10px; padding: 4px 7px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: rgba(255,255,255,.72); background: rgba(6,20,38,.56); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.tool-state.available { color: var(--gold-bright); border-color: rgba(255,225,122,.36); }
.tool-phone { position: relative; z-index: 2; display: flex; width: 62px; height: 96px; flex-direction: column; align-items: center; justify-content: flex-end; padding: 10px; border: 1px solid rgba(255,225,122,.58); border-radius: 14px; color: #fff; background: linear-gradient(180deg, rgba(47,128,237,.22), #061426); box-shadow: 0 12px 28px rgba(0,0,0,.3); transform: rotate(5deg); }
.tool-phone span { color: var(--gold-bright); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.tool-phone strong { font-size: 15px; }
.video-tool-visual > i { position: absolute; z-index: 2; padding: 5px 7px; border: 1px solid rgba(255,255,255,.14); border-radius: 5px; color: rgba(255,255,255,.78); background: rgba(6,20,38,.82); font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .06em; }
.video-tool-visual > i:nth-of-type(1) { top: 52px; left: 10%; }
.video-tool-visual > i:nth-of-type(2) { right: 9%; bottom: 28px; }
.story-tool-phone { position: relative; z-index: 2; display: grid; width: 88px; height: 106px; align-content: end; gap: 3px; padding: 12px; border: 1px solid rgba(255,225,122,.5); border-radius: 17px; color: #fff; background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(6,20,38,.82)); box-shadow: 0 12px 30px rgba(0,0,0,.3); transform: rotate(-4deg); }
.story-tool-phone::before { position: absolute; inset: 12px 10px auto; height: 38px; border-radius: 10px; background: #f2f7f3; content: ""; }
.story-tool-phone strong { position: relative; color: #fff; font-size: 14px; line-height: 1; }
.story-tool-phone small { position: relative; color: rgba(255,225,122,.82); font-size: 7px; font-weight: 900; }
.story-chat-dot { position: absolute; z-index: 2; top: 20px; left: 20px; width: 24px; height: 14px; border-radius: 999px 999px 999px 4px; background: #22c55e; box-shadow: 32px 10px 0 #d6a84f; }
.story-tool-visual > i { position: absolute; z-index: 2; padding: 7px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 5px; color: rgba(255,255,255,.78); background: rgba(6,20,38,.82); font-size: 8px; font-style: normal; font-weight: 900; letter-spacing: 0; }
.story-tool-visual > i:nth-of-type(1) { top: 48px; left: 11%; }
.story-tool-visual > i:nth-of-type(2) { right: 11%; bottom: 28px; }
.future-tool-mark { position: relative; z-index: 2; display: grid; width: 68px; height: 68px; place-content: center; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; color: rgba(255,255,255,.8); font-size: 28px; text-align: center; background: rgba(255,255,255,.06); box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.future-tool-mark small { color: rgba(255,225,122,.72); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.studio-tool-body { padding: 14px 16px 16px; }
.studio-tool-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.studio-tool-title p { margin: 0 0 3px; color: #8a5d12; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.studio-tool-title h3 { margin: 0; font-size: 18px; }
.studio-tool-body > p { display: -webkit-box; overflow: hidden; min-height: 0; margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tool-arrow { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 15px; }
.tool-capabilities { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-capabilities span { padding: 4px 7px; border-radius: 999px; color: #344054; background: #f2f4f7; font-size: 8px; font-weight: 800; }
.ai-tool-empty { padding: 42px 20px; border: 1px dashed #d0d5dd; border-radius: 14px; color: var(--muted); text-align: center; background: #fff; }
.ai-tool-empty[hidden] { display: none; }
.ai-tool-empty > span { display: grid; width: 46px; height: 46px; margin: 0 auto 12px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--light-blue); font-size: 28px; }
.ai-tool-empty strong { display: block; color: var(--navy); font-size: 17px; }
.ai-tool-empty p { margin: 6px 0 0; font-size: 12px; }

.master-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 18px; padding: 28px; border-radius: 8px; color: #fff; background: linear-gradient(120deg, #061426, #0b2c3b); box-shadow: var(--shadow); }
.master-hero.helper-hero { background: linear-gradient(120deg, #0b1f3a, #174a58); }
.master-hero h2 { margin: 0 0 8px; font-size: 34px; }
.master-hero p { max-width: 760px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.7; }
.master-status { display: grid; gap: 6px; justify-items: end; min-width: 210px; }
.master-status span,
.master-topics span { padding: 6px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #ffe17a; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 900; }
.master-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.master-side,
.master-chat-panel { padding: 18px; }
.master-side h3,
.master-chat-head h3 { margin: 0; }
.master-quick-list { display: grid; gap: 8px; margin-top: 14px; }
.master-quick-list button { min-height: 42px; padding: 10px 12px; border: 1px solid #d6e4ff; border-radius: 8px; color: var(--navy); background: #f8fbff; font-weight: 900; text-align: left; cursor: pointer; }
.master-quick-list button:hover { border-color: var(--blue); background: #eef6ff; }
.master-note { margin-top: 18px; padding: 12px; border: 1px solid #e4e7ec; border-radius: 8px; background: #f9fafb; }
.master-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.master-chat-panel { display: grid; grid-template-rows: auto auto minmax(420px, 58vh) auto; min-height: 640px; }
.master-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.master-chat-head span { padding: 7px 10px; border-radius: 999px; color: #175cd3; background: #eff8ff; font-size: 11px; font-weight: 900; }
.master-chat-window { display: grid; align-content: start; gap: 12px; overflow-y: auto; padding: 16px; border: 1px solid #dbeafe; border-radius: 8px; background: linear-gradient(180deg, #eef6ff, #f8fafc); }
.master-message { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: start; max-width: 86%; }
.master-message.user { justify-self: end; grid-template-columns: minmax(0, 1fr) 42px; }
.master-message.user .master-avatar { grid-column: 2; grid-row: 1; background: #123b7a; }
.master-message.user .master-bubble { grid-column: 1; grid-row: 1; color: #fff; background: #123b7a; }
.master-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #061426, #184e77); font-size: 12px; font-weight: 900; }
.master-bubble { padding: 12px 14px; border: 1px solid rgba(12,42,76,.08); border-radius: 8px; color: #101828; background: #fff; box-shadow: 0 10px 28px rgba(12,42,76,.08); }
.master-bubble p { margin: 0; line-height: 1.75; }
.master-topics,
.master-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.master-topics span { border-color: #d6e4ff; color: #175cd3; background: #eff8ff; }
.master-chat-input { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 10px; margin-top: 12px; }
.master-chat-input textarea { min-height: 54px; max-height: 150px; padding: 12px 14px; border: 1px solid #d0d5dd; border-radius: 8px; outline: 0; font: inherit; resize: vertical; }
.master-chat-input textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,128,237,.1); }
.master-chat-input button { border: 0; border-radius: 8px; color: #fff; background: var(--blue); font-weight: 900; cursor: pointer; }

.helper-chat-panel {
  grid-template-rows: auto minmax(240px, 36vh) auto;
  min-height: 0;
}

.helper-chat-input {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  margin-top: 10px;
}

.helper-chat-input textarea {
  height: 86px;
  min-height: 86px;
  max-height: 130px;
  resize: vertical;
}

.helper-chat-input button {
  width: 74px;
  min-height: 44px;
  height: 44px;
  align-self: end;
  padding: 0 12px;
}

.voice-subtitle-shell { display: grid; gap: 18px; }
.voice-subtitle-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 24px; border: 1px solid rgba(214,168,79,.26); border-radius: 12px; color: #fff; background: linear-gradient(135deg, #061426, #0b1f3a 56%, #174a58); box-shadow: 0 18px 44px rgba(6,20,38,.16); }
.voice-subtitle-hero h2 { margin: 5px 0 7px; font-size: 34px; line-height: 1.08; }
.voice-subtitle-hero p { max-width: 780px; margin: 0; color: rgba(255,255,255,.72); line-height: 1.7; }
.voice-subtitle-hero .eyebrow { color: var(--gold-bright); }
.voice-subtitle-status { display: grid; min-width: 170px; gap: 6px; justify-items: end; }
.voice-subtitle-status span { color: var(--gold-bright); font-size: 10px; font-weight: 900; }
.voice-subtitle-status strong { padding: 8px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.08); font-size: 13px; }
.voice-tool-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.voice-tool-tab { display: grid; min-height: 132px; gap: 8px; align-content: start; padding: 16px; border: 1px solid #d0d5dd; border-radius: 10px; color: #344054; background: #fff; text-align: left; box-shadow: 0 10px 24px rgba(16,24,40,.05); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.voice-tool-tab:hover { transform: translateY(-1px); border-color: rgba(11,31,58,.34); box-shadow: 0 14px 30px rgba(16,24,40,.08); }
.voice-tool-tab.active { border-color: var(--deep-blue); background: #f0f7ff; box-shadow: 0 14px 34px rgba(47,128,237,.14); }
.voice-tool-tab span { color: var(--gold-dark); font-size: 10px; font-weight: 950; letter-spacing: .06em; }
.voice-tool-tab strong { color: var(--navy); font-size: 18px; line-height: 1.15; }
.voice-tool-tab small { color: #667085; font-size: 12px; font-weight: 750; line-height: 1.55; }
.voice-subtitle-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 18px; align-items: start; }
.voice-workbench { display: grid; gap: 14px; min-width: 0; }
.voice-panel,
.voice-preview-panel { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.voice-panel { display: grid; gap: 14px; padding: 18px; }
.voice-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.voice-panel-head h3 { margin: 3px 0 0; font-size: 20px; }
.voice-panel-head > span { max-width: 240px; overflow: hidden; color: #667085; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.voice-mode-row { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-mode-row button { min-height: 36px; padding: 7px 11px; border: 1px solid #d0d5dd; border-radius: 999px; color: #344054; background: #f9fafb; font-size: 11px; font-weight: 900; cursor: pointer; }
.voice-mode-row button.active { color: #fff; border-color: var(--deep-blue); background: var(--deep-blue); box-shadow: 0 8px 18px rgba(11,31,58,.16); }
.voice-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.voice-action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.voice-consent-row { grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; color: #344054; font-size: 12px; font-weight: 800; }
.voice-consent-row input { width: 18px; min-height: 18px; padding: 0; }
.voice-builder-studio { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); gap: 18px; }
.voice-script-card,
.voice-settings-card,
.voice-source-card,
.voice-action-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.voice-script-card { min-width: 0; }
.voice-script-ai-box { display: grid; grid-template-columns: minmax(170px, .75fr) minmax(0, 1.35fr); gap: 10px 12px; align-items: end; padding: 12px; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.voice-script-ai-box > div:first-child { align-self: center; }
.voice-script-ai-box strong { display: block; color: var(--navy); font-size: 13px; }
.voice-script-ai-box span { display: block; margin-top: 4px; color: #667085; font-size: 11px; font-weight: 750; line-height: 1.45; }
.voice-script-ai-box label { display: grid; gap: 6px; color: #344054; font-size: 11px; font-weight: 900; }
.voice-script-ai-box textarea { min-height: 82px; resize: vertical; line-height: 1.6; }
.voice-script-ai-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.voice-script-editor { display: grid; gap: 8px; }
.voice-script-editor > span,
.voice-settings-card label,
.voice-clone-card label { color: #344054; font-size: 12px; font-weight: 900; }
.voice-script-editor textarea { min-height: 248px; resize: vertical; line-height: 1.75; }
.voice-script-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-script-meta span { padding: 7px 10px; border: 1px solid #e4e7ec; border-radius: 999px; color: #475467; background: #f9fafb; font-size: 11px; font-weight: 850; }
.voice-settings-card { align-content: start; }
.voice-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.voice-settings-head h4 { margin: 3px 0 0; color: var(--navy); font-size: 18px; }
.voice-settings-head > span { padding: 7px 9px; border: 1px solid #dbeafe; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 900; white-space: nowrap; }
.voice-settings-card label,
.voice-clone-card label { display: grid; gap: 8px; }
.voice-clone-card { display: grid; gap: 12px; padding: 14px; border: 1px solid #eef2f6; border-radius: 10px; background: #fcfdff; }
.voice-source-card,
.voice-action-card { grid-column: 1 / -1; }
.voice-upload-zone { display: grid; min-height: 160px; place-items: center; align-content: center; gap: 8px; border: 1.5px dashed rgba(37,99,235,.45); border-radius: 12px; background: linear-gradient(180deg, #fff, #f8fbff); color: #344054; text-align: center; cursor: pointer; }
.voice-upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.voice-upload-zone strong { color: var(--deep-blue); font-size: 15px; }
.voice-upload-zone small { color: #667085; font-size: 12px; font-weight: 750; line-height: 1.5; }
.voice-action-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: linear-gradient(180deg, #fff, #fbfdff); }
.voice-action-card strong { display: block; margin: 2px 0 4px; color: var(--navy); font-size: 16px; }
.voice-action-card span { color: #667085; font-size: 12px; font-weight: 750; }
.transcript-studio { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); gap: 18px; }
.transcript-upload-card,
.transcript-settings-card,
.transcript-result-card,
.transcript-script-card { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.transcript-upload-card,
.transcript-settings-card,
.transcript-result-card,
.transcript-script-card { display: grid; gap: 14px; padding: 18px; }
.transcript-upload-zone { display: grid; min-height: 340px; place-items: center; align-content: center; gap: 8px; border: 2px solid #2563eb; border-radius: 12px; background: linear-gradient(180deg, #fff, #f8fbff); text-align: center; cursor: pointer; }
.transcript-upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-cloud-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #d0d5dd; border-radius: 12px; color: var(--deep-blue); background: #fff; font-size: 22px; font-weight: 950; box-shadow: 0 8px 22px rgba(16,24,40,.08); }
.transcript-upload-zone strong { color: var(--deep-blue); font-size: 15px; }
.transcript-upload-zone small { max-width: 420px; color: #475467; font-size: 12px; line-height: 1.5; }
.transcript-upload-zone em { color: #667085; font-size: 11px; font-style: normal; font-weight: 800; }
.transcript-drive-box { display: grid; gap: 6px; }
.transcript-settings-card textarea { min-height: 82px; }
.transcript-setting-label { display: block; margin-bottom: 9px; color: var(--navy); font-size: 12px; font-weight: 900; }
.transcript-speaker-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.transcript-speaker-modes button { min-height: 42px; border: 1px solid #d0d5dd; border-radius: 9px; color: #344054; background: #fff; font-size: 12px; font-weight: 900; cursor: pointer; }
.transcript-speaker-modes button.active { border-color: #1d4ed8; color: #1d4ed8; background: #eff6ff; box-shadow: inset 0 0 0 1px rgba(37,99,235,.12); }
.transcript-settings-card small { color: #667085; font-size: 11px; line-height: 1.5; }
.transcript-action-stack { display: grid; gap: 9px; }
.transcript-action-stack small { color: #667085; font-size: 11px; line-height: 1.5; }
.transcript-run-button,
.transcript-live-button { min-height: 52px; justify-content: center; font-size: 15px; }
.transcript-live-button { border-color: rgba(214,168,79,.45); color: #8a5a00; background: #fff8e6; }
.transcript-run-button:disabled,
.transcript-live-button:disabled { opacity: .62; cursor: wait; }
.transcript-result-card,
.transcript-script-card { grid-column: 1 / -1; }
.transcript-result-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.transcript-result-tabs button { min-height: 40px; padding: 8px 13px; border: 1px solid #e4e7ec; border-radius: 8px; color: #344054; background: #fff; font-weight: 900; cursor: pointer; }
.transcript-result-tabs button.active { border-color: rgba(37,99,235,.35); color: #1d4ed8; background: #eff6ff; }
.transcript-player-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 14px; min-height: 92px; padding: 16px; border: 1px solid #eef2f6; border-radius: 12px; background: #fcfdff; }
.transcript-play-button { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid #d0d5dd; border-radius: 12px; color: var(--navy); background: #fff; font-size: 28px; font-weight: 950; box-shadow: 0 8px 18px rgba(16,24,40,.08); }
.transcript-player-row > span { color: #344054; font-size: 18px; font-weight: 850; white-space: nowrap; }
.transcript-waveform { display: flex; align-items: center; gap: 2px; height: 64px; overflow: hidden; }
.transcript-waveform i { display: block; flex: 1; min-width: 3px; border-radius: 999px; background: #93c5fd; opacity: .86; }
.transcript-waveform i.active { background: var(--deep-blue); }
.transcript-autoscroll-row { display: inline-grid; grid-template-columns: 46px auto; align-items: center; gap: 12px; width: fit-content; color: #344054; font-size: 15px; font-weight: 900; }
.transcript-autoscroll-row input { width: 46px; height: 26px; min-height: 26px; padding: 0; accent-color: #2563eb; }
.transcript-warning-row { display: grid; gap: 6px; padding: 12px; border: 1px solid #fed7aa; border-radius: 10px; color: #9a3412; background: #fff7ed; font-size: 12px; font-weight: 800; line-height: 1.5; }
.transcript-export-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 14px; border: 1px solid #dbeafe; border-radius: 10px; color: #1d4ed8; background: #eff6ff; font-size: 12px; font-weight: 900; }
.transcript-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.transcript-export-row .btn { min-height: 36px; padding: 0 12px; border-color: rgba(37,99,235,.24); background: #fff; }
.transcript-export-row .btn:disabled { opacity: .52; cursor: not-allowed; }
.transcript-segment-list { display: grid; gap: 4px; max-height: 460px; overflow: auto; padding: 8px 2px; }
.transcript-segment-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; padding: 16px 20px; border-radius: 10px; }
.transcript-segment-row:hover { background: #f8fbff; }
.transcript-segment-row time { color: #475467; font-size: 20px; font-weight: 750; white-space: nowrap; }
.transcript-segment-row p { margin: 0; color: #344054; font-size: 21px; line-height: 1.55; }
.transcript-empty-result { display: grid; gap: 8px; justify-items: center; padding: 46px 20px; color: #667085; text-align: center; }
.transcript-empty-result strong { color: var(--navy); font-size: 18px; }
.transcript-summary-block { padding: 24px; border-radius: 12px; color: #344054; background: #f9fafb; font-size: 18px; line-height: 1.8; }
.transcript-highlight-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0; }
.transcript-highlight-list span { padding: 10px 12px; border: 1px solid rgba(214,168,79,.35); border-radius: 999px; color: #7a4d00; background: #fff8e6; font-size: 13px; font-weight: 900; }
.transcript-script-card textarea { min-height: 190px; }
.voice-replace-note { display: grid; gap: 4px; padding: 12px; border: 1px dashed rgba(47,128,237,.42); border-radius: 10px; background: #f8fbff; }
.voice-replace-note strong { color: var(--deep-blue); font-size: 13px; }
.voice-replace-note span { color: #667085; font-size: 12px; font-weight: 750; line-height: 1.5; }
.subtitle-studio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.subtitle-upload-card,
.subtitle-settings-card,
.subtitle-script-card,
.subtitle-timeline-card,
.subtitle-action-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.subtitle-upload-card { grid-column: 1 / -1; padding: 14px 16px; }
.subtitle-upload-card .voice-panel-head { align-items: center; }
.subtitle-upload-zone { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 78px; align-items: center; gap: 6px 14px; padding: 14px 16px; border: 2px solid rgba(37,99,235,.72); border-radius: 12px; background: linear-gradient(180deg, #fff, #f8fbff); color: #344054; text-align: left; cursor: pointer; }
.subtitle-upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.subtitle-upload-zone .upload-cloud-mark { grid-row: 1 / span 2; }
.subtitle-upload-zone strong { color: var(--deep-blue); font-size: 15px; }
.subtitle-upload-zone small { max-width: none; color: #475467; font-size: 12px; font-weight: 750; line-height: 1.5; }
.subtitle-upload-zone em { justify-self: end; grid-row: 1 / span 2; padding: 8px 10px; border: 1px solid #dbeafe; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-style: normal; font-weight: 850; white-space: nowrap; }
.subtitle-settings-card { grid-column: 1 / -1; align-content: start; }
.subtitle-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.subtitle-settings-head h4 { margin: 3px 0 0; color: var(--navy); font-size: 18px; }
.subtitle-settings-head > span { padding: 7px 9px; border: 1px solid #dbeafe; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 900; white-space: nowrap; }
.subtitle-settings-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.subtitle-settings-actions > span { padding: 7px 9px; border: 1px solid #dbeafe; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 900; white-space: nowrap; }
.subtitle-option-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.subtitle-option-grid label,
.subtitle-script-editor { display: grid; gap: 8px; color: #344054; font-size: 12px; font-weight: 900; }
.subtitle-option-grid label:first-child,
.subtitle-option-grid label:nth-child(2) { grid-column: span 1; }
.subtitle-option-grid label b { justify-self: end; color: #1d4ed8; font-size: 11px; font-weight: 900; }
.subtitle-option-grid input[type="range"] { min-height: 38px; padding: 0; accent-color: #2563eb; }
.subtitle-position-fine { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.subtitle-position-fine label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 900; }
.subtitle-color-row { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.subtitle-color-row label { display: grid; gap: 7px; min-width: 0; }
.subtitle-color-row input[type="color"] { width: 100%; min-height: 42px; padding: 4px; border-radius: 9px; cursor: pointer; }
.subtitle-background-toggle { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid #e4e7ec; border-radius: 10px; background: #f9fafb; }
.subtitle-srt-import-zone { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 12px; padding: 14px; border: 1.5px dashed rgba(37,99,235,.42); border-radius: 12px; background: #f8fbff; cursor: pointer; }
.subtitle-srt-import-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.subtitle-srt-import-zone strong { color: var(--deep-blue); font-size: 14px; }
.subtitle-srt-import-zone small { grid-column: 2; color: #667085; font-size: 12px; font-weight: 750; line-height: 1.5; }
.subtitle-style-chips,
.subtitle-script-meta,
.subtitle-timeline-notes { display: flex; flex-wrap: wrap; gap: 8px; }
.subtitle-style-chips span,
.subtitle-style-chips button,
.subtitle-script-meta span,
.subtitle-timeline-notes span { padding: 7px 10px; border: 1px solid #e4e7ec; border-radius: 999px; color: #475467; background: #f9fafb; font-size: 11px; font-weight: 850; }
.subtitle-style-chips button { cursor: pointer; font: inherit; }
.subtitle-style-chips button:hover { border-color: rgba(37,99,235,.32); color: #1d4ed8; background: #eff6ff; }
.subtitle-script-meta .btn-compact { min-height: 32px; padding: 7px 12px; border-radius: 9px; font-size: 12px; }
.subtitle-style-chips span.active,
.subtitle-style-chips button.active { border-color: rgba(37,99,235,.32); color: #1d4ed8; background: #eff6ff; box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.subtitle-script-card,
.subtitle-timeline-card,
.subtitle-result-card,
.subtitle-action-card { grid-column: 1 / -1; }
.subtitle-script-editor textarea { min-height: 190px; resize: vertical; line-height: 1.75; }
.subtitle-text-tools { display: grid; grid-template-columns: minmax(200px, .75fr) minmax(0, 2.4fr); gap: 10px 14px; align-items: start; padding: 12px; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.subtitle-text-tools div { display: grid; gap: 4px; }
.subtitle-text-tools > div:first-child { grid-row: 1 / span 3; align-self: center; }
.subtitle-text-tool-row { grid-column: 2; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, 180px); gap: 10px; align-items: end; }
.subtitle-agent-row { grid-template-columns: minmax(0, 1fr) minmax(150px, 180px); }
.subtitle-text-tools strong { color: var(--navy); font-size: 13px; }
.subtitle-text-tools span { color: #667085; font-size: 11px; font-weight: 750; line-height: 1.45; }
.subtitle-text-tools label { display: grid; gap: 6px; color: #344054; font-size: 11px; font-weight: 900; }
.subtitle-text-tools label b { justify-self: end; color: #1d4ed8; font-size: 10px; }
.subtitle-text-tools input[type="range"] { min-height: 34px; padding: 0; accent-color: #2563eb; }
.subtitle-text-tools input[type="number"] { min-height: 38px; }
.subtitle-agent-control { min-width: 150px; }
.subtitle-agent-prompt { grid-column: auto; }
.subtitle-agent-prompt textarea { min-height: 48px; resize: vertical; }
.subtitle-timing-editor textarea { min-height: 260px; font-family: Consolas, "Noto Sans Thai", monospace; font-size: 13px; line-height: 1.65; }
.subtitle-timeline-card { background: linear-gradient(180deg, #fff, #fbfdff); }
.subtitle-timeline-preview { display: grid; gap: 12px; padding: 14px; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.subtitle-timeline-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; color: #475467; font-size: 11px; font-weight: 900; }
.subtitle-timeline-toolbar label { display: inline-flex; align-items: center; gap: 8px; min-width: 220px; }
.subtitle-timeline-toolbar input { width: 150px; accent-color: #2563eb; }
.subtitle-zoom-controls { display: inline-flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #dbeafe; border-radius: 12px; background: #fff; }
.subtitle-zoom-controls .btn { min-width: 36px; min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 18px; line-height: 1; }
.subtitle-zoom-controls label { min-width: 190px; }
.subtitle-timeline-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.subtitle-timeline-actions .btn { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.subtitle-timeline-actions .btn.active { border-color: #2563eb; color: #0b1f3a; background: #dbeafe; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.subtitle-timeline-scroll { overflow-x: auto; overflow-y: hidden; padding: 4px 0 8px; scrollbar-color: #93c5fd #eff6ff; }
.subtitle-timeline-canvas { position: relative; min-height: 164px; }
.subtitle-timeline-playhead { position: absolute; top: 22px; bottom: 8px; z-index: 6; width: 0; pointer-events: none; border-left: 2px solid rgba(37,99,235,.72); filter: drop-shadow(0 0 6px rgba(37,99,235,.35)); }
.subtitle-timeline-playhead::before { content: ""; position: absolute; top: -7px; left: -6px; width: 10px; height: 10px; border-radius: 999px; background: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
.subtitle-timeline-playhead span { position: absolute; top: -28px; left: 7px; padding: 3px 6px; border-radius: 7px; color: #0b1f3a; background: #dbeafe; font-size: 10px; font-weight: 950; white-space: nowrap; }
.subtitle-timeline-playhead.is-playing { border-left-color: #10b981; filter: drop-shadow(0 0 8px rgba(16,185,129,.55)); }
.subtitle-timeline-playhead.is-playing::before { background: #10b981; animation: subtitlePlayheadPulse .9s ease-in-out infinite; }
.subtitle-timeline-ruler { position: relative; height: 34px; border-bottom: 1px solid #cfe1ff; }
.subtitle-timeline-ruler,
.subtitle-timeline-lane { cursor: default; }
.subtitle-waveform-track { cursor: pointer; }
.subtitle-timeline-preview.split-mode .subtitle-timeline-ruler,
.subtitle-timeline-preview.split-mode .subtitle-waveform-track { cursor: crosshair; }
.subtitle-timeline-ruler i { position: absolute; bottom: 0; width: 1px; height: 10px; background: #93a4bd; }
.subtitle-timeline-ruler i.major { height: 18px; background: #344054; }
.subtitle-timeline-ruler i span { position: absolute; left: 4px; top: -2px; color: #344054; font-size: 10px; font-weight: 900; white-space: nowrap; }
.subtitle-timeline-lane { position: relative; height: 112px; margin-top: 8px; border: 1px solid #dbeafe; border-radius: 12px; background: repeating-linear-gradient(90deg, #eff6ff 0, #eff6ff 33px, #f8fbff 34px, #f8fbff 67px); }
.subtitle-timeline-cue { position: absolute; top: 14px; bottom: 14px; display: grid; align-content: center; gap: 5px; overflow: hidden; padding: 10px 15px; border: 1px solid rgba(180,124,16,.38); border-radius: 10px; color: #7a4d00; background: linear-gradient(180deg, #fde68a, #fbbf24); box-shadow: 0 7px 18px rgba(214,168,79,.16); text-align: left; cursor: pointer; }
.subtitle-timeline-preview.split-mode .subtitle-timeline-cue { cursor: crosshair; }
.subtitle-timeline-cue:hover,
.subtitle-timeline-cue.is-selected { border-color: #1d4ed8; color: #0b1f3a; background: linear-gradient(180deg, #bfdbfe, #60a5fa); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.subtitle-timeline-cue strong { overflow: hidden; font-size: 12px; font-weight: 950; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.subtitle-timeline-cue small { color: rgba(11,31,58,.72); font-size: 10px; font-weight: 900; white-space: nowrap; }
.subtitle-cue-resize { position: absolute; top: 0; bottom: 0; z-index: 2; width: 10px; cursor: ew-resize; background: rgba(37,99,235,.12); opacity: 0; transition: opacity .14s ease; }
.subtitle-cue-resize.left { left: 0; border-radius: 10px 0 0 10px; }
.subtitle-cue-resize.right { right: 0; border-radius: 0 10px 10px 0; }
.subtitle-timeline-cue:hover .subtitle-cue-resize,
.subtitle-timeline-cue.is-selected .subtitle-cue-resize { opacity: 1; }
.subtitle-timeline-empty { display: grid; height: 100%; place-items: center; color: #667085; font-size: 12px; font-weight: 850; }
.subtitle-waveform-track { display: flex; align-items: end; gap: 2px; height: 76px; margin-top: 10px; padding: 8px; border: 1px solid #dbeafe; border-radius: 12px; background: linear-gradient(180deg, #061426, #0b1f3a); }
.subtitle-waveform-track i { flex: 1 1 0; min-width: 2px; border-radius: 999px 999px 0 0; background: linear-gradient(180deg, #31e6d4, var(--gold-bright)); opacity: .9; }
.subtitle-waveform-track span { display: grid; width: 100%; height: 100%; place-items: center; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 850; text-align: center; }
.subtitle-waveform-track.has-waveform { gap: 1px; }
.hero-band .subtitle-waveform-track { display: none; }
@keyframes subtitlePlayheadPulse {
  0%, 100% { transform: scale(.9); box-shadow: 0 0 0 4px rgba(16,185,129,.14); }
  50% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(16,185,129,.08); }
}
.subtitle-action-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: linear-gradient(180deg, #fff, #fbfdff); }
.subtitle-action-card strong { display: block; margin: 2px 0 4px; color: var(--navy); font-size: 16px; }
.subtitle-action-card span { color: #667085; font-size: 12px; font-weight: 750; }
.subtitle-result-card { display: grid; gap: 14px; padding: 18px; border: 1px solid #dbeafe; border-radius: 12px; background: linear-gradient(180deg, #eff6ff, #fff); box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.subtitle-output-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.subtitle-output-grid div { display: grid; gap: 4px; padding: 12px; border: 1px solid #dbeafe; border-radius: 10px; background: #fff; }
.subtitle-output-grid strong { color: var(--deep-blue); font-size: 13px; }
.subtitle-output-grid span,
.subtitle-output-name { color: #667085; font-size: 12px; font-weight: 750; line-height: 1.5; }
.subtitle-preview-result-card { display: grid; grid-column: 1 / -1; gap: 14px; padding: 18px; border: 1px solid rgba(214,168,79,.32); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.subtitle-preview-result-card video { width: min(100%, 360px); max-height: 620px; justify-self: center; border-radius: 16px; background: #061426; box-shadow: 0 18px 44px rgba(6,20,38,.18); }
.voice-preview-panel { display: grid; gap: 14px; padding: 16px; }
.voice-phone-preview { position: relative; display: grid; min-height: 560px; overflow: hidden; align-content: end; padding: 24px; border-radius: 18px; color: #fff; background: linear-gradient(180deg, #102941, #061426 72%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.voice-phone-preview::before { position: absolute; inset: 0; content: ""; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 34px 34px; }
.voice-waveform { position: absolute; top: 28px; left: 28px; z-index: 1; display: flex; align-items: center; gap: 6px; height: 62px; }
.voice-waveform span { display: block; width: 8px; height: 24px; border-radius: 999px; background: rgba(255,225,122,.75); animation: voiceWave 1s ease-in-out infinite; }
.voice-waveform span:nth-child(2) { height: 42px; animation-delay: .12s; }
.voice-waveform span:nth-child(3) { height: 58px; animation-delay: .24s; }
.voice-waveform span:nth-child(4) { height: 34px; animation-delay: .36s; }
.voice-waveform span:nth-child(5) { height: 48px; animation-delay: .48s; }
.subtitle-preview { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 104px; align-content: center; padding: 18px 10px; text-align: center; }
.subtitle-preview span { display: inline-grid; min-height: 32px; align-items: center; padding: 3px 8px; border-radius: 6px; color: #fff; background: rgba(0,0,0,.62); font-size: 24px; font-weight: 950; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.75); animation: subtitleBounce 2.1s cubic-bezier(.16,1,.3,1) infinite; animation-delay: calc(var(--i) * .09s); }
.subtitle-preview.karaoke span { color: #061426; background: var(--gold-bright); text-shadow: none; animation-name: subtitleKaraoke; }
.subtitle-preview.pop span { font-size: 28px; background: #fff; color: #0b1f3a; text-shadow: none; animation-name: subtitlePop; }
.subtitle-preview.minimal span { color: #fff; background: transparent; box-shadow: inset 0 -8px 0 rgba(255,225,122,.25); font-size: 22px; text-shadow: 0 2px 8px rgba(0,0,0,.72); animation: none; }
.subtitle-stage-shell { display: grid; gap: 10px; width: min(100%, 430px); margin: 0 auto; }
.subtitle-black-stage { container-type: inline-size; position: relative; width: 100%; aspect-ratio: 9 / 16; min-height: 0; overflow: hidden; margin: 0 auto; padding: 0; border-radius: 18px; color: #fff; background: #05080d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 18px 44px rgba(6,20,38,.14); }
.subtitle-black-stage::before { position: absolute; inset: 0; z-index: 1; content: ""; opacity: .08; background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px); background-size: 34px 34px; pointer-events: none; }
.subtitle-stage-video { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; background: #05080d; }
.subtitle-stage-video.exact-render { z-index: 3; }
.subtitle-exact-badge { position: absolute; top: 12px; right: 12px; z-index: 4; padding: 6px 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #fff; background: rgba(5,8,13,.66); font-size: 10px; font-weight: 950; letter-spacing: 0; }
.subtitle-stage-dim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(5,8,13,.08) 0%, rgba(5,8,13,0) 44%, rgba(5,8,13,.72) 100%); pointer-events: none; }
.subtitle-stage-caption { position: absolute; left: var(--subtitle-position-x, 50%); top: var(--subtitle-position-y, 78%); width: 91.2%; z-index: 2; display: grid; place-items: center; padding: 0; text-align: center; transform: translate(-50%, -50%); }
.subtitle-stage-caption.position-top_center,
.subtitle-stage-caption.position-middle_center,
.subtitle-stage-caption.position-bottom_safe { transform: translate(-50%, -50%); }
.subtitle-stage-caption span { display: inline-block; max-width: 100%; padding: .05em .18em .09em; border-radius: .12em; color: var(--subtitle-preview-color, var(--gold-bright)); -webkit-text-fill-color: var(--subtitle-preview-color, var(--gold-bright)); background: var(--subtitle-preview-bg, rgba(0,0,0,.62)); font-size: var(--subtitle-stage-font-size, 46px); font-weight: 950; line-height: var(--subtitle-preview-line-height, 1.08); text-shadow: 0 .04em .12em rgba(0,0,0,.9), 0 0 calc(5px + var(--subtitle-preview-shadow, 0) * 5px) var(--subtitle-preview-highlight, #ffd84d); -webkit-text-stroke: var(--subtitle-preview-outline-width, 1px) var(--subtitle-preview-outline, #000); paint-order: stroke fill; white-space: pre-line; animation: subtitleCuePop .42s cubic-bezier(.16,1.2,.3,1) both; }
.subtitle-stage-caption.bounce span,
.subtitle-stage-caption.effect-bounce_in span { animation-name: subtitleCueBounce; }
.subtitle-stage-caption.karaoke span,
.subtitle-stage-caption.effect-karaoke span { box-shadow: inset 0 -0.28em 0 rgba(255,255,255,.08), 0 0 18px var(--subtitle-preview-highlight, #31e6d4); }
.subtitle-stage-caption.minimal span,
.subtitle-stage-caption.none span,
.subtitle-stage-caption.effect-none span { animation: none; }
.subtitle-stage-caption.minimal span { font-size: clamp(24px, calc(var(--subtitle-preview-size, 44px) * .95), 58px); -webkit-text-stroke: var(--subtitle-preview-outline-width, 0px) var(--subtitle-preview-outline, #000); }
.subtitle-stage-caption.effect-pop_in span,
.subtitle-stage-caption.color span { animation-name: subtitleCueColorPop; }
.subtitle-stage-caption.effect-typewriter span,
.subtitle-stage-caption.reveal span { overflow: hidden; white-space: normal; animation-name: subtitleCueReveal; }
.subtitle-stage-caption.highlight span { background: linear-gradient(180deg, transparent 8%, var(--subtitle-preview-highlight, #ffd84d) 8% 88%, transparent 88%); }
.subtitle-stage-caption.paint span { background: var(--subtitle-preview-bg, rgba(0,0,0,.62)); box-shadow: inset 0 -0.18em 0 var(--subtitle-preview-highlight, #f43f5e), 0 0 22px var(--subtitle-preview-highlight, #f43f5e); animation-name: subtitleCuePaint; }
.subtitle-stage-caption em { color: rgba(255,255,255,.72); font-size: 14px; font-style: normal; font-weight: 850; }
.subtitle-stage-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px 10px 0; }
.subtitle-stage-controls .btn { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.subtitle-stage-controls span { color: #475467; font-size: 12px; font-weight: 900; }
.subtitle-stage-progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e4e7ec; cursor: pointer; }
.subtitle-stage-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-bright), #31e6d4); }
.subtitle-stage-cues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 128px; overflow: auto; padding: 2px 0 0; }
.subtitle-stage-cues button { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; min-height: 34px; padding: 6px 8px; border: 1px solid #e4e7ec; border-radius: 9px; color: #475467; background: #fff; text-align: left; cursor: pointer; }
.subtitle-stage-cues button:hover,
.subtitle-stage-cues button.active { border-color: rgba(37,99,235,.36); color: #0b1f3a; background: #eff6ff; }
.subtitle-stage-cues strong { color: var(--gold-bright); font-size: 10px; font-weight: 950; }
.subtitle-stage-cues span { overflow: hidden; font-size: 11px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.voice-contract { padding: 14px; border: 1px solid #e4e7ec; border-radius: 10px; background: #f9fafb; }
.voice-contract dl { display: grid; gap: 9px; margin: 0; }
.voice-contract div { display: flex; justify-content: space-between; gap: 12px; min-height: 30px; padding-bottom: 8px; border-bottom: 1px solid #eaecf0; }
.voice-contract div:last-child { border-bottom: 0; padding-bottom: 0; }
.voice-contract dt { color: var(--navy); font-size: 11px; font-weight: 900; }
.voice-contract dd { margin: 0; color: #667085; font-size: 11px; font-weight: 800; text-align: right; }
.voice-dry-run-card { display: grid; gap: 6px; padding: 14px; border: 1px solid rgba(47,128,237,.24); border-radius: 10px; background: #f0f7ff; }
.voice-dry-run-card strong { color: var(--deep-blue); font-size: 15px; }
.voice-dry-run-card span { color: #344054; font-size: 11px; font-weight: 800; }
.voice-dry-run-card ul { margin: 4px 0 0; padding-left: 18px; color: #7a2e0e; font-size: 11px; line-height: 1.5; }

@keyframes voiceWave {
  0%, 100% { transform: scaleY(.55); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}

@keyframes subtitleBounce {
  0%, 46%, 100% { transform: translateY(0) scale(1); }
  10% { transform: translateY(-12px) scale(1.16); }
  18% { transform: translateY(0) scale(.98); }
}

@keyframes subtitleKaraoke {
  0%, 100% { filter: saturate(.7); transform: translateY(0); }
  18% { filter: saturate(1.45); transform: translateY(-6px); }
}

@keyframes subtitlePop {
  0%, 48%, 100% { transform: scale(1); }
  12% { transform: scale(1.24) rotate(-1deg); }
}

@keyframes subtitleCuePop {
  0% { opacity: 0; transform: translateY(18px) scale(.72); filter: blur(2px); }
  58% { opacity: 1; transform: translateY(-4px) scale(1.14); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes subtitleCueBounce {
  0% { opacity: 0; transform: translateY(22px) scale(.82); }
  44% { opacity: 1; transform: translateY(-16px) scale(1.12); }
  72% { transform: translateY(4px) scale(.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes subtitleCueFade {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes subtitleCueColorPop {
  0% { opacity: 0; transform: scale(.78) rotate(-1deg); filter: saturate(.6); }
  52% { opacity: 1; transform: scale(1.16) rotate(1deg); filter: saturate(1.45); }
  100% { opacity: 1; transform: scale(1) rotate(0); filter: saturate(1); }
}

@keyframes subtitleCueReveal {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-10px); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); transform: translateX(0); }
}

@keyframes subtitleCuePaint {
  0% { opacity: 0; transform: translateY(16px) scale(.9); filter: hue-rotate(-16deg) blur(1px); }
  48% { opacity: 1; transform: translateY(-8px) scale(1.12); filter: hue-rotate(10deg) blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: hue-rotate(0); }
}

.story-creator-shell { display: grid; gap: 18px; }
.story-creator-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 24px; border: 1px solid rgba(214,168,79,.26); border-radius: 12px; color: #fff; background: linear-gradient(135deg, #061426, #0b1f3a 58%, #123b7a); box-shadow: 0 18px 44px rgba(6,20,38,.16); }
.story-creator-head h2 { margin: 5px 0 7px; font-size: 34px; line-height: 1.08; }
.story-creator-head p { max-width: 680px; margin: 0; color: rgba(255,255,255,.72); line-height: 1.7; }
.story-creator-status { display: grid; min-width: 150px; gap: 6px; justify-items: end; }
.story-creator-status span { color: var(--gold-bright); font-size: 10px; font-weight: 900; }
.story-creator-status strong { padding: 8px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.08); font-size: 13px; }
.story-creator-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; align-items: start; }
.story-chat-column { display: grid; gap: 12px; min-width: 0; }
.story-chat-panel,
.story-order-panel { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.story-tutorial-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 38%); gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(16,24,40,.05); }
.story-tutorial-panel strong { display: block; color: var(--navy); font-size: 15px; }
.story-tutorial-video { display: grid; min-height: 74px; place-items: center; border: 1px dashed #b9c7dc; border-radius: 8px; color: #667085; background: #f8fbff; font-size: 12px; font-weight: 800; }
.story-chat-topbar { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 14px; color: #fff; background: linear-gradient(90deg, #0b1f3a, #123b7a); }
.story-line-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #06261b; background: #22c55e; font-weight: 900; }
.story-chat-topbar strong,
.story-chat-topbar span { display: block; }
.story-chat-topbar strong { font-size: 14px; }
.story-chat-topbar span { margin-top: 2px; color: rgba(255,255,255,.68); font-size: 11px; }
.story-chat-window { display: grid; align-content: start; gap: 8px; height: min(64vh, 650px); min-height: 500px; overflow-y: auto; padding: 12px 14px; background: linear-gradient(180deg, #eaf4ff, #f7fafc); }
.story-message { display: flex; }
.story-message.is-user { justify-content: flex-end; }
.story-bubble { max-width: min(720px, 88%); padding: 8px 11px 6px; border-radius: 10px; color: #101828; background: #fff; box-shadow: 0 6px 16px rgba(16,24,40,.07); font-size: 13px; }
.story-message.is-user .story-bubble { max-width: min(640px, 78%); }
.story-message.is-user .story-bubble { color: #052e16; background: #bbf7d0; }
.story-bubble p { margin: 0; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.story-bubble span { display: block; margin-top: 4px; color: #667085; font-size: 10px; text-align: right; }
.story-quick-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 12px; border-top: 1px solid var(--border); background: #fff; }
.story-quick-actions button { min-height: 30px; padding: 5px 9px; border: 1px solid #d0d5dd; border-radius: 999px; color: #344054; background: #f9fafb; font-size: 11px; font-weight: 800; cursor: pointer; }
.story-quick-actions button:hover { border-color: rgba(47,128,237,.42); color: var(--deep-blue); background: var(--light-blue); }
.story-chat-input { display: grid; grid-template-columns: minmax(0, 1fr) 42px 54px; gap: 7px; padding: 8px 10px; border-top: 1px solid var(--border); background: #fff; }
.story-chat-input textarea { min-width: 0; height: 74px; min-height: 74px; max-height: 150px; padding: 9px 12px; border: 1px solid #d0d5dd; border-radius: 8px; outline: 0; font: inherit; font-size: 13px; line-height: 1.45; resize: vertical; }
.story-chat-input textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,128,237,.1); }
.story-chat-input button { min-height: 74px; border: 0; border-radius: 8px; color: #fff; background: var(--navy); font-size: 12px; font-weight: 900; cursor: pointer; }
.story-attach-button { display: grid; min-height: 74px; place-items: center; border: 1px solid #d0d5dd; border-radius: 8px; color: var(--deep-blue); background: #f8fbff; font-size: 11px; font-weight: 900; cursor: pointer; }
.story-attach-button:hover { border-color: rgba(47,128,237,.5); background: var(--light-blue); }
.story-attach-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.story-attachment-note { margin: -3px 12px 10px; color: #475467; font-size: 11px; font-weight: 800; overflow-wrap: anywhere; }
.story-order-panel { padding: 18px; }
.story-order-summary { display: grid; gap: 8px; }
.story-order-summary h3 { margin: 0; color: var(--navy); font-size: 22px; line-height: 1.18; }
.story-order-badge { justify-self: start; padding: 7px 10px; border-radius: 999px; color: #344054; background: #f2f4f7; font-size: 11px; font-weight: 900; }
.story-order-badge.pending,
.story-order-badge.queued,
.story-order-badge.processing,
.story-order-badge.rendering { color: #8a5d12; background: #fff3cd; }
.story-order-badge.completed { color: #05603a; background: #d1fadf; }
.story-order-badge.failed { color: #b42318; background: #fee4e2; }
.story-order-meta { display: grid; gap: 8px; margin: 18px 0; }
.story-order-meta div { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #f9fafb; }
.story-order-meta dt { color: #667085; font-size: 10px; font-weight: 900; }
.story-order-meta dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #101828; font-size: 13px; font-weight: 800; }
.story-order-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.story-order-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.story-order-steps li > span { display: grid; width: 22px; height: 22px; place-items: center; border: 2px solid #d0d5dd; border-radius: 50%; background: #fff; }
.story-order-steps li.done > span { border-color: var(--success); background: var(--success); }
.story-order-steps li.active > span { border-color: var(--gold); background: var(--gold-bright); }
.story-order-steps strong { display: block; color: var(--navy); font-size: 13px; }
.story-order-steps small { color: #667085; font-size: 11px; }
.story-order-actions { display: grid; gap: 10px; margin: 20px 0; }
.story-order-actions button:disabled { opacity: .48; cursor: not-allowed; }
.story-result-box { display: grid; gap: 6px; padding: 12px; border: 1px solid rgba(18,183,106,.24); border-radius: 8px; background: #f0fdf4; }
.story-result-box.is-empty { border-color: var(--border); background: #f9fafb; }
.story-result-box span { color: #05603a; font-size: 10px; font-weight: 900; }
.story-result-box.is-empty span { color: #667085; }
.story-result-box a,
.story-result-box p { margin: 0; overflow-wrap: anywhere; color: var(--deep-blue); font-size: 13px; font-weight: 800; }
.story-order-inspector { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 10px 28px rgba(16,24,40,.05); }
.story-order-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 12px; border: 0; color: var(--navy); background: #f8fbff; font-weight: 900; cursor: pointer; }
.story-order-toggle small { min-width: 0; flex: 1; overflow-wrap: anywhere; color: #475467; font-size: 11px; font-weight: 800; text-align: left; }
.story-order-toggle strong { color: var(--deep-blue); font-size: 12px; }
.story-project-bubbles { display: grid; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: #fff; }
.story-project-bubble { display: grid; gap: 4px; width: 100%; padding: 10px 12px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; cursor: pointer; text-align: left; }
.story-project-bubble.is-selected { border-color: var(--deep-blue); box-shadow: 0 0 0 2px rgba(47,128,237,.12); }
.story-project-bubble strong { overflow-wrap: anywhere; color: var(--navy); font-size: 12px; line-height: 1.35; }
.story-project-bubble span,
.story-project-bubble small { color: #475467; font-size: 11px; font-weight: 800; }
.story-project-bubble.is-empty { border-color: var(--border); background: #f9fafb; }
.story-order-inspector-body { display: grid; gap: 12px; padding: 12px; }
.story-order-compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.story-order-compact div,
.story-order-field { min-width: 0; padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: #f9fafb; }
.story-order-compact span,
.story-order-field span { display: block; margin-bottom: 4px; color: #667085; font-size: 10px; font-weight: 900; }
.story-order-compact strong,
.story-order-field strong { display: block; overflow-wrap: anywhere; color: #101828; font-size: 12px; line-height: 1.45; }
.story-order-steps.is-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.story-order-steps.is-compact li { grid-template-columns: 20px minmax(0, 1fr); gap: 7px; }
.story-order-steps.is-compact li > span { width: 16px; height: 16px; }
.story-order-steps.is-compact strong { font-size: 11px; }
.story-order-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.story-order-field.is-wide { grid-column: span 3; }
.story-order-field.is-compact { padding: 7px 8px; }
.story-order-field.is-compact strong { font-size: 11px; line-height: 1.25; }
.story-order-field.is-url { padding: 7px 8px; }
.story-order-field.is-url strong { display: -webkit-box; overflow: hidden; font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.story-order-field input,
.story-order-field textarea { width: 100%; min-width: 0; border: 1px solid #d0d5dd; border-radius: 7px; padding: 8px; font: inherit; font-size: 12px; line-height: 1.45; resize: vertical; }
.story-order-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.story-project-media { display: grid; gap: 8px; padding: 10px; border: 1px solid #bfdbfe; border-radius: 9px; background: #f8fbff; }
.story-project-media.is-empty { border-color: var(--border); background: #f9fafb; }
.story-project-media-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.story-project-media-head span,
.story-project-media > div > span,
.story-project-media-card span { color: var(--deep-blue); font-size: 10px; font-weight: 900; }
.story-project-media-head strong,
.story-project-media > div > strong { color: var(--navy); font-size: 13px; }
.story-project-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.story-project-media-card { display: grid; min-width: 0; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.story-project-media-card img,
.story-project-media-card video { width: 100%; max-height: 180px; object-fit: contain; border: 1px solid #e4e7ec; border-radius: 7px; background: #020617; }
.story-project-media-card.is-video video { aspect-ratio: 9 / 16; max-height: 220px; justify-self: start; width: min(140px, 100%); }
.story-project-media-card a { overflow-wrap: anywhere; color: var(--deep-blue); font-size: 11px; font-weight: 900; }
.story-project-media-card.is-empty { align-content: center; min-height: 120px; background: #f9fafb; }
.story-project-media-card.is-empty strong { color: var(--navy); font-size: 13px; }
.story-project-media-card.is-empty small { color: #667085; font-size: 11px; font-weight: 800; }
.story-trial-clip-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid #bfdbfe; border-radius: 8px; background: #f8fbff; }
.story-trial-clip-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.story-trial-clip-head div { display: grid; gap: 3px; min-width: 0; }
.story-trial-clip-head span { color: var(--deep-blue); font-size: 10px; font-weight: 900; }
.story-trial-clip-head strong { color: var(--navy); font-size: 14px; line-height: 1.3; }
.story-trial-clip-head small { color: #667085; font-size: 11px; font-weight: 800; }
.story-trial-clip-error { margin: 0; color: #b42318; font-size: 12px; font-weight: 800; }
.story-trial-clip-video { width: min(240px, 100%); aspect-ratio: 9 / 16; border: 1px solid var(--border); border-radius: 8px; background: #020617; justify-self: start; }
.story-trial-clip-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.story-trial-clip-meta div { min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.story-trial-clip-meta span { display: block; margin-bottom: 3px; color: #667085; font-size: 10px; font-weight: 900; }
.story-trial-clip-meta strong { display: block; overflow-wrap: anywhere; color: #101828; font-size: 12px; }
.story-trial-timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.story-trial-timeline article { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.story-trial-timeline article > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #fff; background: var(--deep-blue); font-size: 11px; font-weight: 900; }
.story-trial-timeline strong { display: block; overflow-wrap: anywhere; color: var(--navy); font-size: 12px; line-height: 1.35; }
.story-trial-timeline small { color: #667085; font-size: 10px; font-weight: 800; }
.story-phaya-clip-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(18,183,106,.32); border-radius: 8px; background: #f0fdf4; }
.story-phaya-clip-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.story-phaya-clip-head div { display: grid; gap: 3px; min-width: 0; }
.story-phaya-clip-head span { color: #05603a; font-size: 10px; font-weight: 900; }
.story-phaya-clip-head strong { color: var(--navy); font-size: 14px; line-height: 1.3; }
.story-phaya-clip-head small { color: #475467; font-size: 11px; font-weight: 800; }
.story-phaya-reasons { display: grid; gap: 6px; }
.story-phaya-reasons span { display: block; padding: 7px 8px; border: 1px solid #fedf89; border-radius: 7px; color: #93370d; background: #fffbeb; font-size: 11px; font-weight: 800; }
.story-phaya-warnings { display: grid; gap: 6px; }
.story-phaya-warnings span { display: block; padding: 7px 8px; border: 1px solid #b2ddff; border-radius: 7px; color: #1849a9; background: #eff8ff; font-size: 11px; font-weight: 800; }
.story-restore-panel { display: grid; gap: 10px; margin: 16px 0; }
.story-restore-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.story-restore-actions button { border: 1px solid #d0d5dd; border-radius: 8px; background: #f8fbff; cursor: pointer; }
.story-restore-actions button { min-height: 32px; color: var(--deep-blue); font-size: 11px; font-weight: 900; }
.story-restore-actions button.is-selected { border-color: var(--deep-blue); background: var(--deep-blue); color: #fff; }
.story-restore-confirm { min-height: 36px; border: 0; border-radius: 8px; background: var(--navy); color: #fff; cursor: pointer; font-size: 12px; font-weight: 900; }
.story-restore-confirm:disabled { cursor: not-allowed; opacity: 0.6; }
.story-restore-note { margin: 0; color: #667085; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }

.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(47, 128, 237, 0.09), transparent 34%),
    radial-gradient(circle at 82% 28%, rgba(214, 168, 79, 0.1), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 34%, #f7fafc 100%);
}

.landing-nav {
  position: fixed;
  z-index: 12;
  top: 16px;
  left: 50%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 225, 122, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(10, 26, 48, 0.92), rgba(3, 13, 26, 0.88)),
    rgba(6, 20, 38, 0.82);
  box-shadow:
    0 18px 40px rgba(6, 20, 38, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.landing-brand img {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 225, 122, 0.35);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 24px rgba(214, 168, 79, 0.25);
}

.landing-brand strong,
.landing-brand small {
  display: block;
  line-height: 1.1;
}

.landing-brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.landing-nav nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.landing-nav nav a {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.landing-nav nav a:hover {
  color: var(--gold-bright);
  background: rgba(214, 168, 79, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 225, 122, 0.14);
}

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.72fr);
  gap: 44px;
  min-height: 96vh;
  overflow: hidden;
  align-items: center;
  padding: 120px max(28px, calc((100vw - 1180px) / 2)) 72px;
  color: #fff;
  background: var(--ink);
}

#landingCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 72% 28%, rgba(214, 168, 79, 0.18), transparent 24%),
    radial-gradient(circle at 90% 72%, rgba(47, 128, 237, 0.18), transparent 26%),
    linear-gradient(90deg, rgba(6, 20, 38, 0.96), rgba(6, 20, 38, 0.82) 46%, rgba(6, 20, 38, 0.56)),
    linear-gradient(180deg, transparent 72%, rgba(247, 250, 252, 1));
}

.landing-hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 rgba(255, 225, 122, 0.18),
    0 28px 60px rgba(0, 0, 0, 0.36);
}

.landing-hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.75;
}

.gold-eyebrow {
  color: var(--gold-bright);
}

.landing-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.landing-proof span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 225, 122, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  font-weight: 800;
}

.landing-logo-stage {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 0;
}

.landing-logo-stage::before,
.landing-logo-stage::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.landing-logo-stage::before {
  width: min(540px, 82vw);
  height: min(540px, 82vw);
  background: radial-gradient(circle, rgba(214, 168, 79, 0.2), transparent 62%);
  filter: blur(4px);
}

.landing-logo-stage::after {
  width: min(430px, 70vw);
  height: min(430px, 70vw);
  border: 1px solid rgba(255, 225, 122, 0.16);
  box-shadow: 0 0 80px rgba(214, 168, 79, 0.16);
}

.logo-glow-card {
  position: relative;
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 225, 122, 0.34);
  border-radius: 8px;
  background: rgba(6, 20, 38, 0.68);
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.36),
    0 0 60px rgba(214, 168, 79, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.logo-glow-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.landing-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0;
}

.landing-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 36px;
  align-items: start;
}

.landing-intro h2,
.landing-split h2,
.landing-cta h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
}

.landing-intro p,
.landing-split p,
.landing-cta p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.landing-feature-grid,
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.landing-feature,
.plan-card,
.landing-admin-card,
.landing-console {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.landing-feature {
  min-height: 190px;
  background:
    linear-gradient(180deg, #fff, #f7fbff),
    #fff;
}

.landing-feature h3 {
  margin: 18px 0 8px;
  color: var(--deep-blue);
  font-size: 22px;
  font-weight: 900;
}

.feature-icon {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(214, 168, 79, 0.45);
  border-radius: 8px;
  background:
    radial-gradient(circle at 32% 28%, #fff8bf, transparent 35%),
    linear-gradient(135deg, var(--gold-bright), var(--gold), var(--gold-deep));
  box-shadow: 0 12px 26px rgba(214, 168, 79, 0.24);
}

.landing-feature p,
.plan-card p {
  color: var(--muted);
  line-height: 1.7;
}

.landing-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 32px;
  align-items: center;
}

.landing-console {
  display: grid;
  gap: 10px;
  color: #fff;
  border-color: rgba(255, 225, 122, 0.18);
  background:
    radial-gradient(circle at 80% 10%, rgba(214, 168, 79, 0.18), transparent 34%),
    linear-gradient(180deg, var(--navy), #061426);
  box-shadow:
    0 26px 64px rgba(6, 20, 38, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.landing-console div,
.landing-admin-card span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.landing-console span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.plan-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.plan-card {
  min-height: 220px;
  background:
    linear-gradient(180deg, #fff, #f8fbff);
}

.plan-card.featured {
  border-color: rgba(214, 168, 79, 0.5);
  background:
    radial-gradient(circle at 80% 0%, rgba(214, 168, 79, 0.18), transparent 36%),
    linear-gradient(180deg, #fffaf0, #fff);
  box-shadow: 0 20px 48px rgba(214, 168, 79, 0.15);
}

.landing-admin-card {
  display: grid;
  gap: 10px;
  border-color: rgba(47, 128, 237, 0.22);
  background: var(--light-blue);
}

.landing-admin-card strong {
  color: var(--navy);
  font-size: 24px;
}

.landing-admin-card span {
  color: var(--deep-blue);
  background: rgba(255, 255, 255, 0.72);
}

.landing-cta {
  width: min(1180px, calc(100% - 40px));
  margin: 20px auto 72px;
  padding: 56px 28px;
  border-radius: 8px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 168, 79, 0.2), transparent 38%),
    linear-gradient(135deg, var(--ink), var(--deep-blue));
  box-shadow: var(--shadow);
}

.landing-cta img {
  width: 92px;
  height: 92px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 225, 122, 0.4);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 38px rgba(214, 168, 79, 0.26);
}

.landing-cta h2 {
  color: #fff;
}

.landing-cta p {
  max-width: 680px;
  margin: 14px auto 22px;
  color: rgba(255, 255, 255, 0.76);
}

.preview-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.preview-strip .label {
  margin: 0;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.segmented button.active {
  color: var(--navy);
  background: #fff6dc;
  border-color: rgba(214, 168, 79, 0.55);
}

.course-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.course-card {
  display: grid;
  gap: 14px;
}

.course-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 128px;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(11, 31, 58, 0.95), rgba(47, 128, 237, 0.86)),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(255, 255, 255, 0.08) 18px, rgba(255, 255, 255, 0.08) 20px);
  font-weight: 900;
}

.course-visual span {
  font-size: 24px;
}

.course-visual small {
  align-self: flex-start;
  padding: 6px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.locked {
  opacity: 0.72;
}

.locked .course-visual {
  filter: grayscale(0.35);
}

.locked-note {
  margin: 0;
  color: var(--warning);
  font-weight: 800;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold));
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.studio-panel {
  position: sticky;
  top: 28px;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.lesson-player {
  padding: 0;
  overflow: hidden;
}

.video-shell {
  display: grid;
  min-height: 360px;
  align-items: end;
  padding: 28px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(11, 31, 58, 0.2), rgba(11, 31, 58, 0.92)),
    radial-gradient(circle at 25% 25%, rgba(47, 128, 237, 0.55), transparent 34%),
    linear-gradient(135deg, #061426, #123b7a);
}

.video-shell h2 {
  max-width: 720px;
  margin: 14px 0 8px;
  font-size: 34px;
}

.video-shell p {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.74);
}

.lesson-body {
  padding: 24px;
}

.lesson-sidebar {
  position: sticky;
  top: 28px;
}

.lesson-list {
  display: grid;
  gap: 8px;
}

.lesson-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.lesson-list button.current {
  border-color: rgba(47, 128, 237, 0.35);
  background: var(--light-blue);
}

.lesson-list button.locked {
  color: var(--muted);
  background: #f8fafc;
}

.tool-card {
  display: grid;
  gap: 14px;
}

.timeline {
  display: grid;
  gap: 10px;
  counter-reset: step;
}

.timeline span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.timeline span::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--deep-blue);
  font-size: 12px;
  font-weight: 900;
}

.profile-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.avatar {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 8px;
  color: var(--gold);
  background: var(--navy);
  font-size: 22px;
  font-weight: 900;
}

.positive {
  color: var(--success);
  font-weight: 900;
}

.negative {
  color: var(--error);
  font-weight: 900;
}

.status-badge.error {
  color: #7a271a;
  background: #fef3f2;
  border-color: #fecdca;
}

.status-badge.warning {
  color: #7a2e0e;
  background: #fffaeb;
  border-color: #fedf89;
}

.status-badge.info {
  color: var(--deep-blue);
  background: var(--light-blue);
  border-color: rgba(47, 128, 237, 0.25);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-users-table table {
  min-width: 1120px;
}

.admin-users-table th,
.admin-users-table td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-users-table th {
  font-size: 10px;
}

.admin-users-table td:nth-child(1) {
  min-width: 170px;
}

.admin-users-table td:nth-child(2) {
  min-width: 260px;
}

.admin-users-table td:nth-child(3),
.admin-users-table td:nth-child(4) {
  width: 136px;
}

.admin-users-table td:nth-child(5),
.admin-users-table td:nth-child(6) {
  width: 78px;
}

.admin-users-table select,
.admin-users-table .admin-credit-input {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
}

.admin-users-table .admin-blocked-input {
  width: 22px;
  min-height: 22px;
  padding: 0;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.admin-actions .btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
}

.admin-credit-input {
  width: 74px;
  flex: 0 0 74px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.tabs button.active {
  color: var(--deep-blue);
  background: var(--light-blue);
  border-color: rgba(47, 128, 237, 0.28);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.auth-screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(247, 250, 252, 0.96), rgba(234, 244, 255, 0.98)),
    var(--bg);
  z-index: 20;
}

.auth-screen.visible {
  display: flex;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  width: min(1080px, 100%);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-copy {
  padding: 36px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #0e315d 55%, #155db3);
}

.auth-copy h2 {
  max-width: 560px;
  margin-top: 36px;
  font-size: 42px;
  line-height: 1.05;
}

.auth-copy p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

#brandCanvas {
  width: 100%;
  height: auto;
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 36px;
}

.login-panel.auth-panel-hidden {
  display: none;
}

.login-panel h3 {
  font-size: 28px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid rgba(18, 183, 106, 0.3);
  border-radius: 8px;
  color: #074d31;
  background: #ecfdf3;
  box-shadow: var(--shadow);
  z-index: 30;
}


.auth-success-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 20, 38, 0.46);
  backdrop-filter: blur(4px);
  z-index: 80;
}

.auth-success-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(18, 183, 106, 0.25);
  border-radius: 8px;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(6, 20, 38, 0.24);
}

.auth-success-icon {
  display: inline-grid;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--success);
  font-size: 28px;
  font-weight: 900;
}

.auth-success-card h3 {
  margin: 0 0 10px;
  font-size: 26px;
}

.auth-success-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .agent-prompt-inspector {
    grid-template-columns: 1fr;
  }

  .agent-prompt-history-head {
    display: grid;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-stack {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-stack a {
    justify-content: center;
    text-align: center;
  }

  .support-panel {
    display: none;
  }

  .grid.cols-3,
  .grid.cols-2,
  .course-list,
  .auth-card,
  .landing-hero,
  .hero-band,
  .ai-tools-hero,
  .split-layout,
  .lesson-layout,
  .landing-intro,
  .landing-split,
  .landing-feature-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .ai-tools-orbit { display: none; }
  .ai-tool-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-tool-controls { grid-template-columns: 1fr; align-items: stretch; }
  .ai-tool-result-count { justify-self: start; }
  .master-hero,
  .master-layout { grid-template-columns: 1fr; }
  .master-status { justify-items: start; }
  .master-message { max-width: 100%; }
  .story-creator-grid { grid-template-columns: 1fr; }
  .story-tutorial-panel { grid-template-columns: 1fr; }
  .story-order-compact,
  .story-order-field-grid,
  .story-order-steps.is-compact,
  .story-project-media-grid,
  .story-trial-clip-meta,
  .story-trial-timeline { grid-template-columns: 1fr; }
  .story-order-field.is-wide { grid-column: auto; }
  .story-trial-clip-head { align-items: stretch; flex-direction: column; }
  .story-creator-head { align-items: flex-start; flex-direction: column; }
  .story-creator-status { justify-items: start; }
  .voice-subtitle-grid { grid-template-columns: 1fr; }
  .voice-subtitle-hero { align-items: flex-start; flex-direction: column; }
  .voice-subtitle-status { justify-items: start; }
  .voice-tool-tabs { grid-template-columns: 1fr; }
  .voice-builder-studio { grid-template-columns: 1fr; }
  .voice-source-card,
  .voice-action-card { grid-column: auto; }
  .voice-action-card { grid-template-columns: 1fr; }
  .voice-script-ai-box { grid-template-columns: 1fr; }
  .voice-script-ai-actions { justify-content: stretch; }
  .voice-script-ai-actions .btn { flex: 1 1 160px; }
  .transcript-studio { grid-template-columns: 1fr; }
  .transcript-result-card,
  .transcript-script-card { grid-column: auto; }
  .subtitle-studio { grid-template-columns: 1fr; }
  .subtitle-script-card,
  .subtitle-result-card,
  .subtitle-preview-result-card,
  .subtitle-action-card { grid-column: auto; }
  .subtitle-action-card { grid-template-columns: 1fr; }
  .subtitle-output-grid { grid-template-columns: 1fr; }
  .subtitle-text-tools { grid-template-columns: 1fr; }
  .subtitle-text-tools > div:first-child,
  .subtitle-text-tool-row { grid-column: 1; grid-row: auto; }
  .subtitle-text-tool-row,
  .subtitle-agent-row { grid-template-columns: 1fr; }
  .transcript-player-row { grid-template-columns: auto minmax(0, 1fr); }
  .transcript-waveform { grid-column: 1 / -1; }
  .transcript-segment-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 10px; }
  .transcript-segment-row time { font-size: 15px; }
  .transcript-segment-row p { font-size: 17px; }

  .landing-nav {
    position: absolute;
    grid-template-columns: 1fr auto;
  }

  .landing-nav nav {
    display: none;
  }

  .auth-copy h2 {
    font-size: 34px;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar,
  .auth-copy,
  .login-panel {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 25px;
  }

  .nav-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .voice-form-grid {
    grid-template-columns: 1fr;
  }

  .voice-phone-preview {
    min-height: 440px;
    padding: 18px;
  }

  .subtitle-preview span {
    font-size: 19px;
  }

  .hero-band h2,
  .video-shell h2 {
    font-size: 28px;
  }

  .ai-tools-hero { min-height: 232px; padding: 22px 18px; }
  .ai-tools-hero h2 { font-size: 30px; }
  .ai-tools-section-head { align-items: flex-start; flex-direction: column; }
  .ai-tool-catalog { grid-template-columns: 1fr; }
  .story-creator-head { padding: 20px; }
  .story-creator-head h2 { font-size: 30px; }
  .story-chat-window { min-height: 380px; height: 56vh; padding: 14px; }
  .story-chat-input { grid-template-columns: 1fr; }
  .story-bubble { max-width: 92%; }

  .landing-hero {
    min-height: 820px;
    align-content: center;
    gap: 28px;
  }

  .landing-hero::after {
    background:
      linear-gradient(180deg, rgba(6, 20, 38, 0.96), rgba(6, 20, 38, 0.66) 70%, rgba(247, 250, 252, 1));
  }

  .landing-logo-stage {
    order: -1;
  }

  .logo-glow-card {
    width: min(260px, 82vw);
  }

  .video-shell {
    min-height: 280px;
  }

  .auth-screen {
    align-items: flex-start;
    overflow-y: auto;
  }
}
