/* Layout: "mark your calendar" poster. Black year band, then month columns
   split by hairline rules: mini calendar on top, event list below. */
:root {
  --band: #0E0E0E;
  --band-ink: #FFFFFF;
  --bg: #FFFFFF;
  --ink: #111111;
  --muted: #5C5C5C;
  --rule: #D9D9D9;
  --tint: #F2F2F2;
  --hosted: #C41E3A;       /* crimson text */
  --hosted-fill: #C41E3A;  /* crimson behind white numerals */
  --attend: #A9D9E0;
  --attend-ink: #0E3A40;
  --backdrop: rgba(14, 14, 14, .62);
  --booth: #F2B53A;        /* amber: events where we run a booth */
  --booth-ink: #3D2800;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gutter-x: clamp(16px, 4vw, 40px);
  --radius: 3px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414; --ink: #F2F2F2; --muted: #A8A8A8; --rule: #333333; --tint: #1F1F1F;
    --hosted: #E5485F; --hosted-fill: #C41E3A;
    --attend: #2C5E66; --attend-ink: #E6F6F8;
    --backdrop: rgba(0, 0, 0, .72);
    --booth: #8A5A00; --booth-ink: #FFF4DC;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --ink: #F2F2F2; --muted: #A8A8A8; --rule: #333333; --tint: #1F1F1F;
  --hosted: #E5485F; --hosted-fill: #C41E3A;
  --attend: #2C5E66; --attend-ink: #E6F6F8;
  --backdrop: rgba(0, 0, 0, .72);
  --booth: #8A5A00; --booth-ink: #FFF4DC;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html.locked { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap {
  max-width: 1280px;
  margin-inline: auto;
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
}

/* Ruled strips: same content edge as .wrap, but rules stop at the gutter */
.inset {
  width: calc(100% - max(var(--gutter-x), env(safe-area-inset-left, 0px)) - max(var(--gutter-x), env(safe-area-inset-right, 0px)));
  max-width: calc(1280px - 2 * var(--gutter-x));
  margin-inline: auto;
}

