:root {
  --font-display: "Libre Baskerville", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", "Helvetica Neue", Arial, sans-serif;

  /* Warm graphite base, tuned toward the Fontpair "soft-marketing" stone palette
     (bg #FAFAFA / text #191513 / primary #78716C) but inverted for the dark
     newsroom brand. */
  --bg: #0d0c0a;
  --bg-elevated: #14120f;
  --panel: #171410;
  --panel-strong: #1b1712;
  --panel-soft: #1b1712;
  --panel-muted: #241f18;
  --text: #f4f1ea;
  --muted: #a89e91;
  --line: rgba(232, 220, 201, 0.05);
  --line-strong: rgba(232, 220, 201, 0.1);

  /* "Vicblu" — the dark navy from FCK's adidas Originals Copenhagen Originals
     track top (F.C. København sort/hvid/mørkeblå). Deep tone for solid tags,
     lighter tint for legible links/hover states on a dark ground. */
  --accent-deep: #16233f;
  --accent: #4f6fa8;
  --accent-strong: #8aa4d4;
  --accent-soft: rgba(79, 111, 168, 0.16);
  --accent-contrast: #eef2fb;

  --ok: rgba(81, 124, 94, 0.18);
  --ok-text: #b9d7c2;
  --error: rgba(126, 67, 67, 0.2);
  --error-text: #f1c1c1;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.16);
  --radius-panel: 12px;
  --radius-card: 8px;
  --radius-editorial: 2px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #100e0b 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-body);
  border-top: 3px solid var(--accent-deep);
}

.app {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 2px 10px;
}

.topbar-brand-shell {
  display: grid;
  gap: 6px;
}

.topbar-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar-brand {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.session-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.session-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.session-name {
  color: var(--text);
  font-size: 0.92rem;
}

.topbar-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  padding: 0;
}

.topbar-label {
  margin: 0;
  font-size: 0.85rem;
}

.topbar-time {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 3px 8px;
  border-radius: var(--radius-editorial);
  background: var(--accent-deep);
  color: var(--accent-contrast);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
}

button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 14px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

button:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.035);
  border-color: transparent;
  box-shadow: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

a.ghost-button,
a.icon-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 14px;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

a.ghost-button:hover,
a.icon-button:hover {
  background: rgba(255, 255, 255, 0.035);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.icon-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 38px;
  padding: 0;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
}

.icon-button .view-icon svg {
  width: 18px;
  height: 18px;
}

.source-toggle-button {
  width: auto;
  padding: 0 10px;
  gap: 8px;
}

.button-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.view-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.view-switch-indicator {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: 112px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    width 220ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.view-switch-button {
  position: relative;
  z-index: 1;
  width: auto;
  height: 44px;
  min-width: 44px;
  padding: 0 14px;
  gap: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  transition: color 180ms ease;
  border-radius: 999px;
}

.view-switch-button:hover {
  background: transparent;
}

.view-switch-button.is-active {
  color: var(--text);
}

.view-switch-button:not(.is-active):hover {
  color: #d8e1f3;
}

.view-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: currentColor;
}

.view-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.view-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin: 0 0 16px;
  padding: 12px 2px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.masthead-copy {
  max-width: 760px;
}

.masthead-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.masthead-description {
  margin: 8px 0 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.masthead-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: min(100%, 320px);
}

.masthead-stat {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  backdrop-filter: none;
}

.masthead-stat span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead-stat strong {
  font-size: 1rem;
  line-height: 1.4;
}

.sources-panel {
  margin: 10px 0 18px;
  padding: 6px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg);
}

.auth-close {
  position: absolute;
  top: 20px;
  right: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.auth-card {
  width: min(540px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(214, 208, 196, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow);
}

.auth-copy {
  margin-bottom: 20px;
}

.auth-title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 2.7rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.auth-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.auth-tab,
.auth-submit {
  width: 100%;
}

.auth-tab.is-active {
  background: #242424;
  color: var(--text);
  border-color: var(--line-strong);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
}

.auth-field input:focus {
  outline: 2px solid rgba(214, 208, 196, 0.32);
  outline-offset: 2px;
}

.auth-submit {
  margin-top: 4px;
}

.auth-message {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.auth-message[data-variant="info"] {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.auth-message[data-variant="error"] {
  background: var(--error);
  color: var(--error-text);
}

.admin-panel {
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(141, 184, 255, 0.08), transparent 26%),
    var(--panel);
}

.admin-panel-head,
.admin-card-head,
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-panel-head {
  margin-bottom: 16px;
}

.admin-title,
.admin-card-head h3 {
  margin: 0;
}

.admin-title {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.admin-actions {
  flex-wrap: wrap;
}

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-stat-card,
.admin-card,
.admin-source-item,
.admin-list-item {
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.admin-stat-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
}

.admin-stat-card span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.admin-stat-card strong {
  font-size: 1rem;
  line-height: 1.3;
}

.admin-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-card {
  padding: 14px;
  border-radius: 20px;
}

.admin-source-create-card {
  margin-bottom: 14px;
}

.admin-card-head {
  margin-bottom: 12px;
}

.admin-source-list,
.admin-run-list {
  display: grid;
  gap: 10px;
}

.admin-source-item {
  padding: 12px 14px;
  border-radius: 16px;
}

.admin-source-item.ok {
  background: var(--ok);
  color: var(--ok-text);
}

.admin-source-item.error {
  background: var(--error);
  color: var(--error-text);
}

.admin-source-item.is-disabled {
  opacity: 0.65;
}

.admin-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-source-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.admin-source-toggle .expand-marker {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-weight: 600;
}

.admin-source-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-source-detail {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(214, 208, 196, 0.24);
}

.quality-warning {
  margin: 0;
  color: var(--error-text, inherit);
  font-size: 0.85rem;
}

.quality-ok {
  margin: 0;
  opacity: 0.72;
  font-size: 0.85rem;
}

.admin-rule-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.admin-source-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-rule-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  opacity: 0.85;
}

.admin-source-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  opacity: 0.85;
}

.admin-rule-form input[type="text"],
.admin-rule-form input[type="number"],
.admin-source-form input[type="text"],
.admin-source-form input[type="url"],
.admin-rule-form input:not([type="checkbox"]) {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
}

.admin-rule-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-source-form-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-rule-message,
.admin-source-form-message {
  font-size: 0.8rem;
  opacity: 0.75;
}

.admin-raw-candidates h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.raw-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--panel);
}

.raw-item summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.raw-item summary::-webkit-details-marker {
  display: none;
}

.candidate-decision {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.candidate-decision.is-match {
  background: var(--ok);
  color: var(--ok-text);
}

.candidate-decision.is-ignored {
  background: var(--panel-soft);
  opacity: 0.75;
}

.candidate-title {
  font-size: 0.86rem;
}

.candidate-reason {
  margin: 6px 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.raw-item pre {
  margin: 6px 0 0;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 0.72rem;
  overflow: auto;
  max-height: 220px;
}

.admin-source-copy span,
.admin-list-item span {
  color: inherit;
  opacity: 0.82;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: left;
}

.admin-list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  justify-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  text-align: left;
}

.admin-list-item.is-selected {
  border-color: rgba(214, 208, 196, 0.42);
  box-shadow: inset 0 0 0 1px rgba(214, 208, 196, 0.18);
}

.admin-log-card {
  padding-bottom: 0;
}

.admin-log-output {
  margin: 0;
  padding: 16px;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: #d6d6d4;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.sources-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.sources-panel-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sources-note {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: right;
}

.sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
}

.source-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 70px;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.source-pill:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.02);
}

.source-pill.is-selected {
  border-color: transparent;
  box-shadow: inset 2px 0 0 var(--accent);
  opacity: 1;
  background: rgba(255, 255, 255, 0.02);
}

.source-pill:not(.is-selected) {
  opacity: 0.9;
}

.source-pill:focus-visible {
  outline: 2px solid rgba(134, 171, 255, 0.3);
  outline-offset: 2px;
}

.source-pill.ok {
  background: var(--ok);
  color: var(--ok-text);
}

.source-pill.error {
  background: var(--error);
  color: var(--error-text);
}

.source-pill span {
  font-size: 0.9rem;
  line-height: 1.45;
}

.sources-clear {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
}

.feed-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 22px;
  align-items: start;
}

.table-view {
  margin-top: 2px;
}

.table-shell {
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 150px 180px 170px;
  gap: 16px;
  align-items: center;
  min-width: 850px;
  padding: 12px 8px;
}

