:root {
  color-scheme: light;
  --accent: #6757e6;
  --accent-strong: #5140d6;
  --accent-soft: #f0edff;
  --accent-line: #dcd6ff;
  --live: #e5484d;
  --success: #1f9d63;
  --warning: #c47a16;
  --ink: #19191f;
  --ink-2: #62626f;
  --ink-3: #9696a2;
  --line: #e9e9ef;
  --surface: #fff;
  --surface-2: #f7f7fa;
  --page: #efeff4;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(31, 28, 55, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--accent); }

#app {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(34px + env(safe-area-inset-bottom));
  animation: enter .18s ease both;
}
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 42px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { width: 28px; height: 28px; border-radius: 10px; background: linear-gradient(145deg, #8072f4, #5545d3); position: relative; box-shadow: 0 7px 18px rgba(103, 87, 230, .28); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; bottom: 7px; width: 3px; border-radius: 3px; background: white; }
.brand-mark::before { left: 8px; height: 8px; box-shadow: 5px -5px 0 white, 10px -1px 0 white; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover, .icon-button:focus-visible { background: var(--surface-2); outline: none; }
.top-actions { display: flex; align-items: center; gap: 4px; }

.eyebrow { margin: 18px 0 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-title { margin: 0; font-size: clamp(26px, 7vw, 38px); line-height: 1.06; letter-spacing: -.035em; }
.page-subtitle { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }

.week { display: grid; grid-template-columns: repeat(7, minmax(39px, 1fr)); gap: 5px; margin: 22px 0 14px; }
.day { min-width: 0; border: 1px solid transparent; border-radius: 14px; padding: 8px 2px 7px; background: transparent; text-align: center; cursor: pointer; }
.day:hover { background: var(--surface-2); }
.day.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.day .dow { color: var(--ink-3); font-size: 9px; font-weight: 800; letter-spacing: .07em; }
.day.active .dow { color: var(--accent); }
.day .num { margin-top: 3px; font-size: 16px; font-weight: 750; }
.day .event-dot { display: block; width: 4px; height: 4px; margin: 5px auto 0; border-radius: 50%; background: transparent; }
.day.has-event .event-dot { background: var(--accent); }

.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: 4px -18px 20px; padding: 0 18px 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; white-space: nowrap; background: white; color: var(--ink-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.filter-chip.active { border-color: var(--accent); color: white; background: var(--accent); }

.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.section-heading h2 { margin: 0; font-size: 15px; }
.section-heading span { color: var(--ink-3); font-size: 11px; }
.event-list { display: grid; gap: 10px; }
.event-card { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; background: white; text-align: left; cursor: pointer; transition: .16s ease; }
.event-card:hover, .event-card:focus-visible { border-color: var(--accent-line); box-shadow: 0 9px 25px rgba(103, 87, 230, .09); transform: translateY(-1px); outline: none; }
.company-logo { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; color: var(--accent); font-weight: 850; }
.company-logo > * { grid-area: 1 / 1; }
.company-logo img { width: 31px; height: 31px; object-fit: contain; }
.event-main { min-width: 0; }
.event-company { display: flex; align-items: center; gap: 7px; min-width: 0; }
.event-company strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ticker { color: var(--ink-3); font-size: 10px; font-weight: 750; }
.event-title { margin-top: 3px; overflow: hidden; color: #363641; font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.event-type { margin-top: 3px; color: var(--ink-3); font-size: 11px; }
.event-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; }
.event-time { color: var(--ink-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.status-pill.live { background: #fff0f1; color: var(--live); }
.status-pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.status-pill.ended, .status-pill.published { color: var(--success); background: #edf9f3; }
@keyframes pulse { 50% { opacity: .32; } }

.empty-card, .error-card { border: 1px dashed var(--line); border-radius: var(--radius); padding: 38px 20px; text-align: center; color: var(--ink-2); background: var(--surface-2); }
.empty-card strong, .error-card strong { display: block; margin-bottom: 7px; color: var(--ink); }
.retry-button, .primary-button { border: 0; border-radius: 999px; margin-top: 15px; padding: 10px 17px; background: var(--accent); color: white; font-size: 12px; font-weight: 800; cursor: pointer; }

.skeleton { overflow: hidden; border-radius: 10px; background: linear-gradient(90deg, #eeeef3 20%, #f8f8fa 45%, #eeeef3 70%); background-size: 250% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -250% 0; } }
.skeleton-title { width: 64%; height: 30px; margin-top: 28px; }
.skeleton-card { height: 80px; margin-top: 14px; border-radius: 18px; }

.company-hero { display: flex; align-items: center; gap: 14px; margin: 16px 0 24px; }
.company-hero .company-logo { width: 62px; height: 62px; border-radius: 19px; }
.company-hero h1 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.company-hero p { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; font-weight: 700; }

.live-header { margin-top: 12px; }
.live-title { margin: 7px 0 0; font-size: clamp(24px, 7vw, 36px); line-height: 1.12; letter-spacing: -.035em; }
.live-company { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.live-company .company-logo { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
.live-company .company-logo img { width: 19px; height: 19px; }
.live-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; color: var(--ink-2); font-size: 12px; }

.coverage-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 16px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.coverage-item { padding: 11px 7px; background: var(--surface-2); text-align: center; }
.coverage-item span { display: block; color: var(--ink-3); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.coverage-item strong { display: block; margin-top: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }

.player { border: 1px solid var(--accent-line); border-radius: 21px; padding: 15px; background: linear-gradient(155deg, #f6f3ff 0%, white 72%); }
.player-row { display: flex; align-items: center; gap: 12px; }
.play-toggle { width: 43px; height: 43px; flex: 0 0 43px; border: 0; border-radius: 50%; background: var(--accent); color: white; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 18px rgba(103, 87, 230, .25); }
.play-toggle[disabled] { background: #c8c8d1; box-shadow: none; cursor: not-allowed; }
.player-track { flex: 1; min-width: 0; }
.wave { display: flex; align-items: center; gap: 2px; height: 30px; }
.wave i { flex: 1; min-width: 2px; border-radius: 3px; background: #d8d3f7; }
.player-progress { width: 100%; accent-color: var(--accent); }
.player-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--ink-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.player-meta strong { color: var(--accent); }
.audio-note { color: var(--ink-3); }

.participant-strip { display: flex; gap: 8px; overflow-x: auto; margin: 14px -18px 4px; padding: 0 18px 3px; scrollbar-width: none; }
.participant-strip::-webkit-scrollbar { display: none; }
.participant-card { min-width: 155px; border: 1px solid var(--line); border-radius: 15px; padding: 10px; display: flex; align-items: center; gap: 9px; background: white; }
.avatar { width: 35px; height: 35px; flex: 0 0 35px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 850; }
.avatar > * { grid-area: 1 / 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.participant-card strong { display: block; max-width: 95px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.participant-card span { display: block; max-width: 95px; margin-top: 2px; overflow: hidden; color: var(--ink-3); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.tabs { position: sticky; top: 0; z-index: 4; display: flex; gap: 24px; margin: 20px -18px 0; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.tab { border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px 1px 10px; background: transparent; color: var(--ink-3); font-size: 13px; font-weight: 750; cursor: pointer; }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.tab-panel { padding-top: 13px; }

.timeline-section { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: white; }
.section-toggle { width: 100%; border: 0; padding: 14px; display: flex; align-items: flex-start; gap: 10px; background: white; text-align: left; cursor: pointer; }
.section-index { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 850; }
.section-name { flex: 1; min-width: 0; }
.section-name strong { display: block; font-size: 14px; }
.section-name span { display: block; margin-top: 4px; color: var(--ink-3); font-size: 10px; }
.section-state { border-radius: 999px; padding: 4px 7px; background: #fff5e8; color: var(--warning); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.section-state.closed { color: var(--success); background: #edf9f3; }
.section-body { border-top: 1px solid var(--line); padding: 2px 14px 14px; }
.section-summary { margin: 11px 0 4px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; padding: 10px 12px; background: var(--accent-soft); color: #464052; font-size: 12px; line-height: 1.6; }
.cue { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; padding: 13px 0; border-bottom: 1px solid #f2f2f5; }
.cue:last-child { border-bottom: 0; }
.cue .avatar { width: 34px; height: 34px; }
.cue-head { display: flex; align-items: baseline; gap: 7px; }
.cue-head strong { font-size: 12px; }
.cue-head button { border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 750; cursor: pointer; }
.cue-role { margin-top: 2px; color: var(--ink-3); font-size: 9px; }
.cue-text { margin-top: 5px; color: #33333c; font-size: 13px; line-height: 1.65; }
.inline-highlight { border: 0; border-radius: 5px; padding: 1px 3px; background: #fff1a8; color: #393223; font: inherit; cursor: pointer; box-shadow: inset 0 -1px rgba(173,133,0,.18); }
.inline-highlight:hover { background: #ffe878; }

.summary-card, .highlight-card { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 14px; background: white; }
.summary-card h3, .highlight-card h3 { margin: 0; font-size: 14px; }
.summary-card .markdown, .highlight-card p { margin-top: 9px; }
.provenance { margin-top: 10px; color: var(--ink-3); font-size: 9px; }
.highlight-card { width: 100%; text-align: left; cursor: pointer; }
.highlight-card:hover { border-color: var(--accent-line); }
.highlight-kind { display: inline-block; margin-bottom: 8px; border-radius: 999px; padding: 4px 8px; background: #fff4cb; color: #8a6511; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.highlight-card p { margin-bottom: 0; color: var(--ink-2); font-size: 12px; line-height: 1.5; }

.markdown { color: #393944; font-size: 13px; line-height: 1.7; }
.markdown h1, .markdown h2, .markdown h3 { margin: 15px 0 6px; color: var(--ink); line-height: 1.3; }
.markdown h1 { font-size: 20px; } .markdown h2 { font-size: 16px; } .markdown h3 { font-size: 14px; }
.markdown p { margin: 7px 0; }
.markdown ul { margin: 7px 0; padding-left: 20px; }
.context-hero { border-bottom: 1px solid var(--line); margin: 10px 0 17px; padding-bottom: 16px; }
.context-hero h1 { margin: 7px 0 0; font-size: 25px; line-height: 1.18; letter-spacing: -.025em; }
.reference-list { display: grid; gap: 8px; margin-top: 20px; }
.reference-card { border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; background: var(--surface-2); }
.reference-card span { display: block; color: var(--ink-3); font-size: 9px; text-transform: uppercase; }
.reference-card strong { display: block; margin-top: 4px; font-size: 12px; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 999px; background: rgba(25,25,31,.9); color: white; font-size: 11px; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  #app { min-height: calc(100vh - 36px); margin: 18px auto; border-radius: 28px; overflow: hidden; }
  .page { min-height: calc(100vh - 36px); padding: 28px 34px 48px; }
  .event-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-row, .participant-strip { margin-left: -34px; margin-right: -34px; padding-left: 34px; padding-right: 34px; }
  .tabs { margin-left: -34px; margin-right: -34px; padding-left: 34px; padding-right: 34px; }
  .live-layout { display: grid; grid-template-columns: minmax(270px, .85fr) minmax(360px, 1.4fr); gap: 28px; align-items: start; }
  .live-aside { position: sticky; top: 24px; }
  .live-content .tabs { position: sticky; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
