/*
 * Colours borrowed from woodstock.at (black, #1F1F1F, gold #AB9962, olive
 * #786C44, brown #342E1D). Their brand fonts are licensed, and this app
 * loads no webfonts anyway: a system serif stands in for the display face,
 * the system sans for the body.
 */
:root {
  --bg: #0b0b0a;
  --surface: #1f1f1f;
  --surface-2: #2a2824;
  --line: #34312b;
  --text: #f4f1ea;
  --muted: #a39d90;
  --gold: #ab9962;
  --gold-strong: #c7b47a;
  --gold-ink: #141311;
  --olive: #786c44;
  --brown: #342e1d;
  --live: #6fc28b;
  --danger: #ff7d6e;
  --danger-soft: #3b1d19;
  --warn: #e9b44c;
  --warn-soft: #382a10;
  --shadow: 0 1px 0 rgb(255 255 255 / .03) inset;
  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --safe-top: max(env(safe-area-inset-top), 10px);
  --safe-bottom: max(env(safe-area-inset-bottom), 8px);
  --max: 760px;
  /* Measured by app.js; sane values before the first measurement. */
  --top-h: 104px;
  --tabs-h: 72px;
  /* Translucent chrome: content scrolls underneath. */
  --chrome: color-mix(in srgb, var(--bg) 72%, transparent);
  --hairline: color-mix(in srgb, var(--text) 12%, transparent);
  --press: scale(.97);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f5f3ee;
    --surface-2: #ebe7dc;
    --line: #e1dccf;
    --text: #111110;
    --muted: #636363;
    --gold: #786c44;        /* olive reads as gold on white with real contrast */
    --gold-strong: #5f5534;
    --gold-ink: #ffffff;
    --brown: #f1ebdb;
    --live: #1c7a45;
    --danger: #b3261e;
    --danger-soft: #fbe4e1;
    --warn: #8a5a00;
    --warn-soft: #fbefd4;
    --shadow: none;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

/* iOS: take the base size from the user's text size setting (Dynamic
   Type); everything else is in rem and scales with it. */
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; }
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
body { font: 1rem/1.45 var(--sans); }

/* Tap-heavy UI: no iOS selection/callout bar, no double-tap zoom delay. */
.app, .sheet, .banner {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
input, textarea, .selectable { -webkit-user-select: text; user-select: text; }

button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.eyebrow, .sheet-section h3, .section-title {
  font-size: 0.7188rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}

/* ---------- Layout: the page never scrolls, the pane does ----------
 * Header and tab bar float above the pane as a translucent material, so
 * content scrolls underneath them instead of being cut off at a hard edge. */

.app { position: relative; height: 100dvh; overflow: hidden; }

.top, .tabs {
  position: absolute; left: 0; right: 0; z-index: 20;
  background: var(--chrome);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
}
.top {
  top: 0;
  padding: var(--safe-top) 12px 0;
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 200ms ease;
}
/* Scroll edge: the hairline only appears once content is actually under it. */
.app[data-scrolled] .top { box-shadow: 0 1px 0 var(--hairline); }
.top-row { display: flex; align-items: center; gap: 4px; max-width: var(--max); margin: 0 auto; }
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; font: 600 1.25rem/1.1 var(--serif); letter-spacing: -0.01em; }
.brand-sub { font-size: 0.7188rem; line-height: 1.25; color: var(--muted); margin-top: 1px; }
.status { font: 400 0.7188rem/1 var(--sans); letter-spacing: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; vertical-align: 1px; }
.status.offline .dot { background: var(--warn); }
.icon-btn {
  position: relative; flex: none;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; text-decoration: none; font-size: 1.4375rem; color: var(--text);
}
.icon-btn[aria-current="page"] { color: var(--gold); }
.dot-badge {
  position: absolute; top: 7px; right: 7px;
  min-width: 1.0625rem; height: 1.0625rem; padding: 0 4px;
  border-radius: 99px; background: var(--gold); color: var(--gold-ink);
  font: 700 0.6562rem/1.0625rem var(--sans); text-align: center;
}
.disclaimer {
  max-width: var(--max); margin: 4px auto 0; padding: 0 0 6px;
  font-size: 0.6875rem; line-height: 1.35; color: var(--muted);
}
.disclaimer a { color: var(--gold); }