.table-head {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.table-row {
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.table-row:focus-visible {
  outline: 2px solid rgba(214, 208, 196, 0.5);
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.03);
}

.load-more-shell {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.load-more-button {
  min-width: 140px;
}

.table-source,
.table-category,
.table-time {
  color: var(--muted);
  font-size: 0.92rem;
}

.category-badge {
  padding-left: 6px;
  border-left: 1px solid currentColor;
  font-weight: 700;
}

.category-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tag-option {
  position: relative;
}

.tag-option input {
  position: absolute;
  opacity: 0;
}

.tag-option span {
  display: block;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
}

.tag-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.latest-tags-picker {
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.latest-tags-picker legend {
  padding: 0;
  color: var(--text);
  font-weight: 700;
}

.latest-tags-picker > p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: .86rem;
}

.latest-tags-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.latest-tag-option {
  position: relative;
}

.latest-tag-option input {
  position: absolute;
  opacity: 0;
}

.latest-tag-option span {
  display: block;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
}

.latest-tag-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.category-editor-message {
  color: var(--muted);
  font-size: .76rem;
}

.category-editor-message[data-variant="error"] {
  color: var(--error-text);
}

.table-title {
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.feed-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 430px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  overflow: hidden;
  position: relative;
  box-shadow: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
  cursor: pointer;
}

.feed-card:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.015);
}

.feed-card:focus-visible {
  outline: 2px solid rgba(134, 171, 255, 0.3);
  outline-offset: 2px;
}

.media-shell {
  position: relative;
  overflow: hidden;
}

.feed-card[data-kind="social"] .card-copy {
  gap: 6px;
}

.card-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.media-shell.no-media .card-top {
  position: static;
  padding: 8px 0 0;
}

.meta-pill {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 24px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.42);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.source {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: transparent;
}

.time {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.6);
  color: #dce6f7;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.media {
  overflow: hidden;
  border-bottom: 0;
  background: #0d1219;
  min-height: 260px;
  height: 260px;
}

.media-image,
.media-audio,
.media-poster,
.media-video,
.media-social,
.media-podcast {
  display: block;
  width: 100%;
}

.media-poster {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: #0c1320;
}

.feed-card[data-kind="video"] .media-poster {
  height: 100%;
}

.media-image {
  height: 260px;
  object-fit: cover;
}

.feed-card[data-kind="video"] .media-image {
  height: 100%;
}

.media-poster-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 9, 14, 0.04) 0%, rgba(6, 9, 14, 0.18) 42%, rgba(6, 9, 14, 0.88) 100%),
    radial-gradient(circle at top right, rgba(110, 168, 255, 0.24), transparent 38%);
}

.media-play-chip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: calc(100% - 24px);
  min-height: 34px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.68);
  color: var(--accent-contrast);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(14px);
}

.media-play-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  position: relative;
}

.media-play-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  transform: translate(-38%, -50%);
}

.media-video {
  position: relative;
  left: 50%;
  top: 50%;
  width: max(100%, calc(280px * 16 / 9));
  height: max(100%, calc((280px * 16 / 9) * 9 / 16));
  border: 0;
  background: #000;
  transform: translate(-50%, -50%);
}

.media-audio {
  min-height: 280px;
  padding: 108px 12px;
  filter: grayscale(0.15) brightness(0.92);
}

.media-social {
  height: 280px;
  padding: 0;
  background: #0f0f10;
  overflow: hidden;
}

.media-podcast {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: #0f0f10;
}

.media-podcast-fallback {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(180deg, #123760 0%, #0c2642 52%, #091421 100%);
}

.media-podcast-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.media-podcast-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.08) 0%, rgba(5, 5, 5, 0.2) 36%, rgba(5, 5, 5, 0.82) 100%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.42));
}

.x-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)),
    #101722;
}

.x-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.x-card-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #173a77, #0d1d38);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
}

.x-card-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.x-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.x-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.x-card-badge {
  color: #ffffff;
  font-size: 0.5rem;
}

.x-card-handle,
.x-card-mark,
.x-card-footer {
  color: var(--muted);
  font-size: 0.82rem;
}

.x-card-mark {
  margin-left: auto;
  font-size: 1rem;
}

.x-card-body {
  margin: 0;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.x-card-image {
  width: 100%;
  min-height: 0;
  flex: 1;
  border-top: 0;
  border-bottom: 0;
  object-fit: cover;
  background: #0a0a0a;
}

.x-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.card-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  position: relative;
  padding: 12px 2px 10px;
}

.player-shell {
  margin-top: auto;
  padding-top: 4px;
}

.card-audio-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audio-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 18px;
}

