:root{
  --theme-primary:#244c3a;--theme-primary-2:#183629;--theme-accent:#b64a3c;--theme-soft:#eef2ed;--theme-stripe:#6d9874;
  --paper:#fffdf8;--cream:#f2ecdf;--ink:#202428;--muted:#6f746f;--line:#d4cec2;--soft:#f8f6f1;--shadow:0 2px 9px rgba(25,30,27,.055);
  --play-black:#171717;--score-green:#49a56a;--out-red:#c83b32;
}
body[data-theme="regular"]{--theme-primary:#244c3a;--theme-primary-2:#183629;--theme-accent:#b64a3c;--theme-soft:#eef2ed;--theme-stripe:#6d9874}
body[data-theme="wildcard"]{--theme-primary:#34383e;--theme-primary-2:#24272b;--theme-accent:#c47a3b;--theme-soft:#f2eee8;--theme-stripe:#c47a3b}
body[data-theme="division"]{--theme-primary:#173a62;--theme-primary-2:#0d2745;--theme-accent:#c7a34c;--theme-soft:#edf2f7;--theme-stripe:#c7a34c}
body[data-theme="championship"]{--theme-primary:#172b49;--theme-primary-2:#0c1b30;--theme-accent:#b62d3b;--theme-soft:#eef1f5;--theme-stripe:#b62d3b}
body[data-theme="worldseries"]{--theme-primary:#0d2747;--theme-primary-2:#07182d;--theme-accent:#c8a54f;--theme-soft:#eff2f6;--theme-stripe:#c8a54f}
body[data-theme="crosstown"]{--theme-soft:#f1f2f3}
*{box-sizing:border-box}html{background:#efede8;-webkit-text-size-adjust:100%}body{margin:0;color:var(--ink);font-family:"Liberation Sans",Arial,Helvetica,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#efede8}button,select,input,textarea{font:inherit;-webkit-tap-highlight-color:transparent}.app-shell{max-width:1800px;margin:auto;padding:calc(6px + env(safe-area-inset-top)) 6px calc(18px + env(safe-area-inset-bottom))}
.hero{background:linear-gradient(145deg,var(--theme-primary),var(--theme-primary-2));color:#fff;border-radius:12px;padding:10px 12px 0;box-shadow:0 3px 12px rgba(0,0,0,.10);display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;overflow:hidden}.brand-block{min-width:0;padding-bottom:9px}.hero h1{font:700 22px "Liberation Sans",Arial,Helvetica,sans-serif;margin:2px 0 0;letter-spacing:-.015em}.theme-badge{display:inline-flex;align-items:center;min-height:20px;padding:3px 7px;border:1px solid rgba(255,255,255,.22);border-radius:999px;background:rgba(255,255,255,.08);font-size:8px;font-weight:850;text-transform:uppercase;letter-spacing:.08em;color:rgba(255,255,255,.88)}.hero-actions{display:flex;gap:5px;align-items:center}.hero button{border:1px solid rgba(255,255,255,.20);border-radius:8px;padding:7px 9px;color:white;background:rgba(255,255,255,.08);font-size:11px;font-weight:800}.hero .primary-action{background:white;color:var(--theme-primary-2);border-color:white}.hero .icon-more{font-size:15px;letter-spacing:1px;min-width:36px}.theme-stripe{height:5px;grid-column:1/-1;margin:0 -12px;background:var(--theme-stripe)}body[data-theme="crosstown"] .hero{background:linear-gradient(110deg,var(--cross-away,#0e3386) 0 48%,var(--cross-home,#27251f) 52% 100%)}body[data-theme="crosstown"] .theme-stripe{background:linear-gradient(90deg,var(--cross-away-accent,#cc3433) 0 50%,var(--cross-home-accent,#c4ced4) 50% 100%)}
.panel{margin-top:7px;background:var(--paper);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);overflow:hidden}.hidden{display:none!important}.section-details>summary,.section-summary{list-style:none;cursor:pointer}.section-details>summary::-webkit-details-marker,.scorecard>summary::-webkit-details-marker,.team-pitching>summary::-webkit-details-marker,.notes-card>summary::-webkit-details-marker{display:none}.section-summary{min-height:40px;padding:9px 11px;display:flex;align-items:center;gap:8px;background:#faf8f3;border-bottom:1px solid transparent}.section-toggle,.summary-status{margin-left:auto;font-size:10px;color:var(--muted);font-weight:800}.section-details[open]>.section-summary{border-bottom-color:var(--line)}.section-details[open]>.section-summary .section-toggle::after,.team-pitching[open]>.subsection-summary .section-toggle::after,.notes-card[open]>.subsection-summary .section-toggle::after{content:"Hide"}.section-details:not([open])>.section-summary .section-toggle::after,.team-pitching:not([open])>.subsection-summary .section-toggle::after,.notes-card:not([open])>.subsection-summary .section-toggle::after{content:"Open"}
.utility-panel{padding:9px}.utility-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.utility-grid button,.file-button{min-height:42px;border:1px solid var(--line);background:white;border-radius:8px;color:var(--ink);display:flex;align-items:center;justify-content:center;font-weight:750;text-align:center;padding:6px;cursor:pointer}.file-button input{display:none}.mini-help{margin-top:7px;padding:8px 9px;border-radius:8px;background:#f4efe4;font-size:11px;color:var(--muted)}
.setup-panel{padding:9px;display:grid;grid-template-columns:1fr 1fr;gap:8px}.team-picker,.game-meta{border:1px solid var(--line);background:#fbf9f3;border-radius:10px;padding:9px}.team-picker{display:flex;gap:10px;align-items:center;min-height:112px}.team-logo-frame{width:108px;height:108px;padding:0;border:1px solid #ded6c8;border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(14,51,134,.03)}.team-logo{display:block;width:100%;height:100%;padding:10px;object-fit:contain;object-position:center center}.team-picker-body{min-width:0;flex:1}.team-picker label,.game-meta label{display:block;text-transform:uppercase;letter-spacing:.07em;font-size:9px;font-weight:800;color:var(--muted)}select,input,textarea{width:100%;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);padding:8px}.team-picker select{margin-top:4px}.game-meta{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:9px;align-items:end}.game-meta label span{display:block;margin-bottom:4px}.game-meta input{height:42px;margin:0;font-size:14px}
.h-scroll,.scorebook-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;position:relative;isolation:isolate;overscroll-behavior-x:contain}.line-score{display:grid;grid-template-columns:112px repeat(12,38px) repeat(3,44px);min-width:700px;background:var(--theme-primary-2);color:white}.line-cell{min-height:34px;display:flex;align-items:center;justify-content:center;border-right:1px solid rgba(255,255,255,.12);border-bottom:1px solid rgba(255,255,255,.12);font-size:11px}.line-cell.head{font-size:9px;font-weight:800;color:#d3dfd5}.line-cell.team{justify-content:flex-start;padding:0 7px;gap:6px;font-weight:800}.line-cell.team img{width:28px;height:28px;object-fit:contain;object-position:center center;padding:2px;background:#fff;border-radius:4px}
.scorecard>summary.scorecard-summary{list-style:none;display:flex;align-items:center;gap:9px;padding:8px 10px;cursor:pointer;background:#faf8f3;border-bottom:1px solid transparent}.scorecard[open]>summary.scorecard-summary{border-bottom-color:var(--line)}.summary-logo-frame{width:56px;height:56px;padding:0;border:1px solid #ded6c8;border-radius:9px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}.summary-logo{display:block;width:100%;height:100%;padding:6px;object-fit:contain;object-position:center center}.scorecard>summary div:nth-child(2){display:grid}.side-label{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.scorecard[open]>.scorecard-summary .summary-status::after{content:"Hide"}.scorecard:not([open])>.scorecard-summary .summary-status::after{content:"Open"}
.inning-nav{display:flex;align-items:center;gap:6px;padding:6px 8px;background:#fbf9f3;border-bottom:1px solid var(--line)}.inning-nav button{width:36px;height:36px;border:1px solid var(--line);background:white;border-radius:8px;font-size:22px;line-height:1}.inning-nav label{font-size:9px;font-weight:800;text-transform:uppercase;color:var(--muted);display:flex;align-items:center;gap:4px}.inning-nav select{width:62px;padding:5px}
.book-grid{display:grid;grid-template-columns:32px 48px 130px 44px repeat(12,148px);min-width:2030px;align-items:stretch}.cell{min-height:154px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:#fff;min-width:0}.head-cell{min-height:36px;display:flex;align-items:center;justify-content:center;background:#f0eadf;font-weight:850;font-size:10px;position:sticky;top:0;z-index:60}.order-cell,.number-cell,.pos-cell{display:flex;align-items:center;justify-content:center;font-weight:800}.number-cell,.player-cell{padding:4px}.number-cell input{padding:7px 2px;text-align:center;font-size:16px;font-weight:850}.player-cell{display:flex;align-items:center}.player-cell input{font-size:16px;padding:7px}.pos-cell input{width:36px;padding:6px 2px;text-align:center;font-size:14px}.sticky-order{position:sticky;left:0;z-index:50;background:#fff}.sticky-number{position:sticky;left:32px;z-index:49;background:#fff}.sticky-player{position:sticky;left:80px;z-index:48;background:#fff}.sticky-pos{position:sticky;left:210px;z-index:47;background:#fff;box-shadow:2px 0 0 rgba(0,0,0,.05)}.head-cell.sticky-order,.head-cell.sticky-number,.head-cell.sticky-player,.head-cell.sticky-pos{z-index:70;background:#f0eadf}
.inning-cell{position:relative;padding:2px;background:#fff;overflow:hidden;z-index:1}.pa-entry{position:relative;border-radius:6px;min-height:132px;cursor:pointer;outline:none}.pa-entry+.pa-entry{margin-top:4px;padding-top:4px;border-top:1px dashed #ddd4c4}.pa-entry:focus-visible{box-shadow:inset 0 0 0 2px #0e3386}.diamond-area{height:122px;position:relative;display:flex;align-items:center;justify-content:center}.diamond{width:122px;height:122px;overflow:visible}.diamond-fill{fill:transparent;transition:fill .12s}.base{stroke:transparent;stroke-width:2.15;transition:stroke .12s}.base.origin,.base.advance{stroke:var(--play-black);stroke-width:4.7;stroke-linecap:round}.pa-entry.scored .diamond-fill{fill:var(--score-green);fill-opacity:.82}.play-code{position:absolute;right:8px;bottom:7px;left:auto;top:auto;display:block;text-align:right;font-size:18px;font-weight:950;z-index:2;line-height:1;color:var(--play-black)}.pa-entry.empty .play-code{display:none}.pa-entry.play-out .play-code{color:var(--out-red)}.run-dot,.runner-pill{display:none!important}.rbi-pill{position:absolute;right:8px;top:7px;left:auto;background:transparent;border:0;padding:0;display:none;font-size:11px;font-weight:900;line-height:1;color:var(--play-black);z-index:4}.rbi-pill.on{display:block}.runner-out-path{display:none;stroke:var(--out-red);stroke-width:5;stroke-linecap:round;vector-effect:non-scaling-stroke}.runner-out-mark{display:none;stroke:var(--out-red);stroke-width:4.6;stroke-linecap:round;vector-effect:non-scaling-stroke}.runner-out-label{display:none;fill:var(--out-red);stroke:white;stroke-width:2.4px;paint-order:stroke fill;font-size:7px;font-weight:950;text-anchor:middle;dominant-baseline:middle}.advance-reason-label{display:none;fill:var(--play-black);stroke:white;stroke-width:2.2px;paint-order:stroke fill;font-size:7px;font-weight:950;text-anchor:middle;dominant-baseline:middle}.pa-entry.runner-out .runner-out-path,.pa-entry.runner-out .runner-out-mark,.pa-entry.runner-out .runner-out-label{display:block}.cell-actions{display:flex;justify-content:flex-end;height:20px}.add-pa,.remove-pa{border:0;background:transparent;color:#0e3386;font-size:9px;font-weight:900;padding:1px 4px}.remove-pa{color:#8b3830}.inning-cell.third-out{box-shadow:inset 0 -4px 0 var(--out-red)}.inning-end-slash{display:none!important}
.team-pitching{border-top:1px solid var(--line);background:#fbf9f3}.subsection-summary{list-style:none;cursor:pointer;min-height:39px;padding:8px 10px;display:flex;align-items:center;gap:8px;background:#f6f1e7;border-bottom:1px solid transparent}.team-pitching[open]>.subsection-summary,.notes-card[open]>.subsection-summary{border-bottom-color:var(--line)}.pitching-wrap{padding:7px}.pitching-scroll{overflow:auto;-webkit-overflow-scrolling:touch}.pitching-table{border-collapse:collapse;min-width:850px;width:100%;background:white}.pitching-table th,.pitching-table td{border:1px solid var(--line);padding:3px;text-align:center}.pitching-table th{background:#f0eadf;font-size:9px;text-transform:uppercase;color:var(--muted)}.pitching-table input{border:0;border-radius:0;padding:6px 3px;text-align:center;font-size:11px;min-width:45px}.pitching-table td:first-child input{min-width:135px;text-align:left}.pitching-actions{display:flex;justify-content:flex-end;gap:6px;padding-top:6px}.pitching-actions button{border:1px solid var(--line);background:white;border-radius:8px;padding:6px 8px;font-size:10px;font-weight:800}
.totals-panel{padding:8px;display:grid;grid-template-columns:repeat(6,1fr);gap:6px}.metric{border:1px solid var(--line);background:#fbf9f3;border-radius:8px;text-align:center;padding:7px}.metric strong{font-size:18px;display:block}.metric span{font-size:8px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.notes-content{padding:8px;display:grid;grid-template-columns:1fr 1fr;gap:7px}.notes-card{border:1px solid var(--line);border-radius:9px;background:#fbf9f3;overflow:hidden}.notes-inner{padding:7px}.notes-card textarea{min-height:110px;resize:vertical}.toast{position:fixed;left:50%;bottom:calc(14px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(20px);background:#202428;color:white;border-radius:999px;padding:8px 13px;font-size:11px;opacity:0;pointer-events:none;transition:.2s;z-index:300}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.version-stamp{text-align:center;font-size:8px;color:#aaa;padding:8px}
/* Single mobile scoring sheet. Scorecard boxes stay visual instead of becoming control panels. */
.editor-overlay{position:fixed;inset:0;background:rgba(0,0,0,.38);z-index:500;display:flex;align-items:flex-end;justify-content:center;padding-top:env(safe-area-inset-top)}.editor-sheet{width:min(620px,100%);max-height:88vh;background:var(--paper);border-radius:18px 18px 0 0;box-shadow:0 -8px 30px rgba(0,0,0,.2);overflow:auto;padding-bottom:calc(10px + env(safe-area-inset-bottom))}.editor-head{position:sticky;top:0;z-index:2;background:#faf8f3;border-bottom:1px solid var(--line);display:grid;grid-template-columns:44px 1fr 70px;align-items:center;padding:8px 10px}.editor-head strong{text-align:center}.editor-icon,.editor-done{border:0;background:transparent;font-weight:900}.editor-icon{font-size:25px}.editor-done{color:#0e3386}.editor-body{padding:12px}.editor-field{display:grid;gap:4px;margin-bottom:10px}.editor-field>span{font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.editor-field select,.editor-field input{font-size:16px;min-height:44px}.editor-row{display:grid;grid-template-columns:1fr 90px;gap:9px}.editor-rbi{max-width:90px}.editor-check{min-height:44px;border:1px solid var(--line);border-radius:8px;display:flex;align-items:center;gap:8px;padding:8px 10px;margin-bottom:10px;background:#fff}.editor-check input{width:auto;transform:scale(1.15)}.runner-out-editor{border-top:1px solid var(--line);padding-top:10px;margin-top:3px}.runner-out-editor .editor-row{grid-template-columns:1fr 1fr}.editor-check.compact{min-height:38px;font-size:12px}.editor-clear{width:100%;border:1px solid #e2b2ad;background:#fff7f5;color:#9b312a;border-radius:9px;padding:10px;font-weight:850;margin-top:4px}
@media(max-width:900px){.notes-content{grid-template-columns:1fr}.utility-grid{grid-template-columns:repeat(3,1fr)}.totals-panel{grid-template-columns:repeat(3,1fr)}}
@media(max-width:620px){.theme-picker-card{grid-template-columns:1fr}.theme-picker-card select{width:100%}.custom-theme-controls{grid-template-columns:1fr 1fr}.app-shell{padding-left:5px;padding-right:5px}.hero{grid-template-columns:1fr}.hero-actions{grid-row:2}.setup-panel{grid-template-columns:1fr 1fr}.team-picker{display:grid;grid-template-columns:82px 1fr;min-height:94px}.team-logo-frame{width:82px;height:82px}.game-meta{grid-column:1/-1}.book-grid{grid-template-columns:30px 44px 112px 40px repeat(12,144px);min-width:1954px}.sticky-number{left:30px}.sticky-player{left:74px}.sticky-pos{left:186px}.cell{min-height:150px}.number-cell input,.player-cell input{font-size:16px}.pos-cell input{font-size:13px}.diamond-area{height:112px}.diamond{width:100px;height:100px}.play-code{font-size:18px}.totals-panel{grid-template-columns:repeat(2,1fr)}}
@media(max-width:430px){.utility-grid{grid-template-columns:1fr 1fr}.setup-panel{grid-template-columns:1fr}.game-meta{grid-column:auto;grid-template-columns:1fr 1fr}.hero h1{font-size:21px}.hero-actions button{padding:7px 8px}.book-grid{grid-template-columns:29px 42px 106px 38px repeat(12,140px);min-width:1895px}.sticky-number{left:29px}.sticky-player{left:71px}.sticky-pos{left:177px}.cell{min-height:148px}.diamond-area{height:109px}.diamond{width:98px;height:98px}}
@media print{body{background:white}.app-shell{max-width:none;padding:0}.hero,.panel{box-shadow:none}.hero-actions,.utility-panel,.inning-nav,.toast,.pitching-actions,.editor-overlay{display:none!important}.scorebook-scroll,.h-scroll,.pitching-scroll{overflow:visible}.book-grid{min-width:0;grid-template-columns:18px 26px 72px 26px repeat(12,1fr)}.cell{min-height:84px}.sticky-order,.sticky-number,.sticky-player,.sticky-pos{position:static}.diamond-area{height:72px}.diamond{width:64px;height:64px}.cell-actions{display:none}.summary-status,.section-toggle{display:none}.pitching-table{min-width:0;font-size:8px}.pitching-table input{font-size:8px;min-width:0;padding:2px}}

.utility-danger{color:#9a342f!important;border-color:#e4b9b5!important;background:#fff8f7!important}.theme-picker-card{grid-column:1/-1;border:1px solid var(--line);background:#fbfaf7;border-radius:9px;padding:9px;display:grid;grid-template-columns:minmax(140px,220px) 1fr;gap:8px;align-items:center}.theme-picker-card>label{font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}.theme-picker-card select{height:40px}.custom-theme-controls{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding-top:2px}.custom-theme-controls label{display:flex;align-items:center;gap:7px;font-size:9px;font-weight:800;text-transform:uppercase;color:var(--muted)}.custom-theme-controls input[type=color]{width:46px;height:34px;padding:2px}.scorecard-summary,.section-summary,.subsection-summary{transition:background .15s}.scorecard[open]>.scorecard-summary,.section-details[open]>.section-summary{background:linear-gradient(90deg,var(--theme-soft),#faf8f3)}.inning-nav button,.editor-done{color:var(--theme-primary)!important}.add-pa{color:var(--theme-primary)!important}.head-cell{border-top:2px solid color-mix(in srgb,var(--theme-primary) 18%, transparent)}

@media(max-width:620px){.theme-picker-card{grid-template-columns:1fr!important}.theme-picker-card select{width:100%}.custom-theme-controls{grid-template-columns:1fr 1fr}}
@media(max-width:430px){.utility-grid{grid-template-columns:1fr 1fr!important}}


/* Primary app tabs */
.app-tabs{position:sticky;top:0;z-index:180;display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-top:7px;padding:4px;background:rgba(239,237,232,.96);backdrop-filter:blur(12px);border:1px solid var(--line);border-radius:11px}.app-tab{border:0;border-radius:8px;background:transparent;color:var(--muted);min-height:38px;font-size:11px;font-weight:850}.app-tab.active{background:var(--paper);color:var(--theme-primary);box-shadow:0 1px 4px rgba(20,25,22,.08)}.tab-count{display:inline-flex;min-width:18px;height:18px;border-radius:99px;align-items:center;justify-content:center;padding:0 5px;margin-left:3px;background:var(--theme-soft);font-size:9px}.tab-panel{display:none}.tab-panel.active{display:block}
/* Theme identity */
.postseason-brand{display:flex;align-items:center;gap:7px;margin-top:7px;min-height:38px}.postseason-logos{display:flex;align-items:center;gap:3px}.postseason-logo{width:34px;height:34px;object-fit:contain;background:rgba(255,255,255,.95);border-radius:7px;padding:3px}.postseason-copy{display:grid;line-height:1}.postseason-copy strong{font-size:10px;letter-spacing:.08em}.postseason-copy span{font-size:8px;margin-top:4px;color:rgba(255,255,255,.72);letter-spacing:.05em;text-transform:uppercase}
/* Dedicated pitching tab */
.pitching-page,.history-page{padding-bottom:8px}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;border-bottom:1px solid var(--line);background:linear-gradient(90deg,var(--theme-soft),#faf8f3)}.page-heading h2{font:700 22px Georgia,"Times New Roman",serif;margin:2px 0 0}.eyebrow{font-size:8px;font-weight:850;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}.page-hint{font-size:9px;color:var(--muted)}.pitching-team-card{margin:8px;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}.pitching-team-summary{list-style:none;display:flex;align-items:center;gap:8px;padding:8px 10px;background:#faf8f3;cursor:pointer}.pitching-team-summary::-webkit-details-marker{display:none}.pitching-team-summary>span:nth-child(2){display:grid}.pitching-team-summary small{font-size:8px;text-transform:uppercase;color:var(--muted)}.pitching-team-summary strong{font-size:12px}.pitching-team-card[open] .section-toggle::after{content:"Hide"}.pitching-team-card:not([open]) .section-toggle::after{content:"Open"}.mini-logo-frame{width:42px;height:42px;border:1px solid var(--line);border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center}.mini-logo-frame img{max-width:88%;max-height:88%;object-fit:contain}.pitching-table{min-width:820px}.pitching-table th{background:var(--theme-soft);color:var(--theme-primary)}
/* Saved game history */
.secondary-action{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 10px;color:var(--theme-primary);font-size:10px;font-weight:850}.history-empty{margin:14px;padding:24px 12px;border:1px dashed var(--line);border-radius:10px;text-align:center;color:var(--muted);font-size:11px}.history-list{display:grid;gap:7px;padding:8px}.history-card{display:grid;grid-template-columns:minmax(180px,1.15fr) minmax(130px,.9fr) auto;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;background:#fff;padding:9px}.history-matchup{display:flex;align-items:center;gap:7px}.history-team{display:grid;grid-template-columns:32px auto auto;gap:5px;align-items:center}.history-team img{width:32px;height:32px;object-fit:contain}.history-team span{font-size:10px;font-weight:850}.history-team strong{font-size:18px}.history-at{font-size:9px;color:var(--muted)}.history-meta{display:grid;gap:2px;min-width:0}.history-meta strong{font-size:11px}.history-meta span{font-size:9px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-actions{display:flex;gap:5px}.history-actions button{border:1px solid var(--line);background:#fff;border-radius:7px;padding:7px 9px;font-size:9px;font-weight:850;color:var(--theme-primary)}.history-actions .history-delete{color:#9b312a;border-color:#e5c2be}
@media(max-width:620px){.history-card{grid-template-columns:1fr auto}.history-meta{grid-column:1/-1;grid-row:2}.history-actions{grid-column:2;grid-row:1}.postseason-logo{width:30px;height:30px}.postseason-copy strong{font-size:9px}}
@media(max-width:430px){.app-tabs{margin-left:1px;margin-right:1px}.page-hint{display:none}.history-card{grid-template-columns:1fr}.history-actions{grid-column:1;grid-row:auto;justify-content:flex-end}.history-meta{grid-column:1;grid-row:auto}.history-matchup{justify-content:space-between}.history-team{grid-template-columns:30px auto auto}.postseason-brand{max-width:260px}}


/* v13 compact game setup */
.setup-panel{gap:7px;padding:8px}.theme-picker-card{grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;padding:8px!important}.setup-field{min-width:0;display:grid;gap:4px}.setup-field>label,.dark-mode-control>span:first-child{font-size:8px;font-weight:850;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}.theme-field select{height:36px;padding:6px 8px;font-size:12px}.dark-mode-control{display:flex;align-items:center;gap:8px;justify-content:flex-end;white-space:nowrap;cursor:pointer}.switch{display:inline-flex}.switch input{position:absolute;opacity:0;pointer-events:none}.switch-track{width:40px;height:22px;border-radius:999px;background:#c8cbd0;position:relative;display:block;transition:.18s}.switch-thumb{position:absolute;width:18px;height:18px;border-radius:50%;background:white;top:2px;left:2px;box-shadow:0 1px 4px rgba(0,0,0,.22);transition:.18s}.switch input:checked+.switch-track{background:var(--theme-primary)}.switch input:checked+.switch-track .switch-thumb{transform:translateX(18px)}
.team-picker{min-height:82px;padding:7px;gap:8px}.team-logo-frame{width:68px;height:68px;border-radius:10px}.team-logo{padding:7px}.team-picker-body{min-width:0}.team-picker select{height:36px;padding:6px 8px;font-size:12px;white-space:nowrap;text-overflow:ellipsis}.game-meta{padding:7px;gap:7px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}.game-meta label{min-width:0}.game-meta label span{font-size:8px;margin-bottom:3px}.game-meta input{display:block;min-width:0;max-width:100%;width:100%;height:36px;padding:6px 8px;font-size:12px;line-height:1.1}.game-meta input[type="date"]{-webkit-appearance:none;appearance:none}.custom-theme-controls{grid-column:1/-1!important}
.summary-team-line{display:flex!important;align-items:center;min-width:0;gap:7px;white-space:nowrap}.summary-team-line strong{overflow:hidden;text-overflow:ellipsis;font-size:13px}.side-label{flex:none;border:1px solid var(--line);border-radius:999px;padding:2px 6px;font-size:7px!important}.scorecard-summary{min-width:0}

/* v13 postseason/Crosstown branding */
.postseason-brand{min-height:46px;max-width:100%;gap:8px}.postseason-brand[data-kind="postseason"] .postseason-logos{background:rgba(255,255,255,.97);border-radius:9px;padding:4px 7px;min-width:110px;height:58px;justify-content:center}.postseason-brand[data-kind="postseason"] .postseason-logo{width:112px;height:50px;padding:1px;background:transparent;border-radius:0;object-fit:contain}.postseason-brand[data-kind="crosstown"] .postseason-logo{width:39px;height:39px;padding:4px;border-radius:8px}.postseason-logo.logo-failed{display:none}.postseason-copy{min-width:0}.postseason-copy strong{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.postseason-copy span{display:block;max-width:245px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.postseason-brand[data-kind="crosstown"] .postseason-copy span{text-transform:none;font-size:8px}

/* v13 clear team totals */
.totals-panel.team-totals{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:8px}.team-total-card{display:grid;grid-template-columns:minmax(0,1fr) repeat(3,42px);align-items:center;border:1px solid var(--line);border-radius:9px;background:#fbfaf7;overflow:hidden}.team-total-identity{display:flex;align-items:center;gap:7px;padding:7px;min-width:0}.total-logo-frame{width:38px;height:38px;border:1px solid var(--line);background:#fff;border-radius:7px;padding:3px;display:flex;align-items:center;justify-content:center;flex:none}.total-logo-frame img{max-width:100%;max-height:100%;object-fit:contain}.team-total-identity strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.team-total-stat{height:100%;min-height:52px;border-left:1px solid var(--line);display:grid;place-items:center;align-content:center;gap:2px}.team-total-stat span{font-size:7px;font-weight:900;color:var(--muted)}.team-total-stat strong{font-size:18px}

/* v13 pitching completeness */
.pitch-team-line{display:flex!important;align-items:center;gap:7px;min-width:0;white-space:nowrap}.pitch-team-line strong{overflow:hidden;text-overflow:ellipsis}.pitch-team-line small{border:1px solid var(--line);padding:2px 5px;border-radius:999px;flex:none}.pitching-table{min-width:1080px}

/* Dark mode is independent of game theme. Scorebook paper itself stays light so black/red scoring notation does not change. */
body[data-mode="dark"]{--paper:#171a1f;--cream:#1d2127;--ink:#eef1f4;--muted:#a4abb3;--line:#343a43;--soft:#20252c;--shadow:0 2px 10px rgba(0,0,0,.22);background:#0e1013;color:var(--ink)}body[data-mode="dark"] html,html:has(body[data-mode="dark"]){background:#0e1013}body[data-mode="dark"] .panel,body[data-mode="dark"] .theme-picker-card,body[data-mode="dark"] .team-picker,body[data-mode="dark"] .game-meta,body[data-mode="dark"] .pitching-team-card,body[data-mode="dark"] .history-card,body[data-mode="dark"] .team-total-card{background:#171a1f}body[data-mode="dark"] .section-summary,body[data-mode="dark"] .scorecard-summary,body[data-mode="dark"] .inning-nav,body[data-mode="dark"] .page-heading,body[data-mode="dark"] .pitching-team-summary,body[data-mode="dark"] .subsection-summary{background:#1d2127!important}body[data-mode="dark"] select,body[data-mode="dark"] input:not([type="color"]),body[data-mode="dark"] textarea,body[data-mode="dark"] .utility-grid button,body[data-mode="dark"] .file-button,body[data-mode="dark"] .secondary-action,body[data-mode="dark"] .history-actions button{background:#22272e;color:#eef1f4;border-color:#3a414b}body[data-mode="dark"] .app-tabs{background:rgba(20,23,28,.96)}body[data-mode="dark"] .app-tab.active{background:#272c33}body[data-mode="dark"] .mini-help{background:#23282e}body[data-mode="dark"] .editor-sheet{background:#171a1f}body[data-mode="dark"] .editor-head{background:#1d2127}body[data-mode="dark"] .editor-check{background:#22272e}body[data-mode="dark"] .utility-danger{background:#2b1d1c!important}body[data-mode="dark"] .total-logo-frame,body[data-mode="dark"] .mini-logo-frame{background:#fff}
/* Keep the traditional scoring sheet light in dark mode. */
body[data-mode="dark"] .scorecard .cell,body[data-mode="dark"] .scorecard .inning-cell,body[data-mode="dark"] .scorecard .sticky-order,body[data-mode="dark"] .scorecard .sticky-number,body[data-mode="dark"] .scorecard .sticky-player,body[data-mode="dark"] .scorecard .sticky-pos{background:#fff;color:#202428}body[data-mode="dark"] .scorecard .head-cell{background:#f0eadf;color:#202428}body[data-mode="dark"] .scorecard .number-cell input,body[data-mode="dark"] .scorecard .player-cell input,body[data-mode="dark"] .scorecard .pos-cell input{background:#fff;color:#202428;border-color:#d4cec2}

@media(max-width:720px){.totals-panel.team-totals{grid-template-columns:1fr}.team-total-card{grid-template-columns:minmax(0,1fr) repeat(3,44px)}}
@media(max-width:620px){.setup-panel{grid-template-columns:1fr!important}.theme-picker-card{grid-template-columns:minmax(0,1fr) auto!important;grid-column:1/-1}.team-picker{grid-column:1/-1;display:grid!important;grid-template-columns:56px minmax(0,1fr)!important;min-height:68px!important}.team-logo-frame{width:56px!important;height:56px!important}.game-meta{grid-column:1/-1!important}.postseason-brand[data-kind="postseason"] .postseason-logos{min-width:96px;height:52px}.postseason-brand[data-kind="postseason"] .postseason-logo{width:98px;height:44px}}
@media(max-width:390px){.game-meta{gap:5px}.game-meta input{font-size:11px;padding-left:5px;padding-right:5px}.dark-mode-control>span:first-child{display:none}.theme-picker-card{gap:6px}.team-total-card{grid-template-columns:minmax(0,1fr) repeat(3,39px)}.team-total-identity strong{font-size:10px}}
@media(max-width:340px){.game-meta{grid-template-columns:1fr!important}}


/* v13 refinement: compact setup, dynamic Crosstown, clearer totals */
.game-meta{display:grid!important;grid-template-columns:140px minmax(0,1fr)!important;gap:8px!important;padding:7px!important;align-items:end!important;overflow:hidden}
.game-meta label{display:grid!important;grid-template-rows:auto 36px;gap:3px;min-width:0!important;overflow:hidden}
.game-meta label span{margin:0!important;font-size:8px!important;line-height:1!important}
.game-meta input{box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important;height:36px!important;padding:5px 7px!important;font-size:12px!important;overflow:hidden!important}
.game-meta input[type=date]{-webkit-appearance:none!important;appearance:none!important;line-height:24px!important}
.team-picker{border-top:3px solid var(--team-primary,var(--line))!important}

body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"]{width:min(100%,560px);display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;padding:6px 8px;border:1px solid rgba(255,255,255,.20);border-radius:10px;background:linear-gradient(105deg,color-mix(in srgb,var(--cross-away) 82%,#000 18%) 0 49.5%,color-mix(in srgb,var(--cross-home) 82%,#000 18%) 50.5% 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-logos{gap:5px;flex:none}
body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-logo{width:42px;height:42px;background:#fff;border-radius:9px;padding:5px;border:1px solid rgba(255,255,255,.55)}
body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-copy{min-width:0;display:flex;align-items:baseline;gap:8px;overflow:hidden}
body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-copy strong{font-size:9px;flex:none;letter-spacing:.08em}
body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-copy span{font-size:9px!important;font-weight:750;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-transform:none!important;max-width:none!important;margin:0!important;color:rgba(255,255,255,.92)}

.team-total-card{position:relative;border-top:3px solid var(--team-primary,var(--theme-primary))!important}
.team-total-card::after{content:"";position:absolute;top:-3px;right:0;width:34%;height:3px;background:var(--team-accent,var(--theme-accent))}
.team-total-copy{display:grid;min-width:0;line-height:1.05}
.team-total-copy>span{font-size:7px;font-weight:900;letter-spacing:.08em;color:var(--muted)}
.team-total-copy strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team-total-identity{min-width:0}

@media(max-width:430px){
  .game-meta{grid-template-columns:1fr!important;gap:6px!important}
  .game-meta label{grid-template-rows:auto 34px}
  .game-meta input{height:34px!important;font-size:12px!important}
  body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"]{grid-template-columns:auto minmax(0,1fr);padding:5px 6px}
  body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-logo{width:36px;height:36px;padding:4px}
  body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-copy{display:grid;gap:2px}
  body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-copy strong{font-size:8px}
  body[data-theme="crosstown"] .postseason-brand[data-kind="crosstown"] .postseason-copy span{font-size:8px!important}
}


/* v14 mobile usability refinements */
:root{--app-visual-width:100vw;--vv-width:100vw;--vv-height:100dvh;--vv-top:0px;--vv-left:0px}
.app-shell{width:min(var(--app-visual-width),1800px);max-width:none}
.scorebook-scroll{scroll-snap-type:x proximity;scroll-padding-left:220px}
.inning-cell{scroll-snap-align:start}

/* Scoring editor stays in the visible center instead of feeling like a bottom drawer. */
.editor-overlay{top:var(--vv-top);left:var(--vv-left);right:auto;bottom:auto;width:var(--vv-width);height:var(--vv-height);align-items:center;justify-content:center;padding:14px;background:rgba(0,0,0,.42)}
.editor-sheet{width:min(420px,94%);max-height:min(720px,86%);border-radius:16px;box-shadow:0 16px 44px rgba(0,0,0,.28);padding-bottom:10px}
.editor-head{border-radius:16px 16px 0 0}

/* Never leave a postseason theme visually blank while a remote official mark is loading. */
.postseason-brand[data-kind="postseason"] .postseason-logo{background:#fff}

@media(max-width:620px){
  /* Prevent iOS focus zoom. */
  input,select,textarea{font-size:16px!important}
  .theme-field select,.team-picker select,.game-meta input{font-size:16px!important}
  .pos-cell input{font-size:16px!important}

  /* Compact frozen identity columns so the active inning owns more of the screen. */
  .book-grid{grid-template-columns:24px 38px 112px 46px repeat(12,138px)!important;min-width:1876px!important}
  .sticky-order{left:0!important}.sticky-number{left:24px!important}.sticky-player{left:62px!important}.sticky-pos{left:174px!important}
  .head-cell{height:28px!important;min-height:28px!important;padding:0 2px!important;font-size:8px!important;line-height:1!important}
  .cell:not(.head-cell){min-height:142px!important}
  .number-cell,.player-cell{padding:3px!important}.pos-cell{padding:2px!important}
  .number-cell input{min-height:38px;height:38px;padding:5px 4px!important}.player-name-input{min-height:46px!important;height:46px!important}.position-select{min-height:38px!important;height:38px!important}
  .number-cell input{font-size:16px!important}.player-name-input{font-size:16px!important}.position-select{width:44px!important;font-size:16px!important}
  .diamond-area{height:112px!important}.diamond{width:104px!important;height:104px!important}
  .scorebook-scroll{scroll-padding-left:220px}
  .inning-nav{padding:5px 7px!important;min-height:42px}.inning-nav label{font-size:8px!important}.inning-nav button{width:34px;height:34px}
}

@media(max-width:430px){
  /* Keep date and venue compact but readable; they stack instead of crowding each other. */
  .game-meta{grid-template-columns:1fr 1fr!important;gap:6px!important}
  .game-meta label{grid-template-rows:auto 38px!important}
  .game-meta input{height:38px!important;min-height:38px!important;padding:6px 7px!important}
  .setup-panel{gap:6px!important;padding:6px!important}
  .theme-picker-card{padding:6px!important}.team-picker{padding:6px!important}
}
@media(max-width:360px){.game-meta{grid-template-columns:1fr!important}}

/* v15 lineup usability */
.player-name-input{width:100%;min-width:0;height:46px;min-height:46px;resize:none;overflow:hidden;border:1px solid var(--line);border-radius:8px;background:#fff;color:#202428;padding:5px 6px;font-size:16px!important;line-height:1.05;font-family:inherit;white-space:pre-wrap;overflow-wrap:anywhere}
.position-select{width:44px!important;min-width:44px;height:38px;min-height:38px;padding:4px 2px!important;text-align:center;text-align-last:center;font-size:16px!important;border:1px solid var(--line);border-radius:8px;background:#fff;color:#202428}
.advance-editor{margin-top:-2px}
/* High-contrast dark mode chrome */
body[data-mode="dark"] .app-tabs{background:#0f1318!important;border-color:#3d4651!important}
body[data-mode="dark"] .app-tab{color:#d8dee6!important}
body[data-mode="dark"] .app-tab.active{background:#f2f4f6!important;color:#11161c!important;box-shadow:0 1px 5px rgba(0,0,0,.35)!important}
body[data-mode="dark"] .app-tab .tab-count{background:#343c46!important;color:#f4f6f8!important}
body[data-mode="dark"] .app-tab.active .tab-count{background:#d9dee4!important;color:#11161c!important}
body[data-mode="dark"] .section-toggle,body[data-mode="dark"] .summary-status,body[data-mode="dark"] .side-label,body[data-mode="dark"] .eyebrow,body[data-mode="dark"] .page-hint,body[data-mode="dark"] .setup-field>label,body[data-mode="dark"] .team-picker label,body[data-mode="dark"] .game-meta label,body[data-mode="dark"] .dark-mode-control>span:first-child{color:#c7ced7!important}
body[data-mode="dark"] .scorecard-summary strong,body[data-mode="dark"] .pitching-team-summary strong,body[data-mode="dark"] .section-summary strong,body[data-mode="dark"] .page-heading h2{color:#f4f6f8!important}
body[data-mode="dark"] .pitching-table{background:#171a1f!important;color:#eef1f4!important}
body[data-mode="dark"] .pitching-table th{background:#252b33!important;color:#eef1f4!important}
body[data-mode="dark"] .pitching-table td{background:#1a1f25!important;border-color:#3a424d!important}
body[data-mode="dark"] .pitching-table input{background:#1f252c!important;color:#f4f6f8!important}
body[data-mode="dark"] .theme-badge{background:rgba(255,255,255,.16)!important;color:#fff!important}
body[data-mode="dark"] .player-name-input,body[data-mode="dark"] .position-select{background:#fff!important;color:#202428!important;border-color:#d4cec2!important}


/* v16 viewport + scorebook boundary fixes */
html{overflow-x:visible}
body{width:var(--app-visual-width);min-width:var(--app-visual-width);max-width:none;overflow-x:clip}
.app-shell{width:100%!important;margin-left:0;margin-right:0;min-width:100%;max-width:none!important}
.scorebook-scroll{
  width:100%;max-width:100%;
  overflow-x:auto!important;overflow-y:hidden!important;
  overscroll-behavior-x:none!important;
  scroll-snap-type:none!important;
  touch-action:pan-x pan-y pinch-zoom;
  scrollbar-gutter:auto;
  -webkit-overflow-scrolling:auto;
}
.book-grid{
  width:max-content!important;
  max-width:none!important;
  min-width:0!important;
}
.editor-overlay{overscroll-behavior:contain;touch-action:pan-y}
body.editor-open .app-shell{pointer-events:none}
body.editor-open .editor-overlay{pointer-events:auto}

@media(max-width:620px){
  .book-grid{grid-template-columns:24px 38px 112px 46px repeat(12,138px)!important;width:max-content!important;min-width:0!important}
}
@media(max-width:430px){
  .book-grid{width:max-content!important;min-width:0!important}
}


/* v17 compact inning view: keep previous + current inning visible on phones. */
@media(max-width:620px){
  .book-grid{grid-template-columns:22px 34px 88px 38px repeat(12,104px)!important;width:max-content!important;min-width:0!important}
  .sticky-order{left:0!important}.sticky-number{left:22px!important}.sticky-player{left:56px!important}.sticky-pos{left:144px!important}
  .head-cell{height:25px!important;min-height:25px!important;font-size:7px!important;padding:0 1px!important}
  .cell:not(.head-cell){min-height:126px!important}
  .number-cell,.player-cell{padding:2px!important}.pos-cell{padding:1px!important}
  .number-cell input{height:34px!important;min-height:34px!important;padding:3px 2px!important}
  .player-name-input{height:43px!important;min-height:43px!important;padding:4px!important;line-height:1.02!important}
  .position-select{width:36px!important;min-width:36px!important;height:34px!important;min-height:34px!important;padding:2px 0!important}
  .diamond-area{height:100px!important}.diamond{width:94px!important;height:94px!important}
  .play-code{right:5px!important;bottom:5px!important;font-size:15px!important;max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .rbi-pill{right:5px!important;top:5px!important;font-size:9px!important}
  .cell-actions{height:18px!important}.add-pa,.remove-pa{font-size:8px!important}
  .scorebook-scroll{scroll-padding-left:182px!important}
}
@media(max-width:380px){
  .book-grid{grid-template-columns:21px 32px 84px 36px repeat(12,100px)!important}
  .sticky-number{left:21px!important}.sticky-player{left:53px!important}.sticky-pos{left:137px!important}
  .position-select{width:34px!important;min-width:34px!important}
  .diamond{width:90px!important;height:90px!important}
}


/* v18 — Dark mode now includes the entire scorekeeping grid. */
body[data-mode="dark"]{
  --play-black:#f2f5f7;
  --out-red:#ff6b61;
  --score-green:#43b86a;
}
body[data-mode="dark"] .scorecard .cell,
body[data-mode="dark"] .scorecard .inning-cell,
body[data-mode="dark"] .scorecard .sticky-order,
body[data-mode="dark"] .scorecard .sticky-number,
body[data-mode="dark"] .scorecard .sticky-player,
body[data-mode="dark"] .scorecard .sticky-pos{
  background:#15191e!important;
  color:#f2f5f7!important;
  border-color:#3b434d!important;
}
body[data-mode="dark"] .scorecard .head-cell,
body[data-mode="dark"] .scorecard .head-cell.sticky-order,
body[data-mode="dark"] .scorecard .head-cell.sticky-number,
body[data-mode="dark"] .scorecard .head-cell.sticky-player,
body[data-mode="dark"] .scorecard .head-cell.sticky-pos{
  background:#242a31!important;
  color:#f7f9fb!important;
  border-color:#46505c!important;
}
body[data-mode="dark"] .scorecard .number-cell input,
body[data-mode="dark"] .scorecard .player-cell input,
body[data-mode="dark"] .scorecard .player-name-input,
body[data-mode="dark"] .scorecard .pos-cell input,
body[data-mode="dark"] .scorecard .position-select{
  background:#1e242b!important;
  color:#f5f7f9!important;
  border-color:#46505c!important;
  -webkit-text-fill-color:#f5f7f9!important;
}
body[data-mode="dark"] .scorecard .player-name-input::placeholder,
body[data-mode="dark"] .scorecard input::placeholder{color:#9099a4!important;opacity:1}
body[data-mode="dark"] .scorecard .pa-entry+.pa-entry{border-top-color:#4a535e!important}
body[data-mode="dark"] .scorecard .pa-entry:focus-visible{box-shadow:inset 0 0 0 2px #7fb2ff}
body[data-mode="dark"] .scorecard .base.origin,
body[data-mode="dark"] .scorecard .base.advance{stroke:#f2f5f7!important}
body[data-mode="dark"] .scorecard .play-code,
body[data-mode="dark"] .scorecard .rbi-pill{color:#f2f5f7!important}
body[data-mode="dark"] .scorecard .pa-entry.play-out .play-code{color:#ff6b61!important}
body[data-mode="dark"] .scorecard .advance-reason-label{
  fill:#f2f5f7!important;
  stroke:#15191e!important;
}
body[data-mode="dark"] .scorecard .runner-out-label{
  fill:#ff6b61!important;
  stroke:#15191e!important;
}
body[data-mode="dark"] .scorecard .runner-out-path,
body[data-mode="dark"] .scorecard .runner-out-mark{stroke:#ff6b61!important}
body[data-mode="dark"] .scorecard .pa-entry.scored .diamond-fill{fill:#43b86a!important;fill-opacity:.76!important}
body[data-mode="dark"] .scorecard .add-pa{color:#9fc6ff!important}
body[data-mode="dark"] .scorecard .remove-pa{color:#ff8a82!important}
body[data-mode="dark"] .scorecard .inning-cell.third-out{box-shadow:inset 0 -4px 0 #ff6b61!important}


/* v19 — Center player names cleanly in lineup cells. */
.player-cell{justify-content:center!important}
.player-name-input{
  text-align:center!important;
  text-align-last:center!important;
}


/* v20 — default mobile density, stable zoom bounds, cleaner lineup cells, centered standalone outs. */
html,body{width:100%;max-width:100%;overflow-x:hidden!important}
body{min-width:0!important}
.app-shell{width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important;overflow-x:hidden!important}
.panel,.scorecard,.section-details{max-width:100%!important}
.scorebook-scroll,.h-scroll{width:100%!important;max-width:100%!important;overscroll-behavior-x:none!important;overflow-x:auto!important;overflow-y:hidden!important}
.book-grid{width:max-content!important;min-width:0!important;max-width:none!important}

/* Player identity fields use the grid cell itself — no little inner boxes. */
.number-cell input,.player-name-input,.position-select{
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  border-radius:0!important;
  outline:none;
}
.number-cell input:focus,.player-name-input:focus,.position-select:focus{
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--theme-primary) 55%,transparent)!important;
  border-radius:3px!important;
}
.player-cell{align-items:center!important;justify-content:center!important;padding:0!important}
.player-name-input{
  width:100%!important;
  min-width:0!important;
  height:50px!important;
  min-height:50px!important;
  padding:3px 2px!important;
  resize:none!important;
  overflow:hidden!important;
  text-align:center!important;
  text-align-last:center!important;
  line-height:1.05!important;
  font-weight:700;
}
.pos-cell{padding:0!important}
.position-select{
  width:100%!important;
  min-width:0!important;
  height:42px!important;
  min-height:42px!important;
  padding:0!important;
  text-align:center!important;
  text-align-last:center!important;
  -webkit-appearance:none!important;
  appearance:none!important;
  font-weight:800;
}

/* A batter-only out is the visual focus of its box. */
.pa-entry.standalone-out .diamond{visibility:hidden}
.pa-entry.standalone-out .play-code{
  inset:0!important;
  width:100%!important;
  height:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  max-width:none!important;
  font-size:32px!important;
  line-height:1!important;
  letter-spacing:-.03em;
  overflow:visible!important;
  white-space:normal!important;
}
.pa-entry.standalone-out .rbi-pill{display:none!important}

/* Default phone view intentionally matches the user's preferred zoomed-out density.
   The compact grid is the default view. The viewport cannot zoom below 1x, so zooming back out always returns to this exact layout without exposing a blank gutter. Users can still zoom in up to 3x. */
@media(max-width:620px){
  .book-grid{grid-template-columns:16px 22px 54px 24px repeat(12,52px)!important}
  .sticky-order{left:0!important}.sticky-number{left:16px!important}.sticky-player{left:38px!important}.sticky-pos{left:92px!important}
  .head-cell{height:21px!important;min-height:21px!important;font-size:6px!important;padding:0!important}
  .cell:not(.head-cell){min-height:118px!important}
  .number-cell input{font-size:12px!important;height:34px!important;min-height:34px!important;padding:0!important}
  .player-name-input{font-size:9px!important;height:44px!important;min-height:44px!important}
  .position-select{font-size:10px!important;height:34px!important;min-height:34px!important}
  .diamond-area{height:92px!important}.diamond{width:48px!important;height:48px!important}
  .play-code{font-size:10px!important;right:3px!important;bottom:4px!important}
  .pa-entry.standalone-out .play-code{font-size:24px!important}
  .rbi-pill{font-size:7px!important;right:3px!important;top:4px!important}
  .cell-actions{height:16px!important}.add-pa,.remove-pa{font-size:7px!important;padding:0 2px!important}
  .scorebook-scroll{scroll-padding-left:116px!important}
  .editor-sheet{width:min(420px,94%)!important;max-height:88%!important}
  .editor-head{grid-template-columns:44px 1fr 70px!important;padding:8px 10px!important;font-size:14px!important}
  .editor-icon{font-size:24px!important}.editor-done{font-size:16px!important}
  .editor-body{padding:12px!important}
  .editor-field>span{font-size:9px!important}.editor-field select,.editor-field input{font-size:16px!important;min-height:44px!important;padding:8px!important}
  .editor-check{min-height:44px!important;font-size:14px!important}.editor-clear{font-size:14px!important;min-height:44px!important}
}

/* At normal desktop scale, keep the centered-out treatment proportional. */
@media(min-width:901px){.pa-entry.standalone-out .play-code{font-size:36px!important}}

/* Dark mode keeps borderless lineup fields readable without bringing the boxes back. */
body[data-mode="dark"] .scorecard .number-cell input,
body[data-mode="dark"] .scorecard .player-name-input,
body[data-mode="dark"] .scorecard .position-select{
  background:transparent!important;
  border:0!important;
  color:#f5f7f9!important;
  -webkit-text-fill-color:#f5f7f9!important;
}

.scorebook-clip{width:100%;max-width:100%;overflow:hidden!important;position:relative;contain:paint}
@media(max-width:620px){
  .hero{padding:6px 7px 0!important;border-radius:8px!important;gap:4px!important}.brand-block{padding-bottom:5px!important}.hero h1{font-size:16px!important}.theme-badge{font-size:6px!important;min-height:16px!important;padding:2px 5px!important}.hero button{font-size:9px!important;padding:5px 6px!important}.hero .icon-more{min-width:30px!important}.theme-stripe{height:3px!important;margin:0 -7px!important}
  .app-tabs{margin-top:4px!important;padding:3px!important}.app-tab{min-height:30px!important;font-size:9px!important}.panel{margin-top:4px!important;border-radius:8px!important}.section-summary{min-height:32px!important;padding:6px 8px!important;font-size:12px!important}.utility-panel{padding:5px!important}.utility-grid{gap:4px!important}.utility-grid button,.file-button{min-height:32px!important;font-size:10px!important;padding:4px!important}
  .setup-panel{padding:5px!important;gap:5px!important}.theme-picker-card,.team-picker,.game-meta{padding:5px!important}.team-picker{min-height:54px!important;grid-template-columns:42px minmax(0,1fr)!important}.team-logo-frame{width:42px!important;height:42px!important}.team-picker select,.theme-field select,.game-meta input{height:30px!important;min-height:30px!important;font-size:16px!important;padding:4px 6px!important}.team-picker label,.game-meta label,.setup-field>label,.dark-mode-control>span:first-child{font-size:6px!important}.switch-track{width:32px!important;height:18px!important}.switch-thumb{width:14px!important;height:14px!important}.switch input:checked+.switch-track .switch-thumb{transform:translateX(14px)!important}
  .line-score{grid-template-columns:72px repeat(12,28px) repeat(3,32px)!important;min-width:504px!important}.line-cell{min-height:27px!important;font-size:8px!important}.line-cell.head{font-size:7px!important}.line-cell.team img{width:20px!important;height:20px!important}
  .scorecard>summary.scorecard-summary{padding:5px 7px!important;gap:6px!important}.summary-logo-frame{width:38px!important;height:38px!important}.summary-team-line strong{font-size:10px!important}.side-label{font-size:5px!important;padding:1px 4px!important}.inning-nav{padding:4px 5px!important;min-height:34px!important}.inning-nav button{width:28px!important;height:28px!important;font-size:18px!important}.inning-nav label{font-size:6px!important}.inning-nav select{width:48px!important;padding:3px!important;font-size:12px!important}
}

body{touch-action:pan-y pinch-zoom}
.scorebook-scroll,.h-scroll{touch-action:pan-x pan-y pinch-zoom}

/* v21 — square mobile play boxes. Keep the compact width, but make each plate-appearance area a true square. */
@media(max-width:620px){
  .book-grid{grid-template-columns:16px 22px 54px 24px repeat(12,54px)!important}
  .sticky-order{left:0!important}.sticky-number{left:16px!important}.sticky-player{left:38px!important}.sticky-pos{left:92px!important}

  /* Lineup row height follows the square scoring area instead of the old tall rectangle. */
  .cell:not(.head-cell){min-height:66px!important}
  .inning-cell{padding:1px!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important}

  /* 54px inning column - 2px cell padding = 52px square play area. */
  .pa-entry{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:1 / 1!important;
    flex:0 0 auto!important;
    border-radius:4px!important;
  }
  .pa-entry+.pa-entry{margin-top:2px!important;padding-top:0!important}
  .diamond-area{height:100%!important;min-height:0!important}
  .diamond{width:48px!important;height:48px!important;max-width:92%!important;max-height:92%!important}

  /* +PA sits in a small dedicated strip so it does not stretch the play box. */
  .cell-actions{height:12px!important;min-height:12px!important;line-height:12px!important;align-items:center!important}
  .add-pa,.remove-pa{font-size:6px!important;line-height:10px!important;padding:0 2px!important}

  /* Keep lineup controls centered within the shorter row. */
  .number-cell input{height:28px!important;min-height:28px!important;font-size:11px!important}
  .player-name-input{height:38px!important;min-height:38px!important;font-size:9px!important;line-height:1.02!important}
  .position-select{height:28px!important;min-height:28px!important;font-size:10px!important}

  /* Standalone outs remain the visual focus of the now-square box. */
  .pa-entry.standalone-out .play-code{font-size:23px!important}
  .play-code{right:3px!important;bottom:3px!important;font-size:10px!important}
  .rbi-pill{right:3px!important;top:3px!important;font-size:7px!important}

  .scorebook-scroll{scroll-padding-left:116px!important}
}

/* v21 refinement — the whole normal inning cell is square, not just the drawing area. */
@media(max-width:620px){
  .cell:not(.head-cell){min-height:54px!important}
  .inning-cell{min-height:54px!important;position:relative!important}
  .cell-actions{
    position:absolute!important;
    left:2px!important;
    right:auto!important;
    bottom:1px!important;
    width:auto!important;
    height:10px!important;
    min-height:10px!important;
    z-index:8!important;
    justify-content:flex-start!important;
    pointer-events:auto!important;
  }
  .add-pa,.remove-pa{font-size:5.5px!important;line-height:9px!important;padding:0 1px!important}
  .number-cell input{height:26px!important;min-height:26px!important}
  .player-name-input{height:36px!important;min-height:36px!important}
  .position-select{height:26px!important;min-height:26px!important}
}


/* v22 — approved localized refinements. Keep the v21 layout; clean up lineup identity, play markers and editor only. */
.book-grid{grid-template-columns:32px 178px 44px repeat(12,148px)!important}
.sticky-order{left:0!important}.sticky-player{left:32px!important}.sticky-pos{left:210px!important}
.player-cell,.pos-cell{cursor:pointer;user-select:none}.player-cell{padding:2px 4px!important;justify-content:center!important;text-align:center!important}.position-text{display:block;width:100%;text-align:center;font-weight:850}.player-display{width:100%;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;line-height:1.03;overflow:hidden}.player-starter{width:100%;font-size:12px;font-weight:850;text-align:center;overflow-wrap:anywhere}.player-sub{width:100%;font-size:9px;font-weight:750;color:var(--muted);text-align:center;overflow-wrap:anywhere}.player-display.sub-count-2 .player-starter{font-size:11px}.player-display.sub-count-2 .player-sub{font-size:8px}.player-display.sub-count-3 .player-starter,.player-display.sub-count-4 .player-starter{font-size:10px}.player-display.sub-count-3 .player-sub,.player-display.sub-count-4 .player-sub{font-size:7px}

/* The inning cell itself is the play box. There is no nested square or inner outline. */
.inning-cell{padding:0!important}.pa-entry{border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important}.diamond-area{border:0!important;outline:0!important}.pa-entry:focus-visible{box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--theme-primary) 70%,white)!important}
.event-marker{display:none;position:absolute;left:0;right:0;bottom:0;height:11px;align-items:center;justify-content:center;background:#111;color:#fff;font-size:8px;font-weight:950;letter-spacing:.08em;line-height:11px;z-index:12;text-align:center}.event-marker.on{display:flex}.pa-entry.has-event-marker .play-code{bottom:13px!important}.pa-entry.standalone-out.has-event-marker .play-code{padding-bottom:9px!important}.inning-cell.third-out .event-marker.on{bottom:3px}.inning-cell.third-out{box-shadow:inset 0 -4px 0 var(--out-red)!important}
body[data-mode="dark"] .event-marker{background:#050607!important;color:#fff!important;border-top:1px solid rgba(255,255,255,.48)}

/* Balanced Editor B: compact enough for mobile but keeps detailed scoring controls easy to scan. */
.editor-body-balanced{padding:10px!important}.editor-balance-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 8px}.editor-balance-grid .editor-field{margin:0}.editor-span-2{grid-column:1/-1}.editor-body-balanced .editor-field>span{font-size:8px}.editor-body-balanced .editor-field select,.editor-body-balanced .editor-field input{min-height:38px;padding:6px 7px;border-radius:7px}.editor-run-check{min-height:38px!important;margin:8px 0!important;padding:6px 8px!important}.editor-action-row{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:8px}.editor-secondary{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:8px;min-height:34px;padding:6px 9px;font-size:10px;font-weight:850}.editor-secondary.danger{color:#9b312a;border-color:#e2b2ad;background:#fff8f6}.runner-out-editor{margin-top:8px;padding-top:8px}.runner-out-editor .editor-field{margin-bottom:6px}

/* Player editor: one compact popout for starter + any substitutions. */
.player-editor-sheet{width:min(520px,94%);max-height:min(760px,88%)}.player-editor-body{padding:10px}.starter-editor-grid{display:grid;grid-template-columns:minmax(0,1fr) 64px 78px;gap:8px}.starter-editor-grid .editor-field{margin:0}.starter-editor-grid input,.starter-editor-grid select{font-size:16px;min-height:40px;padding:7px}.sub-editor-head{display:flex;align-items:center;justify-content:space-between;margin:12px 0 6px;font-size:12px}.sub-editor-head button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 9px;font-size:10px;font-weight:850}.player-sub-list{display:grid;gap:6px}.player-sub-editor-row{display:grid;grid-template-columns:62px minmax(110px,1fr) 48px 64px 68px 30px;gap:5px;align-items:end;border:1px solid var(--line);border-radius:9px;padding:6px;background:#fff}.player-sub-editor-row label{display:grid;gap:2px}.player-sub-editor-row label>span{font-size:7px;font-weight:850;text-transform:uppercase;color:var(--muted)}.player-sub-editor-row input,.player-sub-editor-row select{min-height:34px;font-size:16px!important;padding:4px 5px}.sub-remove{height:34px;border:1px solid #e2b2ad;background:#fff7f5;color:#9b312a;border-radius:7px;font-size:18px}.player-editor-body .editor-clear{margin-top:10px}
body[data-mode="dark"] .player-sub-editor-row,body[data-mode="dark"] .sub-editor-head button,body[data-mode="dark"] .editor-secondary{background:#1e242b!important;color:#f4f6f8!important;border-color:#46505c!important}body[data-mode="dark"] .editor-secondary.danger,body[data-mode="dark"] .sub-remove{background:#2b2021!important;color:#ffaaa4!important;border-color:#774b49!important}

@media(max-width:620px){
  .book-grid{grid-template-columns:20px 78px 24px repeat(12,54px)!important}
  .sticky-order{left:0!important}.sticky-player{left:20px!important}.sticky-pos{left:98px!important}
  .cell:not(.head-cell){min-height:54px!important}.player-cell{padding:1px 2px!important}.player-starter{font-size:8.5px!important}.player-sub{font-size:6.5px!important;line-height:1.02!important}.player-display{gap:1px!important}.player-display.sub-count-2 .player-starter{font-size:7.7px!important}.player-display.sub-count-2 .player-sub{font-size:5.8px!important}.player-display.sub-count-3 .player-starter,.player-display.sub-count-4 .player-starter{font-size:7px!important}.player-display.sub-count-3 .player-sub,.player-display.sub-count-4 .player-sub{font-size:5.2px!important}.position-text{font-size:9px!important}
  .inning-cell{min-height:54px!important}.pa-entry{width:100%!important;min-height:54px!important;height:54px!important;aspect-ratio:1/1!important}.pa-entry+.pa-entry{margin-top:0!important;padding-top:0!important;border-top:1px dashed var(--line)!important}.diamond-area{height:54px!important}.diamond{width:48px!important;height:48px!important}
  .pa-entry.standalone-out .play-code{font-size:22px!important}.play-code{font-size:10px!important;right:3px!important;bottom:3px!important}.event-marker{height:10px!important;line-height:10px!important;font-size:7px!important}.pa-entry.has-event-marker .play-code{bottom:12px!important}
  .scorebook-scroll{scroll-padding-left:122px!important}
  .editor-sheet{width:min(420px,94%)!important}.editor-balance-grid{gap:6px!important}.editor-body-balanced .editor-field select,.editor-body-balanced .editor-field input{font-size:16px!important;min-height:38px!important}.editor-secondary{font-size:10px!important;min-height:34px!important}
  .starter-editor-grid{grid-template-columns:minmax(0,1fr) 54px 68px;gap:6px}.player-sub-editor-row{grid-template-columns:56px minmax(86px,1fr) 44px 58px 62px 28px;gap:4px;padding:5px}.player-sub-editor-row input,.player-sub-editor-row select{min-height:34px!important;font-size:16px!important;padding:3px!important}.sub-remove{height:34px!important}
}


/* v23 — Liberation Sans, automatic ALL CAPS names, and collision-safe play labels. */
body,button,select,input,textarea{font-family:"Liberation Sans",Arial,Helvetica,sans-serif!important}
.hero h1{font-family:"Liberation Sans",Arial,Helvetica,sans-serif!important;font-weight:800!important}
.player-starter,.player-sub,.player-editor-sheet input[data-sub-field="name"],#playerName{text-transform:uppercase!important}
/* Longer non-out play abbreviations (HBP, etc.) shrink so they stay clear of base-path geometry. */
.pa-entry.compact-play-code .play-code{font-size:14px!important;right:5px!important;bottom:5px!important;letter-spacing:-.035em!important}
.pa-entry.tiny-play-code .play-code{font-size:11px!important;right:4px!important;bottom:4px!important;letter-spacing:-.045em!important}
@media(max-width:620px){
  .pa-entry.compact-play-code:not(.standalone-out) .play-code{font-size:7.5px!important;right:2px!important;bottom:2px!important;line-height:.95!important}
  .pa-entry.tiny-play-code:not(.standalone-out) .play-code{font-size:6.2px!important;right:1px!important;bottom:1px!important;line-height:.92!important}
  .pa-entry.has-event-marker.compact-play-code:not(.standalone-out) .play-code,
  .pa-entry.has-event-marker.tiny-play-code:not(.standalone-out) .play-code{bottom:12px!important}
}

/* v24 — hard horizontal viewport confinement.
   The document itself never pans sideways. Only intentional inner scrollers may move horizontally. */
html{
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  overflow-x:clip!important;
  overscroll-behavior-x:none!important;
}
body{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  overflow-x:clip!important;
  overscroll-behavior-x:none!important;
  position:relative;
  touch-action:pan-y pinch-zoom;
}
.app-shell{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  overflow-x:clip!important;
}
.tab-panel,.panel,.scorecard,.section-details,.scorebook-clip{
  min-width:0!important;
  max-width:100%!important;
}
.scorebook-clip{
  width:100%!important;
  overflow:clip!important;
  overscroll-behavior-x:none!important;
  contain:paint;
}
.scorebook-scroll,.h-scroll,.pitching-scroll{
  max-width:100%!important;
  overscroll-behavior-x:none!important;
  overscroll-behavior-inline:none!important;
}
/* Horizontal gestures belong to these inner regions only. */
.scorebook-scroll,.h-scroll,.pitching-scroll{touch-action:pan-x pan-y pinch-zoom!important}
/* Outside those regions, preserve vertical page movement + pinch zoom, not sideways page panning. */
.app-shell,.panel,.tab-panel{touch-action:pan-y pinch-zoom}
/* The visually hidden Dark Mode checkbox inherited the global input width:100%, which created invisible horizontal overflow on mobile. */
.switch{position:relative;display:inline-block;flex:none}
.switch input{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  max-width:1px!important;
  min-height:1px!important;
  max-height:1px!important;
  left:0!important;
  top:0!important;
  margin:0!important;
  padding:0!important;
  opacity:0!important;
  overflow:hidden!important;
}
/* Keep wide grid content inside its own scrolling/painting context so it cannot enlarge the page canvas. */
.scorebook-clip{contain:layout paint!important}


/* v25 — approved themes + thinner tabs + Focus Mode + faster editor + summary. */
body[data-theme="wrigley"]{
  --theme-primary:#0b3a2a;--theme-primary-2:#062a1f;--theme-accent:#d7c28e;--theme-soft:#102f25;--theme-stripe:#d7c28e;
  --paper:#0d3327;--cream:#0a2c22;--ink:#f3ead0;--muted:#c6b98e;--line:#8f825d;--soft:#12382c;--play-black:#f4ead0;--score-green:#7bcf43;--out-red:#e84c3d;
  background:#071d16;color:var(--ink);
}
/* Generic/default: subtle baseball seam texture behind the title. */
body[data-theme="regular"] .hero{
  color:#f8f4e8;
  background:
    radial-gradient(circle at 10% 50%,transparent 0 34px,rgba(255,255,255,.08) 35px 36px,transparent 37px),
    radial-gradient(circle at 90% 50%,transparent 0 34px,rgba(255,255,255,.08) 35px 36px,transparent 37px),
    linear-gradient(135deg,#183a4d,#0f2d3f 54%,#132f42);
  border:1px solid rgba(255,255,255,.13);
}
body[data-theme="regular"] .theme-stripe{background:linear-gradient(90deg,#b33a37,#e7ded0 48% 52%,#173f64)}
body[data-theme="regular"] .theme-badge{background:rgba(255,255,255,.12)}
body[data-theme="regular"] .hero h1{letter-spacing:.08em;text-transform:uppercase;font-weight:900}

/* Heavy Wrigley manual-scoreboard treatment, carried through the full scorecard. */
body[data-theme="wrigley"] .hero{
  position:relative;
  background:
    repeating-linear-gradient(0deg,rgba(255,255,255,.025) 0 1px,transparent 1px 7px),
    linear-gradient(180deg,#0d422f,#082f24 72%,#06251c);
  border:2px solid #b5a675;border-radius:8px;box-shadow:inset 0 0 0 2px rgba(0,0,0,.34),0 3px 10px rgba(0,0,0,.35);
}
body[data-theme="wrigley"] .hero::before,
body[data-theme="wrigley"] .hero::after{content:"★";position:absolute;top:16px;color:#d7c28e;font-size:14px;opacity:.9}
body[data-theme="wrigley"] .hero::before{left:32%}body[data-theme="wrigley"] .hero::after{right:32%}
body[data-theme="wrigley"] .hero h1{font-family:"Liberation Sans Narrow","Arial Narrow","Liberation Sans",sans-serif!important;text-transform:uppercase;letter-spacing:.26em;font-weight:900;text-shadow:0 1px 0 #000;font-size:22px!important}
body[data-theme="wrigley"] .theme-badge{border-color:#a99968;background:rgba(0,0,0,.15);color:#e7dbb7}
body[data-theme="wrigley"] .theme-stripe{height:3px;background:#b5a675}
body[data-theme="wrigley"] .panel{background:#0c3327;border-color:#7f7453;box-shadow:inset 0 0 0 1px rgba(215,194,142,.08),0 2px 8px rgba(0,0,0,.28)}
body[data-theme="wrigley"] .section-summary,body[data-theme="wrigley"] .scorecard>summary.scorecard-summary,body[data-theme="wrigley"] .inning-nav,body[data-theme="wrigley"] .page-heading,body[data-theme="wrigley"] .pitching-team-summary,body[data-theme="wrigley"] .subsection-summary{background:#0a2c22!important;color:#f2e8cb!important;border-color:#786d4f!important}
body[data-theme="wrigley"] .section-toggle,body[data-theme="wrigley"] .summary-status,body[data-theme="wrigley"] .side-label,body[data-theme="wrigley"] .eyebrow,body[data-theme="wrigley"] .page-hint{color:#c9bc94!important}
body[data-theme="wrigley"] .line-score{background:#0a3025;color:#eee3c4;border-top:1px solid #918462;border-bottom:1px solid #918462}
body[data-theme="wrigley"] .line-cell{border-color:rgba(215,194,142,.27)}
body[data-theme="wrigley"] .line-cell.head{color:#d9cb9f}
body[data-theme="wrigley"] .scorecard .cell,body[data-theme="wrigley"] .scorecard .inning-cell,body[data-theme="wrigley"] .scorecard .sticky-order,body[data-theme="wrigley"] .scorecard .sticky-player,body[data-theme="wrigley"] .scorecard .sticky-pos{background:#0b3529!important;color:#f1e6c8!important;border-color:#8e825f!important}
body[data-theme="wrigley"] .scorecard .head-cell,body[data-theme="wrigley"] .scorecard .head-cell.sticky-order,body[data-theme="wrigley"] .scorecard .head-cell.sticky-player,body[data-theme="wrigley"] .scorecard .head-cell.sticky-pos{background:#072a20!important;color:#e9ddbb!important;border-color:#8e825f!important}
body[data-theme="wrigley"] .player-sub{color:#c6b98e!important}
body[data-theme="wrigley"] .scorecard .base.origin,body[data-theme="wrigley"] .scorecard .base.advance{stroke:#f1e6c8!important}
body[data-theme="wrigley"] .scorecard .play-code,body[data-theme="wrigley"] .scorecard .rbi-pill{color:#f1e6c8!important}
body[data-theme="wrigley"] .scorecard .pa-entry.play-out .play-code{color:#ef4d3e!important}
body[data-theme="wrigley"] .scorecard .pa-entry.scored .diamond-fill{fill:#79d23e!important;fill-opacity:.92!important}
body[data-theme="wrigley"] .scorecard .inning-cell.third-out{box-shadow:inset 0 -4px 0 #ef4d3e!important}
body[data-theme="wrigley"] .scorecard .event-marker{background:#050c09!important;color:#fff!important;border-top:1px solid #b5a675}
body[data-theme="wrigley"] .editor-sheet{background:#0a2f24;color:#f3ead0;border:2px solid #8e825f;box-shadow:0 18px 50px rgba(0,0,0,.52)}
body[data-theme="wrigley"] .editor-head{background:#07271e!important;color:#f3ead0!important;border-color:#786d4f!important}
body[data-theme="wrigley"] .editor-field>span,body[data-theme="wrigley"] .quick-label{color:#c7ba91!important}
body[data-theme="wrigley"] .editor-field select,body[data-theme="wrigley"] .editor-field input,body[data-theme="wrigley"] .editor-check,body[data-theme="wrigley"] .editor-secondary,body[data-theme="wrigley"] .quick-play-row button{background:#0d382b!important;color:#f3ead0!important;border-color:#8d815e!important}
body[data-theme="wrigley"] .editor-done{background:#d7c28e!important;color:#10281f!important;border-color:#d7c28e!important}
body[data-theme="wrigley"] .quick-editor-context{background:#082b21!important;border-color:#8d815e!important;color:#f3ead0!important}
body[data-theme="wrigley"] .base-chip i{border-color:#d7c28e!important}body[data-theme="wrigley"] .base-chip.on i{background:#79d23e!important}
body[data-theme="wrigley"] .team-picker,body[data-theme="wrigley"] .game-meta,body[data-theme="wrigley"] .theme-picker-card,body[data-theme="wrigley"] .team-total-card,body[data-theme="wrigley"] .history-card{background:#0d362a!important;border-color:#776d4f!important;color:#f2e8cb!important}
body[data-theme="wrigley"] select,body[data-theme="wrigley"] input:not([type="color"]),body[data-theme="wrigley"] textarea{background:#0a2e23!important;color:#f1e6c8!important;border-color:#7c7152!important}
body[data-theme="wrigley"] .summary-logo-frame,body[data-theme="wrigley"] .team-logo-frame,body[data-theme="wrigley"] .total-logo-frame,body[data-theme="wrigley"] .mini-logo-frame{background:#f8f4e8!important}

/* Thin tabs live directly under the main Scorecard header. */
.app-tabs{margin-top:0!important;border-radius:0 0 8px 8px!important;padding:0 5px!important;gap:0!important;min-height:30px!important;border-top:0!important;box-shadow:none!important;background:#f8f6f1!important;border-left:1px solid var(--line)!important;border-right:1px solid var(--line)!important;border-bottom:1px solid var(--line)!important}
.app-tab{min-height:29px!important;padding:4px 7px!important;border-radius:0!important;background:transparent!important;font-size:9px!important;border:0!important;border-bottom:2px solid transparent!important;box-shadow:none!important}
.app-tab.active{background:transparent!important;color:var(--theme-primary)!important;border-bottom-color:var(--theme-primary)!important}
body[data-theme="wrigley"] .app-tabs{background:#082b21!important;border-color:#786d4f!important}
body[data-theme="wrigley"] .app-tab{color:#cabe97!important}body[data-theme="wrigley"] .app-tab.active{color:#f2e8cb!important;border-bottom-color:#d7c28e!important}
body[data-mode="dark"]:not([data-theme="wrigley"]) .app-tabs{background:#11161b!important;border-color:#3b434d!important}
body[data-mode="dark"]:not([data-theme="wrigley"]) .app-tab.active{color:#f4f6f8!important;border-bottom-color:#9fc6ff!important;background:transparent!important}

/* Focus Mode: hide nonessential scorecard sections, keep scoring + tabs. */
.focus-toggle{white-space:nowrap}
body.focus-mode #morePanel,body.focus-mode #tab-scorecard>.section-details:not(.scoreboard),body.focus-mode #tab-scorecard>.scoreboard,body.focus-mode #tab-scorecard>.notes-panel{display:none!important}
body.focus-mode #tab-scorecard>.scorecard{display:block!important}
body.focus-mode .hero{padding-top:6px!important}.focus-mode .brand-block{padding-bottom:4px!important}.focus-mode .theme-badge{display:none!important}.focus-mode .hero h1{font-size:15px!important;margin:0!important}.focus-mode .theme-stripe{height:2px!important}.focus-mode .app-tabs{position:sticky;top:0;z-index:120}
body.focus-mode .scorecard-summary{padding-top:4px!important;padding-bottom:4px!important}.focus-mode .inning-nav{padding-top:3px!important;padding-bottom:3px!important}

/* Faster Editor B additions. */
.quick-editor-context{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;padding:7px 8px;border:1px solid var(--line);border-radius:8px;background:#faf8f3}
.editor-game-context{font-size:10px;font-weight:900;letter-spacing:.04em}.editor-base-state{display:flex;gap:7px;align-items:center}.base-chip{display:flex;align-items:center;gap:3px;font-size:9px;font-weight:850;color:var(--muted)}.base-chip i{width:10px;height:10px;border:1px solid var(--line);transform:rotate(45deg);display:inline-block;background:transparent}.base-chip.on i{background:var(--score-green);border-color:var(--score-green)}
.quick-play-wrap{margin:0 0 8px}.quick-label{display:block;margin-bottom:4px;font-size:8px;font-weight:900;text-transform:uppercase;color:var(--muted)}.quick-play-row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.quick-play-row button{min-width:0;padding:6px 2px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font-size:10px;font-weight:900}.quick-play-row button[data-quick-play="K"],.quick-play-row button[data-quick-play="KLOOK"],.quick-play-row button[data-quick-play="F8"],.quick-play-row button[data-quick-play="6-3"]{color:var(--out-red)}
body[data-mode="dark"] .quick-editor-context,body[data-mode="dark"] .quick-play-row button{background:#20252c!important;color:#eef1f4!important;border-color:#46505c!important}body[data-mode="dark"] .quick-play-row button[data-quick-play="K"],body[data-mode="dark"] .quick-play-row button[data-quick-play="KLOOK"],body[data-mode="dark"] .quick-play-row button[data-quick-play="F8"],body[data-mode="dark"] .quick-play-row button[data-quick-play="6-3"]{color:#ff6b61!important}

/* Organized Game Summary. */
.game-summary-page{padding:10px}.summary-page-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 2px 10px}.summary-page-head h2{margin:1px 0 0;font-size:18px}.summary-score-hero{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;background:#fbfaf7;padding:10px}.summary-score-team{display:grid;grid-template-columns:42px minmax(0,1fr) 42px;align-items:center;gap:7px;min-width:0}.summary-score-team.home{grid-template-columns:42px minmax(0,1fr) 42px;text-align:right}.summary-score-team img{width:42px;height:42px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:7px;padding:3px}.summary-score-team div{min-width:0}.summary-score-team span{display:block;font-size:7px;font-weight:900;text-transform:uppercase;color:var(--muted)}.summary-score-team strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-score-team b{font-size:26px}.summary-final-chip{padding:4px 7px;border-radius:999px;background:var(--theme-primary);color:#fff;font-size:8px;font-weight:900;white-space:nowrap}.summary-game-meta{grid-column:1/-1;display:flex;gap:10px;justify-content:center;padding-top:7px;border-top:1px solid var(--line);font-size:9px;color:var(--muted)}.summary-card{margin-top:8px;border:1px solid var(--line);border-radius:9px;background:#fbfaf7;overflow:hidden}.summary-card-title{padding:7px 9px;background:#f2ecdf;border-bottom:1px solid var(--line);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}.summary-two-col{display:grid;grid-template-columns:1fr 1fr;gap:8px}.summary-line-wrap,.summary-table-wrap{overflow-x:auto}.summary-line-table,.summary-stat-table{width:100%;border-collapse:collapse;font-size:9px;min-width:540px}.summary-line-table th,.summary-line-table td,.summary-stat-table th,.summary-stat-table td{padding:6px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);text-align:center;white-space:nowrap}.summary-line-table th:first-child,.summary-stat-table th:first-child,.summary-stat-table td:first-child{text-align:left}.summary-line-table thead,.summary-stat-table thead{background:#f6f2e8}.sum-total{font-weight:900}.summary-list{display:grid}.summary-list-row{display:grid;grid-template-columns:70px minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px 9px;border-bottom:1px solid var(--line);font-size:9px}.summary-list-row:last-child{border-bottom:0}.summary-list-row span{color:var(--muted);font-weight:800}.summary-list-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.summary-list-row b{font-size:9px;text-align:right}.summary-empty{padding:12px;color:var(--muted);font-size:10px}
body[data-theme="wrigley"] .game-summary-page,body[data-theme="wrigley"] .summary-score-hero,body[data-theme="wrigley"] .summary-card{background:#0b3428!important;border-color:#7d7252!important}body[data-theme="wrigley"] .summary-card-title,body[data-theme="wrigley"] .summary-line-table thead,body[data-theme="wrigley"] .summary-stat-table thead{background:#08291f!important;color:#e9dcba!important}body[data-theme="wrigley"] .summary-line-table th,body[data-theme="wrigley"] .summary-line-table td,body[data-theme="wrigley"] .summary-stat-table th,body[data-theme="wrigley"] .summary-stat-table td,body[data-theme="wrigley"] .summary-list-row{border-color:#776c4e!important}body[data-theme="wrigley"] .summary-final-chip{background:#d7c28e;color:#10281f}
body[data-mode="dark"]:not([data-theme="wrigley"]) .summary-score-hero,body[data-mode="dark"]:not([data-theme="wrigley"]) .summary-card{background:#171a1f!important}body[data-mode="dark"]:not([data-theme="wrigley"]) .summary-card-title,body[data-mode="dark"]:not([data-theme="wrigley"]) .summary-line-table thead,body[data-mode="dark"]:not([data-theme="wrigley"]) .summary-stat-table thead{background:#20252c!important}
@media(max-width:700px){.summary-two-col{grid-template-columns:1fr}.summary-score-hero{grid-template-columns:1fr auto 1fr}.summary-score-team{grid-template-columns:34px minmax(0,1fr) 30px}.summary-score-team.home{grid-template-columns:30px minmax(0,1fr) 34px}.summary-score-team img{width:34px;height:34px}.summary-score-team b{font-size:22px}.summary-final-chip{font-size:6px}.summary-game-meta{font-size:8px;gap:6px;flex-wrap:wrap}.quick-play-row{grid-template-columns:repeat(4,minmax(0,1fr))}.summary-list-row{grid-template-columns:60px minmax(0,1fr);}.summary-list-row b{grid-column:2;text-align:left;color:var(--muted)}}
@media(max-width:430px){.hero-actions{gap:3px}.hero button{padding:5px 6px!important}.focus-toggle{font-size:8px!important}.app-tab{font-size:8px!important;padding:3px 4px!important}.quick-editor-context{padding:6px}.editor-game-context{font-size:9px}.base-chip{font-size:8px}}
/* v25.1 — keep all four thin tabs on a single row. */
.app-tabs{grid-template-columns:repeat(4,minmax(0,1fr))!important}
