:root {
  color-scheme: light;
  --bg: #f6f5ef;
  --paper: #fffdf8;
  --ink: #161814;
  --muted: #687068;
  --line: #ddd8cc;
  --line-strong: #c9c1b4;
  --time-bg: #fff8e3;
  --room-bg: #eef6f2;
  --track-it: #0f766e;
  --track-unplugged: #a9412b;
  --track-other: #5f5f6f;
  --shadow: 0 18px 50px rgba(22, 24, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0) 260px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  padding: 18px clamp(14px, 4vw, 32px) 14px;
  background: rgba(246, 245, 239, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar > div:first-child {
  min-width: 0;
}

.eyebrow,
.venue,
.summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.eyebrow {
  color: #7b4f12;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 2px 0 3px;
  font-size: clamp(1.36rem, 4vw, 2.05rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.summary {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 116px;
}

.summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  white-space: nowrap;
}

.page {
  width: min(100%, 1420px);
  margin: 0 auto;
  padding: 12px clamp(8px, 2.5vw, 28px) 28px;
}

.agenda-panel {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.agenda-scroll {
  overflow: auto;
  max-height: calc(100dvh - 112px);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.agenda-grid {
  --time-col: 72px;
  --room-col: minmax(154px, 1fr);
  display: grid;
  min-width: calc(var(--time-col) + (var(--room-count) * 154px));
  grid-template-columns: var(--time-col) repeat(var(--room-count), var(--room-col));
  grid-template-rows: 54px repeat(var(--slot-count), minmax(62px, auto));
  background: var(--line);
}

.corner,
.room-header,
.time-cell,
.lane-cell {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: var(--time-bg);
  color: #7b4f12;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.room-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  padding: 10px 11px;
  background: var(--room-bg);
}

.room-header strong {
  display: -webkit-box;
  overflow: hidden;
  color: #18372f;
  font-size: 0.78rem;
  line-height: 1.12;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.time-cell {
  position: sticky;
  left: 0;
  z-index: 7;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 9px 5px;
  background: var(--time-bg);
  color: #3f3321;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.lane-cell {
  min-height: 62px;
  background: rgba(255, 253, 248, 0.72);
}

.session-card {
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% - 10px);
  min-height: 48px;
  margin: 5px;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.26);
  border-left: 5px solid var(--track-it);
  border-radius: 8px;
  background: #f0fbf8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.session-card[data-track="unplugged"] {
  border-color: rgba(169, 65, 43, 0.25);
  border-left-color: var(--track-unplugged);
  background: #fff3ec;
  box-shadow: 0 8px 20px rgba(169, 65, 43, 0.08);
}

.session-card[data-track="other"] {
  border-color: rgba(95, 95, 111, 0.25);
  border-left-color: var(--track-other);
  background: #f5f5fb;
}

.session-card:hover,
.session-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(22, 24, 20, 0.28);
  box-shadow: 0 12px 28px rgba(22, 24, 20, 0.14);
  outline: none;
}

.session-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.session-dialog {
  width: min(92vw, 640px);
  max-height: min(82dvh, 720px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.session-dialog::backdrop {
  background: rgba(22, 24, 20, 0.48);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.dialog-meta {
  max-width: calc(100% - 42px);
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.session-dialog h2 {
  margin: 0 0 14px;
  font-size: clamp(1.28rem, 6vw, 1.9rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.session-dialog p {
  margin: 0;
  color: #31352f;
  font-size: 1rem;
  line-height: 1.55;
}

.speakers-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.speakers-block h3 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.speakers-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.speakers-block li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.35;
}

.speaker-name {
  display: block;
  font-weight: 850;
}

.speaker-org {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 12px 12px;
  }

  .summary {
    max-width: none;
    gap: 5px;
    justify-content: flex-start;
  }

  .summary span {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 0.72rem;
  }

  .page {
    padding: 8px 0 18px;
  }

  .agenda-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .agenda-scroll {
    max-height: calc(100dvh - 94px);
  }

  .agenda-grid {
    --time-col: 62px;
    min-width: calc(var(--time-col) + (var(--room-count) * 148px));
    grid-template-columns: var(--time-col) repeat(var(--room-count), minmax(148px, 1fr));
    grid-template-rows: 50px repeat(var(--slot-count), minmax(58px, auto));
  }

  .room-header {
    padding: 8px;
  }

  .time-cell {
    padding-top: 8px;
    font-size: 0.76rem;
  }

  .lane-cell {
    min-height: 58px;
  }

  .session-card {
    width: calc(100% - 8px);
    margin: 4px;
    padding: 8px;
  }

  .session-title {
    font-size: 0.75rem;
    -webkit-line-clamp: 4;
  }

  .session-dialog {
    width: calc(100vw - 20px);
    padding: 20px;
  }
}