.audio-progress-label,
.audio-progress-time {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.audio-progress-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-progress-time {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.audio-progress-track {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.audio-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
  transition: width 160ms ease;
}

.card-audio-player {
  display: block;
  width: 100%;
  max-width: 100%;
  filter: saturate(0.92) brightness(0.98);
}

.card-main {
  min-width: 0;
}

.secondary {
  margin: 0;
  color: #b8c6df;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.secondary::before {
  content: "";
  display: none;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  opacity: 0.92;
}

.secondary[data-platform]::before {
  display: block;
}

.secondary[data-platform="fck-tv"]::before {
  border: 1.8px solid currentColor;
  border-radius: 3px;
  box-shadow:
    inset 0 -3px 0 -1px currentColor,
    0 10px 0 -5px transparent;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 68% 82%, 62% 100%, 38% 100%, 32% 82%, 0 82%);
}

.secondary[data-platform="youtube"]::before {
  border-radius: 4px;
  background: currentColor;
  clip-path: polygon(0 15%, 100% 15%, 100% 85%, 0 85%);
  box-shadow: inset 4px 0 0 currentColor;
  -webkit-mask: linear-gradient(transparent, transparent);
  mask: linear-gradient(transparent, transparent);
}

.secondary[data-platform="youtube"]::after,
.secondary[data-platform="viaplay"]::after,
.secondary[data-platform="x"]::after,
.secondary[data-platform="fck-tv"]::after {
  color: currentColor;
}

.secondary[data-platform="youtube"]::before {
  background:
    linear-gradient(90deg, transparent 0 38%, #111 38% 39%, transparent 39%) center / 100% 100% no-repeat,
    linear-gradient(35deg, transparent 0 45%, #111 45% 55%, transparent 55%) center / 100% 100% no-repeat,
    currentColor;
}

.secondary[data-platform="x"]::before {
  position: relative;
  content: "X";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.62rem;
  font-weight: 800;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.secondary[data-platform="viaplay"]::before {
  border-radius: 50%;
  background:
    conic-gradient(from 180deg at 52% 50%, currentColor 0 65%, transparent 65% 100%);
  clip-path: circle(50%);
}

.secondary[data-access="registered"],
.secondary[data-access="premium"] {
  color: #dbe5ff;
}

.title {
  margin: 0;
}

.title-link {
  color: var(--text);
  text-decoration: none;
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}

.title-link:hover {
  color: var(--accent);
}

.description {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link {
  margin-top: auto;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  color: var(--text);
}

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

@media (max-width: 1024px) {
  .app {
    width: min(100% - 24px, 1160px);
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .masthead-meta {
    width: 100%;
    min-width: 0;
  }

  .feed-card {
    height: auto;
  }
}

@media (max-width: 900px) {
  .feed-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-status-grid,
  .admin-columns {
    grid-template-columns: 1fr 1fr;
  }

  .feed-card,
  .feed-card[data-kind="video"],
  .feed-card[data-kind="social"] {
    grid-column: span 1;
    min-height: auto;
    height: auto;
  }

  .media {
    min-height: 260px;
  }

  .media-image,
  .media-video,
  .media-social,
  .media-audio,
  .media-podcast {
    min-height: 260px;
    height: 260px;
  }

  .title-link {
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    line-height: 1.08;
  }

}

@media (max-width: 760px) {
  .app {
    width: min(100% - 16px, 1160px);
    padding-top: 16px;
    padding-bottom: 40px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 14px;
  }

  .topbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .masthead {
    padding: 10px 0 8px;
  }

  .masthead-title {
    font-size: clamp(1.35rem, 7vw, 1.75rem);
  }

  .masthead-meta {
    grid-template-columns: 1fr;
  }

  .topbar-meta {
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
  }

  .session-shell {
    justify-content: space-between;
  }

  .toolbar {
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar > button,
  .view-switch {
    flex: 0 0 auto;
  }

  .view-switch {
    width: 100%;
    justify-content: stretch;
  }

  .view-switch-button {
    justify-content: center;
    min-width: 0;
  }

  .sources-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-panel-head,
  .admin-actions,
  .admin-source-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-rule-form,
  .admin-source-form {
    grid-template-columns: 1fr;
  }

  .admin-status-grid,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .sources-note {
    text-align: left;
  }

  .sources-clear {
    width: 100%;
    justify-content: center;
  }

  .feed-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sources {
    grid-template-columns: 1fr;
  }

  .table-shell {
    border-radius: 0;
  }

  .feed-card,
  .feed-card[data-kind="video"],
  .feed-card[data-kind="social"] {
    grid-column: span 1;
    min-height: auto;
    height: auto;
    border-radius: 0;
  }

  .card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta-pill,
  .time {
    max-width: 100%;
  }

  .meta-pill {
    padding-right: 10px;
  }

  .media {
    min-height: 220px;
  }

  .media-image,
  .media-video,
  .media-social,
  .media-audio,
  .media-podcast {
    height: 220px;
    min-height: 220px;
  }

  .card-copy {
    padding: 10px 0 8px;
  }

  .title-link {
    font-size: 1.05rem;
    line-height: 1.05;
  }

  .description {
    font-size: 0.92rem;
    line-height: 1.52;
  }

  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }

  .admin-panel,
  .admin-card {
    border-radius: 20px;
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100% - 12px, 1160px);
  }

  .button-label {
    display: none;
  }

  .topbar {
    padding-bottom: 12px;
  }

  .topbar-brand {
    font-size: 1.08rem;
  }

  .topbar-label,
  .topbar-time {
    font-size: 0.82rem;
  }

  .toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .view-switch {
    width: 100%;
  }

  .sources-panel,
  .empty {
    padding: 8px 0;
    border-radius: 0;
  }

  .card-top {
    padding: 8px;
    gap: 10px;
  }

  .media-shell.no-media .card-top {
    padding: 6px 0 0;
  }

  .media,
  .media-image,
  .media-video,
  .media-social,
  .media-audio,
  .media-podcast {
    min-height: 196px;
    height: 196px;
  }

  .x-card {
    padding: 10px;
  }

  .card-copy {
    padding: 8px 0 6px;
    gap: 8px;
  }

  .title-link {
    font-size: 1rem;
  }

  .table-head,
  .table-row {
    padding: 10px 6px;
  }
}

/* User profile and persisted light / dark appearance */

.profile-shell {
  margin: -18px 0 48px;
  scroll-margin-top: 20px;
}

.profile-card {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px);
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(9,26,55,.11);
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.profile-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .64rem;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.profile-title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.05em;
}

.profile-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

.profile-form {
  display: grid;
  gap: 30px;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-password-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-password-fields .profile-field:last-child {
  grid-column: 2;
}

.profile-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.profile-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 0;
  border-radius: 3px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 .95rem var(--font-body);
}

.profile-field input:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.profile-field small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 450;
  line-height: 1.4;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.theme-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.theme-option {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 12px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-option:hover {
  transform: translateY(-2px);
}

.theme-option:has(input:checked) {
  background: var(--accent-soft);
  color: var(--text);
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option input:focus-visible + .theme-preview {
  outline: 3px solid rgba(77,112,195,.35);
  outline-offset: 3px;
}

.theme-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 12px 1fr;
  gap: 4px;
  width: 74px;
  height: 54px;
  padding: 7px;
  border-radius: 3px;
  box-shadow: 0 6px 16px rgba(9,26,55,.12);
}

.theme-preview i:first-child {
  grid-column: 1 / -1;
}

.theme-preview i {
  display: block;
  border-radius: 1px;
}

.theme-preview-light {
  background: #f2efe6;
}

.theme-preview-light i {
  background: #1c438f;
}

.theme-preview-light i:nth-child(3) {
  background: #d9d5ca;
}

.theme-preview-dark {
  background: #071326;
}

.theme-preview-dark i {
  background: #7897df;
}

.theme-preview-dark i:nth-child(3) {
  background: #1b2b47;
}

.profile-password-head {
  padding-top: 4px;
}

.profile-password-head h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.profile-password-head p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.profile-save {
  min-width: 150px;
  background: var(--accent-deep);
  color: white;
}

.profile-message {
  margin: -12px 0 28px;
  padding: 12px 14px;
  border-radius: 3px;
  font-size: .84rem;
}

.profile-message[data-variant="info"] {
  background: var(--accent-soft);
  color: var(--text);
}

.profile-message[data-variant="success"] {
  background: var(--ok);
  color: var(--ok-text);
}

.profile-message[data-variant="error"] {
  background: var(--error);
  color: var(--error-text);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071326;
  --bg-elevated: #0c1a30;
  --panel: #0f1e35;
  --panel-strong: #11223b;
  --panel-soft: #182a46;
  --panel-muted: #203554;
  --text: #f5f3ec;
  --muted: #98a6bd;
  --line: rgba(226,235,255,.1);
  --line-strong: rgba(226,235,255,.2);
  --accent-deep: #3159b5;
  --accent: #82a2ed;
  --accent-strong: #aac0f2;
  --accent-soft: rgba(103,141,226,.15);
  --ok: rgba(76,140,94,.2);
  --ok-text: #bde0c5;
  --error: rgba(174,75,58,.22);
  --error-text: #ffc6ba;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% -20%, rgba(57,91,170,.18), transparent 42%),
    var(--bg);
}

html[data-theme="dark"] .topbar-brand,
html[data-theme="dark"] .category-link.is-active,
html[data-theme="dark"] .topbar-time,
html[data-theme="dark"] .site-footer-brand,
html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .auth-title,
html[data-theme="dark"] .admin-title,
html[data-theme="dark"] .admin-card-head h3 {
  color: var(--text);
}

html[data-theme="dark"] .source-pill,
html[data-theme="dark"] .source-pill.ok,
html[data-theme="dark"] .source-pill.error,
html[data-theme="dark"] .table-shell {
  background: rgba(255,255,255,.045);
  color: var(--text);
}

html[data-theme="dark"] .source-pill.is-selected,
html[data-theme="dark"] .load-more-button,
html[data-theme="dark"] .auth-submit,
html[data-theme="dark"] .profile-save {
  background: #3159b5;
  color: white;
}

html[data-theme="dark"] .topbar .icon-button,
html[data-theme="dark"] .view-switch {
  background: rgba(255,255,255,.07);
}

html[data-theme="dark"] .table-row:hover {
  background: rgba(255,255,255,.06);
}

html[data-theme="dark"] .feed-card:hover {
  background: transparent;
}

html[data-theme="dark"] .media-shell {
  box-shadow: 0 14px 38px rgba(0,0,0,.28);
}

html[data-theme="dark"] .profile-card {
  box-shadow: 0 26px 80px rgba(0,0,0,.32);
}

.topbar .toolbar {
  display: none;
}

/* Compact account widget — profile, sources and admin live here. */

.topbar-actions {
  position: static;
}

.topbar .toolbar {
  display: none;
}

.session-shell {
  position: relative;
  padding: 0;
}

.profile-widget {
  display: grid;
  grid-template-columns: 42px auto 15px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 6px 10px 6px 6px;
  border: 0;
  border-radius: 28px;
  background: rgba(255,255,255,.5);
  color: var(--text);
  text-align: left;
}

.profile-widget:hover,
.profile-widget[aria-expanded="true"] {
  border-color: transparent;
  background: var(--panel-strong);
  box-shadow: 0 10px 28px rgba(9,26,55,.09);
}

.profile-widget-avatar,
.profile-menu-avatar {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-deep);
}

.profile-widget-avatar {
  width: 42px;
  height: 42px;
}

.profile-widget .session-user {
  display: grid;
  gap: 1px;
  min-width: 84px;
}

.profile-widget .session-label {
  color: var(--muted);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.profile-widget .session-name {
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-size: .85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-widget-chevron {
  color: var(--muted);
  font-size: 1rem;
  transform: translateY(-2px);
  transition: transform 180ms ease;
}

.profile-widget[aria-expanded="true"] .profile-widget-chevron {
  transform: translateY(2px) rotate(180deg);
}

.profile-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 12px);
  right: 0;
  width: min(300px, calc(100vw - 28px));
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 22px 65px rgba(9,26,55,.18);
}

.profile-menu-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 8px 14px;
}

.profile-menu-avatar {
  width: 48px;
  height: 48px;
}

.profile-menu-head > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-menu-head strong,
.profile-menu-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-head strong {
  font-family: var(--font-display);
  font-size: .98rem;
}

.profile-menu-head small {
  color: var(--muted);
  font-size: .72rem;
}

.profile-menu-actions {
  display: grid;
  gap: 2px;
}

.profile-menu-actions button,
.profile-menu-actions a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: 4px;
  color: var(--text);
  font-size: .82rem;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
}

.profile-menu-actions button:hover,
.profile-menu-actions a:hover {
  background: var(--accent-soft);
}

.profile-menu-actions .profile-menu-logout {
  margin-top: 5px;
  color: var(--error-text);
}

html[data-theme="dark"] .profile-widget {
  background: rgba(255,255,255,.055);
}

html[data-theme="dark"] .profile-widget:hover,
html[data-theme="dark"] .profile-widget[aria-expanded="true"] {
  background: var(--panel-strong);
  box-shadow: 0 14px 38px rgba(0,0,0,.26);
}

html[data-theme="dark"] .profile-menu {
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
}

@media (max-width: 820px) {
  .profile-widget {
    grid-template-columns: 40px 12px;
    min-height: 50px;
    padding: 5px 9px 5px 5px;
  }

  .profile-widget-avatar {
    width: 40px;
    height: 40px;
  }

  .profile-widget .session-user {
    display: none;
  }
}

.profile-avatar-editor {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 2px 0 6px;
}

.profile-avatar-editor > img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-deep);
  box-shadow: 0 10px 26px rgba(9,26,55,.13);
}

