:root {
  color-scheme: dark;
  --page-bg: #07111f;
  --page-bg-soft: #0b1728;
  --page-bg-accent: #12233a;
  --bg: var(--page-bg);
  --bg-accent: var(--page-bg-accent);
  --panel-bg: rgba(13, 25, 42, 0.9);
  --panel-bg-strong: rgba(17, 31, 52, 0.96);
  --panel-bg-muted: rgba(19, 36, 59, 0.72);
  --panel: var(--panel-bg);
  --panel-soft: var(--panel-bg-muted);
  --panel-strong: var(--panel-bg-strong);
  --panel-border: rgba(116, 158, 201, 0.24);
  --panel-border-strong: rgba(120, 185, 255, 0.38);
  --border: var(--panel-border);
  --border-strong: var(--panel-border-strong);
  --text: #edf6ff;
  --muted: #a8bad0;
  --muted-soft: #8498b1;
  --primary-accent: #5b8dff;
  --cyan-accent: #2dd4ff;
  --violet-accent: #9d7cff;
  --accent: var(--primary-accent);
  --accent-strong: #9fc2ff;
  --accent-soft: rgba(91, 141, 255, 0.18);
  --success: #4ade80;
  --danger: #ff6b72;
  --warning: #fbbf24;
  --success-bg: rgba(74, 222, 128, 0.12);
  --warning-bg: rgba(251, 191, 36, 0.14);
  --danger-bg: rgba(255, 107, 114, 0.14);
  --glow-cyan: 0 0 28px rgba(45, 212, 255, 0.18);
  --glow-violet: 0 0 34px rgba(157, 124, 255, 0.16);
  --radius-panel: 18px;
  --radius-card: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 24px 54px rgba(0, 0, 0, 0.36);
  --transition-fast: 160ms ease;
  --transition-base: 220ms ease;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 212, 255, 0.16), transparent 28%),
    radial-gradient(circle at 82% 6%, rgba(157, 124, 255, 0.15), transparent 26%),
    linear-gradient(180deg, #091526 0%, var(--page-bg) 48%, #050a13 100%);
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(120, 185, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 185, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 76%);
}

.page {
  max-width: 1540px;
  margin: 0 auto;
  padding: 18px 20px 32px;
}

.owner-auth-shell {
  display: grid;
  gap: 16px;
  width: min(100% - 32px, 760px);
  margin: 36px auto 0;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.owner-auth-shell.is-authenticated {
  grid-template-columns: minmax(240px, 1fr) minmax(260px, auto);
  align-items: center;
  width: min(100% - 40px, 1500px);
  margin-top: 18px;
  padding: 12px 16px;
}

.owner-auth-brand,
.owner-session-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.owner-auth-brand h1,
.owner-auth-brand p,
.owner-auth-card h2,
.owner-auth-card p,
.owner-session-bar strong,
.owner-session-bar span,
.owner-legacy-intro {
  margin: 0;
}

.owner-auth-brand p,
.owner-auth-card p,
.owner-session-bar span,
.owner-legacy-intro {
  color: var(--muted);
}

.owner-auth-card {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(120, 185, 255, 0.24);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, rgba(91, 141, 255, 0.12), transparent 52%),
    rgba(5, 12, 22, 0.5);
}

.owner-session-bar {
  justify-content: flex-end;
}

.owner-session-bar > div {
  display: grid;
  gap: 3px;
  text-align: right;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid rgba(159, 194, 255, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, #6d9cff 0%, #3b6ff0 100%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(59, 111, 240, 0.24);
}

.button-link:hover {
  background: linear-gradient(180deg, #83adff 0%, #4d7fff 100%);
}

.owner-legacy-auth {
  grid-column: 1 / -1;
  justify-self: stretch;
  width: 100%;
}

.owner-legacy-auth summary {
  text-align: left;
}

.owner-legacy-intro {
  margin-top: 10px;
  line-height: 1.5;
}

.owner-auth-pending .owner-auth-shell {
  opacity: 0.72;
}

.command-bar,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.command-bar h1,
.panel h2,
.form-group h3,
.metric-card h3,
.channel-operation-card h3 {
  margin: 0;
}

.command-bar p,
.panel-header p,
small {
  margin: 0;
  color: var(--muted-soft);
}

.api-config,
.settings-form,
.form-group {
  display: grid;
  gap: 12px;
}

.toolbar,
.settings-actions,
.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar,
.settings-actions {
  flex-wrap: wrap;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.control-center {
  padding-top: 16px;
  min-height: 600px;
}

.opportunity-context-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(45, 212, 255, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.08), transparent 42%),
    rgba(5, 12, 22, 0.58);
}

.opportunity-context-banner[hidden] {
  display: none;
}

.opportunity-context-banner h3,
.opportunity-context-banner p {
  margin: 0;
}

.opportunity-context-banner h3 {
  margin-top: 7px;
  font-size: 15px;
}

.opportunity-context-banner p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header > div {
  display: grid;
  gap: 6px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

input,
select,
textarea,
button {
  font: inherit;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    color var(--transition-fast);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(5, 12, 22, 0.78);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

input::placeholder,
textarea::placeholder {
  color: #6f829a;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(45, 212, 255, 0.62);
  box-shadow:
    0 0 0 4px rgba(45, 212, 255, 0.12),
    var(--glow-cyan);
}

textarea {
  min-height: 92px;
  line-height: 1.4;
  resize: vertical;
}

button {
  padding: 10px 14px;
  border: 1px solid rgba(159, 194, 255, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, #6d9cff 0%, #3b6ff0 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(59, 111, 240, 0.24);
}

button:hover {
  background: linear-gradient(180deg, #83adff 0%, #4d7fff 100%);
  transform: translateY(-1px);
  box-shadow:
    0 12px 26px rgba(59, 111, 240, 0.3),
    var(--glow-cyan);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: rgba(21, 38, 63, 0.88);
  color: var(--text);
  border-color: rgba(120, 185, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

button.secondary:hover {
  background: rgba(29, 51, 82, 0.96);
  border-color: rgba(45, 212, 255, 0.42);
}

button.secondary.danger {
  border-color: rgba(255, 107, 114, 0.34);
  color: #ffd1d4;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border: 1px solid rgba(120, 185, 255, 0.16);
}

button.ghost:hover {
  background: rgba(45, 212, 255, 0.08);
  color: var(--text);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

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

.form-group,
.metric-card,
.channel-operation-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.055), transparent 30%),
    linear-gradient(180deg, rgba(18, 34, 56, 0.94) 0%, rgba(12, 24, 40, 0.9) 100%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition:
    box-shadow var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base);
}

.form-group::before,
.metric-card::before,
.channel-operation-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan-accent), rgba(157, 124, 255, 0.68), transparent 72%);
  opacity: 0.58;
}

.metric-card:hover,
.channel-operation-card:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 255, 0.34);
  box-shadow: var(--shadow-hover);
}

.form-group {
  align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.form-grid {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  align-items: start;
}

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

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

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

.form-command-panel {
  gap: 14px;
}

.form-actions-row {
  align-items: center;
  min-height: 48px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  border-radius: 12px;
  background: rgba(7, 17, 31, 0.46);
}

.form-actions-row span {
  min-width: 0;
}

.compact-field-panel {
  padding: 12px;
}

.message-panel textarea {
  min-height: 180px;
}

.preview-panel {
  min-height: 100%;
}

.settings-form > .form-group {
  grid-column: span 4;
}

.settings-form > .form-group:only-of-type {
  grid-column: 1 / -1;
}

.form-group > h3,
.form-group > .form-group-intro,
.form-group > .settings-help,
.form-group > .metadata-warning,
.form-group > .message-builder,
.form-group > .editor-tools,
.form-group > .form-grid,
.form-group > .token-helper-list,
.form-group > .settings-summary-list,
.form-group > small,
.form-group > details {
  grid-column: 1 / -1;
}

.form-group label:has(textarea),
.form-group .settings-actions {
  grid-column: 1 / -1;
}

.form-group h3,
.metric-card h3,
.channel-operation-card h3 {
  margin-bottom: 4px;
}

.settings-actions {
  grid-column: 1 / -1;
}

.settings-summary-grid {
  display: grid;
  margin-bottom: 14px;
}

.settings-summary-card {
  display: grid;
  gap: 12px;
}

.settings-summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.settings-summary-list div {
  display: grid;
  gap: 3px;
}

.settings-summary-list dt {
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.settings-summary-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

.settings-summary-list.compact-list {
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.44);
}

.settings-summary-value.ok {
  color: var(--success);
}

.settings-summary-value.blocked {
  color: var(--danger);
}

.settings-summary-value.neutral {
  color: var(--text);
}

.settings-global-controls {
  border-color: rgba(251, 191, 36, 0.36);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(38, 33, 21, 0.9) 0%, rgba(16, 26, 42, 0.92) 100%);
}

