/* RePSN website: Material Design 3. Colour roles, type scale, shape, motion and state-layer values come from
   tokens.css (generated from the brand seed #0070D1 by tools/build_m3_tokens.mjs). This file only composes them
   into M3 components. Notes: DESIGN.md. */

/* ---------------------------------------------------------------- fonts (self-hosted) */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-ext-400.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/roboto-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/roboto-latin-ext-500.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/roboto-mono-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Material Symbols Outlined"; font-style: normal; font-weight: 400; font-display: block; src: url("../fonts/material-symbols-outlined.woff2") format("woff2"); }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-plain);
  font-size: var(--md-sys-typescale-body-large-size); line-height: var(--md-sys-typescale-body-large-line-height);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
}
img, svg { max-width: 100%; }
a { color: var(--md-sys-color-primary); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
::selection { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 400; color: var(--md-sys-color-on-surface); }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
code, kbd, .mono { font-family: var(--md-ref-typeface-mono); font-size: 0.875em; letter-spacing: 0; }
code { background: var(--md-sys-color-surface-container-high); padding: 2px 6px; border-radius: var(--md-sys-shape-corner-extra-small); }
hr { border: 0; border-top: 1px solid var(--md-sys-color-outline-variant); margin: 24px 0; }
time { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 100; padding: 12px 16px; background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-radius: var(--md-sys-shape-corner-small); }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }

/* type scale */
.display-small { font-size: var(--md-sys-typescale-display-small-size); line-height: var(--md-sys-typescale-display-small-line-height); letter-spacing: var(--md-sys-typescale-display-small-tracking); font-weight: 400; }
.headline-large, h1 { font-size: var(--md-sys-typescale-headline-large-size); line-height: var(--md-sys-typescale-headline-large-line-height); font-weight: 400; }
.headline-medium { font-size: var(--md-sys-typescale-headline-medium-size); line-height: var(--md-sys-typescale-headline-medium-line-height); font-weight: 400; }
.headline-small, h2 { font-size: var(--md-sys-typescale-headline-small-size); line-height: var(--md-sys-typescale-headline-small-line-height); font-weight: 400; }
.title-large, h3 { font-size: var(--md-sys-typescale-title-large-size); line-height: var(--md-sys-typescale-title-large-line-height); font-weight: 400; }
.title-medium, h4 { font-size: var(--md-sys-typescale-title-medium-size); line-height: var(--md-sys-typescale-title-medium-line-height); font-weight: 500; letter-spacing: var(--md-sys-typescale-title-medium-tracking); }
.title-small { font-size: var(--md-sys-typescale-title-small-size); line-height: var(--md-sys-typescale-title-small-line-height); font-weight: 500; letter-spacing: var(--md-sys-typescale-title-small-tracking); }
.body-medium, small { font-size: var(--md-sys-typescale-body-medium-size); line-height: var(--md-sys-typescale-body-medium-line-height); letter-spacing: var(--md-sys-typescale-body-medium-tracking); }
.body-small { font-size: var(--md-sys-typescale-body-small-size); line-height: var(--md-sys-typescale-body-small-line-height); letter-spacing: var(--md-sys-typescale-body-small-tracking); }
.label-large { font-size: var(--md-sys-typescale-label-large-size); line-height: var(--md-sys-typescale-label-large-line-height); font-weight: 500; letter-spacing: var(--md-sys-typescale-label-large-tracking); }
.label-medium { font-size: var(--md-sys-typescale-label-medium-size); line-height: var(--md-sys-typescale-label-medium-line-height); font-weight: 500; letter-spacing: var(--md-sys-typescale-label-medium-tracking); }
.muted { color: var(--md-sys-color-on-surface-variant); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* icons (Material Symbols, subset; the glyph is the icon's codepoint, so no ligature text ever shows) */
.ms {
  font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  display: inline-block; width: 1em; height: 1em; flex: none; overflow: hidden; vertical-align: middle;
  font-variation-settings: "FILL" 0; -webkit-font-smoothing: antialiased; user-select: none; speak: never;
}
.ms-fill { font-variation-settings: "FILL" 1; }
.ms-18 { font-size: 18px; }
.ms-20 { font-size: 20px; }

/* state layer: every interactive surface gets ::before in its content colour */
.state { position: relative; isolation: isolate; }
.state::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard); pointer-events: none; }
.state:hover::before { opacity: var(--md-sys-state-hover-opacity); }
.state:focus-visible::before { opacity: var(--md-sys-state-focus-opacity); }
.state:active::before { opacity: var(--md-sys-state-pressed-opacity); }

