/* ==========================================================================
   AirTimes — stylesheet
   Dark, calm and fast: no web fonts, no frameworks, one file.
   ========================================================================== */

:root {
  --bg: #070b14;
  --bg-soft: #0b1220;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf7;
  --text-muted: #93a1b8;
  --text-dim: #6b7a92;
  --accent: #38bdf8;
  --accent-2: #f472b6;
  --accent-ink: #04121f;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -24px rgba(2, 6, 23, 0.95);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, rgba(244, 114, 182, 0.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .35em; letter-spacing: -0.015em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code { font-family: var(--mono); font-size: .86em; background: rgba(255,255,255,.06); padding: .12em .38em; border-radius: 6px; }

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.count { font-size: .78rem; color: var(--text-dim); background: rgba(255,255,255,.06); padding: .1em .5em; border-radius: 999px; }
.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 32px) 60px; }
.wrap-narrow { max-width: 980px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; gap: 18px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-text small { color: var(--text-dim); font-size: .74rem; }

.tabs { display: flex; gap: 4px; margin-left: auto; background: rgba(255,255,255,.04); padding: 4px; border-radius: 999px; border: 1px solid var(--border); }
.tab { padding: .42rem .95rem; border-radius: 999px; color: var(--text-muted); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.05); text-decoration: none; }
.tab.is-active { color: var(--accent-ink); background: linear-gradient(180deg, #7dd3fc, var(--accent)); font-weight: 600; }

.topbar-search { display: flex; align-items: center; gap: 8px; padding: .4rem .7rem; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text-dim); }
.topbar-search input { background: none; border: 0; color: var(--text); font: inherit; width: 150px; }
.topbar-search input:focus { outline: none; }
.topbar-search:focus-within { border-color: var(--border-strong); color: var(--accent); }
.topbar-stats { display: flex; gap: 14px; font-size: .8rem; color: var(--text-dim); }
.topbar-stats strong { color: var(--text); font-size: .95rem; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.05); color: var(--text); font: inherit; font-size: .9rem;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .12s;
}
.btn:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #7dd3fc, var(--accent)); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: linear-gradient(180deg, #a5e2fd, #4cc7f9); }
.btn-small { padding: .32rem .7rem; font-size: .82rem; }
.btn-danger { color: #ffd7d7; border-color: rgba(248,113,113,.4); }
.btn-danger:hover { background: rgba(248,113,113,.16); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.04);
  color: var(--text); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }

/* --------------------------------------------------------------------------
   Calendar bar (month navigation, next-up, active filter)
   -------------------------------------------------------------------------- */
.calendar-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.month-nav { display: flex; align-items: center; gap: 10px; }
/* The heading keeps the same width every month ("May 2026" … "September 2026"),
   so the arrows either side of it never move. */
.month-nav h1 {
  margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  min-width: 8.2em; text-align: center; white-space: nowrap;
}
.calendar-summary { margin-left: auto; font-size: .9rem; }
.next-up { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); padding: .4rem .8rem; border-radius: 999px; }

/* The calendar can still be filtered to one show (index.php?show=<slug>), but
   with hundreds of shows a row of chips is unreadable — so the active filter
   is shown as a single pill with a way back out. */
