body.page-page { display: block; min-height: 100%; height: auto; }
/* The top padding clears the menu and sign-out buttons from first paint, so the menu script never shifts the page. */
.page-main { display: block; max-width: 56rem; margin: 0 auto; padding: 3.5rem 1.5rem 1.5rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
h2 { font-size: 1.125rem; font-weight: 600; margin: 0 0 1rem; }
.page-kicker, .help, .page-footer { font-size: .875rem; color: var(--road-major); }
.page-kicker { margin: .25rem 0 0; }
.page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.page-panel { border-top: 1px solid var(--hairline); padding-top: 1.25rem; min-width: 0; }
details.page-panel > summary h2 { margin: 0; }
details.page-panel[open] > summary { margin-bottom: .75rem; }
.page-wide { grid-column: 1 / -1; }
.page-preview { max-width: 25rem; margin: 1.5rem auto; }
.page-preview .field-score { font-size: 3rem; }
.page-preview .match-clock { font-size: 2.5rem; margin-top: .75rem; }
button, input, textarea { font: inherit; }
:root { color-scheme: light dark; }
button { min-height: 44px; border: 1px solid var(--hairline); border-radius: .375rem; padding: .5rem .875rem; background: var(--surface); color: var(--ink); cursor: pointer; }
button:hover, button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
label { display: grid; gap: .375rem; margin: 0 0 1rem; font-size: .875rem; }
input, textarea { width: 100%; min-width: 0; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--hairline); border-radius: .375rem; background: var(--surface); color: var(--ink); }
.button-row, .phase-controls { display: flex; gap: .5rem; flex-wrap: wrap; }
.phase-controls button { flex: 1 1 9rem; }
.clock-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
/* Names (with the swap button between them) above the goal buttons, so a swap is never one tap from a goal. */
.score-names, .score-buttons { display: grid; gap: .75rem; align-items: center; }
.score-names { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); margin-bottom: .5rem; }
.score-buttons { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.score-names p { margin: 0; text-align: center; font-weight: 600; overflow-wrap: anywhere; }
.score-name-home, .score-home { order: 1; } .swap-sides { order: 2; } .score-name-away, .score-away { order: 3; }
/* Swapped: the columns follow the field, so Moorestown's controls sit on its bench side. */
.score-controls.swapped .score-name-home, .score-controls.swapped .score-home { order: 3; }
.score-controls.swapped .score-name-away, .score-controls.swapped .score-away { order: 1; }
.swap-sides { display: grid; place-items: center; width: 44px; padding: 0; }
.results-list { margin: 0 0 1rem; padding-left: 1.25rem; font-variant-numeric: tabular-nums; }
.results-list li { margin: .25rem 0; }
.score-control { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: .5rem; }
.score-control output { font-size: 2rem; text-align: center; font-variant-numeric: tabular-nums; }
.page-message { min-height: 1.5rem; margin: 1rem 0 0; color: var(--ink); }
.page-footer { margin-top: 2rem; }
.page-footer a { color: inherit; }
.signin-main { max-width: 28rem; padding-top: min(15vh, 6rem); }
.signin-main h1 { margin-bottom: .75rem; }
.signin-main details { margin-top: 2rem; }
.signin-main summary { margin-bottom: 1rem; }
@media (max-width: 640px) { .page-grid { grid-template-columns: 1fr; } .page-header { align-items: flex-start; } }
select { font: inherit; width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--hairline); border-radius: .375rem; background: var(--surface); color: var(--ink); }
select:focus-visible, .header-link:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-link { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.choice-group { border: 0; padding: 0; margin: 0 0 1rem; font-size: .875rem; }
.choice-group legend { padding: 0; margin-bottom: .375rem; }
.choice { display: flex; align-items: center; gap: .5rem; margin: 0; min-height: 44px; }
.choice input { width: 1.25rem; min-height: 0; height: 1.25rem; margin: 0; accent-color: var(--ink); }
.choice-row { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.people-list { list-style: none; margin: 0; padding: 0; }
.person { border-top: 1px solid var(--hairline); padding: 1rem 0; }
.person:first-child { border-top: 0; padding-top: 0; }
.person h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.person-role { margin: .125rem 0 .75rem; }
.person-items { list-style: none; margin: 0 0 .75rem; padding: 0; }
.person-items li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .25rem 0; font-size: .875rem; }
.person form { margin: 0 0 .75rem; }
/* Saved results page: one row per game, with edit, delete and undo icon buttons; Edit opens the correction form below the row. */
.saved-list { list-style: none; margin: 0 0 1rem; padding: 0; font-variant-numeric: tabular-nums; }
.saved-result { border-top: 1px solid var(--hairline); padding: .75rem 0; overflow-wrap: anywhere; }
.saved-result:first-child { border-top: 0; padding-top: 0; }
.saved-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; }
.saved-text { min-width: 0; }
.row-actions { display: flex; gap: .25rem; flex: none; }
.icon-btn { display: grid; place-items: center; width: 44px; padding: 0; border-color: transparent; background: transparent; }
.icon-btn[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
.icon-btn[aria-disabled="true"]:hover { background: transparent; color: var(--ink); border-color: transparent; }
#add-panel { margin-bottom: 1.25rem; }
.saved-result.deleted .saved-text { color: var(--road-major); text-decoration: line-through; }
.saved-result .help { margin: .25rem 0 .5rem; }
/* A <details> element's contents don't inherit the page's box-sizing in Chrome; set it again. */
.saved-form { margin-top: .75rem; box-sizing: border-box; }
/* Toggle switch: a labeled button with role="switch" (STYLE_GUIDE.md section 13). */
.switch { display: inline-flex; align-items: center; gap: .625rem; border-color: transparent; background: transparent; padding: .5rem .25rem; }
.switch:hover { background: transparent; color: var(--ink); border-color: transparent; }
.switch-track { position: relative; flex: none; width: 2.5rem; height: 1.5rem; border: 1px solid var(--ink); border-radius: 1rem; background: var(--surface); }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--ink); }
.switch[aria-checked="true"] .switch-track { background: var(--ink); }
.switch[aria-checked="true"] .switch-knob { left: calc(100% - 1.125rem - 2px); background: var(--paper); }
@media (prefers-reduced-motion: no-preference) { .switch-knob { transition: left .15s; } }
.switch:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
body[aria-busy="true"] button { cursor: wait; }
/* The exit (sign out) icon sits in the same top-right corner on every signed-in page, mirroring the menu button. */
.exit-btn { position: absolute; z-index: 20; top: max(.5rem, env(safe-area-inset-top)); right: max(.5rem, env(safe-area-inset-right)); }
#activity-list li { padding: .375rem 0; font-size: .875rem; border-top: 1px solid var(--hairline); }
#activity-list li:first-child { border-top: 0; }
/* The passkey re-check block ("Confirm with your passkey"), shown when changes need a recent passkey check. */
.reverify { margin: 1rem 0; padding: 1rem; border: 1px solid var(--hairline); border-radius: .5rem; background: var(--surface); }
.reverify[hidden] { display: none; }
.reverify p { margin: 0 0 .75rem; }
/* Text fields and selects fill their container, padding and border included (a narrow phone has no room for the extra 26px). */
input:not([type="checkbox"]), select, textarea { box-sizing: border-box; }
textarea { padding: .5rem .75rem; resize: vertical; }