.pane {
  position: absolute; inset: 0;
  padding-top: var(--top-h);
  padding-bottom: calc(var(--tabs-h) + 8px);
  scroll-padding-top: var(--top-h);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  outline: none;
}
.pane {
  /* The centred content column lives on the scroll container itself, so
     children may keep their own horizontal margins and still line up. */
  padding-inline: max(0px, calc((100% - var(--max)) / 2));
}

.tabs {
  bottom: 0;
  display: flex; justify-content: center; gap: 2px;
  padding: 6px 6px var(--safe-bottom);
  box-shadow: 0 -1px 0 var(--hairline);
}
.tabs a {
  flex: 1; max-width: 160px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; min-height: 52px;
  border-radius: 12px; text-decoration: none;
  font-size: 0.7188rem; color: var(--muted);
}
.tabs a svg { font-size: 1.5rem; }
.tabs a[aria-current="page"] { color: var(--gold); font-weight: 600; }
.tabs a .count {
  font-size: 0.625rem; font-weight: 700;
  background: var(--gold); color: var(--gold-ink);
  border-radius: 99px; padding: 0 5px; margin-left: 3px;
}
.tabs a .count.bad { background: var(--danger); color: #fff; }

/* ---------- Controls ---------- */

.controls {
  /* Sticky offsets count from inside the pane's padding, which already
     makes room for the header. */
  position: sticky; top: 0; z-index: 5;
  padding: 10px 16px 8px;
  /* Solid, not a second translucent layer under the translucent header. */
  background: var(--bg);
  box-shadow: 0 1px 0 var(--hairline);
}
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; font-size: 1.125rem; color: var(--muted); pointer-events: none; }
.search input, .field input {
  width: 100%; height: 44px;
  padding: 0 40px 0 38px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface);
  font-size: 1rem; /* < 16px makes iOS zoom on focus */
  outline: none; -webkit-appearance: none;
}
.search input:focus, .field input:focus { border-color: var(--gold); }
.search .clear { position: absolute; right: 4px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 8px -16px 0; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 13px;
  border-radius: 99px; border: 1px solid var(--line);
  background: transparent; font-size: 0.875rem; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.fav-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }

.segmented { display: flex; gap: 4px; padding: 4px; margin: 12px 16px 0; background: var(--surface); border-radius: 12px; }
.segmented a {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 6px 8px; border-radius: 9px;
  text-align: center; text-decoration: none; font-size: 0.875rem; line-height: 1.2; color: var(--muted);
}
.segmented a[aria-current="page"] { background: var(--bg); color: var(--text); font-weight: 600; }

.result-meta { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 0; font-size: 0.8125rem; color: var(--muted); }
.linkish { border: 0; background: none; padding: 6px 0; color: var(--gold); font-weight: 600; font-size: 0.8125rem; text-decoration: none; }

/* ---------- Gig list ---------- */

.day-head {
  position: sticky; top: var(--controls-h, 0px); z-index: 3;
  margin: 0; padding: 16px 16px 8px;
  background: var(--bg);
  font: 600 1.0625rem/1.2 var(--serif);
  color: var(--text);
}
.day-head::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--gold); vertical-align: middle; margin-right: 8px; }

