/* ===========================================================================
   BB : Badminton Bill — styles
   Sporty bright theme: court green + shuttlecock lime/yellow.
   =========================================================================== */

:root {
  /* surfaces */
  --bg: #eef3ec;
  --bg-2: #e6ede3;
  --surface: #ffffff;
  --surface-soft: #f5f8f3;

  /* court / brand */
  --court: #0c2b1f;          /* deep court green (hero/app bar) */
  --court-2: #103a2a;
  --primary: #12b34f;        /* vivid green */
  --primary-press: #0e9a44;
  --primary-soft: #e4f7ea;
  --lime: #c9f53a;           /* shuttlecock lime */
  --lime-ink: #25400a;
  --yellow: #ffd21e;

  /* ink */
  --ink: #0d1f16;
  --ink-2: #38493f;
  --muted: #708177;
  --line: #e2e9df;
  --line-2: #d3ddcd;

  /* glow */
  --glow: rgba(18, 179, 79, 0.38);
  --glow-soft: rgba(18, 179, 79, 0.16);

  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --shadow-card: 0 1px 2px rgba(13, 31, 22, 0.05), 0 8px 24px rgba(13, 31, 22, 0.06);
  --shadow-pop: 0 12px 40px rgba(13, 31, 22, 0.18);

  --font: "Bai Jamjuree", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-num: "Space Grotesk", "Bai Jamjuree", system-ui, sans-serif;

  --maxw: 460px;
}

* { 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);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* desktop: center the mobile column on a court-pattern backdrop */
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 50% -10%, #15402f 0%, #0c2b1f 46%, #081d15 100%);
}

input, button, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ---- app shell --------------------------------------------------------- */
#root { display: flex; justify-content: center; }

.app {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 30px 80px rgba(0,0,0,.35);
}
@media (min-width: 480px) {
  .app { height: calc(100dvh - 48px); margin: 24px 0; border-radius: 30px; }
}

.scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 130px;
}

/* ---- hero / app bar ---------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--court-2) 0%, var(--court) 70%);
  color: #fff;
  padding: 20px 20px 18px;
  padding-top: calc(20px + env(safe-area-inset-top));
  overflow: hidden;
}
.hero::after { /* court lines motif */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 100% 34px, 46px 100%;
  -webkit-mask-image: radial-gradient(120% 120% at 80% -10%, #000 30%, transparent 75%);
          mask-image: radial-gradient(120% 120% at 80% -10%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-row { position: relative; display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--lime); color: var(--lime-ink);
  box-shadow: 0 6px 18px rgba(201,245,58,.35);
}
.logo svg { width: 24px; height: 24px; }
.brand { flex: 1; min-width: 0; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .2px; line-height: 1.1; }
.brand p { margin: 2px 0 0; font-size: 11.5px; color: rgba(255,255,255,.62); font-weight: 500; }

.install-btn {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px 8px 10px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4), background .15s;
}
.install-btn:active { transform: scale(.93); background: rgba(255,255,255,.2); }
.install-btn svg { width: 16px; height: 16px; }

/* total chip in hero */
.hero-total {
  position: relative;
  margin-top: 16px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}
.hero-total .lbl { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; }
.hero-total .val { font-family: var(--font-num); font-size: 30px; font-weight: 700; line-height: 1; }
.hero-total .val small { font-size: 15px; font-weight: 600; opacity: .7; margin-left: 3px; }
.hero-total .sub { font-size: 11px; color: var(--lime); font-weight: 600; margin-top: 2px; white-space: nowrap; }