/* ---------------------------------------------------------------- app shell */
.top-app-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; height: 64px; padding: 0 16px 0 4px;
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.brand { display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; color: var(--md-sys-color-on-surface); text-decoration: none; border-radius: var(--md-sys-shape-corner-full); }
.brand svg { width: 28px; height: 28px; }
.brand-name { font-size: var(--md-sys-typescale-title-large-size); line-height: var(--md-sys-typescale-title-large-line-height); font-weight: 500; }
.top-app-bar .spacer { flex: 1; }
.top-app-bar .account-chip { margin-left: 8px; }

.app { flex: 1; display: grid; grid-template-columns: 88px minmax(0, 1fr); }
.nav-rail { position: sticky; top: 64px; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 24px; height: calc(100vh - 64px); overflow-y: auto; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 80px; color: var(--md-sys-color-on-surface-variant); text-decoration: none; }
.rail-item .indicator { display: grid; place-items: center; width: 56px; height: 32px; border-radius: var(--md-sys-shape-corner-full); }
.rail-item .label { font-size: var(--md-sys-typescale-label-medium-size); line-height: var(--md-sys-typescale-label-medium-line-height); font-weight: 500; letter-spacing: var(--md-sys-typescale-label-medium-tracking); text-align: center; }
.rail-item:hover .indicator { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); }
.rail-item:focus-visible { outline: none; }
.rail-item:focus-visible .indicator { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.rail-item[aria-current="page"] { color: var(--md-sys-color-on-surface); }
.rail-item[aria-current="page"] .indicator { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.rail-item[aria-current="page"] .ms { font-variation-settings: "FILL" 1; }

.main { min-width: 0; padding: 24px 24px 64px; }
.content { max-width: 1040px; }
.measure { max-width: 72ch; }
.top-app-bar .nav-toggle { display: none; }

/* navigation drawer (modal, phones) */
.nav-drawer {
  margin: 0; padding: 12px; width: min(360px, 85vw); max-width: none; height: 100%; max-height: none; border: 0;
  border-radius: 0 var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0;
  background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-on-surface);
}
.nav-drawer::backdrop { background: rgb(0 0 0 / 0.32); }
.nav-drawer[open] { animation: drawer-in var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate); }
@keyframes drawer-in { from { transform: translateX(-100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px 16px; }
.drawer-section { padding: 18px 16px 8px; color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-title-small-size); font-weight: 500; }
.drawer-item { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px 0 16px; border-radius: var(--md-sys-shape-corner-full); color: var(--md-sys-color-on-surface-variant); text-decoration: none; font-size: var(--md-sys-typescale-label-large-size); font-weight: 500; letter-spacing: var(--md-sys-typescale-label-large-tracking); }
.drawer-item[aria-current="page"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.drawer-item[aria-current="page"] .ms { font-variation-settings: "FILL" 1; }
.drawer-item .trail { margin-left: auto; }

@media (max-width: 839px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .nav-rail { display: none; }
  .top-app-bar .nav-toggle { display: inline-grid; }
  .main { padding: 16px 16px 48px; }
  .top-app-bar { padding-right: 8px; }
}

/* tabs (primary) */
.tabs { display: flex; gap: 0; margin: -8px 0 24px; border-bottom: 1px solid var(--md-sys-color-outline-variant); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; height: 48px; padding: 0 16px; white-space: nowrap; color: var(--md-sys-color-on-surface-variant); text-decoration: none; font-size: var(--md-sys-typescale-title-small-size); font-weight: 500; letter-spacing: var(--md-sys-typescale-title-small-tracking); }
.tab[aria-current="page"] { color: var(--md-sys-color-primary); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--md-sys-color-primary); }

/* page header and sections */
.page-header { margin: 8px 0 32px; }
.page-header h1 { margin-bottom: 12px; }
.page-header p { max-width: 65ch; color: var(--md-sys-color-on-surface-variant); }
.section { margin-top: 48px; }
.section > h2, .section-title { margin-bottom: 16px; }
.stack > * + * { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 899px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
@media (max-width: 1099px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* banner (site notice) */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 24px; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border: 0; border-radius: var(--md-sys-shape-corner-full); cursor: pointer;
  font: 500 var(--md-sys-typescale-label-large-size)/var(--md-sys-typescale-label-large-line-height) var(--md-ref-typeface-plain);
  letter-spacing: var(--md-sys-typescale-label-large-tracking); text-decoration: none; white-space: nowrap;
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard); }
.btn:hover::before { opacity: var(--md-sys-state-hover-opacity); }
.btn:focus-visible::before { opacity: var(--md-sys-state-focus-opacity); }
.btn:active::before { opacity: var(--md-sys-state-pressed-opacity); }
.btn .ms { font-size: 18px; margin-left: -8px; }
.btn-filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.btn-filled:hover { box-shadow: var(--md-sys-elevation-1); }
.btn-tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.btn-outlined { background: transparent; color: var(--md-sys-color-primary); border: 1px solid var(--md-sys-color-outline); }
.btn-text { background: transparent; color: var(--md-sys-color-primary); padding: 0 12px; }
.btn-text .ms { margin-left: -4px; }
.btn-error { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.btn-error-outlined { background: transparent; color: var(--md-sys-color-error); border: 1px solid var(--md-sys-color-outline); }
.btn-small { height: 32px; padding: 0 16px; }
.btn-text.btn-small { padding: 0 8px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); box-shadow: none; cursor: default; border-color: transparent; }
.btn:disabled::before { opacity: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.icon-btn {
  position: relative; isolation: isolate; display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0;
  border-radius: var(--md-sys-shape-corner-full); background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; text-decoration: none;
}
.icon-btn::before { content: ""; position: absolute; inset: 4px; z-index: -1; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard); }
.icon-btn:hover::before { opacity: var(--md-sys-state-hover-opacity); }
.icon-btn:focus-visible::before, .icon-btn:active::before { opacity: var(--md-sys-state-focus-opacity); }

/* ---------------------------------------------------------------- cards */
.card { border-radius: var(--md-sys-shape-corner-medium); padding: 24px; background: var(--md-sys-color-surface); border: 1px solid var(--md-sys-color-outline-variant); --field-bg: var(--md-sys-color-surface); }
.card-filled { border-color: transparent; background: var(--md-sys-color-surface-container-highest); --field-bg: var(--md-sys-color-surface-container-highest); }
.card-elevated { border-color: transparent; background: var(--md-sys-color-surface-container-low); box-shadow: var(--md-sys-elevation-1); --field-bg: var(--md-sys-color-surface-container-low); }
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: var(--md-sys-typescale-title-large-size); line-height: var(--md-sys-typescale-title-large-line-height); margin-bottom: 8px; }
.card h3 { font-size: var(--md-sys-typescale-title-medium-size); line-height: var(--md-sys-typescale-title-medium-line-height); font-weight: 500; }
.card + .card { margin-top: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .release > .card + .card { margin-top: 0; }
.card-error { border-color: transparent; background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.card-error h2 { color: inherit; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------------------------------------------------------------- text fields (outlined) */
.field { position: relative; margin: 0 0 20px; --field-bg: inherit; }
.field-input {
  display: block; width: 100%; height: 56px; padding: 16px; margin: 0; border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small); background: transparent; color: var(--md-sys-color-on-surface);
  font: 400 var(--md-sys-typescale-body-large-size)/var(--md-sys-typescale-body-large-line-height) var(--md-ref-typeface-plain);
  letter-spacing: var(--md-sys-typescale-body-large-tracking); caret-color: var(--md-sys-color-primary);
}
textarea.field-input { height: auto; min-height: 120px; resize: vertical; }
select.field-input { appearance: none; padding-right: 48px; cursor: pointer; background: transparent; }
.field-select::after { content: "\e5c5"; font-family: "Material Symbols Outlined"; position: absolute; right: 12px; top: 16px; font-size: 24px; line-height: 1; color: var(--md-sys-color-on-surface-variant); pointer-events: none; }
.field-input:hover { border-color: var(--md-sys-color-on-surface); }
.field-input:focus { outline: none; border: 2px solid var(--md-sys-color-primary); padding: 15px; }
select.field-input:focus { padding-right: 47px; }
.field-label {
  position: absolute; left: 12px; top: 16px; padding: 0 4px; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--field-bg, var(--md-sys-color-surface)); color: var(--md-sys-color-on-surface-variant); pointer-events: none;
  font-size: var(--md-sys-typescale-body-large-size); line-height: var(--md-sys-typescale-body-large-line-height);
  transition: top var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard), font-size var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.field-input:focus + .field-label, .field-input:not(:placeholder-shown) + .field-label, select.field-input + .field-label, textarea.field-input + .field-label, .field-input[type="file"] + .field-label {
  top: -8px; font-size: var(--md-sys-typescale-body-small-size); line-height: var(--md-sys-typescale-body-small-line-height);
}
.field-input:focus + .field-label { color: var(--md-sys-color-primary); }
.field-support { display: block; padding: 4px 16px 0; color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-small-size); line-height: var(--md-sys-typescale-body-small-line-height); letter-spacing: var(--md-sys-typescale-body-small-tracking); }
.field-error .field-input, .field-error .field-input:hover, .field-error .field-input:focus { border-color: var(--md-sys-color-error); }
.field-error .field-label, .field-error .field-input:focus + .field-label, .field-error .field-support { color: var(--md-sys-color-error); }
.field-error .field-input { padding-right: 48px; }
.field-error::after { content: "\e000"; font-family: "Material Symbols Outlined"; position: absolute; right: 12px; top: 16px; font-size: 24px; line-height: 1; color: var(--md-sys-color-error); pointer-events: none; }
.field-select.field-error::after { content: "\e5c5"; }
.field-inline { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 24px; }
.field-inline .field { flex: 1; margin-bottom: 0; }
.field-inline .btn { height: 56px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.form-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 16px; color: var(--md-sys-color-on-surface-variant); }
.form-error { display: flex; gap: 12px; padding: 12px 16px; margin: 0 0 20px; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: var(--md-sys-typescale-title-small-size); font-weight: 500; }