.filter-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: .32rem .5rem .32rem .8rem; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--border-strong); background: var(--surface-strong);
}
.filter-pill a {
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; color: var(--text-muted); text-decoration: none; font-size: 1rem; line-height: 1;
}
.filter-pill a:hover { background: rgba(255,255,255,.12); color: var(--text); text-decoration: none; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--show-color, #64748b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--show-color, #64748b) 22%, transparent); flex: none; }

/* --------------------------------------------------------------------------
   Calendar grid
   -------------------------------------------------------------------------- */
.calendar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calendar-head, .calendar-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-head { border-bottom: 1px solid var(--border); background: rgba(255,255,255,.025); }
.calendar-head-cell { padding: .55rem .7rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 600; }
.wd-long { display: inline; }
.wd-short { display: none; }

.day {
  min-height: 128px; padding: 8px 9px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.006);
}
.day:nth-child(7n) { border-right: 0; }
.day.is-weekend { background: rgba(255,255,255,.02); }
.day.is-outside { opacity: .45; }
.day.is-today { background: radial-gradient(600px 200px at 50% 0%, rgba(56,189,248,.14), transparent 70%); box-shadow: inset 0 0 0 1px rgba(56,189,248,.35); }
.day-head { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.day-num { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.day-month { display: none; }
.is-today .day-num { color: var(--accent); }
.day-count { font-size: .68rem; color: var(--text-dim); }
.day-body { display: flex; flex-direction: column; gap: 4px; }

/* Episode chip: the coloured pill used on the calendar */
.chip {
  position: relative;
  display: flex; flex-direction: column; gap: 0; width: 100%; text-align: left;
  padding: .34rem .55rem; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--show-color, #64748b); color: var(--show-contrast, #fff);
  font: inherit; font-size: .76rem; line-height: 1.25;
  box-shadow: 0 1px 0 rgba(0,0,0,.25) inset, 0 4px 12px -8px rgba(0,0,0,.9);
  transition: transform .12s, filter .15s;
}
.chip:hover { transform: translateY(-1px); filter: brightness(1.08); }
.chip-show { font-weight: 700; letter-spacing: -0.01em; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ep { display: block; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ep b { font-weight: 700; opacity: .95; }
.chip-inline { width: auto; min-width: 150px; }

/* Watched tick. It sits in the corner of a chip as an inverted badge, so it
   stays legible on any show colour; episode rows show it after the title. */
.tick { display: none; }
.chip.is-watched { padding-right: 1.75rem; }
.chip.is-watched .tick {
  display: grid; place-items: center; position: absolute; top: 3px; right: 3px;
  width: 15px; height: 15px; border-radius: 50%; line-height: 1;
  font-size: .62rem; font-weight: 800;
  background: var(--show-contrast, #fff); color: var(--show-color, #111827);
}

/* "To be announced" panel */
.tba-panel { margin-top: 20px; }
.tba-panel h2 { display: flex; align-items: center; gap: .5rem; }
.tba-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------------------
   Panels, empty states, flashes
   -------------------------------------------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px clamp(16px, 2.5vw, 26px); margin-bottom: 20px; box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.lead { color: var(--text-muted); max-width: 78ch; }
.empty-state { text-align: center; padding: 44px 24px; }
.empty-state h2 { font-size: 1.3rem; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 0; }
.empty-search { text-align: center; }

.flash { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid var(--border-strong); background: var(--surface); }
.flash-ok { border-color: rgba(52,211,153,.4); }
.flash-warn { border-color: rgba(251,191,36,.4); }
.flash-error { border-color: rgba(248,113,113,.45); }

/* --------------------------------------------------------------------------
   Shows A–Z
   -------------------------------------------------------------------------- */
.list-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.search-field {
  display: flex; align-items: center; gap: 10px; flex: 1 1 320px;
  padding: .6rem 1rem; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-dim);
}
.search-field:focus-within { border-color: var(--border-strong); color: var(--accent); }
.search-field input { flex: 1; background: none; border: 0; color: var(--text); font: inherit; }
.search-field input:focus { outline: none; }
.list-actions { display: flex; align-items: center; gap: 12px; }

.letter-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; }
.letter-nav a {
  min-width: 30px; text-align: center; padding: .2rem .4rem; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-muted); font-size: .82rem; font-weight: 600;
}
.letter-nav a:hover { color: var(--text); background: var(--surface-strong); text-decoration: none; }
.letter-nav a.is-empty { opacity: .3; pointer-events: none; }

.letter-group { margin-bottom: 26px; }
.letter-heading {
  font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim);
  margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 16px; }
.show-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  border-left: 4px solid var(--show-color, #64748b);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.show-card-head { display: flex; gap: 12px; padding: 14px 16px 10px; align-items: flex-start; }
.poster {
  width: 64px; height: 96px; object-fit: cover; border-radius: 8px; background: rgba(255,255,255,.06);
  border: 1px solid var(--border); flex: none;
}
.poster-fallback { display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; color: var(--show-color, #94a3b8); }
.show-card-title { flex: 1; min-width: 0; }
.show-card-title h3 { margin-bottom: .15em; }
.show-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .4em; }
.show-desc { font-size: .85rem; color: var(--text-muted); margin-bottom: .4em; }
.show-next { font-size: .82rem; color: var(--text-muted); margin: 0; }

.swatch {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.35);
  background: var(--show-color, #64748b); cursor: pointer; flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--show-color, #64748b) 20%, transparent);
}
.swatch:hover { filter: brightness(1.1); }
.swatch-small { width: 22px; height: 22px; border-radius: 7px; box-shadow: none; }

.season { border-top: 1px solid var(--border); }
.season summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  padding: .55rem 16px; font-size: .86rem; color: var(--text);
}
.season summary::-webkit-details-marker { display: none; }
.season summary:hover { background: rgba(255,255,255,.03); }
.season-name { font-weight: 600; }
.season summary::after { content: "▾"; margin-left: auto; color: var(--text-dim); transition: transform .15s; }
.season[open] summary::after { transform: rotate(180deg); }

.episode-list { list-style: none; margin: 0; padding: 0 8px 10px; }
.episode-row {
  display: grid; grid-template-columns: 10px 84px 54px 1fr 16px; align-items: center; gap: 8px;
  width: 100%; text-align: left; padding: .35rem .55rem; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer;
}
.episode-row:hover { background: rgba(255,255,255,.05); }
.episode-row.is-match { background: rgba(56, 189, 248, .12); box-shadow: inset 2px 0 0 var(--accent); }
.episode-row.is-match:hover { background: rgba(56, 189, 248, .18); }
.episode-row.is-watched .tick { display: inline; margin-left: .35em; color: var(--ok); font-weight: 800; }
.episode-row.is-watched .ep-title { color: var(--text-muted); }
.episode-row .dot { box-shadow: none; width: 8px; height: 8px; }
.ep-date { color: var(--text-muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.ep-code { color: var(--text-dim); font-size: .76rem; font-family: var(--mono); }
.ep-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-chevron { color: var(--text-dim); }

.show-card-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 16px; border-top: 1px solid var(--border); background: rgba(0,0,0,.15);
}
.sync-note { margin-left: auto; font-size: .74rem; }

/* --------------------------------------------------------------------------
   Add shows page
   -------------------------------------------------------------------------- */
.url-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.url-row-icon { opacity: .5; font-size: .9rem; }
.url-row input {
  flex: 1; padding: .65rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--text);
  font: inherit; font-family: var(--mono); font-size: .85rem;
}
.url-row input:focus { outline: none; border-color: rgba(56,189,248,.6); box-shadow: 0 0 0 3px rgba(56,189,248,.15); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.form-hint { font-size: .85rem; }

.result-list, .check-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.result, .check-list li {
  display: flex; gap: 10px; align-items: flex-start; padding: .6rem .8rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(0,0,0,.18);
}
.result.is-ok, .check-list li.is-ok { border-color: rgba(52,211,153,.35); }
.result.is-error, .check-list li.is-error { border-color: rgba(248,113,113,.4); }
.result-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; flex: none; background: rgba(255,255,255,.08); }
.result.is-ok .result-icon, .check-list li.is-ok .result-icon { background: rgba(52,211,153,.2); color: var(--ok); }
.result.is-error .result-icon, .check-list li.is-error .result-icon { background: rgba(248,113,113,.2); color: var(--danger); }
.result-warnings { margin: 6px 0 0; padding-left: 1.1rem; font-size: .8rem; color: var(--text-muted); }
.check-list li div { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }

.table-wrap { overflow-x: auto; }
.shows-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.shows-table th, .shows-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.shows-table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.shows-table tbody tr:hover { background: rgba(255,255,255,.03); }
.show-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.show-cell small { display: block; font-weight: 400; }
.col-actions { white-space: nowrap; text-align: right; }
.login-form { display: flex; gap: 10px; flex-wrap: wrap; }
.login-form input { padding: .6rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--text); font: inherit; }

/* --------------------------------------------------------------------------
   Search + pagination for the "Shows on the calendar" table
   -------------------------------------------------------------------------- */
.panel-search {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.panel-search .search-field { flex: 1 1 260px; }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .85rem;
}
.pager-info { color: var(--text-muted); }
.pager-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-link {
  min-width: 32px; text-align: center; padding: .25rem .55rem; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-muted); font-size: .82rem; text-decoration: none;
}
.pager-link:hover { background: var(--surface-strong); color: var(--text); text-decoration: none; }
.pager-link.is-current { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.pager-gap { color: var(--text-dim); padding: 0 4px; }

/* --------------------------------------------------------------------------
   Colour popover
   -------------------------------------------------------------------------- */
.popover {
  position: relative; width: 268px; padding: 14px 16px 16px;
  background: rgba(13, 20, 34, 0.97); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 30px 60px -30px rgba(0,0,0,.9);
  backdrop-filter: blur(10px);
}
[hidden] { display: none !important; }

/* The picker lives in a top-layer dialog so it can appear above the episode dialog. */
.color-dialog {
  position: fixed; margin: 0; padding: 0; border: 0; background: transparent;
  width: auto; max-width: none; max-height: none; overflow: visible; color: var(--text);
}
.color-dialog::backdrop { background: rgba(3, 6, 14, 0.35); }
.popover-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.popover-head strong { display: block; font-size: .95rem; }
.popover-head small { color: var(--text-dim); font-size: .74rem; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.swatches button { min-height: 32px; }
.swatches button {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); cursor: pointer; padding: 0;
}
.swatches button:hover { transform: scale(1.08); }
.swatches button.is-active { box-shadow: 0 0 0 2px var(--text); }
.popover-custom { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .8rem; color: var(--text-muted); }
.popover-custom input[type=color] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--border-strong); border-radius: 7px; background: none; }
.popover-custom label { flex: none; }
.popover-note { margin: 10px 0 0; font-size: .74rem; color: var(--text-dim); }

