:root {
  --color-primary: #2050c8;
  --color-primary-hover: #1a44b0;
  --color-bg: #f5f6f8;
  --color-text: #1c1f24;
  --color-text-muted: #556;
  --color-border: #e5e7eb;
  --color-card-bg: #fff;
  --color-code-bg: #eef0f3;
  --color-error-bg: #fee;
  --color-error-text: #b00020;
  --color-success-bg: #e8f7ec;
  --color-success-text: #0a7a30;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
}

* { box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
       margin: 0; background: var(--color-bg); color: var(--color-text); }
a { color: var(--color-primary); text-decoration: none; } a:hover { text-decoration: underline; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--color-code-bg); padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--color-card-bg); border-radius: var(--radius-lg); padding: 32px; width: 360px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.login-card h1 { margin: 0 0 var(--spacing-lg); font-size: 20px; text-align: center; }
.login-card label { display: block; margin-bottom: 14px; }
.login-card label span { display: block; font-size: 13px; color: var(--color-text-muted); margin-bottom: var(--radius-sm); }
.login-card input { width: 100%; padding: 9px 10px; border: 1px solid #d4d6db; border-radius: 5px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: #4070f0; }
.login-card button { width: 100%; padding: 10px; background: var(--color-primary); color: var(--color-card-bg); border: none; border-radius: 5px; font-size: 15px; cursor: pointer; margin-top: var(--spacing-sm); }
.login-card button:hover { background: var(--color-primary-hover); }
.login-card .err { background: var(--color-error-bg); color: var(--color-error-text); padding: var(--spacing-sm) 10px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13px; }

/* Nav */
.topbar { background: var(--color-card-bg); border-bottom: 1px solid var(--color-border); padding: 0 var(--spacing-lg); display: flex; align-items: center; height: 52px; }
.topbar .brand { font-weight: 600; margin-right: 32px; }
.topbar .links a { margin-right: 20px; color: var(--color-text-muted); font-size: 14px; padding: var(--radius-sm) 0; }
.topbar .links a.on { color: var(--color-primary); border-bottom: 2px solid var(--color-primary); }
.topbar .user { margin-left: auto; font-size: 13px; color: var(--color-text-muted); }
.topbar .user span { margin-right: 12px; }
.topbar .logout { background: none; border: 1px solid #d4d6db; padding: var(--radius-sm) 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--color-text-muted); }
.topbar .logout:hover { background: #f0f2f5; }

/* Page */
.page { max-width: 1100px; margin: 0 auto; padding: 28px var(--spacing-lg); }
.page h1 { margin: 0 0 20px; font-size: 22px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--spacing-md); }
.card { background: var(--color-card-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--spacing-md) 18px; }
.card-title { font-size: 12px; color: #788; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--spacing-sm); }
.big { font-size: 22px; font-weight: 600; }
.big.muted { color: #aab; font-weight: 400; }
.sub { font-size: 13px; color: #667; margin-top: var(--radius-md); }
.sub.warn { color: #b06000; }
.sub.ok { color: var(--color-success-text); }
.sub.muted { color: #99a; }
.note { font-size: 13px; margin-top: 10px; padding: var(--spacing-sm) 10px; background: #fafbfc; border-left: 3px solid #4070f0; }

.banner {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #d7dce2;
  border-left-width: 4px;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  background: #fff;
  color: var(--color-text);
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.banner-title {
  font-size: 13px;
  line-height: 1.35;
}
.banner-message {
  color: var(--color-text-muted);
  line-height: 1.45;
}
.banner.err, .err.banner {
  border-left-color: #b00020;
  background: #fff7f7;
  color: var(--color-error-text);
}
.banner.ok, .ok.banner {
  border-left-color: #1b7f3a;
  background: #f7fbf8;
  color: var(--color-success-text);
}
.banner.err .banner-message,
.banner.ok .banner-message {
  color: #3f4650;
}

/* Form */
.form label { display: block; margin-bottom: 14px; }
.form label > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: var(--radius-sm); }
.form input, .form textarea { width: 100%; padding: var(--spacing-sm) 10px; border: 1px solid #d4d6db; border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; }
.form small { display: block; margin-top: 3px; color: #889; font-size: 12px; }
.form button { padding: 9px 20px; background: var(--color-primary); color: var(--color-card-bg); border: none; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; }
.form button[disabled] { background: #c0c4cc; cursor: not-allowed; }

/* History */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.history { width: 100%; border-collapse: collapse; background: var(--color-card-bg); border-radius: var(--radius-md); overflow: hidden; }
table.history th, table.history td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--color-code-bg); font-size: 13px; vertical-align: top; }
table.history th { background: #fafbfc; font-size: 12px; color: #788; text-transform: uppercase; letter-spacing: 0.5px; }
table.history td.mono, table.history td.small { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #667; }
table.history tr.row-current { background: #f7fbff; }
table.history td.note-cell { max-width: 260px; word-break: break-word; }
.badge { display: inline-block; padding: 2px var(--spacing-sm); background: var(--color-primary); color: var(--color-card-bg); border-radius: 10px; font-size: 11px; }
.muted { color: #99a; padding: 40px; text-align: center; }

/* Control plane */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d4d6db;
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font-size: 14px;
}
.button:hover { text-decoration: none; background: #f6f7f8; }
.button.ghost { color: #3f4650; }

.control-page {
  max-width: 1240px;
}
.control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.control-head h1 {
  margin-bottom: 5px;
}
.control-head p,
.panel-head p,
.detail-title p {
  margin: 0;
  color: #667;
  font-size: 13px;
}
.control-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.control-actions button,
.pending-body button,
.profile-form button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #1c1f24;
  border-radius: 6px;
  background: #1c1f24;
  color: #fff;
  font-size: 14px;
}
.control-actions button[disabled],
.pending-body button[disabled] {
  border-color: #d4d6db;
  background: #f0f1f3;
  color: #88909a;
}
.control-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.control-metric {
  min-height: 82px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  padding: 13px 14px;
}
.metric-label {
  color: #667;
  font-size: 12px;
}
.metric-value {
  margin-top: 7px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  word-break: break-word;
}
.metric-foot {
  margin-top: 6px;
  color: #667;
  font-size: 12px;
}
.profile-panel {
  margin-bottom: 16px;
}
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(360px, 1.2fr);
}
.profile-column,
.profile-form {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid #eef0f3;
}
.profile-column:first-child {
  border-left: 0;
}
.profile-label {
  margin-bottom: 9px;
  color: #667;
  font-size: 12px;
}
.profile-column h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.25;
}
.profile-list {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
  font-size: 13px;
}
.profile-list dt {
  color: #667;
}
.profile-list dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}
.profile-note {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fafbfc;
  color: #3f4650;
  font-size: 13px;
  line-height: 1.45;
}
.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.profile-form .profile-label,
.profile-form .wide-field,
.profile-form button {
  grid-column: 1 / -1;
}
.profile-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.profile-form label span {
  color: #4f5863;
  font-size: 12px;
}
.profile-form input,
.profile-form select,
.profile-form textarea {
  width: 100%;
  border: 1px solid #d4d6db;
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
}
.profile-form input,
.profile-form select {
  height: 32px;
  padding: 0 9px;
}
.profile-form textarea {
  min-height: 58px;
  padding: 8px 9px;
  resize: vertical;
}
.field-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #4f5863;
  font-size: 12px;
}
.field-head small {
  color: #7b8490;
}
.mcp-server-rows {
  display: grid;
  gap: 7px;
}
.mcp-server-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.55fr) minmax(92px, 0.55fr) minmax(150px, 1.25fr) minmax(130px, 0.85fr) minmax(150px, 1fr);
  gap: 7px;
  padding: 8px;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  background: #fff;
}
.mcp-server-row textarea {
  min-height: 32px;
}
.mcp-conflict-note {
  grid-column: 1 / -1;
  margin-top: -2px;
  padding: 6px 8px;
  border: 1px solid #fde68a;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.45;
}
.speech-config-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  background: #fff;
}
.speech-config-grid label:nth-child(3) {
  grid-column: span 2;
}
.profile-form button {
  justify-self: start;
}
.inline-form {
  margin-top: 12px;
}
.control-workspace {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 360px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.control-panel {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.panel-head {
  min-height: 54px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head h2,
.detail-title h2,
.detail-block h3 {
  margin: 0;
  color: var(--color-text);
}
.panel-head h2 {
  font-size: 16px;
}
.panel-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}
.panel-filters input,
.panel-filters select {
  height: 34px;
  border: 1px solid #d4d6db;
  border-radius: 6px;
  background: #fafbfc;
  color: #667;
  padding: 0 10px;
}
.panel-filters input {
  width: 180px;
}
.control-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  table-layout: fixed;
}
.control-table th,
.control-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}
.control-table th {
  background: #fafbfc;
  color: #667;
  font-size: 12px;
  font-weight: 600;
}
.control-table tr.selected {
  background: #f4f5f6;
}
.control-table tr[data-device-row] {
  cursor: pointer;
}
.control-table tr[data-device-row]:focus-visible {
  outline: 2px solid #7b8794;
  outline-offset: -2px;
}
.control-table td strong {
  display: block;
  font-weight: 650;
}
.control-table td span {
  display: block;
  margin-top: 3px;
  color: #667;
}
.row-action-form {
  margin: 0;
}
.row-action-form button,
.control-table td > button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #b8bdc4;
  border-radius: 999px;
  color: #30343a;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}
.status-pill.ok::before,
.status-pill.neutral::before,
.status-pill.offline::before,
.status-pill.pending::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #30343a;
}
.status-pill.neutral::before {
  background: #a0a6ae;
}
.status-pill.offline {
  border-color: #d4d6db;
  color: #5f6670;
  background: #f6f7f8;
}
.status-pill.offline::before {
  background: #8f98a3;
}
.status-pill.pending {
  border-color: #d8c48a;
  color: #5a4a16;
  background: #fffaf0;
}
.status-pill.pending::before {
  background: #9a7a18;
}
.detail-panel {
  padding: 14px;
}
.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.detail-title h2 {
  font-size: 18px;
  line-height: 1.25;
}
.detail-list {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 6px 9px;
  margin: 0;
  font-size: 13px;
}
.detail-list dt {
  color: #667;
}
.detail-list dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}
.detail-block {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--color-border);
}
.detail-block h3 {
  margin-bottom: 9px;
  font-size: 14px;
}
.compare-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 13px;
}
.compare-row span,
.timeline-item span,
.pending-body span {
  color: #667;
}
.timeline-item {
  padding: 9px 0;
  border-top: 1px solid #eef0f3;
  font-size: 13px;
}
.timeline-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.timeline-item span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}
.detail-maintenance-action {
  display: grid;
  gap: 9px;
}
.detail-maintenance-action p {
  margin: 0;
  color: #667;
  font-size: 12px;
  line-height: 1.45;
}
.detail-maintenance-action .maintenance-warning {
  padding: 8px;
  border: 1px solid #d8c48a;
  border-radius: 6px;
  background: #fffaf0;
  color: #5a4a16;
}
.detail-maintenance-action button {
  justify-self: start;
}
.prominent-maintenance {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--control-panel-soft);
}
.prominent-maintenance h3 {
  margin-bottom: 8px;
}
.maintenance-fallback-actions {
  display: grid;
  gap: 10px;
}
.pending-panel {
  margin-bottom: 16px;
}
.pending-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}
.pending-body span,
.pending-body strong {
  display: block;
}
.pending-body span {
  margin-bottom: 4px;
  font-size: 12px;
}
.pending-body strong {
  font-size: 14px;
}
.pending-body small {
  display: block;
  margin-top: 4px;
  color: #667;
  font-size: 12px;
}
.pending-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.pending-actions .inline-form {
  margin: 0;
}
.diff-preview-panel {
  margin-bottom: 16px;
}
.diff-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
}
.diff-preview-main,
.confirm-checks {
  min-width: 0;
}
.diff-preview-main {
  border-right: 1px solid var(--color-border);
}
.diff-preview-head,
.diff-preview-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) 88px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.diff-preview-head {
  background: var(--control-panel-soft);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 650;
}
.diff-preview-row:last-child {
  border-bottom: 0;
}
.diff-preview-row.changed {
  background: #fbfbfc;
}
.diff-preview-row strong {
  min-width: 0;
  font-weight: 650;
  word-break: break-word;
}
.confirm-checks {
  display: grid;
  align-content: start;
}
.confirm-check {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.confirm-check:last-child {
  border-bottom: 0;
}
.confirm-check span:first-child {
  color: var(--color-text-muted);
}
.confirm-check strong {
  min-width: 0;
  font-weight: 650;
  word-break: break-word;
}
.audit-panel {
  margin-bottom: 8px;
}
.rollback-panel,
.apply-results-panel {
  margin-bottom: 16px;
}
.rollback-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}
.rollback-body span,
.rollback-body strong,
.rollback-body small {
  display: block;
}
.rollback-body span,
.rollback-body small {
  color: #667;
  font-size: 12px;
}
.rollback-body strong {
  margin-top: 4px;
  font-size: 14px;
}
.rollback-body p {
  margin: 0;
  color: #3f4650;
  font-size: 13px;
  line-height: 1.45;
}
.panel-action-form,
.rollback-body .inline-form {
  margin: 0;
}
.apply-results-table td:last-child {
  word-break: break-word;
}
.audit-table td:last-child {
  word-break: break-word;
}
.empty-state {
  display: grid;
  gap: 6px;
  padding: 20px 14px;
  color: #667;
  font-size: 13px;
  text-align: center;
}
.empty-state strong {
  color: var(--color-text);
  font-size: 15px;
}
.empty-state.compact {
  padding: 12px 8px;
}
.is-hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; height: auto; padding: var(--spacing-sm) 12px; }
  .page { padding: var(--spacing-md) 12px; }
  .grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .control-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
  .control-summary,
  .control-workspace,
  .profile-grid,
  .pending-body {
    grid-template-columns: 1fr;
  }
  .profile-column,
  .profile-form {
    border-left: 0;
    border-top: 1px solid #eef0f3;
  }
  .profile-column:first-child {
    border-top: 0;
  }
  .profile-form {
    grid-template-columns: 1fr;
  }
  .panel-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-filters input,
  .panel-filters select {
    width: 100%;
  }
  .control-table {
    min-width: 760px;
  }
}

