:root {
  color-scheme: dark;
  --bg: #111217;
  --surface: #191b22;
  --surface-2: #22252e;
  --surface-3: #2a2e39;
  --text: #f7f7f8;
  --muted: #a8acb8;
  --line: rgba(255,255,255,.12);
  --accent: #ffb54c;
  --accent-2: #ff7a45;
  --blue: #6d86ff;
  --green: #59c48b;
  --shadow: 0 24px 70px rgba(0,0,0,.34);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(109,134,255,.16), transparent 30rem),
    radial-gradient(circle at 90% 12%, rgba(255,181,76,.13), transparent 28rem),
    linear-gradient(160deg, #0d0e12, var(--bg) 55%, #151821);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1220px, calc(100% - 36px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(13,14,18,.84);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #17120c;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(255,139,69,.22);
  font-weight: 950;
}
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: .97rem; }
.brand-copy span { margin-top: 2px; color: var(--muted); font-size: .74rem; }

.top-actions { display: flex; align-items: center; gap: 9px; }
.action-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: rgba(255,255,255,.055);
  font-weight: 850;
}
.action-button:hover { background: rgba(255,255,255,.11); transform: translateY(-1px); }
.action-button.primary { color: #211811; border-color: transparent; background: var(--accent); }

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 54px 0 90px;
}

.sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.side-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow: 0 16px 50px rgba(0,0,0,.18);
}
.side-card h2 { margin: 0 0 14px; font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }
.side-card p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }

.progress-value { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s ease; }

.phase-nav { display: grid; gap: 7px; }
.phase-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  font-size: .84rem;
  font-weight: 800;
}
.phase-nav a:hover { color: var(--text); background: rgba(255,255,255,.075); }
.phase-nav b { color: var(--accent); }

.timer-display { margin: 2px 0 14px; font-size: 2rem; font-weight: 900; letter-spacing: -.04em; }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.timer-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.055);
  font-weight: 800;
}

.content { min-width: 0; }
.hero { padding: 10px 0 40px; }
.eyebrow {
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 11px;
  border: 1px solid rgba(255,181,76,.34);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255,181,76,.07);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero h1 { max-width: 900px; margin: 0 0 18px; font-size: clamp(2.7rem, 6vw, 5.5rem); line-height: .98; letter-spacing: -.06em; }
.hero h1 span { color: transparent; background: linear-gradient(100deg, var(--accent), #ffd692, var(--accent-2)); background-clip: text; -webkit-background-clip: text; }
.hero p { max-width: 850px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.7; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 28px; }
.summary-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.045); }
.summary-card strong { display: block; color: var(--accent); font-size: 1.35rem; }
.summary-card span { color: var(--muted); font-size: .78rem; }

.phase-section { scroll-margin-top: 96px; margin-top: 34px; }
.phase-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.phase-heading h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.04em; }
.phase-heading p { margin: 0; color: var(--muted); font-size: .88rem; }

.step-list { display: grid; gap: 13px; }
.script-step {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  box-shadow: 0 14px 42px rgba(0,0,0,.17);
}
.script-step[open] { border-color: rgba(255,181,76,.38); box-shadow: var(--shadow); }
.script-step.is-done { border-color: rgba(89,196,139,.45); }
.script-step summary {
  min-height: 78px;
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  list-style: none;
  cursor: pointer;
}
.script-step summary::-webkit-details-marker { display: none; }
.step-number {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #211811;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  font-weight: 950;
}
.step-title strong, .step-title span { display: block; }
.step-title strong { margin-bottom: 4px; font-size: 1rem; }
.step-title span { color: var(--muted); font-size: .78rem; }
.step-time { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .75rem; font-weight: 850; white-space: nowrap; }
.step-body { padding: 0 18px 20px 86px; }
.script-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.script-box { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.04); }
.script-box.full { grid-column: 1 / -1; }
.script-box h3 { margin: 0 0 8px; color: var(--accent); font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; }
.script-box p { margin: 0; color: var(--muted); line-height: 1.65; }
.script-box.speech p { color: var(--text); font-size: .96rem; }
.script-box.interaction { border-color: rgba(109,134,255,.34); background: rgba(109,134,255,.07); }
.script-box.transition { border-color: rgba(89,196,139,.3); background: rgba(89,196,139,.055); }

.done-row { display: flex; justify-content: flex-end; margin-top: 14px; }
.done-label { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: .82rem; font-weight: 800; cursor: pointer; }
.done-label input { width: 18px; height: 18px; accent-color: var(--green); }

.footer-note { margin-top: 40px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: rgba(255,255,255,.035); line-height: 1.65; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(3, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1220px); }
  .topbar-inner { min-height: 64px; }
  .brand-copy span { display: none; }
  .top-actions .action-button:first-child { display: none; }
  .layout { padding-top: 30px; }
  .sidebar { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .phase-heading { align-items: flex-start; flex-direction: column; }
  .script-step summary { grid-template-columns: 44px minmax(0,1fr); gap: 12px; }
  .step-number { width: 44px; height: 44px; }
  .step-time { grid-column: 2; width: fit-content; }
  .step-body { padding: 0 13px 16px; }
  .script-grid { grid-template-columns: 1fr; }
  .script-box.full { grid-column: auto; }
}

@media print {
  :root { color-scheme: light; }
  body { color: #111; background: #fff; }
  .topbar, .sidebar, .top-actions, .done-row { display: none !important; }
  .layout { display: block; padding: 0; }
  .shell { width: 100%; }
  .hero { padding-top: 0; }
  .hero h1 span { color: #111; background: none; }
  .hero p, .phase-heading p, .script-box p, .step-title span { color: #444; }
  .script-step { break-inside: avoid; border-color: #bbb; background: #fff; box-shadow: none; }
  .script-step:not([open]) .step-body { display: block; }
  .script-box { border-color: #ccc; background: #f7f7f7; }
  .step-number { color: #111; background: #ddd; }
  .step-time { color: #444; border-color: #ccc; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