.settings-state-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-state-row span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.settings-help {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.settings-help.warning {
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: var(--warning-bg);
  color: #ffe8a3;
}

.form-group-intro {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-status {
  min-height: 20px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(120, 185, 255, 0.1);
}

.form-status.success {
  background: var(--success-bg);
}

.form-status.error {
  background: var(--danger-bg);
}

.subpanel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.subpanel-header > div {
  display: grid;
  gap: 4px;
}

.subpanel-header h3 {
  font-size: 18px;
  line-height: 1.1;
}

.subpanel-header p,
.overview-status-copy,
.channel-operation-meta,
.channel-operation-detail,
.channel-row-summary-detail,
small {
  font-size: 12px;
}

#settings-status,
#manual-push-status,
#daily-trivia-status,
#feed-status,
#role-access-panel-status,
#role-followup-status,
#composer-status,
#composer-template-status,
#history-review-status {
  font-size: 14px;
  color: var(--muted);
}

.health-grid,
.metrics-grid,
.channel-operations-grid,
.channel-operations-list,
.feed-list {
  display: grid;
  gap: 14px;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.channel-operation-card {
  display: grid;
  gap: 10px;
}

.history-review-card,
.history-review-event-block,
.discord-panel-preview {
  display: grid;
  gap: 12px;
}

.discord-panel-preview {
  align-content: start;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  background: rgba(5, 12, 22, 0.58);
  min-height: 220px;
}

.discord-panel-preview-embed {
  display: grid;
  gap: 12px;
  padding: 15px 16px;
  border-left: 4px solid var(--success);
  border-radius: 8px;
  background: rgba(11, 22, 38, 0.9);
  box-shadow: var(--shadow-soft);
}

.discord-panel-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.discord-panel-preview-embed h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.discord-panel-preview-embed p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.discord-panel-preview button {
  justify-self: start;
  padding: 11px 16px;
  box-shadow: none;
}

.discord-panel-preview-context {
  display: grid;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(120, 185, 255, 0.12);
}

.discord-panel-preview-context p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.composer-form {
  grid-template-columns: minmax(230px, 0.65fr) minmax(380px, 1.35fr) minmax(300px, 0.9fr);
  gap: 12px;
}

.composer-form > .form-group {
  grid-column: auto;
}

.composer-message-group textarea {
  min-height: 240px;
}

.editor-side-panel {
  align-self: start;
}

.editor-main-panel {
  gap: 12px;
}

.editor-tools {
  display: grid;
  gap: 10px;
}

.editor-tools-panel {
  grid-column: 1 / -1;
}

.composer-preview-message {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(11, 22, 38, 0.9);
  box-shadow: var(--shadow-soft);
}

.composer-preview-author {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.composer-preview-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.composer-preview-mention {
  color: var(--accent-strong);
  font-weight: 700;
}

.composer-templates-panel {
  grid-column: 1 / -1;
}

.composer-template-actions {
  grid-column: auto;
}

.composer-templates-list {
  gap: 10px;
}

.role-followup-preview-flow {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.42);
}

.role-followup-preview-flow p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.role-followup-preview-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-followup-warning {
  color: var(--warning);
  font-weight: 700;
}

.inline-warning {
  margin-top: 2px;
}

.message-builder {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.42);
  border: 1px solid rgba(120, 185, 255, 0.16);
}

.message-builder-header {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.message-builder p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.message-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.token-helper-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.token-helper-list div {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.token-helper-list dt,
.token-helper-list dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.token-helper-list dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  color: var(--accent-strong);
}

.token-helper-list dd {
  color: var(--muted);
}

.token-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.pill-button {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: none;
}

.pill-button.secondary {
  background: rgba(21, 38, 63, 0.88);
  color: var(--text);
}

.pill-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.role-access-advanced {
  align-content: start;
}

.role-access-advanced summary {
  cursor: pointer;
  font-weight: 800;
}

.role-access-advanced[open] {
  gap: 12px;
}

.role-access-empty-callout {
  border-color: rgba(45, 212, 255, 0.26);
  background: linear-gradient(180deg, rgba(18, 34, 56, 0.96) 0%, rgba(11, 22, 38, 0.92) 100%);
}

.history-review-event-block {
  padding-top: 12px;
  border-top: 1px solid rgba(120, 185, 255, 0.12);
}

.history-review-event-block h4 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.history-review-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--text);
}

.history-review-link {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.history-review-rendering {
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.45);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history-review-link:hover {
  text-decoration: underline;
}

.history-ledger-toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.history-ledger-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 170px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-ledger-summary,
.history-ledger-list,
.history-ledger-health,
.history-ledger-exceptions,
.history-ledger-item-body,
.history-ledger-expanded-section,
.history-ledger-check-list {
  display: grid;
  gap: 10px;
}

.history-ledger-health,
.history-ledger-exceptions {
  padding: 14px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 12px;
  background: rgba(8, 18, 31, 0.55);
}

.history-ledger-health h4,
.history-ledger-exceptions h4,
.history-ledger-expanded-section h5 {
  margin: 0;
}

.history-ledger-list {
  gap: 12px;
}

.history-ledger-item {
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 12px;
  background: rgba(7, 16, 29, 0.68);
  overflow: hidden;
}

.history-ledger-item > summary {
  cursor: pointer;
  list-style-position: inside;
  padding: 14px;
}

.history-ledger-item[open] > summary {
  border-bottom: 1px solid rgba(120, 185, 255, 0.14);
}

.history-ledger-item-header {
  display: inline-grid;
  gap: 7px;
  width: calc(100% - 24px);
  vertical-align: top;
}

.history-ledger-item-header h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.history-ledger-item-body {
  padding: 14px;
}

.history-ledger-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 7px;
}

.history-ledger-score {
  padding: 7px 9px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 999px;
  background: rgba(21, 38, 63, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.history-ledger-claim {
  display: grid;
  gap: 8px;
  padding: 11px;
  border-left: 3px solid rgba(45, 212, 255, 0.48);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.5);
}

.history-ledger-evidence,
.history-ledger-check,
.history-ledger-exception,
.history-ledger-fixture {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.history-ledger-evidence {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(45, 212, 255, 0.06);
  color: var(--muted);
}

.history-ledger-check.passed {
  color: var(--success);
}

.history-ledger-check.failed,
.history-ledger-exception.critical {
  color: var(--danger);
}

.history-ledger-exception.warning {
  color: var(--warning);
}

.history-ledger-fixture {
  padding: 9px 11px;
  border: 1px solid rgba(255, 193, 7, 0.28);
  border-radius: 8px;
  background: rgba(255, 193, 7, 0.07);
  color: var(--warning);
  font-weight: 700;
}

.history-fallback-tools {
  margin-top: 4px;
}

.history-fallback-tools[open] {
  display: grid;
  gap: 12px;
}

.command-bar {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.1), transparent 32%),
    linear-gradient(145deg, rgba(157, 124, 255, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(18, 34, 56, 0.96) 0%, rgba(10, 22, 38, 0.92) 100%);
  overflow: hidden;
}

.command-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 255, 0.72), rgba(157, 124, 255, 0.54), transparent);
}

.command-bar > * {
  position: relative;
}

.command-bar-top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.command-bar-main,
.command-bar-brand {
  display: grid;
  gap: 10px;
}

.command-bar-main {
  grid-template-columns: minmax(240px, auto) minmax(0, 1fr);
  align-items: center;
}

.command-bar-brand h1 {
  font-size: 24px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.command-bar-brand p {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.command-bar-brand {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark-placeholder,
.brand-mark img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.brand-mark-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(45, 212, 255, 0.24), rgba(157, 124, 255, 0.18)),
    linear-gradient(180deg, rgba(19, 36, 59, 0.96) 0%, rgba(7, 17, 31, 0.96) 100%);
  border: 1px solid rgba(45, 212, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    var(--glow-cyan);
}

.brand-mark-placeholder span {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
}

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

.command-bar-controls {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: end;
}

.command-bar-tabs {
  margin-bottom: 0;
  align-self: start;
}

.automation-master-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(120, 185, 255, 0.24);
  background:
    linear-gradient(90deg, rgba(74, 222, 128, 0.08), transparent 40%),
    rgba(7, 17, 31, 0.42);
  box-shadow: var(--shadow-soft);
}

.automation-master-copy {
  display: grid;
  gap: 8px;
}

.automation-master-copy p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.automation-master-banner {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 114, 0.34);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.metadata-warning {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
}

.api-debug-panel {
  justify-self: end;
  width: min(100%, 520px);
  color: var(--muted);
  font-size: 12px;
}

.api-debug-panel summary {
  cursor: pointer;
  font-weight: 800;
  text-align: right;
}

.api-config.compact {
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius-card);
  background: rgba(5, 12, 22, 0.46);
  border: 1px solid rgba(120, 185, 255, 0.2);
}

.api-config.compact label {
  font-size: 12px;
}

#api-auth-status,
.api-pairing-panel {
  grid-column: 1 / -1;
}

.api-pairing-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: var(--warning-bg);
  color: var(--text);
}

.api-pairing-panel[hidden] {
  display: none;
}

.api-pairing-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.api-pairing-code-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#api-pairing-code {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.api-pairing-command {
  overflow-wrap: anywhere;
  color: var(--muted-soft);
}

.toolbar.compact {
  justify-content: flex-end;
}

.health-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.control-center-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 14px;
  background: rgba(5, 12, 22, 0.5);
  border: 1px solid rgba(120, 185, 255, 0.2);
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.control-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: none;
}

.control-tab:hover {
  background: rgba(45, 212, 255, 0.08);
  color: var(--text);
}

.control-tab.is-active {
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.2), rgba(157, 124, 255, 0.16)),
    rgba(21, 38, 63, 0.92);
  color: var(--text);
  border-color: rgba(45, 212, 255, 0.46);
  box-shadow: var(--glow-cyan);
}

.control-tab-panel[hidden] {
  display: none;
}

.tab-stack {
  display: grid;
  gap: 18px;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.ops-snapshot {
  margin-bottom: 18px;
}

.ops-snapshot .subpanel-header {
  align-items: flex-start;
}

.disclosure-block {
  display: block;
  margin-bottom: 18px;
}

.disclosure-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.disclosure-block > summary::-webkit-details-marker {
  display: none;
}

.disclosure-block > summary h3 {
  margin: 0 0 4px;
}

.disclosure-block > summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.disclosure-block[open] > summary {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(120, 185, 255, 0.16);
}

.disclosure-subheader {
  margin-bottom: 12px;
}

.statistics-panel {
  display: grid;
  gap: 14px;
}

.mission-control {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.mission-control > .subpanel-header {
  order: 0;
  margin-bottom: 2px;
}

.mission-briefing {
  order: 1;
}

.community-intelligence-panel {
  order: 2;
}

.mission-action-panel {
  order: 3;
}

.mission-opportunities-panel {
  order: 4;
}

.mission-activity-panel {
  order: 5;
}

.palworld-launch-panel {
  order: 6;
}

.home-explore-panel {
  order: 7;
}

.daily-briefing-panel {
  order: 8;
}

.mission-found-panel {
  order: 9;
}

.mission-setup-entry {
  order: 10;
}

.mission-channel-setup {
  order: 11;
}

.mission-profile-panel {
  order: 12;
}

.daily-briefing-panel,
.mission-briefing {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.mission-briefing {
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
}

.mission-briefing-copy,
.mission-next-activity,
.mission-action-panel,
.community-intelligence-panel,
.mission-found-panel,
.mission-opportunities-panel,
.mission-activity-panel,
.mission-profile-panel,
.palworld-launch-panel,
.home-explore-panel,
.daily-briefing-panel,
.mission-setup-entry,
.mission-channel-setup {
  padding: 14px;
  border: 1px solid rgba(120, 185, 255, 0.22);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.055), transparent 34%),
    rgba(12, 24, 40, 0.66);
  box-shadow: var(--shadow-soft);
}

.daily-briefing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-intelligence-panel {
  display: grid;
  gap: 12px;
}

.community-intelligence-header,
.community-intelligence-item-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-intelligence-header h3,
.community-intelligence-header p {
  margin: 0;
}

.community-intelligence-header h3 {
  margin-top: 7px;
  font-size: 20px;
  line-height: 1.15;
}

.community-intelligence-header p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.community-intelligence-actions,
.community-intelligence-meta,
.community-intelligence-disposition-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.community-intelligence-actions {
  min-width: 190px;
}

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

.community-intelligence-list[hidden] {
  display: none;
}

.community-intelligence-item {
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.3);
}