/* Control plane gray console shell. Mirrors the desktop gray demo without changing release routes. */
:root {
  --color-primary: #18181b;
  --color-primary-hover: #27272a;
  --color-bg: #f4f4f5;
  --color-text: #18181b;
  --color-text-muted: #71717a;
  --color-border: #d4d4d8;
  --color-card-bg: #fff;
  --color-code-bg: #e4e4e7;
  --control-panel-soft: #fafafa;
  --control-line-dark: #a1a1aa;
  --control-ink: #27272a;
  --control-black: #09090b;
  --control-sidebar-bg: #ededee;
  --control-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--control-ink);
}

.control-app {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--color-bg);
}

.control-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  border-right: 1px solid var(--color-border);
  background: var(--control-sidebar-bg);
  padding: 14px 10px;
}

.control-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 8px 14px;
  border-bottom: 1px solid var(--color-border);
}

.control-brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--control-black);
  border-radius: 6px;
  color: var(--control-black);
  font-size: 13px;
  font-weight: 700;
}

.control-brand-name {
  font-weight: 700;
  line-height: 1.1;
}

.control-brand-sub {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.1;
}

.control-nav {
  display: grid;
  gap: 3px;
  margin-top: 14px;
}

.control-nav-label {
  margin: 14px 8px 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.control-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 31px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--control-ink);
  font-size: 14px;
}

.control-nav-item:hover {
  text-decoration: none;
  background: #f3f3f4;
}

.control-nav-item.active {
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: var(--control-shadow);
  font-weight: 650;
}

.control-nav-count {
  color: var(--color-text-muted);
  font-size: 12px;
}

.control-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 48px 1fr;
}

.control-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  background: #fff;
  padding: 0 18px;
}

.control-crumb,
.control-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.control-crumb {
  color: var(--color-text-muted);
  font-size: 13px;
}

.control-crumb strong {
  color: var(--color-text);
}

.control-user {
  color: var(--color-text-muted);
  font-size: 13px;
}

.control-logout-form {
  display: inline-flex;
  margin: 0;
}

.control-content {
  min-width: 0;
  padding: 14px 18px;
  display: grid;
  gap: 12px;
}

.control-page {
  max-width: none;
}

.control-head {
  margin: 0;
}

.control-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 750;
}

.control-head p {
  margin-top: 5px;
}

.button,
.control-actions button,
.pending-body button,
.profile-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--control-ink);
  box-shadow: none;
  font-size: 14px;
  cursor: default;
}

.button:hover {
  background: var(--control-panel-soft);
  text-decoration: none;
}

.button.primary,
.profile-form button,
.pending-actions .inline-form button {
  border-color: var(--control-black);
  background: var(--control-black);
  color: #fff;
}

.button.ghost {
  color: var(--control-ink);
}

.button[disabled],
button[disabled] {
  border-color: var(--color-border);
  background: #f3f3f4;
  color: var(--color-text-muted);
}

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

.control-metric {
  min-height: 66px;
  border-color: var(--color-border);
  background: #fff;
  border-radius: 8px;
  padding: 10px 11px;
  box-shadow: var(--control-shadow);
}

.metric-label,
.metric-foot,
.panel-head p,
.detail-title p,
.profile-label,
.profile-list dt,
.detail-list dt,
.compare-row span,
.timeline-item span,
.pending-body span,
.pending-body small {
  color: var(--color-text-muted);
}

.metric-value {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 750;
}

.control-panel {
  border-color: var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--control-shadow);
}

.maintenance-panel {
  margin: 0;
}

.maintenance-body {
  display: grid;
  grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
  gap: 0;
}

.compact-maintenance-body {
  display: block;
}

.maintenance-copy {
  padding: 12px;
  border-right: 1px solid var(--color-border);
  background: var(--control-panel-soft);
}

.maintenance-copy span,
.maintenance-action span {
  display: block;
  color: var(--color-text-muted);
  font-size: 12px;
}

.maintenance-copy strong {
  display: block;
  margin-top: 6px;
  color: var(--control-ink);
  font-size: 13px;
  line-height: 1.45;
}

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

.system-maintenance-panel .maintenance-actions {
  grid-template-columns: minmax(0, 1fr);
}

.maintenance-action {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 86px;
  margin: 0;
  padding: 11px 12px;
  border-left: 1px solid var(--color-border);
}

.maintenance-action:first-child {
  border-left: 0;
}