/* checkbox and switch */
.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; cursor: pointer; }
.check input[type="checkbox"], input.checkbox {
  appearance: none; flex: none; width: 18px; height: 18px; margin: 3px 0 0; border: 2px solid var(--md-sys-color-on-surface-variant); border-radius: 2px; display: grid; place-items: center; cursor: pointer; background: transparent;
}
.check input[type="checkbox"]:checked, input.checkbox:checked { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
.check input[type="checkbox"]:checked::after, input.checkbox:checked::after { content: ""; width: 10px; height: 5px; margin-top: -3px; border: solid var(--md-sys-color-on-primary); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.check input:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.check input[type="radio"] { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--md-sys-color-primary); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
input.switch {
  appearance: none; position: relative; flex: none; width: 52px; height: 32px; margin: 0; border: 2px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest); cursor: pointer; transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
input.switch::after { content: ""; position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--md-sys-color-outline); transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard); }
input.switch:checked { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
input.switch:checked::after { left: 22px; top: 2px; width: 24px; height: 24px; background: var(--md-sys-color-on-primary); }

/* ---------------------------------------------------------------- chips and status */
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px; border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-small); color: var(--md-sys-color-on-surface-variant); background: transparent; font-size: var(--md-sys-typescale-label-large-size); font-weight: 500; letter-spacing: var(--md-sys-typescale-label-large-tracking); white-space: nowrap; text-decoration: none; }
a.chip:hover { background: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 8%, transparent); }
.chip .ms { font-size: 18px; margin-left: -8px; }
.chip-small { height: 24px; padding: 0 8px; border-radius: var(--md-sys-shape-corner-extra-small); font-size: var(--md-sys-typescale-label-medium-size); }
.chip-small .ms { margin-left: -2px; font-size: 16px; }
.chip-success { border-color: transparent; background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.chip-warning { border-color: transparent; background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); }
.chip-error { border-color: transparent; background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.chip-info { border-color: transparent; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status .ms { font-size: 20px; }
.status-up .ms { color: var(--md-sys-color-success); }
.status-degraded .ms, .status-maintenance .ms { color: var(--md-sys-color-warning); }
.status-down .ms { color: var(--md-sys-color-error); }
.status-unknown .ms { color: var(--md-sys-color-on-surface-variant); }

/* segmented buttons */
.segmented { display: inline-flex; border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-full); overflow: hidden; }
.segment { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; color: var(--md-sys-color-on-surface); text-decoration: none; font-size: var(--md-sys-typescale-label-large-size); font-weight: 500; letter-spacing: var(--md-sys-typescale-label-large-tracking); white-space: nowrap; }
.segment + .segment { border-left: 1px solid var(--md-sys-color-outline); }
.segment::before { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: 0; }
.segment:hover::before { opacity: var(--md-sys-state-hover-opacity); }
.segment[aria-current="true"], .segment[aria-current="page"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.segment .ms { font-size: 18px; }

/* ---------------------------------------------------------------- lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; gap: 16px; align-items: flex-start; padding: 12px 16px; min-height: 56px; }
.list-item + .list-item { border-top: 1px solid var(--md-sys-color-outline-variant); }
.list-item > .ms { color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.list-item .headline { display: block; color: var(--md-sys-color-on-surface); font-size: var(--md-sys-typescale-body-large-size); }
.list-item .supporting { display: block; color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); line-height: var(--md-sys-typescale-body-medium-line-height); letter-spacing: var(--md-sys-typescale-body-medium-tracking); }
.list-item .trailing { margin-left: auto; padding-left: 16px; color: var(--md-sys-color-on-surface-variant); }
.list-item > div { min-width: 0; }
a.list-item { color: inherit; text-decoration: none; }
a.list-item:hover { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); }
.card > .list { margin: -8px -8px; }

/* key / value */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; }
.kv dt { color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); line-height: 1.5rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 599px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 0; } .kv dd { margin-bottom: 12px; } }
.hash, .secret { font-family: var(--md-ref-typeface-mono); font-size: 0.8125rem; word-break: break-all; }
.cmd { display: block; padding: 12px 16px; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); font: 400 0.8125rem/1.6 var(--md-ref-typeface-mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- data tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface); }
.data { width: 100%; border-collapse: collapse; font-size: var(--md-sys-typescale-body-medium-size); line-height: var(--md-sys-typescale-body-medium-line-height); }
.data th { text-align: left; padding: 14px 16px; white-space: nowrap; color: var(--md-sys-color-on-surface-variant); font-weight: 500; font-size: var(--md-sys-typescale-title-small-size); letter-spacing: var(--md-sys-typescale-title-small-tracking); border-bottom: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface-container-low); }
.data td { padding: 12px 16px; border-bottom: 1px solid var(--md-sys-color-outline-variant); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: color-mix(in srgb, var(--md-sys-color-on-surface) 4%, transparent); }
.data td.num, .data th.num { text-align: right; }
.data form { margin: 0; }
.empty { padding: 24px; color: var(--md-sys-color-on-surface-variant); border: 1px dashed var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-medium); }
/* on phones, tables marked .stack-table become one card per row */
@media (max-width: 599px) {
  .stack-table thead { display: none; }
  .stack-table table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: 8px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { border: 0; padding: 4px 16px; }
  .stack-table td:first-child { font-weight: 500; }
}

