:root {
  --bg: #f3f5f7;
  --bg-soft: #fbfcfd;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d7dde5;
  --line-strong: #c3cbd6;
  --brand-blue: #012F46;
  --brand-red: #ED0A3A;
  --brand-blue-rgb: 1, 47, 70;
  --brand-red-rgb: 237, 10, 58;
  --accent: var(--brand-blue);
  --accent-strong: #022437;
  --accent-soft: rgba(var(--brand-blue-rgb), 0.12);
  --accent-gradient: linear-gradient(135deg, var(--brand-blue), var(--brand-red));
  --accent-gradient-soft: linear-gradient(
    160deg,
    rgba(var(--brand-blue-rgb), 0.12) 0%,
    rgba(var(--brand-red-rgb), 0.1) 100%
  );
  --ok: #186a3b;
  --warn: #8a5b14;
  --error: #b42318;
  --radius-control: 8px;
  --radius-surface: 10px;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    var(--accent-gradient-soft);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.028) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 70%);
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4.8vw, 52px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.page {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 36px;
  flex: 1 0 auto;
  position: relative;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: rgba(243, 245, 247, 0.94);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 0;
}

.site-logo {
  display: block;
  height: 44px;
  width: auto;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.site-header-auth {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.site-city-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.site-city-switcher-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.topnav-city-select {
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font-weight: 600;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.topnav-link:hover,
.topnav-link:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
  outline: none;
}

.topnav-link.active {
  color: var(--accent-strong);
  background: var(--surface);
  border-color: var(--line);
}

.topnav-user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-weight: 600;
}

.topnav-link-logout {
  color: var(--ink);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 22px;
}

.subnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.subnav-link:hover,
.subnav-link:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
}

