:root {
  color-scheme: light;
  --bg: #f3f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dde7f0;
  --line-strong: #c9d5df;
  --surface: #f8fafc;
  --surface-strong: #eef6fb;
  --primary: #00A1D6;
  --primary-strong: #0087BD;
  --primary-soft: #EAF8FC;
  --pink: #FB7299;
  --pink-soft: #FFF1F6;
  --accent: #B54708;
  --accent-soft: #FFFAEB;
  --danger: #D92D20;
  --danger-strong: #B42318;
  --danger-soft: #FEF3F2;
  --danger-line: #FECDCA;
  --success: #067647;
  --success-soft: #ECFDF3;
  --success-line: #ABEFC6;
  --warning: #B54708;
  --warning-soft: #FFFAEB;
  --warning-line: #FEDF89;
  --pending-soft: #EFF8FF;
  --pending-line: #B9E6FE;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.06);
  --shadow-raised: 0 8px 22px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fbfd 0%, var(--bg) 240px);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #ffffff;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar a {
  color: #374151;
  margin-right: 14px;
}

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

.brand {
  position: relative;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--primary);
  box-shadow: inset -3px 0 0 var(--pink);
}

.container {
  width: min(1500px, calc(100% - 32px));
  margin: 24px auto 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.narrow {
  max-width: 460px;
  margin: 70px auto;
}

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

h1,
h2 {
  margin-top: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 16px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

h2 {
  margin-bottom: 14px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 650;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 2px 0 8px;
  font-size: 30px;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-status span {
  padding: 7px 10px;
  border: 1px solid var(--pending-line);
  border-radius: 999px;
  background: var(--pending-soft);
  color: var(--primary-strong);
  font-weight: 700;
  white-space: nowrap;
}

.anchor-nav {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.anchor-nav a {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  color: #475467;
  font-weight: 700;
}

.anchor-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
  text-decoration: none;
}

.dashboard-section,
.dashboard-card {
  scroll-margin-top: 76px;
}

.dashboard-section {
  margin-bottom: 20px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.section-heading.compact h2 {
  font-size: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top-width: 3px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.kpi-card::after {
  display: none;
}

.kpi-label,
.kpi-hint {
  display: block;
  position: relative;
  z-index: 1;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 8px 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.kpi-hint {
  color: var(--muted);
  font-size: 12px;
}

.kpi-primary { border-top-color: var(--primary); }
.kpi-success { border-top-color: var(--success); }
.kpi-warning { border-top-color: var(--warning); }
.kpi-danger { border-top-color: var(--danger); }
.kpi-primary strong { color: var(--primary-strong); }
.kpi-success strong { color: var(--success); }
.kpi-warning strong { color: var(--warning); }
.kpi-danger strong { color: var(--danger-strong); }

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.ops-card {
  min-height: 250px;
  margin-bottom: 0;
}

.issue-list {
  display: grid;
  gap: 10px;
}

.issue-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

a.issue-item:hover {
  text-decoration: none;
  background: #ffffff;
  box-shadow: var(--shadow-hover);
}

.issue-item strong {
  color: var(--text);
  font-size: 14px;
}

.issue-item span,
.issue-item em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.issue-danger { border-left-color: var(--danger); }
.issue-warning { border-left-color: #f59e0b; }
.issue-success { border-left-color: var(--success); }

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.empty-state.compact {
  padding: 20px;
}

label {
  display: block;
  margin: 14px 0 6px;
  color: #374151;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  background: var(--card);
  color: var(--text);
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

textarea { resize: vertical; }

input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c4cbd5;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 161, 214, 0.14);
  outline-offset: 2px;
  border-color: var(--primary);
}

button,
.primary {
  display: inline-block;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: #374151;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

button.primary,
.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  margin-top: 14px;
}

button.danger {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

button:hover,
.primary:hover {
  border-color: #aeb8c6;
  background: var(--surface);
  box-shadow: var(--shadow);
}

button.primary:hover,
.primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #ffffff;
  text-decoration: none;
}

button.danger:hover {
  border-color: var(--danger-strong);
  background: var(--danger-strong);
  box-shadow: var(--shadow);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  box-shadow: none;
}

.staff-submit-form textarea {
  min-height: 168px;
}

.staff-submit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

button.staff-submit-button,
.staff-submit-button {
  min-height: 40px;
  margin-top: 0;
  padding: 8px 15px;
  border-color: #2f6f8f;
  border-radius: 8px;
  background: #347a9b;
  color: #ffffff;
  box-shadow: none;
  font-weight: 650;
  letter-spacing: 0;
}

button.staff-submit-button:hover,
.staff-submit-button:hover {
  border-color: #285f7a;
  background: #2f6e8d;
  color: #ffffff;
  box-shadow: none;
  text-decoration: none;
}

button.staff-submit-button:active,
.staff-submit-button:active {
  border-color: #24546d;
  background: #2a627e;
}

button.staff-submit-button:focus-visible,
.staff-submit-button:focus-visible {
  border-color: #24546d;
  outline-color: rgba(47, 111, 143, 0.24);
}

.inline {
  display: inline-block;
  margin: 0;
}

.link-button {
  color: #374151;
  background: transparent;
  border: 0;
  padding: 0;
  font-weight: 600;
}

.link-button:hover {
  color: var(--text);
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  text-decoration: underline;
}

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

.small {
  font-size: 13px;
  max-width: 360px;
}

.messages { margin-bottom: 16px; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--card);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success-line);
}

.alert-danger {
  background: var(--danger-soft);
  color: var(--danger-strong);
  border-color: var(--danger-line);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  max-height: 680px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

tbody tr:hover td { background: #f8fbfd; }

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

.row-failed td {
  background: #fffafa;
}

.row-failed:hover td {
  background: #fff6f5;
}

.sticky-col {
  position: sticky;
  right: 0;
  z-index: 2;
  background: inherit;
  box-shadow: -6px 0 10px rgba(15, 23, 42, 0.03);
}

th.sticky-col {
  z-index: 3;
  background: var(--surface);
}

td input,
td select {
  min-width: 96px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.status-success,
.status-visible {
  background: var(--success-soft);
  border-color: var(--success-line);
  color: var(--success);
}

.status-failed,
.status-check_failed {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger-strong);
}

.status-not_visible,
.status-skipped {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: var(--warning);
}

.status-pending {
  background: var(--pending-soft);
  border-color: var(--pending-line);
  color: var(--primary-strong);
}

.delay-fast {
  background: var(--success-soft);
  border-color: var(--success-line);
  color: var(--success);
}

.delay-slow {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger-strong);
}

.actions { white-space: nowrap; }

.actions form { margin-right: 6px; }

.actions input[type=password] {
  width: 130px;
  display: inline-block;
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.compact-form input,
.compact-form select {
  min-width: 0;
}

.filter-form {
  grid-template-columns: minmax(140px, 1.2fr) minmax(180px, 1.6fr) minmax(140px, 1.2fr) minmax(140px, 1.2fr) auto;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--pending-line);
  border-radius: 999px;
  background: var(--pending-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

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

.section-heading h2 { margin-bottom: 6px; }

.channel-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4b5563;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.channels-card { padding: 26px; }

.channel-create-form { margin: 20px 0; }

.channel-create-form .compact-form { margin-bottom: 10px; }

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.side-form,
.settings-form {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
}

.side-form h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

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

.channel-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.channel-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.channel-panel-head h3,
.channel-title-line h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 650;
}

.channel-panel-head .primary { margin-top: 0; }

.channel-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  align-items: start;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  color: #374151;
  font-weight: 600;
}

.form-field > label { margin: 0; }

.field-hint,
.summary-hint,
.form-help {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.form-help.is-error {
  color: var(--danger-strong);
  font-weight: 600;
}

.form-help.is-success {
  color: var(--success);
  font-weight: 600;
}

.span-2 { grid-column: span 2; }

.channel-enabled {
  min-height: 40px;
  margin: 25px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.channel-advanced {
  margin: 12px 0 0;
  color: var(--text);
}

.advanced-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.channel-advanced summary {
  cursor: pointer;
  color: #374151;
  font-weight: 650;
  list-style-position: inside;
  padding: 12px 14px;
}

.channel-advanced summary:hover { background: var(--surface); }

.channel-advanced summary span:first-child { margin-right: 8px; }

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px 16px;
  padding: 0 14px 14px;
  margin-top: 2px;
}

.advanced-grid label,
.advanced-grid .field > label {
  margin-top: 0;
}

.advanced-grid textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  min-height: 84px;
}

.advanced-row td {
  background: #fbfcfd;
  padding-top: 0;
}

.channel-list {
  display: grid;
  gap: 14px;
}

.channel-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--card);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.channel-card:hover {
  border-color: #cdd5df;
  box-shadow: var(--shadow-raised);
}

.channel-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 161, 214, 0.10);
}

.channel-card.is-disabled { background: #fbfcfd; }

.channel-card.is-dirty {
  border-color: #f3c969;
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.10);
}

.channel-card.is-submitting { opacity: 0.86; }

.channel-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.channel-title-block { min-width: 0; }

.channel-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.channel-id {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.channel-meta,
.channel-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.channel-meta span {
  color: var(--muted);
  font-size: 13px;
}

.channel-summary {
  justify-content: flex-end;
  max-width: 580px;
}

.channel-feedback {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
}

.channel-feedback.is-success {
  background: var(--success-soft);
  border-color: var(--success-line);
  color: var(--success);
}

.channel-feedback.is-error {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger-strong);
}

.channel-editor-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: clip;
}

.channel-editor-panel[open] {
  background: var(--card);
  border-color: var(--line-strong);
}

.channel-edit-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #374151;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.channel-edit-summary::-webkit-details-marker { display: none; }

.channel-edit-summary::after {
  content: "展开";
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.channel-editor-panel[open] > .channel-edit-summary::after {
  content: "收起";
}

.channel-edit-summary:hover { background: #f7f8fa; }

.channel-edit-form { padding: 14px; }

.channel-create-form.is-submitting,
.channel-edit-form.is-submitting {
  opacity: 0.88;
  pointer-events: none;
}

.form-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.form-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.form-section-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.form-section-head p { margin: 0; }

.config-chip {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: #4b5563;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-chip.ok {
  background: var(--success-soft);
  border-color: var(--success-line);
  color: var(--success);
}

.config-chip.warn {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: var(--warning);
}

.dirty-badge {
  display: none;
  padding: 3px 8px;
  border: 1px solid var(--warning-line);
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
}

.channel-card.is-dirty .dirty-badge { display: inline-block; }

.channel-actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.channel-actions-bar .primary { margin-top: 0; }

.hidden-form { display: none; }

.inline-check {
  margin: 8px 0 0;
  color: #374151;
}

.channel-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.channel-edit-form .advanced-card[open] {
  border-color: var(--line-strong);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

.checkbox input { width: auto; }

pre {
  max-width: 520px;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.kv div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.kv strong {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 3px;
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

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

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

@media (max-width: 900px) {
  .grid.two { grid-template-columns: 1fr; }

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

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

  .span-2 { grid-column: auto; }

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

  .hero-status { justify-content: flex-start; }

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

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

  .section-heading,
  .channel-panel-head,
  .channel-card-header,
  .channel-actions-bar,
  .form-section-head,
  .channel-edit-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .channel-enabled { margin-top: 0; }

  .channel-summary {
    justify-content: flex-start;
    max-width: none;
  }

  .channel-actions-bar .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    white-space: normal;
  }

  .channel-actions-bar button { flex: 1 1 140px; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 20px, 1500px); }

  .page-hero {
    padding: 20px;
    border-radius: 14px;
  }

  .page-hero h1 { font-size: 26px; }

  .anchor-nav { top: 0; }

  .kpi-grid,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .channels-card { padding: 18px; }

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

  .responsive-table {
    overflow: visible;
    max-height: none;
    border: 0;
    background: transparent;
  }

  .responsive-table table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
  }

  .responsive-table table {
    min-width: 0;
  }

  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .responsive-table tbody {
    display: grid;
    gap: 12px;
  }

  .responsive-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }

  .responsive-table td.empty {
    display: block;
  }

  .responsive-table td.empty::before {
    content: "";
  }

  .sticky-col {
    position: static;
    box-shadow: none;
  }

  .actions input[type=password] {
    width: 100%;
    margin: 8px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}


section.page-hero {
    display: none;
}
