/* YAN TV portal: the TV's "Cosmic Stream" colours (ADR-0024; cyan accent, user's decision of 2026-10-13), system fonts
   (nothing loaded from elsewhere). */
:root {
  --obsidian: #0b0d13;
  --charcoal: #131722;
  --elevated: #1c2230;
  --highlight: #262f42;
  --cyan: #00d2ff;
  --deep-cyan: #0369a1;
  --light-cyan: #7ef0ff;
  --ink: #e8eef8;
  --text: #ffffff;
  --text-medium: #cbd5e1;
  --text-low: #94a3b8;
  --error: #ffb4ab;
  --success: #22c55e;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--obsidian);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

.top {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--highlight);
}
/* The logo (liquid blob and play triangle) and the wordmark: "YAN" in Ink, "TV" in cyan. */
.logo { width: 26px; height: 26px; flex: none; background: url(favicon.svg) center / contain no-repeat; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--ink); flex: 1; }
.brand span { color: var(--cyan); }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px; }
footer { padding: 16px; text-align: center; font-size: 13px; }

h1 { font-size: 22px; margin: 8px 0 12px; }
.muted { color: var(--text-low); }
.error { color: var(--error); }

label { display: block; margin: 12px 0 4px; color: var(--text-medium); }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 4px 16px 4px 0; color: var(--text); }
fieldset { border: 0; padding: 0; margin: 12px 0 0; }
legend { color: var(--text-medium); padding: 0; }

input[type=text], input:not([type]), input[type=url], input[type=password], input[type=search] {
  width: 100%; padding: 12px; font-size: 16px;
  color: var(--text); background: var(--charcoal);
  border: 1px solid var(--highlight); border-radius: 10px;
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#tv-id { font-size: 28px; letter-spacing: .2em; text-transform: uppercase; text-align: center; font-variant-numeric: tabular-nums; }

button {
  padding: 11px 16px; font-size: 16px; border-radius: 10px; cursor: pointer;
  color: var(--text); background: var(--elevated); border: 1px solid var(--highlight);
}
button.primary { background: var(--cyan); color: var(--obsidian); border-color: var(--cyan); font-weight: 600; }
button.link { background: none; border: 0; color: var(--cyan); padding: 6px; }
button.danger { color: var(--error); }
button:disabled { opacity: .45; cursor: default; }

.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.row > button { flex: 1; }
.sticky { position: sticky; bottom: 0; background: var(--obsidian); padding: 10px 0; margin: 0; }

form > button.primary, #add { width: 100%; margin-top: 16px; }

.status { padding: 10px 12px; border-radius: 10px; background: var(--elevated); }
.status.bad { color: var(--error); }


.list { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--charcoal); border: 1px solid var(--highlight); border-radius: 14px; padding: 14px; }
.card h2 { font-size: 18px; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--cyan); color: var(--obsidian); font-weight: 700; }
.badge.new { background: var(--highlight); color: var(--cyan); }
.card p { margin: 2px 0; color: var(--text-medium); overflow-wrap: anywhere; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.card .actions button { flex: 1 1 auto; padding: 8px 10px; font-size: 14px; }

.tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.tabs button { flex: 1; white-space: nowrap; }
.tabs button[aria-selected=true] { border-color: var(--cyan); color: var(--cyan); }

.groups { display: flex; flex-direction: column; }
.group { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--highlight); margin: 0; color: var(--text); }
.group input { width: 22px; height: 22px; accent-color: var(--cyan); flex: none; }
.group .name { flex: 1; overflow-wrap: anywhere; }
.group .count { color: var(--text-low); font-size: 14px; }

/* The TV reached by its identifier (ADR-0022): on or off, and what waits for it. */
.tv-id { margin: 0 0 4px; color: var(--text-medium); }
.tv-id strong { color: var(--cyan); letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.tv-state { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--charcoal); border-left: 4px solid var(--success); }
.tv-state.off { border-left-color: var(--cyan); color: var(--text-medium); }
.tv-state .tv-note { display: block; margin-top: 6px; font-size: 0.92em; }
.queue { margin-top: 16px; }
.queue h2 { font-size: 16px; margin: 0 0 6px; color: var(--text-medium); }
.queue ul { margin: 0; padding-left: 20px; }
.queue li { margin: 4px 0; overflow-wrap: anywhere; }
.risk { font-size: 13px; margin-top: 16px; }

/* The remote (ADR-0032): the channel playing, the zapping, the restart; the channel picker. */
.remote { margin-bottom: 12px; border-color: var(--deep-cyan); }
.remote .now { color: var(--ink); font-size: 16px; }
.remote .now .programme { display: block; color: var(--text-medium); font-size: 14px; }
.channels { display: flex; flex-direction: column; }
.channel { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--highlight); border-radius: 0; background: none; text-align: left; width: 100%; }
.channel .num { min-width: 3ch; text-align: right; color: var(--cyan); font-variant-numeric: tabular-nums; flex: none; }
.channel .name { flex: 1; overflow-wrap: anywhere; }
.channel .grp { font-size: 13px; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel.playing { background: var(--elevated); }
.channel.playing .name { color: var(--cyan); font-weight: 600; }
