:root {
  --page-bg: #ffffff;
  --surface: #f7f7f5;
  --surface-strong: #ffffff;
  --surface-muted: #eeeeeb;
  --ink: #111111;
  --muted: #5f6668;
  --line: #deded8;
  --accent: #f00610;
  --accent-deep: #9f0008;
  --accent-soft: #ffe6e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 92px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand-mark {
  width: 64px;
  height: auto;
}

.topbar-actions {
  position: absolute;
  right: clamp(18px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-wordmark {
  width: auto;
  height: 64px;
  max-width: min(280px, 46vw);
  object-fit: contain;
}

.exit-access {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 6px;
}

.exit-access:hover,
.exit-access:focus-visible {
  color: #ffffff;
  background: var(--ink);
}

.active-editors {
  position: absolute;
  left: 50%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: min(460px, 42vw);
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

.active-editors span {
  flex-basis: 100%;
  color: var(--accent-deep);
  font-weight: 700;
  text-transform: uppercase;
}

.active-editors strong {
  display: inline-flex;
  padding: 3px 8px;
  color: var(--ink);
  background: var(--surface-muted);
  border-radius: 6px;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 48px) 72px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.modal-kicker {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 54px;
  line-height: 1.02;
}

.page-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.section-nav .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-nav .active {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.section-nav span {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  padding: 2px 7px;
  color: inherit;
  background: rgba(95, 102, 104, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.section-nav .active span {
  background: rgba(255, 255, 255, 0.18);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.status-panel,
.station-table-wrap,
.access-panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(17, 17, 17, 0.05);
}

.schedule-table-wrap {
  margin-top: 24px;
}

.access-panel {
  width: 100%;
}

.access-panel h1 {
  font-size: 46px;
}

.access-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.access-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 24px;
}

.access-code-input {
  max-width: 180px;
  text-transform: uppercase;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 26px;
}

.section-title span,
.muted {
  color: var(--muted);
}

.station-table {
  min-width: 1140px;
  margin: 0;
}

.schedule-table {
  min-width: 1120px;
  margin: 0;
}

.station-table th,
.schedule-table th,
.access-code-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.sortable-heading {
  vertical-align: middle;
}

.sortable-heading > span {
  display: inline-flex;
  vertical-align: middle;
}

.sortable-heading.text-end {
  text-align: right;
}

.sort-button {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: 5px;
  color: var(--accent-deep);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
}

.sort-button:hover,
.sort-button:focus-visible {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.station-table td,
.schedule-table td,
.access-code-table td {
  font-size: 15px;
  vertical-align: middle;
}

.station-table td strong,
.station-table td span,
.schedule-table td strong,
.schedule-table td span,
.access-code-table td strong,
.access-code-table td span {
  display: block;
}

.station-table td strong,
.schedule-table td strong,
.access-code-table td strong {
  font-size: 16px;
}

.editorial-note {
  color: var(--muted);
  font-size: 13px;
}

.order-cell {
  color: var(--accent-deep);
  font-weight: 700;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--accent-deep);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: grab;
  font-weight: 700;
}

.drag-handle:active {
  cursor: grabbing;
}

.station-table tr[draggable="true"] {
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.station-table tr.is-dragging {
  opacity: 0.45;
}

.station-table tr.is-drop-target {
  background: var(--accent-soft);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-published,
.status-approved {
  color: #12351f;
  background: #dfeee4;
}

.status-draft,
.status-review,
.status-planned {
  color: #4a3511;
  background: #f4ead7;
}

.status-archived,
.status-idea,
.status-tbd {
  color: #4a2a2a;
  background: #f1dddd;
}

.status-confirmed {
  color: #12351f;
  background: #dfeee4;
}

.status-soft {
  color: #26322e;
  background: var(--surface-muted);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
  min-width: 220px;
}

.inline-form {
  display: inline;
}

.reorder-form {
  display: flex;
  justify-content: end;
}

.modal-content {
  border: 0;
  border-radius: 8px;
}

.modal-header,
.modal-footer {
  padding: 22px 26px;
}

.modal-body {
  padding: 24px 26px;
}

.edit-meta,
.edit-lock-warning {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.edit-meta span,
.edit-lock-warning span {
  display: block;
}

.edit-meta strong {
  color: var(--ink);
}

.edit-lock-warning {
  color: #4a3511;
  background: #f4ead7;
  border-color: #e4d2b5;
}

.edit-lock-warning strong {
  color: #2f210a;
}

.access-code-section + .access-code-section {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.access-codes-body {
  display: grid;
  gap: 24px;
}

.access-code-section h3 {
  margin: 0 0 16px;
  font-size: 21px;
}

.access-code-form {
  display: grid;
  gap: 18px;
}

.access-create-grid {
  margin-bottom: 0;
}

.station-restriction {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.station-restriction strong,
.station-restriction span {
  display: block;
}

.station-restriction span {
  color: var(--muted);
  font-size: 14px;
}

.station-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.station-checkbox {
  display: flex;
  gap: 8px;
  align-items: start;
  min-width: 0;
  color: #333333;
  font-size: 14px;
}

.station-checkbox span {
  overflow-wrap: anywhere;
}

.station-checkbox small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.schedule-assignment {
  margin-bottom: 24px;
}

.access-code-table {
  min-width: 980px;
}

.access-code-table code {
  color: var(--accent-deep);
  font-size: 16px;
  font-weight: 700;
}

.form-grid,
.textarea-grid {
  display: grid;
  gap: 16px;
}

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

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

.single-textarea-grid {
  grid-template-columns: 1fr;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field span {
  color: #333333;
  font-size: 13px;
  font-weight: 700;
}

.textarea-field textarea {
  min-height: 132px;
  resize: vertical;
}

.alert {
  border-radius: 8px;
}

.btn-dark {
  --bs-btn-bg: var(--ink);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: var(--accent-deep);
  --bs-btn-hover-border-color: var(--accent-deep);
}

.btn-outline-dark {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: var(--ink);
  --bs-btn-hover-border-color: var(--ink);
}

.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent-deep);
  --bs-btn-active-border-color: var(--accent-deep);
}

.btn-outline-danger {
  --bs-btn-color: var(--accent-deep);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
}

@media (max-width: 860px) {
  .topbar {
    min-height: 76px;
    padding-inline: 16px;
  }

  .brand-mark {
    width: 48px;
  }

  .topbar-actions {
    right: 16px;
  }

  .brand-wordmark {
    display: none;
  }

  .page-shell {
    max-width: 100%;
    padding-inline: 20px;
  }

  .page-heading {
    display: block;
  }

  .section-nav,
  .section-actions,
  .page-heading .btn {
    width: 100%;
    margin-top: 18px;
  }

  .section-nav,
  .section-actions {
    display: grid;
    gap: 10px;
  }

  .active-editors {
    display: none;
  }

  .access-form {
    display: grid;
  }

  .access-code-input {
    max-width: none;
  }

  h1 {
    font-size: 42px;
  }

  .station-table-wrap {
    padding: 16px;
  }

  .form-grid,
  .textarea-grid,
  .station-checkbox-grid {
    grid-template-columns: 1fr;
  }
}