.community-intelligence-item.high,
.community-intelligence-item.critical {
  border-color: rgba(255, 107, 114, 0.24);
}

.community-intelligence-item-summary {
  cursor: pointer;
  padding: 12px;
}

.community-intelligence-item-summary strong,
.community-intelligence-item-summary span {
  display: block;
  min-width: 0;
}

.community-intelligence-item-summary > span {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.community-intelligence-item-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.community-intelligence-evidence {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.12);
  border-radius: 8px;
  background: rgba(12, 24, 40, 0.64);
}

.community-intelligence-evidence p,
.community-intelligence-evidence ul {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.community-intelligence-evidence ul {
  padding-left: 18px;
}

.daily-briefing-header h3,
.daily-briefing-header p,
.daily-briefing-section h4 {
  margin: 0;
}

.daily-briefing-header h3 {
  margin-top: 7px;
  font-size: 22px;
  line-height: 1.15;
}

.daily-briefing-header p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.daily-briefing-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.daily-briefing-content[hidden] {
  display: none;
}

.daily-briefing-section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.28);
}

.daily-briefing-section h4 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-briefing-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.daily-briefing-metrics {
  grid-column: 1 / -1;
}

.daily-briefing-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.daily-briefing-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.3);
}

.daily-briefing-metric span {
  overflow: hidden;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-briefing-metric strong {
  font-size: 18px;
  line-height: 1;
}

.mission-briefing-copy {
  display: grid;
  gap: 10px;
  align-content: center;
}

.mission-briefing-copy h3,
.mission-action-card h3,
.mission-found-card h3 {
  margin: 0;
}

.mission-briefing-copy h3 {
  font-size: 22px;
  line-height: 1.15;
}

.mission-briefing-copy p,
.mission-action-card p,
.mission-found-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mission-briefing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mission-briefing-details {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.28);
}

.mission-briefing-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mission-briefing-grid-secondary {
  margin-top: 10px;
}

.mission-next-activity {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.mission-action-panel,
.mission-found-panel,
.mission-opportunities-panel,
.mission-activity-panel,
.mission-profile-panel,
.palworld-launch-panel,
.home-explore-panel,
.mission-channel-setup {
  display: grid;
  gap: 12px;
}

.home-explore-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-explore-link {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.36);
  color: var(--text);
  text-decoration: none;
}

.home-explore-link:hover {
  border-color: rgba(45, 212, 255, 0.34);
  background: rgba(21, 38, 63, 0.66);
}

.home-explore-link strong,
.home-explore-link span {
  overflow-wrap: anywhere;
}

.home-explore-link span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-channel-setup-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.settings-channel-setup-entry > div {
  display: grid;
  gap: 5px;
}

.palworld-launch-panel {
  align-content: start;
}

.palworld-launch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.palworld-launch-grid .ops-status-card {
  min-width: 0;
}

.palworld-launch-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted-soft);
  font-size: 11px;
  line-height: 1.35;
}

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

.palworld-launch-body section {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.3);
}

.palworld-launch-body h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.palworld-compact-list {
  display: grid;
  gap: 7px;
}

.palworld-list-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(120, 185, 255, 0.12);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.24);
}

.palworld-list-item.active {
  border-color: rgba(42, 157, 88, 0.38);
}

.palworld-list-item.blocked {
  border-color: rgba(244, 92, 92, 0.42);
}

.palworld-list-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palworld-list-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.palworld-launch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-setup-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mission-setup-entry h3 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.mission-setup-entry p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.channel-setup-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.channel-setup-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.38);
}

.channel-setup-form label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.channel-setup-wizard-step,
.channel-setup-advanced {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.channel-setup-wizard-step h4,
.channel-setup-preview-heading h4 {
  margin: 2px 0 0;
  font-size: 14px;
}

.channel-setup-step-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid rgba(45, 212, 255, 0.24);
  border-radius: 999px;
  color: var(--cyan-accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.channel-setup-advanced summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  list-style: none;
}

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

.channel-setup-advanced-grid {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.channel-setup-content-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 10px;
}

.channel-setup-content-types legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.channel-setup-content-types label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}

.channel-setup-memory-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.channel-setup-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.channel-setup-preview {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.channel-setup-preview-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-setup-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.channel-setup-plan-header h4,
.channel-setup-plan-section h4 {
  margin: 0;
}

.channel-setup-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.channel-setup-summary div {
  padding: 9px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.channel-setup-summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.channel-setup-summary dd {
  margin: 4px 0 0;
  font-size: 13px;
}

.channel-setup-plan-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.channel-setup-plan-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.channel-setup-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channel-setup-steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.channel-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-action-list,
.mission-found-list,
.mission-profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.mission-overflow-details {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.mission-overflow-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.mission-overflow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.automation-activity-list .mission-overflow-list {
  grid-template-columns: 1fr;
}

.mission-action-card,
.mission-found-card,
.mission-profile-card {
  display: grid;
  gap: 9px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.42);
}

.recommended-next-step {
  gap: 14px;
}

.recommended-next-step > button {
  justify-self: start;
}

.explain-details {
  padding-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.explain-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.explain-details-list {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.42);
}

.explain-details-list dt {
  color: var(--text);
  font-weight: 700;
}

.explain-details-list dd {
  margin: 0 0 4px;
  line-height: 1.45;
}

.mission-found-card {
  border-color: rgba(45, 212, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.07), transparent 38%),
    rgba(5, 12, 22, 0.42);
}

.mission-discovery-card {
  gap: 8px;
  padding: 10px;
  border-color: rgba(45, 212, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(10, 27, 45, 0.82), rgba(5, 12, 22, 0.62));
}

.mission-discovery-card h3,
.mission-discovery-card-heading p,
.mission-discovery-reason {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.mission-discovery-card h3 {
  -webkit-line-clamp: 2;
}

.mission-discovery-card-heading p {
  -webkit-line-clamp: 3;
  font-size: 12px;
  line-height: 1.35;
}

.mission-discovery-card-header,
.mission-discovery-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mission-discovery-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
}

.mission-discovery-badges .status-badge {
  gap: 4px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
}

.mission-discovery-card-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mission-discovery-thumbnail {
  display: grid;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.11), rgba(157, 124, 255, 0.08)),
    rgba(5, 12, 22, 0.42);
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mission-discovery-thumbnail[data-thumbnail-kind="video"],
.content-discovery-thumbnail[data-thumbnail-kind="video"] {
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(16, 42, 67, 0.84), rgba(5, 12, 22, 0.72));
}

.mission-discovery-thumbnail[data-thumbnail-kind="discussion"],
.content-discovery-thumbnail[data-thumbnail-kind="discussion"] {
  background:
    linear-gradient(135deg, rgba(82, 196, 126, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(12, 45, 39, 0.84), rgba(5, 12, 22, 0.72));
}

.mission-discovery-thumbnail[data-thumbnail-kind="news"],
.content-discovery-thumbnail[data-thumbnail-kind="news"] {
  background:
    linear-gradient(135deg, rgba(255, 205, 86, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(55, 43, 16, 0.82), rgba(5, 12, 22, 0.72));
}

.mission-discovery-thumbnail[data-thumbnail-kind="history"],
.content-discovery-thumbnail[data-thumbnail-kind="history"] {
  background:
    linear-gradient(135deg, rgba(157, 124, 255, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(37, 30, 62, 0.84), rgba(5, 12, 22, 0.72));
}

.mission-discovery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mission-discovery-context {
  display: grid;
  gap: 3px 8px;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.34);
}

.mission-discovery-context dt,
.mission-discovery-context dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.28;
}

.mission-discovery-context dt {
  color: var(--muted-soft);
  font-weight: 800;
}

.mission-discovery-context dd {
  color: var(--text);
}

.mission-discovery-reason {
  -webkit-line-clamp: 2;
}

.mission-discovery-actions {
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  position: relative;
}

.mission-discovery-actions > button,
.mission-discovery-actions > .status-badge,
.mission-discovery-actions > .discovery-workflow-menu {
  flex: 0 0 auto;
}

.discovery-workflow-menu {
  position: relative;
}

.discovery-workflow-menu summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(120, 185, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 27, 45, 0.72);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.discovery-workflow-menu summary::-webkit-details-marker {
  display: none;
}

.discovery-workflow-menu summary::marker {
  content: "";
}

.discovery-workflow-menu[open] summary {
  border-color: rgba(45, 212, 255, 0.44);
  background: rgba(16, 42, 67, 0.92);
}

.discovery-workflow-menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  min-width: 170px;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(120, 185, 255, 0.22);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.98);
  box-shadow: 0 16px 32px rgba(2, 8, 23, 0.38);
}

.discovery-workflow-menu-items button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}

.discovery-inbox-summary {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(45, 212, 255, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.08), transparent 42%),
    rgba(5, 12, 22, 0.5);
}

.discovery-inbox-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.discovery-inbox-count {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 7px 6px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  background: rgba(10, 27, 45, 0.58);
  color: var(--text);
}

.discovery-inbox-count strong,
.discovery-inbox-count span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-inbox-count strong {
  font-size: 15px;
  line-height: 1;
}

.discovery-inbox-count span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.discovery-inbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.34);
}