/* --------------------------------------------------------------------------
   Episode dialog
   -------------------------------------------------------------------------- */
.ep-dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0;
  background: rgba(11, 18, 32, 0.98); color: var(--text); width: min(560px, calc(100vw - 32px));
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.95);
}
.ep-dialog::backdrop { background: rgba(3, 6, 14, .68); backdrop-filter: blur(3px); }
.ep-dialog-body { padding: 20px 22px 18px; }
.ep-dialog-head { display: flex; gap: 12px; align-items: flex-start; }
.ep-dialog-head > div { flex: 1; }
.ep-dialog-show { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-muted); margin: 0 0 .2em; text-transform: uppercase; letter-spacing: .06em; }
.ep-dialog h2 { font-size: 1.3rem; margin-bottom: .2em; }
.ep-dialog-meta { color: var(--text-muted); font-size: .88rem; margin: 0; }
.ep-dialog-summary { margin: 14px 0; color: #cfd8e8; font-size: .92rem; }
.ep-dialog-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 16px; font-size: .85rem; }
.ep-dialog-facts dt { color: var(--text-dim); }
.ep-dialog-facts dd { margin: 0; }
.ep-dialog-foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 14px; }
.ep-foot-group { display: flex; gap: 10px; flex-wrap: wrap; }
.ep-foot-end { margin-left: auto; }
.btn-watch.is-on { border-color: rgba(52, 211, 153, .55); background: rgba(52, 211, 153, .16); color: #b6f5dc; }
.btn-watch.is-on:hover { background: rgba(52, 211, 153, .24); }

/* Toasts */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: .6rem .9rem; border-radius: var(--radius-sm); font-size: .85rem;
  background: rgba(13, 20, 34, .96); border: 1px solid var(--border-strong);
  box-shadow: 0 18px 40px -24px rgba(0,0,0,.9); animation: toast-in .18s ease-out;
}
.toast-error { border-color: rgba(248,113,113,.5); }
.toast-ok { border-color: rgba(52,211,153,.45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.footer { border-top: 1px solid var(--border); margin-top: 40px; background: rgba(0,0,0,.18); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; font-size: .8rem; color: var(--text-dim); }
.footer p { margin: 0; }

/* --------------------------------------------------------------------------
   My colours, administrator bits and other extras
   -------------------------------------------------------------------------- */
.popover-links {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: .8rem;
}
.btn-mine { border-color: rgba(244, 114, 182, .5); color: #ffe3f3; }
.btn-mine:hover { background: rgba(244, 114, 182, .16); }

.code-block {
  font-family: var(--mono); font-size: .78rem; line-height: 1.5; color: #cbd5e1;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 0 0 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.paste-box {
  width: 100%; margin-top: 12px; padding: .7rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(0, 0, 0, .3); color: var(--text);
  font-family: var(--mono); font-size: .82rem; resize: vertical;
}
.paste-box:focus { outline: none; border-color: rgba(56, 189, 248, .6); box-shadow: 0 0 0 3px rgba(56, 189, 248, .15); }
input[type=file] { font: inherit; font-size: .85rem; color: var(--text-muted); }
input[type=file]::file-selector-button {
  font: inherit; font-size: .85rem; margin-right: 10px; padding: .4rem .8rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .06); color: var(--text); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: rgba(255, 255, 255, .12); }

.admin-details summary { cursor: pointer; font-weight: 600; color: var(--text); }
.admin-details summary::marker { color: var(--text-dim); }
.admin-details > p { margin-top: 10px; }

/* --------------------------------------------------------------------------
   Cookie notice, privacy page
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed; left: 18px; right: 18px; bottom: 18px; z-index: 50;
  max-width: 660px; margin: 0 auto; padding: 16px 18px;
  background: rgba(11, 18, 32, .97); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .95);
  backdrop-filter: blur(10px); animation: toast-in .22s ease-out;
}
.cookie-form { display: flex; flex-direction: column; gap: 12px; }
.cookie-text strong { display: block; margin-bottom: .2em; }
.cookie-text p { margin: 0; font-size: .85rem; color: var(--text-muted); }
.cookie-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cookie-link { font-size: .82rem; margin-left: auto; }

.link-button {
  background: none; border: 0; padding: 0; color: var(--accent); font: inherit;
  font-size: inherit; cursor: pointer; text-decoration: underline;
}
.link-button:hover { color: #7dd3fc; }

.prose { max-width: 880px; }
.prose h2 { margin-top: 1.6em; font-size: 1.05rem; }
.prose p, .prose li { max-width: 76ch; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.privacy-table td, .privacy-table th { vertical-align: top; font-weight: 400; }
.privacy-table td:first-child, .privacy-table th:first-child { white-space: nowrap; }
.forget-form {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 0; padding: 14px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .18);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .topbar-stats { display: none; }
  .wd-long { display: none; }
  .wd-short { display: inline; }
}
@media (max-width: 980px) {
  .topbar-search { display: none; }
  .day { min-height: 104px; }
  .chip-ep { display: none; }
  .chip { padding: .3rem .45rem; font-size: .72rem; }
  .show-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar-inner { gap: 10px; flex-wrap: wrap; }
  .brand-text small { display: none; }
  .tabs { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .tab { padding: .4rem .6rem; font-size: .84rem; }

  /* Calendar becomes an agenda: only days with episodes are shown. */
  .calendar-head { display: none; }
  .calendar-body { grid-template-columns: 1fr; }
  .day {
    min-height: 0; border-right: 0; padding: 10px 12px;
    flex-direction: column; gap: 8px;
  }
  .day.is-empty { display: none; }
  .day.is-outside { display: none; }
  .day-head { justify-content: flex-start; gap: 10px; }
  .day-num { font-size: .95rem; color: var(--text); }
  .day-month { display: inline; color: var(--text-dim); font-weight: 500; margin-right: 2px; }
  .day-count { order: -1; }
  .day-body { gap: 6px; }
  .chip { padding: .45rem .6rem; font-size: .8rem; }
  .chip-ep { display: block; }
  .calendar-summary { margin-left: 0; width: 100%; }
  .episode-row { grid-template-columns: 10px 1fr auto; }
  .ep-date { order: 3; grid-column: 2 / -1; font-size: .74rem; }
  .ep-chevron { display: none; }
  .ep-dialog-facts { grid-template-columns: 1fr; gap: 2px; }
  .ep-dialog-facts dt { margin-top: 6px; }
}
