/* RHIS house style. Colours, type and radii follow brand/tokens.css in
   rhisijmuiden/rhis-website: nacht and wolk carry the page, koraal is the
   signal and appears only a few times per screen, status colours only for status. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
}
:root {
  --nacht: #14213D; --koraal: #FF6B57; --lucht: #9CC3FF; --wolk: #F6F7FB;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F3F9;
  --text: #14213D;
  --muted: #4F5B73;
  --border: #DCE1EB;
  --accent: #14213D;
  --accent-hover: #1B2B4D;
  --accent-soft: rgba(156, 195, 255, .3);
  --accent-text: #FFFFFF;
  --link: #B8392A;
  --tint: #14213D;
  --tile: #14213D;
  --chart: #14213D;
  --hover-border: #14213D;
  --side-bg: #FFFFFF;
  --side-text: #14213D;
  --side-muted: #4F5B73;
  --side-hover: #F1F3F9;
  --side-active: rgba(20, 33, 61, .07);
  --ok-bg: #E3F3EB; --ok: #1C8A57;
  --err-bg: #FBE8E8; --err: #C23434;
  --warn-bg: #FBF0DA; --warn: #A86B00;
  --shadow: 0 1px 2px rgba(20, 33, 61, .05), 0 1px 3px rgba(20, 33, 61, .06);
  --radius-sm: 6px; --radius-md: 10px; --radius: 16px;
  /* Chart series, validated for colour-blind separation on the surface. */
  --s1: #2F5FC7; --s2: #D9503C; --s3: #1F8F7A;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1626; --surface: #16213A; --surface-2: #1B2846; --text: #EEF1F7; --muted: #A3AEC4;
    --border: #26324D; --accent: #FF6B57; --accent-hover: #FF8371; --accent-soft: rgba(156, 195, 255, .14);
    --accent-text: #14213D; --link: #FF8A78; --tint: #9CC3FF; --tile: #0E1626; --chart: #9CC3FF; --hover-border: #9CC3FF;
    --side-bg: #16213A; --side-text: #EEF1F7; --side-muted: #A3AEC4; --side-hover: #1B2846; --side-active: rgba(156, 195, 255, .12);
    --ok-bg: #12301F; --ok: #4ACB8C; --err-bg: #3A1A20; --err: #FF7A7A;
    --warn-bg: #352A10; --warn: #F2B640;
    --shadow: none;
    --s1: #5A8BE6; --s2: #E8604C; --s3: #2FA088;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
:focus-visible { outline: 3px solid var(--koraal); outline-offset: 2px; }
::selection { background: var(--lucht); color: var(--nacht); }
a:hover { text-decoration: underline; }
h1, h2 { font-stretch: 125%; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 1.55rem; font-weight: 800; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1rem; font-weight: 700; margin: 0 0 .75rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: .05em .35em; border-radius: 5px; }
code.big { font-size: 1.05rem; display: inline-block; padding: .45em .75em; user-select: all; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.muted { color: var(--muted); }
small { color: var(--muted); font-weight: 400; }

/* App shell: sidebar + content */
.app main { margin-left: 248px; padding: 2rem 2.5rem 3rem; max-width: calc(1180px + 248px); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--border); padding: 1.4rem .8rem .8rem; overflow-y: auto; z-index: 20; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; color: var(--text); }
.brand-logo { display: block; height: 34px; width: auto; }
.logo-icon { display: block; width: 30px; height: 30px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--side-muted); }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: .7rem; color: var(--side-text); padding: 0 .65rem 1.1rem; margin-bottom: .3rem; border-bottom: 1px solid var(--border); line-height: 1.2; }
.sidebar .brand small { margin-top: .15rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem; border-radius: var(--radius-md); color: var(--side-text); font-weight: 500; font-size: .93rem; }
.sidebar nav a .icon { color: var(--side-muted); }
.sidebar nav a:hover { background: var(--side-hover); color: var(--side-text); text-decoration: none; }
.sidebar nav a.active { background: var(--side-active); font-weight: 700; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -.8rem; top: .45rem; bottom: .45rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--koraal); }
.sidebar nav a.active .icon { color: var(--side-text); }
.nav-group { margin: 1.1rem .65rem .35rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--side-muted); }
.account { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; padding: .6rem .4rem 0 .65rem; border-top: 1px solid var(--border); }
.account a { flex: 1; display: flex; align-items: center; gap: .6rem; color: var(--side-text); font-weight: 500; min-width: 0; }
.account a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account a:hover { color: var(--link); text-decoration: none; }
.account form { margin: 0; }
.powered { display: flex; align-items: center; gap: .5rem; padding: .55rem .4rem 0 .65rem; font-size: .75rem; color: var(--side-muted); }
.powered img { display: block; width: 20px; height: 20px; }
.powered strong { color: var(--side-text); font-weight: 800; letter-spacing: .02em; }
.powered:hover { text-decoration: none; color: var(--side-text); }
/* Language switch: under the account in the menu, in the footer elsewhere. */
.language { margin: 0; }
.language label { display: inline-flex; flex-direction: row; align-items: center; gap: .4rem; margin: 0; font-weight: 500; color: var(--side-muted, var(--muted)); }
.language select { width: auto; font-size: .8rem; padding: .25rem .5rem; }
.sidebar .language { padding: .6rem .4rem 0 .65rem; }
body:not(.app) > footer .language { display: block; margin-bottom: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sidebar footer { font-size: .72rem; color: var(--side-muted); padding: .6rem .65rem 0; }
.sidebar footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sidebar footer a:hover { color: var(--side-text); }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; cursor: pointer; }
.icon-button:hover { background: var(--side-hover); color: inherit; filter: none; }
.nav-toggle, .mobilebar, .scrim { display: none; }

