/* Ward Khoj — visual system.
   Built for cheap Android phones held in direct sunlight: light theme only,
   high contrast, large touch targets, system fonts so nothing waits on a
   network. Dark mode is deliberately not supported — this app is used
   outdoors in daylight, where a dark screen is unreadable. */

:root {
  /* surfaces */
  --bg: #eef1f6;
  --bg-2: #e6eaf2;
  --card: #ffffff;
  --card-2: #f7f9fc;

  /* ink */
  --ink: #0c1220;
  --ink-2: #38445c;
  --muted: #6b7688;
  --faint: #98a2b3;

  /* lines */
  --line: #dfe5ee;
  --line-2: #edf1f7;

  /* brand — deep navy, the colour of the header and every primary action */
  --navy: #0e2452;
  --navy-2: #1c407f;
  --navy-3: #2b5cae;
  --on-navy: #f4f7fc;
  --on-navy-dim: #9fb3d4;

  /* tricolour accents, used sparingly */
  --saffron: #ff9933;
  --saffron-ink: #b45309;
  --saffron-bg: #fff4e6;
  --green: #12894f;
  --green-ink: #0c6b3e;
  --green-bg: #e8f7ee;

  --gold: #b07d1a;
  --focus: #2b5cae;
  --male: #1d4ed8;
  --male-bg: #e8eefc;
  --female: #b31860;
  --female-bg: #fceaf2;
  --other: #5b6478;
  --other-bg: #eef0f4;
  --ok: #0c6b3e;
  --warn: #a83208;
  --warn-bg: #fdeeea;

  /* shape */
  --r: 18px;
  --r-sm: 13px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(14,36,82,.06), 0 1px 3px rgba(14,36,82,.05);
  --shadow: 0 2px 6px rgba(14,36,82,.07), 0 12px 28px rgba(14,36,82,.09);
  --shadow-lg: 0 -2px 8px rgba(14,36,82,.06), 0 -18px 44px rgba(14,36,82,.16);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light only;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html { background: var(--bg-2); }
body {
  margin: 0 auto; padding: 0;
  max-width: 560px;
  background: var(--bg); color: var(--ink);
  font-family: "Nirmala UI", "Noto Sans Devanagari UI", "Noto Sans Devanagari",
               "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 16px; line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 600px) {
  body { box-shadow: 0 0 0 1px var(--line), 0 24px 70px rgba(14,36,82,.14); min-height: 100vh; }
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.view { min-height: 100vh; }
.view.centred {
  display: flex; align-items: center; justify-content: center;
  padding: 24px; padding-top: calc(24px + var(--safe-t));
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, #ffffff 0%, rgba(255,255,255,0) 60%),
    var(--bg);
}
.pad { padding: 16px 16px calc(34px + var(--safe-b)); }

/* ============ activation ============ */
.stack { width: 100%; max-width: 400px; text-align: center; }
.mark {
  width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 24px;
  background: linear-gradient(155deg, var(--navy-3), var(--navy));
  color: #fff; display: grid; place-items: center;
  font-size: 36px; font-weight: 700; line-height: 1;
  box-shadow: 0 10px 26px rgba(14,36,82,.28), inset 0 1px 0 rgba(255,255,255,.28);
  position: relative;
}
.mark::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: -7px; height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--saffron) 0 33%, #ffffff 33% 66%, var(--green) 66% 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.mark.small { width: 54px; height: 54px; font-size: 26px; border-radius: 17px; margin: 0 0 18px; }
.mark.small::after { left: 12px; right: 12px; bottom: -6px; height: 3px; }
.title { margin: 0 0 6px; font-size: 29px; font-weight: 700; letter-spacing: -.5px; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.code-input {
  width: 100%; padding: 16px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 25px; font-weight: 700; line-height: 1.3;
  letter-spacing: 2px; text-align: center; text-transform: uppercase;
  box-shadow: var(--shadow-sm); -webkit-appearance: none;
}
.code-input::placeholder {
  color: var(--faint); font-weight: 500; letter-spacing: 2px; text-transform: none;
}
.code-input:focus { outline: 3px solid rgba(43,92,174,.35); outline-offset: 0; border-color: var(--navy-3); }
.fine { color: var(--muted); font-size: 13px; margin-top: 20px; line-height: 1.55; }
.msg { min-height: 20px; font-size: 14.5px; margin: 12px 0 0; line-height: 1.5; }
.msg.err { color: var(--warn); font-weight: 600; }
.msg.ok { color: var(--ok); font-weight: 600; }

.setup-pad { padding-top: calc(34px + var(--safe-t)); max-width: 460px; margin: 0 auto; }
.setup-pad .title { text-align: left; font-size: 26px; }
.setup-pad .sub { text-align: left; margin-bottom: 24px; }
.setup-pad .field { margin-bottom: 20px; }
.setup-pad .fine { text-align: center; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--r-sm); padding: 13px 16px; cursor: pointer; font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.btn.primary {
  background: linear-gradient(160deg, var(--navy-2), var(--navy));
  color: var(--on-navy); border-color: transparent;
  box-shadow: 0 2px 4px rgba(14,36,82,.18), 0 10px 22px rgba(14,36,82,.22),
              inset 0 1px 0 rgba(255,255,255,.16);
}
.btn.gold {
  background: linear-gradient(160deg, #d99a2b, #b07d1a); color: #fff; border-color: transparent;
  box-shadow: 0 2px 4px rgba(176,125,26,.2), 0 10px 22px rgba(176,125,26,.24);
}
.btn.green {
  background: linear-gradient(160deg, #17a05d, var(--green-ink)); color: #fff; border-color: transparent;
  box-shadow: 0 2px 4px rgba(12,107,62,.2), 0 10px 22px rgba(12,107,62,.22);
}
.btn.big { padding: 16px 18px; font-size: 17px; width: 100%; margin-top: 16px; border-radius: var(--r); }
.btn.block { width: 100%; }
.btn.tiny { padding: 8px 13px; font-size: 13.5px; border-radius: 10px; box-shadow: none; }
.btn.ext {
  margin-top: 12px; padding: 15px 18px; font-size: 15.5px; border-radius: var(--r);
  text-decoration: none; color: var(--navy-2); border-color: #c9d6ea; background: #f5f8ff;
}
.btn.ext svg { flex: none; opacity: .75; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; box-shadow: none; }
.icon-btn {
  background: none; border: 0; padding: 9px 11px; font-size: 20px; line-height: 1;
  color: var(--ink-2); cursor: pointer; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active { background: var(--line-2); }
.icon-btn.light { color: #cfdcf1; }
.icon-btn.light:active { background: rgba(255,255,255,.14); }

/* ============ hero header ============ */
.hero {
  position: sticky; top: 0; z-index: 20;
  background:
    radial-gradient(130% 100% at 88% 0%, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(162deg, var(--navy-2) 0%, var(--navy) 74%);
  padding: calc(12px + var(--safe-t)) 15px 16px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 24px rgba(14,36,82,.22);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(90deg, var(--saffron) 0 33.3%, #f4f7fc 33.3% 66.6%, #19b567 66.6% 100%);
  opacity: .95;
}
.hero-top { display: flex; align-items: center; gap: 11px; }
.ident { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.avatar {
  width: 46px; height: 46px; border-radius: 14px; object-fit: cover; flex: none;
  background: rgba(255,255,255,.14); color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3), 0 3px 8px rgba(0,0,0,.2);
}
.avatar-text { display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.ident-text { flex: 1; min-width: 0; }
.cand-name {
  font-weight: 700; font-size: 16.5px; color: #ffffff; letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cand-meta {
  font-size: 12.5px; color: var(--on-navy-dim); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.party-mark {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.6);
}
.party-mark canvas, .party-mark img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }

.searchwrap { position: relative; margin-top: 14px; }
.s-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--faint); pointer-events: none;
}
.search {
  width: 100%; padding: 15px 44px 15px 42px; font-size: 17px;
  border-radius: 15px; border: 0; background: var(--card); color: var(--ink);
  -webkit-appearance: none; font-weight: 500;
  box-shadow: 0 3px 12px rgba(6,14,32,.22), inset 0 0 0 1px rgba(255,255,255,.4);
}
.search::placeholder { color: var(--faint); font-weight: 400; }
.search:focus { outline: 3px solid rgba(255,153,51,.75); outline-offset: 0; }
.search::-webkit-search-cancel-button { display: none; }
.clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--line-2); font-size: 20px; color: var(--muted);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; line-height: 28px;
  padding: 0; text-align: center;
}

/* ============ chips ============ */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 13px 15px 3px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); border-radius: 999px; padding: 8px 15px;
  font-size: 14px; cursor: pointer; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .12s ease, color .12s ease, transform .08s ease;
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] {
  background: linear-gradient(160deg, var(--navy-2), var(--navy));
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(14,36,82,.28);
}
.chip.soft { background: var(--card-2); font-weight: 500; color: var(--muted); }
.count {
  font-size: 13px; color: var(--muted); padding: 12px 17px 2px; font-weight: 600;
  letter-spacing: .1px;
}

/* ============ start state ============ */
.start { padding: 16px 15px calc(34px + var(--safe-b)); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.tile {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px 16px; box-shadow: var(--shadow-sm);
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--line);
}
.tile.all::before { background: linear-gradient(180deg, var(--saffron) 0 33%, #cfd8e6 33% 66%, var(--green) 66% 100%); }
.tile.m::before { background: var(--male); }
.tile.f::before { background: var(--female); }
.tile.p::before { background: var(--gold); }
.tile-n {
  font-size: 27px; font-weight: 700; letter-spacing: -.8px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.tile-l { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 600; }
.tile.m .tile-n { color: var(--male); }
.tile.f .tile-n { color: var(--female); }
.tile.p .tile-n { color: var(--gold); }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted); font-weight: 700;
  margin: 24px 4px 10px; letter-spacing: .6px; text-transform: none;
}
.section-head button {
  border: 0; background: none; color: var(--navy-3); font-size: 12.5px;
  font-weight: 700; cursor: pointer; padding: 2px 4px;
}
.recent-q { display: flex; flex-wrap: wrap; gap: 8px; }

.hint {
  margin-top: 22px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 17px; box-shadow: var(--shadow-sm);
  color: var(--ink-2); font-size: 14px; line-height: 1.6;
}
.hint-title { font-weight: 700; color: var(--ink); font-size: 15.5px; margin-bottom: 8px; }
.hint p { margin: 0 0 9px; }
.hint p:last-child { margin-bottom: 0; }
.hint b { color: var(--ink); }
.kbd {
  display: inline-block; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px; font-weight: 700; color: var(--navy-2);
  font-size: 13.5px;
}

.setup-card {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: linear-gradient(160deg, #fff8ee, #fffdfa);
  border: 1px solid #f0dcbc; border-radius: var(--r);
  padding: 14px 15px; margin-bottom: 13px; cursor: pointer;
  box-shadow: var(--shadow-sm); font: inherit; color: inherit;
}
.setup-card:active { transform: scale(.99); }
.setup-icon {
  flex: none; width: 42px; height: 42px; border-radius: 13px;
  background: var(--saffron-bg); border: 1px solid #f2d9b4;
  display: grid; place-items: center; font-size: 20px;
}
.setup-text { flex: 1; min-width: 0; }
.setup-title { font-weight: 700; font-size: 15.5px; }
.setup-sub { font-size: 12.5px; color: var(--saffron-ink); margin-top: 2px; font-weight: 600; }

/* ============ results ============ */
.results { padding: 9px 15px calc(34px + var(--safe-b)); }
.row {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 13px; margin-bottom: 9px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .12s ease;
}
.row:active { transform: scale(.99); background: var(--card-2); }
.pill {
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.pill.M { background: var(--male-bg); color: var(--male); }
.pill.F { background: var(--female-bg); color: var(--female); }
.pill.O { background: var(--other-bg); color: var(--other); }
.row-main { flex: 1; min-width: 0; }
.row-name {
  font-weight: 700; font-size: 16.5px; line-height: 1.3; letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub {
  font-size: 13.5px; color: var(--ink-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-meta {
  font-size: 12.5px; color: var(--muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-meta b { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row mark {
  background: linear-gradient(180deg, rgba(255,153,51,0) 62%, rgba(255,153,51,.45) 62%);
  color: inherit; font-weight: 800; border-radius: 2px;
}
.row-sr {
  flex: none; text-align: center; min-width: 54px;
  background: var(--card-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 6px 8px;
}
.row-sr span { display: block; font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: .3px; }
.row-sr b {
  display: block; font-size: 17px; font-weight: 700; color: var(--navy-2);
  font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.3px;
}
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px;
  padding: 1px 7px; margin-left: 6px; vertical-align: 1px;
  background: var(--green-bg); color: var(--green-ink);
}

.empty { text-align: center; padding: 52px 28px; color: var(--muted); }
.empty-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px;
  display: grid; place-items: center; font-size: 26px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.empty h2 { font-size: 18.5px; color: var(--ink); margin: 0 0 8px; font-weight: 700; }
.empty p { margin: 0 auto; font-size: 14.5px; line-height: 1.6; max-width: 330px; }

/* ============ ward list ============ */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
  gap: 4px; padding: calc(9px + var(--safe-t)) 9px 9px;
  background: rgba(238,241,246,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar-title { font-weight: 700; font-size: 16.5px; }
.bar-space { flex: 1; }
.list { margin-bottom: 14px; }
.ward-head {
  font-size: 12px; color: var(--muted); font-weight: 700;
  margin: 20px 4px 9px; letter-spacing: .6px;
}
.part {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 14px; margin-bottom: 9px; box-shadow: var(--shadow-sm);
}
.part-badge {
  flex: none; width: 42px; height: 42px; border-radius: 13px;
  background: var(--card-2); color: var(--navy-2);
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  border: 1px solid var(--line-2); font-variant-numeric: tabular-nums;
}
.part-main { flex: 1; min-width: 0; }
.part-title { font-weight: 700; font-size: 15.5px; }
.part-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.part-sub.warn { color: var(--warn); font-weight: 600; }
.part.total { background: linear-gradient(160deg, var(--navy-2), var(--navy)); border-color: transparent; }
.part.total .part-title { color: #fff; font-size: 16.5px; }
.part.total .part-sub { color: var(--on-navy-dim); }
.part.total .part-badge { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.2); }
.progress-box { margin: 14px 0; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--navy-3), var(--navy-2));
  transition: width .18s ease;
}

/* ============ sheets ============ */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.sheet-back {
  position: absolute; inset: 0; background: rgba(8,14,28,.46);
  backdrop-filter: blur(3px); animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-card {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto;
  max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 6px 17px calc(24px + var(--safe-b));
  box-shadow: var(--shadow-lg);
  animation: rise .24s cubic-bezier(.2,.9,.3,1);
}
@keyframes rise { from { transform: translateY(26px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) {
  .sheet { align-items: center; justify-content: center; }
  .sheet-card { max-width: 520px; border-radius: 22px; max-height: 88vh; }
}
.sheet-grip { width: 44px; height: 5px; border-radius: 99px; background: #cfd6e2; margin: 9px auto 15px; }

.v-head { display: flex; gap: 13px; align-items: flex-start; margin: 0 2px 2px; }
.v-name { font-size: 23px; font-weight: 700; line-height: 1.25; letter-spacing: -.4px; }
.v-rel { color: var(--ink-2); margin-top: 4px; font-size: 14.5px; }

/* the three numbers a booth worker actually reads out */
.v-nums {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin: 16px 0 12px;
  box-shadow: var(--shadow-sm);
}
.v-num { background: var(--card); padding: 13px 8px; text-align: center; }
.v-num span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .3px; }
.v-num b {
  display: block; font-size: 25px; font-weight: 700; color: var(--navy); margin-top: 3px;
  font-variant-numeric: tabular-nums; letter-spacing: -.6px; line-height: 1.15;
}

.v-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 3px 16px; margin: 12px 0; box-shadow: var(--shadow-sm);
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); padding: 11px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.kv dd {
  margin: 0; font-weight: 600; padding: 11px 0; text-align: right;
  border-bottom: 1px solid var(--line-2); padding-left: 14px; word-break: break-word;
}
.kv dt:nth-last-of-type(1), .kv dd:nth-last-of-type(1) { border-bottom: 0; }
.sheet h3 {
  font-size: 12px; color: var(--muted); font-weight: 700;
  margin: 22px 4px 10px; letter-spacing: .6px;
}
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.actions .btn { padding: 15px 8px; font-size: 15.5px; }
.actions .span2 { grid-column: 1 / -1; }
.family .row { margin-bottom: 8px; }
.sheet p { font-size: 14.5px; line-height: 1.62; color: var(--ink-2); margin: 0 4px 11px; }
.sheet p.fine { margin-top: 14px; }

.menu-list { padding-bottom: 6px; }
.menu-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 15px 15px; margin-bottom: 9px;
  font-size: 15.5px; cursor: pointer; font-weight: 600; box-shadow: var(--shadow-sm);
}
.menu-item:active { background: var(--card-2); }
.menu-item .mi-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.menu-arrow { color: var(--faint); font-size: 20px; flex: none; }
.menu-item.danger { color: var(--warn); }

/* party picker */
.party-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin: 4px 0 6px;
}
.party-opt {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
  padding: 14px 8px 12px; cursor: pointer; text-align: center;
  box-shadow: var(--shadow-sm); transition: border-color .12s ease, transform .08s ease;
}
.party-opt:active { transform: scale(.97); }
.party-opt[aria-pressed="true"] { border-color: var(--navy-2); background: #f5f8ff; }
.party-opt canvas, .party-opt .po-img {
  width: 54px; height: 54px; display: block; margin: 0 auto 8px;
  border-radius: 50%; object-fit: cover;
}
.party-opt .po-img { border: 1px solid var(--line); }
.party-opt .po-none {
  width: 54px; height: 54px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--card-2); border: 1px dashed var(--line); display: grid;
  place-items: center; color: var(--faint); font-size: 20px;
}
.party-opt .po-name { font-size: 13px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.party-opt .po-sym { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

.field { margin: 6px 0 2px; }
.field label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 4px 6px; }
.field input[type="text"] {
  width: 100%; padding: 13px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 15.5px; box-shadow: var(--shadow-sm);
}
.field input[type="text"]:focus { outline: 3px solid rgba(43,92,174,.3); border-color: var(--navy-3); }

.preview-wrap {
  margin: 12px 0 4px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm);
}
.preview-wrap img { width: 100%; display: block; }

/* ============ banner and toast ============ */
.banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: calc(100% - 20px); max-width: 540px;
  bottom: calc(12px + var(--safe-b));
  z-index: 70; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 9px 13px 15px; box-shadow: var(--shadow);
}
.banner-text { flex: 1; font-size: 13.5px; line-height: 1.45; font-weight: 500; }
.toast {
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-b));
  transform: translateX(-50%); z-index: 90;
  background: var(--navy); color: #fff;
  padding: 13px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(14,36,82,.35); max-width: 90vw; text-align: center;
  animation: rise .2s ease;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