.maintenance-action strong {
  display: block;
  color: var(--control-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.maintenance-action span {
  margin-top: 5px;
  line-height: 1.45;
}

.maintenance-action button {
  justify-self: start;
}

.maintenance-action-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 0;
  border-left: 0;
}

.maintenance-action-row button {
  justify-self: end;
}

.profile-panel,
.pending-panel,
.audit-panel,
.policy-panel,
.capability-panel,
.device-policy-panel,
.control-workspace {
  margin: 0;
}

.panel-head {
  min-height: 44px;
  padding: 10px 12px;
  border-bottom-color: var(--color-border);
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 700;
}

.profile-grid {
  grid-template-columns: minmax(220px, 0.86fr) minmax(220px, 0.86fr) minmax(360px, 1.15fr);
}

.profile-column,
.profile-form {
  padding: 11px 12px;
  border-left-color: var(--color-border);
}

.profile-column h3 {
  font-size: 15px;
  font-weight: 700;
}

.profile-note,
.compare-row {
  border-color: var(--color-border);
  background: var(--control-panel-soft);
}

.policy-summary .metric-value {
  font-size: 18px;
  line-height: 1.25;
}

.policy-rows,
.capability-list {
  display: grid;
}

.policy-row,
.capability-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(170px, 0.8fr) minmax(280px, 1.4fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid var(--color-border);
}

.policy-row:first-child,
.capability-row:first-child {
  border-top: 0;
}

.policy-row span,
.policy-row small,
.capability-row span {
  display: block;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.policy-row strong,
.capability-row strong {
  display: block;
  margin-top: 4px;
  color: var(--control-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.policy-row .status-pill {
  display: inline-flex;
  margin-bottom: 6px;
}

.capability-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.capability-row > div {
  min-width: 0;
}

.profile-form {
  gap: 8px 10px;
  background: var(--control-panel-soft);
}

.profile-form input,
.profile-form select,
.profile-form textarea,
.panel-filters input,
.panel-filters select {
  border-color: var(--color-border);
  background: var(--control-panel-soft);
  color: var(--control-ink);
  border-radius: 6px;
}

.profile-form textarea {
  min-height: 58px;
}

.control-workspace {
  grid-template-columns: minmax(520px, 1fr) 330px;
  gap: 12px;
}

.control-table th,
.control-table td {
  border-bottom-color: var(--color-border);
  padding: 8px 10px;
}

.control-table th {
  background: var(--control-panel-soft);
  color: var(--color-text-muted);
  font-weight: 650;
}

.control-table tr.selected {
  background: #f1f1f2;
}

.control-table tr.row-current {
  background: #f6f6f7;
}

.control-table td strong {
  font-weight: 680;
}

.status-pill {
  gap: 6px;
  min-height: 22px;
  padding: 0 7px;
  border-color: var(--control-line-dark);
  color: var(--control-ink);
  background: #fff;
}

.status-pill.ok,
.status-pill.pending,
.status-pill.offline,
.status-pill.neutral {
  border-color: var(--control-line-dark);
  color: var(--control-ink);
  background: #fff;
}

.status-pill.ok::before,
.status-pill.neutral::before,
.status-pill.pending::before,
.status-pill.offline::before {
  width: 7px;
  height: 7px;
  margin-right: 0;
  background: var(--control-ink);
}

.status-pill.neutral::before,
.status-pill.pending::before {
  background: #a1a1aa;
}

.status-pill.offline::before {
  background: transparent;
  border: 1px solid var(--control-ink);
}

.detail-panel {
  padding: 0;
}

.detail-panel > [data-detail-content],
.detail-panel > .empty-state {
  padding: 12px;
}

.detail-title {
  align-items: center;
}

.detail-title h2 {
  font-size: 16px;
}

.detail-list,
.profile-list {
  line-height: 1.35;
}

.detail-block {
  border-top-color: var(--color-border);
}

.timeline-item {
  border-top-color: var(--color-border);
}

.pending-body {
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 12px;
  padding: 12px;
}

.pending-body strong {
  color: var(--control-ink);
  font-weight: 650;
}

.diff-preview-panel {
  margin: 0;
}

.rollback-panel,
.apply-results-panel {
  margin: 0;
}

.rollback-body {
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
}

.rollback-body span,
.rollback-body small {
  color: var(--color-text-muted);
}

.rollback-body p {
  color: var(--control-ink);
}

.history-panel,
.release-panel,
.release-form {
  margin: 0;
}

.history-table,
.audit-table {
  min-width: 920px;
}

.history-table .note-cell,
.audit-table td:last-child {
  max-width: 360px;
  word-break: break-word;
}

.release-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 16px;
}

.force-release-grid {
  padding: 14px;
}

.force-release-form {
  display: grid;
  align-content: start;
  gap: 12px;
}

.release-panel-body,
.release-form-body {
  padding: 14px;
}

.release-list {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.release-list dt {
  color: var(--color-text-muted);
}

.release-list dd {
  min-width: 0;
  margin: 0;
  word-break: break-word;
}

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

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

.release-form label > span {
  color: #4f5863;
  font-size: 12px;
}

.release-form input,
.release-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--control-panel-soft);
  color: var(--control-ink);
  font: inherit;
  font-size: 13px;
}

.release-form input {
  height: 34px;
  padding: 0 10px;
}

.release-form textarea {
  min-height: 86px;
  padding: 9px 10px;
  resize: vertical;
}

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

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

.diff-preview-main {
  border-right-color: var(--color-border);
}

.diff-preview-head {
  background: var(--control-panel-soft);
}

.empty-state {
  color: var(--color-text-muted);
}

.empty-state strong {
  color: var(--color-text);
}

@media (max-width: 1100px) {
  .control-app {
    grid-template-columns: 1fr;
  }

  .control-sidebar {
    display: none;
  }

  .control-workspace {
    grid-template-columns: 1fr;
  }

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

  .maintenance-body,
  .maintenance-actions {
    grid-template-columns: 1fr;
  }

  .maintenance-copy,
  .maintenance-action,
  .maintenance-action:first-child {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--color-border);
  }

  .maintenance-copy {
    border-top: 0;
  }

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

  .policy-row {
    grid-template-columns: 1fr;
  }

  .mcp-server-row {
    grid-template-columns: 1fr;
  }

  .speech-config-grid {
    grid-template-columns: 1fr;
  }

  .speech-config-grid label:nth-child(3) {
    grid-column: auto;
  }

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

  .profile-column,
  .profile-form {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }

  .profile-column:first-child {
    border-top: 0;
  }
}

@media (max-width: 720px) {
  .control-topbar,
  .control-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .control-topbar,
  .control-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .control-top-actions,
  .control-actions,
  .panel-filters {
    flex-wrap: wrap;
  }

  .panel-filters input,
  .panel-filters select,
  .profile-form input,
  .profile-form select {
    width: 100%;
  }

  .control-summary,
  .pending-body,
  .rollback-body,
  .diff-preview-grid,
  .capability-row,
  .inline-field {
    grid-template-columns: 1fr;
  }

  .diff-preview-main {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .diff-preview-head,
  .diff-preview-row,
  .confirm-check {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .control-table {
    min-width: 760px;
  }
}

/* 2026-05-30 human UI redesign: overview first, dangerous actions isolated. */
:root {
  --ui-blue: #2563eb;
  --ui-blue-soft: #eff6ff;
  --ui-green: #16a34a;
  --ui-green-soft: #f0fdf4;
  --ui-amber: #d97706;
  --ui-amber-soft: #fffbeb;
  --ui-red: #dc2626;
  --ui-red-soft: #fef2f2;
  --ui-purple: #7c3aed;
  --ui-purple-soft: #f5f3ff;
  --ui-card-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.control-content {
  gap: 16px;
  padding: 18px 22px 26px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  min-height: 180px;
  padding: 26px;
  border: 1px solid #dbe3ef;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 56%, #edf5ff 100%);
  box-shadow: var(--ui-card-shadow);
  overflow: hidden;
}

.hero-panel.ok {
  border-color: #bbf7d0;
  background:
    radial-gradient(circle at top right, rgba(22, 163, 74, 0.17), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f7fdf9 56%, #effdf4 100%);
}

.hero-panel.pending {
  border-color: #fde68a;
  background:
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.18), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #fffdf6 56%, #fffbeb 100%);
}

.hero-panel.err {
  border-color: #fecaca;
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.16), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #fff8f8 56%, #fef2f2 100%);
}

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

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.hero-orb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ui-blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.11);
}

.hero-panel.ok .hero-orb { background: var(--ui-green); box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12); }
.hero-panel.pending .hero-orb { background: var(--ui-amber); box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.13); }
.hero-panel.err .hero-orb { background: var(--ui-red); box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.12); }

.hero-panel h1 {
  margin: 16px 0 0;
  color: #0f172a;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero-panel p {
  max-width: 760px;
  margin: 13px 0 0;
  color: #475569;
  font-size: 15px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #64748b;
  font-size: 12px;
}

.hero-meta strong {
  color: #0f172a;
  font-weight: 800;
}

.hero-actions {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  min-width: 156px;
}

.hero-actions .button {
  height: 42px;
  border-radius: 999px;
  font-weight: 750;
}

.button.primary,
.profile-form button,
.pending-actions .inline-form button {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}

.button.primary:hover,
.profile-form button:hover,
.pending-actions .inline-form button:hover {
  background: #1e293b;
}

.button.danger-link,
.danger-button {
  border-color: #fecaca;
  background: #fff;
  color: #991b1b;
}

.button.danger-link:hover,
.danger-button:hover {
  background: var(--ui-red-soft);
}

.control-summary-redesign {
  gap: 12px;
}

.control-summary-redesign .control-metric {
  position: relative;
  min-height: 104px;
  padding: 15px 16px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--ui-card-shadow);
  overflow: hidden;
}

.control-summary-redesign .control-metric::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px auto;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  opacity: 0.18;
  background: var(--ui-blue);
}

.control-summary-redesign .metric-online::after { background: var(--ui-green); }
.control-summary-redesign .metric-config::after { background: var(--ui-purple); }
.control-summary-redesign .metric-release::after { background: var(--ui-blue); }
.control-summary-redesign .metric-pending::after { background: var(--ui-amber); }

.control-summary-redesign .metric-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.control-summary-redesign .metric-value {
  margin-top: 10px;
  color: #0f172a;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.control-summary-redesign .metric-foot {
  margin-top: 8px;
  color: #64748b;
}

.control-panel {
  border-color: #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.045);
}

