/* Layout: one tall touch list under a sticky control bar (progress, search, filters); each shooter is a full-width tap row. */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --ink: #16211c;
  --muted: #5d6b64;
  --line: #d8e0dc;
  --accent: #1d6b48;
  --done-bg: #c9f2cf;
  --done-ink: #4c6656;
  --tr: #2f5d8a;   --tr-bg: #e3ecf6;
  --fo: #8a5a12;   --fo-bg: #f8ecd6;
  --fs: #5b4a9e;   --fs-bg: #ece9f8;
  --ftr: #1f7470;  --ftr-bg: #dcf0ee;
  --sp: #8a2f5e;   --sp-bg: #f7e4ee;
  --danger: #a3332b;
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1613; --surface: #17211c; --ink: #e6efe9; --muted: #93a39b; --line: #2a3832;
    --accent: #5fc893; --done-bg: #1f4a2e; --done-ink: #a3c2af;
    --tr: #9cc1ea; --tr-bg: #1d2c3d; --fo: #e8bd73; --fo-bg: #3a2c14; --ftr: #7fd3cc; --ftr-bg: #143633;
    --fs: #c3b8f2; --fs-bg: #2a2440; --sp: #eda6ca; --sp-bg: #3d1e2f;
    --danger: #f08a80; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1613; --surface: #17211c; --ink: #e6efe9; --muted: #93a39b; --line: #2a3832;
  --accent: #5fc893; --done-bg: #1f4a2e; --done-ink: #a3c2af;
  --tr: #9cc1ea; --tr-bg: #1d2c3d; --fo: #e8bd73; --fo-bg: #3a2c14; --ftr: #7fd3cc; --ftr-bg: #143633;
  --fs: #c3b8f2; --fs-bg: #2a2440; --sp: #eda6ca; --sp-bg: #3d1e2f;
  --danger: #f08a80; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; -webkit-tap-highlight-color: transparent; }
[hidden]:not([hidden=until-found i]) { display: none !important; }
img { max-width: 100%; }
.wrap { max-width: 900px; margin: 0 auto; padding-inline: 16px; padding-block: 0 96px; }

.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: 14px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.titles { display: grid; gap: 4px; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: 0.01em; line-height: 1; text-wrap: balance; }
.prog { font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog b { color: var(--accent); font-weight: 700; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.search { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 48px; }
.sbox { position: relative; }
.sbox .search { padding-right: 52px; }
.search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sclear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.sclear:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 8px; }
.search:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: 15px; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 10px 13px; min-height: 44px; cursor: pointer; font-variant-numeric: tabular-nums; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.seg small { font-weight: 500; opacity: .75; margin-left: 4px; }

#list { display: grid; margin-top: 8px; }
.row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px 10px 10px; min-height: 68px; cursor: pointer; transition: background .15s ease; }
.row:first-child { border-radius: 12px 12px 0 0; }
.row:last-child { border-radius: 0 0 12px 12px; border-bottom: 0; }
.row:only-child { border-radius: 12px; }
.row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; position: relative; }
.box { width: 40px; height: 40px; border-radius: 9px; border: 2.5px solid var(--muted); display: grid; place-items: center; justify-self: center; }
.box svg { width: 26px; height: 26px; opacity: 0; transform: scale(.6); transition: opacity .12s ease, transform .12s ease; }
.who { min-width: 0; display: grid; gap: 2px; }
.name { font-size: 20px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.name span { font-weight: 400; }
.meta { font-size: 14px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.req { display: grid; justify-items: end; gap: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1; padding: 7px 10px; border-radius: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip.TR { color: var(--tr); background: var(--tr-bg); }
.chip.FO { color: var(--fo); background: var(--fo-bg); }
.chip.FS { color: var(--fs); background: var(--fs-bg); }
.chip.FTR { color: var(--ftr); background: var(--ftr-bg); }
.chip.SP, .chip.SPO { color: var(--sp); background: var(--sp-bg); }
.disc { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: right; }
.stamp { font-size: 14px; color: var(--done-ink); }

.row[aria-pressed="true"] { background: var(--done-bg); color: var(--done-ink); }
.row[aria-pressed="true"] .meta, .row[aria-pressed="true"] .disc { color: var(--done-ink); }
.row[aria-pressed="true"] .chip { opacity: .6; }
.row[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.row[aria-pressed="true"] .box svg { opacity: 1; transform: none; }
.box svg path { stroke: var(--surface); }

.state { text-align: center; padding: 48px 16px; color: var(--muted); display: grid; gap: 6px; }
.state strong { font-family: var(--font-display); font-size: 24px; color: var(--ink); }

.foot { margin-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.btn { font: inherit; font-weight: 600; font-size: 15px; padding: 10px 16px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.fbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.warn { border-color: var(--danger); color: var(--danger); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--surface); min-width: 96px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.confirm { margin-top: 14px; border: 2px solid var(--danger); border-radius: 12px; background: var(--surface); padding: 16px; display: grid; gap: 8px; }
.cq { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--danger); }
.cwhy { margin: 0; color: var(--muted); }
.cbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 9; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 14px; font-size: 16px; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.25); }
#toast button { font: inherit; font-weight: 700; background: transparent; color: var(--bg); border: 1px solid currentColor; border-radius: 8px; padding: 8px 12px; min-height: 40px; cursor: pointer; }

.net { font-size: 13px; font-weight: 600; color: var(--fo); }
.linkbtn { font: inherit; font-size: 14px; background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--accent); text-decoration: underline; cursor: pointer; }
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.card { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 20px; width: 100%; max-width: 420px; display: grid; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.card h2 { margin: 0; font-family: var(--font-display); font-size: 28px; }
.card p { margin: 0; color: var(--muted); }
.card .err { color: var(--danger); min-height: 1.2em; }
.card .row2 { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 520px) {
  h1 { font-size: 28px; } .prog { font-size: 20px; }
  .row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .box { width: 34px; height: 34px; } .name { font-size: 18px; } .chip { font-size: 17px; }
  .seg button { padding: 10px 10px; font-size: 14px; }
  .chips { flex-direction: column; align-items: flex-end; gap: 4px; }
  .disc { font-size: 11px; letter-spacing: .05em; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
