:root {
  --rail-width: 220px;
  --queue-width: 390px;
  --review-width: 310px;
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-muted: #edf1f2;
  --surface-subtle: #f8fafb;
  --surface-hover: #f2f7f5;
  --canvas: #f3f5f6;
  --border: #dfe5e7;
  --border-strong: #c8d2d6;
  --text: #172126;
  --muted: #69777f;
  --nav-text: #526169;
  --green: #078a66;
  --green-hover: #057455;
  --green-soft: #e4f5ef;
  --blue: #1e68a0;
  --blue-soft: #e8f2f8;
  --blue-panel: #f3f8fb;
  --amber: #9a6200;
  --amber-soft: #fff3d8;
  --red: #c53d4c;
  --red-soft: #fbeaec;
  --red-panel: #fff7f8;
  --progress-bg: #e1e7e9;
  --floating: rgba(255, 255, 255, 0.98);
  --on-primary: #ffffff;
  --shadow: 0 18px 50px rgba(20, 34, 40, 0.12);
  --shadow-small: 0 4px 14px rgba(20, 34, 40, 0.07);
  --radius: 7px;
}

html[data-theme="dark"] {
  --bg: #0c1114;
  --surface: #141b1f;
  --surface-muted: #20282d;
  --surface-subtle: #182025;
  --surface-hover: #1b2529;
  --canvas: #0c1114;
  --border: #29343a;
  --border-strong: #3a484f;
  --text: #edf2f3;
  --muted: #8e9ba1;
  --nav-text: #b8c3c7;
  --green: #25c08f;
  --green-hover: #31d09d;
  --green-soft: #153c31;
  --blue: #67b7e7;
  --blue-soft: #193746;
  --blue-panel: #152b35;
  --amber: #efb558;
  --amber-soft: #47361e;
  --red: #ff7585;
  --red-soft: #42262c;
  --red-panel: #322025;
  --progress-bg: #344147;
  --floating: rgba(20, 27, 31, 0.98);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  --shadow-small: 0 5px 16px rgba(0, 0, 0, 0.24);
}

body {
  background: var(--bg);
  font-size: 13px;
  line-height: 1.4;
}

svg { stroke-width: 1.9; }
button, input, select, textarea { letter-spacing: 0; }

/* Global application rail */
.sidebar {
  width: var(--rail-width);
  align-items: stretch;
  padding: 12px 10px;
  border-right-color: var(--border);
  background: var(--surface);
}

.brand {
  width: 100%;
  min-height: 56px;
  justify-content: flex-start;
  padding: 0 8px 12px;
}

.brand > span:last-child { display: block; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--green) 24%, transparent);
}

.nav {
  width: 100%;
  display: grid;
  justify-items: stretch;
  gap: 4px;
  padding-top: 12px;
}

.nav-link {
  position: relative;
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 11px;
  border-radius: var(--radius);
}

.nav-link > span,
.nav-section-label { display: block; }
.nav-link svg { width: 18px; height: 18px; }
.nav-link:hover { background: var(--surface-muted); color: var(--text); }
.nav-link.active {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: inset 3px 0 var(--green);
}

.nav-status-link .nav-badge {
  position: static;
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  font-size: 7px;
}

.nav-divider { width: auto; margin: 7px 10px; }
.sidebar-status { width: 100%; margin-top: auto; padding-top: 10px; }
.sync-state {
  min-height: 34px;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
}
.sync-state > span:last-child { display: block; }
.sync-dot { width: 9px; height: 9px; }
.sidebar-command {
  width: 100%;
  min-height: 40px;
  justify-content: flex-start;
  gap: 8px;
  margin: 4px auto 0;
  padding: 0 10px;
  border-radius: var(--radius);
}
.sidebar-command span { display: block; }

.workspace {
  margin-left: var(--rail-width);
  padding: 0 28px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 72px;
  margin: 0 -28px 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}

.topbar h1 { font-size: 20px; font-weight: 720; }
.eyebrow { color: var(--green); font-size: 9px; letter-spacing: 0; }
.account-button {
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
}
.account-button:hover { border-color: var(--border); background: var(--surface); }

