@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..800;1,9..40,300..800&display=swap');

:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #efede7;
  --ink: #1a1917;
  --muted: #6b6862;
  --line: #e2dfd8;
  --accent: #00635f;
  --accent-light: #e0f2f1;
  --focus: #111111;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);

  /* event type tokens */
  --keynote-bg: #fffbeb;
  --keynote-border: #d97706;
  --keynote-text: #92400e;
  --break-bg: #f0efe9;
  --social-bg: #f5f3ff;
  --social-border: #7c3aed;
  --practitioner-bg: #f0fdf4;
  --practitioner-border: #059669;
}


* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: rgba(0, 99, 95, 0.15);
}

button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1.2;
  text-wrap: balance;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
}

/* ── Skip link ── */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 12px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-140%);
}
.skip-link:focus-visible { transform: translateY(0); }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 246, 242, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
  padding: 14px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin-bottom: 0;
}

/* ── Controls ── */
.controls {
  display: grid;
  gap: 8px;
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 clamp(16px, 4vw, 42px) 12px;
}

.section-nav {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.section-nav button {
  padding: 8px 18px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: color .12s;
}
.section-nav button:hover { color: var(--ink); }
.section-nav button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.day-row {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(280px, 1fr);
  gap: 14px;
  align-items: end;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  min-height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.segmented button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13.5px;
  transition: color .12s, background .12s;
  line-height: 1.2;
  padding: 4px 8px;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.search { display: grid; gap: 5px; }

.search span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.search input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .12s, box-shadow .12s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 99, 95, .12);
  outline: none;
}

/* ── Layout ── */
.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 42px) 48px;
}

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

.schedule-panel {
  min-width: 0;
}

.timeline { display: flex; flex-direction: column; gap: 8px; padding: 10px; }

/* ── Time blocks ── */
.time-block {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
}

.time-block.session-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.time-label {
  padding: 16px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f9f8f5;
  border-right: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

/* ── Event grid ── */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  padding: 10px;
}

/* ── Event cards ── */
.event-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .12s, box-shadow .12s;
}

.event-card > .favorite {
  position: absolute;
  top: 10px;
  right: 10px;
}

.event-card:hover,
.event-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

/* event type styling */
.event-card.keynote {
  background: var(--keynote-bg);
  border-color: #fcd34d;
  min-height: 68px;
}

.event-card.break {
  background: var(--break-bg);
  border-style: solid;
  min-height: 56px;
  opacity: .85;
}

.event-card.social {
  background: var(--social-bg);
  border-color: #c4b5fd;
  min-height: 68px;
}

.event-card.plenary {
  min-height: 60px;
}

.event-card.practitioner {
  background: var(--practitioner-bg);
  border-color: #6ee7b7;
  min-height: 86px;
}

/* ── Event select button ── */
.event-select {
  display: grid;
  gap: 5px;
  width: 100%;
  height: 100%;
  padding: 0;
  padding-right: 32px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.event-select:disabled,
.talk-select:disabled {
  cursor: default;
  pointer-events: none;
}

/* ── Card meta / pills ── */
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
}

.pill.session {
  color: #3b4b8c;
  background: #eef0fb;
}

.pill.room {
  color: #7c3412;
  background: #fff0e6;
}

.event-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

.event-card.keynote .event-title { color: var(--keynote-text); }