.gigs { list-style: none; margin: 0; padding: 0 12px 6px; }
.gig {
  display: grid; grid-template-columns: 54px 52px 1fr 44px;
  align-items: center; gap: 10px;
  padding: 7px 2px 7px 8px; margin-bottom: 6px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: pointer;
}
.gig.past { opacity: .45; }
.gig.live { box-shadow: inset 3px 0 0 var(--live), var(--shadow); }
.gig-time { font-variant-numeric: tabular-nums; font-size: 0.875rem; line-height: 1.15; }
.gig-time b { display: block; font-size: 1rem; }
.gig-time span { color: var(--muted); font-size: 0.7812rem; }
.thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--surface-2); display: block; }
.gig-main { min-width: 0; }
.gig-artist { font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.gig-stage { font-size: 0.8125rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; vertical-align: 1px; font-size: 0.625rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.badge.live { background: var(--live); color: #0b0b0a; }
.badge.clash { background: var(--danger-soft); color: var(--danger); }

.who { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.75rem; color: var(--gold); min-width: 0; }
.who span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatars { display: inline-flex; flex: none; }
.avatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 0.5625rem/1 var(--sans); letter-spacing: .2px;
  background: var(--brown); color: var(--gold-strong);
  border: 1.5px solid var(--surface);
}
.avatar + .avatar { margin-left: -6px; }
.avatar.lg { width: 34px; height: 34px; font-size: 0.7812rem; border-width: 2px; }

.fav { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px; color: var(--muted); font-size: 1.375rem; }
.fav[aria-pressed="true"] { color: var(--gold); }
.fav[aria-pressed="true"] svg { fill: currentColor; }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty h2 { font: 600 1.3125rem/1.2 var(--serif); color: var(--text); margin: 0 0 8px; }
.empty .big { font-size: 2.5rem; color: var(--gold); }

/* ---------- Artists grid: the photos carry the page ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; padding: 12px 16px 24px; }
.card { position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--surface); aspect-ratio: 4 / 5; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgb(0 0 0 / .82)); }
.card .meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 10px; color: #fff; }
.card .name { font: 600 1rem/1.15 var(--serif); overflow-wrap: anywhere; }
.card .sub { font-size: 0.75rem; color: rgb(255 255 255 / .75); margin-top: 3px; }
.card .fav {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  width: 38px; height: 38px; font-size: 1.25rem;
  background: rgb(0 0 0 / .4); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.card .fav[aria-pressed="true"] { color: #d9c58a; }

/* ---------- Sheet (artist detail, join, transfer) ---------- */

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .6); animation: fade .18s ease-out; }
.sheet-card {
  position: relative; width: 100%; max-width: 640px;
  max-height: calc(100dvh - var(--safe-top) - 8px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 20px 20px 0 0;
  padding-bottom: var(--safe-bottom);
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}
@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 20px; max-height: 88dvh; }
}
.sheet-close {
  position: sticky; top: 10px; float: right; z-index: 2;
  margin: 10px 10px -50px 0; width: 40px; height: 40px; border-radius: 50%;
  border: 0; color: #fff;
  background: rgb(20 19 17 / .45);
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 0 0 .5px rgb(255 255 255 / .25);
  display: grid; place-items: center; font-size: 1.25rem;
}
.hero { position: relative; aspect-ratio: 1; max-height: 62dvh; width: 100%; background: var(--surface-2); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgb(0 0 0 / .85)); }
.hero .hero-text { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; color: #fff; }
.hero h2 { margin: 2px 0 0; font: 600 1.875rem/1.05 var(--serif); text-shadow: 0 1px 10px rgb(0 0 0 / .4); }
.hero .eyebrow { color: #d9c58a; }
.sheet-section { padding: 14px 16px 4px; }
.sheet-section h3 { margin: 0 0 8px; }
.sheet-pad { padding: 56px 16px 16px; }
.sheet-pad h2 { font: 600 1.5rem/1.15 var(--serif); margin: 4px 0 8px; }
.years { display: flex; flex-wrap: wrap; gap: 5px; }
.years span { font-size: 0.8125rem; padding: 2px 8px; border-radius: 99px; background: var(--surface); font-variant-numeric: tabular-nums; }
.years span.now { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.big-fav {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border-radius: 12px;
  border: 1px solid var(--gold); background: none; color: var(--gold); font-weight: 600;
}
.big-fav svg { font-size: 1.25rem; }
.big-fav[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.big-fav[aria-pressed="true"] svg { fill: currentColor; }

.slot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 6px; background: var(--surface); border-radius: 12px; }
.slot .when { flex: 1; min-width: 0; }
.slot .when b { display: block; }
.slot .when span { font-size: 0.8125rem; color: var(--muted); }
.pill { flex: none; font-size: 0.7812rem; font-weight: 600; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); background: transparent; }
.pill.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface); text-decoration: none; font-size: 0.875rem; }
.fineprint { font-size: 0.75rem; color: var(--muted); padding: 12px 16px 16px; }
.fineprint a { color: var(--gold); }