/* ---------------------------------------------------------------- prose (guides, legal, news) */
.prose { max-width: 72ch; }
.prose h2 { margin: 40px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 8px; }
.prose li { margin-bottom: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose blockquote { margin: 16px 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--md-sys-color-outline-variant); color: var(--md-sys-color-on-surface-variant); }
.prose pre { padding: 16px; overflow-x: auto; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container-high); font: 400 0.8125rem/1.6 var(--md-ref-typeface-mono); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: var(--md-sys-typescale-body-medium-size); line-height: var(--md-sys-typescale-body-medium-line-height); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.prose th { color: var(--md-sys-color-on-surface-variant); font-weight: 500; }
.prose :target { scroll-margin-top: 80px; }
.prose .table-wrap { margin: 0 0 16px; }
.prose .table-wrap table { margin: 0; }
.note { display: flex; gap: 12px; padding: 16px; margin: 0 0 16px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-high); }
.note > .ms { color: var(--md-sys-color-on-surface-variant); }
.note > div > :last-child { margin-bottom: 0; }
.note-warning { background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); }
.note-warning > .ms { color: inherit; }
.toc { margin: 0 0 32px; }
.toc .list-item { min-height: 0; padding: 6px 0; }
.toc .list-item + .list-item { border: 0; }
ol.steps { padding-left: 0; list-style: none; counter-reset: step; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 20px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); font-size: var(--md-sys-typescale-label-large-size); font-weight: 500; }
ol.steps > li > h3 { margin: 4px 0 4px; font-size: var(--md-sys-typescale-title-medium-size); line-height: var(--md-sys-typescale-title-medium-line-height); font-weight: 500; }

