:root {
  --background: #ffffff;
  --layer-01: #f4f4f4;
  --layer-02: #e8e8e8;
  --text-primary: #161616;
  --text-secondary: #525252;
  --border-subtle: #d6d6d6;
  --interactive: #0f62fe;
  --interactive-hover: #0043ce;
  --dark: #161616;
  --dark-layer: #262626;
  --blue-tint: #edf5ff;
  --danger: #da1e28;
  --max-width: 1280px;
  --gutter: clamp(1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.maker-claim { position: fixed; right: 0; bottom: 0; z-index: 20; border-top: 1px solid #525252; border-left: 1px solid #525252; padding: .35rem .65rem; background: var(--dark); color: #c6c6c6; font-size: .68rem; letter-spacing: .04em; }
a { color: var(--interactive); text-underline-offset: .2em; }
a:hover { color: var(--interactive-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--interactive); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 400; }
h1 { max-width: 15ch; margin-bottom: 2rem; font-size: clamp(2.6rem, 5vw, 4.7rem); line-height: 1.06; letter-spacing: -.028em; }
h2 { max-width: 20ch; margin-bottom: 1.5rem; font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.12; letter-spacing: -.018em; }
h3 { font-size: 1.2rem; line-height: 1.35; }
button, input { font: inherit; }
.container { width: min(100%, var(--max-width)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4rem, 8vw, 7rem); }
.band-gray { background: var(--layer-01); }
.band-dark { background: var(--dark); color: #fff; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: #fff; color: #000; }
.skip-link:focus { top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow, .system-label, .role-code, .sidebar-label {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .75rem;
  line-height: 1.3;
  letter-spacing: .08em;
}
.lead { max-width: 47rem; color: var(--text-secondary); font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.5; }

.site-header { position: sticky; top: 0; z-index: 20; background: var(--dark); color: #fff; border-bottom: 1px solid #393939; }
.header-inner { width: min(100%, var(--max-width)); min-height: 4rem; margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: stretch; justify-content: space-between; }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: #fff; text-decoration: none; font-size: 1.1rem; letter-spacing: .02em; }
.brand:hover { color: #fff; }
.brand-mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; background: var(--interactive); color: #fff; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-weight: 600; }
.site-nav { display: flex; align-items: stretch; }
.site-nav a, .back-link { display: flex; align-items: center; min-height: 4rem; padding-inline: 1rem; color: #c6c6c6; text-decoration: none; font-size: .875rem; }
.site-nav a:hover, .back-link:hover { background: var(--dark-layer); color: #fff; }
.site-nav .header-login { min-width: 9rem; justify-content: space-between; margin-left: .5rem; border-left: 1px solid #393939; color: #fff; }

.intro { padding-block: clamp(5rem, 9vw, 8rem); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(19rem, .85fr); gap: clamp(3rem, 8vw, 8rem); align-items: end; }
.actions { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; margin-top: 2.5rem; }
.button { min-height: 3rem; display: inline-flex; align-items: center; justify-content: space-between; gap: 2.5rem; border: 0; padding: .75rem 1rem; cursor: pointer; text-decoration: none; }
.button-primary { min-width: 15rem; background: var(--interactive); color: #fff; }
.button-primary:hover { background: var(--interactive-hover); color: #fff; }
.button-light { min-width: 15rem; background: #fff; color: var(--interactive); }
.button-light:hover { background: var(--blue-tint); color: var(--interactive-hover); }
.text-link { min-height: 3rem; display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.system-view { min-width: 0; align-self: start; }
.system-label { margin: 0 0 1.5rem; padding-top: .75rem; border-top: 1px solid var(--text-primary); }
.system-view ol { list-style: none; margin: 0; padding: 0; }
.system-view li { position: relative; display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid var(--border-subtle); }
.system-view li:not(:last-child)::after { content: "↓"; position: absolute; left: .65rem; bottom: -.65rem; z-index: 1; padding-inline: .15rem; background: #fff; color: var(--text-secondary); }
.system-view .node { color: var(--text-secondary); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.system-view strong { display: block; font-weight: 600; }
.system-view small { display: block; margin-top: .25rem; color: var(--text-secondary); }
.system-view .is-result { margin-top: .5rem; padding: 1rem; border: 0; background: var(--blue-tint); }
.system-view .is-result .node { color: var(--interactive); }
.fact-band { background: var(--interactive); color: #fff; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); }
.facts div { min-height: 9rem; padding: 1.5rem; border-right: 1px solid rgba(255,255,255,.35); }
.facts div:first-child { padding-left: 0; }
.facts div:last-child { border-right: 0; }
.facts strong { display: block; margin-bottom: .4rem; font-weight: 600; }
.facts span { display: block; max-width: 20rem; opacity: .9; font-size: .9rem; }
.section-heading { max-width: 52rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.section-heading > p:not(.eyebrow) { max-width: 44rem; color: var(--text-secondary); font-size: 1.125rem; }
.workflow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--border-subtle); background: var(--border-subtle); }
.workflow-grid article { min-height: 18rem; padding: 1.5rem; background: #fff; }
.workflow-grid article > span { display: block; margin-bottom: 4rem; color: var(--interactive); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .8rem; }
.workflow-grid h3 { font-weight: 600; }
.workflow-grid p { color: var(--text-secondary); }
.section-heading-light .eyebrow, .band-dark .eyebrow, .band-dark .role-code { color: #a8a8a8; }
.roles-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.role-table { border-top: 1px solid #6f6f6f; }
.role-table article { display: grid; grid-template-columns: .7fr 1fr 2fr; gap: 1.5rem; padding: 1.6rem 0; border-bottom: 1px solid #393939; }
.role-table h3 { margin: 0; color: #fff; }
.role-table p:last-child { color: #c6c6c6; }
.access-section { background: var(--interactive); color: #fff; }
.access-section .eyebrow { color: #d0e2ff; }
.access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.access-grid > div:last-child { max-width: 38rem; }
.access-grid .button { margin-top: 1.5rem; }
.site-footer { padding-block: 2rem; background: var(--dark); color: #c6c6c6; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.footer-inner p { margin: 0; font-size: .875rem; }

.login-main { min-height: calc(100vh - 4rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(28rem, .72fr); }
.login-context { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(3rem, 8vw, 7rem) var(--gutter); background: var(--dark); color: #fff; }
.login-context > div, .login-context .login-steps { width: min(100%, 44rem); margin-left: auto; }
.login-context .eyebrow { color: #a8a8a8; }
.login-context .lead { color: #c6c6c6; }
.login-steps { list-style: none; margin-top: 5rem; padding: 0; border-top: 1px solid #6f6f6f; }
.login-steps li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid #393939; }
.login-steps span { color: #a8a8a8; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .8rem; }
.login-panel { display: grid; place-items: center; padding: clamp(2rem, 7vw, 6rem) var(--gutter); background: #fff; }
.login-form-wrap { width: min(100%, 29rem); }
.login-form-wrap h2 { max-width: none; font-size: clamp(2rem, 3vw, 2.75rem); }
.form-stack { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.field { display: grid; gap: .5rem; }
.field label { font-size: .875rem; font-weight: 600; }
.field input { width: 100%; min-height: 3.25rem; border: 0; border-bottom: 1px solid #8d8d8d; padding: .75rem 1rem; background: var(--layer-01); color: var(--text-primary); }
.field input:hover { background: var(--layer-02); }
.field input:focus { border-bottom: 2px solid var(--interactive); }
.field-error { color: var(--danger); font-size: .8rem; }
.form-submit { width: 100%; margin-top: .5rem; }
.login-note { margin-top: 2rem; color: var(--text-secondary); font-size: .875rem; }
.message { padding: .875rem 1rem; border-left: 4px solid var(--danger); background: #fff1f1; }

.app-page { min-height: 100vh; background: var(--layer-01); }
.app-header { position: sticky; top: 0; z-index: 30; min-height: 4rem; display: flex; justify-content: space-between; align-items: stretch; background: var(--dark); color: #fff; border-bottom: 1px solid #393939; }
.app-brand { padding-inline: 1rem 2rem; border-right: 1px solid #393939; }
.app-user { min-width: 0; display: flex; align-items: stretch; }
.role-badge, .user-email, .header-action { display: flex; align-items: center; min-height: 4rem; padding-inline: 1rem; border-left: 1px solid #393939; }
.role-badge { color: #d0e2ff; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.user-email { color: #c6c6c6; font-size: .875rem; overflow-wrap: anywhere; }
.app-user form { display: flex; }
.header-action { border-top: 0; border-right: 0; border-bottom: 0; background: transparent; color: #fff; cursor: pointer; }
.header-action:hover { background: var(--dark-layer); }
.app-shell { min-height: calc(100vh - 4rem); display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
.app-sidebar { padding: 2rem 1rem; background: #fff; border-right: 1px solid var(--border-subtle); }
.sidebar-label { padding-inline: .75rem; }
.app-sidebar nav { display: grid; gap: 2px; }
.app-sidebar nav > * { min-height: 3.25rem; display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .5rem; padding: .75rem; color: var(--text-primary); text-decoration: none; font-size: .9rem; }
.app-sidebar nav > * > span { color: var(--text-secondary); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .75rem; }
.app-sidebar nav .is-active { border-left: 3px solid var(--interactive); background: var(--blue-tint); }
.app-sidebar nav .is-disabled { color: #8d8d8d; }
.app-sidebar small { font-size: .7rem; text-transform: uppercase; }
.dashboard-main { min-width: 0; padding: clamp(2rem, 5vw, 4rem); }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--text-primary); }
.dashboard-heading h1 { max-width: 22ch; margin-bottom: .5rem; font-size: clamp(2.25rem, 4vw, 3.75rem); }
.dashboard-heading .eyebrow { margin-bottom: 1rem; }
.dashboard-meta { margin: 0; color: var(--text-secondary); }
.station-contexts { display: flex; flex-wrap: wrap; gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); }
.station-contexts > span { min-width: 11rem; display: grid; padding: .65rem .8rem; background: #fff; }
.station-contexts small { color: var(--text-secondary); }
.context-button { flex: none; border: 1px solid var(--interactive); background: #fff; color: var(--interactive); }
.station-dashboard { margin-top: 2.5rem; padding-top: 1px; border-top: 3px solid var(--text-primary); }
.station-dashboard-heading { min-height: 5.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.station-dashboard-heading .eyebrow { margin-bottom: .35rem; }
.station-dashboard-heading h2 { max-width: none; margin: 0; font-size: 1.8rem; }
.recognition-state { padding: .35rem .6rem; background: var(--blue-tint); color: var(--interactive); font-size: .75rem; font-weight: 600; }
.context-status { min-width: 14rem; display: grid; gap: .4rem; padding: 1rem; background: var(--blue-tint); }
.context-status span { color: var(--interactive); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .7rem; letter-spacing: .07em; }
.dashboard-placeholder { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1.5rem; max-width: 56rem; margin-top: 3rem; padding: 2rem 0; border-bottom: 1px solid var(--border-subtle); }
.dashboard-placeholder .placeholder-index { color: var(--interactive); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.dashboard-placeholder h2 { max-width: none; margin-bottom: .75rem; font-size: 1.75rem; }
.dashboard-placeholder p { color: var(--text-secondary); }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2rem; border: 1px solid var(--border-subtle); background: var(--border-subtle); gap: 1px; }
.dashboard-kpis article { min-width: 0; min-height: 10rem; display: flex; flex-direction: column; padding: 1.25rem; background: #fff; }
.dashboard-kpis span { color: var(--text-secondary); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .7rem; letter-spacing: .07em; }
.dashboard-kpis strong { margin-top: auto; font-size: clamp(2rem, 3vw, 3.25rem); font-weight: 400; line-height: 1; }
.dashboard-kpis .kpi-time { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 1rem; line-height: 1.35; }
.dashboard-kpis small { margin-top: .75rem; color: var(--text-secondary); font-size: .75rem; }
.dashboard-workspace { display: grid; gap: 2rem; margin-top: 2rem; }
.dashboard-section { min-width: 0; background: #fff; border: 1px solid var(--border-subtle); }
.dashboard-section-heading { min-height: 6.5rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.dashboard-section-heading .eyebrow { margin-bottom: .4rem; }
.dashboard-section-heading h2 { max-width: none; margin: 0; font-size: 1.5rem; }
.dashboard-section-heading > a { flex: none; font-size: .875rem; }
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table { width: 100%; min-width: 40rem; border-collapse: collapse; }
.dashboard-table th { padding: .7rem 1rem; background: var(--layer-02); color: var(--text-secondary); font-size: .75rem; font-weight: 600; text-align: left; }
.dashboard-table td { padding: .9rem 1rem; border-top: 1px solid var(--border-subtle); vertical-align: top; }
.dashboard-table td strong, .dashboard-table td span { display: block; }
.dashboard-table td span { color: var(--text-secondary); font-size: .825rem; }
.dashboard-table tbody tr:hover { background: var(--blue-tint); }
.dashboard-time { color: var(--text-secondary); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .75rem; white-space: nowrap; }
.dashboard-rankings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.ranking-list { list-style: none; margin: 0; padding: 0; }
.ranking-list li { min-height: 4.25rem; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .75rem 1rem; border-top: 1px solid var(--border-subtle); }
.ranking-list li:first-child { border-top: 0; }
.ranking-position { color: var(--interactive); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .75rem; }
.ranking-list li > span:nth-child(2) { min-width: 0; display: grid; }
.ranking-list strong { overflow-wrap: anywhere; }
.ranking-list small { color: var(--text-secondary); }
.ranking-list b { font-size: .8rem; font-weight: 600; white-space: nowrap; }
.ranking-list .ranking-empty { display: block; min-height: 4.25rem; padding: 1.25rem 1rem; color: var(--text-secondary); font-size: .875rem; }
.dashboard-no-data { margin-top: 2rem; padding: 3rem 2rem; border: 1px solid var(--border-subtle); background: #fff; }
.dashboard-no-data h2 { max-width: 38rem; font-size: 1.75rem; }
.dashboard-no-data > p:not(.eyebrow) { max-width: 44rem; color: var(--text-secondary); }
.dashboard-no-data .button { width: fit-content; margin-top: 1rem; }
.dashboard-empty { min-height: 17rem; display: grid; place-items: center; margin-top: 2rem; border: 1px solid var(--border-subtle); color: #8d8d8d; }
.dashboard-empty span { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .75rem; letter-spacing: .08em; }
.dashboard-empty p { margin: -5rem 0 0; }
.station-dialog { position: relative; width: min(calc(100% - 2rem), 52rem); max-height: min(48rem, calc(100vh - 2rem)); margin: auto; border: 0; padding: 0; background: #fff; color: var(--text-primary); overflow: auto; }
.station-dialog::backdrop { background: rgba(22,22,22,.68); }
.dialog-close { position: absolute; top: 1rem; right: 1rem; display: inline-flex; gap: .45rem; align-items: center; border: 1px solid var(--border-subtle); padding: .5rem .65rem; background: #fff; color: var(--text-primary); font-size: .78rem; font-weight: 600; cursor: pointer; }
.dialog-close:hover, .dialog-close:focus-visible { border-color: var(--interactive); color: var(--interactive); }
.dialog-close span { font-size: 1.1rem; line-height: .75; }
.dialog-heading { padding: 2rem 8rem 1.5rem 2rem; border-bottom: 1px solid var(--border-subtle); }
.dialog-heading h2 { max-width: none; margin-bottom: .75rem; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.dialog-heading > p:last-child { max-width: 42rem; margin-bottom: 0; color: var(--text-secondary); }
.station-list { margin: 0; border: 0; padding: 0; }
.station-option { min-height: 4.5rem; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) minmax(8rem, .6fr); gap: 1rem; align-items: center; padding: 1rem 2rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; }
.station-option:hover { background: var(--layer-01); }
.station-option input { position: absolute; opacity: 0; pointer-events: none; }
.station-check { width: 1.25rem; height: 1.25rem; border: 2px solid #8d8d8d; }
.station-option input:checked + .station-check { border: 4px solid var(--interactive); background: #fff; }
.station-option input:disabled ~ * { opacity: .45; }
.station-option:has(input:focus-visible) { outline: 3px solid var(--interactive); outline-offset: -3px; }
.station-name { min-width: 0; display: grid; }
.station-name strong { overflow-wrap: anywhere; }
.station-name small { color: var(--text-secondary); }
.station-format { color: var(--text-secondary); font-size: .875rem; text-align: right; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; padding: 1.5rem 2rem 2rem; }
.empty-message { margin: 0; padding: 2rem; color: var(--text-secondary); }
.app-mobile-nav { display: none; }
.playlist-heading h1 { max-width: none; }
.playlist-filters {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) minmax(12rem, 1.15fr) repeat(2, minmax(8.5rem, .8fr)) minmax(8rem, .75fr);
  gap: 1px;
  margin-top: 2rem;
  border: 1px solid var(--border-subtle);
  background: var(--border-subtle);
}
.audit-filters {
  grid-template-columns: minmax(18rem, 1.5fr) minmax(14rem, 1fr);
}
.filter-field { min-width: 0; display: grid; align-content: start; gap: .5rem; padding: 1rem; background: #fff; }
.filter-field label { color: var(--text-secondary); font-size: .75rem; font-weight: 600; }
.filter-field input, .filter-field select {
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-bottom: 1px solid #8d8d8d;
  border-radius: 0;
  padding: .55rem .75rem;
  background: var(--layer-01);
  color: var(--text-primary);
  font: inherit;
}
.filter-field input:hover, .filter-field select:hover { background: var(--layer-02); }
.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  background: #fff;
}
.filter-actions .button { min-width: auto; min-height: 2.75rem; gap: 1rem; }
.filter-export { border: 1px solid var(--interactive); background: #fff; color: var(--interactive); }
.filter-export:hover { background: var(--blue-tint); color: var(--interactive-hover); }
.filter-reset { padding: .65rem 0; font-size: .875rem; }
.playlist-table-wrap { max-width: 100%; margin-top: 2rem; overflow-x: auto; background: #fff; border: 1px solid var(--border-subtle); }
.playlist-table { width: 100%; min-width: 48rem; border-collapse: collapse; }
.playlist-table th {
  padding: .75rem 1rem;
  background: var(--layer-02);
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 600;
  text-align: left;
}
.playlist-table td { padding: 1rem; border-top: 1px solid var(--border-subtle); vertical-align: top; }
.playlist-table tbody tr:hover { background: var(--blue-tint); }
.playlist-table td strong, .playlist-table td span { display: block; }
.playlist-table td > span { margin-top: .15rem; color: var(--text-secondary); font-size: .875rem; }
.playlist-time { white-space: nowrap; color: var(--text-secondary); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .78rem; }
.playlist-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1rem 0; font-size: .875rem; }
.playlist-pagination > :last-child { text-align: right; }
.playlist-empty { margin-top: 2rem; padding: 3rem 2rem; border: 1px solid var(--border-subtle); background: #fff; }
.playlist-empty h2 { max-width: 38rem; font-size: 1.75rem; }

.admin-main .dashboard-heading h1 { font-size: clamp(2rem, 3vw, 3rem); }
.admin-main .button-primary { min-width: auto; gap: 1rem; white-space: nowrap; }
.admin-tabs { display: flex; gap: 0; margin-bottom: 2rem; border-bottom: 1px solid var(--border-subtle); }
.admin-tabs a { min-height: 2.75rem; display: flex; align-items: center; padding: .65rem 1rem; color: var(--text-secondary); text-decoration: none; }
.admin-tabs a:hover { background: var(--layer-02); color: var(--text-primary); }
.admin-tabs .is-active { border-bottom: 3px solid var(--interactive); color: var(--interactive); font-weight: 600; }
.admin-notice { margin-top: 1rem; padding: .85rem 1rem; border-left: 4px solid var(--interactive); background: #fff; }
.admin-notice-warning { border-left-color: #b28600; background: #fff8e1; }
.admin-notice-success { border-left-color: #198038; background: #defbe6; }
.admin-station-table { min-width: 52rem; }
.monitoring-table { min-width: 52rem; table-layout: fixed; }
.monitoring-table th:nth-child(1) { width: 19%; }
.monitoring-table th:nth-child(2) { width: 15%; }
.monitoring-table th:nth-child(3) { width: 18%; }
.monitoring-table th:nth-child(4) { width: 34%; }
.monitoring-table th:nth-child(5) { width: 14%; }
.monitoring-times > span { display: flex; gap: .7rem; align-items: baseline; }
.monitoring-times > span + span { margin-top: .3rem; }
.monitoring-times b { margin-right: .7rem; flex: 0 0 10.5rem; font-size: .72rem; }
.monitoring-status { margin: 0; color: inherit; font-size: .78rem; font-weight: 600; }
.monitoring-status.is-active::before { background: #198038; }
.monitoring-status.is-waiting::before { background: #0f62fe; }
.monitoring-status.is-stale::before { background: #b28600; }
.monitoring-status.is-degraded::before,
.monitoring-status.is-misconfigured::before { background: var(--danger); }
.monitoring-detail, .monitoring-event-key, .monitoring-error {
  display: block;
  max-width: 18rem;
  margin-top: .35rem;
  color: var(--text-secondary);
  font-size: .72rem;
  overflow-wrap: anywhere;
}
.monitoring-time {
  color: var(--text-secondary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .72rem;
  white-space: nowrap;
}
.monitoring-table td:last-child .monitoring-time { white-space: normal; overflow-wrap: anywhere; }
.monitoring-error { color: var(--danger); }
.admin-station-table td > .admin-status { margin: 0; color: inherit; font-size: .78rem; font-weight: 600; }
.admin-status::before { content: ""; width: .5rem; height: .5rem; display: inline-block; margin-right: .45rem; background: #8d8d8d; }
.admin-status.is-positive::before { background: #198038; }
.admin-last-message { display: block; margin-top: .45rem; color: var(--text-secondary); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .72rem; white-space: nowrap; }
.admin-actions { min-width: 6.5rem; white-space: nowrap; }
.admin-actions a, .admin-actions form { display: block; }
.admin-actions form { margin-top: .4rem; }
.admin-actions button { border: 0; padding: 0; background: transparent; color: var(--danger); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.admin-form { max-width: 64rem; margin-top: 2rem; border: 1px solid var(--border-subtle); background: #fff; }
.admin-form fieldset { margin: 0; border: 0; border-bottom: 1px solid var(--border-subtle); padding: 0; }
.admin-form legend { width: 100%; padding: 1rem; background: var(--layer-02); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); }
.admin-form .filter-field { min-height: 7.25rem; }
.admin-form .has-error { border-left: 3px solid var(--danger); }
.admin-checks { display: flex; gap: 2rem; padding: 1.25rem 1rem; }
.admin-checks label { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.admin-checks input { width: 1.1rem; height: 1.1rem; }
.admin-form fieldset > .field-error { margin: 0; padding: 0 1rem 1rem; }
.admin-form-hint { margin: 0; padding: 1rem; color: var(--text-secondary); font-size: .875rem; }
.admin-station-access ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); list-style: none; }
.admin-station-access li { border-right: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.admin-station-access label { display: flex; align-items: center; gap: .65rem; min-height: 3rem; padding: .7rem 1rem; cursor: pointer; }
.admin-station-access input { width: 1.1rem; height: 1.1rem; }
.admin-role { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.admin-user-table { min-width: 54rem; }
.admin-form-actions { display: flex; align-items: center; gap: 1.5rem; padding: 1rem; }

.legal-links { display: flex; justify-content: center; border-top: 1px solid #525252; background: var(--dark); }
.legal-links a { min-height: 2rem; display: flex; align-items: center; padding: .35rem .65rem; color: #c6c6c6; font-size: .68rem; letter-spacing: .04em; text-decoration: none; }
.legal-links a + a { border-left: 1px solid #525252; }
.legal-links a:hover, .legal-links a:focus-visible { color: #fff; text-decoration: underline; }
.legal-body { min-height: 100vh; background: var(--layer-01); }
.legal-header { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); background: #fff; }
.legal-header .brand, .legal-header .brand:hover { color: var(--text-primary); }
.legal-header > a:last-child { min-height: 4rem; display: flex; align-items: center; padding-inline: var(--gutter); border-left: 1px solid var(--border-subtle); color: var(--text-primary); text-decoration: none; }
.legal-header > a:last-child:hover { background: var(--layer-02); }
.legal-main { width: min(100% - 2rem, 74rem); margin-inline: auto; padding: clamp(3rem, 7vw, 6rem) 0 7rem; }
.legal-document { max-width: 52rem; }
.legal-document h1 { margin-bottom: 3rem; }
.legal-document h2 { margin: 2.75rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); font-size: 1.25rem; }
.legal-document p, .legal-document li, .legal-document address { line-height: 1.7; }
.legal-document address { margin-bottom: 1.5rem; font-style: normal; }
.legal-document ul { padding-left: 1.25rem; }
.legal-updated { margin-top: -2rem; color: var(--text-secondary); font-size: .875rem; }

@media (max-width: 900px) {
  .intro-grid, .roles-layout { grid-template-columns: 1fr; }
  .system-view { max-width: 42rem; }
  .workflow-grid { grid-template-columns: 1fr; }
  .workflow-grid article { min-height: 0; }
  .workflow-grid article > span { margin-bottom: 2rem; }
  .role-table article { grid-template-columns: .6fr 1fr; }
  .role-table article > p:last-child { grid-column: 2; }
  .login-main { grid-template-columns: 1fr; }
  .login-context { min-height: 32rem; }
  .login-context > div, .login-context .login-steps { width: 100%; margin-left: 0; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-mobile-nav { display: flex; gap: 1px; margin: -1rem 0 2rem; border-bottom: 1px solid var(--border-subtle); }
  .app-mobile-nav a { min-height: 2.75rem; display: flex; align-items: center; padding: .5rem 1rem; color: var(--text-primary); text-decoration: none; }
  .app-mobile-nav .is-active { border-bottom: 3px solid var(--interactive); color: var(--interactive); }
  .playlist-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-rankings { grid-template-columns: 1fr; }
}

@media (max-width: 671px) {
  html { scroll-padding-top: 3.5rem; }
  h1 { font-size: 2.75rem; }
  .header-inner { min-height: 3.5rem; }
  .site-nav a:not(.header-login) { display: none; }
  .site-nav a, .back-link { min-height: 3.5rem; padding-inline: .75rem; }
  .site-nav .header-login { min-width: auto; margin: 0; }
  .section, .intro { padding-block: 4rem; }
  .facts, .access-grid { grid-template-columns: 1fr; }
  .facts div, .facts div:first-child { min-height: 0; padding: 1.25rem 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.35); }
  .facts div:last-child { border-bottom: 0; }
  .role-table article { grid-template-columns: 1fr; gap: .5rem; }
  .role-table article > p:last-child { grid-column: auto; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .login-context { min-height: auto; padding-block: 3rem; }
  .login-steps { margin-top: 3rem; }
  .login-panel { padding-block: 3rem; }
  .app-header { min-height: 3.5rem; }
  .app-brand { padding-inline: .75rem; border-right: 0; }
  .app-user { margin-left: auto; }
  .role-badge, .header-action { min-height: 3.5rem; padding-inline: .75rem; }
  .user-email { display: none; }
  .dashboard-main { padding: 2rem 1rem; }
  .app-mobile-nav { margin-top: -.75rem; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .context-status { width: 100%; }
  .playlist-filters { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
  .filter-actions { align-items: stretch; flex-direction: column; }
  .filter-actions .button { width: 100%; }
  .filter-reset { text-align: center; }
  .playlist-empty { padding: 2rem 1rem; }
  .admin-form-grid, .admin-station-access ul { grid-template-columns: 1fr; }
  .admin-checks, .admin-form-actions { align-items: stretch; flex-direction: column; }
  .admin-form-actions .button { width: 100%; }
  .dashboard-kpis { grid-template-columns: 1fr; }
  .dashboard-kpis article { min-height: 8.5rem; }
  .dashboard-section-heading { align-items: start; flex-direction: column; }
  .ranking-list li { grid-template-columns: 2rem minmax(0, 1fr); }
  .ranking-list b { grid-column: 2; }
  .dashboard-no-data { padding: 2rem 1rem; }
  .dashboard-no-data .button { width: 100%; }
  .dashboard-placeholder { grid-template-columns: 2rem minmax(0, 1fr); gap: .75rem; }
  .station-dialog { width: 100%; max-height: 100vh; }
  .dialog-close { top: .75rem; right: .75rem; }
  .dialog-heading { padding: 4rem 1rem 1rem; }
  .station-option { min-height: 4.75rem; grid-template-columns: 1.5rem minmax(0, 1fr); padding: .875rem 1rem; }
  .station-format { grid-column: 2; margin-top: -.75rem; text-align: left; }
  .dialog-actions { padding: 1rem; }
  .dialog-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