.discovery-inbox-top-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.discovery-inbox-top h4,
.discovery-inbox-top p,
.discovery-inbox-next-action {
  margin: 0;
}

.discovery-inbox-top h4 {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-inbox-top p,
.discovery-inbox-next-action {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.discovery-inbox-next-action {
  padding: 0 2px;
}

.mission-found-card:hover {
  border-color: rgba(124, 92, 255, 0.32);
  box-shadow: 0 14px 32px rgba(2, 8, 23, 0.22);
}

.mission-profile-card.is-complete {
  opacity: 0.78;
}

.mission-action-card-header,
.mission-profile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mission-action-card h3,
.mission-found-card h3,
.mission-profile-card h3 {
  font-size: 14px;
  line-height: 1.25;
  margin: 0;
}

.mission-action-card small,
.mission-found-card small {
  font-size: 11px;
}

.mission-trust-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mission-trust-meta span {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 999px;
  background: rgba(5, 12, 22, 0.36);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-action-card button,
.mission-found-card button,
.mission-profile-card button {
  justify-self: start;
  padding: 8px 10px;
  font-size: 12px;
}

.mission-profile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.mission-profile-meta div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.mission-profile-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.mission-profile-meta dd {
  margin: 4px 0 0;
  font-size: 12px;
}

.mission-profile-content-types,
.mission-profile-next-step {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.mission-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-found-empty {
  grid-column: 1 / -1;
}

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

.mission-opportunity-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.42);
  cursor: pointer;
}

.mission-opportunity-card.priority-critical,
.mission-opportunity-card.priority-high {
  border-color: rgba(255, 107, 114, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 107, 114, 0.08), transparent 42%),
    rgba(5, 12, 22, 0.46);
}

.mission-opportunity-card:focus-visible {
  outline: none;
  border-color: rgba(45, 212, 255, 0.62);
  box-shadow:
    0 0 0 4px rgba(45, 212, 255, 0.12),
    var(--glow-cyan);
}

.mission-opportunity-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mission-opportunity-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.mission-opportunity-title strong,
.mission-opportunity-title p,
.mission-opportunity-meta,
.mission-opportunity-action {
  margin: 0;
}

.mission-opportunity-title strong {
  font-size: 14px;
  line-height: 1.25;
}

.mission-opportunity-title p,
.mission-opportunity-meta,
.mission-opportunity-action {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mission-opportunity-action {
  color: var(--text);
  font-weight: 700;
}

.mission-opportunity-signals {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.35;
}

.opportunity-action-drawer {
  margin-bottom: 6px;
}

.channel-intelligence-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.channel-intelligence-count {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px 8px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 10px;
  background: rgba(10, 27, 45, 0.58);
  color: var(--text);
  box-shadow: none;
}

.channel-intelligence-count.active {
  border-color: rgba(74, 222, 128, 0.3);
  background: var(--success-bg);
}

.channel-intelligence-count.blocked {
  border-color: rgba(255, 107, 114, 0.34);
  background: var(--danger-bg);
}

.channel-intelligence-count strong,
.channel-intelligence-count span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-intelligence-count strong {
  font-size: 18px;
  line-height: 1;
}

.channel-intelligence-count span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.channel-intelligence-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.42);
  cursor: pointer;
}

.channel-intelligence-card:focus-visible {
  outline: none;
  border-color: rgba(45, 212, 255, 0.62);
  box-shadow:
    0 0 0 4px rgba(45, 212, 255, 0.12),
    var(--glow-cyan);
}

.channel-intelligence-card.health-attention {
  border-color: rgba(255, 107, 114, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 107, 114, 0.08), transparent 42%),
    rgba(5, 12, 22, 0.46);
}

.channel-intelligence-card.health-needs-setup,
.channel-intelligence-card.health-inactive {
  border-color: rgba(251, 191, 36, 0.3);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.07), transparent 42%),
    rgba(5, 12, 22, 0.46);
}

.channel-intelligence-card.health-healthy {
  border-color: rgba(74, 222, 128, 0.28);
}

.channel-intelligence-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.channel-intelligence-heading {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.channel-intelligence-heading h3,
.channel-intelligence-heading p {
  margin: 0;
}

.channel-intelligence-heading h3 {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-intelligence-heading p {
  color: var(--muted);
  font-size: 12px;
}

.channel-intelligence-details {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.channel-intelligence-details dt,
.channel-intelligence-details dd {
  margin: 0;
}

.channel-intelligence-details dt {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.channel-intelligence-details dd {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-intelligence-recommendation {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.34);
}

.channel-intelligence-recommendation strong,
.channel-intelligence-recommendation p {
  margin: 0;
}

.channel-intelligence-recommendation strong {
  font-size: 13px;
}

.channel-intelligence-recommendation p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.engagement-dashboard {
  display: grid;
  gap: 14px;
}

.engagement-privacy-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.36);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.engagement-empty-state[hidden] {
  display: none;
}

.engagement-dashboard-content {
  display: grid;
  gap: 14px;
}

.engagement-metrics-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.engagement-list-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.engagement-list-card h3 {
  margin: 0;
}

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

.engagement-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(120, 185, 255, 0.12);
}

.engagement-channel-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.engagement-channel-row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.engagement-channel-row-copy strong,
.engagement-channel-row-copy span,
.engagement-channel-row-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engagement-channel-row-copy strong {
  font-size: 13px;
}

.engagement-channel-row-copy span {
  color: var(--muted-soft);
  font-size: 11px;
  text-transform: lowercase;
}

.engagement-channel-row-value {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.content-outcomes-panel {
  display: grid;
  gap: 12px;
}

.content-outcomes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.content-outcomes-header h3,
.content-outcomes-header p {
  margin: 0;
}

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

.content-outcome-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.34);
}

.content-outcome-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.content-outcome-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.content-outcome-title strong,
.content-outcome-title p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-outcome-title strong {
  font-size: 13px;
}

.content-outcome-title p {
  color: var(--muted-soft);
  font-size: 12px;
}

.content-outcome-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.content-outcome-stats dt,
.content-outcome-stats dd {
  margin: 0;
}

.content-outcome-stats dt {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.content-outcome-stats dd {
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.channel-action-drawer {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(45, 212, 255, 0.3);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.08), transparent 42%),
    rgba(5, 12, 22, 0.7);
  box-shadow: var(--shadow-soft);
}

.channel-action-drawer[hidden] {
  display: none;
}

.channel-action-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.channel-action-drawer-header h3,
.channel-action-drawer-header p {
  margin: 0;
}

.channel-action-drawer-header h3 {
  margin-top: 7px;
  font-size: 18px;
}

.channel-action-drawer-body {
  display: grid;
  gap: 12px;
}

.channel-action-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.34);
}

.channel-action-section h4,
.channel-action-section p {
  margin: 0;
}

.channel-action-section h4 {
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.channel-action-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.channel-action-summary-grid dt,
.channel-action-summary-grid dd {
  margin: 0;
}

.channel-action-summary-grid dt {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.channel-action-summary-grid dd {
  overflow: hidden;
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-action-health-reason,
.channel-action-recommendation p,
.channel-action-fallback {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.channel-action-recommendation {
  display: grid;
  gap: 4px;
}

.channel-action-recommendation strong {
  font-size: 14px;
}

.channel-action-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.channel-action-list li {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.channel-action-activity-list {
  display: grid;
  gap: 8px;
}

.channel-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.channel-action-recommended-actions {
  display: grid;
  gap: 8px;
}

.channel-action-recommended-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(120, 185, 255, 0.14);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.34);
}

.channel-action-recommended-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.channel-action-recommended-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.channel-action-recommended-title strong,
.channel-action-recommended-copy p {
  margin: 0;
}

.channel-action-recommended-title strong {
  font-size: 13px;
}

.channel-action-recommended-copy p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.channel-action-buttons button {
  padding: 8px 10px;
  font-size: 12px;
}

.compact-empty {
  padding: 0;
}

.is-channel-action-target,
.is-opportunity-context-target {
  border-color: rgba(45, 212, 255, 0.72) !important;
  box-shadow:
    0 0 0 4px rgba(45, 212, 255, 0.12),
    var(--glow-cyan) !important;
}

.mission-severity-action-needed {
  border-color: rgba(255, 107, 114, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 107, 114, 0.08), transparent 42%),
    rgba(5, 12, 22, 0.46);
}

.mission-severity-warning {
  border-color: rgba(251, 191, 36, 0.3);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.065), transparent 42%),
    rgba(5, 12, 22, 0.44);
}

.ops-snapshot-actions {
  justify-content: flex-end;
}

.ops-snapshot-actions button {
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.2;
}

.ops-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.ops-snapshot-group {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  grid-column: span 4;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.22);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.045), transparent 34%),
    rgba(12, 24, 40, 0.66);
  overflow: hidden;
}

.ops-snapshot-group::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, rgba(45, 212, 255, 0.52), rgba(157, 124, 255, 0.1));
}

.ops-snapshot-group-wide {
  grid-column: span 6;
}

.ops-snapshot-group-wide:has(.ops-integrity-grid),
.ops-snapshot-group-wide:has(.common-task-grid) {
  grid-column: 1 / -1;
}

.ops-snapshot-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ops-snapshot-group-header h3 {
  margin: 0;
  font-size: 14px;
}

.ops-card-grid,
.ops-integrity-grid {
  display: grid;
  gap: 8px;
}

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

.ops-card-grid-compact,
.ops-integrity-grid {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.ops-status-card {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  background: rgba(5, 12, 22, 0.48);
}

.ops-status-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.05;
}

.ops-status-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.ops-status-card.ok {
  border-color: rgba(74, 222, 128, 0.32);
  background: var(--success-bg);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.08);
}

.ops-status-card.ok strong {
  color: var(--success);
}

.ops-status-card.warning {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--warning-bg);
}

.ops-status-card.warning strong {
  color: var(--warning);
}

.ops-status-card.bad {
  border-color: rgba(255, 107, 114, 0.34);
  background: var(--danger-bg);
}

.ops-status-card.bad strong {
  color: var(--danger);
}

.ops-status-card.neutral strong {
  color: var(--text);
}

.ops-next-automation,
.ops-next-details,
.automation-detail-list {
  display: grid;
  gap: 8px;
}

