:root{--ink:#0b1b33;--muted:#52627a;--line:#d7e2ee;--bg:#f4f7fb;--card:#fff;--accent:#0f766e;--nav:#123f66;--warn:#f59e0b;--danger:#b91c1c}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink);line-height:1.45}header{background:linear-gradient(135deg,#0f766e,#123f66);color:#fff;padding:18px 22px;display:flex;justify-content:space-between;gap:16px;align-items:center}h1{margin:0;font-size:26px}h2{margin:0 0 14px}h3{margin:0 0 5px}.brand{display:flex;gap:14px;align-items:center}.logo{width:66px;height:66px;border-radius:14px;background:#fff;display:grid;place-items:center;overflow:hidden;box-shadow:0 8px 22px rgba(0,0,0,.18)}.logo img{width:100%;height:100%;object-fit:contain}.badge{display:inline-block;margin-top:6px;padding:4px 8px;border-radius:999px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.15);font-weight:800;font-size:12px}nav{position:sticky;top:0;z-index:10;background:#fff;border-bottom:1px solid var(--line);padding:10px 14px;display:flex;gap:8px;flex-wrap:wrap}button,.btn{border:0;border-radius:10px;background:var(--nav);color:#fff;padding:9px 12px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-flex;gap:6px;align-items:center}button.ghost,.btn.ghost{background:#e8eef6;color:#10213d}button.light{background:#e7f6f4;color:#0f766e}button.danger{background:#fee2e2;color:#991b1b}.small-btn{font-size:12px;padding:6px 9px}main{max-width:1280px;margin:0 auto;padding:18px}.view.hidden{display:none}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}.card,.rule-card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;margin-bottom:14px;box-shadow:0 6px 20px rgba(15,35,70,.045)}.tile{cursor:pointer}.tile:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(15,35,70,.10)}.muted{color:var(--muted)}.status{margin:8px 0;padding:10px 12px;border-radius:10px;background:#ecfdf5;color:#065f46;font-weight:800}.warn{background:#fff7ed;color:#9a3412}.toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px;font:inherit;background:#fff;color:var(--ink)}textarea{min-height:110px}label{display:block;margin:8px 0 4px;font-weight:900}.two{display:grid;grid-template-columns:1fr 1fr;gap:14px}.three{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}.admin-layout{display:grid;grid-template-columns:260px 1fr;gap:14px}.side{position:sticky;top:70px;align-self:start}.side button{width:100%;justify-content:flex-start;margin-bottom:7px}.list{border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:8px;max-height:560px;overflow:auto}.list-item{background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px;margin:5px 0;cursor:pointer}.list-item.active{background:#dff7f3;border-color:#0f766e}.rule-card{border-left:5px solid var(--accent)}.rule-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.rule-head h3{color:var(--accent)}.rule-meta{font-size:12px;color:var(--muted);margin-bottom:8px}.clause{margin:6px 0;padding:8px 10px;border-left:3px solid #cbd5e1;background:#fbfdff;border-radius:8px}.clause-label{font-weight:950;color:#0f766e;margin-right:6px}.ref-link{border:1px solid #cfe0f1;background:#eef6ff;color:#123f66;border-radius:999px;padding:1px 6px;font-weight:900;cursor:pointer}.ref-panel{position:fixed;right:18px;top:88px;width:min(560px,calc(100vw - 36px));max-height:calc(100vh - 110px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 18px 55px rgba(15,23,42,.25);z-index:60;padding:16px}table{border-collapse:collapse;width:100%;margin:10px 0;background:#fff}td,th{border:1px solid var(--line);padding:7px 8px;text-align:left;vertical-align:top}th{background:#eaf1f8}.table-wrap{overflow:auto}.doc-cover{display:flex;gap:14px;align-items:center;background:linear-gradient(135deg,#fff,#f5fbff);border:1px solid var(--line);border-radius:18px;padding:16px 18px;margin-bottom:14px}.logo-mini{width:56px;height:56px;border-radius:12px;background:#fff url('../assets/hills-logo.jpg') center/contain no-repeat;border:1px solid var(--line)}.print-title{font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:950;color:var(--accent)}.checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:7px;max-height:560px;overflow:auto;border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:10px}.checks label{background:#fff;border:1px solid var(--line);border-radius:10px;padding:7px;margin:0;font-weight:500;display:flex;gap:8px;align-items:flex-start}.checks input{width:auto;margin-top:3px}.figure-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}.figure-card img,.figure-img{max-width:100%;height:auto;border:1px solid var(--line);border-radius:12px;background:#fff}.pill{display:inline-block;background:#e8eef6;border-radius:999px;padding:2px 7px;font-size:12px;font-weight:900;margin:2px}.footer-note{text-align:center;color:var(--muted);font-size:12px;margin:20px 0}.no-print{}@media(max-width:850px){.two,.three,.admin-layout{grid-template-columns:1fr}.side{position:static}header{display:block}.toolbar{margin-top:10px}}@media print{@page{margin:10mm 9mm;size:A4}header,nav,.no-print,.ref-panel{display:none!important}body{background:#fff;font-size:10.5pt;line-height:1.22}main{max-width:none;padding:0}.card,.rule-card{box-shadow:none;border:0;border-radius:0;padding:5px 7px;margin:0 0 5px;break-inside:auto}.rule-card{border-left:3px solid var(--accent)}.doc-cover{border:0;border-bottom:1px solid #bbb;border-radius:0;padding:5px 0 7px;margin:0 0 7px}.logo-mini{width:34px;height:34px}.doc-cover h2{font-size:16pt;margin:0}p{margin:2px 0 4px}.clause{margin:2px 0;padding:3px 5px;border-radius:0}table{font-size:8.5pt;margin:3px 0 5px}td,th{padding:2px 4px}}
/* Portable Core v2 refinements */
.print-actions{display:flex;gap:8px;justify-content:flex-end;margin:-6px 0 10px}.conference-preview{border:1px dashed var(--line);border-radius:14px;padding:10px;background:#fff;margin-top:14px}.rule-search{position:sticky;top:0;background:#f8fafc;padding:8px 0;z-index:2}.checks .hidden-by-search{display:none!important}.checks label.rule-item{font-weight:900;border-left:4px solid var(--accent);background:#f8fffd}.checks label.rule-item span::before{content:"Whole rule";display:inline-block;margin-right:8px;padding:2px 7px;border-radius:999px;background:#dff7f3;color:#0f766e;font-size:11px;font-weight:950;vertical-align:middle}.checks label.clause-item{margin-left:18px;font-size:13px}.checks label.table-item{margin-left:18px;background:#f0f9ff}.checks input[type="checkbox"]{width:18px;height:18px;min-width:18px;accent-color:var(--accent);cursor:pointer}.sync-banner{display:none}
@media print{.status,.sync-banner,.print-actions,.footer-note{display:none!important}.doc-cover{break-after:avoid}.rule-card{break-inside:auto}.conference-head table{font-size:8.5pt}.conference-head th{width:28%}.table-wrap{break-inside:avoid}h2,h3{break-after:avoid}.clause{break-inside:auto}}
/* Portable Core v3 requested fixes */
.logo-mini-img{width:56px;height:56px;border-radius:12px;object-fit:contain;background:#fff;border:1px solid var(--line);display:block}
.quick-editor th{width:28%}.quick-editor td:first-child{width:52px;text-align:center}.quick-editor input[type="checkbox"]{width:auto}.custom-quick{margin-top:6px}
@media print{.logo-mini-img{width:34px;height:34px;print-color-adjust:exact;-webkit-print-color-adjust:exact}.conference-preview>h3{display:none!important}.conference-preview{border:0!important;padding:0!important;margin:0!important}.card:has(.conference-preview){padding:0!important;border:0!important}}


/* Portable Core v4 responsive layout refinements */
body.admin-page main{max-width:1760px;padding:20px 26px}
body.public-page main{max-width:1320px}
body.admin-page header{padding:14px 24px}
body.admin-page h1{font-size:24px}
body.admin-page header p{margin:4px 0 0}
body.admin-page nav{gap:10px;padding:10px 18px}
body.admin-page .admin-layout{grid-template-columns:240px minmax(0,1fr);gap:18px}
body.admin-page .card{padding:18px}
body.admin-page .side{top:76px}
body.admin-page .side button{padding:10px 12px;margin-bottom:8px}
body.admin-page .two{grid-template-columns:minmax(360px,.9fr) minmax(520px,1.35fr);gap:18px;align-items:start}
body.admin-page .three{grid-template-columns:repeat(3,minmax(220px,1fr));gap:16px}
body.admin-page .list{max-height:calc(100vh - 315px);min-height:420px}
body.admin-page textarea{min-height:120px}
body.admin-page input,body.admin-page select,body.admin-page textarea{padding:11px 12px}
body.admin-page .checks{grid-template-columns:repeat(auto-fit,minmax(340px,1fr));max-height:calc(100vh - 390px);min-height:420px}
body.admin-page .conference-preview{max-height:calc(100vh - 300px);overflow:auto}
body.admin-page .quick-editor td,body.admin-page .quick-editor th{padding:8px}
body.admin-page .quick-editor input,body.admin-page .quick-editor select{padding:8px 10px}

/* Public: desktop/tablet/phone-friendly viewing */
body.public-page nav{overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
body.public-page nav button{white-space:nowrap;flex:0 0 auto}
body.public-page .rule-card,body.public-page .card{overflow:hidden}
body.public-page .table-wrap,body.public-page .card table{max-width:100%}
body.public-page .conference-head{overflow-x:auto}
body.public-page .doc-cover{align-items:flex-start}

@media (min-width:1500px){
  body.admin-page main{max-width:1840px}
  body.admin-page .admin-layout{grid-template-columns:260px minmax(0,1fr)}
  body.admin-page .two{grid-template-columns:minmax(430px,.85fr) minmax(680px,1.45fr)}
  body.admin-page .checks{grid-template-columns:repeat(auto-fit,minmax(380px,1fr))}
}
@media (max-width:1100px){
  body.admin-page main{padding:14px}
  body.admin-page .admin-layout{grid-template-columns:1fr}
  body.admin-page .side{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body.admin-page .side button,body.admin-page .side label{margin:0}
  body.admin-page .side hr{display:none}
  body.admin-page .two,body.admin-page .three{grid-template-columns:1fr}
  body.admin-page .list,body.admin-page .checks,body.admin-page .conference-preview{max-height:none;min-height:0}
}
@media (max-width:760px){
  body.public-page header,body.admin-page header{padding:12px 14px;gap:10px}
  header .brand{align-items:flex-start}
  .logo{width:48px;height:48px;border-radius:10px;flex:0 0 auto}
  h1{font-size:21px;line-height:1.1}
  header p{font-size:13px;margin:5px 0}
  .badge{font-size:11px}
  header .toolbar{width:100%;margin-top:10px}
  header .toolbar .btn,header .toolbar button{flex:1;justify-content:center;font-size:12px;padding:8px}
  nav{padding:8px 10px;gap:6px}
  nav button{font-size:13px;padding:8px 10px;border-radius:9px}
  main{padding:10px}
  .card,.rule-card{border-radius:12px;padding:12px;margin-bottom:10px}
  .doc-cover{padding:12px;gap:10px;border-radius:12px}
  .logo-mini-img,.logo-mini{width:42px;height:42px}
  .rule-head{display:block}
  .rule-head .toolbar{margin-top:8px}
  .ref-panel{right:8px;top:72px;width:calc(100vw - 16px);max-height:calc(100vh - 84px);border-radius:14px}
  table{font-size:13px;display:block;overflow-x:auto;white-space:nowrap}
  td,th{padding:5px 6px}
  .grid{grid-template-columns:1fr}
  .figure-grid{grid-template-columns:1fr}
  body.admin-page .side{grid-template-columns:1fr}
  body.admin-page .card{padding:12px}
  body.admin-page .quick-editor input,body.admin-page .quick-editor select{min-width:180px}
}
@media (max-width:430px){
  body.public-page header .brand{gap:9px}
  .logo{width:42px;height:42px}
  h1{font-size:19px}
  .doc-cover h2{font-size:18px}
  .print-title{font-size:10px}
  .rule-card p,.clause{font-size:14px}
  button,.btn{padding:8px 10px;font-size:13px}
}

/* Portable Core v5 fixes: rule save/search and admin spacing */
.hidden-by-search{display:none!important}
.card,.rule-card,.admin-layout,.two,.three,.conf-builder-grid,.rule-editor-grid{min-width:0;max-width:100%}
.two>*,.three>*,.conf-builder-grid>*,.rule-editor-grid>*{min-width:0}
input,select,textarea{max-width:100%;min-width:0}
textarea{resize:vertical;overflow:auto}
body.admin-page .card{overflow:hidden}
body.admin-page .rule-editor-grid{display:grid;grid-template-columns:minmax(360px,.75fr) minmax(600px,1.25fr);gap:22px;align-items:start}
body.admin-page .conf-builder-grid{display:grid;grid-template-columns:minmax(600px,.9fr) minmax(680px,1.1fr);gap:24px;align-items:start}
body.admin-page .quick-editor{table-layout:fixed;min-width:560px}
body.admin-page .quick-editor th:nth-child(1){width:70px}
body.admin-page .quick-editor th:nth-child(2){width:190px}
body.admin-page .quick-editor th:nth-child(3){width:auto}
body.admin-page .quick-editor select,body.admin-page .quick-editor input{width:100%;max-width:100%}
body.admin-page #clausesBox .card{overflow:visible}
@media (min-width:1500px){
  body.admin-page .rule-editor-grid{grid-template-columns:minmax(420px,.75fr) minmax(760px,1.25fr)}
  body.admin-page .conf-builder-grid{grid-template-columns:minmax(680px,.95fr) minmax(820px,1.05fr)}
}
@media (max-width:1200px){
  body.admin-page .rule-editor-grid,body.admin-page .conf-builder-grid{grid-template-columns:1fr}
  body.admin-page .quick-editor{min-width:620px}
}

/* v6 targeted fixes */
.public-page header .toolbar a[href*="admin"]{display:none!important;}
.manual-ref-row{margin-top:8px;font-size:.9rem;color:#334155;display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
.manual-ref{font-size:.82rem;padding:3px 7px;}
.age-filter-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:8px;margin:8px 0 14px;}
.age-filter{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid #dbe7f5;border-radius:12px;padding:10px 12px;font-weight:700;}
.age-filter input{width:auto;}
.age-filter-mode{display:flex;align-items:center;gap:8px;margin:8px 0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#ecfdf5}.age-filter-mode input{width:auto}.automatic-age-filter{opacity:.72}

/* v8 Age Matrix controls */
.age-tool .dob-row{display:grid;grid-template-columns:minmax(180px,260px) 1fr auto;gap:10px;align-items:end;margin-top:10px}
.age-matrix tr.eligible-row td{background:#dcfce7!important;border-top:2px solid #22c55e;border-bottom:2px solid #22c55e;font-weight:700}
.age-matrix tr.eligible-row td:first-child{border-left:4px solid #16a34a}
.age-matrix-editor input{min-width:130px;width:100%;box-sizing:border-box}
.age-matrix-editor td,.age-matrix-editor th{vertical-align:top}
@media(max-width:700px){.age-tool .dob-row{grid-template-columns:1fr}.age-matrix{font-size:12px}}

/* Portable Core v9 age matrix + duplicate tools */
.age-matrix-editor input.year-cell{min-width:72px;text-align:center}.age-matrix-editor input.age-cell{min-width:58px;text-align:center;font-weight:900}.eligible-row td,.eligible-row th{background:#dff7f3!important;border-color:#0f766e}.eligible-cell{outline:3px solid #0f766e;outline-offset:-3px;font-weight:950}.duplicate-tools .card{margin:6px 0}.age-tool .dob-row{display:grid;grid-template-columns:minmax(180px,320px) auto;gap:10px;align-items:end}
@media(max-width:700px){.age-tool .dob-row{grid-template-columns:1fr}.age-matrix{font-size:12px}.age-matrix th,.age-matrix td{padding:5px}}

/* TR1.1 conference-to-age-matrix context */
.status.age-context{background:#ecfdf5;color:#065f46}
.age-matrix tr.conference-age-row td,.age-matrix tr.conference-age-row th{background:#dcfce7!important;border-color:#22c55e;font-weight:850}
.age-matrix tr.conference-age-row td:first-child,.age-matrix tr.conference-age-row th:first-child{border-left:4px solid #16a34a}
.playing-group-ages{min-width:900px}.playing-group-ages th:first-child{width:190px}.playing-group-ages td{vertical-align:top}.age-choice-list{display:flex;gap:6px;flex-wrap:wrap}.age-choice{display:inline-flex;align-items:center;gap:4px;margin:0;padding:5px 7px;border:1px solid var(--line);border-radius:8px;background:#fff;font-weight:750;white-space:nowrap}.age-choice input{width:auto;min-width:0;margin:0}.range-choice{background:#eef6ff;color:#123f66}

/* TR1.1 pitching assignment headings */
.rest-period-table .assignment-bands th{text-align:center;vertical-align:middle;white-space:normal}
.rest-period-table .assignment-bands span{display:block;font-size:.82em;font-weight:750;margin-top:2px}
.conference-selector{max-width:620px}.conference-selector label{margin-top:0}.conference-selector select{font-weight:800}
.conditional-rule-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(160px,.7fr) auto;gap:10px;align-items:end;padding:10px 0;border-bottom:1px solid var(--line)}
.conditional-rule-row label{margin-top:0}.conditional-rule-row button{margin-bottom:1px}.conditional-rules{margin:12px 0;padding:12px;border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:10px;background:#fbfdff}.conditional-rules p{margin:6px 0}
.conference-notes{margin:12px 0;padding:12px;border:1px solid var(--line);border-left:4px solid #d6a400;border-radius:10px;background:#fffdf3}.conference-notes h3{margin-bottom:8px}.conference-notes p{margin:6px 0}.conference-notes-input{min-height:140px}
@media(max-width:700px){.conditional-rule-row{grid-template-columns:1fr}.conditional-rule-row button{justify-self:start}}

/* Mobile Conference Details table; pitching/rest tables remain unchanged */
@media(max-width:700px){
  .conference-head table,.conference-head tbody,.conference-head tr,.conference-head th,.conference-head td{display:block;width:100%}
  .conference-head table{white-space:normal;background:transparent}
  .conference-head tr{margin-bottom:9px;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#fff}
  .conference-head th,.conference-head td{border:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
  .conference-head th{padding:7px 9px;background:#eaf1f8}
  .conference-head td{padding:9px}
}

/* Wider rule reference on desktop; mobile keeps the existing full-width panel */
@media(min-width:761px){.ref-panel{width:min(860px,calc(100vw - 36px))}}

/* Editable Conference Format Snapshot */
.table-figure-card{grid-column:1/-1}.editable-figure-view h4{text-align:center;font-size:1.1rem;margin:8px 0}.conference-snapshot-table{min-width:1450px;font-size:10px;line-height:1.25;table-layout:fixed}.conference-snapshot-table th,.conference-snapshot-table td{white-space:normal;padding:4px 5px;overflow-wrap:anywhere}.conference-snapshot-table th:first-child{width:120px}.conference-snapshot-table th:nth-child(2){width:42px}.conference-snapshot-table th:nth-child(3){width:145px}.conference-snapshot-table th:nth-child(7){width:105px}.conference-snapshot-table th:nth-child(17){width:150px}
body.admin-page .figure-editor-layout.table-editor-layout{grid-template-columns:1fr!important}.table-editor-layout .figure-library-sidebar .list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:6px;max-height:none}.table-editor-layout .figure-library-sidebar .list-item{margin:0}.table-editor-layout .figure-editor-main{width:100%;min-width:0}.figure-table-editor{min-width:2200px}.figure-table-editor th{min-width:115px}.figure-table-editor th:first-child{min-width:170px}.figure-table-editor input{min-width:105px}.figure-table-editor textarea{min-width:115px;min-height:105px}.figure-table-editor th .small-btn{margin-top:5px}

/* Generic editable tables in the Rule Editor */
.rule-table-workspace{margin-top:22px;padding-top:20px;border-top:2px solid var(--line);width:100%;min-width:0}.rule-table-workspace-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:10px}.rule-table-workspace-head p{margin:3px 0 0}.rule-table-editor-card{overflow:hidden;padding:14px!important}.rule-table-editor{width:100%;min-width:1050px;table-layout:fixed}.rule-table-editor td{min-width:0}.rule-table-editor td:last-child{width:105px}.rule-table-editor textarea{width:100%;min-width:0;min-height:92px;resize:vertical}.rule-table-editor tr:first-child textarea{font-weight:900;background:#eaf1f8;min-height:64px}.rule-table-editor-card>.small-btn{margin-right:6px}
@media(max-width:700px){.rule-table-workspace-head{display:block}.rule-table-workspace-head button{margin-top:10px}.rule-table-editor{min-width:900px}.rule-table-editor textarea{min-height:82px}}

/* Rulebook figure popup keeps the reader's place */
.figure-link{white-space:nowrap}.figure-popup-open{overflow:hidden}.figure-popup{position:fixed;inset:0;z-index:100;background:rgba(11,27,51,.72);display:flex;align-items:center;justify-content:center;padding:20px}.figure-popup-panel{width:min(920px,100%);max-height:calc(100vh - 40px);overflow:auto;background:#fff;border-radius:18px;box-shadow:0 24px 70px rgba(0,0,0,.35);padding:16px}.figure-popup-actions{position:sticky;top:0;z-index:2;display:flex;justify-content:flex-end;margin-bottom:8px}.figure-popup-content h3{margin:0 0 12px}.figure-popup-content img{display:block;max-width:100%;max-height:calc(100vh - 190px);width:auto;height:auto;margin:0 auto;border:1px solid var(--line);border-radius:12px}.figure-popup-content .conference-snapshot-table{min-width:1450px}
@media(max-width:700px){.figure-popup{padding:8px}.figure-popup-panel{max-height:calc(100vh - 16px);padding:10px;border-radius:13px}.figure-popup-content img{max-height:calc(100vh - 155px)}}

/* Same-rule subclause links */
.local-clause-link{white-space:nowrap}.clause.local-clause-target{background:#dcfce7;border-left-color:#16a34a;box-shadow:0 0 0 2px rgba(34,197,94,.25);font-weight:650}

/* Hills logo navy across the top of the public and admin applications */
:root{--nav:#090d30}header{background:linear-gradient(135deg,#070a27,#151d52)}nav button.light{background:#e9ecf8;color:#090d30}

/* Compact public header for website embedding */
body.public-page header{padding:10px 14px;background:linear-gradient(135deg,#b91c1c,#e11d2e);justify-content:center}
body.public-page .header-search{width:min(760px,100%);margin:0}
body.public-page .header-search label{margin:0 0 5px;color:#fff;font-size:13px}
body.public-page .header-search input{border:2px solid rgba(255,255,255,.72);border-radius:12px;padding:10px 13px;background:#fff;color:var(--ink);box-shadow:0 5px 18px rgba(0,0,0,.16)}
body.public-page .header-search input:focus{outline:3px solid rgba(255,255,255,.3);outline-offset:2px;border-color:#fff}
body.public-page nav{overflow-x:visible;flex-wrap:wrap;justify-content:center}
body.public-page nav button{background:#d71920;white-space:normal;justify-content:center;flex:0 1 auto}
body.public-page nav button:hover{background:#b91c1c}
.mobile-nav-toggle{display:none}
.deploy-note{font-size:12px;line-height:1.38;margin:8px 0;padding:9px;border:1px solid #facc15;border-left:4px solid #d6a400;border-radius:10px;background:#fffbea;color:#3f2f00}.deploy-note code{font-size:11px;background:rgba(255,255,255,.75);padding:1px 4px;border-radius:5px}
body.public-page .context-return{position:sticky;top:64px;z-index:9;margin:0 0 12px;background:#166534;box-shadow:0 5px 16px rgba(15,23,42,.18)}
body.public-page .context-return[hidden]{display:none!important}
button:disabled{opacity:.45;cursor:not-allowed}
.rule-editor-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.rule-editor-title h2{margin:0}
@media(max-width:760px){
  body.public-page header{display:none}
  body.public-page nav{display:flex;flex-direction:column;align-items:stretch;padding:8px 10px;position:fixed;top:0;left:0;right:0;z-index:30;max-height:82vh;overflow:auto;transition:transform .22s ease,box-shadow .22s ease;box-shadow:0 8px 20px rgba(15,23,42,.18)}
  body.public-page.mobile-nav-hidden nav{transform:translateY(calc(-100% - 4px));box-shadow:none;pointer-events:none}
  body.public-page nav button{width:100%;justify-content:center}
  .mobile-nav-toggle{display:flex;position:fixed;top:0;left:10px;transform:none;z-index:31;width:max-content;margin:0;padding:7px 14px;min-height:34px;border-radius:0 0 12px 12px;background:#d71920;color:#fff;box-shadow:0 8px 18px rgba(15,23,42,.18)}
  body.public-page:not(.mobile-nav-hidden) .mobile-nav-toggle{display:none}
  body.public-page .context-return{top:56px;width:100%;justify-content:center}
  .rule-editor-title{align-items:stretch;flex-direction:column}.rule-editor-title button{justify-content:center}
}

/* Live-search match highlighting */
.search-hit-highlight{background:#dcfce7;color:#166534;border-radius:4px;padding:0 2px;font-weight:900;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.appendix-link{color:#b91c1c;font-weight:900;text-decoration:underline;text-underline-offset:2px}

/* Optional clause treatments for bold and new-rule indicators */
.clause-display-options{display:flex;gap:10px;flex-wrap:wrap;margin:9px 0}
.clause-bold-option,.clause-display-option{display:flex;align-items:center;gap:8px;width:max-content;max-width:100%;margin:0}.clause-bold-option input,.clause-display-option input{width:auto;min-width:0;margin:0}.clause-bold-text,.inline-rule-bold{font-weight:900}
.clause.new-rule-clause{background:#fff3bf;border-left-color:#d6a400;box-shadow:0 0 0 1px rgba(214,164,0,.28)}
.clause.new-rule-clause .clause-label{color:#7a4f00}

/* Compact Rule Editor metadata and enlarge the main clause body field */
body.admin-page #clausesBox .card{padding:13px 14px}body.admin-page #clausesBox .two{grid-template-columns:minmax(150px,.38fr) minmax(300px,1fr);gap:10px}body.admin-page #clausesBox label{font-size:.84rem;margin:4px 0 3px}body.admin-page #clausesBox .two input{padding:6px 9px;min-height:34px;font-size:.9rem;border-radius:8px}body.admin-page #clausesBox .muted{font-size:.76rem;line-height:1.3;margin:3px 0 6px}body.admin-page #clausesBox textarea[data-field="text"]{min-height:210px;padding:11px 12px}body.admin-page #clausesBox .clause-display-options{font-size:.84rem;margin:7px 0}body.admin-page #clausesBox .small-btn{padding:5px 8px;font-size:11px}
@media(max-width:760px){body.admin-page #clausesBox .two{grid-template-columns:1fr}body.admin-page #clausesBox textarea[data-field="text"]{min-height:180px}}

/* Larger touch targets for public phone use */
@media(max-width:760px){
  body.public-page nav button{min-height:52px;padding:13px 14px;font-size:15px;border-radius:12px}
  body.public-page .tile{min-height:92px;padding:17px}
  body.public-page button,body.public-page .btn{min-height:46px}
  body.public-page .ref-link{min-height:36px;padding:6px 10px;border-radius:12px;align-items:center}
}

/* Dedicated Rule 7.16 pitching and rest-period editor */
.rest-table-admin-editor{min-width:1200px;table-layout:fixed}.rest-table-admin-editor th,.rest-table-admin-editor td{min-width:140px}.rest-table-admin-editor th:last-child,.rest-table-admin-editor td:last-child{width:105px;min-width:105px}.rest-table-admin-editor textarea{min-height:72px;width:100%;resize:vertical}.rest-table-admin-editor thead textarea{min-height:60px;font-weight:900;background:#eaf1f8}.rest-editor-bands th{padding:9px;text-align:center;vertical-align:middle;border-bottom:3px solid #fff}.rest-editor-bands input{font-weight:900;text-align:center;border:1px solid rgba(15,23,42,.18);background:rgba(255,255,255,.72)}.rest-editor-bands .rest-info-band{background:#eaf1f8;color:#123f66}.rest-editor-bands .minor-band{background:#dcfce7;color:#166534}.rest-editor-bands .substantial-band{background:#fef3c7;color:#92400e}.rest-editor-bands .major-band{background:#fee2e2;color:#991b1b}.rest-editor-bands .rest-row-band{background:#f8fafc}
@media(max-width:800px){.rest-table-admin-editor{min-width:1050px}}