/* Shared component refresh for secondary pages */
.button,
.icon-button {
  border-color: var(--border-strong);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}
.button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 720;
}
.button:hover,
.icon-button:hover { transform: translateY(-1px); }
.button.primary,
.button.approve { border-color: var(--green); background: var(--green); color: var(--on-primary); }
.button.primary:hover,
.button.approve:hover { border-color: var(--green-hover); background: var(--green-hover); }
.button.later { border-color: color-mix(in srgb, var(--amber) 55%, var(--border)); background: var(--amber-soft); color: var(--amber); }
.button.reject { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); background: var(--red-soft); color: var(--red); }
.icon-button { width: 38px; height: 38px; border-radius: var(--radius); }
.icon-button.small { width: 30px; height: 30px; border-radius: 6px; }
input, select, textarea { min-height: 40px; border-color: var(--border-strong); border-radius: var(--radius); }
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}
.metrics { gap: 8px; border: 0; background: transparent; }
.metric {
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.filter-band,
.table-wrap,
.panel,
.login-form,
.operator-picker {
  border-color: var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-small);
}
th { background: var(--surface-subtle); font-size: 8px; letter-spacing: 0; }
.priority,
.status,
.health,
.learning-badge { border-radius: 5px; }

/* Command workspace */
.merchant-command-page {
  height: 100vh;
  overflow: hidden;
}

.merchant-command-page .topbar { display: none; }
.merchant-command-page .workspace {
  height: 100vh;
  margin-left: var(--rail-width);
  padding: 0;
  overflow: hidden;
}

.command-workspace {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--queue-width) minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.command-workspace.modal-card-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preview-learning-form { margin: 0; }
.preview-learning-form button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.preview-learning-form button:hover { border-color: var(--green); color: var(--green); }
.preview-learning-form svg { width: 14px; height: 14px; }
.preview-rejection-reasons { padding: 8px 0 2px; }
.preview-rejection-reasons > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.preview-rejection-reasons > div { display: flex; flex-wrap: wrap; gap: 5px; }
.preview-rejection-reasons button { min-height: 28px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border)); border-radius: 6px; background: var(--red-soft); color: var(--red); font: inherit; font-size: 9px; font-weight: 750; cursor: pointer; }
.preview-rejection-reasons button:hover,
.preview-rejection-reasons button:focus-visible { border-color: var(--red); outline: none; }
.review-reason-select { display: grid; gap: 6px; margin-bottom: 10px; }
.review-reason-select > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.review-reason-select select { min-height: 38px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }

.command-queue {
  position: relative;
  z-index: 2;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.command-queue-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px 10px 16px;
  border-bottom: 1px solid var(--border);
}

.command-title { min-width: 0; }
.command-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.command-title h1 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.command-title p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.command-header-actions { display: flex; align-items: center; gap: 6px; }
.command-icon-button,
.command-operator,
.command-row-actions a,
.command-row-actions button,
.command-card-navigation button,
.command-card-tools a,
.command-card-tools button,
.command-address-bar > button {
  min-width: 34px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.command-icon-button:hover,
.command-row-actions a:hover,
.command-row-actions button:hover,
.command-card-navigation button:hover,
.command-card-tools a:hover,
.command-card-tools button:hover,
.command-address-bar > button:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: var(--text);
}
.command-icon-button svg,
.command-row-actions svg,
.command-card-navigation svg,
.command-card-tools svg { width: 16px; height: 16px; }
.command-operator { width: auto; gap: 7px; padding: 0 8px 0 4px; }
.command-operator > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
}
.command-operator strong { max-width: 80px; overflow: hidden; color: var(--text); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.command-toast {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px 0;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--green) 30%, var(--border));
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}
.command-toast svg { width: 15px; height: 15px; }