.ops-next-channel {
  font-size: 20px;
  line-height: 1.1;
}

.common-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.common-task-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.42);
}

.common-task-card h3,
.common-task-card p {
  margin: 0;
}

.common-task-card h3 {
  font-size: 14px;
  line-height: 1.2;
}

.common-task-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.common-task-card button {
  justify-self: start;
  margin-top: 2px;
  padding: 8px 10px;
  font-size: 12px;
}

.automation-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.automation-section-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  text-align: left;
  padding: 13px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.055), transparent 40%),
    rgba(5, 12, 22, 0.44);
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.automation-section-card:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 255, 0.36);
  box-shadow: var(--shadow-soft), var(--glow-cyan);
}

.automation-section-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.automation-section-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.content-studio-choice-area {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.content-studio-choice-area h3 {
  margin: 0;
  font-size: 16px;
}

.content-studio-choice-grid {
  margin-bottom: 0;
}

.content-studio-choice.is-active {
  border-color: rgba(45, 212, 255, 0.56);
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.16), rgba(157, 124, 255, 0.1)),
    rgba(11, 22, 38, 0.9);
  box-shadow: var(--glow-cyan);
}

.content-studio-advanced {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.content-studio-advanced summary,
.content-studio-collapsed-tool summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.content-studio-advanced label {
  margin-top: 10px;
}

.content-studio-collapsed-tool label,
.content-studio-collapsed-tool .message-builder:first-of-type {
  margin-top: 10px;
}

.content-studio-saved-heading {
  display: none;
}

.content-discovery-review-panel {
  display: grid;
  gap: 14px;
}

.content-discovery-review-intro {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.content-discovery-review-list {
  display: grid;
  gap: 12px;
}

.content-discovery-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.content-discovery-filter-chips button {
  padding: 6px 9px;
  font-size: 12px;
}

.content-discovery-filter-chips button.is-active {
  border-color: rgba(45, 212, 255, 0.56);
  color: var(--text);
  box-shadow: var(--glow-cyan);
}

.content-discovery-review-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(45, 212, 255, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(10, 27, 45, 0.86), rgba(5, 12, 22, 0.66));
}

.content-discovery-prepared-draft {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.38);
}

.content-discovery-prepared-draft h4,
.content-discovery-prepared-draft p {
  margin: 0;
}

.content-discovery-prepared-draft h4 {
  font-size: 12px;
}

.content-discovery-prepared-draft p {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.content-discovery-review-header,
.content-discovery-review-badges,
.content-discovery-review-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.content-discovery-review-heading {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.content-discovery-review-heading h3,
.content-discovery-review-heading p {
  margin: 0;
}

.content-discovery-review-heading p {
  color: var(--muted);
  line-height: 1.45;
}

.content-discovery-review-badges,
.content-discovery-review-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.content-discovery-review-layout {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.content-discovery-thumbnail {
  display: grid;
  min-height: 150px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(157, 124, 255, 0.14), rgba(45, 212, 255, 0.08)),
    rgba(5, 12, 22, 0.5);
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.content-discovery-thumbnail img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: cover;
}

.content-discovery-review-context {
  align-content: start;
}

.content-discovery-sources-panel {
  margin-top: 4px;
}

.content-discovery-sources-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.content-discovery-sources-header h4,
.content-discovery-sources-header p {
  margin: 0;
}

.content-discovery-sources-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.discovery-source-form {
  margin: 12px 0;
}

.content-source-library {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(45, 212, 255, 0.22);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.36);
}

.content-source-library[hidden] {
  display: none;
}

.content-source-library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.content-source-library-header h4,
.content-source-library-header p {
  margin: 0;
}

.content-source-library-header p,
.content-source-card p,
.content-source-card small {
  color: var(--muted);
}

.content-source-library-header label {
  min-width: min(260px, 100%);
}

.content-source-library-recommendations,
.content-source-library-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.content-source-library-recommendations {
  color: var(--muted);
  font-size: 12px;
}

.content-source-library-categories button.is-active {
  border-color: rgba(45, 212, 255, 0.56);
  color: var(--text);
  box-shadow: var(--glow-cyan);
}

.content-source-library-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.content-source-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(11, 22, 38, 0.72);
}

.content-source-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.content-source-card-heading {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.content-source-card h4,
.content-source-card p {
  margin: 0;
}

.content-source-card small {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.automation-detail-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.automation-detail-line strong {
  color: var(--text);
  text-align: right;
}

.automation-detail-line.strong strong {
  font-size: 14px;
}

.automation-detail-line.ok strong {
  color: var(--success);
}

.automation-detail-line.blocked strong,
.automation-detail-line.bad strong {
  color: var(--danger);
}

.automation-detail-line.warning strong {
  color: var(--warning);
}

.control-block {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.control-block[hidden] {
  display: none;
}

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

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

#post-now-history,
#post-now-generated-content {
  grid-template-columns: minmax(0, 1fr);
}

#post-now-message,
#post-now-generated-content,
#create-post-scheduled-posts,
#content-discovery-review,
.content-recent-posts-section,
.content-create-post-advanced {
  scroll-margin-top: 18px;
}

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

.content-ready-post-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.3);
}

.content-ready-post-card .subpanel-header {
  margin-bottom: 0;
}

.content-scheduled-posts-section .feed-list,
.content-recent-posts-section .content-outcomes-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-scheduled-post-card {
  align-content: start;
}

#manual-push-form > .form-group {
  grid-template-columns: minmax(0, 1fr);
}

#manual-push-form {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

#manual-push-form > .form-group {
  grid-column: 1 / -1;
}

#manual-push-form > .form-actions-row {
  grid-column: 1 / -1;
  align-self: auto;
  align-content: start;
  justify-content: flex-start;
}

#post-now-message {
  gap: 12px;
}

#community-health .ops-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.community-overview {
  display: contents;
}

.community-overview > .subpanel-header {
  order: 0;
}

.community-section-nav {
  order: 0;
}

#community-new-members {
  order: 1;
}

#community-health {
  order: 2;
}

#community-role-signup-buttons {
  order: 3;
}

#community-role-followups {
  order: 3;
}

#community-activity {
  order: 4;
}

#community-recognition {
  order: 5;
}

#community-channel-summary {
  order: 6;
}

.community-owner-section,
.community-activity-panel,
.community-recognition-panel {
  display: grid;
  gap: 12px;
}

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

.community-owner-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.18);
  border-radius: 12px;
  background: rgba(5, 12, 22, 0.42);
}

.community-owner-item.blocked {
  border-color: rgba(255, 107, 114, 0.28);
  background: rgba(255, 107, 114, 0.08);
}

.community-owner-item.active {
  border-color: rgba(74, 222, 128, 0.24);
  background: rgba(74, 222, 128, 0.08);
}

.community-owner-item-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.community-owner-item h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.community-owner-item .status-badge {
  justify-self: end;
  white-space: nowrap;
}

.community-welcome-panel {
  display: grid;
  gap: 12px;
}

.community-welcome-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.32);
}

.community-welcome-summary h3,
.community-welcome-summary p {
  margin: 0;
}

.community-welcome-summary-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.community-welcome-form {
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr) minmax(300px, 0.9fr);
}

.community-welcome-form[hidden] {
  display: none;
}

.community-welcome-form > .settings-actions {
  grid-column: 1 / -1;
}

.community-owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.community-builder-form[hidden] {
  display: none;
}

.community-builder-summary {
  display: grid;
  gap: 10px;
}

.community-builder-advanced {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
}

.community-builder-advanced summary,
.community-token-tools summary {
  cursor: pointer;
  font-weight: 800;
}

.community-builder-advanced > .form-grid,
.community-token-tools > p,
.community-token-tools > .message-builder-actions,
.community-token-tools > .token-helper-list {
  margin-top: 10px;
}

#role-access-panel-form,
#role-followup-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

#role-access-panel-form > .form-group,
#role-followup-form > .form-group {
  grid-column: span 4;
}

#role-access-panel-form > .community-setup-panel,
#role-followup-form > .community-setup-panel,
#role-access-panel-form > .message-panel,
#role-followup-form > .message-panel {
  grid-column: span 8;
}

#role-access-panel-form > .role-access-preview-panel,
#role-followup-form > .role-access-preview-panel {
  grid-column: span 4;
}

#role-access-panel-form > .role-access-advanced,
#role-followup-form > .role-access-advanced,
#role-access-panel-form > .compact-field-panel,
#role-followup-form > .compact-field-panel {
  grid-column: span 4;
}

#role-access-panel-form > .settings-actions,
#role-followup-form > .settings-actions {
  grid-column: 1 / -1;
}

#settings-form > .settings-global-controls,
#settings-form > .settings-actions {
  grid-column: 1 / -1;
}

#settings-form > .form-group {
  grid-column: span 4;
}

#settings-form > .settings-global-controls {
  grid-column: 1 / -1;
}

#settings-form > .settings-api-panel,
#settings-form > .settings-diagnostics-panel {
  grid-column: span 6;
}

.automation-activity-card {
  align-content: start;
}

.automation-activity-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.automation-activity-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  background: rgba(5, 12, 22, 0.42);
}

.automation-activity-item.status-success {
  border-color: rgba(74, 222, 128, 0.28);
  background: var(--success-bg);
}

.automation-activity-item.status-failure,
.automation-activity-item.status-blocked {
  border-color: rgba(255, 107, 114, 0.32);
  background: var(--danger-bg);
}

.automation-activity-main {
  display: grid;
  gap: 7px;
}

.automation-activity-message {
  margin: 0;
  color: var(--text);
  line-height: 1.35;
  font-size: 13px;
}

.automation-activity-meta {
  display: grid;
  gap: 4px;
}

.compact-status {
  gap: 8px;
  min-height: 100%;
  background: linear-gradient(180deg, rgba(18, 34, 56, 0.96) 0%, rgba(11, 22, 38, 0.92) 100%);
}

