@font-face {
  font-family: "Barlow Condensed";
  src: url(/fonts/barlow-condensed-600.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url(/fonts/barlow-condensed-700.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #170f2e;
  --bg-2: #1e1539;
  --surface: #251b45;
  --surface-2: #31265a;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f0ff;
  --muted: #d6cff0;
  --ink: #1a1233;
  --accent: #fe9dc6;
  --warn: #ffbf5e;
  --danger: #ff6b7d;
  --live: #ff4d6d;
  --custom: #efeaff;
  --radius: 12px;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: calc(99px + var(--safe-top));
  --tabs-h: calc(62px + var(--safe-bottom));
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--ui);
  -webkit-tap-highlight-color: transparent;
}
body.sheet-open {
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}

/* ---------- Header, day switcher, tabs ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  background: rgba(23, 15, 46, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}
.brand {
  margin-right: auto;
  font: 700 25px/1 var(--display);
  white-space: nowrap;
}
.brand span {
  color: var(--accent);
}
.me-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 99px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
/* Make room for the sync badge on narrow phones: the avatar alone identifies you. */
.sync + .me-btn > span:first-child {
  display: none;
}
.sync {
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(255, 191, 94, 0.15);
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.days {
  display: flex;
  gap: 8px;
  height: 46px;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 10px;
}
.days button {
  flex: 1;
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font: 700 19px/1 var(--display);
  text-align: center;
}
.days button small {
  margin-left: 4px;
  font: 600 15px var(--display);
  opacity: 0.8;
}
.days button.on {
  background: var(--text);
  color: var(--ink);
}

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: var(--safe-bottom);
  background: rgba(23, 15, 46, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabs button {
  height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.tabs svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.tabs button.on {
  color: var(--text);
}
.tabs button.on svg {
  fill: var(--accent);
}

/* ---------- Generic pieces ---------- */

.view {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 16px calc(var(--tabs-h) + 24px);
}
.view-wide {
  max-width: none;
  padding: 12px 0 0;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
}
.seg button {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.seg button.on {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 600;
}
.btn-small {
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
}
.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--pc, var(--accent));
  color: var(--ink);
  font-size: 16px;
}
.btn-danger {
  color: var(--danger);
}
.btn:disabled {
  opacity: 0.6;
}
.link {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px 16px;
  color: var(--muted);
  text-align: center;
}
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabs-h) + 12px);
  z-index: 40;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--text);
  color: var(--ink);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Avatars: filled = must-see, dark with a colored ring = maybe. */
.av {
  --s: 20px;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--pc);
  color: var(--ink);
  font: 700 calc(var(--s) * 0.62) / 1 var(--display);
  box-shadow: 0 0 0 2px var(--ring, var(--bg));
}
.av-md {
  --s: 28px;
}
.av-lg {
  --s: 52px;
}
.av.is-maybe {
  background: var(--ink);
  color: var(--pc);
  box-shadow:
    inset 0 0 0 2px var(--pc),
    0 0 0 2px var(--ring, var(--bg));
}
.av-stack {
  display: inline-flex;
  align-items: center;
}
.av-stack .av + .av {
  margin-left: -4px;
}

.place {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.place-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--sc);
}
.place-pin {
  font-size: 9px;
  color: var(--custom);
}

.pick-btns {
  display: flex;
  gap: 4px;
}
.pick {
  min-width: 54px;
  height: 32px;
  padding: 0 8px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.pick.on {
  background: var(--pc);
  color: var(--ink);
}
.pick.maybe.on {
  background: transparent;
  border-color: var(--pc);
  color: var(--pc);
}

.level-tag {
  align-self: flex-start;
  padding: 4px 6px;
  border-radius: 5px;
  background: var(--text);
  color: var(--ink);
  font: 700 12px/1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.level-tag.maybe {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--muted);
}
.clash {
  color: var(--warn);
  font-size: 12px;
}
.clash::before {
  content: "⚠ ";
}

.group {
  margin-top: 18px;
}
.group:first-child {
  margin-top: 0;
}
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font: 700 15px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.group-head.has-color {
  color: var(--text);
}
.group-head.has-color::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--sc);
}

/* ---------- Lineup ---------- */