/* Header band */
.band { background: var(--band); color: var(--band-ink); }
.band-inner {
  display: flex; align-items: flex-end; flex-wrap: wrap;
  gap: 4px clamp(14px, 2.4vw, 32px);
  padding-block: clamp(20px, 3vw, 36px) clamp(18px, 2.6vw, 30px);
}
.year {
  font-weight: 800;
  font-size: clamp(84px, 14.5vw, 168px);
  line-height: .78;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.qt { display: flex; flex-direction: column; padding-bottom: .1em; }
.q { font-weight: 300; font-size: clamp(40px, 6.4vw, 84px); line-height: .85; letter-spacing: -.02em; }
.title { font-weight: 700; font-size: clamp(18px, 2.3vw, 30px); line-height: 1.15; letter-spacing: -.01em; }

/* Sign-in gate: until someone signs in, the gate is the only thing on the page */
body.signed-out > :not(.gate) { display: none; }
body:not(.signed-out) > .gate { display: none; }
.gate {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center;
  overflow: hidden;
  /* Always light, whatever the system theme: the welcome page uses fixed colours */
  background:
    radial-gradient(48% 55% at 84% 30%, rgba(196, 30, 58, .16), transparent 70%),
    radial-gradient(50% 60% at 60% 78%, rgba(169, 217, 224, .6), transparent 72%),
    #FAF8F6;
  color: #111111;
}
.gate-inner {
  width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: clamp(24px, 5vw, 80px);
  padding-block: 48px;
}
.gate-title {
  font-weight: 800;
  font-size: clamp(44px, 6.6vw, 92px);
  line-height: .9;
  letter-spacing: -.035em;
}
.gate-lead { max-width: 44ch; margin-top: 18px; font-size: 19px; color: #5C5C5C; }
.gate-features { margin-top: 26px; display: grid; gap: 12px; font-size: 17px; }
.gate-features li { display: flex; align-items: flex-start; gap: 12px; }
.gate-features li::before {
  content: ""; flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
  background: var(--hosted-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.gate-button { width: fit-content; margin-top: 32px; min-height: 44px; }
.gate-hint { margin-top: 10px; font-size: 14px; color: #5C5C5C; }
.gate-msg {
  max-width: 52ch; margin-top: 20px; padding-left: 12px;
  border-left: 3px solid var(--hosted-fill);
  font-size: 15px;
}

/* Welcome art: two tilted cards in the calendar's own colours (fixed, so they look the same in dark mode) */
.gate-art { position: relative; height: clamp(320px, 38vw, 480px); }
.g-card {
  position: absolute; padding: 18px; border-radius: 18px;
  background: #FFFFFF; color: #111111;
  box-shadow: 0 24px 56px rgba(17, 17, 17, .14), 0 2px 6px rgba(17, 17, 17, .06);
}
.g-cal {
  left: 2%; top: 4%; width: min(62%, 320px); rotate: -6deg;
  display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px;
  font-size: 13px; text-align: center; font-variant-numeric: tabular-nums;
}
.g-cal b { padding-bottom: 6px; font-size: 11px; font-weight: 700; color: #5C5C5C; }
.g-cal span { aspect-ratio: 1; display: grid; place-items: center; }
.g-cal .h { background: #C41E3A; color: #FFFFFF; font-weight: 700; }
.g-cal .a { background: #A9D9E0; color: #0E3A40; font-weight: 700; }
.g-cal .gs { border-radius: 7px 0 0 7px; }
.g-cal .ge { border-radius: 0 7px 7px 0; }
.g-cal .gs.ge { border-radius: 7px; }
.g-event {
  right: 2%; bottom: 3%; width: min(56%, 280px); rotate: 5deg;
  display: flex; flex-direction: column; gap: 10px;
}
.g-tag {
  align-self: flex-start; padding: 3px 9px; border-radius: 999px;
  background: #C41E3A; color: #FFFFFF;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.g-line { display: block; height: 10px; border-radius: 5px; background: #E4E4E4; }
.g-line-lg { width: 86%; height: 16px; border-radius: 6px; background: #111111; }
.g-line-md { width: 56%; }
.g-head {
  margin-top: 6px; padding-top: 12px; border-top: 1px solid #E4E4E4;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5C5C5C;
}
.g-row { display: flex; align-items: center; gap: 10px; }
.g-row i { flex: none; width: 36px; height: 10px; border-radius: 5px; background: #A9D9E0; }
.g-row .g-line { flex: 1; }
.g-badge {
  position: absolute; border-radius: 50%; border: 5px solid #FFFFFF;
  box-shadow: 0 10px 24px rgba(17, 17, 17, .18);
}
.g-badge-check {
  right: 12%; top: 6%; width: 60px; height: 60px;
  background: #C41E3A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.g-badge-dot {
  left: 6%; bottom: 10%; width: 46px; height: 46px;
  background: radial-gradient(circle, #3D2800 0 5px, transparent 5.5px) #F2B53A;
}
@media (prefers-reduced-motion: no-preference) {
  .g-cal { animation: g-float 7s ease-in-out infinite; }
  .g-event { animation: g-float 8s ease-in-out -3s infinite; }
  .g-badge { animation: g-float 6s ease-in-out -1.5s infinite; }
}
@keyframes g-float { 50% { translate: 0 -10px; } }
@media (max-width: 799px) {
  .gate { align-items: flex-start; }
  .gate-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 32px 40px; }
  .gate-art { order: -1; width: 100%; max-width: 420px; height: 340px; margin-inline: auto; }
  .g-card { padding: 14px; border-radius: 16px; }
  .g-cal { width: 58%; font-size: 11px; }
  .g-event { width: 50%; }
  .g-badge-check { right: 6%; top: 10%; width: 50px; height: 50px; background-size: 22px; }
  .g-badge-dot { left: 12%; bottom: 0; }
}

/* Intro + legend */
.intro {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 32px;
  padding-block: 18px;
  font-size: 15px;
  color: var(--muted);
}
.intro p { max-width: 62ch; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink); font-size: 14px; font-weight: 500; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 2px; flex: none; }
.sw.hosted { background: var(--hosted-fill); }
.sw.attending { background: var(--attend); }

/* Filters */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 14px 28px;
  padding-block: 16px 20px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.fgroup { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.flabel {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg); cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fsearch { flex: 1 1 240px; max-width: 360px; }
.fsearch input {
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg);
}
.fsearch input:hover { border-color: var(--muted); }
.fsearch input::placeholder { color: var(--muted); }
.clear, .linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); font-size: 14px; font-weight: 700;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.clear { min-height: 40px; }
.clear:hover, .linkbtn:hover { color: var(--hosted); }

/* Month columns */
.months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-block: 28px 40px;
}
.month { min-width: 0; padding-inline: clamp(20px, 2.2vw, 32px); border-left: 1px solid var(--rule); }
.month:first-child { padding-left: 0; border-left: 0; }
.month:last-child { padding-right: 0; }
.mhead {
  font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.02em;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
.mhead .sl { font-weight: 300; color: var(--muted); letter-spacing: -.08em; margin-inline: .04em .1em; }

/* Mini calendar */
.cal {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 4px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.cal th {
  font-size: 12px; font-weight: 700; color: var(--muted);
  padding-bottom: 4px;
}
.cal th abbr { text-decoration: none; }
.cal td { padding: 0; height: 38px; text-align: center; font-size: 14px; }
.cal .d {
  display: grid; place-items: center;
  width: 100%; height: 38px;
  position: relative;
  border: 0; background: none; padding: 0;
}
.cal .n {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
}
.cal td.today .n { box-shadow: 0 0 0 2px var(--ink); font-weight: 700; }
.cal td.sh { font-weight: 700; }
.cal td.hosted { --fill: var(--hosted-fill); background: var(--fill); color: #FFFFFF; }
.cal td.attending { --fill: var(--attend); background: var(--fill); color: var(--attend-ink); }
/* overlap neighbours by 1px so sub-pixel cell widths never leave a seam in a run */
.cal td.sh:not(.re) { box-shadow: 1px 0 0 var(--fill); }
.cal td.rs { border-top-left-radius: 19px; border-bottom-left-radius: 19px; }
.cal td.re { border-top-right-radius: 19px; border-bottom-right-radius: 19px; }
.cal td.sh .d { cursor: pointer; border-radius: inherit; }
.cal td.sh .d:focus-visible { outline-offset: -2px; outline-color: var(--ink); }
.cal td.hosted .d:focus-visible { outline-color: #FFFFFF; }
.cal td.sh.today .n { box-shadow: 0 0 0 2px currentColor; }
.cal .dot {
  position: absolute; left: 50%; bottom: 3px;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: currentColor;
}
.cal td.sh:hover .n,
.cal td.hl .n { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cal td.hl { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .28); }
.cal td.hl:not(.re) { box-shadow: 1px 0 0 var(--fill), inset 0 -3px 0 rgba(0, 0, 0, .28); }

/* Event list */
.events li + li .row { border-top: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px;
  width: 100%; padding: 14px 8px; margin: 0;
  border: 0; background: none; text-align: left; cursor: pointer;
  border-radius: 0;
  transition: background-color .15s;
}
.row:hover, .row.hl { background: var(--tint); }
.when { font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.35; }
.when small { display: block; font-size: 13px; }
.what { display: flex; flex-direction: column; min-width: 0; }
.name { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.loc { font-size: 14px; }
.pic { font-size: 13px; color: var(--muted); }
.part { font-size: 13px; font-weight: 500; }
.row.hosted .when, .row.hosted .name { color: var(--hosted); }
.empty { color: var(--muted); font-size: 15px; padding: 12px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  padding-block: 18px 32px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--rule);
}
.foot .linkbtn { font-size: inherit; color: var(--ink); }
.foot-info { display: flex; flex-direction: column; gap: 2px; }
.foot .help a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.foot .help a:hover { color: var(--hosted); }
.status { grid-column: 1 / -1; color: var(--muted); }

/* Event card */
.card {
  width: min(640px, calc(100% - 32px));
  max-width: 640px;
  max-height: calc(100dvh - 64px);
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--bg); color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.card[open] { display: flex; flex-direction: column; animation: card-in .18s ease-out; }
.card::backdrop { background: var(--backdrop); }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.card-bar {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: flex-end; align-items: center;
  height: 52px; padding-right: 6px;
  background: var(--bg);
  border-top: 6px solid var(--stripe, var(--ink));
}
.card.hosted { --stripe: var(--hosted-fill); }
.card.attending { --stripe: var(--attend); }
.x {
  display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: none; cursor: pointer; color: var(--ink);
}
.x:hover { background: var(--tint); }
.card-main { padding: 0 28px 28px; display: flex; flex-direction: column; gap: 22px; }
.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px;
}
.kicker .type { color: var(--ink); }
.card.hosted .kicker .type { color: var(--hosted); }
.card h2 { font-size: clamp(24px, 4vw, 30px); font-weight: 800; line-height: 1.12; letter-spacing: -.015em; text-wrap: balance; }
.facts { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 15px; }
.facts dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .linkbtn { font-size: 15px; text-align: left; }
.sec h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.booths li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 2px 14px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.booths li:first-child { border-top: 1px solid var(--rule); }
.booths li.no-num { grid-template-columns: minmax(0, 1fr); font-weight: 700; }
.booths .bn { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--booth-ink); background: var(--booth); border-radius: 3px; padding: 0 6px; justify-self: start; }
.booth-tag {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  margin-block: 3px 2px; padding: 1px 8px 1px 6px; border-radius: 3px;
  background: var(--booth); color: var(--booth-ink);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.5;
  text-transform: none; font-variant-numeric: tabular-nums;
}
.booth-tag svg { flex: none; }
/* Grey sibling of the booth tag: this event has material links */
.mat-tag {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  margin-block: 3px 2px; padding: 0 8px 0 6px; border-radius: 3px;
  border: 1px solid var(--rule); background: var(--tint); color: var(--ink);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.mat-tag svg { flex: none; }
.row .mat-tag:hover { border-color: var(--ink); }
.legend .mat-tag { margin: 0; }
.kicker .booth-tag { margin: 0 0 0 4px; letter-spacing: .02em; }
.legend .booth-tag { margin: 0; }
.pics { display: flex; flex-wrap: wrap; gap: 6px; }
.pics li { padding: 4px 12px; border-radius: 999px; background: var(--tint); border: 1px solid var(--rule); font-size: 14px; font-weight: 500; }
.notes { font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.sched-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.sched-head h3 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; text-transform: none; color: var(--ink); margin: 0; }
.sched-head:empty { display: none; }
.source { font-size: 13px; color: var(--muted); }
.source a { color: var(--ink); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.source a:hover { color: var(--hosted); }
.day { margin-top: 16px; }
.day h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.items li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 2px 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.items .t { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.items .ti { font-weight: 500; }
.items .pl { display: block; font-size: 13px; color: var(--muted); }
.tbc {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 3px;
  background: var(--tint); border: 1px solid var(--rule); color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; vertical-align: 2px;
}

/* Agenda / Materials tabs */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--rule); }
.tab {
  min-height: 44px; margin-bottom: -1px; padding: 8px 0; border: 0; border-bottom: 3px solid transparent;
  background: none; cursor: pointer;
  font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab .n { font-weight: 500; font-size: 15px; }
.panel { padding-top: 16px; }
.panel .day:first-child { margin-top: 0; }
.panel-empty { font-size: 15px; color: var(--muted); }
.mat-group + .mat-group { margin-top: 20px; }
.mat-group h4 { margin: 0 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); font-size: 14px; font-weight: 700; }
.mat-group h4 .n { font-weight: 500; color: var(--muted); }
.mats a {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--rule);
  font-size: 15px; font-weight: 500; color: inherit; text-decoration: none;
}
.mats .lbl { overflow-wrap: anywhere; }
.mats .src { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.mats a:hover .lbl { text-decoration: underline; text-underline-offset: 3px; }
.mats a:hover .src { color: var(--hosted); }

/* Editing material links (editors only) */
.btn {
  min-height: 40px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: 999px;
  background: none; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--tint); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .85; }
.btn.danger { border-color: var(--hosted-fill); background: var(--hosted-fill); color: #FFFFFF; }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
}
.iconbtn:hover { background: var(--tint); color: var(--ink); }
.mats li.editable { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--rule); }
.mats li.editable a { flex: 1; min-width: 0; border-bottom: 0; }
.mat-actions { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.mat-actions.confirm { gap: 8px; font-size: 13px; font-weight: 700; }
.add-mat { margin-top: 18px; }
.panel-empty + .add-mat { margin-top: 14px; }
.mat-form { margin-top: 20px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--tint); }
.mat-form h4 { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.mat-row { position: relative; display: grid; grid-template-columns: 11em minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.mat-row + .mat-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); padding-right: 40px; }
.mat-row .row-x { position: absolute; right: 0; bottom: 2px; }
.mat-row label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mat-row label > span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mat-row label small { font-weight: 500; letter-spacing: 0; text-transform: none; }
.mat-row input, .mat-row select {
  width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.mat-form .linkbtn { margin-top: 12px; }
.form-msg { margin-top: 12px; padding-left: 10px; border-left: 3px solid var(--hosted-fill); font-size: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.form-hint { margin-top: 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 699px) {
  .mat-row { grid-template-columns: minmax(0, 1fr); }
  .mat-row input, .mat-row select { font-size: 16px; } /* under 16px, iPhone zooms the page when a field is tapped */
  .mats li.editable { flex-wrap: wrap; }
  .mat-actions.confirm { width: 100%; justify-content: flex-end; padding-bottom: 8px; }
}

/* Chooser */
.chooser { width: min(420px, calc(100% - 32px)); }
.chooser .card-bar { border-top-color: var(--ink); justify-content: space-between; padding-left: 24px; }
.chooser .card-bar h2 { font-size: 16px; font-weight: 800; }
.chooser ul { padding: 0 12px 16px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 10px 12px; border: 0; border-radius: var(--radius);
  background: none; text-align: left; cursor: pointer; font-weight: 700;
}
.choice:hover { background: var(--tint); }
.choice.hosted { color: var(--hosted); }

/* Responsive */
@media (max-width: 1099px) {
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .month:nth-child(odd) { padding-left: 0; border-left: 0; }
  .month:nth-child(even) { padding-right: 0; }
  .month:nth-child(n+3) { padding-top: 28px; border-top: 1px solid var(--rule); }
  .month:nth-child(3) { padding-right: clamp(20px, 2.2vw, 32px); }
}
@media (max-width: 699px) {
  .months { grid-template-columns: minmax(0, 1fr); row-gap: 32px; padding-top: 24px; }
  .month { padding-inline: 0 !important; border-left: 0; }
  .month + .month { padding-top: 28px; border-top: 1px solid var(--rule); }
  .fsearch { max-width: none; flex-basis: 100%; }
  .card {
    width: 100%; max-width: none; height: 100%; max-height: none;
    margin: 0; border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .chooser { height: auto; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; }
  .card-main { padding: 0 max(18px, env(safe-area-inset-right, 0px)) 28px max(18px, env(safe-area-inset-left, 0px)); }
  .items li { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd + dt { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Keep booth numbers like CA13-04 on one line */
.nw { white-space: nowrap; }