.overview-status-copy {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

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

#automation-scheduled-posts,
#automation-daily-trivia {
  grid-template-columns: minmax(520px, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

.automation-primary-actions {
  margin-bottom: 12px;
}

.automation-advanced-details {
  margin-bottom: 16px;
}

.automation-advanced-details > .automation-section-grid {
  margin-top: 12px;
}

.feed-config-form[hidden],
.daily-trivia-config-form[hidden] {
  display: none;
}

.automation-form-advanced {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
}

.automation-form-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automation-form-advanced > .form-grid {
  margin-top: 10px;
}

#automation-scheduled-posts > .subpanel-header,
#automation-daily-trivia > .subpanel-header,
#automation-scheduled-posts > details,
#automation-daily-trivia > details {
  grid-column: 1 / -1;
}

#automation-scheduled-posts > .settings-form,
#automation-daily-trivia > .settings-form {
  grid-column: 1;
}

#feeds-list,
#daily-trivia-summary {
  grid-column: 2;
}

#automation-scheduled-posts:has(#feed-form[hidden]) #feeds-list,
#automation-daily-trivia:has(#daily-trivia-form[hidden]) #daily-trivia-summary {
  grid-column: 1 / -1;
}

#automation-community-game {
  grid-template-columns: minmax(0, 1fr);
}

.channel-operations-list {
  gap: 10px;
}

.channel-row {
  position: relative;
  border: 1px solid rgba(120, 185, 255, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 255, 0.055), transparent 36%),
    linear-gradient(180deg, rgba(18, 34, 56, 0.94) 0%, rgba(11, 22, 38, 0.9) 100%);
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow-soft);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.channel-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(45, 212, 255, 0.22);
}

.channel-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(45, 212, 255, 0.36);
}

.channel-row[open] {
  box-shadow: var(--shadow-hover);
}

.channel-row.state-active::before {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.76), rgba(45, 212, 255, 0.18));
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.4);
}

.channel-row.state-disabled::before,
.channel-row.state-global-disabled::before {
  background: linear-gradient(180deg, rgba(132, 152, 177, 0.52), rgba(132, 152, 177, 0.12));
}

.channel-row.state-silenced::before,
.channel-row.state-cooldown::before,
.channel-row.state-skip-next::before {
  background: linear-gradient(180deg, rgba(255, 107, 114, 0.56), rgba(251, 191, 36, 0.18));
}

.channel-row.state-disabled,
.channel-row.state-global-disabled {
  background: linear-gradient(180deg, rgba(15, 28, 46, 0.9) 0%, rgba(9, 18, 32, 0.88) 100%);
}

.channel-row-summary {
  list-style: none;
  cursor: pointer;
  padding: 0;
}

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

.channel-row-summary-main {
  display: grid;
  gap: 10px;
  padding: 12px 13px 11px;
}

.channel-row-identity,
.channel-row-title-block {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.channel-row-summary-detail {
  margin: 0;
  line-height: 1.35;
  color: var(--muted);
}

.channel-row-summary-detail.blocked {
  color: var(--danger);
  font-weight: 700;
}

.channel-row-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.channel-row-summary-actions button,
.channel-row-expand {
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 999px;
}

.channel-row-expand {
  background: rgba(21, 38, 63, 0.88);
  color: var(--text);
  box-shadow: none;
}

.channel-row-expand:hover {
  background: rgba(29, 51, 82, 0.96);
}

.channel-row-summary-actions .primary-action {
  background: linear-gradient(180deg, #6d9cff 0%, #3b6ff0 100%);
  box-shadow: 0 10px 22px rgba(59, 111, 240, 0.28);
}

.channel-row-expanded {
  display: grid;
  gap: 12px;
  padding: 0 13px 13px;
  border-top: 1px solid rgba(120, 185, 255, 0.14);
  background: linear-gradient(180deg, rgba(45, 212, 255, 0.035) 0%, rgba(255, 255, 255, 0) 100%);
}

.channel-row-expanded-meta {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.channel-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.channel-state-item {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  background: rgba(5, 12, 22, 0.42);
}

.channel-state-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.channel-state-item strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.25;
}

.channel-state-item.ok {
  border-color: rgba(74, 222, 128, 0.28);
  background: var(--success-bg);
}

.channel-state-item.ok strong {
  color: var(--success);
}

.channel-state-item.warning {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--warning-bg);
}

.channel-state-item.warning strong {
  color: var(--warning);
}

.channel-state-item.bad {
  border-color: rgba(255, 107, 114, 0.34);
  background: var(--danger-bg);
}

.channel-state-item.bad strong {
  color: var(--danger);
}

.channel-row-expanded-actions {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: stretch;
  padding-top: 0;
}

.channel-operation-card.compact {
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, auto);
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
}

.channel-operation-main,
.channel-operation-times,
.channel-operation-actions {
  display: grid;
  gap: 8px;
}

.channel-operation-identity {
  display: grid;
  gap: 8px;
}

.channel-operation-meta,
.channel-operation-empty,
.channel-operation-status,
.channel-operation-detail {
  margin: 0;
}

.channel-operation-meta,
.channel-operation-empty,
.channel-operation-detail {
  color: var(--muted-soft);
}

.channel-operation-status {
  font-weight: 700;
  font-size: 13px;
}

.channel-operation-detail {
  font-size: 13px;
  line-height: 1.35;
}

.channel-operation-detail.error-text {
  color: var(--danger);
}

.channel-operation-detail-strong {
  color: var(--text);
  font-weight: 700;
}

.channel-operation-status.active {
  color: var(--success);
}

.channel-operation-status.blocked {
  color: var(--danger);
}

.channel-operation-actions {
  align-content: start;
  justify-items: end;
}

.channel-operation-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.channel-operation-action-group.secondary button {
  background: rgba(21, 38, 63, 0.88);
  color: var(--text);
}

.channel-operation-action-group.secondary button:hover {
  background: rgba(29, 51, 82, 0.96);
}

.channel-operation-actions button {
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.control-debug-details {
  margin-top: 8px;
  opacity: 0.92;
}

.developer-details {
  display: grid;
  gap: 10px;
}

.developer-details h4 {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.channel-operation-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.82;
}

.automation-master-badge {
  font-size: 12px;
  padding: 5px 10px;
}

.status-badge.active {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.28);
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.12);
}

.status-badge.blocked {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(255, 107, 114, 0.32);
}

.status-badge.neutral {
  background: rgba(120, 185, 255, 0.1);
  color: var(--muted);
  border-color: rgba(120, 185, 255, 0.18);
}

.health-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 185, 255, 0.2);
  background: linear-gradient(180deg, rgba(18, 34, 56, 0.88) 0%, rgba(7, 17, 31, 0.72) 100%);
  min-width: 0;
  box-shadow: var(--shadow-soft);
}

.health-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.health-value {
  font-size: 16px;
  font-weight: 700;
}

.health-card-ok {
  border-color: rgba(74, 222, 128, 0.28);
  box-shadow: var(--shadow-soft), 0 0 18px rgba(74, 222, 128, 0.09);
}

.health-card-bad {
  border-color: rgba(255, 107, 114, 0.32);
}

.health-value.ok {
  color: var(--success);
}

.health-value.bad {
  color: var(--danger);
}

.metric-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.metric-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(120, 185, 255, 0.12);
}

