@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;650;700;750&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --page: #f8f7f4;
  --paper: #fff;
  --ink: #201a29;
  --subtle: #605968;
  --line: #e4dfe7;
  --purple: #5b29a7;
  --purple-dark: #452082;
  --lavender: #f1e8fe;
  --focus: #7139c7;
  --error: #9b2942;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  font: 15px/1.45 "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.topbar { background: #231635; color: #fff; }
.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  max-width: 1280px;
  margin: auto;
  padding: 0 32px;
}
.brand { display: flex; gap: 10px; align-items: center; font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: #e0c8ff; color: #351750; font: 700 13px var(--mono); border-radius: 8px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 7px;
  color: #e7d9f9;
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
}
.topbar nav a:hover { background: #3c2952; }
.topbar nav a[aria-current] { color: white; background: #533775; }
.topbar nav a:focus-visible { outline-color: #dbbaff; }
.event-clock { justify-self: end; color: #e7d9f9; font: 500 13px var(--mono); white-space: nowrap; }
.page { width: min(100%, 1280px); margin: auto; padding: 36px 32px 52px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.eyebrow { color: var(--purple); font: 600 12px var(--mono); letter-spacing: .045em; text-transform: uppercase; }
h1 { font-size: clamp(36px, 6vw, 60px); letter-spacing: -.065em; line-height: 1; font-weight: 750; margin: 7px 0 9px; }
.event-meta { color: var(--subtle); }
.event-meta span { margin-inline: 4px; }
.connection { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--subtle); white-space: nowrap; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #91869b; flex: none; }
.connection[data-state="online"] .connection-dot { background: #1c845e; }
.connection[data-state="offline"] .connection-dot { background: #b16822; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.section-heading span, .panel-heading p:not(.eyebrow), .live-heading p { color: var(--subtle); font-size: 13px; }
h2 { font-size: 20px; font-weight: 750; letter-spacing: -.025em; }
.session-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.session-day, .surface, .cue { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; min-width: 0; }
.session-day { padding: 12px; }
.session-day h3 { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 8px; font-size: 14px; }
.session-day h3 span { font: 500 12px var(--mono); color: var(--subtle); }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 50px;
  text-align: left;
  padding: 6px 9px;
  background: #faf8fb;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
}
.slot strong { font-size: 13px; }
.slot span, .stage-time, .cue-time { font: 500 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--subtle); }
.slot:hover, .stage:hover { background: #f7f0fe; }
.slot[aria-pressed="true"], .stage[aria-pressed="true"] { background: var(--lavender); border-color: #b391e8; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.panel-heading { display: flex; justify-content: space-between; gap: 8px 12px; align-items: start; padding: 16px; }
.schedule .panel-heading { border-bottom: 1px solid var(--line); }
.coverage { color: var(--subtle); font-size: 12px; padding-top: 4px; white-space: nowrap; }
#stage-list { padding: 6px; }
.stage {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.stage + .stage { margin-top: 2px; }
.stage-label { min-width: 0; overflow-wrap: anywhere; }
.stage-label strong { display: block; font-weight: 750; }
.stage-owner { display: block; color: var(--subtle); font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 6px; background: #f2eff4; color: #5b5263; font-size: 11px; font-weight: 750; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-status="ready"] { background: #e6f3f8; color: #1a5c75; }
.status[data-status="in-progress"] { background: #eee3ff; color: #5a2b98; }
.status[data-status="blocked"] { background: #fce9e9; color: #9b2942; }
.status[data-status="done"] { background: #e3f3e8; color: #21643f; }
.details .panel-heading { padding-bottom: 7px; }
.details .eyebrow { margin-bottom: 4px; }
.details .status { margin-top: 4px; }
.stage-description { color: var(--subtle); font-size: 14px; padding: 0 16px; }
form { padding: 16px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
.fields .wide { grid-column: 1 / -1; }
label { display: grid; gap: 4px; min-width: 0; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid #d7cfde;
  border-radius: 7px;
  color: var(--ink);
  background: white;
}
input[type="time"] { font-family: var(--mono); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #716978; }
.form-message { min-height: 19px; margin: 6px 0; font-size: 12px; color: var(--subtle); }
.form-message[data-error] { color: var(--error); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 14px;
  font-weight: 750;
  text-decoration: none;
}
.primary { background: var(--purple); color: white; }
.primary:hover { background: var(--purple-dark); }
.secondary { background: white; border-color: var(--line); color: var(--ink); }
.secondary:hover { background: #f8f3ff; }
.button:active, .slot:active, .stage:active { transform: translateY(1px); }
.stage-brief { border-top: 1px solid var(--line); background: #fbf8fe; padding: 12px 16px; border-radius: 0 0 12px 12px; font-size: 13px; }
.stage-brief div + div { margin-top: 8px; }
.stage-brief dt { font-weight: 750; }
.stage-brief dd { color: var(--subtle); }
.load-state { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.load-state button { margin-top: 12px; }
.live-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.live-picker { min-width: 170px; }
.live-cues { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cue { min-height: 210px; padding: 20px; }
.cue[data-kind="now"] { background: #2a1941; color: #fff; border-color: #2a1941; }
.cue[data-kind="now"] :is(.eyebrow, .cue-time, .cue-secondary) { color: #e4d0ff; }
.cue h3 { font-size: clamp(23px, 4vw, 35px); letter-spacing: -.035em; line-height: 1.13; margin: 6px 0; }
.cue-time { display: block; margin: 4px 0 12px; }
.cue-secondary { color: var(--subtle); font-size: 14px; margin-top: 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cue-owner { font-weight: 750; overflow-wrap: anywhere; }
.live-blockers { margin-top: 18px; }
.blocker {
  margin-top: 8px;
  background: #fff1f0;
  border: 1px solid #f3cdcf;
  border-radius: 8px;
  padding: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
#live-plan-link { margin-top: 18px; }

@media (max-width: 920px) {
  .slots { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner, .page { padding-inline: 20px; }
  .stage { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 7px; }
  .stage-time { font-size: 11px; }
}

@media (max-width: 700px) {
  .plan-layout, .live-cues { grid-template-columns: minmax(0, 1fr); }
  .stage { grid-template-columns: 84px minmax(0, 1fr) auto; }
  .stage-time { font-size: 12px; }
  .page { padding-top: 24px; }
  .page-heading { align-items: start; flex-direction: column; gap: 8px; margin-bottom: 20px; }
  .cue { min-height: auto; }
}

@media (max-width: 480px) {
  .topbar-inner, .page { padding-inline: 12px; }
  .topbar-inner { min-height: 58px; grid-template-columns: auto 1fr auto; gap: 7px; }
  .brand > span + span { display: none; }
  .topbar nav { justify-self: center; }
  .topbar nav a { padding-inline: 9px; font-size: 13px; }
  .event-clock { font-size: 11px; }
  .session-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .session-day { display: grid; grid-template-columns: 77px minmax(0, 1fr); align-items: center; padding: 6px; }
  .session-day h3 { display: grid; padding-bottom: 0; }
  .slots { grid-template-columns: 1fr 1fr; }
  .slot { padding-inline: 6px; }
  .slot span { font-size: 11px; }
  .stage { grid-template-columns: 73px minmax(0, 1fr) auto; padding-inline: 6px; }
  .stage-label strong { font-size: 13px; }
  .stage-time { font-size: 10px; }
  .coverage { white-space: normal; text-align: right; }
  input, select, textarea { font-size: 16px; }
}