.lineup-tools {
  display: grid;
  gap: 10px;
}
.search {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 16px;
}
.rows {
  display: grid;
  gap: 6px;
}
.row {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--sc);
}
.row.is-picked {
  background: var(--surface-2);
}
/* Nobody has picked it: recede into the page, but keep the pick buttons at full strength. */
.row.is-unpicked {
  background: var(--bg-2);
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--sc) 35%, transparent);
}
.row.is-unpicked .row-open,
.mini.is-unpicked .mini-main {
  opacity: 0.8;
}
.mini.is-unpicked {
  background: var(--bg-2);
}
.row-open {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  padding: 10px 6px 10px 14px;
}
.row-time {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 46px;
  font: 700 18px/1.1 var(--display);
}
.row-time small,
.card-time small {
  color: var(--muted);
  font: 600 15px/1.2 var(--display);
}
.row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.row-title {
  font: 700 20px/1.08 var(--display);
  overflow-wrap: anywhere;
}
.row-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.row-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px 8px 0;
}
.day-tag {
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: 700 12px/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Plan: list ---------- */

.chips {
  display: flex;
  gap: 6px;
  margin: 0 -16px 12px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 8px;
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.chip:first-child {
  padding-left: 12px;
}
.chip.on {
  background: var(--text);
  color: var(--ink);
  --ring: var(--text);
}
.cards {
  display: grid;
  gap: 8px;
}
.card {
  width: 100%;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--sc);
}
.card.is-custom {
  box-shadow:
    inset 4px 0 0 var(--custom),
    inset 0 0 0 1px rgba(239, 234, 255, 0.25);
}
.card-time {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 46px;
  font: 700 19px/1.1 var(--display);
}
.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-title {
  font: 700 22px/1.08 var(--display);
  overflow-wrap: anywhere;
}
.card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.card .av-stack {
  margin-top: 4px;
}
.meanwhile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.meanwhile-label {
  color: var(--warn);
  font: 700 12px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meanwhile-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meanwhile-item .av-stack {
  margin: 0;
}

/* ---------- Plan: timeline (one lane per person) ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--accent);
}
.legend-swatch.is-maybe {
  margin-left: 6px;
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(23, 15, 46, 0.5) 3px 6px);
}
.tl {
  --axis: 30px;
}
.tl-head {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  display: grid;
  grid-template-columns: var(--axis) repeat(var(--lanes), 1fr);
  gap: 3px;
  margin: 0 -16px;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.tl-person {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}
.tl-person span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-person.is-me span:last-child {
  color: var(--text);
  font-weight: 700;
}
.tl-body {
  position: relative;
  margin-top: 10px;
}
.tl-hour {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
}
.tl-hour span {
  position: absolute;
  top: 3px;
  left: 0;
  color: var(--muted);
  font: 600 13px/1 var(--display);
}
.tl-lanes {
  position: absolute;
  inset: 0 0 0 var(--axis);
  display: grid;
  grid-template-columns: repeat(var(--lanes), 1fr);
  gap: 3px;
}
.tl-lane {
  position: relative;
}
.tl-block {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  padding: 3px 4px;
  border-radius: 6px;
  background-color: var(--sc);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(23, 15, 46, 0.7);
}
.tl-block.is-maybe {
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(23, 15, 46, 0.3) 6px 12px);
}
.tl-block.is-custom {
  background-color: var(--custom);
  outline: 2px dashed rgba(23, 15, 46, 0.45);
  outline-offset: -4px;
}
.tl-title {
  font: 700 13px/1.05 var(--display);
  overflow-wrap: break-word;
  hyphens: auto;
}
/* Clashing picks share a lane side by side; run their names vertically so they stay legible. */
.tl-block.is-split {
  align-items: center;
  padding: 4px 1px;
}
.tl-block.is-split .tl-title {
  max-height: 100%;
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  writing-mode: vertical-rl;
}
.tl-block.is-split .tl-place {
  display: none;
}
.tl-place {
  font-size: 10px;
  line-height: 1.1;
  opacity: 0.75;
}
.tl-block.is-short:not(.is-split) .tl-title {
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.now-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  height: 2px;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
}

/* ---------- Grid (by stage) ---------- */

.grid-legend {
  max-width: 760px;
  margin: 0 auto 10px;
  padding: 0 16px;
}
.legend-swatch.is-unpicked {
  margin-left: 8px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.legend-swatch.is-yours {
  margin-left: 8px;
  outline: 2px solid var(--ink);
  outline-offset: -4px;
}
.grid-scroll {
  height: calc(100vh - var(--header-h) - var(--tabs-h) - 42px);
  height: calc(100dvh - var(--header-h) - var(--tabs-h) - 42px);
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
}
.grid {
  --col: 118px;
  position: relative;
  width: calc(var(--axis) + var(--col) * var(--stages));
  padding-bottom: 16px;
}
.grid-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  background: var(--bg);
}
.grid-corner {
  position: sticky;
  left: 0;
  z-index: 7;
  flex: none;
  width: var(--axis);
  background: var(--bg);
}
.grid-stage {
  flex: none;
  width: calc(var(--col) - 4px);
  margin: 6px 2px;
  padding: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--sc);
  color: var(--ink);
  font: 700 15px/1 var(--display);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.grid-body {
  position: relative;
  display: flex;
}
.grid-axis {
  position: sticky;
  left: 0;
  z-index: 5;
  flex: none;
  width: var(--axis);
  background: var(--bg);
}
.grid-axis span {
  position: absolute;
  left: 6px;
  margin-top: 3px;
  color: var(--muted);
  font: 600 13px/1 var(--display);
}
.grid-line {
  position: absolute;
  left: var(--axis);
  right: 0;
  border-top: 1px solid var(--line);
}
.grid-col {
  position: relative;
  flex: none;
  width: var(--col);
}
.grid-block {
  --ring: var(--sc);
  position: absolute;
  left: 2px;
  right: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  padding: 5px 6px;
  border-radius: 7px;
  background: var(--sc);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(23, 15, 46, 0.7);
}
/* Inset from the edge so it reads as a frame, not as a thicker gap between sets. */
.grid-block.is-must {
  outline: 3px solid var(--ink);
  outline-offset: -6px;
}
.grid-block.is-maybe {
  outline: 3px dashed var(--ink);
  outline-offset: -6px;
}
.grid-block.is-mine {
  padding: 8px 9px;
}
/* Nobody's going: a dark tint of the stage color, so the group's picks stand out. */
.grid-block.is-unpicked {
  background: var(--surface);
  background: color-mix(in srgb, var(--sc) 15%, var(--bg));
  color: rgba(244, 240, 255, 0.85);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc) 30%, transparent);
}
.grid-title {
  font: 700 15px/1.05 var(--display);
  overflow-wrap: anywhere;
}
.grid-time {
  font-size: 11px;
  opacity: 0.75;
}
.grid-block .av-stack {
  margin-top: auto;
}