.metric-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric-name {
  color: var(--muted-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-value {
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
}

.details-block {
  margin-top: 16px;
  border-top: 1px solid rgba(120, 185, 255, 0.12);
  padding-top: 12px;
}

.details-block summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 13px;
}

pre {
  margin: 0;
  padding: 16px;
  background: rgba(3, 8, 15, 0.94);
  color: #cfe0f2;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Knowledge & News workspace */
.knowledge-workspace {
  display: grid;
  gap: 16px;
}

.knowledge-hero,
.knowledge-section-heading,
.knowledge-panel-heading,
.knowledge-topic-header,
.knowledge-form-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.knowledge-hero {
  padding: 22px;
  border: 1px solid rgba(45, 212, 255, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 0%, rgba(157, 124, 255, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(45, 212, 255, 0.1), transparent 48%),
    rgba(5, 12, 22, 0.7);
}

.knowledge-hero h2,
.knowledge-section-heading h3,
.knowledge-panel-heading h3,
.knowledge-topic-header h3,
.knowledge-control-panel h4,
.knowledge-history-explainer p,
.knowledge-hero p,
.knowledge-section-heading p,
.knowledge-panel-heading p,
.knowledge-topic-header p,
.knowledge-future-strip p,
.knowledge-reset-panel p {
  margin: 0;
}

.knowledge-hero h2 {
  margin: 5px 0 6px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
}

.knowledge-hero p,
.knowledge-section-heading p,
.knowledge-panel-heading p,
.knowledge-topic-header p,
.knowledge-future-strip p,
.knowledge-reset-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.knowledge-eyebrow,
.knowledge-section-kicker,
.knowledge-future-strip span,
.knowledge-topic-id {
  color: var(--cyan-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.knowledge-hero-actions,
.knowledge-topic-badges,
.knowledge-topic-actions,
.knowledge-validation-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-hero-actions {
  justify-content: flex-end;
}

.knowledge-safety-banner,
.knowledge-history-explainer,
.knowledge-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  line-height: 1.45;
}

.knowledge-safety-banner {
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: var(--warning-bg);
  color: #fde9a7;
}

.knowledge-history-explainer {
  display: grid;
  border: 1px solid rgba(45, 212, 255, 0.32);
  background: rgba(45, 212, 255, 0.08);
}

.knowledge-error {
  border: 1px solid rgba(255, 107, 114, 0.42);
  background: var(--danger-bg);
  color: #ffd4d6;
}

.knowledge-loading {
  padding: 26px;
  border: 1px dashed var(--panel-border-strong);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.knowledge-subnav {
  display: flex;
  gap: 7px;
  padding: 5px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(3, 8, 15, 0.58);
  overflow-x: auto;
}

.knowledge-subtab {
  min-height: 42px;
  padding: 9px 14px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  white-space: nowrap;
}

.knowledge-subtab:hover,
.knowledge-subtab.is-active {
  background: rgba(91, 141, 255, 0.17);
  border-color: rgba(91, 141, 255, 0.34);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.knowledge-subtab:focus-visible,
.knowledge-topic-card summary:focus-visible {
  outline: 3px solid rgba(45, 212, 255, 0.45);
  outline-offset: 2px;
}

.knowledge-view {
  display: grid;
  gap: 16px;
}

.knowledge-section-heading {
  padding: 2px 2px 0;
}

.knowledge-section-heading > div,
.knowledge-panel-heading > div,
.knowledge-topic-header > div {
  display: grid;
  gap: 5px;
}

.knowledge-community-clock {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.knowledge-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-metric-card,
.knowledge-control-panel,
.knowledge-future-strip article,
.knowledge-history-card,
.knowledge-topic-card,
.knowledge-settings-relationship,
.knowledge-reset-panel {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(5, 12, 22, 0.58);
}

.knowledge-metric-card {
  display: grid;
  gap: 7px;
  min-height: 104px;
  padding: 14px;
}

.knowledge-metric-card span,
.knowledge-history-card dt,
.knowledge-topic-detail dt {
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.knowledge-metric-card strong {
  align-self: end;
  font-size: 20px;
  line-height: 1.15;
}

.knowledge-metric-card small {
  line-height: 1.35;
}

.knowledge-control-panel,
.knowledge-history-card,
.knowledge-reset-panel {
  padding: 16px;
}

.knowledge-panel-heading {
  margin-bottom: 13px;
}

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

.knowledge-topic-summary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 12px;
  background: rgba(13, 25, 42, 0.62);
}

.knowledge-topic-summary-card h4,
.knowledge-topic-summary-card p {
  margin: 0;
}

.knowledge-topic-summary-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.knowledge-topic-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(45, 212, 255, 0.25);
  border-radius: 11px;
  background: rgba(45, 212, 255, 0.09);
  font-size: 19px;
}

.knowledge-upcoming-list {
  display: grid;
  gap: 8px;
}

.knowledge-upcoming-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.4fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(13, 25, 42, 0.7);
}

.knowledge-upcoming-item span,
.knowledge-upcoming-item time {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-future-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-future-strip article {
  display: grid;
  gap: 6px;
  padding: 14px;
  opacity: 0.76;
}

.knowledge-future-strip p {
  font-size: 12px;
}

.knowledge-topics-list {
  display: grid;
  gap: 11px;
}

.knowledge-topic-card {
  overflow: clip;
}

.knowledge-topic-card[open] {
  border-color: rgba(45, 212, 255, 0.35);
  box-shadow: var(--shadow-soft);
}

.knowledge-topic-card > summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  list-style: none;
}

.knowledge-topic-card > summary::-webkit-details-marker {
  display: none;
}

.knowledge-topic-summary-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.knowledge-topic-summary-main h3,
.knowledge-topic-summary-main p,
.knowledge-topic-summary-meta p {
  margin: 0;
}

.knowledge-topic-summary-main p,
.knowledge-topic-summary-meta p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.knowledge-topic-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--panel-border);
  background: rgba(3, 8, 15, 0.36);
}

.knowledge-topic-editor.is-read-only {
  background: linear-gradient(135deg, rgba(45, 212, 255, 0.05), rgba(3, 8, 15, 0.4));
}

.knowledge-form-grid,
.knowledge-topic-detail-grid,
.knowledge-history-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.knowledge-form-grid label,
.knowledge-topic-editor label {
  min-width: 0;
}

.knowledge-form-wide {
  grid-column: 1 / -1;
}

.knowledge-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  border: 0;
}

.knowledge-weekdays legend {
  width: 100%;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
}

.knowledge-weekdays label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  background: rgba(13, 25, 42, 0.72);
  font-size: 12px;
}

.knowledge-weekdays input {
  width: auto;
}

.knowledge-topic-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.knowledge-topic-detail {
  margin: 0;
  padding: 11px;
  border-radius: 10px;
  background: rgba(13, 25, 42, 0.68);
}

.knowledge-topic-detail dd,
.knowledge-history-card dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.knowledge-schedule-preview,
.knowledge-policy-preview,
.knowledge-validation-errors {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.15);
  border-radius: 11px;
  background: rgba(5, 12, 22, 0.62);
}

.knowledge-schedule-preview ol,
.knowledge-policy-preview ul,
.knowledge-validation-errors ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.knowledge-policy-preview[data-tone="blocked"],
.knowledge-validation-errors {
  border-color: rgba(255, 107, 114, 0.32);
  background: rgba(255, 107, 114, 0.07);
}

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

.knowledge-history-card {
  display: grid;
  gap: 11px;
}

.knowledge-history-card dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.knowledge-history-card dl > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) minmax(0, 1fr);
  gap: 10px;
}

.knowledge-warning-copy {
  padding: 12px;
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: var(--warning-bg);
  color: #fde9a7;
  line-height: 1.5;
}

.knowledge-settings-relationship {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
}

.knowledge-settings-relationship > div {
  display: grid;
  gap: 3px;
  text-align: center;
}

.knowledge-settings-relationship span {
  color: var(--muted);
  font-size: 11px;
}

.knowledge-settings-form {
  display: grid;
  gap: 13px;
}

.knowledge-form-actions {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.knowledge-reset-panel {
  border-color: rgba(255, 107, 114, 0.24);
}

.knowledge-reset-panel summary {
  cursor: pointer;
  color: #ffb6ba;
  font-weight: 700;
}

.knowledge-reset-panel[open] {
  display: grid;
  gap: 12px;
}

.knowledge-editorial-boundary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(45, 212, 255, 0.38);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(45, 212, 255, 0.11), rgba(157, 124, 255, 0.08));
}

.knowledge-editorial-boundary span {
  color: var(--muted);
  line-height: 1.45;
}

.knowledge-editorial-controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) auto minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
}

.knowledge-editorial-controls .form-status {
  grid-column: 1 / -1;
}

.knowledge-editorial-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: start;
}

.knowledge-editorial-candidates,
.knowledge-editorial-evidence-list,
.knowledge-editorial-detail,
.knowledge-editorial-detail-section,
.knowledge-editorial-policy-results,
.knowledge-editorial-owner-actions,
.knowledge-editorial-queue {
  display: grid;
  gap: 10px;
}

.knowledge-editorial-candidate {
  display: grid;
  justify-items: start;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border-color: rgba(120, 185, 255, 0.18);
  background: rgba(13, 25, 42, 0.68);
  box-shadow: none;
  color: var(--text);
  text-align: left;
}

.knowledge-editorial-candidate:hover,
.knowledge-editorial-candidate.is-active {
  border-color: rgba(45, 212, 255, 0.46);
  background: rgba(45, 212, 255, 0.11);
  box-shadow: none;
  transform: none;
}

.knowledge-editorial-candidate span:not(.status-badge) {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-editorial-detail {
  min-width: 0;
}

.knowledge-editorial-detail-header {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--panel-border);
}

.knowledge-editorial-detail-header h3,
.knowledge-editorial-detail-header p,
.knowledge-editorial-detail-section h4,
.knowledge-editorial-draft-preview h4,
.knowledge-editorial-draft-preview h5,
.knowledge-editorial-draft-preview p,
.knowledge-editorial-evidence p,
.knowledge-editorial-empty p,
.knowledge-editorial-queue-item p {
  margin: 0;
}

.knowledge-editorial-detail-header h3 {
  margin: 4px 0 6px;
}

.knowledge-editorial-detail-header p,
.knowledge-editorial-empty p,
.knowledge-editorial-queue-item p {
  color: var(--muted);
  line-height: 1.5;
}

.knowledge-editorial-detail-section {
  padding-top: 4px;
  border-top: 1px solid rgba(120, 185, 255, 0.1);
}

.knowledge-editorial-evidence {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 11px;
  background: rgba(13, 25, 42, 0.62);
}

.knowledge-editorial-evidence small {
  color: var(--muted);
  line-height: 1.45;
}

.knowledge-editorial-source-list,
.knowledge-editorial-attributions,
.knowledge-editorial-version-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.knowledge-editorial-source-list li {
  display: grid;
  gap: 3px;
}

.knowledge-editorial-source-list span,
.knowledge-editorial-version-list span {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-editorial-draft-preview {
  display: grid;
  gap: 11px;
  padding: 15px;
  border: 1px solid rgba(45, 212, 255, 0.25);
  border-radius: 12px;
  background: rgba(4, 10, 18, 0.75);
  overflow-wrap: anywhere;
}

.knowledge-editorial-draft-preview h4 {
  font-size: 18px;
}

.knowledge-editorial-draft-preview h5 {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.knowledge-editorial-draft-preview p {
  line-height: 1.55;
}

.knowledge-editorial-lead {
  color: #d8e7ff;
  font-size: 15px;
}

.knowledge-editorial-policy-result {
  display: grid;
  grid-template-columns: auto minmax(130px, 0.45fr) minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(120, 185, 255, 0.1);
}

.knowledge-editorial-policy-result span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-editorial-owner-actions {
  margin-top: 4px;
  padding-top: 13px;
  border-top: 1px solid var(--panel-border);
}

.knowledge-editorial-owner-actions textarea {
  width: 100%;
  resize: vertical;
}

.knowledge-editorial-owner-actions small {
  color: var(--muted);
}

.knowledge-editorial-version-list li {
  display: grid;
  grid-template-columns: minmax(90px, auto) auto 1fr;
  gap: 8px;
  align-items: center;
}

.knowledge-editorial-empty {
  display: grid;
  gap: 6px;
  min-height: 180px;
  place-content: center;
  text-align: center;
}

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

.knowledge-editorial-queue-item {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid rgba(120, 185, 255, 0.16);
  border-radius: 11px;
  background: rgba(13, 25, 42, 0.62);
}

.knowledge-dry-run-boundary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(157, 124, 255, 0.42);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(157, 124, 255, 0.12), rgba(45, 212, 255, 0.07));
}

.knowledge-dry-run-boundary span {
  color: var(--muted);
  line-height: 1.45;
}

.knowledge-dry-run-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(135px, 1fr)) auto;
  gap: 11px;
  align-items: end;
}

.knowledge-dry-run-toolbar .form-status {
  grid-column: 1 / -1;
}

.knowledge-dry-run-preview-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.4fr) auto;
  gap: 14px;
  align-items: end;
}

.knowledge-dry-run-preview-controls h3,
.knowledge-dry-run-preview-controls p,
.knowledge-dry-run-card h4 {
  margin: 0;
}

.knowledge-dry-run-preview-controls p {
  margin-top: 5px;
  color: var(--muted);
}

