:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#102c44;background:#dce5ed;font-synthesis:none;--navy:#082b48;--blue:#1661b1;--line:#b4c9dd;--muted:#526779;--green:#117b2f;--surface:#f5f8fc}
*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer;touch-action:manipulation}button:disabled{cursor:default;opacity:.42}button:focus-visible,a:focus-visible{outline:3px solid #f6b82d;outline-offset:2px}button{color:inherit}button svg{width:24px;height:24px;flex-shrink:0}button .label{pointer-events:none}.app-shell{max-width:600px;min-height:100dvh;margin:auto;background:linear-gradient(130deg,#fff 15%,#edf3fa 100%);box-shadow:0 0 50px #15395725;padding-bottom:calc(87px + env(safe-area-inset-bottom))}.masthead{padding:calc(18px + env(safe-area-inset-top)) 16px 17px;background:linear-gradient(130deg,#103f65,#04213c);color:white;display:flex;justify-content:space-between;align-items:center}.brand{display:flex;align-items:center;gap:9px}.brand img{object-fit:contain}.brand h1{font-size:clamp(21px,5.7vw,29px);letter-spacing:-.8px;margin:0;font-weight:800;line-height:1.1}.brand p{font-size:18px;margin:3px 0 0;letter-spacing:.2px;font-weight:600}.icon-button{border:0;border-radius:10px;min-width:44px;height:44px;background:#ffffff10;color:inherit;display:grid;place-items:center}.icon-button svg{width:26px;height:26px}main{padding:0 12px 20px}.station-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 -12px 17px;padding:0 16px 16px;background:linear-gradient(130deg,#103f65,#04213c);color:white}.station-badge{border:1px solid #a7c8e8;border-radius:9px;padding:8px 16px;min-width:113px;background:linear-gradient(135deg,#317cc1,#1c568a);box-shadow:inset 0 1px 0 #ffffff25}.station-badge strong{font-size:25px;letter-spacing:-.4px}.score-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;border:1px solid #8dabc6;border-radius:10px;overflow:hidden;font-variant-numeric:tabular-nums;background:white}.name-col{width:16.5%}.total-col{width:12%}.score-table th,.score-table td{padding:0;text-align:center}.score-table thead{color:white}.score-table .shooter-head,.score-table .total-head{background:linear-gradient(130deg,#2b4b65,#0c2a42);font-size:clamp(11px,3vw,15px);line-height:1.25;padding:5px 1px}.group-single{background:linear-gradient(#347cc3,#165b9e);font-size:17px;height:30px}.group-pair{background:linear-gradient(#ffd15c,#edb72b);color:#172a37;font-size:17px;border-left:2px solid white}.single-label{background:#0c4679;font-size:16px;height:29px;border-right:1px solid #25699f}.pair-label{background:#8b6710;font-size:16px;height:29px;border-left:1px solid #bd922c}.score-table tbody th{font-size:clamp(13px,3.8vw,19px);font-weight:750;background:#edf3f9;border-right:1px solid var(--line);padding:0 3px;text-align:left}.shooter-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.score-table tbody td,.score-table tbody th{height:65px;border-top:1px solid var(--line)}.score-table tbody td{background:#f8fbff}.score-table .pair-start{border-left:2px solid #7392ae}.score-table .pair-divider{border-left:1px solid #b5c7d6}.score-table .total-cell{border-left:1px solid var(--line);padding:3px;background:#edf3f9}.target{display:flex;align-items:center;justify-content:center;border-radius:7px;border:1px solid #738ca5;margin:0 auto;width:calc(100% - 3px);height:44px;background:white;box-shadow:inset 0 1px 1px #0d304c08;font-size:clamp(16px,4.7vw,23px);font-weight:750;color:#082b16;padding:0}.target.hit,.sample.hit{background:linear-gradient(#ecffe7,#a7e5a1);border-color:#40973d;color:#062b10}.target.lost,.sample.lost{background:linear-gradient(#fff3ef,#f3b4ae);border-color:#be5b50;color:#55120b}.target:active{transform:scale(.94)}.station-number{display:block;border-radius:6px;background:#dfe9f4;font-weight:800;font-size:clamp(20px,5.8vw,29px);padding:5px 0}.row-count{display:block;font-size:10px;color:#4b6174;margin-top:2px}.cumulative{background:linear-gradient(120deg,#24465f,#07243e);color:white;border-radius:9px;padding:13px 8px;display:grid;grid-template-columns:1.18fr repeat(4,1fr);align-items:center;text-align:center;gap:0}.cumulative-label{text-align:left;font-size:12px;line-height:1.4;font-weight:650;padding-left:4px}.cumulative-shooter{border-left:1px solid #6f899f;min-width:0}.cumulative-shooter span{display:block;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 3px}.cumulative-shooter strong{display:block;font-size:28px;line-height:1.2;margin-top:3px}.navigation{display:grid;grid-template-columns:1fr 1.25fr;gap:10px;margin-top:20px}.navigation button{display:flex;justify-content:center;align-items:center;gap:7px;min-height:56px;font-weight:700;font-size:16px;padding:8px 6px;border-radius:11px;border:1px solid #829eb8;background:#edf3fa}.navigation .next{color:white;background:linear-gradient(#178e33,#087821);border-color:#087523}.navigation button svg{width:21px}.save-status{font-size:11px;text-align:center;color:var(--muted);margin:14px 0 0;line-height:1.5}.save-status.error{color:#8c220e;font-weight:650}.connection{display:inline-block;width:6px;height:6px;border-radius:50%;background:#247b40;margin-right:4px;vertical-align:1px}.bottom-nav{position:fixed;z-index:10;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,600px);border-top:1px solid #c9d8e6;background:#f4f8fdf5;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);display:grid;grid-template-columns:repeat(4,1fr);padding:7px 8px calc(7px + env(safe-area-inset-bottom))}.bottom-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:56px;border:0;border-radius:9px;background:transparent;font-size:12px;color:#405a70}.bottom-nav svg{width:25px;height:25px}.bottom-nav button[aria-current=page]{color:#0750ae;background:#e5effb;font-weight:750}.view-heading{display:flex;align-items:end;justify-content:space-between;margin:23px 2px 18px}.view-heading h2{font-size:26px;margin:0;letter-spacing:-.5px}.eyebrow{font-size:11px;font-weight:750;letter-spacing:1.1px;text-transform:uppercase;color:var(--muted);margin:0 0 5px}.subtitle{font-size:13px;color:var(--muted);line-height:1.5;margin:8px 2px 19px}.pill{background:#e3edf8;color:#265170;border:1px solid #c1d2e4;border-radius:30px;padding:5px 8px;font-size:11px;white-space:nowrap}.card{background:white;border:1px solid #c3d3e2;border-radius:12px;padding:16px;margin:14px 0}.card h3{margin:0 0 9px;font-size:16px}.card p{font-size:13px;line-height:1.55;color:var(--muted);margin:0}.summary-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;font-variant-numeric:tabular-nums;border:1px solid #b5c9dc;border-radius:10px;overflow:hidden;background:white}.summary-table th,.summary-table td{text-align:center;padding:11px 3px;font-size:14px;border-bottom:1px solid #d4e0ec}.summary-table thead th,.summary-table tfoot th,.summary-table tfoot td{background:#0b304e;color:white;font-weight:700}.summary-table thead th{overflow:hidden;text-overflow:ellipsis}.summary-table th:first-child{width:21%}.summary-table tbody tr:nth-child(even){background:#f0f5fa}.summary-table tbody th{padding:0}.summary-table button{border:0;min-height:49px;width:100%;background:transparent;color:#0751a6;font-weight:750}.summary-table td small{display:block;font-size:10px;color:var(--muted);margin-top:2px}.summary-table tbody .current{box-shadow:inset 3px 0 #1d69b5;background:#e6f0fb}.summary-table tfoot td{font-size:20px}.summary-table tfoot small{color:#c5daec}.primary,.secondary,.danger{border:1px solid #b6cadf;border-radius:9px;min-height:47px;display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 15px;font-weight:700;background:#eef4fc;width:100%;text-decoration:none}.primary{background:#115ead;border-color:#115ead;color:white}.danger{background:#ae3026;border-color:#ae3026;color:white}.share-actions{display:grid;gap:10px}.share-preview{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.65 ui-monospace,SFMono-Regular,monospace;color:#233e55;margin:0;max-height:310px;overflow:auto}.local-note{font-size:12px;line-height:1.55;color:var(--muted);margin:16px 2px}.settings-section{border-top:1px solid #d5e0ea;padding-top:17px;margin-top:20px}.settings-section h3{font-size:15px;margin:0 0 8px}dialog{border:0;border-radius:16px;background:#f8fbff;color:#102c44;padding:21px;width:calc(100% - 28px);max-width:430px;max-height:85dvh;box-shadow:0 20px 80px #00142770;overscroll-behavior:contain}dialog::backdrop{background:#06203999;backdrop-filter:blur(3px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:15px}.dialog-heading h2{font-size:21px;margin:0}.dialog-heading .icon-button{background:#e5eef7}.name-field{display:block;margin:13px 0}.name-field span{display:block;font-size:12px;font-weight:650;margin-bottom:5px;color:var(--muted)}input{width:100%;border:1px solid #a7bdd1;border-radius:8px;background:white;padding:11px;font-size:17px;color:var(--navy)}.form-actions{display:flex;gap:9px;margin-top:18px}.dialog-copy{font-size:14px;color:#405b70;line-height:1.6}#toast{position:fixed;z-index:30;bottom:calc(96px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:#092d49;color:white;border-radius:10px;padding:11px 16px;font-size:13px;box-shadow:0 5px 25px #001a3444;max-width:90%;text-align:center;opacity:0;pointer-events:none;transition:opacity .15s}#toast.visible{opacity:1}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.backup-input{display:none}.copy-fallback{width:100%;min-height:180px;margin-top:12px;font-size:14px} .offline-hint{margin-top:10px!important}
.row-count{font-size:10px;white-space:nowrap}.cumulative-label span{white-space:nowrap;font-size:10px}.score-table tbody td,.score-table tbody th{height:61px}
@media(min-width:600px){.app-shell{margin-top:22px;margin-bottom:22px;min-height:calc(100dvh - 44px);border-radius:18px;overflow:hidden}.masthead{padding-top:22px}.brand h1{font-size:29px}main{padding-left:18px;padding-right:18px}.station-top{margin-left:-18px;margin-right:-18px;padding-left:22px;padding-right:22px}.score-table tbody th{font-size:20px;padding-left:7px}.score-table tbody td,.score-table tbody th{height:74px}.target{height:49px;font-size:24px;width:calc(100% - 6px)}.bottom-nav{border-radius:0 0 18px 18px;bottom:0}.cumulative-label{font-size:15px}.cumulative-shooter span{font-size:15px}}
@media(max-width:350px){main{padding-left:8px;padding-right:8px}.station-top{margin-left:-8px;margin-right:-8px}.masthead{padding-left:10px;padding-right:10px}.brand{gap:5px}.brand img{width:39px;height:39px}.brand h1{font-size:21px}.brand p{font-size:16px}.navigation button{font-size:14px;gap:3px}.legend{gap:8px;font-size:11px}.cumulative{padding-left:5px;padding-right:5px}.cumulative-shooter span{font-size:11px}.cumulative-label{font-size:11px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media print{body,.app-shell{background:white;box-shadow:none;margin:0;max-width:none}.bottom-nav,.masthead button,.share-actions,.save-status{display:none}.app-shell{padding-bottom:0}.share-preview{max-height:none;overflow:visible}}

/* The score view flows within the current Safari/Home Screen viewport. Keep
   the table's shared columns and 44px target buttons; remove surrounding bulk. */
.scoring{min-height:100vh;min-height:100dvh;padding-bottom:0;display:flex;flex-direction:column}
.masthead{padding:calc(8px + env(safe-area-inset-top)) 12px 8px}
.brand img{width:44px;height:44px}.brand h1{font-size:clamp(21px,5.7vw,27px)}
.scoring main{flex:1;padding-bottom:6px}
.station-top{margin-bottom:10px;padding:0 12px 8px;justify-content:flex-start}
.station-badge{min-width:0;border-radius:7px;padding:4px 10px;display:flex;align-items:baseline;box-shadow:none}
.station-badge strong{font-size:20px;line-height:1.2}
.cumulative{margin-top:10px;padding:7px 6px}.cumulative-label{font-size:11px;line-height:1.25}
.cumulative-shooter span{font-size:11px}.cumulative-shooter strong{font-size:23px;margin-top:1px}
.navigation{margin-top:10px;gap:8px}.navigation button{min-height:48px;font-size:14px;gap:4px;padding:6px 4px}
.score-view .save-status{margin:7px 0 0;font-size:10px;line-height:1.3}
.scoring .bottom-nav{position:sticky;left:auto;transform:none;margin-top:auto;flex-shrink:0;padding:4px 8px calc(4px + env(safe-area-inset-bottom));width:100%}
.bottom-nav button{min-height:48px;gap:2px}.bottom-nav svg{width:23px;height:23px}
@media(max-height:650px) and (max-width:599px){
 .masthead{padding-top:calc(4px + env(safe-area-inset-top));padding-bottom:4px}
 .station-top{margin-bottom:6px;padding-bottom:6px}
 .score-table tbody td,.score-table tbody th{height:53px}
 .cumulative{margin-top:6px;padding-top:5px;padding-bottom:5px}
 .navigation{margin-top:6px}.navigation button{min-height:44px}
 .scoring .bottom-nav{padding-top:2px;padding-bottom:calc(2px + env(safe-area-inset-bottom))}
}

.shooting-date {
  display:flex;align-items:center;gap:6px;min-width:0;min-height:34px;
  padding:4px 8px;border:1px solid #a7c8e8;border-radius:7px;
  background:#ffffff10;color:white;font-size:14px;font-weight:650;
}
.shooting-date span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shooting-date svg {width:15px;height:15px}
#date-form input {min-height:44px}

.score-table tbody .first-shooter {background:#fff1c2;box-shadow:inset 3px 0 #b58115;padding-left:6px}
.first-tag {
  display:inline-block;vertical-align:top;margin-top:3px;padding:1px 5px;border-radius:4px;
  background:#775100;color:white;font-size:10px;font-weight:800;line-height:1.2;
}

.showing-totals {padding-bottom:calc(57px + env(safe-area-inset-bottom))}
.showing-totals main {padding-bottom:6px}
.totals-view .view-heading {margin:12px 2px}
.totals-view .eyebrow {margin-bottom:3px}
.totals-table {
  width:100%;table-layout:fixed;border:1px solid #b5c9dc;border-radius:10px;
  border-spacing:0;overflow:hidden;background:white;font-variant-numeric:tabular-nums;
}
.totals-table th,.totals-table td {text-align:center;padding:8px 3px}
.totals-table th:first-child {width:31%;text-align:left;padding-left:9px}
.totals-table thead th {background:#0b304e;color:white;font-size:12px}
.totals-table tbody th,.totals-table tbody td {padding-block:9px;line-height:1.1}
.totals-table tbody th {font-size:21px}
.totals-table tbody td {font-size:20px;white-space:nowrap}
.totals-table tbody strong {display:block;font-size:25px;font-weight:800}
.totals-table tbody tr:nth-child(even) {background:#f0f5fa}
.totals-table tbody tr+tr > * {border-top:1px solid #d4e0ec}
.totals-table small {display:block;color:var(--muted);font-size:16px}
.totals-table progress {
  display:block;appearance:none;-webkit-appearance:none;width:100%;max-width:86px;
  height:5px;margin:4px auto 0;border:0;border-radius:10px;background:#e5edf5;overflow:hidden;
}
.totals-table progress::-webkit-progress-bar {background:#e5edf5}
.totals-table progress::-webkit-progress-value {background:#1f69af}
.totals-table progress::-moz-progress-bar {background:#1f69af}
.totals-progress {margin:12px 2px 2px;font-size:18px}
.totals-note {margin:0 2px 10px;font-size:12px;color:var(--muted)}
.totals-view .save-status {margin-top:6px}

@media(max-height:620px) and (max-width:599px) {
  .showing-totals .masthead {padding-top:env(safe-area-inset-top);padding-bottom:0}
  .showing-totals main {padding-bottom:4px}
  .totals-view .view-heading {margin-block:4px}
  .totals-table tbody th,.totals-table tbody td {padding-block:7px}
  .totals-progress {margin-top:6px}
  .totals-note {margin-bottom:5px}
  .totals-view .secondary {min-height:44px;padding-block:8px}
  .totals-view .save-status {margin-top:4px}
}

@media(max-height:560px) and (max-width:599px) {
  .scoring .masthead {padding-top:env(safe-area-inset-top);padding-bottom:0}
  .scoring main {padding-bottom:3px}
  .station-top {padding-bottom:2px;margin-bottom:2px}
  .cumulative {margin-top:4px;padding-top:3px;padding-bottom:3px}
  .navigation {margin-top:4px}
  .score-view .save-status {margin-top:5px}
}