/* Pages without a session: login, password change */
body:not(.app) > main { max-width: 680px; margin: 0 auto; padding: 4rem 16px 2rem; }
body:not(.app) > footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

/* Page header */
.titlebar { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.titlebar h1 { margin: 0; }
.subtitle { margin: .3rem 0 0; color: var(--muted); max-width: 46rem; }
.buttons { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.buttons form { margin: 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 440px; margin: 0 auto 1.25rem; }
.card.narrow.wide { max-width: 640px; }
.app .card.narrow { margin: 2rem auto; }
.card.empty { text-align: center; color: var(--muted); padding: 2.5rem 1.5rem; }
.card.highlight { border-color: var(--hover-border); box-shadow: 0 0 0 3px var(--accent-soft); }
.card h2:not(:first-child) { margin-top: 1.5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.card > p:last-child, .card > ul:last-child { margin-bottom: 0; }
.card > p:first-child { margin-top: 0; }
.section-title { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 1.75rem 0 .75rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1.25rem; align-items: start; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { display: flex; align-items: center; gap: 1rem; color: var(--text); margin: 0; padding: 1.1rem 1.25rem; }
.stat:hover { text-decoration: none; border-color: var(--hover-border); }
.stat .stat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--tile); color: var(--koraal); }
.stat .stat-icon .icon { width: 22px; height: 22px; }
.stat strong { display: block; font-size: 1.6rem; font-weight: 800; font-stretch: 125%; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: .6rem; }
.action { display: flex; align-items: center; gap: .65rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-weight: 500; background: var(--surface-2); }
.action .icon { color: var(--tint); }
.action:hover { border-color: var(--hover-border); text-decoration: none; }

/* Messages */
.flash { padding: .75rem 1rem; border-radius: var(--radius-md); margin: 0 0 1.25rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 1.1rem; }
form.inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 0; }
form.inline input:not(.small):not([type=checkbox]) { flex: 1; min-width: 10rem; }
form.inline select { width: auto; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input { flex: 1; min-width: 12rem; }
.filters select, .filters button { width: auto; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .93rem; }
label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 400; }
input, select, textarea { font: inherit; font-size: .93rem; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: .55rem .7rem; width: 100%; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio] { width: 1rem; height: 1rem; flex: none; margin: 0; padding: 0; accent-color: var(--nacht); }
fieldset label.check:has(input[type=radio]) { align-items: flex-start; margin: .3rem 0; }
fieldset label.check input[type=radio] { margin-top: .2rem; }
.categories-group + .categories-group { margin-top: 1rem; }
.categories-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .5rem; }
input[type=file] { padding: .45rem; background: var(--surface-2); }
input.small { width: 6rem; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hover-border); box-shadow: 0 0 0 4px var(--accent-soft); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); padding: .8rem 1rem; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
legend { font-weight: 500; font-size: .93rem; padding: 0 .3rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .25rem; }