.command-stats {
  min-height: 55px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
.command-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7px 8px;
  border-right: 1px solid var(--border);
}
.command-stat:last-child { border-right: 0; }
.command-stat span { overflow: hidden; color: var(--muted); font-size: 7px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.command-stat strong { margin-top: 2px; font-size: 16px; line-height: 1; }
.command-stat.urgent strong { color: var(--red); }
.command-stat.review strong,
.command-stat.new strong { color: var(--blue); }
.command-stat.done strong { color: var(--green); }
.command-stat:hover { background: var(--surface-subtle); }

.command-filter-form {
  position: relative;
  z-index: 8;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.command-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 9px 10px 7px;
}
.command-search {
  position: relative;
  min-width: 0;
  height: 38px;
  display: flex;
  align-items: center;
}
.command-search > svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.command-search input {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 34px;
  border-color: var(--border);
  background: var(--surface-subtle);
  font-size: 10px;
}
.command-search > a {
  position: absolute;
  right: 7px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
}
.command-search > a:hover { background: var(--surface-muted); color: var(--text); }
.command-search > a svg { width: 14px; height: 14px; }
.command-filter-drawer { position: static; }
.command-filter-drawer > summary { list-style: none; }
.command-filter-drawer > summary::-webkit-details-marker { display: none; }
.command-filter-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}
.command-filter-button:hover,
.command-filter-drawer[open] .command-filter-button { border-color: var(--green); color: var(--green); }
.command-filter-button svg { width: 15px; height: 15px; }
.command-filter-button strong {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 8px;
}
.command-filter-panel {
  position: absolute;
  z-index: 40;
  top: 54px;
  left: 10px;
  width: min(680px, calc(100vw - var(--rail-width) - 28px));
  max-height: calc(100vh - 74px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.command-filter-panel > header,
.command-filter-panel > footer {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
}
.command-filter-panel > header { border-bottom: 1px solid var(--border); }
.command-filter-panel > footer { border-top: 1px solid var(--border); }
.command-filter-panel > header > span { display: inline-flex; align-items: center; gap: 8px; }
.command-filter-panel > header svg { width: 16px; height: 16px; color: var(--green); }
.command-filter-panel > header strong { font-size: 12px; }
.command-filter-panel > header a { color: var(--red); font-size: 9px; font-weight: 750; }
.command-filter-panel > footer { justify-content: flex-end; }
.command-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-subtle);
}
.command-filter-grid > label:not(.command-check) { display: grid; gap: 5px; min-width: 0; }
.command-filter-grid > label > span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.command-filter-grid input,
.command-filter-grid select { width: 100%; min-height: 38px; font-size: 10px; }
.command-processor-filter { grid-column: span 2; }
.command-check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.command-check input { width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.command-check span { color: var(--text) !important; font-size: 9px !important; text-transform: none !important; }

.command-queue-tabs {
  display: flex;
  gap: 3px;
  padding: 0 10px 7px;
  overflow-x: auto;
  scrollbar-width: none;
}
.command-queue-tabs a {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}
.command-queue-tabs a strong {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 7px;
}
.command-queue-tabs a:hover { background: var(--surface-subtle); }
.command-queue-tabs a.active { border-color: color-mix(in srgb, var(--green) 40%, var(--border)); background: var(--green-soft); color: var(--green); }
.command-queue-tabs a.urgent.active { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); background: var(--red-soft); color: var(--red); }
.command-queue-tabs a.active strong { background: var(--surface); color: currentColor; }
.command-status-view {
  min-height: 46px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 25px;
  align-items: center;
  gap: 7px;
  margin: 0 10px 7px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.command-status-view > svg { width: 17px; height: 17px; }
.command-status-view span { min-width: 0; }
.command-status-view span strong,
.command-status-view span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-status-view span strong { font-size: 10px; }
.command-status-view span small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.command-status-view > b { font-size: 15px; }
.command-status-view > a { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 5px; color: var(--muted); }
.command-status-view > a:hover { background: var(--surface-muted); color: var(--text); }
.command-status-view > a svg { width: 14px; height: 14px; }
.command-status-pending { background: var(--blue-soft); color: var(--blue); }
.command-status-approved { background: var(--green-soft); color: var(--green); }
.command-status-later { background: var(--amber-soft); color: var(--amber); }
.command-status-rejected { background: var(--red-soft); color: var(--red); }

.command-category-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 0 10px 8px;
  scrollbar-width: thin;
}
.command-category { flex: 0 0 auto; cursor: pointer; }
.command-category input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.command-category span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}
.command-category b {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 7px;
}
.command-category:hover span,
.command-category:hover b { border-color: var(--green); color: var(--green); }
.command-category.active span,
.command-category.active b { border-color: var(--green); background: var(--green-soft); color: var(--green); }