.profile-avatar-editor > div {
  display: grid;
  gap: 5px;
}

.profile-avatar-editor strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
}

.profile-avatar-editor p {
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
}

.profile-avatar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.profile-avatar-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--text);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 650;
}

.profile-avatar-upload:hover {
  background: rgba(77,112,195,.2);
}

.profile-avatar-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.profile-avatar-upload:has(input:focus-visible) {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.profile-avatar-actions button {
  min-height: 38px;
  padding: 8px 10px;
  font-size: .78rem;
}

html[data-theme="dark"] .profile-avatar-editor > img {
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
}

@media (max-width: 520px) {
  .profile-avatar-editor {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .profile-avatar-editor > img {
    width: 70px;
    height: 70px;
  }
}

@media (max-width: 680px) {
  .profile-shell {
    margin: -10px 14px 36px;
  }

  .profile-card {
    padding: 24px 18px;
  }

  .profile-fields,
  .profile-password-fields,
  .theme-picker {
    grid-template-columns: 1fr;
  }

  .profile-password-fields .profile-field:last-child {
    grid-column: auto;
  }

  .theme-picker legend {
    grid-column: auto;
  }
}

/* --------------------------------------------------------------------------
   Copenhagen editorial system — Semafor-inspired grid, FCKnews expression
   -------------------------------------------------------------------------- */

:root {
  --bg: #f1efe8;
  --bg-elevated: #f8f6ef;
  --panel: #faf8f2;
  --panel-strong: #ffffff;
  --panel-soft: #ebe8df;
  --panel-muted: #dedbd1;
  --text: #091a37;
  --muted: #657086;
  --line: rgba(9, 26, 55, 0.14);
  --line-strong: rgba(9, 26, 55, 0.34);
  --accent-deep: #102f6c;
  --accent: #214ca7;
  --accent-strong: #4f73ca;
  --accent-soft: rgba(33, 76, 167, 0.1);
  --accent-contrast: #faf8f2;
  --signal: #ed5e43;
  --ok: #e3eee6;
  --ok-text: #1f5a34;
  --error: #f5e1dc;
  --error-text: #963e30;
  --shadow: 0 30px 80px rgba(5, 22, 50, 0.16);
  --shadow-soft: 0 12px 34px rgba(5, 22, 50, 0.1);
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  border-top: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(9, 26, 55, 0.035) 50%, transparent calc(50% + 0.5px)),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

::selection {
  background: var(--accent);
  color: white;
}

.app {
  width: min(1440px, calc(100% - 48px));
  padding: 0 0 68px;
}

.edition-rail {
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 35px;
  color: var(--accent-deep);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.edition-rail-line {
  height: 1px;
  background: linear-gradient(90deg, rgba(16,47,108,.22), transparent);
}

.edition-rail-edition {
  color: var(--muted);
}

.topbar {
  min-height: 110px;
  margin-bottom: 30px;
  padding: 20px 0;
}

.topbar-brand-shell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 58px;
  overflow: hidden;
  background: var(--accent-deep);
  color: white;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,255,255,.5);
  clip-path: inherit;
}

.brand-mark::after {
  inset: 0;
  background: linear-gradient(125deg, transparent 48%, rgba(255,255,255,.15) 49% 53%, transparent 54%);
  border: 0;
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand-mark i {
  position: absolute;
  z-index: 1;
  bottom: 13px;
  width: 17px;
  height: 2px;
  background: white;
  box-shadow: 0 4px 0 rgba(255,255,255,.6);
}

.topbar-kicker {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
}

.topbar-brand,
.site-footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.055em;
}

.topbar-brand {
  color: var(--accent-deep);
  font-size: clamp(1.65rem, 2.3vw, 2.35rem);
  line-height: .9;
}

.topbar-brand span,
.site-footer-brand span {
  color: var(--accent);
  font-style: normal;
  font-weight: 400;
}

.topbar-actions {
  gap: 12px;
}

.topbar-meta {
  padding: 0 4px 0 12px;
}

.topbar-label,
.topbar-time {
  font-size: 0.76rem;
}

.topbar-time {
  color: var(--accent-deep);
}

button {
  min-height: 40px;
  border-radius: 2px;
  color: var(--text);
  font-size: .84rem;
  letter-spacing: .01em;
}

button:hover {
  background: var(--accent-soft);
  border-color: transparent;
}

button:focus-visible,
a:focus-visible,
.feed-card:focus-visible,
.table-row:focus-visible {
  outline: 3px solid rgba(33, 76, 167, .4);
  outline-offset: 3px;
}

.ghost-button {
  color: var(--accent-deep);
}

.toolbar {
  gap: 8px;
}

.view-switch {
  gap: 0;
  padding: 3px;
  border: 0;
  border-radius: 3px;
  background: rgba(16,47,108,.07);
}

.view-switch-indicator {
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 1px;
  background: var(--accent-deep);
  box-shadow: 0 3px 12px rgba(16,47,108,.24);
}

.view-switch-button {
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 1px;
  color: var(--muted);
}

.view-switch-button.is-active {
  color: white;
}

.view-switch-button:not(.is-active):hover {
  color: var(--accent);
}

.icon-button {
  min-width: 40px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 2px;
  background: rgba(16,47,108,.06);
}

.source-toggle-button {
  width: auto;
}

.masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 8.2fr) minmax(270px, 3.8fr);
  align-items: end;
  gap: 0;
  min-height: 405px;
  margin: 24px 0 28px;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(105deg, rgba(2,14,40,.2), transparent 58%),
    var(--accent-deep);
  color: white;
  box-shadow: var(--shadow);
}

.masthead::before {
  content: "";
  position: absolute;
  width: clamp(340px, 44vw, 720px);
  aspect-ratio: 1;
  right: -11%;
  top: -70%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(255,255,255,.025),
    0 0 0 140px rgba(255,255,255,.02),
    0 0 0 210px rgba(255,255,255,.015);
}

.masthead::after {
  content: "KBH · 12";
  position: absolute;
  right: clamp(24px, 4vw, 58px);
  top: 27px;
  color: rgba(255,255,255,.42);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.masthead-copy,
.masthead-meta {
  position: relative;
  z-index: 1;
}

.masthead-copy {
  max-width: 900px;
  padding-right: clamp(20px, 5vw, 80px);
}

.eyebrow {
  gap: 9px;
  margin-bottom: 24px;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: .67rem;
  letter-spacing: .18em;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 5px rgba(237,94,67,.14);
}

.masthead-title {
  max-width: 950px;
  color: white;
  font-family: var(--font-display);
  font-size: clamp(3.15rem, 6.2vw, 7.1rem);
  font-weight: 700;
  line-height: .91;
  letter-spacing: -.065em;
  text-wrap: balance;
}

.masthead-title em {
  color: #afc4f5;
  font-weight: 400;
}

.masthead-description {
  max-width: 54ch;
  margin-top: 24px;
  color: rgba(255,255,255,.7);
  font-size: 1rem;
  line-height: 1.55;
}

.masthead-meta {
  grid-template-columns: 1fr;
  gap: 0;
  min-width: 0;
  border-top: 1px solid rgba(255,255,255,.3);
}

.masthead-stat {
  grid-template-columns: 80px 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,.2);
  border-radius: 0;
}