/* ---------- Map ---------- */

.site-map-link {
  display: block;
}
.site-map {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.map-hint {
  margin-top: 10px;
  text-align: center;
}

/* ---------- Now ---------- */

.banner {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2d2058, #46204f);
}
.banner-big {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font: 700 34px/1 var(--display);
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(255, 77, 109, 0);
  }
}
.crew {
  display: grid;
  gap: 8px;
}
.crew-card {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--pc);
}
.crew-who {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-weight: 700;
}
.slot {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
}
.slot + .slot {
  border-top: 1px solid var(--line);
}
.slot-label {
  flex: none;
  width: 58px;
  color: var(--muted);
  font: 700 13px/1.6 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.slot-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slot-title {
  font: 700 20px/1.1 var(--display);
}
.slot-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.slot-empty {
  font-size: 14px;
}

.mini-list {
  display: grid;
  gap: 6px;
}
.mini {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
}
.mini-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mini-title {
  font: 700 18px/1.1 var(--display);
}
.mini-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Sheets ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 4, 20, 0.65);
  animation: fade 0.15s ease-out;
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px calc(24px + var(--safe-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--bg-2);
  animation: rise 0.2s ease-out;
}
@media (min-width: 600px) {
  .sheet-backdrop {
    align-items: center;
  }
  .sheet {
    border-radius: 18px;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    transform: translateY(48px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet-backdrop,
  .live-dot {
    animation: none;
  }
}
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 14px;
}
.sheet-head {
  margin: -20px -16px 16px;
  padding: 22px 56px 16px 16px;
  border-radius: 18px 18px 0 0;
  background: var(--sc, var(--custom));
  color: var(--ink);
}
.sheet-head.is-custom {
  background: var(--custom);
}
.sheet-head .place {
  font-size: 14px;
  font-weight: 700;
}
.sheet-head .place-dot {
  display: none;
}
.sheet-head .place-pin {
  color: var(--ink);
}
.sheet-title {
  margin: 4px 0;
  padding-right: 40px;
  font: 700 32px/1.05 var(--display);
  overflow-wrap: anywhere;
}
.sheet-head .sheet-title {
  padding-right: 0;
}
.sheet-when {
  font-size: 14px;
  opacity: 0.8;
}
.choice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.choice button {
  height: 46px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}
.choice button.on {
  background: var(--pc);
  color: var(--ink);
}
.choice button:last-child.on {
  background: var(--text);
}
.warn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 191, 94, 0.12);
  color: var(--warn);
  font-size: 14px;
}
.warn .link {
  text-align: left;
}
.sheet-section {
  margin-top: 18px;
}
.sheet-section h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font: 700 14px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sheet .mini {
  background: var(--surface);
}
.who {
  display: grid;
  gap: 10px;
}
.who li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.who-level {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
.who-level.must {
  color: var(--text);
  font-weight: 600;
}
.note {
  margin-bottom: 6px;
  white-space: pre-wrap;
}
.row-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- Forms, login, person picker ---------- */

.form {
  display: grid;
  gap: 12px;
}
.form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
}
.form textarea {
  resize: vertical;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-error {
  color: var(--danger);
  font-size: 14px;
}
.gate {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(32px + var(--safe-top)) 24px calc(32px + var(--safe-bottom));
}
.gate-title {
  font: 700 52px/1 var(--display);
}
.gate-title span {
  color: var(--accent);
}
.gate-form {
  margin-top: 20px;
}
.form input.pin-input {
  height: 64px;
  font: 700 34px/1 var(--display);
  letter-spacing: 0.5em;
  text-align: center;
  text-indent: 0.5em; /* balance the trailing letter-spacing so dots sit centered */
}
.me-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 40px;
  --ring: var(--bg-2);
}
.logout {
  width: 100%;
  margin-top: 20px;
}