.subnav-link.active {
  color: var(--accent-strong);
  border-color: rgba(var(--brand-red-rgb), 0.45);
  background: rgba(var(--brand-red-rgb), 0.12);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.monitor-hero {
  grid-template-columns: minmax(0, 1fr);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.lead {
  max-width: 860px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.hero-actions {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.hero-actions form {
  margin: 0;
}

.hero-tasks {
  grid-template-columns: minmax(0, 1fr);
}

.hero-tasks .hero-actions {
  justify-items: stretch;
}

.task-hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.task-hero-actions form {
  flex: 0 0 auto;
}

button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button:hover,
button:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  outline: none;
}

.danger-button {
  background: #f8d7da;
  border-color: #e4afb4;
  color: #7a1f2a;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: #f2c6cc;
  border-color: #d9929a;
  color: #5b1820;
}

.status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.error {
  color: var(--error);
}

.panel {
  margin-bottom: 24px;
}

.settings-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}

.settings-top-panel {
  margin-bottom: 0;
}

.settings-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.settings-overview-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-reference-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-reference-item {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.settings-reference-item dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-reference-item dd {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.settings-placeholder-panel .status {
  margin-top: 12px;
}

.ratings-add-form {
  max-width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.ratings-add-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

#ratingsFormStatus {
  margin: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.ratings-rank {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-red-rgb), 0.36);
  background: rgba(var(--brand-red-rgb), 0.1);
  color: var(--accent-strong);
  font-weight: 700;
}

.ratings-inline-input,
.ratings-inline-select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  font-size: 13px;
}

.ratings-metric-input,
.ratings-inline-number {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  font-size: 13px;
  min-width: 168px;
  font-variant-numeric: tabular-nums;
}

#ratingsTableBody td:nth-child(4),
#ratingsTableBody td:nth-child(5) {
  min-width: 188px;
}

.ratings-inline-link {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.ratings-inline-link:hover,
.ratings-inline-link:focus-visible {
  text-decoration: underline;
}

.ratings-open-actions {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ratings-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(var(--brand-red-rgb), 0.44);
  border-radius: var(--radius-control);
  background: rgba(var(--brand-red-rgb), 0.14);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.ratings-open-button:hover,
.ratings-open-button:focus-visible {
  border-color: rgba(var(--brand-red-rgb), 0.7);
  background: rgba(var(--brand-red-rgb), 0.2);
}

.ratings-inactive-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #e4afb4;
  border-radius: 999px;
  background: #fff1f0;
  color: #9c2f27;
  font-size: 11px;
  font-weight: 700;
}

.ratings-inline-muted,
.ratings-inline-station-name {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ratings-empty-row {
  text-align: center;
  color: var(--muted);
}

.settings-panel-modes {
  grid-column: 1;
}

.settings-top-panel .settings-form {
  max-width: 100%;
}

.settings-add-station-panel {
  grid-column: 1;
  margin-bottom: 0;
}

.settings-add-station-panel .settings-form {
  max-width: 100%;
}

.settings-panel-system {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.panel-header.settings-compact-header {
  display: grid;
  gap: 6px;
  align-items: start;
}

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

.stations-grid .station-panel {
  margin-bottom: 0;
}

.panel-header.station-panel-header {
  display: grid;
  gap: 6px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.station-panel.is-active .panel-header.station-panel-header {
  border-color: #9ad0af;
  background: #edf9f1;
}

.station-panel.is-active .panel-header.station-panel-header h2 {
  color: #13673b;
}

.station-panel.is-inactive .panel-header.station-panel-header {
  border-color: #e7b4b0;
  background: #fff1f0;
}

.station-panel.is-inactive .panel-header.station-panel-header h2 {
  color: #9c2f27;
}

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

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.compact {
  margin-top: 18px;
}

.stats-grid,
.status-grid,
.cards,
.advertisers,
.item-list {
  display: grid;
  gap: 10px;
}

.stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 24px;
}

.status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stat-card,
.status-card,
.block-card,
.advertiser-card,
.item-card,
.inset-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow-soft);
}

.stat-card,
.status-card {
  min-height: 112px;
  padding: 14px 16px;
}

.stat-card span,
.status-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong,
.status-card strong {
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 18px;
}

.equal-top {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.inset-panel {
  padding: 14px 16px 16px;
}

.form-grid,
.settings-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.form-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.form-grid > button {
  width: 100%;
}

.settings-form {
  max-width: 820px;
}

.station-settings-form {
  max-width: 980px;
  gap: 10px;
}

.station-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}

.station-field-wide {
  grid-column: 1 / -1;
}

.station-recording-hint {
  overflow-wrap: anywhere;
}

.station-meta-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: end;
}

.station-active-row {
  min-height: 40px;
}

.station-monitoring-field {
  display: grid;
  gap: 6px;
}

.station-monitoring-inline {
  width: max-content;
  grid-template-columns: repeat(2, minmax(92px, 116px));
  gap: 8px;
}

.station-time-input {
  min-height: 34px;
  padding: 7px 10px;
}

.station-windows-field textarea {
  min-height: 72px;
}

.add-station-windows-field textarea {
  min-height: 72px;
}

.station-settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.station-save-button {
  transition: background-color 0.28s ease, border-color 0.28s ease, color 0.28s ease, box-shadow 0.28s ease;
}

.station-save-button.is-saving {
  background: #64748b;
  border-color: #64748b;
}

.station-save-button.is-success {
  background: #1f8a4c;
  border-color: #1f8a4c;
}

.station-save-button.is-error {
  background: #c43d33;
  border-color: #c43d33;
}

.station-save-feedback {
  margin: 0;
  min-height: 1.1em;
  font-size: 13px;
  color: var(--muted);
}

.station-save-feedback.is-saving {
  color: var(--warn);
}

.station-save-feedback.is-success {
  color: var(--ok);
}

.station-save-feedback.is-error {
  color: var(--error);
}

.mode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.mode-copy {
  display: grid;
  gap: 4px;
}

.mode-copy strong {
  font-size: 15px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mode-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mode-label-left,
.mode-label-right {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mode-slider {
  width: 56px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #9eacbe;
  background: #d6dee8;
  position: relative;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.mode-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.mode-toggle input:checked + .mode-slider {
  background: #0f172a;
  border-color: #0f172a;
}

.mode-toggle input:checked + .mode-slider::after {
  transform: translateX(26px);
}

.mode-save-status {
  margin-top: 2px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: #8a99ab;
  box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.08);
  outline: none;
}

.inline-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.task-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.analysis-action-cell form {
  margin: 0;
}

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

.secondary-button {
  background: var(--accent-soft);
  border-color: var(--line-strong);
  color: var(--accent-strong);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: #dde5ef;
  border-color: #aab6c4;
  color: var(--accent-strong);
}

.folder-dialog {
  width: min(720px, calc(100% - 32px));
  border: 0;
  padding: 0;
  border-radius: var(--radius-surface);
  background: transparent;
}

.folder-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.folder-dialog-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.folder-dialog-header,
.folder-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.folder-dialog-path {
  margin: 0;
  color: var(--muted);
  word-break: break-all;
}

.folder-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.folder-item {
  justify-content: flex-start;
  text-align: left;
}

.folder-empty {
  margin: 0;
  color: var(--muted);
}

small {
  color: var(--muted);
  line-height: 1.45;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row span {
  margin: 0;
}

.delete-form {
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.recent-table-wrap {
  max-height: 260px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.45;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f8fafc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-action-cell {
  width: 1%;
  white-space: nowrap;
}

.table-action-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.advertiser-rename-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.advertiser-rename-input {
  min-width: 180px;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.row-no-creatives td {
  background: #fdecec;
}

.recent-added-row td {
  background: #fff5bf;
}

.creative-merge-row {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.creative-merge-row:hover td:not(.inline-edit-cell) {
  background: #f7fafd;
}

.creative-merge-row:focus-visible {
  outline: 2px solid rgba(211, 173, 50, 0.7);
  outline-offset: -2px;
}

.creative-merge-row.is-primary td:not(.inline-edit-cell) {
  background: #edf7ff;
}

.creative-merge-row.is-primary [data-merge-role-label] {
  color: #0e5a93;
  font-weight: 700;
}

.creative-merge-row.is-secondary [data-merge-role-label] {
  color: #7e8fa3;
}

.inline-edit-cell {
  min-width: 170px;
  cursor: text;
  background: rgba(255, 255, 255, 0.75);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.inline-edit-cell:focus {
  background: #fffef0;
  box-shadow: inset 0 0 0 1px #d3ad32;
  outline: none;
}

.inline-edit-cell.is-saving {
  background: #fff4df;
}

.inline-edit-cell.is-saved {
  background: #e8f7ee;
}

.inline-edit-cell.is-error {
  background: #fdecec;
}

.station-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.station-pill {
  border: 1px solid #c9d4e1;
  border-radius: 999px;
  background: #f5f8fc;
  color: #2f455c;
  padding: 2px 6px;
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: default;
}

[data-merge-fill-canonical].station-pill {
  cursor: pointer;
}

[data-merge-fill-canonical].station-pill:hover,
[data-merge-fill-canonical].station-pill:focus {
  border-color: #d3ad32;
  outline: none;
}

.station-selection-form {
  display: grid;
  gap: 10px;
}

.station-selection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.station-selection-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c9d4e1;
  border-radius: 999px;
  background: #f5f8fc;
  color: #2f455c;
  font-size: 13px;
  font-weight: 600;
}

.station-selection-button:hover,
.station-selection-button:focus-visible {
  border-color: #94a4b6;
  background: #eef3f9;
}

.station-selection-button.is-active {
  border-color: rgba(var(--brand-red-rgb), 0.58);
  background: rgba(var(--brand-red-rgb), 0.17);
  color: #8a1737;
}

.station-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.station-view-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.database-live-search {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.database-live-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.database-live-search-input {
  flex: 1 1 320px;
}

.database-live-search-clear {
  min-height: 40px;
}

.rim-page-size-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.station-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.station-view-button:hover,
.station-view-button:focus-visible {
  border-color: var(--accent);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.station-view-button.is-active {
  border-color: rgba(var(--brand-red-rgb), 0.45);
  background: rgba(var(--brand-red-rgb), 0.12);
  color: var(--accent-strong);
}

.creative-advertiser-input {
  width: 100%;
  min-width: 180px;
  padding: 7px 9px;
  border: 1px solid #d6dde7;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
}

.creative-advertiser-input:focus {
  outline: none;
  border-color: #d3ad32;
  box-shadow: 0 0 0 2px rgba(211, 173, 50, 0.18);
}

.creative-advertiser-input.is-saving {
  background: #fff4df;
}

.creative-advertiser-input.is-saved {
  background: #e8f7ee;
}

.creative-advertiser-input.is-error {
  background: #fdecec;
}

.creative-advertiser-picker {
  position: relative;
  min-width: 280px;
}

.creative-advertiser-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.creative-advertiser-toggle {
  border: 1px solid #d6dde7;
  border-radius: 8px;
  background: #f7f9fc;
  color: #2f455c;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.creative-advertiser-toggle:hover,
.creative-advertiser-toggle:focus {
  border-color: #d3ad32;
  outline: none;
}

.creative-advertiser-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d6dde7;
  border-radius: 12px;
  box-shadow: 0 18px 32px rgba(37, 52, 68, 0.16);
  padding: 10px;
}

.creative-advertiser-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d6dde7;
  border-radius: 8px;
  font: inherit;
  margin-bottom: 8px;
}

.creative-advertiser-search:focus {
  outline: none;
  border-color: #d3ad32;
  box-shadow: 0 0 0 2px rgba(211, 173, 50, 0.18);
}

.creative-advertiser-options {
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.creative-advertiser-option {
  width: 100%;
  border: 1px solid #e0e6ee;
  border-radius: 8px;
  background: #fbfcfe;
  color: #24364a;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.creative-advertiser-option:hover,
.creative-advertiser-option:focus {
  outline: none;
  border-color: #d3ad32;
  background: #fff7df;
}

.creative-advertiser-option.is-current {
  background: #eef4fb;
  border-color: #b9cadf;
}

.creative-advertiser-empty {
  margin: 0;
  color: #657789;
  font-size: 13px;
  line-height: 1.4;
}

.monitor-overview {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 24px;
  align-items: stretch;
}

.monitor-stats-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.monitor-ribbon-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% -24%, rgba(var(--brand-blue-rgb), 0.24), transparent 50%),
    radial-gradient(circle at -10% 120%, rgba(var(--brand-red-rgb), 0.2), transparent 54%),
    linear-gradient(165deg, #fbfdff 0%, #f3f6fb 56%, #eef2f7 100%);
  border: 1px solid rgba(var(--brand-blue-rgb), 0.18);
  border-radius: 24px;
  box-shadow:
    0 18px 36px rgba(17, 24, 39, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  padding: 16px 18px 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 234px;
  font-family: "Manrope", "Aptos", "Segoe UI", sans-serif;
}

.monitor-ribbon-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(var(--brand-blue-rgb), 0.08),
    rgba(var(--brand-blue-rgb), 0.3),
    rgba(var(--brand-red-rgb), 0.2),
    rgba(var(--brand-red-rgb), 0.06)
  );
  pointer-events: none;
}

.monitor-ribbon-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.monitor-ribbon-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.monitor-ribbon-head h2 {
  font-family: "Space Grotesk", "Manrope", "Aptos", "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #0e2235;
}

.monitor-ribbon-current {
  margin: 0 auto 12px;
  width: fit-content;
  min-height: 34px;
  padding: 7px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-blue-rgb), 0.2);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 6px 18px rgba(var(--brand-blue-rgb), 0.1);
  text-align: center;
  color: #21384c;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.monitor-ribbon-title p {
  margin: 0;
  max-width: 360px;
  color: #66788a;
  font-size: 12px;
  line-height: 1.35;
}

.monitor-ribbon-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.task-pause-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
}

.monitor-ribbon-card .task-pause-buttons button {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 18px;
  font-family: "Manrope", "Aptos", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(var(--brand-blue-rgb), 0.22);
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.monitor-ribbon-card .task-pause-buttons button:hover,
.monitor-ribbon-card .task-pause-buttons button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(var(--brand-blue-rgb), 0.18);
}

.monitor-ribbon-card #pauseTasksButton {
  background: linear-gradient(160deg, #063954, #0b4a69);
  border-color: rgba(6, 57, 84, 0.92);
  color: #f7fbff;
}

.monitor-ribbon-card #pauseTasksButton:hover,
.monitor-ribbon-card #pauseTasksButton:focus-visible {
  background: linear-gradient(160deg, #052f45, #0a3f5a);
  border-color: #04283b;
}

.monitor-ribbon-card #resumeTasksButton.secondary-button {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(var(--brand-blue-rgb), 0.16);
  color: #24455b;
}

.monitor-ribbon-card #resumeTasksButton.secondary-button:hover,
.monitor-ribbon-card #resumeTasksButton.secondary-button:focus-visible {
  background: #ffffff;
  border-color: rgba(var(--brand-blue-rgb), 0.28);
}

.monitor-ribbon-card .task-pause-buttons button:disabled {
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

#monitorTasksPauseStatus {
  margin: 0;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgba(var(--brand-blue-rgb), 0.18);
  background: rgba(255, 255, 255, 0.78);
  color: #274157;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

#monitorTasksPauseStatus.status.ok {
  color: #1c3f57;
  border-color: rgba(var(--brand-blue-rgb), 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(var(--brand-blue-rgb), 0.06));
}

#monitorTasksPauseStatus.status.warn {
  color: #74511c;
  border-color: rgba(140, 96, 26, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(196, 140, 48, 0.14));
}

.activity-wheel {
  min-width: 0;
}

.activity-wheel-viewport {
  position: relative;
  height: 176px;
  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(var(--brand-blue-rgb), 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.55)),
    linear-gradient(160deg, rgba(var(--brand-blue-rgb), 0.08), rgba(var(--brand-red-rgb), 0.07));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 24px rgba(17, 24, 39, 0.06);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--brand-blue-rgb), 0.28) transparent;
}