/* Buttons */
button, .button { font: inherit; font-size: .93rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1.05rem; border-radius: var(--radius-md); border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-text); white-space: nowrap; line-height: 1.3; transition: background .15s, border-color .15s; }
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
button:disabled { opacity: .6; cursor: default; }
button:not(.secondary):not(.danger):disabled:hover { background: var(--accent); border-color: var(--accent); }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
button.secondary:hover, .button.secondary:hover { background: var(--surface); border-color: var(--hover-border); }
button.danger, .button.danger { background: var(--surface); color: var(--err); border-color: var(--border); }
button.danger:hover, .button.danger:hover { background: var(--err-bg); border-color: var(--err); }
button.sm, .button.sm { padding: .3rem .6rem; font-size: .83rem; font-weight: 600; border-radius: var(--radius-sm); box-shadow: none; }
button.sm .icon, .button.sm .icon { width: 15px; height: 15px; }
button.link, button.link:hover { background: none; border: 0; padding: 0; color: var(--link); font-weight: 400; }
form.stack > button { align-self: flex-start; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.card:not(.flush) th { background: none; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.card.flush tbody tr:hover td { background: var(--surface-2); }
td form { margin: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions > * { display: inline-flex; vertical-align: middle; margin-left: .3rem; }
td a.name { font-weight: 600; color: var(--text); }
td a.name:hover { color: var(--link); }
th.select, td.select { width: 1%; padding-right: 0; }
.card.flush tbody tr:has(td.select input:checked) td { background: var(--accent-soft); }
.bulk-bar { position: sticky; bottom: .75rem; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; padding: .7rem 1rem; border-color: var(--hover-border); box-shadow: 0 8px 24px rgba(20, 33, 61, .18); }
.bulk-bar.js:not(.active) { display: none; }
.bulk-count { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.bulk-count .icon { color: var(--koraal); }
.bulk-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.bulk-actions select { width: auto; padding: .3rem .6rem; font-size: .83rem; }
td.logo { width: 64px; }
td.logo img { max-width: 48px; max-height: 32px; display: block; }
table.radios td.logo img { width: 40px; height: 40px; max-height: none; object-fit: contain; border-radius: var(--radius-sm); }
td.logo .logo-placeholder { display: inline-flex; color: var(--muted); }
td.logo .logo-placeholder .icon { width: 22px; height: 22px; }
.chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.categories { display: flex; flex-wrap: wrap; gap: .4rem; }
.categories .category { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; padding: .25rem .65rem; border-radius: 999px; background: var(--surface-2); }
.categories .category .icon { width: 14px; height: 14px; color: var(--muted); }
.categories .category .count { font-size: .75rem; font-weight: 600; color: var(--muted); }
a.quiet { color: var(--muted); }
a.quiet:hover { color: var(--link); }
.tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.pager { display: flex; gap: .5rem; align-items: center; margin: .8rem 0; }
.url { font-size: .8rem; word-break: break-all; }
.now-playing { display: flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--link); margin-top: .2rem; }
.now-playing.muted { font-weight: 400; color: var(--muted); }
.now-playing .icon { width: 14px; height: 14px; flex: none; }
.now-playing-toggle { margin: 0 0 1rem; }
.health-msg { font-size: .8rem; max-width: 22rem; margin-top: .25rem; }
table.details th { text-transform: none; letter-spacing: 0; font-size: .9rem; width: 40%; background: none; color: var(--muted); font-weight: 500; }
table.details th, table.details td { padding: .5rem .5rem .5rem 0; }

.badge { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; border: 0; box-shadow: none; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--err-bg); color: var(--err); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
button.badge:hover { filter: brightness(.95); border: 0; }
button.badge.on:hover { background: var(--ok-bg); } button.badge.off:hover { background: var(--err-bg); } button.badge.warn:hover { background: var(--warn-bg); }

.copy { display: flex; gap: .5rem; }
.copy input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.copy button { width: auto; }
input.link-field { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; padding: .25rem .4rem; min-width: 14rem; }

/* Info page */
.buttons.wrap { flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1rem; }
.flash.update { margin-top: 1rem; }
.flash.update p { margin: 0 0 .75rem; }
.release .card-head { flex-wrap: wrap; margin-bottom: .5rem; }
.notes h3 { font-size: 1rem; font-stretch: 112%; margin: .75rem 0 .4rem; }
.notes h4 { font-size: .95rem; margin: .6rem 0 .3rem; }
.notes ul { margin: 0 0 .5rem; padding-left: 1.25rem; }
.notes p { margin: .4rem 0; }

/* iptv-org browser */
table.iptvorg td { vertical-align: top; }
table.iptvorg th label.check { font-weight: 600; }
label.check.option { align-items: flex-start; }
label.check.option input { margin-top: .25rem; }
label.check.option small { display: block; color: var(--muted); font-weight: 400; margin-top: .15rem; }
label.indent { margin-left: 1.75rem; }
.pre-line { white-space: pre-line; }
.error-text { color: var(--err); font-size: .85rem; margin-top: .25rem; }
label.check.stream { align-items: flex-start; font-weight: 400; margin: .2rem 0; }
label.check.stream input { margin-top: .25rem; }
@media (min-width: 900px) and (min-height: 820px) {
  .add-bar { position: sticky; bottom: 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, .1); }
}

/* Phones and small tablets: the sidebar slides in from the left */
@media (max-width: 900px) {
  .mobilebar { display: flex; align-items: center; gap: .5rem; position: sticky; top: 0; z-index: 10; padding: .55rem 16px .55rem 8px; background: var(--side-bg); color: var(--side-text); border-bottom: 1px solid var(--border); }
  .mobilebar .brand { color: var(--side-text); }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(20, 33, 61, .5); }
  .app main { margin-left: 0; padding: 1.25rem 16px 2.5rem; }
  h1 { font-size: 1.35rem; }
  .card { padding: 1.1rem 1rem; }
  .channels th:nth-child(5), .channels td:nth-child(5) { display: none; }
  td.actions .label { display: none; }
}
@media (max-width: 640px) {
  .channels th:nth-child(2), .channels td:nth-child(2), .channels th:nth-child(4), .channels td:nth-child(4) { display: none; }
  .radios th:nth-child(2), .radios td:nth-child(2), .radios th:nth-child(4), .radios td:nth-child(4), .radios .chip { display: none; }
  th, td { padding: .6rem .7rem; }
}

/* Edit pages */
.back { display: inline-block; font-size: .88rem; font-weight: 500; color: var(--muted); margin-bottom: .4rem; }
.back:hover { color: var(--link); text-decoration: none; }
.stack-card { display: flex; flex-direction: column; gap: 1.1rem; margin: 0; }
.stack-card h2 { margin: 0; }
.stack-card > p { margin: 0; }
.logo-icon.big { width: 52px; height: 52px; margin-bottom: 1.1rem; }

/* Mail */
.spaced { margin-top: 1.25rem; }
.crumb { margin: 0 0 .35rem; font-size: .85rem; }
.crumb a { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }
.crumb .icon { width: 15px; height: 15px; }
/* Views per day: one series in nacht (lucht in dark mode), bars with a 2px gap. */
.chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: .5rem; border-bottom: 1px solid var(--border); }
.chart .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 1px; }
.chart .bar span { display: block; width: 100%; min-height: 2px; background: var(--chart); border-radius: 4px 4px 0 0; }
.chart .bar:hover span { background: var(--koraal); }
.nowrap { white-space: nowrap; }
form.retention { align-items: flex-end; margin-bottom: .5rem; }
.chart-axis { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: .4rem; }
.beside-label { padding-top: 1.9rem; }