.masthead-stat span {
  color: rgba(255,255,255,.52);
  font-size: .59rem;
}

.masthead-stat strong {
  color: white;
  font-family: var(--font-display);
  font-size: .96rem;
  font-weight: 400;
}

.sources-panel {
  margin: -4px 0 28px;
  padding: 22px 0 0;
}

.sources-panel-head {
  margin-bottom: 18px;
}

.sources-panel .eyebrow,
.admin-panel .eyebrow,
.auth-card .eyebrow {
  color: var(--accent-deep);
}

.sources-note {
  color: var(--muted);
  text-align: left;
}

.sources {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.source-pill {
  min-height: 78px;
  padding: 13px 15px;
  border: 0;
  border-radius: 3px;
  background: rgba(255,255,255,.5);
  color: var(--text);
}

.source-pill.ok,
.source-pill.error {
  background: rgba(255,255,255,.35);
  color: var(--text);
}

.source-pill.is-selected {
  background: var(--accent-deep);
  color: white;
  box-shadow: inset 0 -3px 0 #6f92e3;
}

.source-pill strong {
  font-size: .85rem;
}

.source-pill span {
  color: inherit;
  font-size: .72rem;
  opacity: .68;
}

.feed-list {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 38px 26px;
  background: transparent;
}

.frontpage-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.65fr) minmax(220px, 0.82fr);
  gap: 24px;
  align-items: start;
  margin: 0 0 34px;
  padding: 0 0 26px;
  border-bottom: 1px dashed rgba(9, 26, 55, 0.22);
}

.frontpage-rail {
  min-width: 0;
  border-top: 1px dashed rgba(9, 26, 55, 0.22);
}

.frontpage-rail-left {
  padding-right: 20px;
  border-right: 1px dashed rgba(9, 26, 55, 0.22);
}

.frontpage-rail-right {
  padding-left: 20px;
  border-left: 1px dashed rgba(9, 26, 55, 0.22);
}

.frontpage-rail-head h2 {
  margin: 0;
  padding: 14px 0 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 1.5vw, 1.62rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.frontpage-story-list {
  display: grid;
}

.frontpage-story {
  border-top: 1px dashed rgba(9, 26, 55, 0.18);
}

.frontpage-story:first-child {
  border-top: 0;
}

.frontpage-story-link {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  color: inherit;
  text-decoration: none;
}

.frontpage-story-link:hover strong {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.frontpage-story-source,
.frontpage-story time,
.frontpage-kicker,
.next-match-meta {
  color: var(--muted);
  font-size: .59rem;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.frontpage-story strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(.92rem, 1vw, 1.06rem);
  line-height: 1.14;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.frontpage-story time {
  letter-spacing: .04em;
  text-transform: none;
}

.frontpage-main-story {
  min-width: 0;
  cursor: pointer;
}

.frontpage-main-story:focus-visible {
  outline: 2px solid rgba(49, 89, 181, .38);
  outline-offset: 8px;
}

.frontpage-main-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto 20px;
  text-align: center;
}

.frontpage-kicker {
  margin: 0;
  color: var(--accent);
}

.frontpage-main-title {
  max-width: 15ch;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.8vw, 4.2rem);
  line-height: .98;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.frontpage-main-title a {
  color: inherit;
  text-decoration: none;
}

.frontpage-main-story:hover .frontpage-main-title a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
}

.frontpage-main-description {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: clamp(.95rem, 1.2vw, 1.18rem);
  line-height: 1.32;
  text-wrap: balance;
}

.frontpage-main-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
}

.frontpage-main-media {
  overflow: hidden;
  background: #dbe0e7;
  box-shadow: 0 16px 40px rgba(9,26,55,.09);
}

.frontpage-main-image,
.frontpage-main-fallback {
  display: block;
  width: 100%;
  height: clamp(260px, 30vw, 410px);
}

.frontpage-main-image {
  object-fit: cover;
  transition: transform 520ms cubic-bezier(.2,.7,.2,1);
}

.frontpage-main-story:hover .frontpage-main-image {
  transform: scale(1.018);
}

.frontpage-main-fallback {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(49, 89, 181, .92), rgba(7, 19, 38, .96)),
    var(--accent-deep);
  color: white;
  font-family: "Major Mono Display", var(--font-display);
  font-size: clamp(3rem, 9vw, 6.5rem);
}

.next-match-card {
  display: grid;
  gap: 13px;
  padding: 14px 0 0;
}