.activity-wheel-viewport::-webkit-scrollbar {
  width: 6px;
}

.activity-wheel-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.activity-wheel-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(var(--brand-blue-rgb), 0.3);
}

.activity-wheel-viewport::before,
.activity-wheel-viewport::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  pointer-events: none;
  z-index: 2;
}

.activity-wheel-viewport::before {
  top: 0;
  background: linear-gradient(180deg, rgba(245, 248, 252, 0.96), rgba(245, 248, 252, 0));
}

.activity-wheel-viewport::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(245, 248, 252, 0.96), rgba(245, 248, 252, 0));
}

.activity-wheel-centerline {
  display: none;
}

.activity-wheel-list {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  gap: 10px;
}

.activity-wheel-item {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(var(--brand-blue-rgb), 0.12);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 3px 12px rgba(17, 24, 39, 0.05);
  text-align: center;
  scroll-snap-align: center;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    color 0.22s ease,
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.activity-wheel-text {
  display: -webkit-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 13px;
  line-height: 1.35;
  color: #445567;
  font-weight: 600;
}

.activity-wheel-item.is-current .activity-wheel-text {
  -webkit-line-clamp: 3;
  font-size: 14px;
  font-weight: 700;
  color: #12354f;
}

.activity-wheel-item.is-current {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(var(--brand-blue-rgb), 0.24);
  box-shadow:
    0 12px 24px rgba(var(--brand-blue-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.activity-wheel-item.status-running.is-current .activity-wheel-text,
.activity-wheel-item.status-started.is-current .activity-wheel-text {
  color: #0a5478;
}

.activity-wheel-item.status-queued.is-current .activity-wheel-text {
  color: #7a5317;
}

.activity-wheel-item.status-failed.is-current .activity-wheel-text,
.activity-wheel-item.status-error.is-current .activity-wheel-text {
  color: #8f2f2a;
}

.activity-wheel-item.distance-0 {
  opacity: 1;
  transform: scale(1.01);
}

.activity-wheel-item.distance-1,
.activity-wheel-item.distance--1 {
  opacity: 0.64;
  transform: scale(0.986);
}

.activity-wheel-item.distance-2,
.activity-wheel-item.distance--2 {
  opacity: 0.4;
  transform: scale(0.97);
}

.activity-wheel-item.distance-3,
.activity-wheel-item.distance--3 {
  opacity: 0.22;
  transform: scale(0.955);
}

.monitor-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.monitor-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow-soft);
}

.monitor-card.status-listening {
  border-color: rgba(24, 106, 59, 0.3);
  background: linear-gradient(180deg, rgba(232, 247, 238, 0.92), rgba(255, 255, 255, 0.96));
}

.monitor-card.status-error,
.monitor-card.status-stalled {
  border-color: rgba(180, 35, 24, 0.28);
  background: linear-gradient(180deg, rgba(253, 236, 236, 0.9), rgba(255, 255, 255, 0.96));
}

.monitor-card.status-reconnecting,
.monitor-card.status-connecting,
.monitor-card.status-starting,
.monitor-card.status-restarting {
  border-color: rgba(138, 91, 20, 0.28);
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.9), rgba(255, 255, 255, 0.96));
}

