/* Dugout Coach — mobile-first, high contrast for outdoor daylight use. */

:root {
  /* Athletics: kelly green and gold. */
  --green: #003831;
  --green-dk: #00251f;
  --green-lt: #e0eeea;
  /* Gold is the accent. Text on gold is always dark green — gold on white cannot carry text. */
  --dirt: #a97a06;          /* gold, darkened enough for white text and small type */
  --dirt-lt: #fdf3d7;
  --gold: #efb21e;
  /* Pitcher and catcher get their own colour: infield clay. Distinct from the green infield
     and gold outfield at a glance, and deliberately not the same red as --danger. */
  --battery: #8f3a1d;
  --battery-lt: #fbeee8;
  --ink: #14181c;
  --ink-2: #4b5563;
  --line: #d6dbe1;
  --bg: #f4f6f8;
  --card: #ffffff;
  --danger: #b42318;
  --danger-lt: #fdeceb;
  --warn: #8a6206;
  --warn-lt: #fdf3d7;
  --ok: #006b4f;
  --radius: 14px;
  --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --bar-h: 52px;
  --tabbar-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }

/* ---------- App bar ---------- */
#appbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: calc(var(--bar-h) + var(--safe-t));
  padding: var(--safe-t) 6px 0;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  /* Gold rule under the bar, like the cap logo. */
  box-shadow: inset 0 -3px 0 var(--gold), 0 1px 0 rgba(0,0,0,.15);
}
#appTitle {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-btn {
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.bar-btn:active { background: rgba(255,255,255,.3); }
#backBtn { font-size: 26px; line-height: 1; padding-bottom: 3px; }
.bar-btn[hidden] { display: none; }
#appbar .bar-spacer { min-width: 44px; }

/* ---------- Layout ---------- */
#view {
  padding: calc(var(--bar-h) + var(--safe-t) + 10px) 12px
           calc(var(--tabbar-h) + var(--safe-b) + 24px);
  max-width: 720px;
  margin: 0 auto;
  outline: none;
}
body.no-tabs #view { padding-bottom: calc(var(--safe-b) + 24px); }
body.no-tabs #tabbar { display: none; }

/* ---------- Tab bar ---------- */
#tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(8px);
}
#tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
}
#tabbar a.on { color: var(--green); }
#tabbar a.on .tab-ico { transform: translateY(-1px); }
.tab-ico { font-size: 21px; line-height: 1; }