/* ---------- Panels, forms, buttons ---------- */

.panel { margin: 12px 16px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); }
.panel h2 { margin: 0 0 4px; font: 600 1.125rem/1.2 var(--serif); }
.panel p { margin: 4px 0; font-size: 0.875rem; color: var(--muted); }
.panel p.text { color: var(--text); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.row label { font-size: 0.9375rem; }
.row select { height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .15s; }
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(20px); }
.field { display: block; margin: 10px 0; }
.field span { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 4px; }
.field input { padding: 0 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px;
  border-radius: 10px; border: 0;
  background: var(--gold); color: var(--gold-ink);
  font-weight: 700; font-size: 0.9062rem; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn[disabled] { opacity: .5; }

.summary { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 16px 0; }
.stat { flex: 1; min-width: 96px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.stat b { display: block; font: 600 1.5rem/1 var(--serif); }
.stat span { font-size: 0.75rem; color: var(--muted); }
.stat.bad b { color: var(--danger); }
.stat.warn b { color: var(--warn); }
.stat.good b { color: var(--live); }

.notice { margin: 12px 16px; padding: 12px 14px; border-radius: var(--radius); font-size: 0.875rem; }
.notice.suggest { background: var(--brown); }
.notice.ios { background: var(--surface); }
.notice .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Plan timeline ---------- */

.timeline-day { padding: 4px 0 8px; }
.timeline { position: relative; margin: 0 16px 0 58px; border-left: 1px solid var(--line); }
.hour { position: absolute; left: -50px; right: 0; font-size: 0.7188rem; color: var(--muted); font-variant-numeric: tabular-nums; border-top: 1px dashed var(--line); }
.hour span { position: relative; top: -8px; background: var(--bg); padding-right: 4px; }
.now-line { position: absolute; left: -6px; right: 0; height: 2px; background: var(--live); z-index: 2; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--live); }
.block {
  position: absolute; padding: 5px 7px; border-radius: 8px;
  background: var(--surface); border-left: 4px solid var(--gold);
  overflow: hidden; cursor: pointer; font-size: 0.8125rem; line-height: 1.2;
}
.block b { display: block; font-size: 0.8438rem; overflow-wrap: anywhere; }
.block span { color: var(--muted); font-size: 0.75rem; }
.block .with { display: block; color: var(--gold); margin-top: 2px; }
.block.overlap { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 70%, var(--surface)); }
.block.tight { border-left-color: var(--warn); }
.block.past { opacity: .45; }
/* In a clash block: the whole gig stays visible, the part your route spends
   there is highlighted. */