.monitor-card-head {
  display: flex;
  align-items: start;
  justify-content: flex-start;
  gap: 12px;
}

.monitor-card-title {
  min-width: 0;
}

.monitor-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.monitor-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.auto-recording-pill,
.audio-toggle-button,
.monitor-station-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.auto-recording-pill {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #8f2d2d;
  border-color: rgba(191, 62, 62, 0.22);
  background: rgba(255, 226, 226, 0.95);
}

.audio-toggle-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
}

.monitor-station-link {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.monitor-station-link:hover,
.monitor-station-link:focus-visible {
  background: rgba(248, 250, 252, 1);
  transform: translateY(-1px);
  outline: none;
}

.audio-toggle-button:hover:not(:disabled) {
  background: rgba(248, 250, 252, 1);
  transform: translateY(-1px);
}

.audio-toggle-button.is-active {
  background: rgba(24, 106, 59, 0.12);
  border-color: rgba(24, 106, 59, 0.35);
}

.audio-toggle-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-audio-player-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.app-audio-player-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-audio-player-trigger {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.app-audio-player-summary {
  font-size: 12px;
  line-height: 1.35;
  color: #5b6b79;
}

.app-audio-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.app-audio-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.app-audio-modal-card {
  position: relative;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(30, 41, 59, 0.12);
  background: #ffffff;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.app-audio-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-audio-modal-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.app-audio-modal-subtitle,
.app-audio-modal-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #5b6b79;
}

.app-audio-player-control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(var(--brand-blue-rgb), 0.06), rgba(var(--brand-red-rgb), 0.05)),
    #ffffff;
  padding: 10px;
}