/* ---------- Cards & sections ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 0 12px;
}
.card.tight { padding: 10px 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2, .card > h3 { margin: 0 0 8px; }

h2.section {
  margin: 22px 2px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
h2.section:first-child { margin-top: 4px; }

.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }
.divider { height: 1px; background: var(--line); margin: 12px -14px; }

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-2);
}
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.dirt { background: var(--gold); border-color: #d79c17; color: var(--green-dk); }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--green); }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 62px; font-size: 19px; border-radius: 14px; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
}
input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 17px; /* >=16px prevents iOS zoom-on-focus */
}
textarea { min-height: 84px; resize: vertical; line-height: 1.35; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.inline-fields { display: flex; gap: 10px; }
.inline-fields > label.field { flex: 1; }
.w-num { max-width: 96px; }

/* ---------- List rows ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.rowbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
}
.rowbtn:active { background: var(--green-lt); }
.rowbtn .chev { margin-left: auto; color: var(--ink-2); font-size: 22px; }

.jersey {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--green-lt);
  color: var(--green);
  font-size: 15px;
  font-weight: 750;
}
.jersey.grey { background: #eef0f2; color: var(--ink-2); }

/* ---------- Chips / pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef0f2;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pill.green { background: var(--green-lt); color: var(--green); }
.pill.dirt { background: var(--dirt-lt); color: var(--dirt); }
.pill.warn { background: var(--warn-lt); color: var(--warn); }
.pill.danger { background: var(--danger-lt); color: var(--danger); }
.pill.solid { background: var(--gold); color: var(--green-dk); }

.toggle-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle {
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}
.toggle.on { background: var(--green); border-color: var(--green); color: #fff; }
.toggle.out { background: #fff; border-color: var(--line); color: var(--ink-2); opacity: .65; }

/* ---------- Attendance grid ---------- */
.att-grid {
  display: grid;
  /* Two wide columns on a phone (roomy tap targets, full names), more on a tablet. */
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}
.att {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 52px;
  padding: 6px 8px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
}
.att .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.in { border-color: var(--green); background: var(--green-lt); color: var(--green-dk); }
.att.out { opacity: .5; }
.att .mark { font-size: 15px; }

/* ---------- Lineup (game) ---------- */
.lineup { list-style: none; margin: 0; padding: 0; }
.lineup > li { border-bottom: 1px solid var(--line); }
.lineup > li:last-child { border-bottom: 0; }
.slot {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  text-align: left;
}
.slot:active { background: var(--green-lt); }
.pos-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}
/* Three groups, three colours: green infield, gold outfield, clay for pitcher and catcher. */
.pos-badge.of { background: var(--gold); color: var(--green-dk); }
.pos-badge.battery { background: var(--battery); color: #fff; }
.pos-badge.bench { background: #6b7280; }

/* Small colour key so the badges are learnable without asking. */
.pos-key {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 10px 12px 2px;
  font-size: 12px;
  color: var(--ink-2);
}
.pos-key span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pos-key i {
  width: 12px; height: 12px; border-radius: 4px; display: inline-block;
}

/* ---- the field diagram ---- */
.field-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.field-card.dim { opacity: .55; }
/* Pin the ratio to the viewBox. Relying on height:auto let the box come out 364x341 against a
   360x380 viewBox, so the drawing was letterboxed and scaled down — which silently moved every
   coordinate and clipped the catcher. */
.field-svg { display: block; width: 100%; aspect-ratio: 360 / 380; height: auto; }

/* Text on grass needs a dark outline or it disappears in sunlight. paint-order puts the stroke
   behind the glyph so the letters stay their proper weight. */
.field-svg text {
  font-family: inherit;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .55);
  stroke-width: 3px;
  stroke-linejoin: round;
  fill: #fff;
}
.field-svg .spot-code { font-size: 12.5px; font-weight: 800; letter-spacing: -.02em; text-anchor: middle; }
.field-svg .spot-name { font-size: 12px; font-weight: 700; }
.field-svg .spot.empty .spot-code { fill: rgba(255, 255, 255, .75); }
.field-svg .spot[role='button'] { cursor: pointer; }
.field-svg .spot[role='button']:active circle { stroke: #fff; stroke-width: 3; }
.field-svg .spot[role='button']:focus-visible circle { stroke: var(--gold); stroke-width: 3; outline: none; }

.field-bench {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.field-bench .lbl {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2);
}
.field-bench .chip {
  font-size: 13px; font-weight: 650;
  background: var(--green-lt); color: var(--green-dk);
  border-radius: 999px; padding: 3px 10px;
}

/* Collapsed field on the Gameday screen. */
.field-fold > summary {
  list-style: none;
  cursor: pointer;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}
.field-fold > summary::-webkit-details-marker { display: none; }
.field-fold[open] > summary { border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.field-fold[open] .field-card { border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 0; }
.slot .who { flex: 1; min-width: 0; }
.slot .who .nm {
  font-size: 17px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot .who .sub { font-size: 12.5px; color: var(--ink-2); }
.slot .lock { font-size: 15px; color: var(--dirt); }
.slot.unfilled .who .nm { color: var(--danger); }

.bench-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.bench-chip {
  display: flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; font-weight: 650; font-size: 15px;
}

/* Inning stepper */
.inning-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.inning-bar .now { flex: 1; text-align: center; }
.inning-bar .now .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.inning-bar .now .val { font-size: 22px; font-weight: 800; line-height: 1.1; }
.step-btn {
  width: 56px; height: 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 26px;
  font-weight: 700;
  color: var(--green);
}
.step-btn:disabled { opacity: .35; }

.inning-dots { display: flex; gap: 6px; justify-content: center; padding: 2px 0 10px; }
.inning-dots button {
  min-width: 38px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.inning-dots button.on { background: var(--green); border-color: var(--green); color: #fff; }
.inning-dots button.done { background: var(--green-lt); color: var(--green); }

/* ---------- Batting order ---------- */
.bat-list { list-style: none; margin: 0; padding: 0; counter-reset: bat; }
.bat-list > li {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}
.bat-list > li:last-child { border-bottom: 0; }
.bat-list > li.now { background: var(--green-lt); }
.bat-list > li.now .num { background: var(--green); color: #fff; }
.bat-list > li.past { opacity: .5; }
.bat-list .num {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: #eef0f2; color: var(--ink-2);
  font-size: 14px; font-weight: 750;
}
.bat-list .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Practice run mode ---------- */
.run-wrap { text-align: center; }
.run-kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.run-title { font-size: 27px; font-weight: 800; line-height: 1.15; margin: 4px 0 2px; }
.clock {
  font-variant-numeric: tabular-nums;
  font-size: 74px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  margin: 10px 0 4px;
}
.clock.over { color: var(--danger); }
.clock.warn { color: var(--dirt); }
/* Waiting for GO: full time on the board, dimmed so it reads as "not running yet". */
.clock.ready { opacity: .45; }
.bar {
  height: 10px;
  border-radius: 999px;
  background: #e5e8eb;
  overflow: hidden;
  margin: 10px 0 4px;
}
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .4s linear; }
.bar > i.over { background: var(--danger); }

.coach-points { text-align: left; margin: 0; padding-left: 20px; }
.coach-points li { margin-bottom: 5px; }

.station-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.station-card:last-child { border-bottom: 0; }
.station-tag {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--dirt-lt); color: var(--dirt);
  font-weight: 800; font-size: 15px;
}

/* ---------- Report table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td {
  padding: 7px 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid thead th {
  position: sticky; top: 0;
  background: #fff;
  font-size: 11.5px;
  font-weight: 750;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.grid th.nmcol, table.grid td.nmcol {
  position: sticky; left: 0;
  background: #fff;
  text-align: left;
  min-width: 116px;
  font-weight: 650;
  box-shadow: 1px 0 0 var(--line);
}
table.grid tbody tr:nth-child(even) td { background: #fafbfc; }
table.grid tbody tr:nth-child(even) td.nmcol { background: #fafbfc; }
td.zero { color: #c3c8ce; }
td.hot { background: var(--warn-lt) !important; font-weight: 750; color: var(--warn); }

.flag {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.flag:last-child { border-bottom: 0; }
.flag .ico { flex: 0 0 auto; }

/* ---------- Sheet (bottom modal) ---------- */
#sheetHost {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15,20,25,.45);
}
#sheetHost[hidden] { display: none; }

/* Page scroll is locked only while a sheet is up. Applied as a class so it can always be
   removed — an inline style that survives a navigation leaves the app unscrollable. */
body.sheet-open { overflow: hidden; }
.sheet {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding-bottom: var(--safe-b);
  animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px 18px 0 0;
}
.sheet-head h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px; }
.sheet-body > .card:last-child { margin-bottom: 0; }
.sheet-foot { padding: 12px 14px; border-top: 1px solid var(--line); background: var(--card); }
.x-btn {
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: #eef0f2; color: var(--ink-2);
  font-size: 19px; font-weight: 700;
}

/* ---------- Toast ---------- */
#toastHost {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  z-index: 80;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 460px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(20,24,28,.94);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  animation: up .16s ease-out;
}

/* ---------- Misc ---------- */
.sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.hint {
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--dirt-lt);
  color: #7c3d06;
  font-size: 13.5px;
  line-height: 1.35;
}
.hint.green { background: var(--green-lt); color: var(--green-dk); }

@media (prefers-color-scheme: dark) {
  /* Daylight readability wins: keep the light theme, just soften the page frame. */
  :root { --bg: #eef1f4; }
}

/* ---------- First-run walkthrough ---------- */

#tourHost {
  position: fixed;
  inset: 0;
  z-index: 90;              /* above the sheets, which the tour may point at */
  pointer-events: none;
}
#tourHost[hidden] { display: none; }

/* Dim everything, then punch a hole with a giant ring shadow. */
.tour-dim {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 18, .62);
  pointer-events: auto;
}
.tour-ring {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(10, 20, 18, .62), 0 0 0 3px var(--gold);
  transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease;
  pointer-events: none;
}
.tour-ring[hidden] { display: none; }

.tour-card {
  position: absolute;
  left: 12px;
  right: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 12px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .34);
  pointer-events: auto;
  animation: up .18s ease-out;
}
.tour-card.centred {
  top: 50%;
  transform: translateY(-50%);
}
.tour-card h2 {
  margin: 2px 0 6px;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.2;
}
.tour-step {
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tour-body {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}
.tour-body strong { font-weight: 700; }
.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.tour-actions .btn { min-height: 40px; }
.tour-actions [data-tour-next] { min-width: 84px; }
.tour-actions [data-tour-back][hidden] { display: none; }

/* The first-run invitation. Sits above the tab bar, never blocks the page. */
#tourInvite {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  z-index: 70;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
body.no-tabs #tourInvite { bottom: calc(var(--safe-b) + 12px); }
.tour-invite-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  pointer-events: auto;
  animation: up .2s ease-out;
}
