/* SAM Mission Conference 2026 — live program
   Brand: Samaritan Aid Ministries red, dusty terracotta backgrounds, handwritten
   script title and heavy geometric caps (as in the 2025 livestream designs). */

:root {
  --red: #e3242b;
  --red-press: #c81d24;
  --crimson: #a3161c;
  --ink: #2a1916;
  --ink-2: #5a4640;
  --muted: #8a756d;
  --bg: #f6efe9;
  --card: #fffdfb;
  --field: #faf5f1;
  --line: #eadcd3;
  --chip: #f3e7e0;
  --seg: #eadbd2;
  --band: #fbe6e2;
  --warn: #a8530a;
  --warn-bg: #fdefd8;
  --warn-line: #eab676;
  --scrim: rgba(28, 10, 8, .46);
  --shadow: 0 1px 2px rgba(70, 25, 15, .06), 0 10px 30px -14px rgba(70, 25, 15, .22);
  --shadow-lift: 0 22px 44px -14px rgba(70, 20, 12, .42), 0 2px 8px rgba(70, 20, 12, .12);

  --k-speaker: #b3151b;
  --k-music: #c27a0e;
  --k-choir: #c4502c;
  --k-worship: #d1364d;
  --k-offering: #8e5a10;
  --k-prayer: #6b5190;
  --k-break: #7d6e67;
  --k-other: #7d6e67;

  --font: 'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-caps: 'League Spartan', 'Jost', system-ui, sans-serif;
  --font-script: 'Hurricane', 'Segoe Script', cursive;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --seg-ink: #fffdfb;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-h: 60px;
  --hero-h: calc(var(--safe-top) + 178px);
  --tabs-h: 64px;
  --y: 0;
  --p: 0;
  --tab-p: 0;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { position: fixed; inset: 0; overflow: hidden; }

/* ---------------------------------------------------------------- hero ---- */
.hero {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  height: var(--hero-h);
  color: #fff;
  transform: translate3d(0, calc(var(--y) * -1px), 0);
  will-change: transform;
}
.hero-art {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(255, 221, 205, .42), transparent 55%),
    radial-gradient(80% 110% at 0% 100%, rgba(96, 14, 14, .55), transparent 62%),
    linear-gradient(162deg, #c79a88 0%, #b0705c 38%, #8c3429 74%, #6e1f1b 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.hero-art::after {
  content: ''; position: absolute; inset: 0; opacity: .22; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-mark {
  position: absolute; width: 360px; height: 360px; right: -110px; top: -70px;
  background: #fff; opacity: .13;
  -webkit-mask: url(/img/sam-mark-512.png) center / contain no-repeat;
  mask: url(/img/sam-mark-512.png) center / contain no-repeat;
  transform: rotate(-10deg);
}
.bar {
  position: absolute; left: 0; right: 0; top: var(--safe-top); height: var(--bar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 14px;
  transform: translate3d(0, calc(var(--y) * 1px), 0);
  will-change: transform;
}
.mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 2px 6px rgba(60, 5, 5, .35)); }
.wordmark {
  height: 24px; width: auto; flex: none;
  opacity: calc(1 - var(--p) * 1.8);
  filter: drop-shadow(0 1px 3px rgba(40, 5, 5, .35));
}
.bar-title {
  position: absolute; left: 62px; right: 104px; top: 50%;
  border: 0; background: none; padding: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-align: left;
  font: 400 clamp(1.3rem, 6vw, 2.05rem)/1.25 var(--font-script); color: #fff;
  text-shadow: 0 2px 10px rgba(50, 5, 5, .35);
  opacity: calc((var(--p) - .55) * 2.4);
  transform: translateY(calc(-50% + (1 - var(--p)) * 10px));
  pointer-events: none;
}
.app.collapsed .bar-title { pointer-events: auto; }
.grow { flex: 1; }

.live {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(40, 8, 6, .22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 600 .8125rem/1 var(--font); color: #fff; cursor: pointer; white-space: nowrap;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #f3b35a; box-shadow: 0 0 0 3px rgba(243, 179, 90, .25); }
.live[data-state="live"] .live-dot { background: #56d27c; box-shadow: 0 0 0 3px rgba(86, 210, 124, .28); animation: pulse 2.4s var(--ease) infinite; }
.live[data-state="offline"] .live-dot { background: #c9bdb8; box-shadow: none; }
.live[data-state="connecting"] .live-dot, .live[data-state="reconnecting"] .live-dot { animation: blink 1.2s ease-in-out infinite; }
.live-n { padding-left: 7px; border-left: 1px solid rgba(255, 255, 255, .3); font-variant-numeric: tabular-nums; }
.live-text { display: inline-block; max-width: 7.5em; overflow: hidden; transition: max-width .3s var(--ease), opacity .2s; }
/* collapsed bar: the green dot says it all, the title needs the room */
.app.compact .live { gap: 0; padding: 0 10px; }
.app.compact .live-text { max-width: 0; opacity: 0; }
.app.compact .live-n { margin-left: 7px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(86, 210, 124, .28); } 50% { box-shadow: 0 0 0 6px rgba(86, 210, 124, 0); } }
@keyframes blink { 50% { opacity: .35; } }

.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: none;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn.on-dark { color: #fff; }
.share-btn svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(40, 5, 5, .3)); }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }

.big {
  position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + var(--bar-h));
  padding: 4px 18px 0;
  opacity: calc(1 - var(--p) * 1.7);
  transform: translate3d(0, calc(var(--p) * -14px), 0);
  transform-origin: left center;
}
.script {
  margin: 0;
  font: 400 clamp(2.1rem, 10.4vw, 4.6rem)/.92 var(--font-script);
  letter-spacing: .005em;
  text-shadow: 0 3px 22px rgba(60, 8, 4, .38);
  white-space: nowrap;
}
.caps {
  margin: 12px 2px 0;
  font: 700 .78rem/1.2 var(--font-caps);
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 8px rgba(60, 8, 4, .35);
}
.caps-sep { opacity: .7; }

/* ---------------------------------------------------------------- tabs ---- */
.tabs {
  position: absolute; z-index: 3; left: 0; right: 0; top: var(--hero-h); height: var(--tabs-h);
  padding: 8px 12px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid color-mix(in srgb, var(--line) calc(var(--p) * 100%), transparent);
  transform: translate3d(0, calc(var(--y) * -1px), 0);
  will-change: transform;
}
.tabs-inner {
  position: relative; height: 100%; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--seg); border-radius: 14px; padding: 3px;
}
.tab-ink {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  background: var(--seg-ink); border-radius: 11px;
  box-shadow: 0 1px 2px rgba(70, 25, 15, .1), 0 4px 12px -4px rgba(70, 25, 15, .22);
  transform: translate3d(calc(var(--tab-p) * 100%), 0, 0);
}
.tab {
  position: relative; border: 0; background: none; cursor: pointer; border-radius: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 6px;
  min-width: 0;
}
.tab-name {
  font: 700 .82rem/1 var(--font-caps); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); transition: color .25s; padding-top: 2px;
}
.tab-time { font: 500 .74rem/1 var(--font); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab[aria-selected="true"] .tab-name { color: var(--crimson); }
.tab[aria-selected="true"] .tab-time { color: var(--ink-2); }
.tab:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* --------------------------------------------------------------- pager ---- */
.pager {
  position: absolute; inset: 0;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pager::-webkit-scrollbar { display: none; }
.panel {
  flex: 0 0 100%; width: 100%; height: 100%;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain;
  scroll-snap-align: start; scroll-snap-stop: always;
  padding-top: calc(var(--hero-h) + var(--tabs-h));
  -webkit-overflow-scrolling: touch;
}
.panel-inner { max-width: 640px; margin: 0 auto; padding: 12px 10px calc(120px + var(--safe-bottom)); }
.col-title { display: none; }

.session-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 2px 4px 12px;
}
.start-pill {
  display: inline-flex; align-items: center; gap: 6px; position: relative;
  height: 36px; padding: 0 6px 0 12px; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow);
  font: 600 .8125rem/1 var(--font); color: var(--ink-2); cursor: pointer;
}
.start-pill svg { width: 16px; height: 16px; stroke: var(--crimson); fill: none; stroke-width: 2; stroke-linecap: round; }
.start-input {
  border: 0; background: none; padding: 0 4px; height: 30px; min-width: 0; width: 7.4em;
  font: 700 .95rem/1 var(--font-caps); color: var(--crimson); cursor: pointer; letter-spacing: .02em;
}
.start-input:focus { outline: none; }
/* the native picker button covers the whole pill: tap anywhere to change the time */
.start-input::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.start-pill:focus-within { box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.session-sum { font-size: .8125rem; color: var(--muted); text-align: right; }

.session-foot { margin: 14px 0 0; text-align: center; font-size: .875rem; color: var(--muted); }
.session-foot b { color: var(--ink-2); font-weight: 600; }
.session-foot .missing { color: var(--warn); }

/* ---------------------------------------------------------------- list ---- */
.list {
  list-style: none; margin: 0; padding: 8px 0;
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow);
  position: relative;
}
.row {
  --k: var(--k-other);
  position: relative;
  display: grid; grid-template-columns: 2.75rem 28px minmax(0, 1fr) 34px; column-gap: 10px;
  align-items: start;
  padding: 11px 2px 11px 8px;
  min-height: 64px;
  background: var(--card);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.row::before {
  content: ''; position: absolute; z-index: 0;
  left: calc(8px + 2.75rem + 10px + 13px); width: 2px; top: 0; bottom: 0;
  background: var(--line);
}
.row:first-child::before { top: 24px; }
.row:last-child::before { bottom: auto; height: 24px; }
.row:only-child::before { display: none; }
.k-speaker { --k: var(--k-speaker); }
.k-music { --k: var(--k-music); }
.k-choir { --k: var(--k-choir); }
.k-worship { --k: var(--k-worship); }
.k-offering { --k: var(--k-offering); }
.k-prayer { --k: var(--k-prayer); }
.k-break { --k: var(--k-break); }

.rail { text-align: right; padding-top: 3px; min-width: 0; }
.t {
  display: block; font: 700 1.02rem/1 var(--font-caps); color: var(--crimson);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.t.approx { opacity: .55; }
.d { display: block; margin-top: 5px; font: 500 .75rem/1.1 var(--font); color: var(--muted); white-space: nowrap; }
.d .missing {
  display: inline-block; padding: 2px 6px; border-radius: 6px;
  color: var(--warn); background: var(--warn-bg); font-weight: 600;
}
.node {
  position: relative; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--k); color: #fff;
  box-shadow: 0 0 0 4px var(--card), 0 3px 8px -2px color-mix(in srgb, var(--k) 60%, transparent);
  transition: transform .25s var(--ease);
}
.node svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

.body {
  all: unset; display: block; min-width: 0; cursor: pointer; padding: 2px 0 1px; border-radius: 8px;
}
.body:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.name { display: block; font: 600 1.0625rem/1.25 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.tbd { color: var(--warn); font-style: italic; font-weight: 500; }
.meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; font-size: .875rem; line-height: 1.3; color: var(--ink-2); }
.meta span { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
.meta svg { width: 13px; height: 13px; flex: none; align-self: center; fill: none; stroke: var(--k); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.meta .role {
  font: 700 .68rem/1.3 var(--font-caps); letter-spacing: .12em; text-transform: uppercase; color: var(--crimson);
  align-self: center; padding-top: 1px;
}
.song { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: .875rem; line-height: 1.3; color: var(--ink-2); }
.song > svg { width: 13px; height: 13px; flex: none; margin-top: 3px; fill: none; stroke: var(--k); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.song-text { min-width: 0; font-style: italic; }
.song-text .lat { color: var(--muted); white-space: normal; }
/* translators always on one line: chips shrink together, and a name that still
   does not fit ends in "…" (the full name is in the tooltip) */
.chips { display: flex; flex-wrap: nowrap; gap: 5px; margin-top: 7px; min-width: 0; }
/* team page: the line may run under the drag handle's column (the handle sits beside the name) */
.app.can-edit .chips { margin-right: -42px; }
.tr {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0;
  padding: 2px 7px 2px 2px; border-radius: 999px;
  background: var(--chip); color: var(--ink-2);
  font: 500 .75rem/1.2 var(--font); white-space: nowrap;
}
.tr b {
  flex: none;
  font: 700 .57rem/1 var(--font-caps); letter-spacing: .05em;
  padding: 4px 4px 3px; border-radius: 999px;
  background: var(--card); color: var(--crimson);
}
.trn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tr.open { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.note { display: block; margin-top: 6px; font-size: .8125rem; line-height: 1.35; color: var(--muted); font-style: italic; }

.grip {
  width: 44px; height: 42px; margin: -6px 0 0 -8px; border: 0; border-radius: 12px; background: none;
  display: grid; place-items: center; color: var(--muted); color: color-mix(in srgb, var(--muted) 70%, transparent);
  cursor: grab; touch-action: none;
}
.grip svg { width: 20px; height: 20px; fill: currentColor; }
.grip:hover { background: var(--chip); color: var(--ink-2); }
.grip:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; color: var(--crimson); }

/* congregational moments: tinted band, like the bold italic lines on the paper plan */
.row.k-worship, .row.k-offering {
  background: linear-gradient(90deg, var(--band), var(--card));
  background: linear-gradient(90deg, var(--band), color-mix(in srgb, var(--band) 30%, var(--card)) 70%, var(--card));
}
.row.k-worship .name, .row.k-offering .name { font-style: italic; color: var(--crimson); }
.row.k-worship .node, .row.k-offering .node { box-shadow: 0 0 0 4px color-mix(in srgb, var(--band) 60%, var(--card)), 0 3px 8px -2px color-mix(in srgb, var(--k) 60%, transparent); }
.row.k-break .name { font: 700 .95rem/1.3 var(--font-caps); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding-top: 2px; }

.row:hover { background-color: color-mix(in srgb, var(--chip) 45%, var(--card)); }
.row.k-worship:hover, .row.k-offering:hover { filter: brightness(.99); }

/* public view: nothing to grab or tap */
.app:not(.can-edit) .fab, .app:not(.can-edit) .grip { display: none; }
.app:not(.can-edit) .row { grid-template-columns: 2.75rem 28px minmax(0, 1fr); padding-right: 14px; }
.app:not(.can-edit) .body { cursor: default; }
.app:not(.can-edit) .row:hover { background-color: var(--card); }
.app:not(.can-edit) .start-pill { cursor: default; }
.start-input:disabled { opacity: 1; color: var(--crimson); -webkit-text-fill-color: var(--crimson); cursor: default; }
.start-input:disabled::-webkit-calendar-picker-indicator { display: none; }

/* drag */
.list.is-dragging .row:not(.dragging) { transition: transform .22s var(--ease); }
.row.dragging {
  z-index: 6; border-radius: 16px; box-shadow: var(--shadow-lift);
  background: var(--card); cursor: grabbing;
}
.row.dragging::before { opacity: 0; }
.row.dragging .node { transform: scale(1.12); }
.row.dragging .grip { color: var(--crimson); background: var(--chip); }
body.dragging-any, body.dragging-any * { cursor: grabbing !important; }

/* feedback */
.row.flash { animation: flash 1.6s var(--ease-out); }
@keyframes flash {
  0% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--red) 16%, transparent); }
  100% { box-shadow: inset 0 0 0 999px transparent; }
}
.row.entering { animation: enter .42s var(--ease-out); }
@keyframes enter { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.row.leaving { transition: opacity .2s, transform .22s var(--ease); opacity: 0; transform: translateX(24px); }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: .95rem; }
.skeleton { height: 64px; margin: 4px 12px; border-radius: 14px; background: linear-gradient(90deg, var(--chip), color-mix(in srgb, var(--chip) 40%, var(--card)), var(--chip)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ----------------------------------------------------------------- fab ---- */
.fab {
  position: fixed; z-index: 8;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(20px + var(--safe-bottom));
  height: 62px; min-width: 62px; padding: 0; border: 0; border-radius: 31px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(circle at 32% 26%, #ff5a5e, var(--red) 48%, #ad141a);
  color: #fff; cursor: pointer;
  box-shadow: 0 12px 26px -8px rgba(179, 21, 27, .6), 0 2px 6px rgba(60, 10, 8, .2), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .25s var(--ease), box-shadow .25s, bottom .4s var(--ease-out);
}
.fab svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(90, 0, 0, .25)); }
.fab-label { display: none; font: 700 .9rem/1 var(--font-caps); letter-spacing: .14em; text-transform: uppercase; }
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: scale(.94); }
.fab:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 40%, transparent); outline-offset: 3px; }
body.dragging-any .fab { transform: scale(.85); opacity: .5; }