.next-match-teams {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.45vw, 1.58rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.next-match-teams span {
  color: var(--accent);
  font-family: var(--font-body);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.next-match-meta {
  display: grid;
  gap: 6px;
  letter-spacing: .07em;
}

.next-match-link {
  justify-self: start;
  color: var(--accent);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.next-match-link:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.next-match-previews {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.next-match-previews .frontpage-rail-head h2 {
  padding-top: 10px;
  font-size: clamp(1rem, 1.18vw, 1.28rem);
}

.next-match-placeholder {
  display: grid;
  place-items: end start;
  min-height: 150px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(7, 19, 38, .08), rgba(7, 19, 38, .52)),
    linear-gradient(135deg, #f5f0d3 0 24%, #3159b5 24% 52%, #ffffff 52% 70%, #071326 70%);
  color: white;
  box-shadow: 0 12px 32px rgba(9,26,55,.08);
}

.next-match-placeholder span {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.025em;
}

.feed-card {
  grid-column: span 4;
  gap: 0;
  height: auto;
  min-height: 510px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}

.feed-card:hover {
  transform: translateY(-3px);
  background: transparent;
}

.feed-card:hover .media-image,
.feed-card:hover .media-podcast-image {
  transform: scale(1.025);
}

.media-shell {
  background: #dbe0e7;
  box-shadow: 0 12px 32px rgba(9,26,55,.08);
}

.media-shell.no-media {
  background: transparent;
  box-shadow: none;
}

.card-top {
  padding: 13px;
  color: white;
}

.media-shell.no-media .card-top {
  padding: 0 0 14px;
  color: var(--muted);
}

.meta-pill,
.time {
  border: 0;
  border-radius: 2px;
  background: rgba(6,19,44,.78);
  color: white;
  backdrop-filter: blur(10px);
}

.media-shell.no-media .meta-pill,
.media-shell.no-media .time {
  border: 0;
  background: transparent;
  color: var(--muted);
  backdrop-filter: none;
}

.media,
.media-poster {
  height: 260px;
  min-height: 260px;
  background: #cad2df;
}

.media-image {
  height: 260px;
  transition: transform 420ms cubic-bezier(.2,.7,.2,1);
}

.media > .media-podcast,
.media > .media-social {
  height: 100%;
}

.media-poster-overlay {
  background: linear-gradient(180deg, rgba(4,14,34,.02), rgba(4,14,34,.8));
}

.media-play-chip {
  border: 0;
  border-radius: 2px;
  background: rgba(9,26,55,.84);
}

.card-copy {
  gap: 10px;
  height: auto;
  padding: 18px 0 2px;
}

.secondary {
  color: var(--accent);
  font-size: .64rem;
}

.title-link {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.26rem, 1.65vw, 1.8rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.title-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.description {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.52;
}

.player-shell {
  margin-top: 12px;
}

.audio-progress-track {
  background: rgba(9,26,55,.1);
}

.x-card,
.media-podcast-fallback {
  background: var(--accent-deep);
}

.x-card-name,
.x-card-body {
  color: white;
}

.x-card-handle,
.x-card-mark,
.x-card-footer {
  color: rgba(255,255,255,.58);
}

.table-shell {
  border: 0;
  border-radius: 0;
  background: rgba(255,255,255,.56);
  box-shadow: 0 14px 44px rgba(9,26,55,.07);
}

.table-head,
.table-row {
  padding: 16px 18px;
}

.table-head {
  color: var(--accent-deep);
  border-bottom: 0;
}

.table-row {
  border-color: rgba(9,26,55,.07);
}

.table-row:hover {
  background: white;
}

.table-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.load-more-shell {
  margin-top: 30px;
}

.load-more-button,
.auth-submit,
.admin-actions button:not(.ghost-button),
.admin-source-form-footer button,
.admin-rule-footer button {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: white;
}

.load-more-button {
  min-width: 180px;
  border-radius: 2px;
}

.auth-card,
.admin-panel {
  border: 0;
  border-radius: 0;
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
}

.auth-title,
.admin-title,
.admin-card-head h3 {
  color: var(--accent-deep);
  font-family: var(--font-display);
}

.auth-field input,
.admin-rule-form input[type="text"],
.admin-rule-form input[type="number"],
.admin-source-form input[type="text"],
.admin-source-form input[type="url"],
.admin-rule-form input:not([type="checkbox"]) {
  border-radius: 2px;
  background: var(--bg-elevated);
  color: var(--text);
}

.auth-tab.is-active {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: white;
}

.admin-card,
.admin-stat-card,
.admin-source-item,
.admin-list-item,
.raw-item {
  border: 0;
  border-radius: 2px;
  background: var(--bg-elevated);
}

.admin-log-output {
  background: #07162e;
  color: #dce6fa;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 30px;
  margin-top: 70px;
  padding: 28px 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.site-footer-brand {
  color: var(--accent-deep);
  font-family: "Major Mono Display", var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  font-size: 1.4rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  justify-self: end;
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1120px) {
  .app {
    width: min(100% - 28px, 1440px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .masthead {
    grid-template-columns: minmax(0, 2fr) minmax(230px, .75fr);
  }

  .frontpage-layout {
    grid-template-columns: minmax(190px, .7fr) minmax(0, 1.55fr) minmax(210px, .78fr);
    gap: 22px;
  }

  .frontpage-rail-left {
    padding-right: 18px;
  }

  .frontpage-rail-right {
    padding-left: 18px;
  }

  .feed-card {
    grid-column: span 6;
  }
}

@media (max-width: 820px) {
  .app {
    width: min(100% - 20px, 1440px);
  }

  .edition-rail {
    grid-template-columns: auto 1fr;
  }

  .edition-rail-line {
    display: none;
  }

  .edition-rail-edition {
    justify-self: end;
  }

  .topbar-actions,
  .toolbar {
    align-items: stretch;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .topbar-meta {
    order: -1;
    border-left: 0;
    padding-left: 0;
  }

  .masthead {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 38px 28px 28px;
  }

  .masthead-copy {
    padding-right: 0;
  }

  .masthead-title {
    font-size: clamp(2.7rem, 11vw, 5rem);
  }

  .masthead-meta {
    margin-top: 34px;
  }

  .frontpage-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    margin: 0 0 30px;
    padding: 0 14px 24px;
  }

  .frontpage-main-story {
    order: 1;
  }

  .frontpage-rail-left {
    order: 2;
    padding-right: 0;
    border-right: 0;
  }

  .frontpage-rail-right {
    order: 3;
    padding-left: 0;
    border-left: 0;
  }

  .frontpage-main-title {
    max-width: 15ch;
    font-size: clamp(2rem, 8.5vw, 3.65rem);
  }

  .frontpage-story-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
  }

  .feed-card {
    grid-column: span 6;
    grid-row: auto;
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .app {
    width: 100%;
    padding-bottom: 40px;
  }

  .edition-rail,
  .topbar,
  .frontpage-layout,
  .sources-panel,
  .table-view,
  .load-more-shell,
  .site-footer {
    margin-left: 14px;
    margin-right: 14px;
  }

  .edition-rail-edition {
    display: none;
  }

  .topbar {
    min-height: 0;
    margin-bottom: 20px;
    padding: 16px 0;
  }

  .brand-mark {
    width: 42px;
    height: 49px;
  }

  .topbar-kicker {
    display: none;
  }

  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .view-switch {
    width: 100%;
  }

  .view-switch-button {
    padding: 0 9px;
  }

  .view-label,
  .button-label {
    display: none;
  }

  .masthead {
    margin: 0 0 22px;
    padding: 42px 22px 25px;
  }

  .masthead::after {
    right: 20px;
    top: 18px;
  }

  .masthead-title {
    font-size: clamp(2.75rem, 14vw, 4.25rem);
  }

  .masthead-description {
    font-size: .9rem;
  }

  .frontpage-layout {
    gap: 20px;
    padding: 0 0 22px;
  }

  .frontpage-main-copy {
    align-items: start;
    justify-items: start;
    margin-bottom: 14px;
    text-align: left;
  }

  .frontpage-main-title {
    max-width: 14ch;
    font-size: clamp(1.7rem, 8.6vw, 2.75rem);
  }

  .frontpage-main-description {
    font-size: .92rem;
    text-wrap: pretty;
  }

  .frontpage-main-meta {
    justify-content: flex-start;
  }

  .frontpage-main-image,
  .frontpage-main-fallback,
  .next-match-placeholder {
    height: 180px;
    min-height: 180px;
  }

  .frontpage-story-list {
    grid-template-columns: 1fr;
  }

  .frontpage-story:nth-child(n+4) {
    display: none;
  }

  .frontpage-story-link {
    padding: 10px 0;
  }

  .frontpage-rail-head h2 {
    padding-top: 12px;
    font-size: 1.15rem;
  }

  .next-match-card {
    gap: 9px;
  }

  .next-match-placeholder {
    display: none;
  }

  .feed-list {
    gap: 34px;
  }

  .feed-card {
    grid-column: 1 / -1;
    padding: 0 10px;
  }

  .media,
  .media-image,
  .media-poster {
    height: 250px;
    min-height: 250px;
  }

  .title {
    width: 100%;
  }

  .title-link {
    font-size: 1.12rem;
    line-height: 1.14;
    letter-spacing: -.022em;
    text-wrap: pretty;
    hyphens: none;
    overflow-wrap: normal;
    word-break: normal;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-top: 46px;
  }

  .site-footer p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 400px) {
  .title-link {
    font-size: 1.06rem;
  }
}

/* Clean centered masthead and editorial category navigation */

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 92px;
  margin-bottom: 0;
  padding: 14px 0 8px;
}

.topbar-brand-shell {
  grid-column: 2;
  justify-self: center;
}

.topbar-brand {
  color: var(--accent-deep);
  font-family: "Major Mono Display", var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  font-size: clamp(1.45rem, 2.7vw, 2.55rem);
  line-height: .8;
  text-decoration: none;
}

.topbar-actions {
  grid-column: 3;
  justify-self: end;
  width: auto;
}

.topbar-meta {
  position: absolute;
  left: 0;
  top: 50%;
  display: grid;
  gap: 3px;
  padding: 0;
  transform: translateY(-50%);
}

.topbar-label {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.topbar-time {
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 400;
}

.toolbar .view-switch {
  display: none;
}

.topbar .toolbar {
  display: none;
  grid-template-columns: none;
  width: auto;
}

.category-nav {
  margin: 0 0 26px;
  padding: 0 0 8px;
}

.category-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.1vw, 32px);
  min-height: 42px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-link {
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: clamp(.7rem, .82vw, .82rem);
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
}

.category-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translate(-50%, 4px) scale(.4);
  transition: opacity 180ms ease, transform 180ms ease;
}

.category-link:hover {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.category-link.is-active {
  color: var(--accent-deep);
  font-weight: 750;
}

.category-link.is-active::after {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

@media (max-width: 1024px) {
  .feed-card[data-kind="video"] {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .feed-card[data-kind="video"] .media-shell,
  .feed-card[data-kind="video"] .card-copy,
  .feed-card[data-kind="video"] .title,
  .feed-card[data-kind="video"] .title-link {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .feed-card[data-kind="video"] .media {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .feed-card[data-kind="video"] .media-video {
    position: static;
    inset: auto;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    transform: none;
  }

  .feed-card[data-kind="video"] .media-poster,
  .feed-card[data-kind="video"] .media-image {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .feed-card[data-kind="video"] .title-link {
    text-wrap: pretty;
    overflow-wrap: normal;
    word-break: normal;
  }
}

@media (max-width: 820px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 74px;
    margin-left: 0;
    margin-right: 0;
    padding: 12px 14px 8px;
  }

  .topbar-brand {
    font-size: clamp(1.55rem, 6.2vw, 2.25rem);
  }

  .topbar-meta {
    display: none;
  }

  .topbar-actions {
    flex-direction: row;
    align-items: center;
  }

  .session-user {
    display: none;
  }

  .session-shell {
    padding: 0;
  }

  .category-nav {
    margin-bottom: 22px;
    padding-bottom: 6px;
  }

  .category-scroll {
    justify-content: flex-start;
    gap: 21px;
    padding: 0 16px;
  }
}

@media (max-width: 520px) {
  .topbar {
    min-height: 66px;
  }

  .topbar-brand {
    font-size: 1.42rem;
  }

  .topbar-actions {
    gap: 4px;
  }

  .category-nav {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 18px;
  }
}

/* Keep theme tokens last in the cascade. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071326;
  --bg-elevated: #0c1a30;
  --panel: #0f1e35;
  --panel-strong: #11223b;
  --panel-soft: #182a46;
  --panel-muted: #203554;
  --text: #f5f3ec;
  --muted: #98a6bd;
  --line: rgba(226,235,255,.1);
  --line-strong: rgba(226,235,255,.2);
  --accent-deep: #3159b5;
  --accent: #82a2ed;
  --accent-strong: #aac0f2;
  --accent-soft: rgba(103,141,226,.15);
  --ok: rgba(76,140,94,.2);
  --ok-text: #bde0c5;
  --error: rgba(174,75,58,.22);
  --error-text: #ffc6ba;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% -20%, rgba(57,91,170,.18), transparent 42%),
    var(--bg);
}

html[data-theme="dark"] .topbar-brand,
html[data-theme="dark"] .category-link.is-active,
html[data-theme="dark"] .topbar-time,
html[data-theme="dark"] .site-footer-brand,
html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .auth-title,
html[data-theme="dark"] .admin-title,
html[data-theme="dark"] .admin-card-head h3 {
  color: var(--text);
}

html[data-theme="dark"] .source-pill,
html[data-theme="dark"] .source-pill.ok,
html[data-theme="dark"] .source-pill.error,
html[data-theme="dark"] .table-shell {
  background: rgba(255,255,255,.045);
  color: var(--text);
}

html[data-theme="dark"] .source-pill.is-selected,
html[data-theme="dark"] .load-more-button,
html[data-theme="dark"] .auth-submit,
html[data-theme="dark"] .profile-save {
  background: #3159b5;
  color: white;
}

html[data-theme="dark"] .topbar .icon-button,
html[data-theme="dark"] .view-switch {
  background: rgba(255,255,255,.07);
}

html[data-theme="dark"] .table-row:hover {
  background: rgba(255,255,255,.06);
}

html[data-theme="dark"] .feed-card:hover {
  background: transparent;
}

html[data-theme="dark"] .media-shell {
  box-shadow: 0 14px 38px rgba(0,0,0,.28);
}

html[data-theme="dark"] .profile-card {
  box-shadow: 0 26px 80px rgba(0,0,0,.32);
}

/* --------------------------------------------------------------------------
   Video rows — Netflix-style horizontal rails + custom embed tiles
   -------------------------------------------------------------------------- */

.video-rows {
  display: flex;
  flex-direction: column;
  gap: 44px;
  margin-top: 4px;
}

.video-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 2px;
}

.video-row-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.6vw + 0.9rem, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.video-row-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.video-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 18px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.video-rail::-webkit-scrollbar {
  height: 6px;
}

.video-rail::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
}

.video-tile {
  position: relative;
  flex: 0 0 auto;
  width: clamp(230px, 24vw, 330px);
  scroll-snap-align: start;
  cursor: pointer;
  border-radius: var(--radius-card);
  outline: none;
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease, z-index 0s;
}

.video-tile:hover,
.video-tile:focus-visible {
  transform: scale(1.055) translateY(-4px);
  box-shadow: var(--shadow);
  z-index: 3;
}

.video-tile:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.video-tile-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #0c1320;
}

.video-tile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.video-tile:hover .video-tile-image,
.video-tile:focus-visible .video-tile-image {
  transform: scale(1.08);
}

.video-tile-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 9, 14, 0.05) 0%, rgba(6, 9, 14, 0.18) 46%, rgba(6, 9, 14, 0.92) 100%);
}

.video-tile-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.6);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.video-tile[data-platform="youtube"] .video-tile-badge {
  background: #d0271f;
}

.video-tile[data-platform="fck-tv"] .video-tile-badge {
  background: var(--accent-deep);
}

.video-tile[data-platform="viaplay"] .video-tile-badge {
  background: #6c2bd9;
}

.video-tile-duration {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(8, 12, 18, 0.72);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
}

.video-tile-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 12, 18, 0.5);
  backdrop-filter: blur(6px);
  transform: translate(-50%, -50%) scale(0.82);
  opacity: 0;
  transition: transform 260ms ease, opacity 200ms ease, background 200ms ease;
  pointer-events: none;
}

.video-tile:hover .video-tile-play,
.video-tile:focus-visible .video-tile-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-tile-play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid #fff;
}

.video-tile-foot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-tile-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-tile-series {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.video-tile-time {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 600;
}

.video-tile-time.is-upcoming {
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 999px;
  background: #6c2bd9;
  color: #fff;
  font-weight: 750;
}

.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: rgba(6, 10, 18, 0.88);
  backdrop-filter: blur(6px);
}

body.video-lightbox-open {
  overflow: hidden;
}

.video-lightbox-shell {
  position: relative;
  width: min(1100px, 100%);
}

.video-lightbox-frame-shell {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.video-lightbox-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-lightbox-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  aspect-ratio: 1;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 160ms ease;
}

.video-lightbox-close:hover,
.video-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 640px) {
  .video-tile {
    width: clamp(200px, 72vw, 280px);
  }

  .video-lightbox {
    padding: 0;
  }

  .video-lightbox-shell {
    width: 100%;
  }

  .video-lightbox-frame-shell {
    border-radius: 0;
  }

  .video-lightbox-close {
    top: 10px;
    right: 10px;
    background: rgba(8, 12, 18, 0.6);
  }
}