.app-audio-player-media {
  display: none;
}

.app-audio-player-ui {
  display: grid;
  gap: 10px;
}

.app-audio-player-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-audio-player-play {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(var(--brand-blue-rgb), 0.35);
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.app-audio-player-play:hover,
.app-audio-player-play:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(var(--brand-blue-rgb), 0.25);
  outline: none;
}

.app-audio-player-play:active {
  transform: translateY(0);
}

.app-audio-player-time {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #23374b;
}

.app-audio-player-time-separator {
  color: #6b7a88;
}

.app-audio-player-seek {
  --seek-progress: 0%;
  width: 100%;
  margin: 0;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(
    90deg,
    rgba(var(--brand-blue-rgb), 0.92) 0,
    rgba(var(--brand-red-rgb), 0.9) var(--seek-progress),
    #dbe2ea var(--seek-progress),
    #dbe2ea 100%
  );
  cursor: pointer;
}

.app-audio-player-seek:focus-visible {
  outline: 2px solid rgba(var(--brand-blue-rgb), 0.45);
  outline-offset: 2px;
}

.app-audio-player-seek:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-audio-player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(var(--brand-blue-rgb), 0.3);
}

.app-audio-player-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(var(--brand-blue-rgb), 0.3);
}

.app-audio-player-seek::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: transparent;
}