.block.routed { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.block.routed > :not(.watch) { position: relative; }
.block .watch {
  position: absolute; left: 0; right: 0;
  background: color-mix(in srgb, var(--gold) var(--watch-mix, 24%), var(--surface));
  pointer-events: none;
}
@media (prefers-color-scheme: light) { .block .watch { --watch-mix: 16%; } }
.block .yours { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 600; color: var(--gold-strong); }
.block .yours.missed { color: var(--muted); font-weight: 400; }
.block.skipped { opacity: .55; border-left-style: dashed; }

.gap { margin: 0 16px 8px 58px; padding: 2px 0 10px; color: var(--muted); letter-spacing: 4px; font-size: 0.8125rem; }
.issues { list-style: none; margin: 0; padding: 4px 16px 8px; }
.issue { padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: var(--danger-soft); font-size: 0.875rem; }
.issue.tight { background: var(--warn-soft); }
.issue strong { color: var(--danger); }
.issue.tight strong { color: var(--warn); }
.issue p { margin: 4px 0 0; }
.issue .group-hint { color: var(--gold); }
.route { list-style: none; margin: 8px 0 0; padding: 0; }
.route li {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: start;
  padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  font-size: 0.875rem; cursor: pointer;
}
.route li:first-child { border-top: 0; }
.route .t { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.route li.walk { color: var(--muted); font-size: 0.8125rem; cursor: default; padding: 4px 0; }
.route li.walk span:last-child::before { content: "↳ "; }
.route .pct { margin-left: 4px; padding: 1px 7px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; background: var(--surface); color: var(--text); white-space: nowrap; }
.missed { margin-top: 8px; line-height: 2; }
.must-chip {
  height: 28px; padding: 0 9px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--text) 25%, transparent);
  background: transparent; color: var(--muted);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.must-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.must-btn {
  width: 100%; height: 44px; margin-top: 8px; border-radius: 12px;
  border: 1px dashed var(--gold); background: none; color: var(--gold); font-weight: 600;
}
.must-btn[aria-pressed="true"] { border-style: solid; background: color-mix(in srgb, var(--gold) 18%, transparent); }
.badge.must { background: var(--gold); color: var(--gold-ink); }
.issue .missed b { color: var(--text); }
.alt { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 8px 10px; background: var(--surface); border-radius: 10px; }
.alt .ok { color: var(--live); font-weight: 600; }

/* ---------- Groups ---------- */

.list { list-style: none; margin: 0; padding: 4px 16px 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 8px;
  background: var(--surface); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.list-item .sub { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }
.list-item .count-big { font: 600 1.375rem/1 var(--serif); color: var(--gold); min-width: 28px; text-align: center; }
.list-item img.thumb { width: 48px; height: 48px; }
.members { display: flex; flex-wrap: wrap; gap: 8px; }
.member { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--surface); font-size: 0.875rem; }
.member.me { outline: 1px solid var(--gold); }
details.member-plan { margin: 0 16px 8px; background: var(--surface); border-radius: var(--radius); }
details.member-plan summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
details.member-plan summary::-webkit-details-marker { display: none; }
details.member-plan summary .grow { flex: 1; }
details.member-plan ul { margin: 0; padding: 0 12px 10px 56px; list-style: none; font-size: 0.875rem; }
details.member-plan li { padding: 3px 0; color: var(--muted); }
details.member-plan li b { color: var(--text); font-weight: 600; }
.invite { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center; }
.qr { background: #fff; border-radius: 10px; padding: 6px; line-height: 0; }
.qr svg { width: 120px; height: 120px; display: block; }
.qr.large svg { width: min(70vw, 260px); height: min(70vw, 260px); margin: 0 auto; }
.mono { font: 0.75rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; color: var(--muted); }
@media (max-width: 360px) { .invite { grid-template-columns: 1fr; } }

/* ---------- Inbox & changes ---------- */

.feed { list-style: none; margin: 0; padding: 8px 16px 16px; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed li a { text-decoration: none; display: flex; gap: 12px; flex: 1; min-width: 0; }
.feed .kind {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.125rem;
  background: var(--surface); color: var(--gold);
}
.feed .kind.removed { color: var(--danger); }
.feed .grow { flex: 1; min-width: 0; }
.feed .title { font-weight: 600; }
.feed .body { font-size: 0.875rem; color: var(--muted); white-space: pre-line; margin-top: 2px; }
.feed .when { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.feed li.unread .title::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: 2px; }
.feed .mine { color: var(--gold); font-size: 0.75rem; font-weight: 600; }

/* ---------- Info ---------- */

.prose { padding: 4px 16px 16px; font-size: 0.9375rem; line-height: 1.5; }
.prose h2 { font: 600 1.25rem/1.2 var(--serif); margin: 22px 0 6px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose a { color: var(--gold); }

/* ---------- Banner, toast, skeleton ---------- */

.banner {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  top: calc(var(--safe-top) + 6px);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 99px;
  background: var(--gold); color: var(--gold-ink);
  box-shadow: 0 6px 24px rgb(0 0 0 / .35);
  font-size: 0.875rem; font-weight: 600; white-space: nowrap;
}
.banner button { border: 0; border-radius: 99px; padding: 6px 12px; background: var(--gold-ink); color: var(--gold); font-weight: 700; }
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tabs-h) + 12px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  font-size: 0.875rem; max-width: calc(100vw - 32px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.skeleton { padding: 16px; }
.skeleton div { height: 66px; margin-bottom: 8px; border-radius: var(--radius); background: var(--surface); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Tablet: cap the column, let touch targets grow taller rather than wider. */
@media (min-width: 768px) {
  .gig { padding-top: 10px; padding-bottom: 10px; }
  .tabs a { min-height: 58px; }
}

/* ---------- Typography: tracking and leading follow size ---------- */

.hero h2 { letter-spacing: -0.02em; line-height: 1.05; }
.day-head, .empty h2, .panel h2, .sheet-pad h2, .stat b, .card .name { letter-spacing: -0.01em; }
.status, .brand-sub, .disclaimer, .gig-stage, .card .sub, .fineprint, .badge { letter-spacing: .01em; }
.gig-artist, .list-item .title { line-height: 1.2; }

/* ---------- Response: feedback on press, instantly ---------- */

.btn, .chip, .pill, .fav, .must-chip, .must-btn, .big-fav, .icon-btn, .tabs a, .segmented a,
.linkish, .gig, .card, .list-item, .slot, .route li, .block, .links a, .search .clear {
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}
.btn:active, .chip:active, .pill:active, .must-chip:active, .must-btn:active, .big-fav:active,
.icon-btn:active, .tabs a:active, .segmented a:active, .links a:active, .search .clear:active {
  transform: var(--press);
  transition-duration: 90ms;
}
/* Big surfaces move less; a press on a nested control doesn't press the row. */
.gig:active:not(:has(button:active)), .card:active:not(:has(button:active)),
.list-item:active:not(:has(button:active)), .slot:active:not(:has(button:active)),
.route li:not(.walk):active:not(:has(button:active)), .block:active {
  transform: scale(.985);
  transition-duration: 90ms;
}
.fav:active { transform: scale(.88); transition-duration: 90ms; }

/* ---------- Sheet: a physical card you can drag away ---------- */

.sheet-card { will-change: transform; touch-action: pan-y; }
.sheet-grabber {
  position: sticky; top: 0; z-index: 3;
  height: 22px; margin-bottom: -22px;
  display: grid; place-items: center;
  cursor: grab; touch-action: none;
}
.sheet-grabber::before {
  content: ""; width: 38px; height: 5px; border-radius: 99px;
  background: rgb(255 255 255 / .55); box-shadow: 0 0 0 .5px rgb(0 0 0 / .25);
}
.sheet-card.dragging, .sheet-card.dragging .sheet-grabber { cursor: grabbing; }
.hero { touch-action: none; }
/* The sheet's own motion is driven by springs in app.js. */
.sheet[data-motion] .sheet-backdrop, .sheet[data-motion] .sheet-card { animation: none; }
@media (min-width: 700px) { .sheet-grabber { display: none; } }

/* ---------- Accessibility: less motion, less transparency, more contrast ---------- */

@media (prefers-reduced-transparency: reduce) {
  :root { --chrome: var(--bg); }
  .top, .tabs, .card .fav, .sheet-close { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --chrome: var(--bg); --hairline: var(--text); --muted: color-mix(in srgb, var(--text) 80%, var(--bg)); }
  .top, .tabs { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .gig, .card, .panel, .issue, .slot, .list-item, .stat { outline: 1px solid var(--hairline); }
}
@media (prefers-reduced-motion: reduce) {
  :root { --press: none; }
  .gig:active, .card:active, .list-item:active, .slot:active, .block:active, .fav:active { transform: none; }
}

.hint { margin: 6px 2px 0; font-size: .8125rem; line-height: 1.35; color: var(--muted); }
