:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5c6670;
  --line: #d9dee3;
  --paper: #ffffff;
  --wash: #f4f6f7;
  --accent: #006b63;
  --accent-dark: #004d47;
  --focus: #ffbf47;
  --clash: #b42318;
  --clash-wash: #fff1f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  line-height: 1.5;
}

a { color: var(--accent-dark); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 44px 0 30px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .82rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.03em;
}

h2 { margin: 34px 0 14px; }

.lede {
  margin: 16px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

main { padding: 28px 0 52px; }

.notice {
  background: #fff8df;
  border: 1px solid #eadba7;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.notice.error {
  background: var(--clash-wash);
  border-color: #f3b5b0;
  color: #7a271a;
}

.notice p { margin: 0; }

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.event-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.event-card.primary {
  border-color: #9ccdc9;
  box-shadow: 0 3px 12px rgba(0, 107, 99, .08);
}

.event-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.meta {
  margin: 0 0 16px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--paper);
  color: var(--accent-dark);
  text-decoration: none;
  font: inherit;
  font-weight: 650;
  font-size: .94rem;
  cursor: pointer;
}

.button:hover { background: #edf8f7; }
.button:disabled { opacity: .45; cursor: default; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }

.builder { margin-top: 38px; }
.builder-intro { max-width: 800px; }
.builder-intro h2 { margin-bottom: 6px; }
.builder-intro p { margin-top: 0; color: var(--muted); }

.builder-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 18px 0;
  padding: 14px 16px;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 3px 14px rgba(0,0,0,.07);
}

.builder-controls p { margin: 5px 0 0; }
.compact-actions { justify-content: flex-end; }
.conflict-warning { color: var(--clash); max-width: 570px; font-size: .91rem; }

.programme-day {
  margin: 28px 0 38px;
}

.programme-day > h2 {
  margin: 0 0 9px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

.programme-item {
  display: grid;
  grid-template-columns: 34px 92px minmax(250px, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.programme-item:first-of-type { border-radius: 10px 10px 0 0; }
.programme-item:last-child { border-radius: 0 0 10px 10px; border-bottom: 0; }
.programme-item.has-conflict { background: var(--clash-wash); box-shadow: inset 4px 0 0 var(--clash); }
.programme-item.kind-break,
.programme-item.kind-lunch { background: #f8f9fa; }
.programme-item.kind-panel,
.programme-item.kind-plenary,
.programme-item.kind-fireside { background: #f0f8f7; }

.event-select { padding-top: 3px; text-align: center; }
.event-select input { width: 19px; height: 19px; accent-color: var(--accent); cursor: pointer; }
.event-time { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.event-body h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.event-details { margin: 4px 0 0; color: var(--muted); font-size: .91rem; }
.event-links { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; max-width: 220px; }
.mini-link { font-size: .8rem; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; text-decoration: none; background: #fff; white-space: nowrap; }
.mini-link:hover { border-color: var(--accent); background: #edf8f7; }

.small { color: var(--muted); font-size: .9rem; }
.workshop-note { margin-top: -22px; }

.direct-links {
  margin-top: 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
}

.direct-links h2 { margin-top: 0; }

code {
  background: #eef1f3;
  border-radius: 4px;
  padding: 2px 5px;
  overflow-wrap: anywhere;
}

.link-table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.link-table { width: 100%; border-collapse: collapse; }
.link-table th, .link-table td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.link-table th { background: #f4f6f7; font-size: .86rem; }
.link-table tr:last-child td { border-bottom: 0; }

footer {
  padding: 20px 0 36px;
  color: var(--muted);
  font-size: .9rem;
}

.embed-body { background: transparent; padding: 8px; }
.embed-shell { display: flex; flex-direction: column; gap: 7px; }
.embed-title { font-size: .9rem; font-weight: 700; margin: 0; }
.embed-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .builder-controls { position: static; flex-direction: column; align-items: stretch; }
  .compact-actions { justify-content: flex-start; }
  .programme-item { grid-template-columns: 30px 80px 1fr; }
  .event-links { grid-column: 3; justify-content: flex-start; max-width: none; }
}

@media (max-width: 560px) {
  header { padding-top: 30px; }
  .wrap { width: min(100% - 22px, 1120px); }
  .event-card { padding: 18px; }
  .event-card .button { width: 100%; text-align: center; }
  .programme-item { grid-template-columns: 28px 1fr; gap: 8px 10px; }
  .event-time { grid-column: 2; }
  .event-body { grid-column: 2; }
  .event-links { grid-column: 2; }
  .builder-controls .button { width: 100%; text-align: center; }
  .embed-box .button { width: auto; }
}