.app-audio-player-rates {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.app-audio-player-rate {
  min-height: 26px;
  min-width: 54px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #334a60;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.app-audio-player-rate:hover,
.app-audio-player-rate:focus-visible {
  border-color: rgba(var(--brand-blue-rgb), 0.45);
  color: #173449;
  outline: none;
}

.app-audio-player-rate.is-active {
  border-color: rgba(var(--brand-blue-rgb), 0.65);
  background: rgba(var(--brand-blue-rgb), 0.12);
  color: #102e43;
  font-weight: 700;
}

@media (max-width: 640px) {
  .app-audio-player-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-audio-player-time {
    font-size: 11px;
  }

  .app-audio-player-rate {
    min-width: 50px;
    padding: 0 7px;
  }
}

.app-audio-modal-trace-label {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #23374b;
}

.app-audio-modal-trace p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #31475d;
}

.app-audio-modal-path {
  word-break: break-word;
}

.app-audio-player-empty {
  margin: 0;
}

body.is-audio-modal-open {
  overflow: hidden;
}

.monitor-card-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.monitor-url {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.monitor-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.monitor-pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
  position: relative;
  background: #16a34a;
  --pulse-ripple: rgba(22, 163, 74, 0.45);
  --pulse-ripple-fade: rgba(22, 163, 74, 0);
  box-shadow: 0 0 0 0 var(--pulse-ripple);
  animation: monitorPulse 1.8s ease-out infinite;
}

.monitor-pulse.tone-ok {
  background: #16a34a;
  --pulse-ripple: rgba(22, 163, 74, 0.45);
  --pulse-ripple-fade: rgba(22, 163, 74, 0);
}

.monitor-pulse.tone-warn {
  background: #eab308;
  --pulse-ripple: rgba(234, 179, 8, 0.42);
  --pulse-ripple-fade: rgba(234, 179, 8, 0);
}

.monitor-pulse.tone-bad {
  background: #dc2626;
  --pulse-ripple: rgba(220, 38, 38, 0.42);
  --pulse-ripple-fade: rgba(220, 38, 38, 0);
}

@keyframes monitorPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 var(--pulse-ripple);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px var(--pulse-ripple-fade);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 var(--pulse-ripple-fade);
  }
}

.monitor-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.monitor-facts div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.monitor-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.monitor-facts dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.block-card,
.advertiser-card {
  padding: 14px 16px;
}

.item-card {
  padding: 12px 14px;
  background: #fafbfd;
}

.item-card strong,
.item-card span {
  display: block;
  margin-bottom: 4px;
}

.block-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.meta,
.transcript,
.advertiser-card span,
.advertiser-card small {
  color: var(--muted);
}

.transcript {
  line-height: 1.55;
}

.status-processed {
  border-color: rgba(24, 106, 59, 0.25);
}

.status-manual_pending,
.status-scheduled,
.status-needs_transcription,
.status-pending,
.status-processing,
.status-retry {
  border-color: rgba(138, 91, 20, 0.26);
}

.status-ignored {
  border-color: rgba(91, 100, 114, 0.28);
}

.status-error {
  border-color: rgba(180, 35, 24, 0.24);
}

.date-picker {
  position: relative;
}

.date-picker-trigger,
.date-picker-nav,
.date-picker-day {
  box-shadow: none;
}

.date-picker-trigger {
  width: 100%;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 400;
}

.date-picker-trigger::after {
  content: "v";
  color: var(--muted);
  font-size: 11px;
}

.date-picker-trigger:hover,
.date-picker-trigger:focus-visible {
  background: var(--surface-strong);
  border-color: #8a99ab;
  color: var(--ink);
}

.date-picker-trigger.is-empty {
  color: var(--muted);
}

.date-picker-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(14px);
}

.date-picker-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.date-picker-header strong {
  text-align: center;
  font-size: 14px;
  text-transform: capitalize;
}