.command-result-form {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.command-bulk-bar {
  position: absolute;
  z-index: 20;
  inset: 8px 8px auto;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--floating);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.command-bulk-bar[hidden] { display: none; }
.command-bulk-bar > strong { color: var(--green); font-size: 9px; white-space: nowrap; }
.command-bulk-bar input { width: 100%; min-height: 34px; height: 34px; font-size: 9px; }
.command-bulk-bar > div { display: flex; gap: 4px; }
.command-icon-button.approve { border-color: var(--green); background: var(--green); color: var(--on-primary); }
.command-icon-button.later { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.command-icon-button.reject { border-color: var(--red); background: var(--red-soft); color: var(--red); }

.command-list { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.command-select-page {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}
.command-select-page input { width: 14px; min-height: 14px; height: 14px; margin: 0; accent-color: var(--green); }
.command-select-page small { margin-left: auto; font-size: 7px; font-weight: 650; }
.command-result {
  position: relative;
  min-height: 112px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  outline: none;
  transition: background 110ms ease, box-shadow 110ms ease;
}
.command-result:hover { background: var(--surface-hover); }
.command-result:focus-visible { box-shadow: inset 0 0 0 2px var(--green); }
.command-result.active {
  background: var(--green-soft);
  box-shadow: inset 3px 0 var(--green);
}
.command-result.reviewed-in-preview { opacity: 0.48; }
.command-row-check { width: 17px; height: 17px; cursor: pointer; }
.command-row-check input { position: absolute; opacity: 0; pointer-events: none; }
.command-row-check span {
  width: 15px;
  height: 15px;
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
}
.command-row-check input:checked + span { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 3px var(--surface); }
.command-score {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.command-score strong { font-size: 20px; line-height: 1; }
.command-score small { margin-top: 4px; color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.command-score-hot { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); background: var(--red-soft); color: var(--red); }
.command-score-high { border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); background: var(--amber-soft); color: var(--amber); }
.command-score-medium { border-color: color-mix(in srgb, var(--blue) 35%, var(--border)); background: var(--blue-soft); color: var(--blue); }
.command-result-copy { min-width: 0; }
.command-result-heading { min-width: 0; display: flex; align-items: center; gap: 8px; }
.command-result-heading > strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.command-result-heading .status {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 7px;
  font-size: 8px;
}
.command-result-copy > small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.command-result-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
}
.command-result-meta b,
.command-result-meta em,
.command-result-meta time { overflow: hidden; font-style: normal; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.command-result-meta b { color: var(--nav-text); }
.command-result-meta em::before,
.command-result-meta time::before { content: "·"; margin-right: 5px; color: var(--border-strong); }
.health-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.health-dot.health-healthy,
.health-dot.health-ok,
.health-dot.health-working,
.health-dot.health-active { background: var(--green); }
.health-dot.health-timeout,
.health-dot.health-connection_error,
.health-dot.health-server_error { background: var(--red); }
.command-row-actions { display: flex; align-items: center; gap: 3px; }
.command-row-actions a,
.command-row-actions button { width: 34px; min-width: 34px; height: 34px; border-color: transparent; background: transparent; }
.command-row-actions svg { width: 17px; height: 17px; }
.command-result:not(:hover):not(.active) .command-row-actions > :not(:last-child) { opacity: 0; pointer-events: none; }
.command-empty {
  min-height: 270px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 20px;
  text-align: center;
}
.command-empty > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-muted); color: var(--muted); }
.command-empty strong { margin-top: 12px; font-size: 13px; }
.command-empty p { margin: 5px 0 12px; color: var(--muted); font-size: 9px; }
.command-pagination {
  min-height: 45px;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.command-pagination > a,
.command-pagination > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; }
.command-pagination > a:hover { border-color: var(--green); color: var(--green); }
.command-pagination > a svg { width: 15px; height: 15px; }
.command-pagination > strong { text-align: center; font-size: 10px; }
.command-pagination > strong small { color: var(--muted); font-size: 8px; font-weight: 650; }

/* Inspector and review dock */
.command-inspector {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.command-inspector-empty,
.command-preview-loading {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 28px;
  text-align: center;
}
.command-inspector-empty[hidden],
.command-preview-loading[hidden] { display: none; }
.command-empty-orbit {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--green) 5%, transparent), 0 0 0 20px color-mix(in srgb, var(--green) 3%, transparent);
}
.command-empty-orbit svg { width: 26px; height: 26px; }
.command-inspector-empty > strong { margin-top: 30px; font-size: 18px; }
.command-inspector-empty > p { max-width: 370px; margin: 8px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.command-inspector-empty > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.command-inspector-empty > div > span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8px;
}
kbd {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--text);
  font-family: inherit;
  font-size: 8px;
  font-weight: 800;
  box-shadow: 0 1px 0 var(--border-strong);
}
.command-preview-loading { gap: 10px; color: var(--muted); font-size: 10px; }
.command-preview-loading svg { width: 22px; height: 22px; color: var(--green); animation: command-spin 1.2s linear infinite; }
.command-preview-content { height: 100%; }
.command-preview-content[hidden] { display: none; }
.command-card {
  height: 100%;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  overflow: hidden;
  outline: none;
}
.command-card-header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.command-mobile-back { display: none; }
.command-card-identity { min-width: 0; }
.command-card-category {
  display: block;
  margin-bottom: 2px;
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}
.command-card-identity h2 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.command-card-identity p { margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.command-card-navigation { display: flex; align-items: center; gap: 7px; }
.command-card-navigation button:disabled { opacity: 0.35; cursor: not-allowed; }
.command-card-navigation span { min-width: 74px; text-align: center; }
.command-card-navigation span strong,
.command-card-navigation span small { display: block; }
.command-card-navigation span strong { font-size: 10px; }
.command-card-navigation span small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.command-card-tools { display: flex; justify-content: flex-end; gap: 5px; }
.command-card-tools form { margin: 0; }
.command-card-tools .active { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.command-card-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--review-width);
  overflow: hidden;
}
.command-card-main {
  min-width: 0;
  overflow-y: auto;
  padding: 14px 16px 26px;
  scrollbar-width: thin;
}
.command-address-bar {
  min-height: 48px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 34px auto;
  align-items: center;
  gap: 7px;
  padding: 6px 7px 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.command-address-security { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.command-address-security svg { width: 14px; height: 14px; }
.command-address-copy { min-width: 0; }
.command-address-copy small,
.command-address-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-address-copy small { color: var(--muted); font-size: 7px; }
.command-address-copy strong { margin-top: 2px; font-size: 9px; }
.command-address-bar > a {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--green);
  color: var(--on-primary);
  font-size: 8px;
  font-weight: 800;
}
.command-address-bar > a:hover { background: var(--green-hover); }
.command-address-bar > a svg,
.command-address-bar > button svg { width: 14px; height: 14px; }
.command-change-banner {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--amber) 50%, var(--border));
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
}
.command-change-banner > svg { width: 17px; height: 17px; }
.command-change-banner strong,
.command-change-banner small { display: block; }
.command-change-banner strong { font-size: 10px; }
.command-change-banner small { margin-top: 2px; color: var(--text); font-size: 8px; }
.command-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.command-overview > div:first-child { min-width: 0; padding: 16px; }
.command-section-label { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.command-overview p { margin: 8px 0 0; color: var(--nav-text); font-size: 11px; line-height: 1.55; }
.command-priority {
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  border-left: 1px solid var(--border);
  background: var(--surface-subtle);
}
.command-priority span { color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.command-priority strong { margin: 4px 0 2px; font-size: 32px; line-height: 1; }
.command-priority small { color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.command-priority-hot { background: var(--red-soft); color: var(--red); }
.command-priority-high { background: var(--amber-soft); color: var(--amber); }
.command-priority-medium { background: var(--blue-soft); color: var(--blue); }
.command-signal-section,
.command-facts-section,
.command-decision-history {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.command-signal-section > header,
.command-facts-section > header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}
.command-signal-section > header small,
.command-facts-section > header small { color: var(--muted); font-size: 7px; }
.command-signal-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px; }
.command-signal-list > span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--green) 25%, var(--border));
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 8px;
  font-weight: 700;
}
.command-signal-list > span.negative { border-color: color-mix(in srgb, var(--red) 25%, var(--border)); background: var(--red-soft); color: var(--red); }
.command-signal-list svg { width: 12px; height: 12px; }
.command-signal-list strong { margin-left: 2px; }
.command-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}
.command-facts > div {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.command-facts > div:nth-child(3n) { border-right: 0; }
.command-facts > div.wide { grid-column: span 3; border-right: 0; }
.command-facts > div:last-child { border-bottom: 0; }
.command-facts dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.command-facts dt svg { width: 13px; height: 13px; color: var(--green); }
.command-facts dd { min-width: 0; margin: 6px 0 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 700; }
.command-facts .health,
.command-facts .learning-badge { min-height: 22px; font-size: 7px; }
.command-decision-history { padding: 12px; }
.command-decision-history > div { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.command-decision-history > div > svg { width: 30px; height: 30px; padding: 7px; border-radius: 6px; background: var(--surface-muted); color: var(--muted); }
.command-decision-history strong,
.command-decision-history small { display: block; }
.command-decision-history strong { font-size: 10px; }
.command-decision-history small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.command-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.command-card-footer > a,
.command-card-footer button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 8px;
  font-weight: 750;
}
.command-card-footer > a:hover,
.command-card-footer button:hover { border-color: var(--green); color: var(--green); }
.command-card-footer svg { width: 14px; height: 14px; }
.command-card-footer > a svg:last-child { margin-left: 4px; }

.command-review-dock {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.command-review-dock > header {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.command-review-dock > header .status { min-height: 24px; font-size: 7px; }
.command-review-context {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px 0;
}
.command-review-context > span {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-content: center;
  gap: 2px 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-subtle);
}
.command-review-context svg { grid-row: span 2; width: 15px; height: 15px; align-self: center; color: var(--green); }
.command-review-context small,
.command-review-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-review-context small { color: var(--muted); font-size: 7px; }
.command-review-context strong { font-size: 9px; }
.command-review-form {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.command-note-field { display: grid; gap: 6px; }
.command-note-field > span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.command-note-field textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px;
  resize: vertical;
  background: var(--surface-subtle);
  font-size: 10px;
  line-height: 1.45;
}
.preview-error { margin: 8px 0 0; padding: 8px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 8px; }
.command-decision-actions { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: auto; padding-top: 14px; }
.command-decision {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 0 9px 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 100ms ease, border-color 100ms ease, background 100ms ease;
}
.command-decision:hover { transform: translateY(-1px); }
.command-decision > span { display: inline-flex; align-items: center; gap: 8px; }
.command-decision svg { width: 17px; height: 17px; }
.command-decision strong { font-size: 10px; }
.command-decision.approve { border-color: var(--green); background: var(--green); color: var(--on-primary); }
.command-decision.approve:hover { background: var(--green-hover); }
.command-decision.approve kbd { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.13); color: var(--on-primary); box-shadow: none; }
.command-decision.later { border-color: color-mix(in srgb, var(--amber) 55%, var(--border)); background: var(--amber-soft); color: var(--amber); }
.command-decision.reject { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); background: var(--red-soft); color: var(--red); }
.command-decision:disabled { opacity: 0.55; cursor: wait; transform: none; }
.command-review-hint { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.command-review-hint svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }

/* Analytics, discovery, growth and detail workspaces */
body:not(.merchant-command-page) .metrics {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  border: 0;
}
body:not(.merchant-command-page) .metric {
  min-height: 92px;
  padding: 14px 15px;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
body:not(.merchant-command-page) .metric span { font-size: 9px; }
body:not(.merchant-command-page) .metric strong { margin: 5px 0 2px; font-size: 25px; line-height: 1; }
body:not(.merchant-command-page) .metric small { font-size: 8px; }
body:not(.merchant-command-page) a.metric:hover {
  border-color: var(--border-strong) !important;
  background: var(--surface);
  transform: translateY(-1px);
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.analytics-panel {
  grid-column: span 6;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.analytics-panel.analytics-wide { grid-column: span 12; }
.panel-heading {
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.panel-heading h2 { font-size: 13px; font-weight: 750; }
.panel-heading p { margin-top: 3px; font-size: 8px; }
.panel-count {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-muted);
  font-size: 8px;
}
.analytics-panel .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.analytics-panel th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 38px;
  padding-inline: 11px;
  background: var(--surface-subtle);
  font-size: 7px;
}
.analytics-panel td { height: 52px; padding: 7px 11px; font-size: 9px; }
.analytics-panel tbody tr:hover { background: var(--surface-hover); }
.daily-chart { padding: 10px 12px 14px; }
.daily-row { min-height: 43px; }
.distribution-row,
.rank-list > a,
.rank-list > div { min-height: 45px; padding-inline: 12px; }
.quality-list { background: var(--surface); }
.quality-list > div { min-height: 88px; }
.scout-status-line {
  min-height: 46px;
  margin: 0 0 12px;
  padding: 0 13px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.discovery-state,
.target-type,
.campaign-state,
.source-tier,
.language-code,
.recheck-state,
.scout-mode,
.dossier-state,
.route-label {
  min-height: 23px;
  border-radius: 5px;
  font-size: 7px;
}
.scout-run-list article { min-height: 62px; padding-inline: 12px; }
.run-icon { border-radius: 7px; }
.detail-toolbar { min-height: 44px; margin-bottom: 10px; }
.back-link { min-height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.detail-header {
  grid-template-columns: minmax(0, 1fr) 140px;
  padding: 22px 0;
  border-top: 0;
}
.detail-header h2 { font-size: 28px; }
.detail-score {
  min-height: 110px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.reason-strip { gap: 6px; padding: 10px 0; }
.reason { min-height: 29px; border-radius: 6px; font-size: 8px; }
.review-workspace,
.learning-summary,
.facts-section,
.history-section {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.review-workspace form { align-items: end; }
.decision-actions { gap: 7px; }
.learning-stats,
.facts-grid { overflow: hidden; border-radius: 7px; }
.raw-data {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.guide-intro { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.guide-steps { gap: 8px; }
.guide-steps article,
.guide-decision-list { border-radius: 8px; box-shadow: var(--shadow-small); }
.login-form,
.operator-picker {
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.operator-option { border-radius: 7px; }

html[data-theme="dark"] .topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); }
html[data-theme="dark"] .command-score,
html[data-theme="dark"] .command-empty-orbit { box-shadow: none; }

@keyframes command-spin { to { transform: rotate(360deg); } }

@media (max-width: 1280px) {
  :root { --queue-width: 350px; --review-width: 280px; }
  .analytics-panel { grid-column: span 12; }
  .command-operator strong { display: none; }
  .command-operator { width: 34px; padding: 0; }
  .command-result { grid-template-columns: 56px minmax(0, 1fr) 34px; gap: 11px; padding-inline: 11px; }
  .command-score { width: 54px; height: 54px; }
  .command-row-actions > :not(:last-child) { display: none; }
  .command-card-main { padding-inline: 12px; }
  .command-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-facts > div:nth-child(3n) { border-right: 1px solid var(--border); }
  .command-facts > div:nth-child(2n) { border-right: 0; }
  .command-facts > div.wide { grid-column: span 2; }
}

@media (max-width: 980px) {
  :root { --queue-width: 340px; }
  .command-card-body { grid-template-columns: 1fr; overflow-y: auto; }
  .command-card-main { overflow: visible; }
  .command-review-dock { min-height: 420px; overflow: visible; border-top: 1px solid var(--border); border-left: 0; }
  .command-decision-actions { margin-top: 0; }
}

@media (max-width: 820px) {
  .sidebar { z-index: 70; width: 252px; align-items: stretch; padding: 14px 12px; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand { justify-content: flex-start; padding-left: 48px; }
  .sidebar .brand-mark { display: none; }
  .sidebar .brand > span:last-child { display: block; }
  .sidebar .nav { justify-items: stretch; }
  .sidebar .nav-link { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 11px; }
  .sidebar .nav-link > span { display: block; }
  .sidebar .nav-status-link .nav-badge { position: static; margin-left: auto; border: 0; }
  .sidebar .nav-section-label { display: block; }
  .sidebar .sync-state { justify-content: flex-start; gap: 8px; padding: 8px; }
  .sidebar .sync-state > span:last-child { display: block; }
  .sidebar .sidebar-command { width: 100%; justify-content: flex-start; gap: 8px; padding: 0 10px; }
  .sidebar .sidebar-command span { display: block; }
  .workspace,
  .merchant-command-page .workspace { margin-left: 0; }
  .workspace { padding: 0 14px 30px; }
  .topbar { margin-inline: -14px; padding-inline: 62px 14px; }
  .mobile-menu { z-index: 80; display: inline-flex; }
  .command-workspace { display: block; }
  .command-queue { width: 100%; border-right: 0; }
  .command-queue-header { padding-left: 60px; }
  .command-inspector {
    position: fixed;
    z-index: 60;
    inset: 0;
    transform: translateX(100%);
    transition: transform 180ms ease;
  }
  .command-preview-open .command-inspector { transform: translateX(0); }
  .command-mobile-back {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
  }
  .command-mobile-back svg { width: 16px; height: 16px; }
  .command-card-header { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; padding: 9px 10px; }
  .command-card-navigation { grid-column: 1 / -1; grid-row: 2; justify-content: center; display: none; }
  .command-card-tools { grid-column: 3; }
  .command-card-tools > :first-child { display: none; }
  .command-card-main { padding-bottom: 180px; }
  .command-review-dock {
    position: fixed;
    z-index: 66;
    inset: auto 0 0;
    min-height: 154px;
    display: block;
    padding: 8px 10px 10px;
    overflow: hidden;
    border-top: 1px solid var(--border-strong);
    border-left: 0;
    background: var(--floating);
    box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(14px);
  }
  .command-review-dock > header {
    min-height: 26px;
    padding-bottom: 5px;
    border-bottom: 0;
  }
  .command-review-context,
  .command-review-hint { display: none; }
  .command-review-form { display: block; }
  .command-note-field { gap: 0; }
  .command-note-field > span { display: none; }
  .command-note-field textarea {
    min-height: 40px;
    height: 40px;
    padding: 8px 9px;
    resize: none;
  }
  .command-decision-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding-top: 6px;
  }
  .command-decision {
    min-height: 42px;
    justify-content: center;
    padding: 0 6px;
  }
  .command-decision > span { gap: 5px; }
  .command-decision strong { font-size: 8px; line-height: 1.1; text-align: left; }
  .command-decision svg { width: 15px; height: 15px; }
  .command-decision kbd { display: none; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-panel,
  .analytics-panel.analytics-wide { grid-column: 1; }
  .detail-header { grid-template-columns: 1fr; }
  .review-workspace,
  .learning-summary,
  .facts-section,
  .history-section { padding: 11px; }
}

@media (max-width: 560px) {
  .command-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-stat:nth-child(2) { border-right: 0; }
  .command-stat:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .command-filter-panel { width: calc(100vw - 20px); }
  .command-filter-grid { grid-template-columns: 1fr; max-height: 60vh; overflow-y: auto; }
  .command-processor-filter { grid-column: 1; }
  .command-result { min-height: 98px; }
  .command-result-heading .status { display: none; }
  .command-address-bar { grid-template-columns: 30px minmax(0, 1fr) 34px; }
  .command-address-bar > a { width: 34px; padding: 0; justify-content: center; }
  .command-address-bar > a span { display: none; }
  .command-overview { grid-template-columns: 1fr; }
  .command-priority { min-height: 76px; grid-template-columns: auto auto auto; gap: 7px; border-top: 1px solid var(--border); border-left: 0; }
  .command-facts { grid-template-columns: 1fr; }
  .command-facts > div,
  .command-facts > div:nth-child(2n),
  .command-facts > div.wide { grid-column: 1; border-right: 0; }
  .command-card-footer { align-items: stretch; flex-direction: column; }
  .command-card-footer > a,
  .command-card-footer button { width: 100%; justify-content: center; }
  .command-review-context { grid-template-columns: 1fr; }
}