/* Dashboard viewers */
.badge.idle { background: var(--surface-2); color: var(--muted); }
.section-link { float: right; display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
.section-link .icon { width: 14px; height: 14px; }
.device { display: inline-block; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: var(--muted); }
@media (max-width: 640px) {
  .viewers th:nth-child(4), .viewers td:nth-child(4), .viewers th:nth-child(5), .viewers td:nth-child(5) { display: none; }
}
/* Microsoft sign-in on the login page */
.button.sso { width: 100%; padding: .65rem 1rem; }
.ms-logo { width: 18px; height: 18px; flex: none; }
p.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .83rem; margin: 1.1rem 0; }
p.divider::before, p.divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* Parts of a form that do not apply, hidden by a script */
[hidden] { display: none !important; }
td.nowrap { white-space: nowrap; }

/* Pages for subscribers (invite, welcome): the logo sits above the card */
.portal-head { display: flex; justify-content: center; padding: 3rem 16px 0; }
body .portal-head + main { padding-top: 1.5rem; }

/* Suggested replacements for failing streams */
.nav-count { margin-left: auto; min-width: 1.35rem; padding: .05rem .4rem; border-radius: 999px; background: var(--koraal); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.3; }
.suggestion h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.suggestion h2 a { color: inherit; }
.suggestion table { margin: 0; }
.suggestion td { vertical-align: middle; }
.suggestion td > div + div { margin-top: .2rem; }
.suggestion s { text-decoration-color: var(--err); }
a.suggested { display: inline-flex; align-items: center; gap: .3rem; margin-top: .2rem; font-size: .78rem; font-weight: 600; color: var(--warn); }
a.suggested .icon { width: 14px; height: 14px; }