.date-picker-nav {
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
}

.date-picker-nav:hover,
.date-picker-nav:focus-visible {
  background: #e5ebf3;
  border-color: var(--line-strong);
  color: var(--accent-strong);
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.date-picker-weekdays {
  margin-bottom: 8px;
}

.date-picker-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.date-picker-day {
  min-height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.06);
  color: var(--ink);
  font-weight: 600;
}

.date-picker-day.is-available {
  background: rgba(var(--brand-red-rgb), 0.18);
  border-color: rgba(var(--brand-red-rgb), 0.46);
  color: var(--accent-strong);
  opacity: 1;
}

.date-picker-day.is-available:hover,
.date-picker-day.is-available:focus-visible {
  background: rgba(var(--brand-red-rgb), 0.26);
  border-color: rgba(var(--brand-red-rgb), 0.62);
  color: var(--accent-strong);
}

.date-picker-day.is-unavailable {
  opacity: 0.16;
  cursor: default;
}

.date-picker-day.is-outside {
  opacity: 0.1;
}

.date-picker-day.is-outside.is-available {
  opacity: 0.48;
}

.date-picker-day.is-selected,
.date-picker-day.is-selected:hover,
.date-picker-day.is-selected:focus-visible {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  opacity: 1;
}

.date-picker-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.analysis-progress-panel {
  margin-top: -4px;
}

.analysis-progress-shell {
  display: grid;
  gap: 14px;
}

.analysis-progress-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.analysis-progress-summary strong {
  font-size: clamp(28px, 4vw, 40px);
}

.analysis-progress-summary span {
  color: var(--muted);
  font-size: 16px;
}

.analysis-progress-bar {
  position: relative;
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.08);
}

.analysis-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
  transition: width 0.25s ease;
}

.analysis-audio-section {
  margin: 0 0 18px;
}

.analysis-audio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.analysis-audio-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.analysis-audio-time,
.analysis-audio-topic {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.analysis-audio-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.analysis-audio-player {
  width: 100%;
  min-height: 34px;
}

.station-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.analysis-station-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-panel);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(160deg, rgba(var(--brand-blue-rgb), 0.08), rgba(var(--brand-red-rgb), 0.07));
  box-shadow: var(--shadow-soft);
}

.analysis-station-card-link {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.analysis-station-card > *:not(.analysis-station-card-link) {
  position: relative;
  z-index: 1;
}

.analysis-station-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.analysis-station-card-head h2 {
  margin: 4px 0 0;
  font-size: 26px;
}

.analysis-station-summary {
  display: grid;
  gap: 12px;
}

.analysis-station-row {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  align-items: start;
}

.analysis-station-row span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.analysis-station-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.analysis-card-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto 0;
  padding: 16px 18px;
  border-radius: var(--radius-surface) var(--radius-surface) 0 0;
  background: #e6ebf1;
  color: #111827;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px 18px;
}

.readonly-banner {
  margin-top: 10px;
}

.readonly-disabled-form {
  opacity: 0.72;
}

.readonly-disabled-control {
  opacity: 0.55;
  pointer-events: none;
}

.page-login {
  min-height: 100vh;
}

.login-header {
  justify-content: center;
}

.login-panel {
  max-width: 520px;
  margin: 22px auto;
}

.login-panel .panel-header h1 {
  white-space: nowrap;
}

.login-form {
  gap: 14px;
}

.login-sessions-table {
  margin-bottom: 14px;
}

.users-create-form {
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.users-create-actions {
  display: grid;
  align-items: end;
}

.users-create-actions button {
  width: 100%;
}

.users-inline-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.users-inline-form input,
.users-inline-form select {
  min-height: 38px;
}

.users-inline-delete-form {
  margin: 0;
}

.city-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.city-tab-link {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.city-tab-link:hover,
.city-tab-link:focus-visible {
  border-color: rgba(var(--brand-red-rgb), 0.35);
  background: rgba(var(--brand-red-rgb), 0.08);
  transform: translateY(-1px);
  outline: none;
}

.city-tab-link.active {
  border-color: rgba(var(--brand-red-rgb), 0.5);
  background: rgba(var(--brand-red-rgb), 0.12);
}

.city-tab-link small {
  color: var(--muted);
}

.city-profile-grid {
  margin-top: 10px;
}

.city-danger-zone {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 24, 0.26);
  border-radius: var(--radius-control);
  background: rgba(180, 35, 24, 0.06);
  display: grid;
  gap: 10px;
}

.city-danger-zone h3 {
  margin: 0;
}

.city-danger-zone p {
  margin: 0;
}

.city-delete-dialog {
  width: min(620px, calc(100% - 32px));
  border: 0;
  padding: 0;
  border-radius: var(--radius-surface);
  background: transparent;
}

.city-delete-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.city-delete-dialog-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.city-delete-dialog-card h3,
.city-delete-dialog-card p {
  margin: 0;
}

.city-delete-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-footer-logo-link {
  display: inline-flex;
  align-items: flex-end;
  line-height: 0;
}

.site-footer-logo {
  display: block;
  height: 46px;
  width: auto;
}

.site-footer-contacts {
  display: grid;
  gap: 4px;
  justify-items: end;
  font-size: 14px;
}

.site-footer-contacts a {
  color: #000000;
  text-decoration: none;
}

.site-footer-contacts a:hover,
.site-footer-contacts a:focus-visible {
  text-decoration: underline;
}

.system-log-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 12px;
}