/* Recovery codes (Profile): a readable two-column list, and printing shows only the codes. */
.recovery-codes { columns: 2; column-gap: 2rem; padding-left: 1.5rem; margin: 0.75rem 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.05rem; line-height: 1.9; }
@media print { body.printing-codes main > *:not(#profile-controls), body.printing-codes #profile-controls > div > *:not(#recovery-result), body.printing-codes .page-footer, body.printing-codes #recovery-result .button-row { display: none !important; } }

/* Disclosures (STYLE_GUIDE.md section 13): every <details> uses the Admin look, an outlined chevron that turns down
   when open, a 44px row and a visible focus ring. The chevron is drawn here, so pages add no icon markup. */
details > summary { display: flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; list-style: none; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; flex: none; width: 20px; height: 20px; background: var(--road-major);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
details[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: no-preference) { details > summary::before { transition: transform .15s ease; } }
/* Shared control and message variants. */
button.secondary { background: transparent; }
button.secondary:hover { background: var(--ink); }
button.danger { border-color: var(--ink); font-weight: 600; }
.page-message.error, .help.error { color: var(--ink); font-weight: 600; }
.page-message.error::before, .help.error::before { content: "Problem: "; }
.help a { color: inherit; text-decoration: underline; }
@media (max-width: 400px) { .recovery-codes { columns: 1; } }
.page-message.error:empty, .help.error:empty { display: none; }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
button.primary:hover { opacity: .85; }
.invited { margin: 1rem 0 1.5rem; }
.invited h2 { margin-bottom: .5rem; }
.steps { margin: 0 0 1rem; padding-left: 1.25rem; }
.steps li { margin: .375rem 0; }
.invited:focus { outline: none; }
/* A hidden label, form or section stays hidden even where a display rule (label { display: grid }) would show it. */
[hidden] { display: none !important; }