.panel-head {
  min-height: 58px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.panel-head h2 {
  color: #0f172a;
  font-size: 15px;
}

.panel-head p {
  color: #64748b;
  line-height: 1.45;
}

.command-panel {
  border-color: #dbeafe;
  background: #fff;
}

.command-panel .panel-head {
  background: linear-gradient(90deg, #eff6ff, #fff);
}

.control-workspace {
  grid-template-columns: minmax(560px, 1fr) 360px;
  gap: 16px;
}

.control-table th {
  background: #f8fafc;
  color: #64748b;
}

.control-table tr.selected {
  background: #eff6ff;
}

.control-table tr[data-device-row]:hover {
  background: #f8fafc;
}

.status-pill.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.status-pill.pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.status-pill.offline {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}
.status-pill.neutral {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1e40af;
}
.status-pill.ok::before { background: var(--ui-green); }
.status-pill.pending::before { background: var(--ui-amber); }
.status-pill.offline::before { border: 0; background: #94a3b8; }
.status-pill.neutral::before { background: var(--ui-blue); }

.detail-panel,
.detail-panel > [data-detail-content],
.detail-panel > .empty-state {
  border-radius: 18px;
}

.detail-hint,
.release-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.55;
}

.release-note.warn {
  margin-top: 0;
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

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

.profile-state-grid .profile-column {
  border-left: 0;
}

.profile-state-grid .profile-column + .profile-column {
  border-left: 1px solid #e2e8f0;
}

.profile-editor-drawer {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.profile-editor-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  color: #0f172a;
}

.profile-editor-drawer summary::-webkit-details-marker {
  display: none;
}

.profile-editor-drawer summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.profile-editor-drawer[open] summary::after {
  content: "–";
}

.profile-editor-drawer summary span {
  font-weight: 800;
}

.profile-editor-drawer summary small {
  color: #64748b;
  font-size: 12px;
}

.profile-editor-drawer .profile-form {
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.danger-zone {
  border-color: #fecaca;
}

.danger-zone .panel-head,
.force-release-zone .panel-head {
  background: linear-gradient(90deg, #fef2f2, #fff);
}

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

.danger-action {
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 142px;
  margin: 0;
  padding: 16px;
  border-left: 1px solid #fee2e2;
  background: #fff;
}

.danger-action:first-child {
  border-left: 0;
}

.danger-action strong,
.force-release-form span {
  display: block;
  color: #111827;
  font-weight: 800;
}

.danger-action span {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.danger-action .button {
  justify-self: start;
}

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

.release-grid + .release-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.force-release-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.force-release-form {
  padding: 14px;
  border: 1px solid #fee2e2;
  border-radius: 16px;
  background: #fffafa;
}

.publish-android-form {
  border-color: #bfdbfe;
}

.publish-android-form .panel-head {
  background: linear-gradient(90deg, #eff6ff, #fff);
}

#live-box {
  text-align: left;
}

@media (max-width: 1180px) {
  .hero-panel,
  .control-workspace,
  .danger-grid,
  .release-grid,
  .release-grid + .release-grid,
  .force-release-grid,
  .profile-state-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .profile-state-grid .profile-column + .profile-column,
  .danger-action,
  .danger-action:first-child {
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }

  .danger-action:first-child {
    border-top: 0;
  }
}

@media (max-width: 720px) {
  .control-content {
    padding: 14px;
  }

  .hero-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .control-summary-redesign {
    grid-template-columns: 1fr;
  }

  .profile-editor-drawer summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 2026-05-30 second cut: task-board UI, card-first devices, drawers by default. */
body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 34rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.control-app {
  grid-template-columns: 236px minmax(0, 1fr);
  background: transparent;
}

.control-sidebar {
  border-right: 1px solid rgba(203, 213, 225, 0.72);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(241,245,249,.82));
  color: #0f172a;
  padding: 18px 12px;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.72);
}

.control-brand {
  height: auto;
  padding: 6px 8px 18px;
  border-bottom-color: rgba(203, 213, 225, 0.82);
}

.control-brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  color: #fff;
}

.control-brand-name { color: #0f172a; }
.control-brand-sub { color: #64748b; }
.control-nav { gap: 6px; }
.control-nav-label { color: #64748b; text-transform: uppercase; letter-spacing: .08em; }
.control-nav-item { color: #334155; min-height: 38px; border-radius: 12px; }
.control-nav-item:hover { background: rgba(219, 234, 254, 0.78); color: #0f172a; }
.control-nav-item.active {
  border: 1px solid rgba(37, 99, 235, 0.24);
  background: rgba(255,255,255,.92);
  color: #0f172a;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.10);
}
.control-nav-count { color: #2563eb; }

.control-main { grid-template-rows: 56px 1fr; }
.control-topbar {
  border-bottom: 0;
  background: rgba(255,255,255,.76);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.22);
}
.control-content { max-width: 1500px; width: 100%; margin: 0 auto; padding: 22px 26px 34px; gap: 18px; }

.ops-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 16px;
  align-items: stretch;
}

.ops-status,
.ops-next-card,
.ops-metrics > div,
.probe-card {
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

.ops-status {
  min-height: 260px;
  padding: 30px;
  background:
    radial-gradient(circle at 86% 18%, rgba(96, 165, 250, .22), transparent 22rem),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.92));
}
.ops-board.ok .ops-status { background: radial-gradient(circle at 86% 18%, rgba(34,197,94,.18), transparent 22rem), linear-gradient(135deg, rgba(255,255,255,.96), rgba(240,253,244,.92)); }
.ops-board.pending .ops-status { background: radial-gradient(circle at 86% 18%, rgba(245,158,11,.20), transparent 22rem), linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,251,235,.94)); }
.ops-board.err .ops-status { background: radial-gradient(circle at 86% 18%, rgba(239,68,68,.18), transparent 22rem), linear-gradient(135deg, rgba(255,255,255,.96), rgba(254,242,242,.94)); }

.ops-kicker { display: inline-flex; align-items: center; gap: 9px; color: #334155; font-weight: 800; font-size: 13px; }
.ops-status h1 { max-width: 720px; margin: 18px 0 0; color: #0f172a; font-size: clamp(38px, 5vw, 68px); line-height: .96; letter-spacing: -.065em; }
.ops-status p { max-width: 740px; margin: 18px 0 0; color: #475569; font-size: 16px; line-height: 1.8; }
.ops-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.ops-actions .button { height: 42px; border-radius: 999px; font-weight: 800; }

.ops-next-card { display: flex; flex-direction: column; padding: 22px; }
.ops-card-label { color: #64748b; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.ops-next-card strong { display: block; margin-top: 15px; color: #0f172a; font-size: 24px; line-height: 1.15; letter-spacing: -.03em; }
.ops-next-card > span { margin-top: 10px; color: #64748b; line-height: 1.65; }
.ops-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 22px; }
.ops-card-actions .inline-form { margin: 0; }

.ops-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ops-metrics > div { min-height: 112px; padding: 18px; }
.ops-metrics span, .ops-metrics small, .probe-card span, .probe-card small { display: block; color: #64748b; font-size: 12px; font-weight: 700; }
.ops-metrics strong, .probe-card strong { display: block; margin-top: 8px; color: #0f172a; font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.ops-metrics small, .probe-card small { margin-top: 10px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }

.control-panel { border: 1px solid rgba(203, 213, 225, .9); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: 0 12px 34px rgba(15, 23, 42, .06); }
.panel-head { min-height: 64px; padding: 16px 18px; background: transparent; }
.panel-head h2 { font-size: 17px; letter-spacing: -.02em; }
.panel-head p { margin-top: 4px; font-size: 13px; }

.device-studio { overflow: hidden; }
.studio-head { align-items: center; }
.device-studio-grid { display: grid; grid-template-columns: minmax(420px, .78fr) minmax(420px, 1.22fr); gap: 0; border-top: 1px solid #e2e8f0; }
.device-card-list { display: grid; align-content: start; gap: 12px; padding: 16px; border-right: 1px solid #e2e8f0; background: #f8fafc; }
.device-card { display: grid; gap: 14px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; cursor: pointer; transition: .16s ease; }
.device-card:hover { transform: translateY(-1px); border-color: #bfdbfe; box-shadow: 0 12px 28px rgba(37, 99, 235, .08); }
.device-card.selected { border-color: #60a5fa; background: #eff6ff; box-shadow: inset 4px 0 0 #2563eb; }
.device-card-top, .device-card-bottom { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.device-card-top strong { display: block; color: #0f172a; font-size: 16px; }
.device-card-top span:not(.status-pill), .device-card-mid, .device-card-bottom small { color: #64748b; font-size: 12px; }
.device-card-mid { display: flex; flex-wrap: wrap; gap: 8px; }
.device-card-mid span { padding: 5px 8px; border-radius: 999px; background: #f1f5f9; }
.device-card-state-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.device-readback-form {
  display: inline-flex;
  margin: 0;
}
.device-readback-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.device-readback-form button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.device-inspector { min-width: 0; padding: 20px; background: #fff; }
.inspector-title h2 { font-size: 24px; letter-spacing: -.04em; }
.inspector-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.inspector-facts > div { min-width: 0; padding: 13px; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; }
.inspector-facts span { display: block; color: #64748b; font-size: 12px; }
.inspector-facts strong { display: block; margin-top: 6px; color: #0f172a; font-size: 13px; word-break: break-word; }
.inspector-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
.inspector-section h3 { margin: 0 0 10px; color: #0f172a; font-size: 14px; }
.inspector-compact-title {
  gap: 14px;
  align-items: flex-start;
}
.inspector-compact-title h2 {
  font-size: 22px;
  line-height: 1.12;
}
.inspector-meta-strip,
.inspector-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.inspector-meta-strip span,
.inspector-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.25;
}
.inspector-meta-strip b,
.inspector-chip b {
  flex: 0 0 auto;
  color: #64748b;
  font-weight: 700;
}
.inspector-meta-strip strong,
.inspector-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspector-chip-grid .status-pill {
  min-height: 30px;
  border-radius: 999px;
  font-size: 12px;
}
.inspector-drawer {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.inspector-drawer summary {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
}
.inspector-drawer summary::-webkit-details-marker {
  display: none;
}
.inspector-drawer summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: rotate(45deg);
  transition: transform .16s ease;
}
.inspector-drawer[open] summary::after {
  transform: rotate(225deg);
}
.inspector-drawer summary > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.inspector-drawer summary > strong {
  min-width: 0;
  justify-self: end;
  color: #0f172a;
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: right;
}
.inspector-drawer-body,
.runtime-compact-list {
  padding: 8px 10px 10px;
}
.runtime-compact-list {
  display: grid;
  gap: 8px;
}
.runtime-compact-list > div {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
}
.runtime-compact-list > div:first-child {
  padding-top: 0;
  border-top: 0;
}
.runtime-compact-list span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.runtime-compact-list p {
  margin: 0;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.runtime-compact-list strong {
  color: #0f172a;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.inspector-drawer .compare-row {
  margin-top: 5px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.inspector-drawer .config-summary {
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.quiet-panel .panel-head { border-bottom: 1px solid #e2e8f0; }
.profile-brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.profile-brief { min-width: 0; padding: 16px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; }
.profile-brief.pending { border-color: #fde68a; background: #fffbeb; }
.profile-brief h3 { margin: 8px 0 12px; color: #0f172a; font-size: 22px; letter-spacing: -.04em; }
.brief-lines { display: flex; flex-wrap: wrap; gap: 8px; }
.brief-lines span { padding: 6px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; }
.brief-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.brief-actions .inline-form { margin: 0; }
.mini-drawer { margin-top: 14px; }
.mini-drawer summary { cursor: pointer; color: #2563eb; font-size: 13px; font-weight: 800; }
.mini-drawer .profile-list { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.profile-editor-drawer { border-top: 1px solid #e2e8f0; background: #f8fafc; }
.profile-editor-drawer summary { min-height: 64px; }

.drawer-summary { display: grid; grid-template-columns: minmax(160px, auto) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 18px; cursor: pointer; list-style: none; }
.drawer-summary::-webkit-details-marker { display: none; }
.drawer-summary span { color: #0f172a; font-size: 16px; font-weight: 900; }
.drawer-summary small { color: #64748b; line-height: 1.45; }
.drawer-summary b { padding: 6px 10px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 12px; }
details[open] > .drawer-summary b { background: #dbeafe; color: #1e40af; }
.danger-drawer, .record-drawer { overflow: hidden; }
.danger-drawer:not([open]), .record-drawer:not([open]) { box-shadow: none; }
.danger-summary { background: #fff7f7; }
.danger-summary span { color: #991b1b; }
.drawer-toolbar { display: flex; justify-content: flex-end; padding: 0 16px 14px; }

.release-grid { gap: 14px; }
.release-panel-body, .release-form-body { padding: 16px; }
.force-release-zone:not([open]) .force-release-grid { display: none; }

.policy-summary { gap: 12px; }
.policy-row { grid-template-columns: minmax(180px, .8fr) minmax(180px, .8fr) minmax(300px, 1.3fr); }
.capability-row { min-height: 74px; }
.device-policy-panel .control-table td { vertical-align: top; }

.page { max-width: 1280px; padding: 34px 24px; }
.page h1 { font-size: 44px; letter-spacing: -.055em; }
.card { border-radius: 22px; border-color: #e2e8f0; box-shadow: 0 14px 34px rgba(15,23,42,.06); }

@media (max-width: 1180px) {
  .control-app { grid-template-columns: 1fr; }
  .control-sidebar { display: none; }
  .ops-board, .ops-metrics, .device-studio-grid, .profile-brief-grid { grid-template-columns: 1fr; }
  .device-card-list { border-right: 0; border-bottom: 1px solid #e2e8f0; }
  .drawer-summary { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .control-content { padding: 14px; }
  .ops-status { min-height: 0; padding: 22px; border-radius: 22px; }
  .ops-status h1 { font-size: 38px; }
  .ops-actions, .ops-card-actions { flex-direction: column; }
  .ops-actions .button, .ops-card-actions .button, .ops-card-actions button { width: 100%; }
  .inspector-facts { grid-template-columns: 1fr; }
  .device-card-top, .device-card-bottom { flex-direction: column; align-items: flex-start; }
}

/* Second cut publish center */
.publish-board {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 16px;
}
.publish-status,
.publish-facts > div {
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 28px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 20px 50px rgba(15,23,42,.08);
}
.publish-status {
  min-height: 240px;
  padding: 30px;
  background:
    radial-gradient(circle at 86% 18%, rgba(96, 165, 250, .22), transparent 22rem),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.92));
}
.publish-board.pending .publish-status { background: radial-gradient(circle at 86% 18%, rgba(245,158,11,.20), transparent 22rem), linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,251,235,.94)); }
.publish-board.ok .publish-status { background: radial-gradient(circle at 86% 18%, rgba(34,197,94,.18), transparent 22rem), linear-gradient(135deg, rgba(255,255,255,.96), rgba(240,253,244,.92)); }
.publish-board.err .publish-status { background: radial-gradient(circle at 86% 18%, rgba(239,68,68,.18), transparent 22rem), linear-gradient(135deg, rgba(255,255,255,.96), rgba(254,242,242,.94)); }
.publish-status h1 { margin: 18px 0 0; color: #0f172a; font-size: clamp(42px, 5vw, 72px); line-height: .95; letter-spacing: -.065em; }
.publish-status p { max-width: 720px; margin: 18px 0 0; color: #475569; font-size: 16px; line-height: 1.8; }
.publish-facts { display: grid; gap: 12px; }
.publish-facts > div { padding: 20px; }
.publish-facts span, .publish-facts small { display: block; color: #64748b; font-size: 12px; font-weight: 800; }
.publish-facts strong { display: block; margin-top: 8px; color: #0f172a; font-size: 30px; letter-spacing: -.04em; }
.publish-facts small { margin-top: 8px; font-weight: 500; line-height: 1.45; word-break: break-word; }
.publish-android-form { order: -1; }

@media (max-width: 1180px) {
  .publish-board { grid-template-columns: 1fr; }
  .publish-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .publish-facts { grid-template-columns: 1fr; }
  .publish-status { min-height: 0; padding: 22px; }
  .publish-status h1 { font-size: 40px; }
}

/* Second cut landing dashboard */
.landing-page { max-width: 1380px; }
.landing-hero { padding: 32px; border: 1px solid #dbeafe; border-radius: 30px; background: radial-gradient(circle at 86% 10%, rgba(96,165,250,.24), transparent 22rem), linear-gradient(135deg,#fff,#eff6ff); box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.landing-hero h1 { margin: 18px 0 0; color: #0f172a; font-size: clamp(44px, 6vw, 78px); line-height: .95; letter-spacing: -.07em; }
.landing-hero p { max-width: 760px; margin: 16px 0 0; color: #475569; font-size: 16px; line-height: 1.8; }
.landing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.landing-card { min-width: 0; padding: 20px; border: 1px solid #e2e8f0; border-radius: 24px; background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.06); }
.landing-card.primary-card { grid-column: span 2; }
.landing-card span { display: block; color: #64748b; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.landing-card strong { display: block; margin-top: 10px; color: #0f172a; font-size: 32px; letter-spacing: -.05em; }
.landing-card strong.muted { color: #94a3b8; }
.landing-card small { display: block; margin-top: 8px; color: #64748b; line-height: 1.45; word-break: break-word; }
.landing-card p { margin: 12px 0 0; color: #334155; line-height: 1.6; }
.landing-card button { margin-top: 14px; }
@media (max-width: 1100px) { .landing-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 720px) { .landing-grid, .landing-card.primary-card { grid-template-columns: 1fr; grid-column: auto; } .landing-hero { padding: 22px; } }

.sleek-topbar { height: 60px; border-bottom: 0; background: rgba(15,23,42,.96); color: #e5e7eb; }
.sleek-topbar .brand { color: #fff; }
.sleek-topbar .links a { color: #cbd5e1; padding: 8px 10px; border-radius: 999px; }
.sleek-topbar .links a:hover { background: rgba(148,163,184,.14); text-decoration: none; color: #fff; }
.sleek-topbar .links a.on { border-bottom: 0; background: rgba(37,99,235,.28); color: #fff; }
.sleek-topbar .user { color: #cbd5e1; }
.sleek-topbar .logout { border-color: rgba(148,163,184,.35); color: #e5e7eb; }
.sleek-topbar .logout:hover { background: rgba(148,163,184,.14); }

/* Second cut: make secondary pages easier to scan without changing data. */
.control-head {
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(248,250,252,.9));
  box-shadow: 0 14px 34px rgba(15,23,42,.055);
}
.control-head h1 { font-size: clamp(30px, 4vw, 50px); letter-spacing: -.06em; }
.policy-summary .control-metric,
.control-summary:not(.control-summary-redesign) .control-metric {
  min-height: 110px;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(15,23,42,.06);
}
.policy-row {
  padding: 18px;
  border-top-color: #e2e8f0;
}
.policy-row strong { font-size: 15px; }
.capability-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.capability-row { border: 1px solid #e2e8f0; border-radius: 18px; padding: 16px; }
.capability-row:first-child { border-top: 1px solid #e2e8f0; }
@media (max-width: 900px) { .capability-list { grid-template-columns: 1fr; } .policy-row { grid-template-columns: 1fr; } }

/* Nav de-dup: history belongs to publish center, not primary navigation. */
.panel-head-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.slim-button { min-height: 28px; height: 28px; padding: 0 10px; font-size: 12px; }
.history-panel .panel-head .button.primary { height: 34px; border-radius: 999px; }

/* OTA history pagination */
.page-size-form { margin: 0; }
.page-size-form label { display: inline-flex; align-items: center; gap: 8px; color: #64748b; font-size: 12px; font-weight: 800; }
.page-size-form select { height: 34px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #0f172a; padding: 0 10px; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.pagination-summary { color: #64748b; font-size: 13px; }
.pagination-summary strong { color: #0f172a; }
.pagination-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.page-number { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #334155; font-size: 13px; font-weight: 800; }
.page-number:hover { text-decoration: none; background: #eff6ff; border-color: #bfdbfe; }
.page-number.active { border-color: #0f172a; background: #0f172a; color: #fff; }
.pagination-ellipsis { color: #94a3b8; padding: 0 4px; }
.pagination-actions .button.disabled { pointer-events: none; opacity: .45; }
.history-panel .table-wrap { border-top: 1px solid #e2e8f0; }
@media (max-width: 720px) { .pagination-bar { align-items: stretch; flex-direction: column; } .pagination-actions { justify-content: flex-start; } }

/* Probe dashboard + lazy record pagination */
.ops-probes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
  align-items: stretch;
}
.probe-lane {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 28px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .07);
}
.probe-lane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.probe-lane-kicker {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.win-lane .probe-lane-kicker { background: #dbeafe; color: #1d4ed8; }
.wsl-lane .probe-lane-kicker { background: #dcfce7; color: #15803d; }
.probe-lane h2 {
  margin: 8px 0 0;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.probe-lane > p {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}
.probe-lane-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}
.probe-lane-status.ok { border-color: rgba(34,197,94,.42); background: #f0fdf4; color: #15803d; }
.probe-lane-status.neutral { border-color: rgba(148,163,184,.55); background: #f8fafc; color: #64748b; }
.probe-lane-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.probe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.probe-card { position: relative; min-height: 112px; padding: 18px 42px 18px 18px; overflow: hidden; }
.probe-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 14px auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34,197,94,.12);
}
.probe-card.pending::after { background: #f59e0b; box-shadow: 0 0 0 6px rgba(245,158,11,.14); }
.probe-card.neutral::after,
.probe-card.reserved::after { background: #94a3b8; box-shadow: 0 0 0 6px rgba(148,163,184,.14); }
.probe-card.reserved { border-style: dashed; background: rgba(248,250,252,.72); }
.probe-card.reserved strong { color: #64748b; font-size: 26px; }
.config-summary {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.compare-row {
  grid-template-columns: minmax(44px, max-content) minmax(0, 1fr);
  align-items: start;
}
.compare-row span {
  white-space: nowrap;
  word-break: keep-all;
}
.compare-row strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.record-toolbar {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.record-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.record-pager button[disabled] { opacity: .45; cursor: not-allowed; }
.record-drawer.is-loading table { opacity: .58; }
.record-empty-cell {
  padding: 18px !important;
  color: #64748b;
  text-align: center;
}
.apply-results-table,
.audit-table { min-width: 960px; }
@media (max-width: 1180px) { .ops-probes, .probe-grid { grid-template-columns: 1fr; } .probe-lane-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .probe-grid, .probe-lane-grid { grid-template-columns: 1fr; } .probe-lane { padding: 14px; border-radius: 22px; } .probe-lane-head { flex-direction: column; } .record-toolbar, .record-pager { align-items: stretch; flex-direction: column; } }

/* Dark theme */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.theme-toggle:hover { background: #f8fafc; }
.theme-toggle-icon { line-height: 1; }
.topbar-theme-toggle { margin-right: 10px; }

html[data-theme="dark"] {
  color-scheme: dark;
  --color-primary: #8ab4ff;
  --color-primary-hover: #a8c7fa;
  --color-bg: #070b12;
  --color-text: #e5edf8;
  --color-text-muted: #94a3b8;
  --color-border: #1f2a3a;
  --color-card-bg: #0f172a;
  --color-code-bg: #111827;
  --color-error-bg: #3b1016;
  --color-error-text: #fecdd3;
  --color-success-bg: #082f1f;
  --color-success-text: #86efac;
  --control-ink: #e5edf8;
  --control-line-dark: #334155;
  --control-panel-soft: #0b1220;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 20% -10%, rgba(37,99,235,.22), transparent 28rem),
    radial-gradient(circle at 88% 4%, rgba(34,197,94,.10), transparent 26rem),
    #070b12;
  color: #e5edf8;
}
html[data-theme="dark"] a { color: #93c5fd; }
html[data-theme="dark"] code { background: #111827; color: #dbeafe; }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sleek-topbar,
html[data-theme="dark"] .control-topbar {
  border-color: rgba(51,65,85,.88);
  background: rgba(8,13,23,.82);
  color: #e5edf8;
  box-shadow: 0 1px 0 rgba(148,163,184,.14);
}
html[data-theme="dark"] .topbar .brand,
html[data-theme="dark"] .topbar .links a.on,
html[data-theme="dark"] .control-crumb strong,
html[data-theme="dark"] .control-user { color: #e5edf8; }
html[data-theme="dark"] .topbar .links a,
html[data-theme="dark"] .topbar .user,
html[data-theme="dark"] .control-crumb { color: #94a3b8; }
html[data-theme="dark"] .control-sidebar {
  border-right-color: rgba(51,65,85,.75);
  background: linear-gradient(180deg, #07111f, #0a1020 55%, #070b12);
}
html[data-theme="dark"] .control-brand-mark {
  background: linear-gradient(135deg, #60a5fa, #22c55e);
  color: #020617;
}
html[data-theme="dark"] .control-brand-name,
html[data-theme="dark"] .control-nav-item,
html[data-theme="dark"] .drawer-summary span,
html[data-theme="dark"] .panel-head h2,
html[data-theme="dark"] .profile-brief h3,
html[data-theme="dark"] .device-card-top strong,
html[data-theme="dark"] .inspector-title h2,
html[data-theme="dark"] .inspector-section h3,
html[data-theme="dark"] .ops-next-card strong,
html[data-theme="dark"] .ops-status h1,
html[data-theme="dark"] .landing-hero h1,
html[data-theme="dark"] .landing-card strong,
html[data-theme="dark"] .page h1,
html[data-theme="dark"] .card .big { color: #f8fafc; }
html[data-theme="dark"] .control-brand-sub,
html[data-theme="dark"] .control-nav-label,
html[data-theme="dark"] .panel-head p,
html[data-theme="dark"] .control-head p,
html[data-theme="dark"] .detail-title p,
html[data-theme="dark"] .drawer-summary small,
html[data-theme="dark"] .device-card-mid,
html[data-theme="dark"] .device-card-bottom small,
html[data-theme="dark"] .ops-kicker,
html[data-theme="dark"] .ops-status p,
html[data-theme="dark"] .landing-hero p,
html[data-theme="dark"] .landing-card small,
html[data-theme="dark"] .sub,
html[data-theme="dark"] .empty-state { color: #94a3b8; }
html[data-theme="dark"] .control-nav-item:hover { background: rgba(30,41,59,.78); color: #f8fafc; }
html[data-theme="dark"] .control-nav-item.active {
  border-color: rgba(96,165,250,.55);
  background: rgba(37,99,235,.24);
  color: #f8fafc;
}
html[data-theme="dark"] .control-nav-count { color: #bfdbfe; }
html[data-theme="dark"] .control-main,
html[data-theme="dark"] .control-content { background: transparent; }
html[data-theme="dark"] .control-panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .landing-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .profile-brief,
html[data-theme="dark"] .ops-next-card,
html[data-theme="dark"] .ops-metrics > div,
html[data-theme="dark"] .probe-card,
html[data-theme="dark"] .device-inspector {
  border-color: rgba(51,65,85,.92);
  background: rgba(15,23,42,.88);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
html[data-theme="dark"] .ops-status,
html[data-theme="dark"] .landing-hero,
html[data-theme="dark"] .publish-status,
html[data-theme="dark"] .control-head {
  border-color: rgba(51,65,85,.92);
  background:
    radial-gradient(circle at 86% 18%, rgba(59,130,246,.20), transparent 22rem),
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(2,6,23,.92));
  box-shadow: 0 22px 56px rgba(0,0,0,.32);
}
html[data-theme="dark"] .ops-board.ok .ops-status { background: radial-gradient(circle at 86% 18%, rgba(34,197,94,.16), transparent 22rem), linear-gradient(135deg, rgba(15,23,42,.96), rgba(6,24,20,.92)); }
html[data-theme="dark"] .ops-board.pending .ops-status { background: radial-gradient(circle at 86% 18%, rgba(245,158,11,.16), transparent 22rem), linear-gradient(135deg, rgba(15,23,42,.96), rgba(29,22,8,.92)); }
html[data-theme="dark"] .ops-board.err .ops-status { background: radial-gradient(circle at 86% 18%, rgba(239,68,68,.16), transparent 22rem), linear-gradient(135deg, rgba(15,23,42,.96), rgba(31,10,15,.92)); }
html[data-theme="dark"] .device-card-list,
html[data-theme="dark"] .profile-editor-drawer,
html[data-theme="dark"] .drawer-toolbar,
html[data-theme="dark"] .pagination-bar,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .policy-row,
html[data-theme="dark"] .capability-row,
html[data-theme="dark"] .mcp-server-row,
html[data-theme="dark"] .release-panel-body,
html[data-theme="dark"] .release-form-body { background: rgba(2,6,23,.38); border-color: #1f2a3a; }
html[data-theme="dark"] .device-card,
html[data-theme="dark"] .inspector-facts > div,
html[data-theme="dark"] .inspector-meta-strip span,
html[data-theme="dark"] .inspector-chip,
html[data-theme="dark"] .inspector-drawer,
html[data-theme="dark"] .compare-row,
html[data-theme="dark"] .config-summary,
html[data-theme="dark"] .profile-note,
html[data-theme="dark"] .mini-drawer .profile-list,
html[data-theme="dark"] .brief-lines span,
html[data-theme="dark"] .device-card-mid span,
html[data-theme="dark"] .note,
html[data-theme="dark"] .probe-card.reserved {
  border-color: #1f2a3a;
  background: rgba(15,23,42,.94);
  color: #cbd5e1;
}
html[data-theme="dark"] .inspector-drawer summary {
  background: rgba(2,6,23,.34);
}
html[data-theme="dark"] .inspector-meta-strip b,
html[data-theme="dark"] .inspector-chip b,
html[data-theme="dark"] .inspector-drawer summary > span,
html[data-theme="dark"] .runtime-compact-list span {
  color: #94a3b8;
}
html[data-theme="dark"] .inspector-meta-strip strong,
html[data-theme="dark"] .inspector-chip strong,
html[data-theme="dark"] .inspector-drawer summary > strong,
html[data-theme="dark"] .runtime-compact-list p,
html[data-theme="dark"] .runtime-compact-list strong {
  color: #f8fafc;
}
html[data-theme="dark"] .runtime-compact-list > div {
  border-top-color: #1f2a3a;
}
html[data-theme="dark"] .inspector-drawer summary::after {
  border-color: #94a3b8;
}
html[data-theme="dark"] .device-readback-form button {
  border-color: #334155;
  background: rgba(15,23,42,.94);
  color: #cbd5e1;
}
html[data-theme="dark"] .device-readback-form button:hover {
  border-color: #60a5fa;
  background: rgba(37,99,235,.22);
  color: #bfdbfe;
}

html[data-theme="dark"] .probe-lane {
  border-color: rgba(51,65,85,.92);
  background: rgba(15,23,42,.78);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
html[data-theme="dark"] .probe-lane h2 { color: #f8fafc; }
html[data-theme="dark"] .probe-lane > p { color: #94a3b8; }
html[data-theme="dark"] .probe-lane-status {
  border-color: #334155;
  background: rgba(15,23,42,.9);
  color: #cbd5e1;
}
html[data-theme="dark"] .probe-lane-status.ok { border-color: rgba(34,197,94,.45); background: rgba(20,83,45,.36); color: #bbf7d0; }
html[data-theme="dark"] .probe-lane-status.neutral { border-color: rgba(148,163,184,.42); background: rgba(30,41,59,.62); color: #cbd5e1; }
html[data-theme="dark"] .probe-lane-kicker { background: rgba(14,165,233,.16); color: #7dd3fc; }
html[data-theme="dark"] .win-lane .probe-lane-kicker { background: rgba(37,99,235,.24); color: #bfdbfe; }
html[data-theme="dark"] .wsl-lane .probe-lane-kicker { background: rgba(22,101,52,.32); color: #bbf7d0; }
html[data-theme="dark"] .ops-metrics span,
html[data-theme="dark"] .probe-card span { color: #cbd5e1; }
html[data-theme="dark"] .ops-metrics strong,
html[data-theme="dark"] .probe-card strong,
html[data-theme="dark"] .probe-card.reserved strong { color: #f8fafc; }
html[data-theme="dark"] .ops-metrics small,
html[data-theme="dark"] .probe-card small { color: #b6c3d6; }
html[data-theme="dark"] .probe-card.reserved span,
html[data-theme="dark"] .probe-card.reserved small { color: #94a3b8; }
html[data-theme="dark"] .probe-card.reserved strong { opacity: .72; }
html[data-theme="dark"] .device-card:hover { border-color: #60a5fa; box-shadow: 0 16px 34px rgba(37,99,235,.18); }
html[data-theme="dark"] .device-card.selected { border-color: #60a5fa; background: rgba(30,64,175,.24); box-shadow: inset 4px 0 0 #60a5fa; }
html[data-theme="dark"] .profile-brief.pending { border-color: rgba(245,158,11,.55); background: rgba(69,42,10,.45); }
html[data-theme="dark"] .danger-summary { background: rgba(69,10,10,.48); }
html[data-theme="dark"] .danger-summary span { color: #fecaca; }
html[data-theme="dark"] .control-table th,
html[data-theme="dark"] table.history th {
  border-color: #1f2a3a;
  background: #0b1220;
  color: #94a3b8;
}
html[data-theme="dark"] .control-table td,
html[data-theme="dark"] table.history td { border-color: #1f2a3a; color: #dbe4f0; }
html[data-theme="dark"] .control-table tr.selected,
html[data-theme="dark"] .control-table tr.row-current,
html[data-theme="dark"] table.history tr.row-current { background: rgba(30,64,175,.18); }
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .status-pill.ok,
html[data-theme="dark"] .status-pill.pending,
html[data-theme="dark"] .status-pill.offline,
html[data-theme="dark"] .status-pill.neutral,
html[data-theme="dark"] .page-number,
html[data-theme="dark"] .page-size-form select,
html[data-theme="dark"] .button,
html[data-theme="dark"] .topbar .logout,
html[data-theme="dark"] .theme-toggle {
  border-color: #334155;
  background: rgba(15,23,42,.92);
  color: #e5edf8;
}
html[data-theme="dark"] .button:hover,
html[data-theme="dark"] .topbar .logout:hover,
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .page-number:hover { background: #1e293b; text-decoration: none; }
html[data-theme="dark"] .button.primary,
html[data-theme="dark"] .profile-form button,
html[data-theme="dark"] .form button { border-color: #60a5fa; background: #60a5fa; color: #020617; }
html[data-theme="dark"] .page-number.active { border-color: #bfdbfe; background: #bfdbfe; color: #020617; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .profile-form input,
html[data-theme="dark"] .profile-form select,
html[data-theme="dark"] .profile-form textarea,
html[data-theme="dark"] .panel-filters input,
html[data-theme="dark"] .panel-filters select,
html[data-theme="dark"] .form input,
html[data-theme="dark"] .form textarea {
  border-color: #334155;
  background: #0b1220;
  color: #e5edf8;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b; }
html[data-theme="dark"] .banner { border-color: #334155; background: rgba(15,23,42,.94); color: #e5edf8; }
html[data-theme="dark"] .banner.ok { border-left-color: #22c55e; background: rgba(8,47,31,.72); color: #bbf7d0; }
html[data-theme="dark"] .banner.err { border-left-color: #fb7185; background: rgba(63,18,28,.72); color: #fecdd3; }
html[data-theme="dark"] .banner .banner-message,
html[data-theme="dark"] .banner.err .banner-message,
html[data-theme="dark"] .banner.ok .banner-message { color: #cbd5e1; }
html[data-theme="dark"] .empty-state strong,
html[data-theme="dark"] .policy-row strong,
html[data-theme="dark"] .capability-row strong,
html[data-theme="dark"] .inspector-facts strong,
html[data-theme="dark"] .compare-row strong,
html[data-theme="dark"] .pagination-summary strong { color: #f8fafc; }
html[data-theme="dark"] .login-wrap { background: radial-gradient(circle at 50% 0%, rgba(37,99,235,.18), transparent 28rem), #070b12; }
@media (max-width: 720px) {
  .topbar-theme-toggle { margin: 6px 8px 6px 0; }
}

/* Dark theme fixes: drawers, nested cards and publish surfaces */
html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .command-panel .panel-head,
html[data-theme="dark"] .publish-android-form .panel-head,
html[data-theme="dark"] .danger-zone .panel-head,
html[data-theme="dark"] .force-release-zone .panel-head {
  border-color: #1f2a3a;
  background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(11,18,32,.98));
}
html[data-theme="dark"] .danger-zone,
html[data-theme="dark"] .force-release-zone,
html[data-theme="dark"] .danger-drawer,
html[data-theme="dark"] .record-drawer,
html[data-theme="dark"] .release-form,
html[data-theme="dark"] .release-panel,
html[data-theme="dark"] .command-panel {
  border-color: #263449;
  background: rgba(15,23,42,.92);
}
html[data-theme="dark"] .danger-grid,
html[data-theme="dark"] .force-release-grid,
html[data-theme="dark"] .danger-action,
html[data-theme="dark"] .force-release-form {
  border-color: #334155;
  background: rgba(11,18,32,.96);
  color: #dbe4f0;
}
html[data-theme="dark"] .danger-action + .danger-action { border-left-color: #334155; }
html[data-theme="dark"] .danger-action strong,
html[data-theme="dark"] .force-release-form span,
html[data-theme="dark"] .force-release-form strong,
html[data-theme="dark"] .release-list dd strong,
html[data-theme="dark"] .publish-status h1,
html[data-theme="dark"] .publish-facts strong { color: #f8fafc; }
html[data-theme="dark"] .danger-action span,
html[data-theme="dark"] .force-release-form small,
html[data-theme="dark"] .release-list dt,
html[data-theme="dark"] .release-list dd,
html[data-theme="dark"] .release-note,
html[data-theme="dark"] .detail-hint,
html[data-theme="dark"] .publish-status p,
html[data-theme="dark"] .publish-facts span,
html[data-theme="dark"] .publish-facts small,
html[data-theme="dark"] .profile-label,
html[data-theme="dark"] .profile-list dt,
html[data-theme="dark"] .profile-form label span,
html[data-theme="dark"] .field-head,
html[data-theme="dark"] .field-head small,
html[data-theme="dark"] .control-table td span,
html[data-theme="dark"] table.history td.mono,
html[data-theme="dark"] table.history td.small {
  color: #b6c3d6;
}
html[data-theme="dark"] .release-note,
html[data-theme="dark"] .release-note.warn,
html[data-theme="dark"] .detail-hint,
html[data-theme="dark"] .maintenance-warning,
html[data-theme="dark"] .prominent-maintenance {
  border-color: #334155;
  background: rgba(30,41,59,.75);
  color: #dbeafe;
}
html[data-theme="dark"] .publish-facts > div,
html[data-theme="dark"] .release-panel-body,
html[data-theme="dark"] .release-form-body,
html[data-theme="dark"] .release-list,
html[data-theme="dark"] .force-release-form,
html[data-theme="dark"] .speech-config-grid,
html[data-theme="dark"] .mcp-server-row,
html[data-theme="dark"] .profile-form,
html[data-theme="dark"] .profile-editor-drawer .profile-form,
html[data-theme="dark"] .profile-column,
html[data-theme="dark"] .control-metric,
html[data-theme="dark"] .maintenance-action,
html[data-theme="dark"] .maintenance-copy,
html[data-theme="dark"] .rollback-body,
html[data-theme="dark"] .pending-body,
html[data-theme="dark"] .diff-preview-row,
html[data-theme="dark"] .diff-preview-head,
html[data-theme="dark"] .confirm-check {
  border-color: #263449;
  background: rgba(11,18,32,.86);
  color: #dbe4f0;
}
html[data-theme="dark"] .profile-editor-drawer summary {
  color: #e5edf8;
  background: rgba(11,18,32,.92);
}
html[data-theme="dark"] .profile-editor-drawer summary::after,
html[data-theme="dark"] .drawer-summary b {
  border-color: #334155;
  background: #111827;
  color: #dbeafe;
}
html[data-theme="dark"] details[open] > .drawer-summary b { background: #1e3a8a; color: #dbeafe; }
html[data-theme="dark"] .button[disabled],
html[data-theme="dark"] button[disabled],
html[data-theme="dark"] .profile-form button[disabled],
html[data-theme="dark"] .form button[disabled] {
  border-color: #263449;
  background: #0b1220;
  color: #64748b;
  opacity: .72;
}
html[data-theme="dark"] .button.danger-link,
html[data-theme="dark"] .danger-button {
  border-color: #475569;
  background: #182235;
  color: #f8fafc;
}
html[data-theme="dark"] .button.danger-link:hover,
html[data-theme="dark"] .danger-button:hover {
  border-color: #fb7185;
  background: rgba(127,29,29,.38);
  color: #fecaca;
}
html[data-theme="dark"] .publish-status,
html[data-theme="dark"] .publish-board.pending .publish-status,
html[data-theme="dark"] .publish-board.ok .publish-status,
html[data-theme="dark"] .publish-board.err .publish-status {
  border-color: rgba(51,65,85,.92);
  background:
    radial-gradient(circle at 86% 18%, rgba(59,130,246,.18), transparent 22rem),
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(2,6,23,.94));
}
html[data-theme="dark"] .control-table,
html[data-theme="dark"] table.history {
  background: rgba(15,23,42,.92);
}
html[data-theme="dark"] .control-table tr[data-device-row]:hover,
html[data-theme="dark"] .control-table tbody tr:hover,
html[data-theme="dark"] table.history tbody tr:hover {
  background: rgba(30,41,59,.72);
}
html[data-theme="dark"] .status-pill.ok { border-color: rgba(34,197,94,.45); background: rgba(20,83,45,.36); color: #bbf7d0; }
html[data-theme="dark"] .status-pill.pending { border-color: rgba(245,158,11,.48); background: rgba(120,53,15,.34); color: #fde68a; }
html[data-theme="dark"] .status-pill.offline { border-color: rgba(148,163,184,.42); background: rgba(30,41,59,.62); color: #cbd5e1; }
html[data-theme="dark"] .status-pill.neutral { border-color: rgba(96,165,250,.45); background: rgba(30,64,175,.28); color: #bfdbfe; }
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .metric-foot,
html[data-theme="dark"] .pagination-summary,
html[data-theme="dark"] .page-size-form label,
html[data-theme="dark"] .record-pager,
html[data-theme="dark"] .pagination-ellipsis { color: #b6c3d6; }
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .big,
html[data-theme="dark"] .release-list dd,
html[data-theme="dark"] .profile-column h3 { color: #f8fafc; }

/* Toast tips: replace inline full-width banners for transient feedback. */
.toast-viewport {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}
.toast-tip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 12px;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  color: #0f172a;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}
.toast-tip.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.toast-tip.is-leaving { opacity: 0; transform: translateY(-8px) scale(.98); }
.toast-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, .12);
}
.toast-tip.err .toast-dot { background: #fb7185; box-shadow: 0 0 0 6px rgba(251, 113, 133, .14); }
.toast-body { display: grid; gap: 4px; min-width: 0; }
.toast-body strong { color: inherit; font-size: 14px; line-height: 1.3; }
.toast-body span { color: #475569; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.toast-close:hover { background: rgba(148, 163, 184, .16); color: #0f172a; }
html[data-theme="dark"] .toast-tip {
  border-color: rgba(51, 65, 85, .92);
  background: rgba(15, 23, 42, .88);
  color: #f8fafc;
  box-shadow: 0 22px 56px rgba(0, 0, 0, .38);
}
html[data-theme="dark"] .toast-body span { color: #b6c3d6; }
html[data-theme="dark"] .toast-close { color: #94a3b8; }
html[data-theme="dark"] .toast-close:hover { background: rgba(148, 163, 184, .16); color: #f8fafc; }
html[data-theme="dark"] .mcp-conflict-note {
  border-color: rgba(245, 158, 11, .48);
  background: rgba(120, 53, 15, .34);
  color: #fde68a;
}
@media (max-width: 720px) {
  .toast-viewport { top: auto; right: 14px; bottom: 14px; left: 14px; width: auto; }
}

/* 2026-06-11 Human mode: simple, answer-first admin UI. */
.human-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 22px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(59, 130, 246, .24), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(34, 197, 94, .20), transparent 24rem),
    linear-gradient(135deg, #f8fbff, #eef5ff 52%, #f8fffb);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .10);
}
.human-hero.err {
  background:
    radial-gradient(circle at 12% 10%, rgba(248, 113, 113, .24), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(251, 191, 36, .20), transparent 24rem),
    linear-gradient(135deg, #fff8f8, #fff7ed 52%, #f8fbff);
}
.human-hero.pending {
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, .24), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(59, 130, 246, .18), transparent 24rem),
    linear-gradient(135deg, #fffbeb, #f8fbff 56%, #f7fee7);
}
.human-kicker {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid rgba(59, 130, 246, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .66);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}
.human-pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, .14);
}
.human-hero.err .human-pulse { background: #ef4444; box-shadow: 0 0 0 6px rgba(239, 68, 68, .13); }
.human-hero.pending .human-pulse { background: #f59e0b; box-shadow: 0 0 0 6px rgba(245, 158, 11, .14); }
.human-hero h1 {
  margin: 18px 0 10px;
  max-width: 860px;
  color: #0f172a;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .98;
  letter-spacing: -.055em;
}
.human-answer {
  max-width: 760px;
  margin: 0;
  color: #334155;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
}
.human-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 26px;
}
.human-hero-actions > span {
  color: #64748b;
  font-size: 14px;
}
.human-primary-action,
.human-primary-action:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .28);
  cursor: pointer;
  text-decoration: none;
}
.human-primary-action:hover { transform: translateY(-1px); text-decoration: none; }
.human-command-card {
  display: grid;
  align-content: center;
  gap: 11px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 24px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.70), 0 18px 48px rgba(15,23,42,.10);
  backdrop-filter: blur(18px);
}
.human-command-card span,
.human-panel-head span,
.human-stat span,
.human-version-row small,
.human-service-facts span,
.human-audit-card span,
.human-maintenance-list small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.human-command-card strong {
  color: #0f172a;
  font-size: 26px;
  line-height: 1.08;
}
.human-command-card p { margin: 0; color: #475569; line-height: 1.5; }
.human-command-card code {
  width: fit-content;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: #1d4ed8;
  padding: 6px 10px;
}
.human-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.human-stat,
.human-panel {
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 24px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 45px rgba(15,23,42,.07);
}
.human-stat {
  display: grid;
  gap: 8px;
  padding: 18px;
}
.human-stat strong { color: #0f172a; font-size: 32px; line-height: 1; letter-spacing: -.04em; }
.human-stat small { color: #64748b; line-height: 1.35; }
.human-stat.ok { border-color: rgba(34,197,94,.28); }
.human-stat.pending { border-color: rgba(245,158,11,.34); }
.human-stat.err { border-color: rgba(239,68,68,.30); }
.human-section { margin-top: 18px; }
.human-section.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
  gap: 18px;
}
.human-panel { padding: 20px; }
.human-panel.wide { width: 100%; }
.human-panel-head {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.human-panel-head h2 {
  margin: 4px 0 0;
  color: #0f172a;
  font-size: 24px;
  letter-spacing: -.035em;
}
.human-subtle-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 999px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  background: rgba(248,250,252,.75);
}
.human-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.human-action-form { margin: 0; }
.human-action-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  width: 100%;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248,250,252,.92), rgba(241,245,249,.70));
  color: #0f172a;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.human-action-tile:hover { transform: translateY(-1px); text-decoration: none; }
.human-action-tile b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 20px;
}
.human-action-tile span { font-weight: 900; }
.human-action-tile small { color: #64748b; line-height: 1.35; }
.human-version-list,
.human-maintenance-list { display: grid; gap: 10px; }
.human-version-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 18px;
  background: rgba(248,250,252,.75);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, .12);
}
.status-dot.ok { background: #22c55e; box-shadow: 0 0 0 5px rgba(34,197,94,.12); }
.status-dot.pending { background: #f59e0b; box-shadow: 0 0 0 5px rgba(245,158,11,.12); }
.status-dot.err,
.status-dot.offline { background: #ef4444; box-shadow: 0 0 0 5px rgba(239,68,68,.12); }
.human-version-row strong { color: #0f172a; }
.human-version-row b { color: #0f172a; font-size: 18px; }
.human-note {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(37, 99, 235, .08);
  color: #334155;
  line-height: 1.45;
}
.human-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.human-service-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(248,250,252,.74));
}
.human-service-card.ok { border-color: rgba(34,197,94,.26); }
.human-service-card.offline,
.human-service-card.err { border-color: rgba(239,68,68,.30); }
.human-service-top {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}
.human-service-top strong { color: #0f172a; font-size: 17px; }
.human-service-top small { display:block; color:#64748b; margin-top: 3px; }
.human-service-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.human-service-facts div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(241,245,249,.78);
}
.human-service-facts b { color: #0f172a; font-size: 13px; overflow-wrap: anywhere; }
.human-service-card p { margin: 0; color: #475569; line-height: 1.45; }
.human-empty {
  padding: 24px;
  border: 1px dashed rgba(148, 163, 184, .44);
  border-radius: 20px;
  color: #475569;
  background: rgba(248,250,252,.65);
}
.human-empty strong { display:block; color:#0f172a; font-size: 18px; }
.human-empty p { margin: 8px 0 0; }
.human-empty.compact { padding: 16px; }
.human-maintenance-list form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 18px;
  background: rgba(248,250,252,.72);
}
.human-maintenance-list strong { display:block; color: #0f172a; }
.human-audit-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(248,250,252,.76);
  border: 1px solid rgba(148, 163, 184, .24);
}
.human-audit-card strong { color:#0f172a; font-size: 18px; }
.human-audit-card p { margin:0; color:#475569; line-height:1.5; }
@media (max-width: 1100px) {
  .human-hero,
  .human-section.two-column { grid-template-columns: 1fr; }
  .human-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .human-hero { padding: 20px; border-radius: 24px; }
  .human-hero h1 { font-size: 38px; }
  .human-stats-grid,
  .human-action-grid,
  .human-service-facts { grid-template-columns: 1fr; }
  .human-panel { padding: 16px; }
}
html[data-theme="dark"] .human-hero {
  border-color: rgba(51,65,85,.92);
  background:
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, .24), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(34, 197, 94, .16), transparent 24rem),
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(2,6,23,.95));
  box-shadow: 0 24px 80px rgba(0,0,0,.36);
}
html[data-theme="dark"] .human-hero.err {
  background:
    radial-gradient(circle at 12% 10%, rgba(239, 68, 68, .20), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(245, 158, 11, .16), transparent 24rem),
    linear-gradient(135deg, rgba(30, 15, 23, .96), rgba(2,6,23,.95));
}
html[data-theme="dark"] .human-hero.pending {
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, .20), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(37, 99, 235, .16), transparent 24rem),
    linear-gradient(135deg, rgba(24, 20, 12, .96), rgba(2,6,23,.95));
}
html[data-theme="dark"] .human-kicker,
html[data-theme="dark"] .human-command-card,
html[data-theme="dark"] .human-stat,
html[data-theme="dark"] .human-panel,
html[data-theme="dark"] .human-action-tile,
html[data-theme="dark"] .human-version-row,
html[data-theme="dark"] .human-service-card,
html[data-theme="dark"] .human-service-facts div,
html[data-theme="dark"] .human-empty,
html[data-theme="dark"] .human-maintenance-list form,
html[data-theme="dark"] .human-audit-card,
html[data-theme="dark"] .human-subtle-link {
  border-color: rgba(51,65,85,.92);
  background: rgba(15,23,42,.76);
  color: #e5edf8;
}
html[data-theme="dark"] .human-action-tile,
html[data-theme="dark"] .human-service-card {
  background: linear-gradient(180deg, rgba(15,23,42,.88), rgba(11,18,32,.82));
}
html[data-theme="dark"] .human-hero h1,
html[data-theme="dark"] .human-command-card strong,
html[data-theme="dark"] .human-stat strong,
html[data-theme="dark"] .human-panel-head h2,
html[data-theme="dark"] .human-version-row strong,
html[data-theme="dark"] .human-version-row b,
html[data-theme="dark"] .human-service-top strong,
html[data-theme="dark"] .human-service-facts b,
html[data-theme="dark"] .human-empty strong,
html[data-theme="dark"] .human-maintenance-list strong,
html[data-theme="dark"] .human-audit-card strong {
  color: #f8fafc;
}
html[data-theme="dark"] .human-answer,
html[data-theme="dark"] .human-command-card p,
html[data-theme="dark"] .human-hero-actions > span,
html[data-theme="dark"] .human-stat small,
html[data-theme="dark"] .human-note,
html[data-theme="dark"] .human-service-top small,
html[data-theme="dark"] .human-service-card p,
html[data-theme="dark"] .human-empty,
html[data-theme="dark"] .human-audit-card p,
html[data-theme="dark"] .human-command-card span,
html[data-theme="dark"] .human-panel-head span,
html[data-theme="dark"] .human-stat span,
html[data-theme="dark"] .human-version-row small,
html[data-theme="dark"] .human-service-facts span,
html[data-theme="dark"] .human-audit-card span,
html[data-theme="dark"] .human-maintenance-list small {
  color: #b6c3d6;
}
html[data-theme="dark"] .human-action-tile b { background: rgba(37,99,235,.22); color:#bfdbfe; }
html[data-theme="dark"] .human-note { background: rgba(30,64,175,.22); }
html[data-theme="dark"] .human-command-card code { border-color: rgba(96,165,250,.35); background: rgba(30,64,175,.24); color:#bfdbfe; }

/* 2026-06-11 AJAX feel: keep page in place while actions run. */
.control-content {
  transition: opacity .16s ease, filter .16s ease;
}
.control-content.is-refreshing {
  opacity: .72;
  filter: saturate(.92);
}
form.is-submitting {
  pointer-events: none;
}
form.is-submitting button[type="submit"],
form.is-submitting button:not([type]) {
  position: relative;
}
form.is-submitting button[type="submit"]::after,
form.is-submitting button:not([type])::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: paseo-spin .7s linear infinite;
  vertical-align: -1px;
}
@keyframes paseo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .control-content,
  .human-primary-action,
  .human-action-tile { transition: none; }
  form.is-submitting button[type="submit"]::after,
  form.is-submitting button:not([type])::after { animation: none; }
}