.system-log-controls label {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.system-log-stream {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  line-height: 1.2;
  min-height: 420px;
  max-height: 68vh;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.85);
  white-space: pre-wrap;
  word-break: break-word;
}

.system-log-line {
  border-bottom: 1px dashed rgba(17, 24, 39, 0.08);
  padding: 2px 0;
}

.system-log-line:last-child {
  border-bottom: 0;
}

.system-log-line-muted {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 720px) {
  .analysis-station-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.toggle-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(var(--brand-red-rgb), 0.4);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.toggle-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.toggle-button-indicator {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.85);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.8);
}

.toggle-button.is-on .toggle-button-indicator {
  border-color: rgba(5, 150, 105, 0.95);
  background: rgba(5, 150, 105, 0.18);
  box-shadow: inset 0 0 0 6px rgba(5, 150, 105, 0.9);
}

.button-link,
.analysis-run-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.analysis-run-button.is-loading {
  opacity: 0.75;
}

.analysis-action-cell {
  white-space: nowrap;
}

.is-selected-row td {
  background: rgba(var(--brand-red-rgb), 0.08);
}

@media (max-width: 1180px) {
  .hero,
  .content-grid,
  .equal-top {
    grid-template-columns: 1fr;
  }

  .monitor-overview {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .monitor-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-wheel-viewport {
    height: 188px;
  }

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

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

@media (max-width: 760px) {
  .page {
    width: min(100% - 20px, 100%);
    padding-top: 14px;
  }

  .site-header {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px;
  }

  .site-header-auth {
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .site-logo {
    height: 40px;
  }

  .monitor-stats-stack {
    grid-template-columns: 1fr 1fr;
  }

  .monitor-ribbon-head {
    display: grid;
    gap: 6px;
    align-items: start;
  }

  .monitor-ribbon-title p {
    max-width: none;
  }

  .monitor-ribbon-current {
    margin: 0 0 10px;
    width: auto;
    justify-content: flex-start;
    text-align: left;
  }

  .monitor-ribbon-controls {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .task-pause-buttons {
    justify-content: flex-start;
  }

  .hero {
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }

  .panel {
    margin-bottom: 18px;
  }

  .panel-header {
    display: grid;
    gap: 6px;
    align-items: start;
  }

  .stats-grid,
  .status-grid,
  .form-grid,
  .inline-form-row {
    grid-template-columns: 1fr;
  }

  .settings-top-grid,
  .stations-grid,
  .settings-overview-grid,
  .settings-reference-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-panel-modes,
  .settings-add-station-panel,
  .settings-panel-system {
    grid-column: auto;
    grid-row: auto;
  }

  .station-settings-grid {
    grid-template-columns: 1fr;
  }

  .users-inline-form {
    grid-template-columns: 1fr;
  }

  .station-meta-row {
    display: grid;
    gap: 8px;
    align-items: start;
  }

  .station-monitoring-inline {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    width: min(100% - 20px, 100%);
    padding: 14px 16px;
    align-items: start;
    margin-top: -6px;
  }

  .site-footer-logo {
    height: 40px;
  }

  .site-footer-contacts {
    justify-items: start;
    font-size: 13px;
  }

  .monitor-stats {
    grid-template-columns: 1fr;
  }

  .monitor-card-head {
    display: grid;
  }

  .monitor-facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .stat-card,
  .status-card,
  .monitor-card,
  .block-card,
  .advertiser-card,
  .item-card,
  .inset-panel,
  .form-grid,
  .settings-form,
  .table-wrap {
    border-radius: var(--radius-control);
  }
}

@media (max-width: 1180px) {
  .settings-top-grid,
  .stations-grid {
    grid-template-columns: 1fr;
  }

  .settings-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-reference-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel-modes,
  .settings-add-station-panel,
  .settings-panel-system {
    grid-column: auto;
    grid-row: auto;
  }

  .ratings-add-form {
    grid-template-columns: 1fr;
  }
}