/* ---- court tabs -------------------------------------------------------- */
.tabs {
  position: relative;
  display: flex; gap: 8px;
  padding: 14px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.3), background .15s, color .15s, box-shadow .2s;
  white-space: nowrap;
}
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tab.active {
  background: var(--court); color: #fff; border-color: var(--court);
  box-shadow: 0 6px 16px rgba(12,43,31,.28);
}
.tab.active .dot { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.tab.add { color: var(--primary); border-style: dashed; border-color: var(--line-2); font-weight: 700; }
.tab:active { transform: scale(.94); }

/* ---- sections / cards -------------------------------------------------- */
.body { padding: 6px 16px 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-top: 14px;
  overflow: hidden;
  animation: cardIn .42s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px 4px;
}
.card-head .k { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .2px; }
.card-head .k .em { color: var(--primary); }
.card-head .hint { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.card-body { padding: 8px 16px 16px; }

.sec-label {
  display: flex; align-items: center; gap: 8px;
  margin: 22px 4px 2px; font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .8px;
}
.sec-label .ln { flex: 1; height: 1px; background: var(--line); }
.sec-hint { margin: 3px 4px -4px; font-size: 11.5px; color: var(--muted); font-weight: 500; line-height: 1.4; }

/* ---- money input rows -------------------------------------------------- */
.field {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  transition: border-color .18s, box-shadow .22s, background .18s;
}
.field + .field { margin-top: 10px; }
.field:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--glow-soft), 0 0 22px var(--glow);
}
.field .ic {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-press);
}
.field .ic svg { width: 19px; height: 19px; }
.field .meta { flex: 1; min-width: 0; }
.field .meta .t { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.field .meta .d { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.2; }
.field .input-wrap { display: flex; align-items: baseline; gap: 4px; }
.field input.amt {
  width: 96px; text-align: right; border: none; background: none; outline: none;
  font-family: var(--font-num); font-size: 19px; font-weight: 700; color: var(--ink);
}
.field input.amt::placeholder { color: var(--line-2); }
.field .unit { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---- stepper ----------------------------------------------------------- */
.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line-2);
  color: var(--ink); font-size: 20px; line-height: 1;
  transition: transform .12s cubic-bezier(.2,.9,.3,1.5), background .15s, border-color .15s, box-shadow .15s;
}
.step-btn svg { width: 16px; height: 16px; }
.step-btn:active { transform: scale(.82); }
.step-btn.bump { animation: bump .32s cubic-bezier(.2,.9,.3,1.5); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.step-btn.plus { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px var(--glow); }
.step-btn.plus:active { background: var(--primary-press); }
.step-val {
  min-width: 34px; text-align: center;
  font-family: var(--font-num); font-size: 19px; font-weight: 700;
}
.step-val.pulse { animation: pulse .3s ease; }
@keyframes pulse { 0%{transform:scale(1);} 50%{transform:scale(1.25); color: var(--primary);} 100%{transform:scale(1);} }

/* ---- players ----------------------------------------------------------- */
.players-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px 8px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  font-size: 13.5px; font-weight: 600;
  animation: chipIn .3s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes chipIn { from { opacity:0; transform: scale(.8);} to {opacity:1; transform:none;} }
.pchip .av {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700;
}
.pchip input {
  border: none; background: none; outline: none; width: 78px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.pchip .x { width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.pchip .x:active { background: var(--line); }
.pchip .x svg { width: 12px; height: 12px; }
.add-player {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-press);
  font-size: 13.5px; font-weight: 700;
  border: 1.5px dashed var(--primary);
}
.add-player:active { transform: scale(.94); }
.add-player svg { width: 15px; height: 15px; }

/* ---- hour cards -------------------------------------------------------- */
.hour {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  margin-top: 12px;
  overflow: hidden;
  animation: cardIn .4s cubic-bezier(.2,.8,.2,1) both;
}
.hour.leaving { animation: cardOut .28s ease forwards; }
@keyframes cardOut { to { opacity:0; transform: translateX(40px) scale(.95); margin-top: -8px; max-height: 0; } }
.hour-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hour-no {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--court); color: #fff;
  font-family: var(--font-num); font-weight: 700; font-size: 14px;
}
.hour-no.half { background: var(--lime); color: var(--lime-ink); }
.hour-title { font-size: 13px; font-weight: 700; }
.hour-title small { display:block; font-size: 11px; color: var(--muted); font-weight: 500; }
.hour-head .spacer { flex: 1; }
.hour-shuttle { display: flex; align-items: center; gap: 6px; }
.hour-shuttle .lab { font-size: 11px; color: var(--muted); font-weight: 600; }
.mini-step { width: 28px; height: 28px; border-radius: 9px; }
.mini-step svg { width: 14px; height: 14px; }
.del-hour { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.del-hour:active { background: var(--line); color: #d23b3b; }
.del-hour svg { width: 16px; height: 16px; }

/* extras (water / snacks) */
.extra-name {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.extra-name::placeholder { color: var(--line-2); font-weight: 600; }
.extra-price { display: flex; align-items: baseline; gap: 3px; }
.extra-price .amt {
  width: 70px; text-align: right; border: none; background: none; outline: none;
  font-family: var(--font-num); font-size: 17px; font-weight: 700; color: var(--ink);
}
.extra-price .amt::placeholder { color: var(--line-2); }
.extra-price .unit { font-size: 12px; color: var(--muted); font-weight: 600; }
.extra-head:focus-within { background: #fff; }

.extra-metrics {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 9px 11px; margin-bottom: 11px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px;
}
.em-cell { display: flex; flex-direction: column; gap: 5px; }
.em-cell .em-lab { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.em-cell .extra-price {
  border: 1.5px solid var(--line); border-radius: 9px; padding: 3px 8px;
  background: var(--surface-soft); transition: border-color .15s, box-shadow .2s;
}
.em-cell .extra-price:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--glow-soft); }
.em-cell .extra-price .amt { width: 58px; font-size: 16px; }
.em-total { margin-left: auto; align-items: flex-end; text-align: right; }
.em-total .em-total-val { font-family: var(--font-num); font-size: 18px; font-weight: 700; color: var(--primary-press); }

.hour-players { padding: 11px 13px; }
.shuttle-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; margin-bottom: 11px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px;
}
.shuttle-row .sr-ic {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-press);
}
.shuttle-row .sr-ic svg { width: 17px; height: 17px; }
.shuttle-row .sr-lab { font-size: 13px; font-weight: 700; color: var(--ink); }
.shuttle-row .spacer { flex: 1; }
.hour-players-top { display: flex; align-items: center; margin-bottom: 9px; }
.hour-players-top .c { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.hour-players-top .all { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--primary); }
.hour-players-top .all:active { opacity: .6; }
.present-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.ptoggle {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px 6px 7px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4), background .15s, color .15s, border-color .15s, box-shadow .2s;
}
.ptoggle .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color:#fff; opacity:.45; transition: opacity .15s; }
.ptoggle.on {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary-press);
  box-shadow: 0 0 0 3px var(--glow-soft);
}
.ptoggle.on .av { opacity: 1; }
.ptoggle:active { transform: scale(.9); }

