:root{
  --cc-blue:#123f68; --cc-blue-dark:#09233d; --cc-orange:#f47b20; --cc-light:#eaf5fb;
  --bg:#f3f6f9; --card:#ffffff; --text:#17202a; --muted:#667789; --line:#d8e3ec;
  --shadow:0 8px 24px rgba(18,63,104,.08); --radius:16px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text);line-height:1.58}
a{color:var(--cc-blue)}
.site-header{position:sticky;top:0;z-index:30;background:linear-gradient(135deg,var(--cc-blue),var(--cc-blue-dark));color:#fff;border-bottom:4px solid var(--cc-orange)}
.header-inner{max-width:1560px;margin:0 auto;padding:18px 22px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand-wordmark{font-size:2.15rem;line-height:1;font-weight:900;font-style:italic;letter-spacing:-.05em;color:#fff;text-shadow:0 2px 0 rgba(0,0,0,.18);margin-bottom:2px}.eyebrow{text-transform:uppercase;letter-spacing:.08em;color:#cae6f6;font-weight:700;font-size:.82rem}.site-header h1{margin:2px 0;font-size:1.7rem}.site-header p{margin:0;color:#e8f3fb}.status-pill{display:inline-block;margin-left:8px;background:var(--cc-orange);color:#fff;padding:.15rem .5rem;border-radius:999px;font-size:.78rem;font-weight:800}.header-actions{display:flex;gap:9px;flex-wrap:wrap}.header-actions a,.header-actions button,.mobile-bar button{background:#fff;color:var(--cc-blue);border:0;border-radius:10px;padding:.58rem .82rem;font-weight:800;text-decoration:none;cursor:pointer}.header-actions a:hover,.header-actions button:hover,.mobile-bar button:hover{filter:brightness(.96)}
.docs-shell{max-width:1560px;margin:0 auto;padding:18px;display:grid;grid-template-columns:320px minmax(0,1fr);gap:24px;align-items:start}.left-rail{position:sticky;top:104px;max-height:calc(100vh - 124px);overflow:auto;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px}.rail-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;margin-bottom:14px}.rail-card.compact p{margin:.35rem 0 0;color:var(--muted);font-size:.92rem}.rail-title{font-size:.82rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:800;margin-bottom:8px}.search-box label{display:block;font-weight:800;color:var(--cc-blue);margin-bottom:6px}.search-box input,.mobile-search input,.login-card input{width:100%;border:1px solid var(--line);border-radius:11px;padding:.72rem .78rem;font-size:1rem;background:#fff}.search-help{color:var(--muted);font-size:.82rem;margin-top:6px}.search-help kbd{border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;padding:0 .3rem;background:#f7f9fb}.search-meta{margin:10px 0;color:var(--muted);font-size:.9rem}.toc{border-top:1px solid var(--line);padding-top:10px}
.toc a.toc-l1{font-weight:900;margin-top:.35rem;border-top:1px solid var(--line);padding-top:.65rem}.toc a.toc-l1:first-child{border-top:0;margin-top:0}.toc a.toc-l2{padding-left:1.35rem;font-size:.88rem;color:#355a78}
.toc a{display:block;text-decoration:none;border-radius:9px;padding:.45rem .55rem;color:var(--cc-blue);font-size:.94rem}.toc a:hover{background:var(--cc-light)}.toc .toc-l2{padding-left:1.4rem;font-size:.88rem;color:#355a78}.toc a.active{background:#fff1e6;color:#9d470c;font-weight:800}.rules-content{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:30px;min-width:0}.test-notice{display:grid;gap:4px;border-left:6px solid var(--cc-orange);background:#fff7ef;border-radius:11px;padding:14px 16px;margin-bottom:28px;color:#40220b}.section-title{scroll-margin-top:124px;line-height:1.18;color:var(--cc-blue)}.level-1{font-size:1.85rem;margin:2.6rem 0 1rem;padding-top:1.2rem;border-top:4px solid var(--cc-orange)}.level-1:first-of-type{margin-top:.4rem}.level-2{font-size:1.25rem;margin:1.8rem 0 .65rem}.section-title .copy-rule,.rule-tools button{opacity:0;transition:.15s}.section-title:hover .copy-rule,.rule-item:hover .rule-tools button{opacity:1}.copy-rule,.rule-tools button{margin-left:.5rem;border:1px solid var(--line);background:#f8fbfd;color:var(--cc-blue);border-radius:7px;padding:.15rem .38rem;cursor:pointer;font-size:.75rem}.rule-item{scroll-margin-top:124px;margin:.64rem 0}.rule-item.numbered{--indent:0px;display:grid;grid-template-columns:70px minmax(0,1fr) auto;gap:8px;align-items:start;margin-left:var(--indent);padding:.28rem .35rem;border-radius:10px}.rule-item.rule-depth-1{--indent:0px}.rule-item.rule-depth-2{--indent:24px}.rule-item.rule-depth-3{--indent:48px}.rule-item.rule-depth-4{--indent:72px}.rule-item.rule-depth-5{--indent:96px}.rule-item.rule-depth-6{--indent:120px}.rule-item.numbered:hover{background:#f8fbfd}.rule-anchor{font-weight:700;color:var(--cc-orange);font-size:.94em;text-decoration:none;white-space:nowrap;font-variant-numeric:tabular-nums}.rule-anchor:hover{text-decoration:underline}.rule-text{min-width:0}.rule-continuation{margin-left:calc(var(--indent) + 78px);color:var(--text)}.rule-tools{white-space:nowrap}.figure-label{font-weight:800;color:var(--muted);font-style:italic;margin:1rem 0 .45rem}.level-2{margin-left:24px}.level-3{margin-left:48px}.highlight{background:#fff2a8;border-radius:4px;padding:0 .05em}.hidden-by-search{display:none!important}.no-results{padding:22px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:12px;margin:18px 0}.mobile-bar{display:none}.backtop{position:fixed;right:20px;bottom:20px;border:0;background:var(--cc-orange);color:#fff;border-radius:999px;padding:.76rem .9rem;font-weight:800;box-shadow:0 6px 18px rgba(0,0,0,.2);display:none;z-index:50}.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#142538;color:#fff;border-radius:999px;padding:.65rem .9rem;box-shadow:0 8px 24px rgba(0,0,0,.25);opacity:0;pointer-events:none;transition:.2s;z-index:60}.toast.show{opacity:1}.login-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,var(--cc-blue),var(--cc-blue-dark))}.login-card{background:#fff;border-radius:22px;padding:30px;width:min(92vw,440px);box-shadow:0 16px 42px rgba(0,0,0,.28)}.login-brand{font-size:1.7rem;font-weight:900;color:var(--cc-blue);font-style:italic}.login-card h1{color:var(--cc-blue);margin:.25rem 0}.login-card label{display:block;font-weight:800;margin:1rem 0 .35rem}.login-card button{background:var(--cc-orange);color:#fff;border:0;border-radius:11px;margin-top:1rem;width:100%;padding:.75rem;font-weight:900;cursor:pointer}.error{color:#9b0000;font-weight:800}
@media(max-width:1160px){.docs-shell{grid-template-columns:300px minmax(0,1fr)}}
@media(max-width:820px){.site-header{position:static}.header-inner{display:block}.header-actions{margin-top:12px}.mobile-bar{display:flex;gap:10px;align-items:center;padding:10px;position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);z-index:25}.mobile-search{flex:1}.docs-shell{display:block;padding:10px}.left-rail{display:none;position:fixed;left:10px;right:10px;top:66px;z-index:40;max-height:72vh}.left-rail.open{display:block}.rules-content{padding:18px;border-radius:12px}.level-1{font-size:1.38rem}.level-2{font-size:1.08rem;margin-left:0}.level-3{margin-left:0}.rule-item.numbered{grid-template-columns:62px minmax(0,1fr);gap:7px;margin-left:calc(var(--indent) / 2)}.rule-continuation{margin-left:calc((var(--indent) / 2) + 69px)}.rule-tools{display:none}.site-header h1{font-size:1.35rem}}
@media print{.rule-figure{break-inside:avoid;box-shadow:none;border:1px solid #ccc}.rule-figure img{max-height:none}.site-header,.left-rail,.mobile-bar,.backtop,.toast,.test-notice,.copy-rule,.rule-tools{display:none!important}.docs-shell{display:block;padding:0}.rules-content{box-shadow:none;border:0;border-radius:0;padding:0;max-width:none}.section-title,.rule-item{scroll-margin-top:0}.rule-item{break-inside:avoid}.level-1{color:#000;border-color:#000}}
.rule-figure{margin:1rem 0 1.4rem;padding:12px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 5px 16px rgba(18,63,104,.06);text-align:center;overflow:hidden}
.rule-figure img{display:block;max-width:100%;height:auto;margin:0 auto;border-radius:8px}
.rule-figure figcaption{margin-top:.55rem;color:var(--muted);font-size:.9rem;font-weight:700;font-style:italic}
.rule-figure.narrow{max-width:520px;margin-left:0}
.rule-figure.full{max-width:980px}


/* Change badges */
.change-badge-wrap{display:inline-flex;align-items:center;gap:.35rem;margin-left:.5rem;vertical-align:middle;white-space:nowrap}
.change-badge{border:0;border-radius:999px;padding:.18rem .5rem;font-size:.68rem;font-weight:900;letter-spacing:.04em;color:#fff;cursor:pointer;line-height:1.25;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.change-badge.NEW{background:#1f8b4c}.change-badge.UPDATED{background:var(--cc-orange)}.change-badge.CLARIFIED{background:#2778b8}.change-badge.MOVED{background:#576575}
.change-meta{color:var(--muted);font-size:.78rem;font-weight:800}
.toc-change-dot{display:inline-block;width:.52rem;height:.52rem;border-radius:50%;background:var(--cc-orange);margin-left:.35rem;vertical-align:middle;box-shadow:0 0 0 2px #fff1e6}
.change-popover{position:fixed;z-index:90;width:min(360px,calc(100vw - 24px));background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 16px 42px rgba(0,0,0,.18);padding:14px;color:var(--text)}
.change-popover h3{margin:.1rem 0 .35rem;color:var(--cc-blue);font-size:1rem}.change-popover p{margin:.35rem 0}.change-popover .change-type{display:inline-block;border-radius:999px;padding:.15rem .45rem;color:#fff;font-weight:900;font-size:.72rem;margin-right:.35rem}.change-popover .change-type.NEW{background:#1f8b4c}.change-popover .change-type.UPDATED{background:var(--cc-orange)}.change-popover .change-type.CLARIFIED{background:#2778b8}.change-popover .change-type.MOVED{background:#576575}.change-popover a{font-weight:900}.change-popover-close{float:right;border:0;background:#eef4f8;color:var(--cc-blue);border-radius:999px;width:26px;height:26px;font-weight:900;cursor:pointer}
.change-modal[hidden]{display:none}.change-modal{position:fixed;inset:0;z-index:100}.change-modal-backdrop{position:absolute;inset:0;background:rgba(9,35,61,.62)}.change-modal-panel{position:relative;margin:5vh auto;background:#fff;border-radius:18px;box-shadow:0 18px 60px rgba(0,0,0,.3);width:min(920px,92vw);max-height:88vh;overflow:auto;padding:24px}.change-modal-panel h2{margin-top:0;color:var(--cc-blue)}.change-modal-close{position:absolute;right:16px;top:14px;border:0;background:#eef4f8;color:var(--cc-blue);border-radius:999px;width:34px;height:34px;font-size:1.45rem;line-height:1;cursor:pointer}.change-modal-intro{color:var(--muted)}.change-summary-group{border-top:1px solid var(--line);padding-top:14px;margin-top:16px}.change-summary-group h3{color:var(--cc-blue);margin:.2rem 0 .6rem}.change-summary-list{display:grid;gap:10px}.change-summary-item{display:grid;grid-template-columns:92px 96px minmax(0,1fr);gap:10px;align-items:start;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fbfdff}.change-summary-item a{font-weight:900;text-decoration:none}.change-summary-type{border-radius:999px;color:#fff;font-weight:900;font-size:.72rem;text-align:center;padding:.18rem .45rem}.change-summary-type.NEW{background:#1f8b4c}.change-summary-type.UPDATED{background:var(--cc-orange)}.change-summary-type.CLARIFIED{background:#2778b8}.change-summary-type.MOVED{background:#576575}
@media(max-width:820px){.change-badge-wrap{display:flex;margin:.35rem 0 0}.change-summary-item{grid-template-columns:1fr}.change-modal-panel{padding:18px}.change-popover{left:12px!important;right:12px!important;width:auto}}
@media print{.change-badge-wrap,.change-popover,.change-modal{display:none!important}}


/* Desktop optional collapsible sections */
.desktop-only{display:inline-block}
.chapter-toggle{display:none;margin-right:.55rem;border:1px solid var(--line);background:#f8fbfd;color:var(--cc-blue);border-radius:8px;width:1.65rem;height:1.65rem;font-weight:900;cursor:pointer;vertical-align:middle;line-height:1}
body.collapsible-enabled .chapter-toggle{display:inline-grid;place-items:center}
body.collapsible-enabled .section-title.level-1{cursor:pointer}
.chapter-member.chapter-closed{display:none!important}
body.search-active .chapter-member.chapter-closed{display:revert!important}
body.search-active .chapter-toggle{opacity:.45}

@media(max-width:820px){
  body{font-size:17px;line-height:1.7}
  .desktop-only{display:none!important}
  .chapter-toggle{display:none!important}
  .chapter-member.chapter-closed{display:revert!important}
  .rule-item.numbered{margin-left:0!important;grid-template-columns:62px minmax(0,1fr)!important;gap:7px!important;padding:.42rem .15rem!important}
  .rule-continuation{margin-left:0!important;padding-left:0!important}
  .level-2,.level-3{margin-left:0!important}
}


/* Collapsible table of contents */
.toc{display:grid;gap:4px}
.toc-section{border-radius:10px}
.toc-section-row{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:start;gap:2px;border-radius:10px}
.toc-toggle{border:0;background:transparent;color:var(--cc-blue);font-weight:900;cursor:pointer;border-radius:8px;width:28px;height:30px;line-height:1;margin-top:2px}
.toc-toggle:hover{background:var(--cc-light)}
.toc-section-row .toc-l1{padding-left:.25rem}
.toc-children{padding-left:30px;display:grid;gap:1px}
.toc-section.toc-section-closed .toc-children{display:none}
.toc-children .toc-l2{padding-left:.45rem}

/* Rule collapse now works on mobile too */
@media(max-width:820px){
  #collapseToggle{display:none!important}
  #collapseToggleMobile{display:inline-block!important;white-space:nowrap}
  body.collapsible-enabled .chapter-toggle{display:inline-grid!important;place-items:center}
  .chapter-member.chapter-closed{display:none!important}
  .chapter-toggle{margin-right:.35rem}
  .toc-children{padding-left:22px}
}

/* Mobile reading layout reset: do not force desktop two-column rule layout on phones. */
@media(max-width:820px){
  body{font-size:16.5px;line-height:1.62;background:#fff;}
  .docs-shell{padding:0;}
  .rules-content{border:0;border-radius:0;box-shadow:none;padding:18px 16px;}
  .test-notice{margin:0 0 20px 0;}

  .level-1{font-size:1.42rem;line-height:1.22;margin:2.1rem 0 1rem;padding-top:1rem;}
  .level-2{font-size:1.12rem;line-height:1.28;margin:1.55rem 0 .75rem!important;}
  .level-3{margin-left:0!important;}

  .rule-item.numbered,
  .rule-item.numbered.rule-depth-1,
  .rule-item.numbered.rule-depth-2,
  .rule-item.numbered.rule-depth-3,
  .rule-item.numbered.rule-depth-4,
  .rule-item.numbered.rule-depth-5,
  .rule-item.numbered.rule-depth-6{
    display:block!important;
    margin:.78rem 0!important;
    padding:.66rem 0 .72rem!important;
    border-radius:0!important;
    border-bottom:1px solid rgba(216,227,236,.85);
    background:transparent!important;
  }

  .rule-anchor{
    display:block;
    margin:0 0 .28rem 0;
    font-size:1.02rem;
    line-height:1.2;
    font-weight:750;
    color:var(--cc-orange);
  }

  .rule-text{
    display:block;
    width:100%;
    min-width:0;
    font-size:1rem;
    line-height:1.62;
  }

  .rule-continuation{
    margin:.25rem 0 .75rem 0!important;
    padding-left:0!important;
    font-size:1rem;
    line-height:1.62;
  }

  .rule-item.numbered:hover{background:transparent!important;}
  .rule-tools{display:none!important;}
}

/* Fix: when a chapter is collapsed, hide every item in that chapter on all screen sizes.
   This must come after the mobile reading layout rules because those rules set
   rule items to display:block!important. */
body.collapsible-enabled .chapter-member.chapter-closed,
body.collapsible-enabled .chapter-member.chapter-closed.rule-item,
body.collapsible-enabled .chapter-member.chapter-closed.rule-item.numbered,
body.collapsible-enabled .chapter-member.chapter-closed.section-title,
body.collapsible-enabled .chapter-member.chapter-closed.figure-label,
body.collapsible-enabled .chapter-member.chapter-closed.rule-figure{
  display:none!important;
}

/* Search should temporarily reveal collapsed content so matches can be found. */
body.search-active .chapter-member.chapter-closed,
body.search-active .chapter-member.chapter-closed.rule-item,
body.search-active .chapter-member.chapter-closed.rule-item.numbered,
body.search-active .chapter-member.chapter-closed.section-title,
body.search-active .chapter-member.chapter-closed.figure-label,
body.search-active .chapter-member.chapter-closed.rule-figure{
  display:revert!important;
}

@media(max-width:820px){
  body.search-active .chapter-member.chapter-closed.rule-item.numbered{
    display:block!important;
  }
}

/* ChampCar site integration */
.cc-fallback-header{background:linear-gradient(135deg,var(--cc-blue),var(--cc-blue-dark));border-bottom:4px solid var(--cc-orange);color:#fff}
.cc-fallback-inner{max-width:1560px;margin:0 auto;padding:14px 22px}
.cc-fallback-brand{color:#fff;text-decoration:none;font-size:1.7rem;font-weight:900;font-style:italic;letter-spacing:-.04em}.cc-fallback-brand span{display:block;font-size:.72rem;letter-spacing:.09em;text-transform:uppercase;color:#cae6f6;font-style:normal}
.rulebook-toolbar{background:#fff;border-bottom:1px solid var(--line);box-shadow:0 3px 18px rgba(18,63,104,.06);position:sticky;top:0;z-index:26}
.rulebook-toolbar-inner{max-width:1560px;margin:0 auto;padding:16px 22px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.rulebook-title-block h1{margin:.1rem 0;color:var(--cc-blue);font-size:1.75rem;line-height:1.1}.rulebook-title-block p{margin:0;color:var(--muted);font-weight:700}.rulebook-breadcrumb{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:.86rem;margin-bottom:.25rem}.rulebook-breadcrumb a{text-decoration:none;color:var(--cc-blue)}.rulebook-breadcrumb a:hover{text-decoration:underline}
.rulebook-toolbar .header-actions a,.rulebook-toolbar .header-actions button,.mobile-bar button{background:var(--cc-blue);color:#fff;border:0;border-radius:10px;padding:.58rem .82rem;font-weight:800;text-decoration:none;cursor:pointer}.rulebook-toolbar .header-actions a:hover,.rulebook-toolbar .header-actions button:hover,.mobile-bar button:hover{background:var(--cc-blue-dark);filter:none}
.rulebook-toolbar .header-actions a:first-child{background:var(--cc-orange)}.rulebook-toolbar .header-actions a:first-child:hover{background:#d96613}
.related-tools{margin:0 0 1.15rem 24px;border:1px solid #ffd6b9;border-left:6px solid var(--cc-orange);background:#fff8f1;border-radius:14px;padding:14px 16px;box-shadow:0 5px 16px rgba(18,63,104,.05)}
.related-tools-title{font-size:.82rem;text-transform:uppercase;letter-spacing:.08em;color:#9d470c;font-weight:900;margin-bottom:8px}.related-tools-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.related-tool{display:block;text-decoration:none;background:#fff;border:1px solid #f5c8a7;border-radius:12px;padding:12px;color:var(--cc-blue)}.related-tool strong{display:block;font-size:1rem}.related-tool span{display:block;color:var(--muted);font-size:.9rem;margin-top:.15rem}.related-tool:hover{border-color:var(--cc-orange);box-shadow:0 4px 14px rgba(244,123,32,.14)}
@media(max-width:820px){.rulebook-toolbar{position:static}.rulebook-toolbar-inner{display:block;padding:14px 16px}.rulebook-title-block h1{font-size:1.35rem}.rulebook-toolbar .header-actions{display:flex;gap:8px;overflow:auto;padding-top:10px;flex-wrap:nowrap}.rulebook-toolbar .header-actions a,.rulebook-toolbar .header-actions button{white-space:nowrap;font-size:.9rem}.mobile-bar button{background:#fff;color:var(--cc-blue);border:1px solid var(--line)}.related-tools{margin-left:0;padding:12px}.related-tools-grid{grid-template-columns:1fr}.related-tool{padding:11px}.docs-shell{padding-top:10px}}
@media print{.cc-fallback-header,.rulebook-toolbar{display:none!important}}

/* Mobile toolbar action fix: make buttons fit instead of horizontal scrolling/clipping. */
@media(max-width:820px){
  .rulebook-toolbar .header-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    overflow:visible;
    padding-top:12px;
    width:100%;
  }
  .rulebook-toolbar .header-actions a,
  .rulebook-toolbar .header-actions button{
    width:100%;
    min-width:0;
    max-width:100%;
    white-space:normal;
    text-align:center;
    line-height:1.15;
    padding:.78rem .55rem;
    font-size:.94rem;
  }
  .rulebook-toolbar .header-actions button#copyPageBtn{
    font-size:.9rem;
  }
}
@media(max-width:380px){
  .rulebook-toolbar .header-actions a,
  .rulebook-toolbar .header-actions button{
    font-size:.86rem;
    padding:.72rem .45rem;
  }
}