.event-speaker {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

/* ── Favourite ── */
.favorite {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  opacity: .3;
  transition: opacity .12s, color .12s;
}
.favorite:hover { opacity: 1; color: #d97706; }
.favorite.is-on { opacity: 1; color: #d97706; }

/* ── Session grid ── */
.session-wrap {
  display: grid;
  grid-template-columns: repeat(var(--session-count, 1), minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.session-card {
  --slot-height: 106px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  min-width: 0;
  min-height: calc(66px + (var(--slot-count, 3) * var(--slot-height)));
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: box-shadow .12s;
}

.session-card:hover {
  box-shadow: var(--shadow-sm);
}

.session-card.practitioner {
  background: var(--practitioner-bg);
  border-color: #6ee7b7;
}

.session-card.compact {
  min-height: 0;
  border-color: #fcd34d;
  background: var(--keynote-bg);
}

.session-card.compact .session-head { padding-bottom: 4px; }
.session-card.compact .talk-list { grid-template-rows: auto; }
.session-card.compact .talk-row { height: auto; min-height: 44px; padding: 8px 6px; }

.session-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.session-head h3 {
  margin-bottom: 0;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.2;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink);
}

/* ── Talk rows ── */
.talk-list {
  display: grid;
  grid-template-rows: repeat(var(--slot-count, 3), var(--slot-height));
  gap: 4px;
}

.talk-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
  height: var(--slot-height);
  padding: 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.talk-row > .favorite {
  position: absolute;
  top: 8px;
  right: 6px;
}

.talk-row:last-child { padding-bottom: 0; border-bottom: 0; }
.talk-row.is-active { background: #f9f8f4; }

.talk-row.empty-slot {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: 8px;
  background: repeating-linear-gradient(
    -45deg,
    #f9f8f5,
    #f9f8f5 7px,
    #f3f1ec 7px,
    #f3f1ec 14px
  );
  border-radius: 6px;
  opacity: .65;
}

.talk-row.empty-slot .talk-time { color: #9a958b; }

.talk-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  align-items: start;
  width: 100%;
  height: 100%;
  padding: 7px 34px 7px 6px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition: background .1s;
}

.talk-select:hover,
.talk-row.is-active .talk-select {
  background: #f4f2ec;
}

.talk-time {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.now-pip {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--practitioner-border);
  margin-right: 5px;
  flex-shrink: 0;
  animation: pip-pulse 2s ease-in-out infinite;
}

@keyframes pip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.conflict-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--keynote-bg);
  border: 1px solid var(--keynote-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--keynote-text);
  line-height: 1.5;
}

.conflict-icon { flex-shrink: 0; font-size: 14px; }

.talk-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.talk-main strong {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  max-height: 3.9em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.talk-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  max-height: 1.35em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

/* ── Cross-day search divider ── */
.day-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.day-divider-date { font-weight: 600; opacity: .75; }

/* ── Break rows (breaks, social) ── */
.break-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  color: var(--muted);
  background: 0;
  border: 0;
  text-align: left;
  font: inherit;
  cursor: default;
  width: 100%;
}

.break-row .pill { margin-left: auto; }

.break-row-time {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .01em;
}

.break-row-title {
  font-size: 13px;
  font-weight: 600;
}

button.break-row { cursor: pointer; transition: color .12s; }
button.break-row:hover { color: var(--ink); }

/* ── Social event cards ── */
.social-event-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--social-bg);
  border: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  width: 100%;
  transition: filter .12s;
}
.social-event-card .pill { margin-left: auto; }
.social-event-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.social-event-card:hover { filter: brightness(.97); }
[data-theme="dark"] .social-event-card:hover { filter: brightness(1.08); }


/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(26, 25, 23, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-overlay[hidden] { display: none; }

.modal {
  position: relative;
  width: min(580px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  transition: background .12s, color .12s;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.detail-title {
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.detail-speaker {
  margin-bottom: 2px;
  font-weight: 700;
  font-size: 15px;
}

.detail-affiliation {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
}

.detail-coauthors {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.detail-abstract {
  margin-bottom: 8px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.detail-abstract p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}
.detail-abstract p:last-child { margin-bottom: 0; }

/* ── Venue card ── */
.venue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--accent-light);
  border: 1px solid rgba(0, 99, 95, .15);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background .15s, border-color .15s;
}
.venue-card:hover {
  background: #c5e8e6;
  border-color: rgba(0, 99, 95, .3);
}

.venue-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.venue-pin-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.venue-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.venue-sub {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 1px;
}

.venue-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* ── Agenda toggle ── */
.agenda-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background .12s, color .12s, border-color .12s;
}

.agenda-toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink);
}

.agenda-toggle.is-on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.agenda-toggle.is-on:hover {
  background: #004f4b;
  border-color: #004f4b;
}

.agenda-star { font-size: 14px; line-height: 1; }

/* ── Empty state ── */
.empty-state {
  display: grid;
  align-content: center;
  min-height: 360px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 { color: var(--ink); }

/* ── Focus ── */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

#schedule { scroll-margin-top: 200px; }


/* ── Install banner ── */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.10);
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
}
.install-banner.is-visible { transform: translateY(0); }

.install-banner-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.install-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: -.5px;
}

.install-banner-body { flex: 1; min-width: 0; }
.install-banner-body > strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.install-banner-body p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.install-step {
  display: flex;
  align-items: start;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 3px;
}
.install-step-n {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  margin-top: 2px;
}
.install-safari-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.install-share-icon { vertical-align: -2px; }
.install-banner-body p svg { vertical-align: -3px; display: inline; }

.install-banner-close {
  background: 0; border: 0; padding: 4px; color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0;
}
.install-banner-close:hover { color: var(--ink); }

.install-banner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
}

.install-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}
.install-btn:hover { filter: brightness(1.08); }

.install-dismiss {
  background: 0; border: 0; padding: 0;
  font-size: 13px; color: var(--muted);
  cursor: pointer; margin-left: auto;
  text-decoration: underline; text-underline-offset: 2px;
}
.install-dismiss:hover { color: var(--ink); }

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

/* ── Responsive ── */
@media (max-width: 980px) {
  .day-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .timeline { padding: 8px; gap: 6px; }
  .time-block { grid-template-columns: 1fr; }
  .time-label { border-right: 0; border-bottom: 1px solid var(--line); }
  .event-grid { grid-template-columns: 1fr; }
  .session-wrap { grid-template-columns: 1fr; }
  .talk-select { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
}