html[data-theme="dark"] .video-tile-badge {
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .video-lightbox {
  background: rgba(0, 0, 0, 0.94);
}

/* Podcast universe */
.podcast-universe { display: flex; flex-direction: column; gap: 48px; margin-top: 4px; }
.podcast-shelf-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 17px; padding: 0 2px; }
.podcast-shelf-head h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem, 1.5vw + .9rem, 1.75rem); letter-spacing: -.02em; }
.podcast-shelf-head p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.podcast-rail { display: flex; gap: 18px; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 20px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.podcast-rail::-webkit-scrollbar { height: 6px; }
.podcast-rail::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.podcast-tile { flex: 0 0 clamp(210px, 20vw, 270px); min-width: 0; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)); transition: transform 240ms cubic-bezier(.2,.8,.2,1), border-color 240ms ease, box-shadow 240ms ease; }
.podcast-tile:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 20px 46px rgba(0,0,0,.25); }
.podcast-artwork { position: relative; aspect-ratio: 1; overflow: hidden; background: linear-gradient(145deg, var(--accent-deep), #080b12 72%); }
.podcast-artwork img { width: 100%; height: 100%; object-fit: cover; transition: transform 420ms ease; }
.podcast-tile:hover .podcast-artwork img { transform: scale(1.045); }
.podcast-artwork-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.88); font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: .85; text-align: center; }
.podcast-artwork-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(3,5,10,.72)); pointer-events: none; }
.podcast-source-chip { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 80px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(6,9,15,.62); backdrop-filter: blur(10px); color: #fff; font-size: .62rem; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
.podcast-tile-play { position: absolute; right: 12px; bottom: 12px; z-index: 1; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f5f2eb; box-shadow: 0 8px 24px rgba(0,0,0,.34); cursor: pointer; transition: transform 180ms ease, background 180ms ease; }
.podcast-tile-play:hover, .podcast-tile-play:focus-visible { transform: scale(1.08); background: #fff; }
.podcast-tile-play span, .podcast-main-play-icon { display: block; width: 0; height: 0; margin-left: 4px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid #101722; }
.podcast-tile-play.is-playing span { width: 12px; height: 14px; margin: 0; border: 0; border-left: 4px solid #101722; border-right: 4px solid #101722; }
.podcast-tile-play.is-external { color: #101722; text-decoration: none; }
.podcast-tile-play.is-external span { width: auto; height: auto; margin: 0; border: 0; font-size: 1.35rem; font-weight: 750; line-height: 1; }
.podcast-tile-copy { padding: 15px 15px 14px; }
.podcast-tile-copy h3 { min-height: 2.7em; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .94rem; line-height: 1.35; }
.podcast-tile-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.podcast-resume-label { color: var(--accent-strong); text-align: right; }
.podcast-tile-progress { height: 3px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.1); }
.podcast-tile-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent-strong); }

/* Keep media cards visually identical in the editorial feed and media tabs. */
.feed-card.feed-custom-media-card {
  min-height: 0;
  height: auto;
  grid-row: auto;
  display: block;
  overflow: visible;
  cursor: default;
  transform: none;
}

.feed-custom-media-card > .video-tile,
.feed-custom-media-card > .podcast-tile {
  width: 100%;
  max-width: none;
}

.feed-custom-media-card > .podcast-tile {
  flex: none;
}

.feed-custom-media-card:hover {
  transform: none;
}

@media (max-width: 620px) {
  .feed-card.feed-custom-media-card {
    padding: 0 10px;
  }
}

.podcast-dock { position: fixed; z-index: 180; left: 50%; bottom: 18px; width: min(1120px, calc(100% - 28px)); min-height: 88px; display: grid; grid-template-columns: 60px minmax(160px, 1fr) auto minmax(260px, 1.5fr) auto auto; align-items: center; gap: 15px; padding: 12px 14px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(14,16,20,.9); box-shadow: 0 24px 70px rgba(0,0,0,.5); backdrop-filter: blur(22px) saturate(1.25); }
body.podcast-dock-open { padding-bottom: 122px; }
.podcast-dock-artwork { width: 60px; height: 60px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--accent-deep); color: #fff; font-family: var(--font-display); font-size: .75rem; font-weight: 700; text-align: center; }
.podcast-dock-artwork img { width: 100%; height: 100%; object-fit: cover; }
.podcast-dock-copy { min-width: 0; display: grid; gap: 4px; }
.podcast-dock-source { color: var(--accent-strong); font-size: .62rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.podcast-dock-title { overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.podcast-dock-controls { display: flex; align-items: center; gap: 8px; }
.podcast-skip, .podcast-main-play, .podcast-dock-close { border: 0; color: #fff; cursor: pointer; }
.podcast-skip { background: transparent; color: rgba(255,255,255,.7); font-size: .7rem; font-weight: 750; }
.podcast-skip:hover { color: #fff; }
.podcast-main-play { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #f6f2e9; }
.podcast-main-play.is-playing .podcast-main-play-icon { width: 12px; height: 14px; margin: 0; border: 0; border-left: 4px solid #101722; border-right: 4px solid #101722; }
.podcast-dock-timeline { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 9px; color: rgba(255,255,255,.62); font-variant-numeric: tabular-nums; font-size: .65rem; }
#podcastSeek { --podcast-position: 0%; width: 100%; height: 4px; margin: 0; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--accent-strong) var(--podcast-position), rgba(255,255,255,.16) var(--podcast-position)); cursor: pointer; }
#podcastSeek::-webkit-slider-thumb { width: 12px; height: 12px; appearance: none; border-radius: 50%; background: #fff; }
.podcast-speed { border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 6px 8px; background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: .68rem; }
.podcast-dock-close { align-self: start; width: 24px; height: 24px; border-radius: 50%; background: transparent; color: rgba(255,255,255,.56); font-size: 1.15rem; }

@media (max-width: 820px) {
  .podcast-dock { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; bottom: 8px; padding: 10px 12px 12px; }
  .podcast-dock-artwork { width: 50px; height: 50px; }
  .podcast-dock-controls { grid-column: 1 / -1; justify-content: center; }
  .podcast-dock-timeline { grid-column: 1 / -1; width: 100%; }
  .podcast-speed { display: none; }
  .podcast-dock-close { position: absolute; top: -9px; right: -5px; background: #242832; }
}

@media (max-width: 640px) {
  .podcast-tile { flex-basis: min(74vw, 250px); }
  .podcast-universe { gap: 36px; }
  .podcast-dock-copy { padding-right: 28px; }
}

/* Pipeline operations */
.engine-intro, .engine-muted { color: var(--muted); }
.engine-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.engine-stage { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 22px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
.engine-stage:hover, .engine-stage:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.engine-stage-heading { font-weight: 700; }
.engine-stage-heading > span { color: var(--muted); margin-right: 8px; }
.engine-stage strong { font-size: 36px; line-height: 1.2; }
.engine-stage small { color: var(--muted); margin-top: 6px; }
.engine-workspace { margin-bottom: 24px; }
.engine-filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr auto; gap: 12px; align-items: end; }
.engine-filters label, .engine-entity-fields label { display: grid; gap: 7px; font-size: 13px; }
.engine-filters input, .engine-filters select, .engine-entity-fields select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font: inherit; }
.engine-table-wrap { overflow-x: auto; }
.engine-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.engine-table th { padding: 14px 10px; color: var(--muted); font-weight: 500; }
.engine-table td { padding: 17px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.engine-table td:first-child { min-width: 220px; width: 40%; }
.engine-table td strong, .engine-table td small { display: block; }
.engine-table td small { color: var(--muted); margin-top: 7px; }
.engine-chip, .engine-badge { display: inline-block; padding: 5px 8px; border-radius: 5px; background: var(--accent-soft); margin: 0 4px 5px 0; font-size: 12px; }
.engine-badge.is-error, .engine-error { color: #b43d38; background: #b43d3814; }
.engine-badge.is-ok { color: #287a55; background: #287a5514; }
.engine-pagination, .engine-dialog-head, .engine-item-actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.engine-pagination { margin-top: 18px; }
.engine-dialog { width: min(880px, calc(100vw - 32px)); max-height: 90vh; padding: 28px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; }
.engine-dialog::backdrop { background: #07152b99; }
.engine-dialog h2 { line-height: 1.3; }
.engine-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.engine-dialog details { padding: 16px 0; border-top: 1px solid var(--line); }
.engine-dialog summary { cursor: pointer; font-weight: 600; }
.engine-item-stages { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; list-style: none; gap: 10px; margin: 24px 0; }
.engine-item-stages li { display: grid; gap: 8px; }
.engine-item-actions { justify-content: flex-start; flex-wrap: wrap; }
.engine-body { white-space: pre-wrap; max-height: 320px; overflow-y: auto; line-height: 1.7; }
.engine-error { padding: 12px; border-radius: 6px; }
.engine-entity-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.engine-tag-fields { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 24px; }
.engine-tag-fields label { display: flex; align-items: center; gap: 6px; }
#engineReviewForm { margin-bottom: 24px; }
#engineDetailMessage { position: sticky; bottom: 0; background: var(--panel); padding: 12px 0; }
@media (max-width: 760px) {
  .engine-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engine-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engine-dialog { padding: 18px; }
  .engine-item-stages { grid-template-columns: repeat(2, 1fr); }
  .engine-entity-fields { grid-template-columns: 1fr; }
}
.admin-columns .admin-source-list, .admin-columns .admin-run-list { max-height: 560px; overflow-y: auto; }
.engine-dialog-head { position: sticky; top: -28px; z-index: 2; background: var(--panel); padding: 10px 0; }
@media (max-width: 760px) {
  .engine-table, .engine-table tbody { display: block; }
  .engine-table thead { display: none; }
  .engine-table tr { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding: 12px 0; }
  .engine-table td { border: 0; padding: 8px 0; min-width: 0; }
  .engine-table td:first-child, .engine-table td:last-child { grid-column: 1 / -1; width: auto; min-width: 0; }
  .engine-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); margin-bottom: 6px; }
  .engine-dialog-head { top: -18px; }
}
.feed-overview { margin-bottom: 24px; }
.feed-health-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.feed-health-summary button { background: var(--accent-soft); color: var(--text); padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.feed-health-summary button[aria-pressed="true"] { border-color: var(--accent-strong); }
.feed-health-summary strong { margin-right: 6px; }
.feed-filters { grid-template-columns: 2fr 1fr 1fr; margin-bottom: 18px; }
#engineFilters { grid-template-columns: 1.5fr 1fr .8fr 1.5fr 1fr auto; }
.feed-column-head, .feed-row-main { display: grid; grid-template-columns: minmax(240px, 3fr) 1fr 1fr 1.3fr auto; align-items: center; gap: 16px; }
.feed-column-head { color: var(--muted); font-size: 12px; padding: 8px 14px; }
.feed-row-main .admin-source-toggle { text-align: left; justify-content: flex-start; }
.feed-row .admin-source-copy { min-width: 0; align-items: flex-start; }
.feed-row .admin-source-copy small { color: var(--muted); overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.feed-row .engine-badge { width: fit-content; margin-top: 6px; }
.feed-metric { font-size: 13px; }
.feed-overview .admin-source-list { max-height: 600px; overflow-y: auto; }
.feed-row .admin-source-detail { text-align: left; }
@media (max-width: 900px) {
  #engineFilters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed-column-head { display: none; }
  .feed-row-main { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .feed-row-main .admin-source-toggle { grid-column: 1 / -1; }
  .feed-row-main > button:last-child { grid-column: 1 / -1; justify-self: start; }
  .feed-metric::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
  .feed-filters { grid-template-columns: 1fr; }
}