.add-hour-row { display: flex; gap: 10px; margin-top: 14px; }
.add-hour {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1.5px dashed var(--line-2);
  font-size: 14px; font-weight: 700; color: var(--ink);
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4), border-color .15s, box-shadow .2s;
}
.add-hour:active { transform: scale(.96); }
.add-hour:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--glow-soft); }
.add-hour .big { font-family: var(--font-num); color: var(--primary); }

.empty-hint {
  text-align: center; padding: 20px 10px; color: var(--muted);
  font-size: 13px; line-height: 1.6;
}
.empty-hint svg { width: 34px; height: 34px; opacity: .4; margin-bottom: 6px; }

/* ---- court manage row -------------------------------------------------- */
.court-name-row { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0; }
.court-name-row input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 17px; font-weight: 700; color: #fff;
}
.court-name-row input::placeholder { color: rgba(255,255,255,.4); }
.court-del { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.7); display:flex; align-items:center; gap:5px; }
.court-del svg { width: 14px; height: 14px; }

/* ---- bottom CTA -------------------------------------------------------- */
.cta-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  display: flex; gap: 10px;
  z-index: 20;
}
.cta {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 16px; border-radius: 18px;
  background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 700; letter-spacing: .3px;
  box-shadow: 0 8px 24px var(--glow), 0 1px 0 rgba(255,255,255,.2) inset;
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4), background .15s;
}
.cta:active { transform: scale(.97); background: var(--primary-press); }
.cta svg { width: 20px; height: 20px; }
.cta .amt { font-family: var(--font-num); }

/* ---- summary sheet ----------------------------------------------------- */
.scrim {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(8,18,13,.5);
  backdrop-filter: blur(3px);
  animation: fadeIn .25s ease both;
  display: flex; align-items: flex-end;
}
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
.sheet {
  position: relative; width: 100%;
  max-height: 92%;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: sheetUp .42s cubic-bezier(.2,.85,.2,1) both;
}
.sheet.closing { animation: sheetDown .3s ease forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 4px; }
.sheet-head { padding: 6px 18px 10px; display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.sheet-head .close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); }
.sheet-head .close svg { width: 17px; height: 17px; }
.sheet-scroll { overflow-y: auto; padding: 0 16px 8px; }

.seg { display: flex; gap: 6px; padding: 4px; background: var(--bg-2); border-radius: 13px; margin: 0 16px 4px; }
.seg button {
  flex: 1; padding: 9px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--muted);
  transition: background .18s, color .18s, box-shadow .18s;
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-card); }

.grand {
  margin-top: 6px;
  background: linear-gradient(160deg, var(--court-2), var(--court));
  border-radius: var(--radius); padding: 18px 18px 16px; color: #fff;
  position: relative; overflow: hidden;
}
.grand .lbl { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; }
.grand .big { font-family: var(--font-num); font-size: 40px; font-weight: 700; line-height: 1; margin-top: 4px; }
.grand .big small { font-size: 18px; opacity: .7; }
.grand .meta { margin-top: 10px; display: flex; gap: 16px; font-size: 11.5px; color: rgba(255,255,255,.7); }
.grand .meta b { color: var(--lime); font-family: var(--font-num); font-weight: 700; }