.knowledge-dry-run-list,
.knowledge-dry-run-card-body,
.knowledge-dry-run-policy,
.knowledge-dry-run-reasons,
.knowledge-dry-run-rendered {
  display: grid;
  gap: 10px;
}

.knowledge-dry-run-card {
  min-width: 0;
  border: 1px solid rgba(120, 185, 255, 0.17);
  border-radius: 12px;
  background: rgba(13, 25, 42, 0.62);
  overflow: clip;
}

article.knowledge-dry-run-card {
  display: grid;
  gap: 11px;
  padding: 13px;
}

.knowledge-dry-run-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 13px;
  cursor: pointer;
  list-style: none;
}

.knowledge-dry-run-card > summary::-webkit-details-marker {
  display: none;
}

.knowledge-dry-run-card[open] > summary {
  border-bottom: 1px solid var(--panel-border);
}

.knowledge-dry-run-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.knowledge-dry-run-card-header > div,
.knowledge-dry-run-card > summary > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.knowledge-dry-run-card-header span:not(.status-badge),
.knowledge-dry-run-card > summary span:not(.status-badge) {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-dry-run-card-body {
  padding: 13px;
}

.knowledge-dry-run-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.knowledge-dry-run-detail-grid .knowledge-topic-detail {
  min-width: 0;
}

.knowledge-dry-run-reasons {
  padding: 12px;
  border: 1px solid rgba(255, 195, 92, 0.28);
  border-radius: 10px;
  background: rgba(255, 195, 92, 0.07);
}

.knowledge-dry-run-reasons ul {
  margin: 0;
  padding-left: 20px;
}

.knowledge-dry-run-rendered {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(45, 212, 255, 0.24);
  border-radius: 11px;
  background: rgba(3, 8, 15, 0.68);
}

.knowledge-dry-run-rendered pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.knowledge-dry-run-rendered small {
  color: var(--muted);
}

button.danger {
  background: linear-gradient(180deg, #c94b56, #9f2f3b);
  border-color: rgba(255, 180, 186, 0.34);
  box-shadow: 0 10px 24px rgba(159, 47, 59, 0.22);
}

button.danger:hover {
  background: linear-gradient(180deg, #dc5b66, #b53a46);
}

@media (max-width: 1080px) {
  .knowledge-metric-grid,
  .knowledge-form-grid,
  .knowledge-topic-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-topic-card > summary {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  }

  .knowledge-editorial-layout {
    grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1fr);
  }

  .knowledge-topic-card > summary::after {
    content: "Open";
    grid-column: 1 / -1;
    color: var(--accent-strong);
    font-size: 11px;
    text-align: right;
  }
}

@media (max-width: 820px) {
  .owner-auth-shell,
  .owner-auth-shell.is-authenticated {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 760px);
    margin-top: 12px;
    padding: 14px;
  }

  .owner-session-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-session-bar > div {
    text-align: left;
  }

  .owner-auth-card {
    padding: 18px;
  }

  .knowledge-subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .knowledge-hero,
  .knowledge-section-heading,
  .knowledge-panel-heading,
  .knowledge-topic-header,
  .knowledge-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-hero-actions,
  .knowledge-topic-actions {
    justify-content: flex-start;
  }

  .knowledge-safety-banner {
    display: grid;
  }

  .knowledge-metric-grid,
  .knowledge-topic-summary-grid,
  .knowledge-future-strip,
  .knowledge-form-grid,
  .knowledge-topic-detail-grid,
  .knowledge-history-layout,
  .knowledge-topic-card > summary {
    grid-template-columns: 1fr;
  }

  .knowledge-upcoming-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .knowledge-settings-relationship > div[aria-hidden="true"] {
    transform: rotate(90deg);
  }

  .knowledge-history-card dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .knowledge-editorial-controls,
  .knowledge-editorial-layout,
  .knowledge-editorial-queue,
  .knowledge-editorial-policy-result,
  .knowledge-editorial-version-list li,
  .knowledge-dry-run-toolbar,
  .knowledge-dry-run-preview-controls,
  .knowledge-dry-run-detail-grid,
  .knowledge-dry-run-card-header,
  .knowledge-dry-run-card > summary {
    grid-template-columns: 1fr;
  }

  .knowledge-subtab {
    min-width: 0;
    min-height: 44px;
    white-space: normal;
  }
}

@media (max-width: 1320px) {
  .ops-snapshot-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .ops-snapshot-group {
    grid-column: span 3;
  }

  .ops-snapshot-group-wide {
    grid-column: span 3;
  }

  .ops-snapshot-group-wide:has(.ops-integrity-grid),
  .ops-snapshot-group-wide:has(.common-task-grid) {
    grid-column: 1 / -1;
  }

  .channel-operations-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  #automation-scheduled-posts,
  #automation-daily-trivia {
    grid-template-columns: minmax(460px, 0.95fr) minmax(0, 1.05fr);
  }

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

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

@media (max-width: 1080px) {
  .command-bar-top,
  .overview-layout,
  .daily-briefing-content,
  .palworld-launch-body,
  .ops-snapshot-grid {
    grid-template-columns: 1fr;
  }

  .ops-snapshot-group,
  .ops-snapshot-group-wide {
    grid-column: auto;
  }

  #automation-scheduled-posts,
  #automation-daily-trivia {
    grid-template-columns: 1fr;
  }

  #automation-scheduled-posts > .settings-form,
  #automation-daily-trivia > .settings-form,
  #feeds-list,
  #daily-trivia-summary {
    grid-column: 1;
  }

  #manual-push-form {
    grid-template-columns: 1fr;
  }

  #manual-push-form > .form-group,
  #manual-push-form > .form-actions-row {
    grid-column: 1;
  }

  .composer-form {
    grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  }

  .composer-form > .preview-panel,
  .composer-form > .editor-tools-panel {
    grid-column: 1 / -1;
  }

  .command-bar-controls {
    justify-items: stretch;
  }

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

  .api-debug-panel {
    justify-self: stretch;
  }

  .api-debug-panel summary {
    text-align: left;
  }

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

  .command-bar-main {
    grid-template-columns: 1fr;
  }

  .channel-row-summary-main {
    grid-template-columns: 1fr;
  }

  .content-source-library-header {
    flex-direction: column;
  }

  .content-source-library-list {
    grid-template-columns: 1fr;
  }

  .content-ready-post-grid,
  .content-advanced-grid {
    grid-template-columns: 1fr;
  }

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

  .automation-activity-grid {
    grid-template-columns: 1fr;
  }

  .ops-snapshot .subpanel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mission-briefing,
  .mission-briefing-grid,
  .daily-briefing-metrics-grid,
  .channel-setup-grid,
  .channel-setup-summary,
  .mission-profile-meta {
    grid-template-columns: 1fr;
  }

  .mission-setup-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-snapshot-actions {
    justify-content: flex-start;
  }

  .automation-master-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .opportunity-context-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .community-intelligence-header,
  .community-intelligence-item-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .community-intelligence-actions,
  .community-intelligence-meta,
  .community-intelligence-disposition-actions {
    justify-content: flex-start;
  }

  #community-health .ops-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-owner-item {
    grid-template-columns: 1fr;
  }

  .community-welcome-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .community-welcome-summary-meta {
    justify-content: flex-start;
  }

  .community-owner-item .status-badge,
  .community-owner-item button {
    justify-self: start;
  }
}

@media (max-width: 820px) {
  .api-config.compact {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .panel-header,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-form,
  .composer-form,
  .metrics-grid,
  .automation-activity-grid,
  .content-ready-post-grid,
  .content-advanced-grid,
  .engagement-metrics-grid,
  .engagement-lists-grid,
  .content-outcome-stats,
  .channel-intelligence-summary,
  .channel-intelligence-details,
  .channel-action-summary-grid,
  .palworld-launch-grid,
  .ops-card-grid,
  .ops-card-grid-compact,
  .ops-integrity-grid,
  .channel-operations-grid,
  .channel-operations-list {
    grid-template-columns: 1fr;
  }

  .home-explore-grid {
    grid-template-columns: 1fr;
  }

  .settings-channel-setup-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .settings-form > .form-group,
  .settings-form > .form-group:only-of-type,
  .settings-form > .settings-actions,
  .composer-form > .form-group,
  #role-access-panel-form > .form-group,
  #role-followup-form > .form-group,
  #role-access-panel-form > .role-access-preview-panel,
  #role-followup-form > .role-access-preview-panel,
  #role-access-panel-form > .community-setup-panel,
  #role-followup-form > .community-setup-panel,
  #role-access-panel-form > .message-panel,
  #role-followup-form > .message-panel,
  #role-access-panel-form > .role-access-advanced,
  #role-followup-form > .role-access-advanced,
  #role-access-panel-form > .compact-field-panel,
  #role-followup-form > .compact-field-panel,
  #settings-form > .form-group,
  #settings-form > .settings-global-controls,
  #settings-form > .settings-actions,
  #settings-form > .settings-api-panel,
  #settings-form > .settings-diagnostics-panel,
  #manual-push-form > .form-actions-row {
    grid-column: 1 / -1;
  }

  #manual-push-form > .form-group,
  #community-health .ops-card-grid {
    grid-template-columns: 1fr;
  }

  .command-bar {
    padding: 14px;
  }

  .command-bar-brand {
    grid-template-columns: auto 1fr;
  }

  .channel-operation-card.compact {
    grid-template-columns: 1fr;
  }

  .mission-action-card-header,
  .mission-discovery-card-header,
  .channel-action-drawer-header,
  .mission-discovery-badges,
  .content-discovery-review-header,
  .content-discovery-review-actions,
  .content-discovery-sources-header,
  .mission-profile-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mission-action-card,
  .mission-action-card > *,
  .mission-action-card-header > * {
    min-width: 0;
    max-width: 100%;
  }

  .mission-discovery-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
  }

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

  .discovery-inbox-top {
    align-items: stretch;
    flex-direction: column;
  }

  .content-discovery-review-layout {
    grid-template-columns: 1fr;
  }

  .channel-operation-actions {
    justify-items: stretch;
  }

  .channel-operation-action-group {
    justify-content: flex-start;
  }
}