/* ---------------------------------------------------------------- snackbars and dialogs */
.snackbar-host { position: fixed; left: 50%; bottom: 24px; z-index: 50; display: grid; gap: 8px; width: min(560px, calc(100vw - 32px)); transform: translateX(-50%); margin: 0; padding: 0; list-style: none; }
.snackbar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 4px 6px 16px; border-radius: var(--md-sys-shape-corner-extra-small); background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface); box-shadow: var(--md-sys-elevation-3); font-size: var(--md-sys-typescale-body-medium-size); line-height: var(--md-sys-typescale-body-medium-line-height); animation: snack-in var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate); }
.snackbar .msg { flex: 1; padding: 8px 0; }
.snackbar .icon-btn { color: var(--md-sys-color-inverse-on-surface); width: 40px; height: 40px; }
.snackbar-error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.snackbar-error .icon-btn { color: var(--md-sys-color-on-error-container); }
@keyframes snack-in { from { opacity: 0; transform: translateY(16px); } }
.dialog { padding: 24px; width: min(560px, calc(100vw - 48px)); border: 0; border-radius: var(--md-sys-shape-corner-extra-large); background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); box-shadow: var(--md-sys-elevation-3); }
.dialog::backdrop { background: rgb(0 0 0 / 0.32); }
.dialog h2 { font-size: var(--md-sys-typescale-headline-small-size); line-height: var(--md-sys-typescale-headline-small-line-height); margin-bottom: 16px; }
.dialog p { color: var(--md-sys-color-on-surface-variant); }
.dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* progress (linear, indeterminate) */
.progress-linear { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 4px; overflow: hidden; background: var(--md-sys-color-secondary-container); }
.progress-linear::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--md-sys-color-primary); border-radius: 2px; animation: progress 1.6s var(--md-sys-motion-easing-standard) infinite; }
@keyframes progress { to { left: 100%; } }