.person {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 14px; margin-top: 10px;
  box-shadow: var(--shadow-card);
  animation: cardIn .4s cubic-bezier(.2,.8,.2,1) both;
}
.person .av { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; color:#fff; font-weight: 700; font-size: 15px; }
.person .who { flex: 1; min-width: 0; }
.person .who .nm { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.2; }
.person .who .br { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.person .amt { font-family: var(--font-num); font-size: 21px; font-weight: 700; }
.person .amt small { font-size: 12px; color: var(--muted); margin-left: 2px; }

.court-block { margin-top: 16px; }
.court-block .cb-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 2px; }
.court-block .cb-head .nm { font-size: 14px; font-weight: 700; }
.court-block .cb-head .tot { margin-left: auto; font-family: var(--font-num); font-weight: 700; font-size: 15px; color: var(--primary-press); }
.cb-meta { font-size: 11.5px; color: var(--muted); margin: 0 2px 4px; }

.share-bar { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 10px; background: var(--bg); border-top: 1px solid var(--line); }
.share-bar button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 15px; font-size: 14.5px; font-weight: 700;
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4);
}
.share-bar button:active { transform: scale(.96); }
.share-bar .copy { background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.share-bar .share { background: var(--court); color: #fff; }
.share-bar button svg { width: 18px; height: 18px; }

/* ---- toast ------------------------------------------------------------- */
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600; z-index: 60; opacity: 0;
  box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 8px;
  pointer-events: none; transition: opacity .25s, transform .25s cubic-bezier(.2,.9,.3,1.4);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 16px; height: 16px; color: var(--lime); }

/* ---- misc -------------------------------------------------------------- */
.empty-state { text-align: center; padding: 30px 20px; color: var(--muted); font-size: 14px; }

/* ---- donate ------------------------------------------------------------ */
.donate {
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin: 26px 0 8px;
  padding: 15px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--line);
  box-shadow: var(--shadow-card);
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4), box-shadow .2s, border-color .2s;
}
.donate:active { transform: scale(.97); }
.donate:hover { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,210,30,.18); }
.donate .d-ic {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #ffe27a, var(--yellow)); color: #6b4e00;
}
.donate .d-ic svg { width: 22px; height: 22px; }
.donate .d-tx { flex: 1; text-align: left; }
.donate .d-tx .t { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.donate .d-tx .s { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.donate .d-arrow { color: var(--muted); }
.donate .d-arrow svg { width: 18px; height: 18px; }

.qr-sheet {
  position: relative; width: 100%; max-height: 94%;
  background: var(--bg); border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; align-items: center;
  padding: 0 20px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp .42s cubic-bezier(.2,.85,.2,1) both;
}
.qr-sheet.closing { animation: sheetDown .3s ease forwards; }
.qr-sheet h2 { margin: 4px 0 2px; font-size: 18px; font-weight: 700; }
.qr-sheet .qr-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; text-align: center; }
.qr-img {
  width: 100%; max-width: 300px; border-radius: 18px;
  border: 1px solid var(--line); background: #fff;
  box-shadow: var(--shadow-card); display: block;
}
.qr-actions { display: flex; gap: 10px; width: 100%; max-width: 340px; margin-top: 16px; }
.qr-actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 15px; font-size: 14.5px; font-weight: 700;
  transition: transform .14s cubic-bezier(.2,.9,.3,1.4);
}
.qr-actions button:active { transform: scale(.96); }
.qr-actions .qr-close { background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.qr-actions .qr-save { background: var(--court); color: #fff; }
.qr-actions button svg { width: 18px; height: 18px; }
.qr-thanks { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }

/* install help */
.install-help { align-items: stretch; }
.install-help h2, .install-help .qr-sub { text-align: center; }
.howto { list-style: none; margin: 6px 0 4px; padding: 0; width: 100%; }
.howto li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 14px; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 14px; line-height: 1.45; color: var(--ink);
}
.howto li .n {
  flex: none; width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--court); color: #fff;
  font-family: var(--font-num); font-weight: 700; font-size: 14px;
}
.howto li b { font-weight: 700; }
.howto li .ic { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: middle; border-radius: 6px; background: var(--primary-soft); color: var(--primary-press); margin: 0 1px; }
.howto li .ic svg { width: 14px; height: 14px; }