/* --------------------------------------------------------------- snack ---- */
.snack {
  position: fixed; z-index: 30;
  left: 14px; right: 96px; bottom: calc(24px + var(--safe-bottom));
  display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 6px 6px 6px 16px; border-radius: 16px;
  background: #2b1815; color: #fff; box-shadow: 0 16px 36px -12px rgba(30, 5, 3, .55);
  font-size: .9rem; line-height: 1.3;
  opacity: 0; transform: translateY(18px) scale(.98);
  transition: opacity .22s, transform .3s var(--ease-out), bottom .4s var(--ease-out);
  pointer-events: none;
}
.snack.show { opacity: 1; transform: none; pointer-events: auto; }
.snack-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.snack-action {
  flex: none; height: 40px; padding: 0 14px; border: 0; border-radius: 11px; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #ff9da0;
  font: 700 .8rem/1 var(--font-caps); letter-spacing: .12em; text-transform: uppercase;
}
.snack-action:hover { background: rgba(255, 255, 255, .18); }

/* --------------------------------------------------------------- sheets ---- */
dialog.sheet {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
  /* not scrollable at all: when a sheet opens, the browser focuses a control in a
     card that is still sliding in from below and would scroll the dialog to it */
  overflow: hidden;
  overflow: clip;
}
dialog.sheet:not([open]) { display: none; }
dialog.sheet.no-modal { z-index: 50; background: var(--scrim); } /* browsers without <dialog> */
dialog.sheet::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .25s; }
dialog.sheet.closing::backdrop { opacity: 0; transition: opacity .2s; }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - 28px - var(--safe-top));
  display: flex; flex-direction: column;
  background: var(--card); border-radius: 26px 26px 0 0;
  box-shadow: 0 -18px 50px -20px rgba(30, 5, 3, .45);
  animation: sheet-up .38s var(--ease-out);
}
dialog.sheet.closing .sheet-card { animation: sheet-down .22s var(--ease) forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px 6px 20px; flex: none; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-head h2 { margin: 0; font: 700 1.1rem/1.2 var(--font-caps); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.sheet-sub:empty { display: none; }
.sheet-sub { margin: 3px 0 0; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved { font-size: .78rem; color: #3f9a5c; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.saved.show { opacity: 1; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 20px; flex: 1; }
.sheet-foot {
  flex: none; display: flex; gap: 8px; align-items: center;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
}

.btn {
  height: 46px; padding: 0 16px; border: 0; border-radius: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--chip); color: var(--ink);
  font: 600 .95rem/1 var(--font); white-space: nowrap;
  transition: background .15s, transform .12s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.primary { background: var(--red); color: #fff; box-shadow: 0 8px 18px -8px rgba(200, 29, 36, .7); }
.btn.primary:hover { background: var(--red-press); }
.btn.ghost { background: none; color: var(--crimson); font-weight: 700; }
.btn.ghost:hover { background: var(--chip); }
.btn.danger { color: var(--red-press); }
.btn.tool { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 5px; height: 58px; padding: 0 6px; font-size: .78rem; font-weight: 600; }
.btn.tool span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.btn.wide { flex: 1; height: 52px; font-size: 1rem; }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.head-btn { height: 40px; padding: 0 12px; }

/* editor fields (compact: pairs side by side, small type pills) */
.kinds {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 2px -20px 0; padding: 4px 20px 4px;
  scroll-padding: 0 20px;
}
.kinds::-webkit-scrollbar { display: none; }
.kind {
  --k: var(--k-other);
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px 0 5px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2);
  font: 600 .8rem/1 var(--font);
  transition: background .18s, border-color .18s, color .18s;
}
.kind i { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); }
.kind svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.kind[aria-checked="true"] { background: var(--k); border-color: var(--k); color: #fff; }
.kind[aria-checked="true"] i { background: rgba(255, 255, 255, .22); color: #fff; }
.kind:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.field { display: block; margin-top: 12px; }
.field[hidden] { display: none; }
.pair { display: flex; gap: 10px; }
.pair > .field { flex: 1 1 0; min-width: 0; }
.pair > .grow-2 { flex-grow: 1.5; }
.field-label {
  display: block; margin: 0 0 6px 2px;
  font: 700 .66rem/1 var(--font-caps); letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.input {
  width: 100%; height: 46px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--field); color: var(--ink);
  font: 500 1rem/1.2 var(--font); /* 16px: phones do not zoom into the field */
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); background: var(--card); }
.minutes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) 4.4rem; gap: 6px; }
.minutes button {
  min-width: 0; height: 42px; border: 1.5px solid var(--line); border-radius: 11px; cursor: pointer;
  background: var(--card); color: var(--ink-2); font: 700 .92rem/1 var(--font-caps);
  transition: background .15s, color .15s, border-color .15s;
}
.minutes button[aria-pressed="true"] { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.min-input { width: 100%; height: 42px; text-align: center; padding: 0 6px; font-family: var(--font-caps); font-weight: 700; }
.tr-pair { display: flex; gap: 8px; }
.tr-pair .tr-input { flex: 1 1 0; min-width: 0; margin-top: 0; }
.tr-input { display: flex; align-items: center; position: relative; margin-top: 8px; }
.tr-input b {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font: 700 .62rem/1 var(--font-caps); letter-spacing: .06em; color: var(--crimson);
  background: var(--chip); padding: 5px 6px 4px; border-radius: 7px; pointer-events: none;
}
.tr-input .input { padding-left: 44px; }
.tr-input[hidden] { display: none; }
.link-btn { margin-top: 6px; border: 0; background: none; padding: 6px 2px; cursor: pointer; color: var(--crimson); font: 600 .85rem/1 var(--font); }
.link-btn[hidden] { display: none; }

/* place in the program: a list that opens upwards from its button */
.picker-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.picker-btn span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--crimson); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.picker-btn[aria-expanded="true"] { border-color: var(--red); background: var(--card); }
.picker-btn[aria-expanded="false"] svg { transform: rotate(180deg); }
.picker {
  position: absolute; z-index: 5; left: 12px; right: 12px;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 6px 6px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 -16px 40px -14px rgba(60, 15, 8, .38), 0 2px 6px rgba(60, 15, 8, .08);
  transform-origin: bottom center;
  animation: picker-up .22s var(--ease-out);
}
.picker[hidden] { display: none; }
@keyframes picker-up { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.picker h4 {
  position: sticky; top: 0; z-index: 1; margin: 0 -6px; padding: 11px 16px 7px;
  background: var(--card); border-bottom: 1px solid var(--line);
  font: 700 .66rem/1 var(--font-caps); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.picker .opt {
  display: flex; align-items: baseline; gap: 10px; width: 100%; margin-top: 2px;
  padding: 9px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left;
  font: 500 .92rem/1.25 var(--font); color: var(--ink-2);
}
.picker .opt .ot { flex: none; width: 2.9rem; text-align: right; font: 700 .8rem/1 var(--font-caps); color: var(--crimson); }
.picker .opt b { font-weight: 600; color: var(--ink); }
.picker .opt:hover { background: var(--chip); }
.picker .opt[aria-selected="true"] { background: var(--band); box-shadow: inset 3px 0 0 var(--red); }
.picker .opt:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.lat-row { margin-top: 8px; }

/* recently deleted (team) */
.trash { list-style: none; margin: 0; padding: 0; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); }
.trash li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--field); }
.trash li + li { border-top: 1px solid var(--line); }
.trash .ti { flex: 1; min-width: 0; }
.trash .ti b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash .ti span { font-size: .8rem; color: var(--muted); }
.trash .btn { height: 38px; padding: 0 12px; font-size: .85rem; background: var(--card); color: var(--crimson); }
.trash-empty { margin: 0; padding: 14px; border-radius: 14px; background: var(--field); color: var(--muted); font-size: .875rem; text-align: center; }
.foot-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 14px; border: 0; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow); color: var(--crimson); cursor: pointer;
  font: 600 .85rem/1 var(--font);
}
.foot-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* install card: once per visit in the browser, never inside the installed app */
.install {
  position: fixed; z-index: 25;
  left: 12px; right: 12px; bottom: calc(14px + var(--safe-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px 12px 12px; border-radius: 20px;
  background: var(--card); box-shadow: 0 18px 44px -14px rgba(60, 15, 8, .45), 0 0 0 1px rgba(120, 40, 30, .06);
  opacity: 0; transform: translateY(24px); transition: opacity .3s, transform .45s var(--ease-out);
  pointer-events: none;
}
.install.show { opacity: 1; transform: none; pointer-events: auto; }
.install[hidden] { display: none; }
.install-icon { width: 48px; height: 48px; flex: none; border-radius: 12px; box-shadow: 0 2px 8px -2px rgba(60, 15, 8, .3); }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.install-text b { font: 700 .95rem/1.2 var(--font); color: var(--ink); }
.install-text span { font-size: .8rem; line-height: 1.35; color: var(--muted); }
.install-text svg { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; fill: none; stroke: var(--crimson); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-go { height: 40px; padding: 0 16px; flex: none; }
.install-go[hidden] { display: none; }
.install-x { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.install-x:hover { background: var(--chip); }
.install-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.app.install-visible .fab { bottom: calc(20px + var(--safe-bottom) + var(--install-h, 84px)); }
.app.install-visible .snack { bottom: calc(24px + var(--safe-bottom) + var(--install-h, 84px)); }

/* ---------------------------------------------------------- larger screens -- */
@media (min-width: 700px) {
  .sheet-card {
    left: 50%; top: 50%; bottom: auto; width: min(560px, calc(100% - 40px)); max-height: min(760px, calc(100% - 60px));
    border-radius: 26px; transform: translate(-50%, -50%);
    box-shadow: 0 30px 80px -24px rgba(30, 5, 3, .55);
    animation: sheet-pop .3s var(--ease-out);
  }
  dialog.sheet.closing .sheet-card { animation: sheet-unpop .18s var(--ease) forwards; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 16px; }
  .sheet-foot { padding-bottom: 14px; }
  .snack { left: 50%; right: auto; width: max-content; max-width: min(520px, calc(100% - 200px)); transform: translate(-50%, 18px); }
  .snack.show { transform: translate(-50%, 0); }
  .fab { padding: 0 24px 0 20px; }
  .fab-label { display: inline; }
  .install { left: 24px; right: auto; bottom: calc(24px + var(--safe-bottom)); width: 420px; }
  .app.install-visible .fab { bottom: calc(20px + var(--safe-bottom)); }
}
@keyframes sheet-pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
@keyframes sheet-unpop { to { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }

@media (min-width: 960px) {
  :root { --hero-h: calc(var(--safe-top) + 212px); --tabs-h: 0px; }
  .hero { transform: none; }
  .bar { transform: none; padding: 0 20px 0 28px; }
  .big { padding: 6px 30px 0; opacity: 1; transform: none; }
  .script { font-size: 5rem; }
  .caps { font-size: .85rem; }
  .bar-title { display: none; }
  .wordmark { opacity: 1; }
  .hero-mark { width: 520px; height: 520px; right: -60px; top: -130px; }
  .tabs { display: none; }
  .pager { top: var(--hero-h); overflow: hidden; scroll-snap-type: none; padding: 0 12px; gap: 0; }
  .panel { flex: 1 1 0; scroll-snap-align: none; padding-top: 0; }
  .panel-inner { padding: 20px 14px calc(120px + var(--safe-bottom)); max-width: 620px; }
  .col-title {
    display: flex; align-items: baseline; gap: 10px; margin: 0 4px 10px;
    font: 700 1rem/1 var(--font-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--crimson);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