/* Account pages for subscribers (/account) */
.card p.center { text-align: center; margin: 1.1rem 0 0; font-size: .9rem; }
.copy .copy-button { padding: .5rem .7rem; box-shadow: none; }
td span.name { font-weight: 600; }
.fields { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }

/* System resources */
.live { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--ok); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
.live.paused { color: var(--warn); }
.live.paused::before { animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }
.system-tiles { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.system-tiles .stat > div { flex: 1; min-width: 0; }
.system-tiles .stat strong { white-space: nowrap; }
.grid-2.wide { grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); }
.system-tiles .stat span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { display: block; height: 4px; margin-top: .55rem; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter b { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--chart); transition: width .4s; }
.meter b.raised { background: var(--warn); }
.meter b.high { background: var(--err); }
.linechart { position: relative; min-height: 190px; }
.linechart svg { display: block; width: 100%; height: auto; overflow: visible; }
.linechart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.linechart .base { stroke: var(--border); stroke-width: 1; }
.linechart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.linechart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.linechart .cross { stroke: var(--muted); stroke-width: 1; }
.linechart .dot { stroke: var(--surface); stroke-width: 2; }
.linechart rect:focus { outline: none; }
.line.s1 { stroke: var(--s1); } .line.s2 { stroke: var(--s2); } .line.s3 { stroke: var(--s3); }
.dot.s1 { fill: var(--s1); } .dot.s2 { fill: var(--s2); } .dot.s3 { fill: var(--s3); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); margin: -.4rem 0 .5rem; }
.legend span, .chart-tip div { display: inline-flex; align-items: center; gap: .4rem; }
.legend i, .chart-tip i { display: inline-block; width: 14px; height: 2px; border-radius: 2px; }
i.s1 { background: var(--s1); } i.s2 { background: var(--s2); } i.s3 { background: var(--s3); }
.chart-tip { position: absolute; top: 2rem; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 14px rgba(20, 33, 61, .12); padding: .45rem .65rem; font-size: .8rem; color: var(--muted); white-space: nowrap; z-index: 2; }
.chart-tip div { display: flex; }
.chart-tip strong { color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .tip-time { font-weight: 600; color: var(--text); margin-bottom: .2rem; }
dl.facts { display: grid; grid-template-columns: minmax(8rem, 45%) 1fr; gap: .45rem 1rem; margin: 0; font-size: .92rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
table.compact { margin-top: 1rem; font-size: .9rem; }
table.compact th, table.compact td { padding: .45rem .5rem; }

/* Account pages: guides, devices, packages */
.spaced-bottom { margin-bottom: 1.25rem; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.guide-card { display: flex; align-items: flex-start; gap: 1rem; margin: 0; color: var(--text); }
.guide-card:hover { text-decoration: none; border-color: var(--hover-border); }
.guide-card .stat-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--tile); color: var(--koraal); }
.guide-card .stat-icon .icon { width: 22px; height: 22px; }
.guide-card strong { display: block; font-weight: 700; margin-bottom: .2rem; }
.guide-card span { color: var(--muted); font-size: .88rem; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 1.25rem; align-items: start; }
.guide-layout aside .card + .card { margin-top: 1.25rem; }
.guide h3 { font-size: 1.05rem; margin: 1.5rem 0 .6rem; }
.guide h3:first-child { margin-top: 0; }
.guide p { line-height: 1.6; }
.guide ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0; }
.guide ol.steps li { counter-increment: step; position: relative; padding: .15rem 0 .85rem 2.6rem; line-height: 1.55; }
.guide ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--tile); color: #fff; font-weight: 700; font-size: .85rem; }
.guide ul li { margin-bottom: .35rem; line-height: 1.5; }
.guide code { overflow-wrap: anywhere; }
.guide .tip { padding: .75rem 1rem; border-left: 3px solid var(--koraal); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li + li { margin-top: .5rem; }
.guide-list a { display: inline-flex; align-items: center; gap: .5rem; }
form.device-form { margin-top: 1rem; align-items: flex-end; flex-wrap: wrap; }
.used-devices .badge { margin-left: .35rem; }
.package-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; align-items: start; }
.package-card { margin: 0; display: flex; flex-direction: column; }
.package-card.mine { border-color: var(--hover-border); box-shadow: 0 0 0 3px var(--accent-soft); }
.package-card .price { font-size: 1.35rem; font-weight: 800; font-stretch: 125%; margin: -.4rem 0 .6rem; }
.package-card .package-desc { color: var(--muted); margin-top: 0; }
.includes { list-style: none; padding: 0; margin: .25rem 0 1rem; }
.includes li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; }
.includes li .icon { color: var(--tint); }
.includes li.no { color: var(--muted); text-decoration: line-through; }
.includes li.no .icon { color: var(--muted); }
.includes li.new { color: var(--ok); font-weight: 600; }
.includes li.new .icon { color: var(--ok); }
.package-content { border-top: 1px solid var(--border); padding-top: .75rem; }
.package-content summary, details.request > summary { cursor: pointer; }
.package-content summary { font-weight: 600; color: var(--link); }
.package-content h3 { font-size: .92rem; margin: 1rem 0 .3rem; }
.channel-names { font-size: .88rem; color: var(--muted); margin: 0; line-height: 1.55; }
.package-action { margin-top: 1rem; }
details.request > summary { list-style: none; display: inline-flex; }
details.request > summary::-webkit-details-marker { display: none; }
details.request[open] > summary { display: none; }
.shares { list-style: none; padding: 0; margin: 0; }
.shares li + li { margin-top: 1rem; }
.shares li > div { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.chart.hours { height: 120px; }
@media (max-width: 860px) {
  .guide-layout { grid-template-columns: 1fr; }
}
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.5; }
.icon-choice { display: flex; gap: .5rem; flex-wrap: wrap; }
.icon-choice label.check { padding: .4rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.icon-choice label.check:has(input:checked) { border-color: var(--hover-border); background: var(--accent-soft); }
.request-card h2 a { color: inherit; }
.request-card .form-actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  .my-devices th:nth-child(3), .my-devices td:nth-child(3),
  .used-devices th:nth-child(2), .used-devices td:nth-child(2),
  .used-devices th:nth-child(3), .used-devices td:nth-child(3),
  .used-devices th:nth-child(4), .used-devices td:nth-child(4) { display: none; }
  .my-devices code, .used-devices code { white-space: nowrap; font-size: .8rem; }
}

