:root{
  --page:#fffba0;
  --page2:#fff7b9;
  --line:#2233aa;
  --line2:#0a7a32;
  --ink:#07111f;
  --red:#d40000;
  --green:#cdf6c9;
  --white:#fffef3;
  --panel:#fff8cf;
  --shadow:rgba(0,0,0,.22);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:"Courier New", Courier, monospace;color:var(--ink);background:#f3f3ef}
button,input,select,textarea{font:inherit}
.appShell{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:10px;padding:10px;align-items:start;background:#eee;min-height:100vh}
.scorecardDesk{min-width:0;overflow:auto;padding:8px;background:#fff;border:1px solid #aaa}
.almanacSheet{background:var(--page);border:4px solid #111;box-shadow:0 4px 18px var(--shadow);padding:12px;min-width:1120px;max-width:1500px;margin:0 auto}
.sheetTop{display:grid;grid-template-columns:220px 1fr 260px;align-items:center;gap:12px;margin-bottom:8px}
.yearBox{background:var(--white);border:3px solid #111;text-align:center;color:#0529ff;font-size:28px;font-weight:900;padding:10px 8px;line-height:1}
.scorebookTitle{justify-self:center;min-width:360px;border:2px solid #111;background:#fffcae;text-align:center;color:var(--red);font-weight:900;padding:5px;text-transform:none;letter-spacing:.02em}
.gameMiniBox{display:grid;grid-template-columns:48px 1fr;gap:4px;align-items:center;font-size:12px;font-weight:700}.gameMiniBox select{width:100%;border:2px solid #111;background:#fff;min-height:24px}
.printedInfoGrid{display:grid;grid-template-columns:repeat(8,1fr);border:2px solid var(--line2);background:#e9ffd0;margin:6px 0 8px}.printedInfoGrid>div{min-height:32px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:2px 4px;background:#ffffcc}.printedInfoGrid b{display:block;font-size:9px;color:#063e0b;text-transform:uppercase}.printedInfoGrid span{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.liveScoreStrip{display:grid;grid-template-columns:80px 80px 90px 1.2fr 1.2fr 70px 70px 100px;gap:0;border:2px solid var(--line2);margin-bottom:8px;background:#dff8c8}.statusBlock,.baseStateCard{border-right:1px solid var(--line);padding:3px 5px;background:#ffffc6;min-height:42px}.statusBlock b,.baseStateCard b{display:block;color:#0b4e14;font-size:9px;text-transform:uppercase}.statusBlock span{font-weight:900;font-size:13px}.statusBlock.score span{font-size:18px;color:#001a7a}.baseDiamond{position:relative;width:48px;height:35px;margin:0 auto}.baseDiamond span{position:absolute;font-size:16px;line-height:1}.baseDiamond .second{top:0;left:19px}.baseDiamond .third{top:13px;left:4px}.baseDiamond .first{top:13px;right:4px}.baseDiamond .home{bottom:0;left:19px}
.scorebookHelpBar{border:2px solid var(--line2);background:#fffcc1;padding:5px 8px;font-size:10px;margin-bottom:8px;line-height:1.25}
.teamScoreSection{border:2px solid var(--line2);background:#f8f3af;margin-bottom:10px}.teamHeaderLine{display:grid;grid-template-columns:180px 1fr;background:#c7f6c3;border-bottom:2px solid var(--line2);font-weight:900;text-align:center;color:#073e0d;font-size:12px}.teamHeaderLine span{border-right:1px solid var(--line);padding:3px}
.scorebook{width:100%;border-collapse:collapse;table-layout:fixed;background:#fffcc2;font-size:10px}.scorebook th,.scorebook td{border:1px solid var(--line);padding:0;vertical-align:top}.scorebook thead th{height:22px;background:#c8f8c4;color:#001d66;text-align:center;font-weight:900;font-size:10px}.scorebook th.bat{width:28px}.scorebook th.num{width:34px}.scorebook th.name{width:145px}.scorebook th.pos{width:60px}.scorebook th.tot{width:28px}.scorebook td.bat,.scorebook td.num,.scorebook td.pos,.scorebook td.tot{text-align:center;background:#fff7a6;font-weight:900}.scorebook td.name{background:#fffdf2;padding:2px 4px;font-weight:700;white-space:normal}.subtag{display:block;font-size:8px;color:#0c4880;margin-top:1px}.scorebook tbody tr{height:58px}.scorebook tbody tr:nth-child(even) td{background-color:#fffbd1}.scorebook tfoot td{height:44px;background:#eadf93!important;text-align:center;font-size:9px;font-weight:900}.totalsRow td:first-child{text-align:left!important;padding-left:6px!important;color:#111}
.cell{position:relative;min-height:58px;height:58px;background:#fffdee;background-image:linear-gradient(45deg,rgba(35,51,170,.05) 25%,transparent 25%,transparent 50%,rgba(35,51,170,.05) 50%,rgba(35,51,170,.05) 75%,transparent 75%);background-size:10px 10px;overflow:hidden}.cell.active{box-shadow:inset 0 0 0 3px #000;background-color:#fff3a0}.cell.active:before{content:"CURRENT";position:absolute;right:2px;top:2px;background:#111;color:#fff;font-size:6px;font-weight:900;padding:1px 2px;z-index:4}.cell.multi{overflow:auto}
.pa{position:relative;min-height:54px;height:54px;margin:1px;background:rgba(255,255,245,.72);border:1px solid rgba(35,51,170,.28);overflow:hidden;padding:2px 18px 12px 22px}.paMeta{position:relative;z-index:3;text-align:center;margin-top:13px}.paCode{font-family:Arial,Helvetica,sans-serif;font-size:13px;font-weight:900;color:#06135f;background:rgba(255,255,255,.85);padding:0 3px}.paIndex{position:absolute;right:-12px;top:-13px;background:#e6f8ff;border:1px solid #123c99;font-size:7px;font-weight:900}.paAudit{position:absolute;right:-18px;top:-13px;border:0;background:transparent;font-size:9px;padding:0;cursor:pointer}.paRun{position:absolute;left:2px;bottom:2px;font:bold 10px Arial;background:#111;color:#fff;padding:0 3px;border-radius:2px;z-index:4}.paRbi{position:absolute;right:2px;top:2px;font:bold 8px Arial;background:#fff;border:1px solid #111;padding:0 2px;z-index:4}.paOut{position:absolute;right:2px;bottom:2px;width:17px;height:17px;border:2px solid #111;border-radius:50%;text-align:center;line-height:13px;background:#fff;font:bold 10px Arial;z-index:4}.paOut:empty,.paRbi:empty{display:none}.paNote{position:absolute;left:22px;right:20px;bottom:2px;font:italic 7px Arial;color:#4a3211;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:4}.paTags{position:absolute;left:2px;top:2px;font:bold 7px Arial;color:#663300;background:rgba(255,255,255,.7);z-index:4}.pa.lob:before{content:"LOB";position:absolute;left:2px;top:2px;font:bold 7px Arial;background:#fff0a8;border:1px dashed #663300;padding:0 2px;z-index:5}.pa.inningEnd:after{content:"";position:absolute;right:-8px;bottom:8px;width:44px;border-top:4px solid #111;transform:rotate(-45deg);z-index:5}.pa.scored .miniDiamond{background:#111}.pa.scored .miniDiamond .seg{background:#fff}.pa.selected{outline:3px solid #000}
.miniDiamond{position:absolute;left:50%;top:50%;width:32px;height:32px;transform:translate(-50%,-50%) rotate(45deg);border:2px solid rgba(35,51,170,.35);background:rgba(255,255,255,.35);z-index:1}.miniDiamond .seg{position:absolute;background:#1132b8;opacity:.8;display:none}.miniDiamond .seg1{left:-1px;bottom:-1px;width:2px;height:17px}.miniDiamond .seg2{left:-1px;top:-1px;width:17px;height:2px}.miniDiamond .seg3{right:-1px;top:-1px;width:2px;height:17px}.miniDiamond .seg4{right:-1px;bottom:-1px;width:17px;height:2px}.pa.b1 .seg1,.pa.b2 .seg1,.pa.b2 .seg2,.pa.b3 .seg1,.pa.b3 .seg2,.pa.b3 .seg3,.pa.hr .seg1,.pa.hr .seg2,.pa.hr .seg3,.pa.hr .seg4,.pa.scored .seg1,.pa.scored .seg2,.pa.scored .seg3,.pa.scored .seg4{display:block}.baseMark{position:absolute;font:bold 6px Arial;color:#001c88;transform:rotate(-45deg);opacity:.75}.homeMark{left:-5px;top:12px}.firstMark{left:12px;top:25px}.secondMark{left:25px;top:12px}.thirdMark{left:12px;top:-6px}
.livePitch{position:absolute;left:2px;bottom:2px;background:#000;color:#fff;font:bold 7px Arial;padding:1px 3px;z-index:8}.bottomScoreAreas{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:8px}.printedBox{border:2px solid var(--line2);background:#fff9c5;min-height:50px;padding:5px;font-size:10px}.printedBox b{display:block;color:#073e0d}.printedBox span{display:block;margin-top:4px}
.panel{position:sticky;top:8px;max-height:calc(100vh - 16px);overflow:auto;background:var(--panel);border:4px solid #111;padding:8px;box-shadow:0 4px 16px var(--shadow);font-family:Arial,Helvetica,sans-serif}.panel h2{margin:0 0 8px;text-align:center;background:#c8f8c4;border:2px solid var(--line2);font-size:15px;padding:4px}.panel h3{margin:9px 0 5px;background:#eadf93;border:1px solid #111;padding:3px 5px;font-size:11px;text-transform:uppercase}.toolbar{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-bottom:8px}.current,.workflowStage,.coach,.pending,.positionLegend,.paperFlow,.entryDetail{border:1px solid #6b5531;background:#fffdf1;border-radius:4px;padding:6px;margin:6px 0;font-size:11px;line-height:1.35}.coach b,.positionLegend b,.paperFlow b{display:block;margin-bottom:4px}.positionLegend{background:#fff8c7}.legendGrid{display:grid;grid-template-columns:1fr 1fr;gap:3px}.legendGrid div{background:#fff;border:1px solid #d2c183;padding:3px}.legendGrid span{display:inline-flex;width:18px;height:18px;background:#111;color:#fff;align-items:center;justify-content:center;font-weight:900;margin-right:4px}.paperFlow ol{margin:0;padding-left:18px}.paperFlow li{margin:2px 0}.paperFlow li.active{font-weight:900;color:#001c88}.paperFlow li.done{text-decoration:line-through;color:#287a2f}.paperFlow li.blocked{color:#9a0000}.confirm{width:100%;padding:8px 6px;background:#111;color:#fff;border:2px solid #111;font-weight:900;cursor:pointer}.confirm:disabled{background:#777;border-color:#555;cursor:not-allowed}.controlGroup,.advancedControls{border:1px solid #9c8a52;background:#fff9d6;border-radius:4px;padding:6px;margin:8px 0}.advancedControls summary{cursor:pointer;font-size:11px;line-height:1.25}.hint{font-size:10px;line-height:1.3}.buttons{display:grid;grid-template-columns:1fr;gap:4px}.buttons.three{grid-template-columns:1fr 1fr 1fr}.buttons button,.subbox button,.toolbar button,.positionSelector button,.backBtn{border:1px solid #111;background:#fffef0;padding:6px 5px;text-align:left;font-size:10px;font-weight:800;cursor:pointer}.buttons button:hover,.subbox button:hover,.toolbar button:hover{background:#ffef8f}.buttons button:disabled{opacity:.45;cursor:not-allowed;background:#ddd;color:#666}.subbox{display:grid;grid-template-columns:1fr 45px 70px;gap:4px}.subbox button{grid-column:1/-1;text-align:center}.subbox input{border:1px solid #111;background:#fff;padding:5px;font-size:11px}.auditList{list-style:none;margin:0;padding:0;display:grid;gap:4px;font-size:10px}.auditList li{border:1px solid #c8b36e;background:#fff;padding:5px;border-radius:3px}.auditList li.good{background:#eeffe8;border-color:#65a65e}.auditList li.warn{background:#fff3ca;border-color:#d5a33d}.auditList li.bad{background:#ffe8e8;border-color:#be5b5b}.auditList .readiness{background:#eaf0ff;border-left:4px solid #1b49b6}.statsGroup pre{max-height:220px;overflow:auto;background:#111;color:#e8ffe8;padding:8px;font-size:10px;white-space:pre-wrap}.entryDetail input,.entryDetail textarea{width:100%;border:1px solid #111;background:#fff}.entryDetail textarea{min-height:44px}.detailRow{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:5px 0}.detailActions{display:flex;gap:5px}.workflowOverlay{position:fixed;inset:auto 340px auto auto;top:80px;background:#fff8ca;border:3px solid #111;box-shadow:0 6px 22px rgba(0,0,0,.3);z-index:50;padding:14px;max-width:360px}
@media (max-width:1200px){.appShell{grid-template-columns:1fr}.panel{position:relative;top:auto;max-height:none}.scorecardDesk{order:2}.panel{order:1}.almanacSheet{min-width:1000px}}
@media print{body{background:#fff}.appShell{display:block;padding:0}.panel{display:none}.scorecardDesk{border:0;padding:0}.almanacSheet{border:2px solid #000;box-shadow:none;min-width:0;max-width:none;width:100%;padding:5px}.scorebook th,.scorebook td{border-color:#000}.bottomScoreAreas{page-break-inside:avoid}}
.pitchMarks{position:absolute;left:2px;top:14px;display:grid;grid-template-columns:repeat(3,12px);gap:1px;z-index:3;font:bold 6px Arial;color:#001b80}.pitchMarks span{display:block;border:1px solid rgba(35,51,170,.35);background:rgba(255,255,255,.65);text-align:center;line-height:9px;height:10px}

/* =========================================================
   AGGRESSIVE ALMANAC REPLICATION PASS
   Goal: make the UI read as a traditional printed scorecard,
   not a dashboard or spreadsheet.
   ========================================================= */
:root{
  --ba-paper:#fff67b;
  --ba-paper-soft:#fff9a8;
  --ba-grid-blue:#273aa6;
  --ba-grid-blue-soft:#5d68c8;
  --ba-grid-green:#0c8b3d;
  --ba-green-fill:#c8f2bf;
  --ba-cream:#fffbd1;
  --ba-red:#cf0000;
  --ba-ink:#020b27;
}
html,body{background:#f7f7f7;font-family:Arial, Helvetica, sans-serif;}
.appShell{
  display:grid;
  grid-template-columns:minmax(980px,1fr) 285px;
  gap:8px;
  padding:6px;
  background:#f2f2f2;
}
.scorecardDesk{
  background:#fff;
  border:0;
  padding:4px;
  overflow:auto;
}
.almanacSheet{
  min-width:1240px;
  max-width:1540px;
  margin:0 auto;
  padding:8px 10px 10px;
  background:var(--ba-paper);
  border:3px solid #101010;
  box-shadow:0 2px 8px rgba(0,0,0,.22);
  font-family:Arial, Helvetica, sans-serif;
}
.sheetTop{
  display:grid;
  grid-template-columns:150px 1fr 300px;
  gap:4px;
  margin-bottom:3px;
}
.yearBox{
  border:2px solid var(--ba-grid-blue);
  background:#fffcc7;
  color:var(--ba-red);
  font-size:18px;
  padding:3px;
  text-transform:uppercase;
  display:flex;
  align-items:center;
  justify-content:center;
}
.scorebookTitle{
  min-width:0;
  border:2px solid var(--ba-grid-green);
  background:#f6ffc2;
  color:#05377e;
  font-size:17px;
  letter-spacing:.04em;
  padding:4px 8px;
  text-transform:uppercase;
}
.gameMiniBox{
  grid-template-columns:52px 1fr;
  border:2px solid var(--ba-grid-blue);
  background:#fffbd5;
  padding:3px;
}
.gameMiniBox label{font-size:10px;text-transform:uppercase;font-weight:900;color:#0b5a1f;align-self:center;}
.gameMiniBox select{height:22px;font-size:11px;border:1px solid var(--ba-grid-blue);}
.printedInfoGrid{
  grid-template-columns:1.2fr 1.2fr .8fr 1fr .8fr 1fr 1fr .8fr;
  border:2px solid var(--ba-grid-green);
  background:var(--ba-grid-green);
  gap:1px;
  margin:3px 0 4px;
}
.printedInfoGrid>div{
  border:0;
  background:#ffffbc;
  min-height:27px;
  padding:2px 4px;
}
.printedInfoGrid b{font-size:8px;color:#064112;line-height:1;}
.printedInfoGrid span{font-size:10px;line-height:1.25;}
.almanacUpperStats{
  display:grid;
  grid-template-columns:1.1fr 1.2fr 1.7fr 1fr;
  gap:4px;
  border:2px solid var(--ba-grid-green);
  background:var(--ba-grid-green);
  margin:4px 0;
}
.upperBlock{background:#fffcc6;border:1px solid var(--ba-grid-blue);min-height:54px;}
.blockTitle{background:var(--ba-green-fill);border-bottom:1px solid var(--ba-grid-blue);text-align:center;font-size:9px;font-weight:900;text-transform:uppercase;color:#002b77;padding:2px;}
.miniRows{display:grid;grid-template-columns:repeat(5,1fr);gap:1px;padding:3px;}
.miniRows span,.statGrid span,.lineScoreMini span,.lineScoreMini b,.lineScoreMini i{min-height:14px;border:1px solid rgba(39,58,166,.75);background:#fffde0;font-size:8px;display:flex;align-items:center;justify-content:center;font-style:normal;}
.statGrid{display:grid;grid-template-columns:repeat(10,1fr);padding:4px;gap:1px;}
.lineScoreMini{display:grid;grid-template-columns:38px repeat(12,1fr);gap:1px;padding:1px 3px;}
.blankLines{display:grid;gap:5px;padding:7px 8px;}
.blankLines span{border-bottom:1px solid var(--ba-grid-blue);height:9px;}
.liveScoreStrip{
  grid-template-columns:78px 68px 76px 1.2fr 1.2fr 58px 58px 82px;
  border:2px solid var(--ba-grid-green);
  background:var(--ba-grid-green);
  gap:1px;
  margin:4px 0;
}
.statusBlock,.baseStateCard{border:0;background:#fffbbf;min-height:34px;padding:2px 4px;}
.statusBlock b,.baseStateCard b{font-size:8px;color:#064112;}
.statusBlock span{font-size:11px;line-height:1.1;}
.statusBlock.score span{font-size:16px;color:#001c88;}
.scorebookHelpBar{border:2px solid var(--ba-grid-green);background:#fffbd4;color:#111;font-size:9px;padding:3px 5px;margin:4px 0;}
.teamScoreSection{
  border:2px solid var(--ba-grid-green);
  background:var(--ba-paper);
  margin:5px 0 8px;
}
.teamHeaderLine{
  grid-template-columns:220px 1fr;
  background:var(--ba-green-fill);
  border-bottom:2px solid var(--ba-grid-green);
  color:#002b77;
  font-size:10px;
}
.teamHeaderLine span{padding:2px;border-right:1px solid var(--ba-grid-blue);}
.scorebook{
  font-size:9px;
  background:var(--ba-paper-soft);
  border-collapse:collapse;
  table-layout:fixed;
}
.scorebook th,.scorebook td{border:1px solid var(--ba-grid-blue);}
.scorebook thead th{
  height:18px;
  background:var(--ba-green-fill);
  color:#002b77;
  font-size:8px;
  border-color:var(--ba-grid-blue);
}
.scorebook th.bat{width:24px}.scorebook th.num{width:32px}.scorebook th.name{width:130px}.scorebook th.pos{width:58px}
.scorebook th.inningHead{width:76px;}
.scorebook th.statHead{width:25px;background:#d8f6ca;color:#002b77;font-size:8px;}
.scorebook td.bat,.scorebook td.num,.scorebook td.pos,.scorebook td.tot{background:#fff6a5;font-size:9px;color:#111;}
.scorebook td.name{background:#fffde1;font-size:10px;font-weight:800;}
.scorebook tbody tr{height:68px;}
.scorebook tbody tr:nth-child(even) td{background-color:#fffcc3;}
.scorebook tfoot td{height:36px;background:#efe29a!important;font-size:8px;}
.scoreCellWrap{background:#fffbd2!important;}
.cell{
  height:68px;
  min-height:68px;
  background:#fffbd7;
  background-image:
    linear-gradient(90deg,rgba(39,58,166,.12) 0 1px,transparent 1px),
    linear-gradient(0deg,rgba(39,58,166,.10) 0 1px,transparent 1px),
    repeating-linear-gradient(45deg,rgba(39,58,166,.035) 0 2px,transparent 2px 7px);
  background-size:18px 18px,18px 18px,10px 10px;
}
.cell:after{
  content:"";
  position:absolute;
  left:50%;top:50%;
  width:34px;height:34px;
  transform:translate(-50%,-50%) rotate(45deg);
  border:2px solid rgba(39,58,166,.28);
  background:rgba(255,255,255,.18);
  pointer-events:none;
}
.cell:before{
  content:"B  S  F";
  position:absolute;left:2px;top:2px;
  font:bold 6px Arial;color:#263aa6;
  letter-spacing:2px;z-index:1;
}
.cell.active{box-shadow:inset 0 0 0 3px #111;background-color:#fff39c;}
.pa{
  height:64px;
  min-height:64px;
  margin:1px;
  border:0;
  background:transparent;
  padding:2px 18px 12px 20px;
}
.paMeta{margin-top:17px;}
.paCode{font-size:14px;color:#001b80;background:rgba(255,255,255,.72);border:1px solid rgba(39,58,166,.35);}
.pitchMarks{top:3px;left:3px;grid-template-columns:repeat(3,13px);}
.pitchMarks span{height:10px;line-height:9px;background:#fffde8;border-color:var(--ba-grid-blue);font-size:6px;}
.miniDiamond{width:38px;height:38px;border-color:rgba(39,58,166,.38);background:rgba(255,255,255,.25);}
.paOut{width:18px;height:18px;line-height:14px;border:2px solid #111;background:#fffde9;}
.paRbi{font-size:7px;border-color:#111;background:#fffde8;}
.paRun{background:#111;color:#fff;}
.paNote{font-size:7px;color:#2b1b00;}
.bottomScoreAreas{
  grid-template-columns:1.1fr 1.4fr 1fr;
  gap:4px;
  margin-top:5px;
}
.printedBox{border:2px solid var(--ba-grid-green);background:#fffcc6;min-height:62px;font-size:9px;}
.printedBox b{background:var(--ba-green-fill);display:block;margin:-5px -5px 4px;padding:2px;text-align:center;color:#002b77;border-bottom:1px solid var(--ba-grid-blue);}
.panel{
  border:3px solid #111;
  background:#fff8c8;
  padding:6px;
  max-height:calc(100vh - 12px);
  font-size:11px;
}
.panel h2{font-size:13px;margin-bottom:5px;}
.panel h3{font-size:10px;margin:7px 0 4px;}
.buttons button,.toolbar button,.positionSelector button,.backBtn{font-size:9px;padding:4px 5px;line-height:1.1;}
.current,.workflowStage,.coach,.pending,.positionLegend,.paperFlow,.entryDetail{font-size:10px;margin:4px 0;padding:5px;}
.legendGrid{grid-template-columns:1fr;}
.controlGroup,.advancedControls{margin:5px 0;padding:5px;}
@media(max-width:1300px){
  .appShell{grid-template-columns:1fr;}
  .panel{position:relative;top:auto;max-height:none;order:1;}
  .scorecardDesk{order:2;}
}

/* =========================================================
   PASS 2 — CLOSER BASEBALL ALMANAC SCORECARD REPLICATION
   This layer intentionally pushes the app away from a web-app
   dashboard and toward a printed scorebook worksheet.
   ========================================================= */
body{
  background:#d9d9d9;
}
.appShell{
  grid-template-columns:minmax(1180px,1fr) 250px;
  align-items:start;
  gap:6px;
  padding:4px;
}
.panel{
  max-height:calc(100vh - 8px);
  border:3px solid #111;
  background:#fff5b8;
  box-shadow:none;
}
.panel h2{
  background:#c9efb7;
  border:1px solid var(--ba-grid-blue);
  color:#001b80;
  text-align:center;
  font-size:13px;
  padding:4px;
  margin:0 0 6px;
  text-transform:uppercase;
}
.scorecardDesk{
  padding:0;
  background:#efefef;
}
.almanacSheet{
  width:1520px;
  max-width:none;
  min-width:1520px;
  min-height:980px;
  padding:7px 9px 12px;
  background:
    linear-gradient(rgba(255,255,255,.10),rgba(255,255,255,.10)),
    repeating-linear-gradient(0deg, rgba(0,0,0,.018) 0 1px, transparent 1px 4px),
    var(--ba-paper);
  border:4px solid #111;
}
.sheetTop{
  grid-template-columns:170px 1fr 335px;
  gap:5px;
}
.scorebookTitle{
  text-align:center;
  font-size:20px;
  font-weight:900;
  padding:5px;
  border:2px solid var(--ba-grid-green);
}
.yearBox{
  font-size:20px;
  font-weight:900;
  color:#d00000;
}
.printedInfoGrid{
  grid-template-columns:1.3fr 1.3fr .75fr .9fr .8fr 1.1fr .9fr .75fr;
  margin-top:5px;
}
.printedInfoGrid>div{
  min-height:34px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  position:relative;
}
.printedInfoGrid>div:after{
  content:"";
  display:block;
  border-bottom:1px solid var(--ba-grid-blue);
  margin-top:2px;
}
.printedInfoGrid b{font-size:9px;text-transform:uppercase;}
.printedInfoGrid span{font-size:12px;color:#111;}
.liveScoreStrip{
  margin:5px 0;
}
.almanacUpperStats{
  grid-template-columns:1.25fr 1.35fr 1.65fr 1.1fr;
  min-height:75px;
}
.upperBlock{min-height:75px;}
.blockTitle{font-size:10px;padding:3px;}
.miniRows span,.statGrid span,.lineScoreMini span,.lineScoreMini b,.lineScoreMini i{
  min-height:17px;
  font-size:9px;
}
.scorebookHelpBar{
  display:none;
}
.teamScoreSection{
  margin:6px 0 9px;
  border:3px solid var(--ba-grid-green);
}
.teamHeaderLine{
  min-height:22px;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}
.scorebook{
  width:100%;
  font-size:10px;
}
.scorebook th.bat{width:30px}.scorebook th.num{width:36px}.scorebook th.name{width:150px}.scorebook th.pos{width:65px}
.scorebook th.inningHead{width:92px;}
.scorebook th.statHead{width:31px;}
.scorebook thead th{
  height:20px;
  font-size:9px;
  letter-spacing:.02em;
}
.scorebook tbody tr{height:58px;}
.scorebook td.name{
  font-size:10px;
  position:relative;
}
.scorebook td.name .paperLine{
  display:block;
  height:20px;
  border-bottom:1px solid var(--ba-grid-blue);
  margin:10px 6px 0;
}
.emptyLine td{
  background:#fff8b6!important;
}
.cell{
  height:56px;
  min-height:56px;
  overflow:hidden;
  background-color:#fffdd4;
  background-image:
    linear-gradient(90deg,rgba(39,58,166,.18) 0 1px,transparent 1px),
    linear-gradient(0deg,rgba(39,58,166,.15) 0 1px,transparent 1px),
    repeating-linear-gradient(45deg,rgba(39,58,166,.05) 0 1px,transparent 1px 6px);
  background-size:16px 16px,16px 16px,8px 8px;
}
.cell:after{
  width:38px;
  height:38px;
  border:2px solid rgba(39,58,166,.32);
}
.cell.emptyCell:before{
  content:"B  S  F";
}
.pa{
  height:54px;
  min-height:54px;
  padding:1px 15px 10px 18px;
}
.paMeta{margin-top:14px;}
.paCode{
  font-size:13px;
  min-width:24px;
  padding:1px 2px;
}
.miniDiamond{
  width:38px;
  height:38px;
  opacity:.95;
}
.paTags{
  max-width:80px;
  font-size:6px;
}
.inningTotalCell{
  font-size:8px;
  line-height:1.15;
  text-align:center;
  vertical-align:middle;
  background:#efe29a!important;
}
.totalGuide{
  color:rgba(0,27,128,.55);
  font-size:7px;
}
.bottomScoreAreas{
  grid-template-columns:1.2fr 1.4fr 1.2fr;
  gap:5px;
}
.printedBox{
  min-height:78px;
  padding:4px;
  background:#fffcc6;
  position:relative;
}
.printedBox b{
  display:block;
  background:#c8f2bf;
  border:1px solid var(--ba-grid-blue);
  color:#002b77;
  text-align:center;
  padding:2px;
  margin-bottom:4px;
}
.printedBox span{
  display:block;
  min-height:48px;
  background:repeating-linear-gradient(0deg, transparent 0 13px, rgba(39,58,166,.35) 13px 14px);
  font-size:9px;
}
.controlGroup h3{
  font-size:11px;
  margin:0 0 4px;
  background:#c8f2bf;
  border:1px solid var(--ba-grid-blue);
  color:#002b77;
  padding:3px;
  text-align:center;
  text-transform:uppercase;
}
.controlGroup,.advancedControls,.positionLegend,.paperFlow,.coach,.current,.pending,.entryDetail{
  border-color:var(--ba-grid-blue);
  background:#fffbd0;
  border-radius:0;
}
.buttons button,.subbox button,.toolbar button,.positionSelector button,.backBtn{
  font-size:9px;
  padding:4px 4px;
  border-color:#111;
  background:#fffde5;
}
.toolbar.setup{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:3px;
}
.positionLegend .legendGrid{
  grid-template-columns:1fr;
}
.positionLegend .legendGrid div{
  font-size:10px;
  padding:2px;
  border-bottom:1px solid rgba(39,58,166,.35);
}
@media (max-width:1400px){
  .appShell{grid-template-columns:1fr;}
  .panel{position:relative;max-height:none;order:1;}
  .scorecardDesk{order:2;overflow:auto;}
}

/* =========================================================
   ALMANAC FIDELITY PASS 2 — one readable sheet, printed form cells
   ========================================================= */
.scorecardPageTabs{
  display:grid;
  grid-template-columns:180px 180px 1fr;
  align-items:center;
  gap:2px;
  margin:4px 0;
  border:2px solid var(--ba-grid-green);
  background:var(--ba-grid-green);
}
.pageTab{
  border:1px solid var(--ba-grid-blue);
  background:#fffcc6;
  color:#002b77;
  font:bold 10px Arial, sans-serif;
  padding:4px 6px;
  cursor:pointer;
}
.pageTab.active{
  background:#c8f2bf;
  box-shadow:inset 0 0 0 2px #002b77;
}
.pageTabNote{
  background:#fffcc6;
  border:1px solid var(--ba-grid-blue);
  color:#002b77;
  font:italic 9px Arial, sans-serif;
  padding:4px 6px;
  min-height:20px;
}
body[data-scorecard-view="away"] .homePage{display:none;}
body[data-scorecard-view="home"] .visitorPage{display:none;}
body[data-scorecard-view="away"] .visitorPage,
body[data-scorecard-view="home"] .homePage{display:block;}

/* Make one active team page feel like a full scorecard sheet instead of a web table. */
.teamScoreSection{
  margin-top:6px;
  margin-bottom:6px;
  box-shadow:inset 0 0 0 1px #fffde8;
}
.teamHeaderLine{
  min-height:22px;
  align-items:center;
  letter-spacing:.04em;
}
.scorebook.almanacGrid{
  width:100%;
  border:2px solid var(--ba-grid-blue);
}
.scorebook th.name{width:155px;}
.scorebook th.pos{width:70px;}
.scorebook th.inningHead{width:88px;}
.scorebook tbody tr{height:78px;}
.cell{
  height:78px;
  min-height:78px;
  overflow:hidden;
}
.pa{
  height:74px;
  min-height:74px;
}

/* Closer to the Baseball Almanac printed cell: faint diamond, pitch strip, boxed guides. */
.cell:after{
  width:42px;
  height:42px;
  border:2px solid rgba(39,58,166,.34);
  background:rgba(255,255,255,.12);
}
.cell:before{
  content:"BALLS    STRIKES    FOULS";
  left:2px;
  top:1px;
  letter-spacing:0;
  font:bold 5.5px Arial, sans-serif;
  color:rgba(0,27,128,.75);
}
.cell .pitchMarks{
  top:9px;
  left:2px;
  grid-template-columns:repeat(3,16px);
}
.cell .pitchMarks span{
  width:16px;
  height:11px;
  line-height:10px;
  font-size:6px;
}
.cellGuideLine{display:none;}
.miniDiamond{
  width:44px;
  height:44px;
  border:2px solid rgba(39,58,166,.45);
}
.paCode{
  min-width:30px;
  text-align:center;
  font:bold 15px Arial, sans-serif;
  color:#001b80;
  border:1px solid rgba(39,58,166,.55);
  background:rgba(255,255,220,.86);
}
.paMeta{margin-top:22px;}
.paOut{
  right:2px;
  bottom:2px;
  width:20px;
  height:20px;
  line-height:16px;
  border-radius:50%;
  font:bold 11px Arial, sans-serif;
}
.paRbi{
  right:2px;
  top:22px;
  background:#fff8a8;
  color:#001b80;
  border:1px solid var(--ba-grid-blue);
}
.paRun{
  left:2px;
  bottom:2px;
  width:20px;
  height:16px;
  border:1px solid #111;
  font:bold 10px Arial, sans-serif;
}
.paNote{
  left:22px;
  bottom:2px;
  max-width:54px;
  color:#001b80;
  background:rgba(255,255,220,.75);
}
.paTags{
  right:24px;
  bottom:2px;
  max-width:54px;
  background:#fff8a8;
  border:1px solid rgba(39,58,166,.55);
  color:#001b80;
}

/* Print-card style top blocks: denser and less app-like. */
.almanacSheet{
  min-width:1320px;
  max-width:1680px;
}
.almanacUpperStats{
  grid-template-columns:1.25fr 1.35fr 2fr 1.15fr;
}
.upperBlock{min-height:66px;}
.blockTitle{font-size:9px;letter-spacing:.03em;}
.printedInfoGrid>div{min-height:31px;}
.printedInfoGrid b{font-size:8px;text-transform:uppercase;}
.printedInfoGrid span{border-bottom:1px solid rgba(39,58,166,.4);display:block;min-height:14px;}

/* Reduce web-app feel of side panel while preserving live scoring. */
.panel{
  width:285px;
  background:#fff5b7;
}
.panel h2{
  background:#c8f2bf;
  border:1px solid var(--ba-grid-blue);
  color:#002b77;
  text-align:center;
  padding:4px;
}
.advancedControls[open]{max-height:420px;overflow:auto;}

@media print{
  .scorecardPageTabs,.scorebookHelpBar{display:none;}
  body[data-scorecard-view="away"] .homePage,
  body[data-scorecard-view="home"] .visitorPage{display:none!important;}
  .teamScoreSection{display:block!important;}
  .cell,.pa{height:64px;min-height:64px;}
}

/* =========================================================
   ALMANAC FIDELITY PASS 3 — printed scorecard refinement
   ========================================================= */
body{
  background:#e8e2c7;
  color:var(--ba-ink);
}
.appShell{
  grid-template-columns:minmax(1120px,1fr) 250px;
  gap:6px;
  padding:5px;
  align-items:start;
}
.scorecardDesk{
  background:#d8d0a7;
  padding:6px;
  border:1px solid #8a8055;
}
.almanacSheet{
  min-width:1320px;
  max-width:1680px;
  padding:7px 9px 11px;
  border:4px double #111;
  background:
    radial-gradient(circle at 16% 11%, rgba(255,255,255,.36), transparent 22%),
    linear-gradient(0deg, rgba(255,255,255,.18), rgba(255,255,255,0) 22%),
    var(--ba-paper);
  box-shadow:0 1px 0 #fff inset, 0 6px 18px rgba(0,0,0,.28);
}
.sheetTop{
  grid-template-columns:132px 1fr 270px;
  align-items:stretch;
}
.yearBox{
  font-family:Georgia, 'Times New Roman', serif;
  font-size:15px;
  font-weight:900;
  line-height:1.05;
  color:#0d4c19;
  background:#fff7a4;
  border:2px solid var(--ba-grid-blue);
}
.scorebookTitle{
  display:grid;
  grid-template-columns:180px 1fr 210px;
  align-items:center;
  text-align:center;
  gap:4px;
  padding:2px 6px;
  font-family:Georgia, 'Times New Roman', serif;
  background:#fff897;
  border:3px solid var(--ba-grid-green);
}
.scorebookTitle span,
.scorebookTitle em{
  color:#0b5a1f;
  font-size:10px;
  font-style:normal;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.scorebookTitle strong{
  color:#002b77;
  font-size:22px;
  letter-spacing:.08em;
}
.printedInfoGrid{
  grid-template-columns:1.25fr 1.25fr .7fr .9fr .75fr .95fr .95fr .7fr;
  gap:1px;
  border:3px solid var(--ba-grid-green);
}
.printedInfoGrid>div{
  min-height:30px;
  box-shadow:inset 0 -1px 0 rgba(39,58,166,.35);
}
.printedInfoGrid b{
  font-size:8px;
  letter-spacing:.05em;
}
.printedInfoGrid span{
  border-bottom:1px solid rgba(39,58,166,.65);
  min-height:15px;
}
.printedLedgerStrip{
  display:grid;
  grid-template-columns:1fr 1.35fr 1fr 1.55fr;
  gap:1px;
  background:var(--ba-grid-green);
  border:2px solid var(--ba-grid-green);
  margin:4px 0;
}
.printedLedgerStrip div{
  background:#fffbc5;
  min-height:28px;
  padding:2px 5px;
  border:1px solid var(--ba-grid-blue);
}
.printedLedgerStrip b{
  display:block;
  font-size:8px;
  color:#064112;
  text-transform:uppercase;
  line-height:1;
}
.printedLedgerStrip span{
  display:block;
  font-size:9px;
  color:#002b77;
  line-height:1.4;
  font-weight:700;
}
.scorecardPageTabs{
  background:#fff8a1;
  border:2px solid var(--ba-grid-blue);
  padding:3px;
  display:grid;
  grid-template-columns:170px 170px 1fr;
  gap:3px;
}
.pageTab{
  border:2px solid var(--ba-grid-blue);
  background:#f7f0aa;
  font-size:10px;
  color:#002b77;
  padding:4px;
  font-weight:900;
}
.pageTab.active{
  background:var(--ba-green-fill);
  color:#041;
  box-shadow:inset 0 0 0 2px #fff8a8;
}
.pageTabNote{
  display:flex;align-items:center;
  font-size:9px;
  color:#183a7a;
  padding-left:6px;
}
.teamHeaderLine{
  font-family:Georgia, 'Times New Roman', serif;
  font-weight:900;
  letter-spacing:.05em;
  min-height:22px;
}
.scorebook{
  border:3px solid var(--ba-grid-blue);
  outline:2px solid var(--ba-grid-green);
  outline-offset:-5px;
}
.scorebook thead th{
  height:22px;
  background:#c5efb8;
  border:1px solid var(--ba-grid-blue);
  font-size:9px;
  font-family:Arial Narrow, Arial, sans-serif;
  text-transform:uppercase;
}
.scorebook th.inningHead{
  width:88px;
  font-size:13px;
  font-family:Georgia, 'Times New Roman', serif;
}
.scorebook th.bat{width:26px}
.scorebook th.num{width:35px}
.scorebook th.name{width:150px}
.scorebook th.pos{width:62px}
.scorebook th.statHead{width:28px}
.scorebook tbody tr{height:78px;}
.scorebook td{
  border:1px solid var(--ba-grid-blue);
}
.scorebook td.bat,
.scorebook td.num,
.scorebook td.pos,
.scorebook td.tot{
  background:#fff3a0!important;
  color:#001b80;
  font-family:Arial Narrow, Arial, sans-serif;
  font-weight:900;
}
.scorebook td.name{
  background:#fffbd6!important;
  border-bottom:2px solid var(--ba-grid-blue);
  font-family:Arial Narrow, Arial, sans-serif;
  font-size:11px;
  color:#111;
  vertical-align:top;
  padding-top:4px;
}
.scoreCellWrap{
  padding:0!important;
  background:#fff8b1!important;
}
.cell{
  height:78px;
  min-height:78px;
  border:0;
  background-color:#fff9bc;
  background-image:
    linear-gradient(90deg,rgba(39,58,166,.20) 0 1px,transparent 1px),
    linear-gradient(0deg,rgba(39,58,166,.18) 0 1px,transparent 1px),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(12,139,61,.16) 13px 14px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(12,139,61,.11) 22px 23px);
  background-size:100% 100%,100% 100%,100% 100%,100% 100%;
}
.cell:before{
  content:'B   S   F';
  top:3px;left:4px;
  font:bold 7px 'Arial Narrow', Arial, sans-serif;
  color:#002b77;
  letter-spacing:4px;
}
.cell:after{
  width:42px;height:42px;
  border:2px solid rgba(39,58,166,.42);
  background:rgba(255,255,255,.10);
}
.pa{
  height:74px;
  min-height:74px;
  padding:3px 20px 14px 22px;
}
.paMeta{margin-top:20px;}
.paCode{
  min-width:24px;
  font-size:15px;
  font-family:Georgia, 'Times New Roman', serif;
  color:#001b80;
  border:1px solid rgba(39,58,166,.55);
  background:#fffde1;
}
.pitchMarks{
  top:14px!important;
  left:4px!important;
  grid-template-columns:repeat(3,14px);
}
.pitchMarks span{
  height:11px;
  line-height:10px;
  font-size:6px;
  border:1px solid var(--ba-grid-blue);
  background:#fffde7;
}
.miniDiamond{
  width:44px;height:44px;
  border:2px solid rgba(39,58,166,.44);
}
.baseMark{
  font-size:6px!important;
  color:#2740a0!important;
}
.seg{background:#001b80!important;}
.paOut{
  right:2px;bottom:2px;
  width:19px;height:19px;
  border:2px solid #111;
  border-radius:50%;
  background:#fffde7;
  font-family:Georgia, 'Times New Roman', serif;
  font-weight:900;
}
.paRbi{
  right:2px;top:2px;
  color:#001b80;
  border:1px solid var(--ba-grid-blue);
  background:#fffde7;
  font-size:7px;
}
.paRun{
  left:2px;bottom:2px;
  width:17px;height:17px;
  line-height:17px;
  border:1px solid #111;
  border-radius:50%;
  font-size:9px;
}
.paTags{
  right:22px;bottom:2px;
  background:transparent;
  color:#111;
  font-size:6px;
  max-width:48px;
}
.paNote{
  font-size:7px;
  max-width:54px;
  color:#1b1b1b;
}
.cell.multi .pa{
  transform:scale(.82);
  transform-origin:top left;
  width:118%;
  margin-bottom:-13px;
}
.inningTotalCell{
  background:#fff6a6!important;
  font-family:Arial Narrow, Arial, sans-serif;
  text-align:center;
  color:#001b80;
  font-size:9px;
  font-weight:900;
}
.totalGuide{
  color:rgba(0,27,128,.65);
  font-size:8px;
  line-height:1.15;
}
.bottomScoreAreas{
  grid-template-columns:1.1fr 1.35fr 1.1fr;
  gap:5px;
}
.printedBox{
  min-height:78px;
  border:2px solid var(--ba-grid-blue);
  outline:2px solid var(--ba-grid-green);
  outline-offset:-4px;
  background:#fff8ad;
  padding:4px;
  position:relative;
}
.printedBox b{
  display:block;
  background:#c8f2bf;
  border:1px solid var(--ba-grid-blue);
  color:#002b77;
  font-size:9px;
  text-align:center;
  margin-bottom:5px;
  text-transform:uppercase;
}
.printedBox span{
  display:block;
  min-height:40px;
  border-bottom:1px solid var(--ba-grid-blue);
  border-top:1px solid rgba(39,58,166,.35);
  padding-top:5px;
}
.compactScorer{
  width:auto;
  max-width:250px;
  border:2px solid #111;
  background:#fff7a7;
  padding:7px;
  box-shadow:none;
}
.compactScorer h2{
  background:#c8f2bf;
  border:2px solid var(--ba-grid-blue);
  text-align:center;
  color:#002b77;
  font-family:Georgia, 'Times New Roman', serif;
  font-size:15px;
  margin:0 0 6px;
  padding:4px;
}
.current,.coach,.positionLegend,.paperFlow,.pending,.controlGroup,.advancedControls,.statsGroup{
  border:1px solid var(--ba-grid-blue);
  background:#fffbd0;
  border-radius:0;
  margin:5px 0;
}
.buttons button,.toolbar button,.subbox button,.backBtn,.positionSelector button{
  border:1px solid var(--ba-grid-blue);
  background:#fffde2;
  color:#111;
  font-family:Arial Narrow, Arial, sans-serif;
  font-size:10px;
  padding:5px 4px;
}
.controlGroup h3{font-size:10px;color:#002b77;text-transform:uppercase;margin:0 0 4px;}
.advancedControls summary{background:#fff1a2;border:1px solid var(--ba-grid-blue);padding:4px;color:#002b77;}
@media (max-width:1300px){
  .appShell{grid-template-columns:1fr;}
  .compactScorer{max-width:none;}
  .scorecardDesk{overflow:auto;}
}

/* =========================================================
   ALMANAC FIDELITY PASS 4 — scorecard-first rebuild polish
   Goal: closer to Baseball Almanac worksheet, less web app.
   ========================================================= */
:root{
  --alm-paper:#fff3a6;
  --alm-paper-deep:#f4e581;
  --alm-blue:#173a91;
  --alm-green:#127030;
  --alm-red:#b30000;
  --alm-ink:#10205a;
}
body{background:#d9d0a5!important;}
.appShell{
  grid-template-columns:minmax(1220px,1fr) 235px!important;
  gap:5px!important;
}
.scorecardDesk{padding:5px!important;background:#c9bf8d!important;}
.almanacSheet{
  border:5px double #000!important;
  background:
    linear-gradient(90deg, rgba(23,58,145,.045) 1px, transparent 1px) 0 0/18px 18px,
    linear-gradient(0deg, rgba(23,58,145,.035) 1px, transparent 1px) 0 0/18px 18px,
    radial-gradient(circle at 25% 12%, rgba(255,255,255,.32), transparent 24%),
    var(--alm-paper)!important;
  box-shadow:0 0 0 2px #fff4ad inset,0 0 0 6px rgba(0,0,0,.06) inset,0 10px 28px rgba(0,0,0,.32)!important;
}
.sheetTop{
  border:2px solid var(--alm-blue);
  background:#fff19a;
  padding:2px;
  gap:2px;
}
.scorebookTitle{
  border:2px solid var(--alm-green)!important;
  background:#fff07d!important;
  box-shadow:inset 0 0 0 1px var(--alm-blue);
}
.scorebookTitle strong{font-size:25px!important;line-height:1;color:var(--alm-blue)!important;}
.scorebookTitle span,.scorebookTitle em{font-size:9px!important;color:var(--alm-green)!important;}
.printedInfoGrid,
.almanacUpperStats,
.printedLedgerStrip,
.bottomScoreAreas{gap:2px!important;}
.printedInfoGrid>div,.upperBlock,.printedLedgerStrip>div,.printedBox,.teamHeaderLine{
  border:1.5px solid var(--alm-blue)!important;
  background:rgba(255,247,174,.78)!important;
  color:var(--alm-ink)!important;
}
.printedInfoGrid b,.blockTitle,.printedLedgerStrip b,.printedBox b,.teamHeaderLine span:first-child{
  color:var(--alm-green)!important;
  font-family:Arial Narrow,Arial,sans-serif!important;
  letter-spacing:.04em!important;
}
.liveScoreStrip{border:2px solid var(--alm-blue)!important;background:#fff7b8!important;}
.statusBlock,.baseStateCard{border:1px solid var(--alm-blue)!important;background:#fffbd1!important;}
.scorecardPageTabs{justify-content:flex-start;border:1px solid var(--alm-blue);background:#f4e581;padding:3px;}
.pageTab{border:2px solid var(--alm-blue)!important;background:#fff7ad!important;color:var(--alm-blue)!important;font-weight:900!important;}
.pageTab.active{background:#c9f0b3!important;color:#003a0b!important;border-color:var(--alm-green)!important;box-shadow:inset 0 -3px 0 var(--alm-green);}
.pageTabNote{margin-left:auto;font-size:9px;color:#274080;font-weight:700;}
.teamScoreSection{border:2px solid var(--alm-blue)!important;background:rgba(255,242,143,.9)!important;padding:2px!important;}
.scorebook{
  border-collapse:collapse!important;
  background:#fff5a4!important;
  color:var(--alm-ink)!important;
  table-layout:fixed!important;
  width:100%!important;
  font-family:Arial Narrow,Arial,sans-serif!important;
}
.scorebook th{
  background:#d8f4be!important;
  color:#062b7f!important;
  border:1.5px solid var(--alm-blue)!important;
  font-size:9px!important;
  text-transform:uppercase;
  letter-spacing:.02em;
  padding:2px!important;
}
.scorebook td{
  border:1.35px solid var(--alm-blue)!important;
  background:#fff6ab!important;
  padding:0!important;
}
.scorebook th.bat,.scorebook td.bat{width:26px!important;text-align:center;font-weight:900;background:#eef7bf!important;}
.scorebook th.num,.scorebook td.num{width:34px!important;text-align:center;font-weight:800;}
.scorebook th.name,.scorebook td.name{width:168px!important;font-weight:800;padding:2px 4px!important;background:#fff4a0!important;}
.scorebook th.pos,.scorebook td.pos{width:62px!important;text-align:center;font-size:9px!important;font-weight:900;background:#fff4a0!important;}
.scorebook th.inningHead{width:94px!important;background:#c9f0b3!important;color:#002477!important;font-size:13px!important;}
.scorebook th.tot,.scorebook td.tot{width:28px!important;text-align:center;font-size:9px!important;font-weight:900;background:#eef7bf!important;}
.scorebook tbody tr{height:86px!important;}
.scoreCellWrap{height:86px!important;}
.cell{height:86px!important;min-height:86px!important;background:#fff7b4!important;position:relative;}
.cell:before{
  content:"B     S     F"!important;
  position:absolute!important;left:2px!important;top:1px!important;right:auto!important;
  font:bold 6px Arial Narrow,Arial,sans-serif!important;color:rgba(23,58,145,.82)!important;
  letter-spacing:4px!important;z-index:1!important;
}
.cell:after{
  content:""!important;position:absolute!important;left:50%!important;top:52%!important;
  width:52px!important;height:52px!important;transform:translate(-50%,-50%) rotate(45deg)!important;
  border:2px solid rgba(23,58,145,.35)!important;background:transparent!important;z-index:0!important;
}
.pa{height:82px!important;min-height:82px!important;background:transparent!important;position:relative;z-index:2;}
.pitchMarks{top:10px!important;left:2px!important;display:grid!important;grid-template-columns:repeat(3,18px)!important;gap:1px!important;}
.pitchMarks span{width:18px!important;height:12px!important;border:1px solid rgba(23,58,145,.7)!important;background:#fffbd4!important;color:var(--alm-blue)!important;font-size:6px!important;line-height:10px!important;text-align:center;}
.paMeta{margin-top:24px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:1px!important;position:relative;z-index:3;}
.paCode{font:bold 17px Arial, sans-serif!important;color:#001d78!important;background:rgba(255,251,208,.92)!important;border:1.5px solid var(--alm-blue)!important;box-shadow:0 1px 0 rgba(255,255,255,.8) inset;min-width:34px!important;padding:1px 2px!important;}
.paAudit{font-size:8px!important;border:0!important;background:transparent!important;padding:0!important;opacity:.45!important;}
.paRun{left:2px!important;bottom:2px!important;background:#ffdada!important;color:#960000!important;border:1.5px solid var(--alm-red)!important;font-weight:900!important;}
.paRbi{right:2px!important;top:23px!important;background:#fff8a8!important;color:var(--alm-blue)!important;border:1px solid var(--alm-blue)!important;font-size:8px!important;}
.paOut{right:2px!important;bottom:2px!important;width:22px!important;height:22px!important;border:2px solid #111!important;border-radius:50%!important;background:#fffdf2!important;color:#111!important;font:bold 13px Arial!important;display:flex!important;align-items:center!important;justify-content:center!important;}
.paNote{left:24px!important;bottom:3px!important;max-width:58px!important;font-size:7px!important;color:#001d78!important;background:rgba(255,251,208,.8)!important;border:0!important;}
.paTags{display:none!important;}
.pa.inningEnd:before{content:"";position:absolute;inset:0;background:linear-gradient(135deg, transparent 48%, rgba(0,0,0,.75) 49%, rgba(0,0,0,.75) 51%, transparent 52%);pointer-events:none;z-index:4;}
.miniDiamond{display:none!important;}
.scoreTotalRow td{background:#e7f3b4!important;color:#001d78!important;font:bold 8px Arial!important;text-align:center!important;}
/* Scoring assistant becomes a compact pencil tray, not the product. */
.panel{width:235px!important;border:3px double #111!important;background:#fff1a1!important;padding:5px!important;font-family:Arial Narrow,Arial,sans-serif!important;}
.panel h2{font:900 13px Georgia,serif!important;background:#d8f4be!important;color:#002477!important;border:1.5px solid var(--alm-blue)!important;margin-bottom:5px!important;}
.controlGroup,.advancedControls,.current,.workflowStage,.coach,.pending,.positionLegend,.paperFlow,.entryDetail{border:1px solid var(--alm-blue)!important;background:#fff8bf!important;border-radius:0!important;margin:5px 0!important;padding:5px!important;font-size:10px!important;}
.panel h3{font-size:9px!important;background:#d8f4be!important;color:#002477!important;border:1px solid var(--alm-blue)!important;margin:4px 0!important;}
.buttons{gap:2px!important;}
.buttons button,.subbox button,.toolbar button,.positionSelector button,.backBtn,.quickNotationStrip button{font-size:9px!important;padding:4px!important;border:1px solid var(--alm-blue)!important;background:#fffbe0!important;color:#001d78!important;font-weight:900!important;}
.buttons button:hover,.quickNotationStrip button:hover,.positionSelector button:hover{background:#ffed82!important;}
.quickNotationStrip{display:grid;grid-template-columns:repeat(5,1fr);gap:2px;margin-top:4px;border-top:1px solid rgba(23,58,145,.55);padding-top:4px;}
.quickNotationStrip button{text-align:center!important;}
.positionLegend{background:#fff4a0!important;}
.legendGrid{grid-template-columns:1fr!important;gap:1px!important;}
.legendGrid div{padding:2px!important;font-size:9px!important;border-color:rgba(23,58,145,.55)!important;}
.legendGrid span{width:16px!important;height:16px!important;background:var(--alm-blue)!important;color:#fff!important;}
.workflowOverlay{position:fixed!important;right:248px!important;top:86px!important;width:390px!important;max-width:390px!important;border:4px double #111!important;background:#fff2a2!important;box-shadow:0 8px 28px rgba(0,0,0,.35)!important;z-index:200!important;}
.workflowOverlay h4{margin:0 0 4px!important;text-align:center;font:bold 16px Georgia,serif;color:var(--alm-blue);border-bottom:2px solid var(--alm-green);}
.workflowPrompt{border:1px solid var(--alm-blue);background:#fff9c8;padding:6px;margin-bottom:6px;color:var(--alm-ink);}
.workflowPrompt b{display:block;font-size:13px;color:var(--alm-green);}
.workflowPrompt span{font-size:11px;}
.workflowPositions{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:4px!important;margin:6px 0!important;}
.workflowPositions button{min-height:48px!important;text-align:center!important;background:#fffbe0!important;}
.workflowPositions button b{display:block;font-size:10px;line-height:1.1;}
.workflowPositions button span{display:inline-flex;align-items:center;justify-content:center;margin-top:3px;width:22px;height:22px;border-radius:50%;background:var(--alm-blue);color:#fff;font-weight:900;font-size:12px;}
.targetPositions button span{border-radius:2px;width:auto;min-width:32px;padding:0 4px;}
@media (max-width:1350px){.appShell{grid-template-columns:1fr!important}.panel{position:relative!important;width:auto!important;max-height:none!important}.almanacSheet{min-width:1180px!important}.scorecardDesk{overflow:auto!important}}
@media print{.panel{display:none!important}.appShell{display:block!important}.almanacSheet{min-width:0!important;width:100%!important;box-shadow:none!important}.scorecardDesk{background:#fff!important}.scorebook tbody tr{height:64px!important}.cell,.pa{height:62px!important;min-height:62px!important}.paCode{font-size:12px!important}.cell:after{width:38px!important;height:38px!important}}

/* =========================================================
   ALMANAC FIDELITY PASS 5 — biggest remaining issues
   - Scorebook must dominate.
   - Workflow buttons must feel like scorekeeper decisions.
   - Runner path diamond must be visible inside the box.
   - Printed card styling gets closer to Baseball Almanac.
   ========================================================= */
.almanacInstructionBand{
  display:grid;
  grid-template-columns:210px 1fr;
  align-items:center;
  border:2px solid var(--alm-blue);
  background:#fff7a2;
  color:var(--alm-ink);
  margin:3px 0;
  font-family:Arial Narrow,Arial,sans-serif;
}
.almanacInstructionBand b{
  background:#c8efb4;
  color:var(--alm-blue);
  border-right:2px solid var(--alm-blue);
  padding:4px 6px;
  font-size:12px;
  letter-spacing:.06em;
  text-align:center;
}
.almanacInstructionBand span{font-size:10px;font-weight:800;padding:4px 7px;}
.appShell{grid-template-columns:minmax(1280px,1fr) 220px!important;}
.panel{width:220px!important;max-width:220px!important;}
.almanacSheet{min-width:1320px!important;max-width:1620px!important;}
.scorebook th.name,.scorebook td.name{width:184px!important;}
.scorebook th.inningHead{width:104px!important;}
.scorebook tbody tr{height:94px!important;}
.scoreCellWrap{height:94px!important;}
.cell{height:94px!important;min-height:94px!important;}
.pa{height:90px!important;min-height:90px!important;}
.cell:after{
  width:60px!important;height:60px!important;
  border:2px solid rgba(23,58,145,.28)!important;
  background:rgba(255,255,255,.08)!important;
}
/* The miniDiamond is the live runner path layer; do not hide it. */
.miniDiamond{
  display:block!important;
  position:absolute!important;
  left:50%!important;top:52%!important;
  width:58px!important;height:58px!important;
  transform:translate(-50%,-50%) rotate(45deg)!important;
  border:1px solid rgba(23,58,145,.25)!important;
  background:transparent!important;
  z-index:1!important;
  pointer-events:none!important;
}
.miniDiamond .seg{
  display:none;
  position:absolute!important;
  background:#0a2490!important;
  opacity:.9!important;
  border-radius:2px!important;
}
.miniDiamond .seg1{left:-1px!important;bottom:-1px!important;width:4px!important;height:30px!important;}
.miniDiamond .seg2{left:-1px!important;top:-1px!important;width:30px!important;height:4px!important;}
.miniDiamond .seg3{right:-1px!important;top:-1px!important;width:4px!important;height:30px!important;}
.miniDiamond .seg4{right:-1px!important;bottom:-1px!important;width:30px!important;height:4px!important;}
.pa.b1 .seg1,.pa.b2 .seg1,.pa.b2 .seg2,.pa.b3 .seg1,.pa.b3 .seg2,.pa.b3 .seg3,.pa.hr .seg1,.pa.hr .seg2,.pa.hr .seg3,.pa.hr .seg4,.pa.scored .seg1,.pa.scored .seg2,.pa.scored .seg3,.pa.scored .seg4{display:block!important;}
.baseMark{
  display:block!important;
  position:absolute!important;
  font:bold 6px Arial!important;
  color:rgba(23,58,145,.65)!important;
  transform:rotate(-45deg)!important;
  background:#fff8b8!important;
  border:1px solid rgba(23,58,145,.28)!important;
  width:11px;height:9px;line-height:8px;text-align:center;
}
.homeMark{left:-7px!important;top:24px!important;}
.firstMark{left:24px!important;top:55px!important;}
.secondMark{left:55px!important;top:24px!important;}
.thirdMark{left:24px!important;top:-7px!important;}
.paMeta{margin-top:30px!important;}
.paCode{font-size:18px!important;min-width:38px!important;}
.pitchMarks{grid-template-columns:repeat(3,20px)!important;}
.pitchMarks span{width:20px!important;height:13px!important;line-height:11px!important;}
.paRbi{top:18px!important;right:2px!important;max-width:38px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.paNote{max-width:72px!important;left:20px!important;right:24px!important;}
.scorebook td.tot,.scorebook th.statHead{font-size:8px!important;}
.controlGroup.scorebookDecisionGroup{
  background:#fff3a0!important;
  border:2px solid var(--alm-blue)!important;
}
.controlGroup.scorebookDecisionGroup h3:before{content:"✎ ";}
.buttons.decisionButtons button:first-child{
  background:#ffeec0!important;
  border:2px solid var(--alm-red)!important;
  color:#7b0000!important;
}
.workflowOverlay{right:232px!important;top:72px!important;width:420px!important;max-width:420px!important;}
.workflowPositions button b{font-size:11px!important;}
.workflowPositions button span{font-size:14px!important;width:26px!important;height:26px!important;}
.targetPositions button{min-height:56px!important;}
.targetPositions button span{font-size:13px!important;min-width:42px!important;}
.scorebook tbody tr.emptyLine td.name:after{
  content:"";display:block;height:1px;background:var(--alm-blue);opacity:.55;margin-top:14px;
}
.bottomScoreAreas .printedBox span{
  min-height:54px;
  background:repeating-linear-gradient(0deg, transparent 0 14px, rgba(23,58,145,.45) 15px, transparent 16px);
}
@media print{
  .almanacInstructionBand,.pageTabNote{display:none!important;}
  .scorebook tbody tr{height:72px!important;}
  .cell,.pa{height:70px!important;min-height:70px!important;}
  .miniDiamond{width:44px!important;height:44px!important;}
}

/* User-flow pass: make scoring operate like an organized event selector, not scattered text entry. */
.eventSelectorIntro{border:2px solid #0d3480;background:#fff8c7;color:#081b4b;padding:6px;margin:6px 0 8px;font-size:11px;line-height:1.35;box-shadow:inset 0 0 0 1px rgba(13,52,128,.15)}
.eventSelectorIntro b{display:block;text-transform:uppercase;letter-spacing:.05em;margin-bottom:2px}.eventSelectorIntro span{display:block}
.primarySelector{border-width:2px!important;border-color:#0d3480!important;background:#fff6bd!important}.primarySelector h3{background:#0d3480!important;color:#fff!important;border-color:#0d3480!important;letter-spacing:.04em}.runnerQuickGroup{background:#fffbe6!important}
.pendingChecklist{display:grid;gap:6px}.runnerCard{border:2px solid #233d86!important;background:#fffef0!important;padding:6px!important;border-radius:3px!important}.runnerCard.unresolved{border-color:#b00000!important;background:#fff0e8!important}.runnerCard.resolved{border-color:#27732c!important;background:#efffe8!important}.runnerCard b{display:block;margin-bottom:3px}.runnerCard span{display:block;font-size:10px;margin-bottom:5px}.runnerCardActions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}.runnerCardActions button,.pendingQuickActions button{border:1px solid #0d3480;background:#fffbe0;color:#001d78;font-size:9px;font-weight:900;padding:4px 3px;cursor:pointer;text-align:left}.runnerCardActions button:hover,.pendingQuickActions button:hover{background:#ffed82}.pendingQuickActions{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-top:6px}.pendingQuickActions button:last-child{background:#0d3480;color:#fff;text-align:center}.compactScorer .advancedControls:not([open]){opacity:.9}.compactScorer .controlGroup h3{display:flex;align-items:center;gap:4px}.scorebookDecisionGroup .decisionButtons button{min-height:32px}.quickNotationStrip{display:grid;grid-template-columns:repeat(5,1fr);gap:2px;margin-top:5px}.quickNotationStrip button{text-align:center!important}


/* Pass: mandatory runner-resolution workflow */
.eventCategoryGrid{display:grid;gap:8px;margin-top:8px}
.eventCategory{border:1px solid rgba(40,93,90,.35);background:rgba(255,255,238,.65);padding:7px;border-radius:6px}
.eventCategory>b{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#1f5b58;margin-bottom:5px}
.pendingProgress{font-size:12px;background:#fffbe2;border:1px solid #b9a85d;padding:5px 7px;margin:5px 0;color:#584200}
.runnerCard{border-left-width:6px!important}
.runnerCard.unresolved{background:#fff6dc!important;border-color:#9b6d12!important}
.runnerCard.resolved{background:#eef7e9!important;border-color:#497d37!important}
.runnerCardActions{display:grid;gap:6px;margin-top:7px}
.runnerActionSet{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.runnerActionSet button{font-size:11px;line-height:1.15;padding:6px 5px;border:1px solid #316b67;background:#f8f6d2;color:#113c3a;border-radius:4px;cursor:pointer}
.runnerActionSet button:hover{background:#e7f1d0}
.runnerActionMore summary{font-size:11px;font-weight:800;color:#285d5a;cursor:pointer;margin-top:2px}
.pendingInstruction{font-size:12px;line-height:1.35;background:#f8f6d2;border:1px dashed #9ab1a4;padding:6px;margin-top:7px}
button:disabled{opacity:.45;cursor:not-allowed!important}
@media (max-width:900px){.runnerActionSet{grid-template-columns:1fr}.eventCategoryGrid{grid-template-columns:1fr}}

/* Guided special-play workflow polish */
.guidedSpecialGroup{
  border:2px solid var(--line-blue);
  background:linear-gradient(180deg, rgba(255,252,221,.96), rgba(246,238,181,.96));
}
.workflowChoices{
  display:grid;
  grid-template-columns:1fr;
  gap:6px;
  margin-top:8px;
}
.workflowChoices button,
.runnerSpecialPositions button{
  border:1px solid var(--line-blue);
  background:#fff8bf;
  color:#14345a;
  border-radius:4px;
  padding:8px 9px;
  text-align:left;
  font-weight:800;
  cursor:pointer;
}
.workflowChoices button:hover,
.runnerSpecialPositions button:hover{
  background:#eaf5d0;
}
.runnerSpecialPositions button:disabled{
  opacity:.45;
  cursor:not-allowed;
  background:#efe7aa;
}

.secondaryConfirm{margin-top:6px;background:#345f72!important;}
#smokeList{margin-top:8px;}


/* Production pass: keep scorer on guided event-selector workflow; direct notation is fallback, not the main UI. */
.quickNotationStrip{display:none!important;}
.advancedControls:not([open]){background:#f7edb8!important;border-style:dashed!important;opacity:.72!important;}
.advancedControls:not([open]) summary{font-size:9px!important;color:#28416f!important;}
.advancedControls[open]{box-shadow:inset 0 0 0 2px rgba(14,54,128,.18);}
.runnerQuickGroup{border-style:dashed!important;}
.runnerQuickGroup h3::after{content:'  (disabled during pending plays)';font-weight:400;font-size:9px;color:#684;}
.eventCategoryGrid{gap:6px!important;}
.guidedSpecialGroup{box-shadow:inset 0 0 0 2px rgba(0,70,150,.12);}

/* Production Hardening Pass — final mobile live-game and print scorebook cleanup */
.secondaryConfirm{margin-top:4px;background:#264b8f!important;color:#fff!important;border-color:#0e2a5f!important;}
.eventSelectorIntro{border:2px solid var(--alm-blue,#1f3b88);background:#fff6b8;padding:6px;margin-bottom:6px;font-size:10px;line-height:1.25;}
.eventSelectorIntro b{display:block;text-align:center;text-transform:uppercase;color:#082d75;letter-spacing:.04em;}
.toolbar.setup{grid-template-columns:repeat(2,minmax(0,1fr));}
.toolbar.setup button{font-size:9px;text-align:center;padding:5px 3px;}
body.mobileScoringFocus .scorecardDesk{max-height:38vh;overflow:auto;border-bottom:4px solid #0e3480;}
body.mobileScoringFocus .panel{position:sticky!important;bottom:0!important;top:auto!important;max-height:62vh!important;border-top-width:5px!important;z-index:80;}
body.mobileScoringFocus .printedInfoGrid,
body.mobileScoringFocus .almanacUpperStats,
body.mobileScoringFocus .printedLedgerStrip,
body.mobileScoringFocus .bottomScoreAreas{display:none!important;}
body.mobileScoringFocus .almanacSheet{padding:6px!important;}
body.mobileScoringFocus .scorebook tbody tr{height:56px!important;}
body.mobileScoringFocus .cell,body.mobileScoringFocus .pa{height:54px!important;min-height:54px!important;}
body.mobileScoringFocus .controlGroup h3{font-size:10px!important;}
body.mobileScoringFocus .buttons button,
body.mobileScoringFocus .runnerCardActions button{min-height:34px;font-size:10px!important;}

@media (max-width:900px){
  body{overflow-x:hidden;}
  .appShell{display:flex!important;flex-direction:column!important;padding:4px!important;gap:6px!important;}
  .panel{order:1!important;position:relative!important;top:auto!important;max-height:none!important;border-width:3px!important;}
  .scorecardDesk{order:2!important;width:100%!important;overflow:auto!important;padding:4px!important;}
  .almanacSheet{min-width:980px!important;padding:6px!important;}
  .liveScoreStrip{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .statusBlock.wide{grid-column:auto!important;}
  .toolbar.setup{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .eventCategoryGrid{grid-template-columns:1fr!important;}
  .runnerCardActions{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .workflowOverlay{inset:8px!important;max-width:none!important;overflow:auto;}
}

@media print{
  @page{size:landscape;margin:.25in;}
  html,body{background:#fff!important;color:#000!important;}
  .panel,.scorecardPageTabs,.toolbar,.workflowOverlay,.eventSelectorIntro{display:none!important;}
  .scorecardDesk{display:block!important;overflow:visible!important;background:#fff!important;padding:0!important;}
  .almanacSheet{width:100%!important;max-width:none!important;min-width:0!important;border:2px solid #000!important;box-shadow:none!important;background:#fffbc6!important;padding:5px!important;}
  .sheetTop,.printedInfoGrid,.liveScoreStrip,.almanacUpperStats,.printedLedgerStrip,.bottomScoreAreas{page-break-inside:avoid!important;}
  .teamScoreSection{display:block!important;page-break-inside:avoid!important;}
  body[data-scorecard-view="away"] .homePage,
  body[data-scorecard-view="home"] .visitorPage{display:none!important;}
  .scorebook{width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;}
  .scorebook th,.scorebook td{border:1px solid #000!important;color:#000!important;}
  .scorebook tbody tr{height:58px!important;}
  .cell,.pa{height:56px!important;min-height:56px!important;background:#fffde0!important;}
  .paCode{font-size:11px!important;color:#000!important;}
  .cell:after{opacity:.55!important;border-color:#000!important;}
}


/* Production Hardening Pass 2: CSS consolidation and less app-like live-game controls. */
:root{
  --scorebook-paper:#fff3ad;
  --scorebook-paper-soft:#fff9d7;
  --scorebook-blue:#133f93;
  --scorebook-green:#1f6f4a;
  --scorebook-ink:#101010;
  --scorebook-line:rgba(19,63,147,.86);
}
body.advancedCollapsed .advancedControls:not([open]){display:block;opacity:.58;}
body.advancedCollapsed .advancedControls:not([open]) > :not(summary){display:none!important;}
body.advancedCollapsed .advancedControls:not([open]) summary::after{content:' — collapsed for live scoring';font-weight:700;color:#654b00;}
#collapseAdvanced{background:#fff4b3!important;border-color:#133f93!important;color:#08245b!important;font-weight:900!important;}
.eventCategoryGrid{gap:6px!important;}
.eventCategory{border:1.5px solid var(--scorebook-blue)!important;background:#fffbe5!important;padding:5px!important;}
.eventCategory b{display:block;background:#d9efca;border:1px solid var(--scorebook-green);padding:2px 4px;margin-bottom:4px;text-transform:uppercase;font-size:10px;}
.eventCategory .buttons button{min-height:30px;}
.compactScorer{scrollbar-width:thin;}
.workflowOverlay .workflowPrompt b{font-size:13px;color:#08245b;}
.workflowOverlay .workflowPrompt span{display:block;font-size:11px;margin-top:3px;}
.pending .runnerCardActions button{min-height:28px;}
.scorebook .paEntry{min-height:74px!important;}
.scorebook .paEntry .notation{font-size:14px!important;letter-spacing:.4px;}
.scorebook .paEntry .diamondGuide{opacity:.82;}
.scorebook .paEntry .pitchStrip{font-size:7px!important;letter-spacing:.3px;}
.scorebook .paEntry .outBubble{font-weight:900;}
@media print{
  .compactScorer,.scorecardPageTabs,.toolbar,.workflowOverlay{display:none!important;}
  .appShell{display:block!important;}
  .scorecardDesk{width:100%!important;}
  .almanacSheet{box-shadow:none!important;border:2px solid #000!important;margin:0!important;width:100%!important;max-width:none!important;}
  .teamScoreSection{page-break-inside:avoid;}
  body{background:#fff!important;}
}

/* Full-game certification production pass */
#fullGameList { margin-top: 8px; border-top: 1px dashed rgba(32,76,96,.35); padding-top: 8px; }


/* =====================================================================
   EMERGENCY PRODUCTION LAYOUT RESET — SCOREBOOK FIRST, NO BROKEN DESKTOP
   Added after review of live 100% browser screenshots.
   Goals: no horizontal page scrolling, scorebook always visible, pencil docked,
   compact controls, readable scorecard, actual scorebook workspace feel.
   ===================================================================== */
html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden!important;
  margin:0!important;
  background:#c8bf8f!important;
}
body{
  font-size:13px!important;
  line-height:1.15!important;
}
.appShell{
  display:grid!important;
  grid-template-columns:minmax(0, 1fr) 300px!important;
  gap:8px!important;
  width:100vw!important;
  max-width:100vw!important;
  min-height:100vh!important;
  padding:6px!important;
  box-sizing:border-box!important;
  align-items:start!important;
  background:#c8bf8f!important;
}
.scorecardDesk{
  order:1!important;
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  overflow:auto!important;
  padding:4px!important;
  box-sizing:border-box!important;
  background:#c8bf8f!important;
  border:0!important;
  max-height:calc(100vh - 12px)!important;
}
.almanacSheet{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  box-sizing:border-box!important;
  padding:7px!important;
  border:3px solid #001b63!important;
  background:#fff7a8!important;
  box-shadow:0 2px 8px rgba(0,0,0,.32)!important;
}
.panel,
.compactScorer{
  order:2!important;
  position:sticky!important;
  top:6px!important;
  right:auto!important;
  width:300px!important;
  max-width:300px!important;
  min-width:300px!important;
  max-height:calc(100vh - 12px)!important;
  overflow:auto!important;
  box-sizing:border-box!important;
  background:#fff7b5!important;
  border:3px solid #001b63!important;
  padding:7px!important;
  box-shadow:0 2px 8px rgba(0,0,0,.25)!important;
  font-size:12px!important;
}
.panel h2{
  margin:0 0 6px!important;
  padding:6px!important;
  text-align:center!important;
  font-size:18px!important;
  line-height:1!important;
  color:#001b63!important;
  background:#dfffd0!important;
  border:2px solid #0050a8!important;
  text-transform:uppercase!important;
}
.eventSelectorIntro,
.coach,
.paperFlow,
.workflowStage{
  margin:5px 0!important;
  padding:5px!important;
  border:1px solid #0050a8!important;
  background:#fffbd0!important;
  font-size:11px!important;
}
.eventSelectorIntro span{display:none!important;}
.paperFlow{display:none!important;}
.coach b{display:block!important;margin-bottom:2px!important;}
.coach span{font-size:11px!important;}
.toolbar.setup{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:4px!important;
  margin:5px 0!important;
}
.toolbar.setup button,
.panel button{
  min-height:28px!important;
  padding:4px 5px!important;
  font-size:11px!important;
  line-height:1.05!important;
  border:1px solid #003e91!important;
  background:#fffbd4!important;
  color:#001b63!important;
  font-weight:700!important;
  border-radius:2px!important;
  cursor:pointer!important;
}
.panel button:hover,
.panel button:focus{background:#dfffd0!important;outline:2px solid #001b63!important;}
.current{
  margin:5px 0!important;
  padding:5px!important;
  border:2px solid #0050a8!important;
  background:#f6ffd9!important;
  font-weight:700!important;
  font-size:11px!important;
}
.positionLegend{
  padding:5px!important;
  margin:5px 0!important;
  border:2px solid #0050a8!important;
  background:#f1ffd4!important;
}
.legendGrid{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:2px 6px!important;
  font-size:10.5px!important;
}
.legendGrid span{
  display:inline-block!important;
  min-width:16px!important;
  text-align:center!important;
  color:#fff!important;
  background:#001b63!important;
  border-radius:2px!important;
  margin-right:3px!important;
}
.controlGroup,
.primarySelector,
.guidedSpecialGroup,
.runnerQuickGroup,
details.advancedControls{
  margin:6px 0!important;
  padding:5px!important;
  border:2px solid #0050a8!important;
  background:#fffbd0!important;
}
.controlGroup h3{
  margin:0 0 5px!important;
  padding:3px 4px!important;
  font-size:12px!important;
  text-transform:uppercase!important;
  background:#dfffd0!important;
  border:1px solid #0050a8!important;
  color:#001b63!important;
}
.eventCategoryGrid{
  display:block!important;
}
.eventCategory{
  margin:4px 0!important;
  padding:4px!important;
  border:1px solid #8a7b35!important;
  background:#fff8bd!important;
}
.eventCategory b{
  display:block!important;
  margin-bottom:3px!important;
  color:#001b63!important;
  text-transform:uppercase!important;
  font-size:11px!important;
}
.buttons,
.buttons.three,
.buttons.decisionButtons{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:4px!important;
}
.pitchGroup .buttons{grid-template-columns:1fr 1fr 1fr!important;}
.quickNotationStrip{
  display:none!important;
}
details.advancedControls:not([open]){padding:3px 5px!important;background:#f5eeb2!important;}
details.advancedControls summary{
  font-size:11px!important;
  color:#001b63!important;
  cursor:pointer!important;
}
#entryDetail.entryDetail{
  max-height:160px!important;
  overflow:auto!important;
  font-size:11px!important;
  margin:5px 0!important;
  border:2px solid #0050a8!important;
  background:#fffbd0!important;
}
#pendingBox.pending{
  max-height:260px!important;
  overflow:auto!important;
  margin:5px 0!important;
  border:2px solid #0050a8!important;
  background:#f6ffd9!important;
}
#confirmPlay.confirm{
  width:100%!important;
  min-height:36px!important;
  background:#001b63!important;
  color:#fff!important;
  font-size:13px!important;
  text-transform:uppercase!important;
  margin:5px 0!important;
}
/* Scorecard density and fit */
.sheetTop{
  display:grid!important;
  grid-template-columns:90px 1fr 210px!important;
  gap:4px!important;
  align-items:stretch!important;
}
.scorebookTitle strong{font-size:18px!important;}
.printedInfoGrid,
.topStatBlocks,
.lineScoreArea{
  gap:3px!important;
}
.teamTabs{margin:5px 0!important;}
.teamScoreSection{margin-top:4px!important;}
.teamHeaderLine{
  padding:3px 5px!important;
  font-size:11px!important;
}
table.scorebook,
.scorebook{
  width:100%!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
  font-size:10px!important;
}
.scorebook th,
.scorebook td{
  border:1.5px solid #0050a8!important;
  box-sizing:border-box!important;
}
.scorebook th{padding:2px!important;background:#dfffd0!important;color:#001b63!important;}
.scorebook tbody tr{height:58px!important;}
.scorebook .playerCell,
.scorebook .player,
.scorebook td.player{
  width:120px!important;
  min-width:120px!important;
  max-width:120px!important;
  font-size:10px!important;
}
.scorebook td.cell,
.scorebook .cell{
  height:58px!important;
  min-height:58px!important;
  padding:0!important;
  position:relative!important;
  background:#fff7b5!important;
  overflow:hidden!important;
}
.pa{
  height:56px!important;
  min-height:56px!important;
  position:relative!important;
  padding:0!important;
  overflow:hidden!important;
}
.cell:after,
.pa:after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:33px!important;
  height:33px!important;
  border:1.5px solid rgba(0,80,168,.38)!important;
  transform:translate(-50%,-42%) rotate(45deg)!important;
  pointer-events:none!important;
  background:transparent!important;
}
.paCode{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  z-index:4!important;
  color:#001b63!important;
  font-size:13px!important;
  line-height:1!important;
  font-weight:900!important;
  text-align:center!important;
  text-shadow:0 1px 0 #fff9b8!important;
}
.pitchMarks,
.pitchStrip{
  position:absolute!important;
  top:1px!important;
  left:1px!important;
  right:1px!important;
  height:10px!important;
  display:flex!important;
  gap:1px!important;
  z-index:3!important;
  pointer-events:none!important;
}
.pitchMarks span,
.pitchStrip span{
  display:block!important;
  width:8px!important;
  height:8px!important;
  border:1px solid #0050a8!important;
  background:#fffbd0!important;
}
.outCircle{
  position:absolute!important;
  right:2px!important;
  bottom:2px!important;
  width:18px!important;
  height:18px!important;
  border:2px solid #001b63!important;
  border-radius:50%!important;
  background:#fffbd0!important;
  color:#001b63!important;
  z-index:5!important;
  font-size:11px!important;
  font-weight:900!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.runMark,.rbiMark,.lobMark{
  position:absolute!important;
  z-index:6!important;
  font-size:9px!important;
  font-weight:900!important;
  color:#001b63!important;
  background:#dfffd0!important;
  border:1px solid #0050a8!important;
  padding:1px 2px!important;
}
.runMark{left:2px!important;bottom:2px!important;}
.rbiMark{right:2px!important;top:13px!important;}
.lobMark{left:2px!important;top:13px!important;}
.bottomScoreAreas{
  display:grid!important;
  grid-template-columns:1fr 1fr 1fr!important;
  gap:4px!important;
  margin-top:5px!important;
}
.printedBox{min-height:48px!important;padding:4px!important;font-size:10px!important;}
/* Desktop should NEVER collapse to panel-first at normal browser widths */
@media (min-width:901px){
  .appShell{display:grid!important;grid-template-columns:minmax(0,1fr) 300px!important;}
  .panel{order:2!important;position:sticky!important;}
  .scorecardDesk{order:1!important;}
  .almanacSheet{min-width:0!important;width:100%!important;}
}
/* True mobile: controls first, compact scorebook below */
@media (max-width:900px){
  .appShell{display:flex!important;flex-direction:column!important;padding:4px!important;gap:6px!important;overflow-x:hidden!important;}
  .panel{order:1!important;width:100%!important;max-width:none!important;min-width:0!important;position:relative!important;max-height:none!important;}
  .scorecardDesk{order:2!important;max-height:none!important;width:100%!important;overflow:auto!important;}
  .almanacSheet{min-width:760px!important;width:760px!important;max-width:none!important;}
  .buttons,.buttons.decisionButtons{grid-template-columns:1fr 1fr!important;}
}
@media (max-width:520px){
  .buttons,.buttons.decisionButtons,.toolbar.setup{grid-template-columns:1fr!important;}
}

/* SELF-EXPLANATORY SCOREBOOK PASS
   Goal: scorebook visible first, controls read as layman + official notation,
   no generic explanation clutter, stable desktop dimensions. */
html,body{height:100%!important;margin:0!important;}
body{overflow:hidden!important;background:#c7bd8c!important;}
.appShell{
  height:100vh!important;
  width:100vw!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 320px!important;
  gap:6px!important;
  padding:6px!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
.scorecardDesk{
  min-width:0!important;
  height:calc(100vh - 12px)!important;
  overflow:auto!important;
  padding:5px!important;
  box-sizing:border-box!important;
  background:#c7bd8c!important;
}
.compactScorer,.panel{
  width:320px!important;
  max-width:320px!important;
  min-width:0!important;
  height:calc(100vh - 12px)!important;
  max-height:calc(100vh - 12px)!important;
  overflow:auto!important;
  box-sizing:border-box!important;
  position:sticky!important;
  top:6px!important;
}
.almanacSheet{
  width:min(100%, 1220px)!important;
  min-width:1040px!important;
  margin:0 auto!important;
  transform:none!important;
}
.eventSelectorIntro.compactInstruction{display:block!important;border:2px solid #0b3997!important;background:#fff9b0!important;color:#001f74!important;text-align:center!important;font-size:11px!important;line-height:1.25!important;}
.workflowStage,.coach,.paperFlow{display:none!important;}
.current{font-size:11px!important;background:#fffbe0!important;border:2px solid #0b3997!important;}
.positionLegend{margin:5px 0!important;padding:5px!important;}
.positionLegend b{font-size:10px!important;color:#002477!important;text-transform:uppercase!important;}
.legendGrid{grid-template-columns:1fr!important;gap:2px!important;}
.legendGrid div{font-size:10px!important;padding:2px 3px!important;display:flex!important;align-items:center!important;}
.legendGrid span{width:16px!important;height:16px!important;font-size:10px!important;flex:0 0 auto!important;}
.controlGroup,.advancedControls,.pending,.entryDetail{margin:5px 0!important;padding:5px!important;border:2px solid #0b3997!important;background:#fff7bc!important;border-radius:0!important;}
.controlGroup h3{font-size:10px!important;letter-spacing:.04em!important;background:#cfecc0!important;color:#002477!important;border:1px solid #0b3997!important;padding:3px 4px!important;margin:0 0 4px!important;}
.buttons{gap:3px!important;}
.buttons.three{grid-template-columns:repeat(3,1fr)!important;}
.buttons button,.toolbar button,.positionSelector button,.backBtn,.runnerCardActions button,.pendingQuickActions button{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:1px!important;
  min-height:30px!important;
  padding:4px 5px!important;
  background:#fffde5!important;
  border:1.5px solid #0b3997!important;
  color:#001f74!important;
  text-align:left!important;
  font-family:Arial,Helvetica,sans-serif!important;
  cursor:pointer!important;
}
.btnMain{display:block!important;font-size:10.5px!important;font-weight:900!important;line-height:1.05!important;color:#001b63!important;}
.btnSub{display:block!important;font-size:9px!important;font-weight:700!important;line-height:1.05!important;color:#3a2d00!important;}
.buttons button:hover,.toolbar button:hover,.positionSelector button:hover,.runnerCardActions button:hover{background:#ffe977!important;}
.toolbar{grid-template-columns:1fr 1fr!important;gap:3px!important;}
.toolbar button{min-height:26px!important;text-align:center!important;align-items:center!important;font-size:10px!important;font-weight:900!important;}
.quickNotationStrip{display:none!important;}
.advancedControls{opacity:1!important;}
.advancedControls:not([open]){padding:4px!important;}
.advancedControls summary{font-size:10px!important;color:#002477!important;}
.runnerQuickGroup{display:block!important;}
.pendingChecklist{gap:4px!important;}
.runnerCard{padding:5px!important;border-radius:0!important;}
.runnerCardActions{grid-template-columns:1fr 1fr!important;gap:3px!important;}
.confirm{min-height:34px!important;background:#002477!important;color:#fff!important;border:2px solid #00133d!important;font-size:12px!important;letter-spacing:.04em!important;}
.cell,.pa{font-size:10px!important;}
.cell:after,.pa:after{opacity:.55!important;}
@media (max-width:900px){
  body{overflow:auto!important;}
  .appShell{display:flex!important;flex-direction:column!important;height:auto!important;min-height:100vh!important;overflow:visible!important;}
  .compactScorer,.panel{width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;position:relative!important;top:auto!important;order:1!important;}
  .scorecardDesk{height:auto!important;max-height:none!important;order:2!important;overflow:auto!important;}
  .almanacSheet{min-width:980px!important;}
}
