/* v316: consistent site width, neutral night theme and compact mobile controls. */
:root{color-scheme:light}
html:root[data-theme="night"]{color-scheme:dark}

/* Keep footer content on the same 90rem grid as the principal pages. */
footer{padding-inline:0!important}
footer>.footer-links,footer>.footer-bottom{
  width:min(calc(100% - 3rem),90rem);
  margin-inline:auto;
}
footer>.footer-social{display:none!important}

/* Compact, accessible theme control. */
header .theme-toggle{
  display:grid!important;
  place-items:center!important;
  width:2rem!important;
  min-width:2rem!important;
  height:2rem!important;
  min-height:2rem!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--ink)!important;
}
header .theme-toggle:hover,header .theme-toggle:focus-visible{background:transparent!important;color:var(--green)!important}
header .theme-toggle span{display:grid!important;place-items:center!important;width:1.3rem!important;height:1.3rem!important;font-size:0!important;line-height:1!important}
header .theme-toggle svg{display:block;width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
body>header .session>button.theme-toggle,
html:root[data-theme="night"] body>header .session>button.theme-toggle{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--ink)!important;
}
body.home-active>header .session>button.theme-toggle{background:transparent!important;color:#111!important}
html:root[data-theme="night"] body.home-active>header .session>button.theme-toggle{color:#f1f2f1!important}
body .competition-filters span{font-size:.82rem!important}

html:root[data-theme="night"]{
  --ink:#f1f2f1;
  --muted:#b7bbb9;
  --paper:#101112;
  --panel:#1a1c1e;
  --line:rgba(255,255,255,.16);
  --green:#70c7a4;
  --green-deep:#91dbbd;
  --acid:#d7ef56;
  --white:#1a1c1e;
}
html:root[data-theme="night"],html:root[data-theme="night"] body,html:root[data-theme="night"] main{
  background:var(--paper)!important;
  color:var(--ink)!important;
}
html:root[data-theme="night"] body :is(.view,.site-page,#athletes,#club,#public,#entry,#admin){
  background:transparent!important;
  color:var(--ink)!important;
}
html:root[data-theme="night"] body #club.view[data-active-section="competitions"]{background:transparent!important}
html:root[data-theme="night"] body #club[data-active-section="competitions"] :where(.competition-directory,.competition-index,.competition-index button){
  background:transparent!important;
  color:var(--ink)!important;
}
html:root[data-theme="night"] body #club[data-active-section="competitions"] .competition-index{
  border-color:var(--line)!important;
}
html:root[data-theme="night"] body #club[data-active-section="competitions"] .competition-index button{
  border-color:var(--line)!important;
}
html:root[data-theme="night"] body:has(#athletes.active),
html:root[data-theme="night"] main:has(#athletes.active),
html:root[data-theme="night"] body:has(#club.active[data-active-section="competitions"]),
html:root[data-theme="night"] main:has(#club.active[data-active-section="competitions"]){background:var(--paper)!important}
html:root[data-theme="night"] body:has(#public.active),
html:root[data-theme="night"] body:has(#public.active) main{background:var(--paper)!important}
html:root[data-theme="night"] header,
html:root[data-theme="night"] body:has(#public.active)>header{
  background:rgba(16,17,18,.92)!important;
  color:var(--ink)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}
html:root[data-theme="night"] header.is-scrolled{box-shadow:0 .35rem 1.1rem rgba(0,0,0,.34)!important}
html:root[data-theme="night"] header :where(nav button,.menu-toggle,.theme-toggle){color:var(--ink)!important}
html:root[data-theme="night"] header .session>button,
html:root[data-theme="night"] header #accountButton{background:#242628!important;color:var(--ink)!important}
html:root[data-theme="night"] :where(
  input,select,textarea,.toolbar select,.entry-tools select,.entry-tools input,
  .athlete-tools select,.athlete-tools input,.archive-tools select,.archive-tools input,
  .competition-search input
){border-color:var(--line)!important;background-color:var(--panel)!important;color:var(--ink)!important}
html:root[data-theme="night"] :where(input,textarea)::placeholder{color:#9ea3a0!important}
html:root[data-theme="night"] .athlete-tools select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23edf5f1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;
  background-position:right 1rem center!important;
  background-size:1rem!important;
}
html:root[data-theme="night"] :where(
  .leaderboard,.lanes-scoreboard,.target-lanes-view,.lanes-firer-tile,.lanes-scoreboard-row,
  .athlete-card,.competition-card,.competition-index a,.team-record,.competition-results-table,
  .athlete-profile-stats article,.major-placing-summary>span,.profile-record-section,
  .competition-summary-grid,.competition-results-grid,.local-trophy-grid,.international-honour-grid,
  .history-timeline article,.site-card,.account-dropdown,.nav-dropdown,.home-live-card
){border-color:var(--line)!important;background-color:var(--panel)!important;color:var(--ink)!important}
html:root[data-theme="night"] :where(.row,.thead,.lanes-scoreboard-head,.lanes-scoreboard-row,.archive-row,.competition-results-table th,.competition-results-table td){border-color:var(--line)!important;color:var(--ink)!important}
html:root[data-theme="night"] body #public .leaderboard{background:var(--panel)!important;color:var(--ink)!important}
html:root[data-theme="night"] :where(.row:hover,.row[aria-expanded="true"],.athlete-card:hover,.athlete-card:focus-visible,.competition-card:hover){background:#26292b!important}
html:root[data-theme="night"] .inline-result{border-color:var(--line)!important;background:#222527!important}
html:root[data-theme="night"] .lanes-firer-tile.is-recorded{background:#242927!important}
html:root[data-theme="night"] .lanes-firer-tile.is-partial{background:#3a321b!important}
html:root[data-theme="night"] .lanes-firer-ranges b{color:var(--ink)!important}
html:root[data-theme="night"] .lanes-scoreboard-head .total-head{background:#176f55!important;color:#fff!important}
html:root[data-theme="night"] :where(.home-live-feature,.home-destinations,.home-utility,.home-routes){background:var(--paper)!important;color:var(--ink)!important}
html:root[data-theme="night"] .home-destinations>button{border-color:var(--line)!important;background:var(--panel)!important;color:var(--ink)!important}
html:root[data-theme="night"] body.home-active,
html:root[data-theme="night"] body.home-active main,
html:root[data-theme="night"] body.home-active #home,
html:root[data-theme="night"] body.home-active .home-live-feature,
html:root[data-theme="night"] body.home-active .home-destinations{background:var(--paper)!important;color:var(--ink)!important}
html:root[data-theme="night"] body.home-active .home-live-card{border-color:var(--line)!important;background:rgba(26,28,30,.96)!important;color:var(--ink)!important;box-shadow:0 1rem 2.8rem rgba(0,0,0,.34)!important}
html:root[data-theme="night"] body.home-active .home-destinations>button{border-color:var(--line)!important;background:#1d1f21!important;color:var(--ink)!important}
html:root[data-theme="night"] body.home-active .home-destinations>button:hover{background:#25282a!important}
html:root[data-theme="night"] body.home-active .home-live-status.completed{background:#252a28!important;color:var(--green)!important}
html:root[data-theme="night"] body.home-active .home-live-columns,
html:root[data-theme="night"] body.home-active .home-live-card li{border-color:var(--line)!important;color:var(--ink)!important}
html:root[data-theme="night"] body.home-active .home-live-card :where(h2,b,strong,span,em){color:inherit}
html:root[data-theme="night"] .athlete-avatar,
html:root[data-theme="night"] .athlete-photo{border-color:#3a3e3d!important;background-color:#272a2b!important;color:var(--green)!important}
html:root[data-theme="night"] .competition-filters span{border-color:var(--line)!important;background:#1a1c1e!important;color:#d9dcda!important}
html:root[data-theme="night"] .competition-filters input:checked+span{border-color:#258464!important;background:#185d49!important;color:#f5fbf8!important}
html:root[data-theme="night"] :where(
  .athletes-head>div:first-child>p:last-child,
  .competition-directory-head>div>p,
  .athlete-identity em,
  .athlete-ranking-result small,
  .home-live-intro p,
  .home-destinations p,
  .history-page p
){color:var(--muted)!important}
html:root[data-theme="night"] body #athletes .athletes-head>div:first-child>p:last-child,
html:root[data-theme="night"] body #club .competition-directory-head>div>p,
html:root[data-theme="night"] body #athletes .athlete-identity em,
html:root[data-theme="night"] body #home .home-live-intro p,
html:root[data-theme="night"] body #home .home-destinations p{color:var(--muted)!important}
html:root[data-theme="night"] .home-live-feature::before,
html:root[data-theme="night"] .home-live-feature::after{opacity:.22}
html:root[data-theme="night"] footer{border-top:1px solid var(--line)!important;background:#090a0b!important;color:#c2c6c4!important}
html:root[data-theme="night"] footer :where(a,button){color:#eef5f1!important}
html:root[data-theme="night"] :focus-visible{outline-color:#a6dfca!important}
@media(forced-colors:active){
  header .theme-toggle{border:1px solid ButtonText!important}
}

@media(max-width:57.5rem){
  header .menu-toggle{
    position:relative!important;
    display:block!important;
    width:2.5rem!important;
    min-width:2.5rem!important;
    height:2.5rem!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--ink)!important;
  }
  header .menu-toggle span{
    position:absolute!important;
    top:50%!important;
    left:50%!important;
    display:block!important;
    width:1.35rem!important;
    height:2px!important;
    border-radius:999px!important;
    background:currentColor!important;
    transform-origin:center!important;
    transition:transform .24s cubic-bezier(.4,0,.2,1)!important;
  }
  header .menu-toggle span:nth-of-type(1){transform:translate(-50%,-.25rem)!important}
  header .menu-toggle span:nth-of-type(2){transform:translate(-50%,.25rem)!important}
  header.menu-open .menu-toggle span:nth-of-type(1){transform:translate(-50%,0) rotate(45deg)!important}
  header.menu-open .menu-toggle span:nth-of-type(2){transform:translate(-50%,0) rotate(-45deg)!important}
  header .menu-toggle b{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important}
  .competition-filters span{font-size:.82rem!important}
}

@media(prefers-reduced-motion:reduce){header .menu-toggle span{transition:none!important}}

/* iOS does not auto-zoom focused controls at 16px; keep search and selectors matched. */
@media(max-width:57.5rem){
  body .athlete-tools input,body .athlete-tools select,body .competition-search input{
    min-height:2.7rem!important;
    padding:.62rem .78rem!important;
    font:600 16px/1.2 var(--font-sans)!important;
    font-size:16px!important;
  }
}