/* Web player of the account pages. The stage is nacht in both themes, so
   video always sits on a dark ground; koraal marks what plays. */
.player-card { padding: 0; overflow: hidden; max-width: 1000px; }
.player-stage { position: relative; background: var(--nacht); aspect-ratio: 16 / 9; }
.player-stage video { display: block; width: 100%; height: 100%; background: var(--nacht); }
.player-card.is-radio .player-stage { aspect-ratio: auto; min-height: 220px; }
.radio-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2rem 1rem 1.5rem; color: var(--wolk); }
.radio-stage[hidden] { display: none; }
.radio-logo { display: grid; place-items: center; width: 132px; height: 132px; border-radius: var(--radius); background: var(--wolk); overflow: hidden; }
.radio-logo img { width: 100%; height: 100%; object-fit: contain; }
.radio-stage audio { width: min(100%, 420px); }
.radio-wave { display: flex; align-items: flex-end; gap: 4px; height: 22px; }
.radio-wave i { width: 4px; height: 100%; border-radius: 2px; background: var(--koraal); animation: wave 1.1s ease-in-out infinite; transform-origin: bottom; }
.radio-wave i:nth-child(2) { animation-delay: -.9s; }
.radio-wave i:nth-child(3) { animation-delay: -.6s; }
.radio-wave i:nth-child(4) { animation-delay: -.3s; }
.radio-wave i:nth-child(5) { animation-delay: -.75s; }
@keyframes wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.player-card.has-msg .radio-wave { visibility: hidden; }
.player-msg { position: absolute; inset: auto 1rem 1rem; margin: 0; padding: .7rem 1rem; border-radius: var(--radius-md); background: rgba(20, 33, 61, .92); color: var(--wolk); border: 1px solid rgba(255, 255, 255, .15); font-size: .93rem; }
.player-msg[hidden] { display: none; }
.player-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; }
.player-info h2 { margin: 0 0 .15rem; font-size: 1.1rem; }
.player-info p { margin: 0; font-size: .9rem; min-height: 1.4em; }
.watch-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; padding: .3rem; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); width: fit-content; max-width: 100%; }
.watch-tabs button { background: transparent; border-color: transparent; color: var(--muted); padding: .45rem .9rem; font-weight: 600; }
.watch-tabs button:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.watch-tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow); }
.watch-tabs button[aria-selected="true"] .icon { color: var(--koraal); }
.watch-tabs .count { font-size: .75rem; font-weight: 600; color: var(--muted); }
.watch-filters select[hidden] { display: none; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem .85rem; }
.tile, .poster { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; padding: .55rem; white-space: normal; text-align: left; font-weight: 600; font-size: .88rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.tile:hover, .poster:hover { background: var(--surface); border-color: var(--hover-border); }
.tile.playing, .poster.playing { border-color: var(--koraal); box-shadow: 0 0 0 1px var(--koraal); }
.tile-logo, .poster-art { position: relative; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.tile-logo { aspect-ratio: 16 / 10; padding: .6rem; }
.tile.radio .tile-logo { aspect-ratio: 1; padding: 0; }
.tile-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile.radio .tile-logo img { width: 100%; height: 100%; object-fit: cover; }
.poster-art { aspect-ratio: 2 / 3; }
.poster-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-logo b, .poster-art b { padding: .5rem; font-size: .8rem; font-weight: 700; color: var(--muted); text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tile-logo img ~ b, .poster-art img ~ b { display: none; }
.tile-name, .poster-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.playing .tile-name::before, .poster.playing .poster-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .4rem; border-radius: 50%; background: var(--koraal); vertical-align: 1px; }
.poster { padding: 0; background: transparent; border: 0; box-shadow: none; gap: .35rem; }
.poster:hover { background: transparent; }
.poster:hover .poster-art { outline: 2px solid var(--hover-border); outline-offset: 2px; }
.poster.playing { box-shadow: none; }
.poster-meta { font-size: .78rem; font-weight: 500; color: var(--muted); margin-top: -.3rem; }
.watch-panel .more { text-align: center; margin-top: 1.25rem; }
.watch-panel .more[hidden], .watch-panel .empty[hidden] { display: none; }
.watch-panel .empty { margin-top: .5rem; }
.series-head { display: flex; gap: 1.25rem; align-items: flex-start; margin: .5rem 0 1rem; }
.series-poster { width: 120px; flex: none; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.series-poster[hidden] { display: none; }
.series-head h2 { font-size: 1.25rem; margin-bottom: .35rem; }
.series-head label { max-width: 14rem; }
.series-head label[hidden] { display: none; }
.series-plot { font-size: .9rem; }
.episodes { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.episode { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; text-align: left; white-space: normal; padding: .7rem .9rem; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.episode:hover { background: var(--surface-2); border-color: var(--hover-border); }
.episode.playing { border-color: var(--koraal); }
.episode strong { font-weight: 700; }
.episode small { grid-column: 1 / -1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) {
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .55rem; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .8rem .6rem; }
  .player-card { margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .player-info { padding: .85rem 16px; }
  .watch-tabs { width: 100%; }
  .watch-tabs button { flex: 1; padding: .45rem .5rem; }
  .watch-tabs .count { display: none; }
  .series-poster { width: 84px; }
}
@media (prefers-reduced-motion: reduce) { .radio-wave i { animation: none; transform: scaleY(.6); } }
/* My channels and parental controls */
.card-head h2 .icon, .card > h2 .icon { vertical-align: -3px; color: var(--tint); }
button.icon-only { padding: .3rem .4rem; }
.row-actions { display: flex; align-items: center; gap: .3rem; flex: none; }
.row-actions form { margin: 0; }
.fav-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.fav-list li { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.fav-list li:last-child { border-bottom: 0; }
.fav-list .num { width: 1.6rem; text-align: right; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ch-logo { display: inline-grid; place-items: center; width: 44px; height: 30px; flex: none; color: var(--muted); }
.ch-logo img { max-width: 44px; max-height: 30px; object-fit: contain; }
.ch-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fav-toggle { padding-top: .75rem; border-top: 1px solid var(--border); }
.group-bar { align-items: center; margin: 1.75rem 0 .75rem; }
.group-bar .section-title { margin: 0; }
label.search { flex-direction: row; align-items: center; gap: .4rem; position: relative; }
label.search .icon { position: absolute; left: .65rem; color: var(--muted); }
label.search input { padding-left: 2.1rem; min-width: 14rem; }
.kind-title { display: flex; align-items: center; gap: .45rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1.25rem 0 .6rem; }
.group { padding: .9rem 1.25rem; margin-bottom: .6rem; }
.group.is-hidden { background: var(--surface-2); }
.group.is-hidden .group-title strong { color: var(--muted); }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.group-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
a.badge:hover { text-decoration: none; filter: brightness(.95); }
.group details { margin-top: .4rem; }
.group summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--link); }
.channel-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .25rem 1rem; }
.channel-list li { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.channel-list form { margin: 0; }
button.star { background: none; border: 0; box-shadow: none; padding: .3rem; color: var(--muted); border-radius: 50%; }
button.star:hover { background: var(--surface-2); color: var(--koraal); }
button.star .icon { width: 20px; height: 20px; }
button.star.on { color: var(--koraal); }
button.star.on .icon { fill: currentColor; }
.lock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .45rem .75rem; }
label.lock-item { padding: .45rem .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
label.lock-item:has(input:checked) { border-color: var(--warn); background: var(--warn-bg); }
label.lock-item small { margin-left: .2rem; }
label.age { max-width: 22rem; margin-bottom: .5rem; }
.lock-status { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.lock-status .badge { font-size: .85rem; padding: .3rem .75rem; }
.lock-status .badge::before { display: none; }
.lock-status .badge .icon { width: 15px; height: 15px; }
.status-card .buttons { margin-bottom: .5rem; }
.pin-card { text-align: center; }
.pin-card .lock-status { justify-content: center; margin-bottom: 1.25rem; }
.pin-card form.stack { text-align: left; }
.pin-card form.stack > button { align-self: stretch; }
.pin-card .spaced button { width: 100%; }
.pin-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--tile); color: var(--koraal); margin-bottom: 1rem; }
.pin-icon .icon { width: 26px; height: 26px; }
ol.how { padding-left: 1.2rem; margin: 0; }
ol.how li { margin-bottom: .6rem; line-height: 1.55; }
.admin-prefs .fav-names { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0 1rem; }
@media (max-width: 640px) {
  label.search input { min-width: 0; width: 100%; }
  .group-bar .buttons, label.search { width: 100%; }
  .row-actions .label { display: none; }
}