/* ---------------------------------------------------------------- page-specific layouts */
/* home */
.intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: start; margin: 16px 0 8px; }
.intro h1 { font-size: var(--md-sys-typescale-display-small-size); line-height: var(--md-sys-typescale-display-small-line-height); margin-bottom: 16px; }
.intro .lede { max-width: 60ch; color: var(--md-sys-color-on-surface-variant); }
.intro .btn-row { margin-top: 24px; }
.intro .meta { margin-top: 16px; color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); }
@media (max-width: 1099px) { .intro { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.status-card { padding: 16px 8px 8px; }
.status-card h2 { padding: 0 16px; font-size: var(--md-sys-typescale-title-medium-size); line-height: var(--md-sys-typescale-title-medium-line-height); font-weight: 500; }
.status-card .list-item { min-height: 48px; padding: 8px 16px; align-items: center; }
.status-card .foot { padding: 8px 16px 4px; font-size: var(--md-sys-typescale-body-small-size); color: var(--md-sys-color-on-surface-variant); }
.feature-list .list-item { padding: 16px 0; }
.game-card h3 { margin-bottom: 4px; }
.game-card .chip-row { margin: 12px 0 16px; }

/* status page */
.status-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.status-summary .ms { font-size: 32px; }

/* downloads */
.release { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.release-version { font-size: var(--md-sys-typescale-display-small-size); line-height: var(--md-sys-typescale-display-small-line-height); margin: 4px 0 8px; }
@media (max-width: 899px) { .release { grid-template-columns: minmax(0, 1fr); } }

/* auth pages */
.auth { display: grid; grid-template-columns: minmax(0, 448px) minmax(0, 1fr); gap: 48px; align-items: start; }
.auth .aside { color: var(--md-sys-color-on-surface-variant); max-width: 52ch; padding-top: 8px; }
.auth .aside h2 { font-size: var(--md-sys-typescale-title-large-size); line-height: var(--md-sys-typescale-title-large-line-height); }
@media (max-width: 899px) { .auth { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.narrow { max-width: 560px; }

/* account */
.identity { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.identity h1 { margin: 0; }
.avatar { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; overflow: hidden; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font-size: var(--md-sys-typescale-title-large-size); }
.avatar-large { width: 72px; height: 72px; font-size: var(--md-sys-typescale-headline-small-size); }
.avatar > * { grid-area: 1 / 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; position: relative; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.avatars label { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--md-sys-shape-corner-medium); border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface-variant); font: 500 0.75rem/1 var(--md-ref-typeface-mono); cursor: pointer; overflow: hidden; }
.avatars label > * { grid-area: 1 / 1; }
.avatars label img { width: 100%; height: 100%; object-fit: cover; }
.avatars input { position: absolute; opacity: 0; pointer-events: none; }
.avatars label:has(input:checked) { border: 3px solid var(--md-sys-color-primary); }
.avatars label:has(input:focus-visible) { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.danger { border-color: var(--md-sys-color-error); }
.danger h2 { color: var(--md-sys-color-error); }

/* staff */
.staff-note { display: flex; gap: 8px; align-items: center; margin: -12px 0 24px; color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 16px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container); }
.stat b { display: block; font-size: var(--md-sys-typescale-headline-medium-size); line-height: var(--md-sys-typescale-headline-medium-line-height); font-weight: 400; font-variant-numeric: tabular-nums; }
.stat span { color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); }
.netid { font-family: var(--md-ref-typeface-mono); font-size: 0.8125rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 16px; }

/* news */
.news-list .list-item { padding: 16px 0; }
.news-list time { display: block; color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); }
.news-list h3 { margin: 2px 0 4px; font-size: var(--md-sys-typescale-title-medium-size); line-height: var(--md-sys-typescale-title-medium-line-height); font-weight: 500; }
.news-list h3 a { color: var(--md-sys-color-on-surface); text-decoration: none; }
.news-list h3 a:hover { text-decoration: underline; }
.news-list p { margin: 0; color: var(--md-sys-color-on-surface-variant); }

/* errors */
.error-code { font-size: var(--md-sys-typescale-display-small-size); line-height: var(--md-sys-typescale-display-small-line-height); color: var(--md-sys-color-on-surface-variant); }

/* verification widget slot */
.verify { margin: 0 0 20px; min-height: 65px; }
.verify-dev { display: flex; align-items: center; gap: 8px; padding: 16px; border: 1px dashed var(--md-sys-color-outline); border-radius: var(--md-sys-shape-corner-extra-small); color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: auto; padding: 40px 24px 32px 112px; background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium-size); line-height: var(--md-sys-typescale-body-medium-line-height); }
.site-footer .cols { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 24px; max-width: 1040px; }
.site-footer h2 { margin: 0 0 12px; font-size: var(--md-sys-typescale-title-small-size); line-height: var(--md-sys-typescale-title-small-line-height); font-weight: 500; color: var(--md-sys-color-on-surface); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--md-sys-color-on-surface-variant); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer a:hover { color: var(--md-sys-color-on-surface); }
.site-footer .legal { max-width: 1040px; margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--md-sys-color-outline-variant); font-size: var(--md-sys-typescale-body-small-size); line-height: var(--md-sys-typescale-body-small-line-height); }
@media (max-width: 839px) { .site-footer { padding: 32px 16px 24px; } .site-footer .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .site-footer .about { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
dl.settings { margin: 12px 0 16px; padding: 16px 20px; }
.auth-page > .card, .auth-page > form.card { max-width: 480px; }
.auth .aside .list-item { padding-left: 0; }
.section-gap { margin-top: 32px; }
.support-error { color: var(--md-sys-color-error); font-size: var(--md-sys-typescale-body-small-size); line-height: var(--md-sys-typescale-body-small-line-height); padding: 4px 0 0 30px; }
.code-display { margin: 0 0 16px; font: 400 var(--md-sys-typescale-display-small-size)/var(--md-sys-typescale-display-small-line-height) var(--md-ref-typeface-mono); letter-spacing: 0.08em; }
.measure-wide { max-width: 880px; }
.card .table-wrap { margin: 8px 0 0; }
.card h3 { margin-top: 0; }
.card :is(p, div, form, ul, dl, details) + h3 { margin-top: 24px; }
.content > h2, .content > section > h2 { margin-top: 32px; }
.content > h2:first-child, .content > .staff-note + h1 + h2 { margin-top: 0; }
details.more { margin-top: 16px; }
details.more summary { cursor: pointer; color: var(--md-sys-color-primary); font-size: var(--md-sys-typescale-label-large-size); font-weight: 500; padding: 8px 0; }
details.more[open] summary { margin-bottom: 8px; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.status-card .list { margin: 4px 0 0; }
@media (max-width: 599px) { .intro h1 { font-size: var(--md-sys-typescale-headline-large-size); line-height: var(--md-sys-typescale-headline-large-line-height); } }
.card h2.release-label { margin: 0; color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-title-small-size); line-height: var(--md-sys-typescale-title-small-line-height); font-weight: 500; }
.account-chip[aria-current="page"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
@media (max-width: 599px) { .card { padding: 16px; } .avatars { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); } }
@media (max-width: 599px) { .status-card .trailing .body-small { display: none; } }
