/* One colour system for the console.
 *
 * Everything below the "from the antd theme" block is a value antd itself owns
 * (src/design-system/theme.js). It is repeated here so the very first paint is
 * right before any JavaScript runs, and theme-css-variables.test.js fails if the
 * two ever disagree — the theme stays the source, this stays a copy that cannot
 * silently drift.
 *
 * The rest is the neutral, shell and state scale the theme has no opinion
 * about. Nothing in this file may name a colour any other way: a hex outside
 * this block is a second palette forming again.
 */
:root {
  /* ── from the antd theme: mirrored from adminTheme.token ── */
  --admin-primary: #2f7f78;
  --admin-success: #2f855a;
  --admin-warning: #b7791f;
  --admin-error: #c2410c;
  --admin-info: #2563eb;
  --admin-ink-secondary: #6b6b6b;
  --admin-radius: 6px;
  --admin-radius-lg: 8px;
  --admin-font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── surfaces and lines ── */
  --admin-page: #f3f5f7;
  --admin-surface: #ffffff;
  --admin-surface-subtle: #f6f8fa;
  --admin-line: #dde3ea;
  --admin-line-strong: #d5dde5;
  --admin-line-subtle: #e3e8ee;
  --admin-line-faint: #edf0f3;

  /* ── text on light surfaces ── */
  --admin-ink: #17202a;
  /* 12px secondary text sits on the workspace background, where the lighter
     greys fall below the AA floor; these two keep the hue and clear it. */
  --admin-ink-quiet: #5c6773;
  --admin-ink-muted: #73808d;
  --admin-ink-strong-muted: #4f5d6b;
  --admin-ink-dim: #42515f;

  /* ── the dark shell: sidebar, top actions, code ── */
  --admin-shell: #111820;
  --admin-shell-raised: #1d2934;
  --admin-shell-sunken: #24313d;
  --admin-shell-line: #27323d;
  --admin-shell-contrast-ink: #0f1720;
  --admin-shell-text: #f8fafc;
  --admin-shell-text-muted: #dce4ec;
  --admin-shell-text-dim: #d7dee7;
  --admin-shell-text-quiet: #95a1ad;
  --admin-code-bg: #101820;
  --admin-code-text: #dce8ef;

  /* The primary reads at 2.6:1 on the shell, so the brand carries there as a
     lighter step of the same hue, with shell-contrast-ink on top of it. */
  --admin-primary-on-dark: #8fd7c7;
  --admin-primary-strong: #146058;
  --admin-primary-wash: #eef7f4;
  --admin-focus-ring: rgba(47, 127, 120, 0.18);

  /* ── state ── */
  --admin-dot-online: #6ee7a8;
  --admin-dot-offline: #ff8a7a;
  --admin-dot-neutral: #9aa5af;
  --admin-success-wash: #dff8ea;
  --admin-success-wash-soft: #eef7f2;
  --admin-success-line: #c8e8d4;
  --admin-success-text: #176a3d;
  --admin-success-text-soft: #416150;
  --admin-info-wash: #e7f0ff;
  --admin-info-text: #24589b;
  --admin-accent-wash: #f4ecff;
  --admin-accent-text: #5b3a8f;
  --admin-danger-wash: #fff1f0;
  --admin-danger-line: #ffcbc4;
  --admin-danger-text: #9f2d20;

  /* ── depth and overlays ── */
  --admin-shadow-modal: rgba(17, 24, 32, 0.08);
  --admin-shadow-card: rgba(17, 24, 32, 0.04);
  --admin-count-chip: rgba(65, 80, 95, 0.12);
  --admin-count-chip-on-primary: rgba(255, 255, 255, 0.2);
  --admin-row-tint: rgba(0, 0, 0, 0.015);

  color-scheme: light;
  font-family: var(--admin-font-family);
  background: var(--admin-page);
  color: var(--admin-ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-screen {
  align-items: center;
  background: var(--admin-page);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius-lg);
  box-shadow: 0 18px 50px var(--admin-shadow-modal);
  display: grid;
  gap: 22px;
  max-width: 440px;
  padding: 28px;
  width: 100%;
}

.login-brand {
  padding-bottom: 4px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--admin-ink-secondary);
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  border: 1px solid var(--admin-line-strong);
  border-radius: var(--admin-radius);
  color: var(--admin-ink);
  min-height: 42px;
  outline: none;
  padding: 0 12px;
}

.login-form input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-focus-ring);
}

.language-switch {
  align-items: center;
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-line-subtle);
  border-radius: var(--admin-radius);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 42px;
  padding: 6px;
}

.language-switch > span {
  color: var(--admin-ink-secondary);
  font-size: 12px;
  font-weight: 800;
  padding-left: 6px;
}

.language-options {
  display: inline-grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(44px, 1fr));
}

.language-options button {
  background: transparent;
  border-radius: var(--admin-radius);
  color: var(--admin-ink-secondary);
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  padding: 0 10px;
}

.language-options button.selected {
  background: var(--admin-ink);
  color: var(--admin-surface);
}

.login-form .primary-action {
  margin-top: 4px;
  width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--admin-shell);
  color: var(--admin-shell-text);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  align-items: center;
  background: var(--admin-primary-on-dark);
  border-radius: var(--admin-radius-lg);
  color: var(--admin-shell-contrast-ink);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand h1,
.brand p,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand p,
.section-label,
.muted,
.refresh-stamp {
  /* 12px text on the workspace background: var(--admin-ink-muted) read at 3.69:1, below the
     AA floor. Same hue, enough contrast to be read. */
  color: var(--admin-ink-quiet);
  font-size: 12px;
  line-height: 1.35;
}

.brand p {
  color: var(--admin-shell-text-quiet);
  margin-top: 3px;
}

.main-nav {
  border-top: 1px solid var(--admin-shell-line);
  display: grid;
  gap: 4px;
  padding-top: 18px;
}

.nav-item {
  align-items: center;
  background: transparent;
  border-radius: var(--admin-radius);
  color: var(--admin-shell-text-muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  text-align: left;
  text-decoration: none;
}

.nav-item .anticon {
  color: var(--admin-primary-on-dark);
  font-size: 15px;
  width: 18px;
}

.nav-item span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item.selected,
.nav-item:hover {
  background: var(--admin-shell-raised);
  color: var(--admin-surface);
}

.session-panel {
  border-top: 1px solid var(--admin-shell-line);
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.session-panel span {
  color: var(--admin-shell-text-quiet);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.session-panel strong {
  color: var(--admin-shell-text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.primary-action,
.quiet-action,
.topbar-actions button,
.command-strip button {
  align-items: center;
  border-radius: var(--admin-radius);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
}

.primary-action {
  background: var(--admin-primary-on-dark);
  color: var(--admin-shell-contrast-ink);
}

.quiet-action {
  background: var(--admin-shell-sunken);
  color: var(--admin-shell-text-dim);
}

.status-dot {
  background: var(--admin-dot-neutral);
  border-radius: 999px;
  display: block;
  height: 9px;
  width: 9px;
}

.status-dot[data-state='active'],
.status-dot[data-state='online'] {
  background: var(--admin-dot-online);
}

.status-dot[data-state='offline'],
.status-dot[data-state='timeout'] {
  background: var(--admin-dot-offline);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
  padding: 24px 28px;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.route-loading {
  display: flex;
  justify-content: center;
  padding: 48px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  min-width: 0;
}

.topbar > div:first-child {
  min-width: 0;
}

.section-label {
  font-weight: 800;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: 26px;
  letter-spacing: 0;
  line-height: 1.12;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.topbar-actions button,
.command-strip button {
  background: var(--admin-ink);
  color: var(--admin-surface);
}

.notice {
  align-items: center;
  background: var(--admin-danger-wash);
  border: 1px solid var(--admin-danger-line);
  border-radius: var(--admin-radius);
  color: var(--admin-danger-text);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.notice-message {
  min-width: 0;
}

.notice-dismiss {
  background: transparent;
  border: 1px solid var(--admin-danger-line);
  border-radius: var(--admin-radius);
  color: var(--admin-danger-text);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
}

.notice-dismiss:hover {
  background: var(--admin-danger-line);
}

/* The backend's own words, folded away: useful to whoever the operator
   escalates to, noise to the operator. */
.error-detail summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.error-detail code {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-section {
  display: grid;
  gap: 10px;
}

.dashboard-section-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.dashboard-section-heading .ant-typography {
  margin: 0;
}

.dashboard-card-extra {
  align-items: center;
  display: inline-flex;
  gap: 14px;
}

.see-all-link {
  color: var(--admin-primary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.see-all-link:hover {
  color: var(--admin-primary-strong);
  text-decoration: underline;
}

.payload-block {
  display: grid;
  gap: 10px;
}

.payload-block-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.settings-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
}

/* A labelled input inside a Card, styled like the Descriptions labels beside
   it so the panel reads as one thing. */
.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field label {
  color: var(--admin-ink-secondary);
  font-size: 13px;
}

.device-types-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.device-types-grid .catalog-panel {
  grid-row: auto;
}

.health-page {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.provisioning-page {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
}

.devices-page,
.commands-page,
.audit-page {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(380px, 0.42fr) minmax(0, 0.58fr);
}

.device-scope-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  grid-column: 1 / -1;
  justify-content: space-between;
}

.device-scope-bar .ant-typography {
  margin: 0;
}

.device-scope-empty {
  display: grid;
  gap: 32px;
  justify-items: start;
  padding: 8px 0 40px;
}

.device-environment-switch .ant-btn {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.device-environment-switch strong {
  background: var(--admin-count-chip);
  border-radius: 999px;
  font-size: 11px;
  min-width: 20px;
  padding: 2px 6px;
}

.device-environment-switch .ant-btn-primary strong {
  background: var(--admin-count-chip-on-primary);
}

/* Collapse master-detail to a single column when there is no detail to show —
 * the empty inventory table tells the story by itself and a half-empty detail
 * column looks wasteful. */
.commands-page--single,
.audit-page--single {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  background: var(--admin-surface);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius-lg);
  box-shadow: 0 8px 24px var(--admin-shadow-card);
  min-width: 0;
  padding: 18px;
}

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

.command-history-panel,
.command-detail-panel,
.audit-log-panel,
.audit-detail-panel,
.catalog-panel,
.health-overview-panel,
.health-components-panel,
.health-payload-panel,
.provisioning-form-panel,
.provisioning-result-panel {
  align-content: start;
  display: grid;
}

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

.panel h3 {
  font-size: 16px;
  line-height: 1.2;
}

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

.dashboard-metrics {
  align-content: start;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-card {
  min-width: 0;
}

.dashboard-card-body {
  margin-top: 14px;
}

.dashboard-card .ant-card-head-title,
.device-inventory-card .ant-card-head-title,
.device-detail-card .ant-card-head-title {
  min-width: 0;
}

.ant-card,
.ant-card-body,
.ant-table-wrapper,
.ant-descriptions,
.ant-descriptions-view {
  min-width: 0;
}

.dashboard-card h3,
.device-inventory-card h3,
.device-detail-card h3 {
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
}

.table-cell-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.table-cell-stack .ant-typography {
  margin: 0;
  overflow-wrap: anywhere;
}

.table-cell-stack .ant-typography-secondary:last-child {
  font-size: 12px;
}

.sku-profile-identity {
  max-width: 100%;
  min-width: 0;
}

.sku-profile-identity .ant-typography {
  display: block;
  max-width: 100%;
}

.sku-profile-identity .ant-typography:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-action-strip .ant-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  padding-inline: 0;
  width: 34px;
}

.sku-profiles-table .ant-table-cell,
.command-data-table .ant-table-cell,
.audit-data-table .ant-table-cell {
  vertical-align: top;
}

.command-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.device-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.device-page-strip {
  align-items: center;
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-line-subtle);
  border-radius: var(--admin-radius);
  color: var(--admin-ink-secondary);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: space-between;
  margin-bottom: 14px;
  min-height: 44px;
  padding: 8px 10px;
}

.device-page-strip > span {
  overflow-wrap: anywhere;
}

.command-toolbar,
.audit-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.audit-filter-stack {
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.filter-block {
  display: grid;
  gap: 4px;
}

.filter-label {
  color: var(--admin-ink-secondary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state-title {
  color: var(--admin-ink);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.empty-state-description {
  color: var(--admin-ink-muted);
  font-size: 13px;
}

.search-field {
  display: grid;
  gap: 6px;
}

.search-field span {
  color: var(--admin-ink-secondary);
  font-size: 12px;
  font-weight: 800;
}

.search-field input {
  border: 1px solid var(--admin-line-strong);
  border-radius: var(--admin-radius);
  color: var(--admin-ink);
  min-height: 40px;
  outline: none;
  padding: 0 12px;
}

.search-field input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-focus-ring);
}

.status-filter-group {
  align-self: end;
}

.status-filter-group .ant-btn {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-height: 40px;
}

.status-filter-group strong {
  background: var(--admin-count-chip);
  border-radius: 999px;
  font-size: 11px;
  min-width: 20px;
  padding: 2px 6px;
  text-align: center;
}

.status-filter-group .ant-btn-primary strong {
  background: var(--admin-count-chip-on-primary);
}

.device-inventory-card,
.device-detail-card {
  min-width: 0;
}

.device-inventory-card .ant-card-body,
.device-detail-card .ant-card-body {
  min-width: 0;
  overflow: hidden;
}

.device-data-table .ant-table-row {
  cursor: pointer;
}

.command-data-table .ant-table-row {
  cursor: pointer;
}

.audit-data-table .ant-table-row {
  cursor: pointer;
}

.device-data-table .device-table-row-selected > td {
  background: var(--admin-primary-wash);
}

.command-data-table .command-table-row-selected > td {
  background: var(--admin-primary-wash);
}

.audit-data-table .audit-table-row-selected > td {
  background: var(--admin-primary-wash);
}

.device-data-table .ant-table-cell {
  line-height: 1.35;
  vertical-align: top;
}

.device-data-table .ant-table-thead > tr > th {
  white-space: normal;
}

.command-data-table .ant-table-cell,
.audit-data-table .ant-table-cell,
.catalog-panel .ant-table-cell {
  overflow-wrap: anywhere;
}

.device-identity {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 10px minmax(0, 1fr);
}

.device-identity strong,
.device-identity small {
  display: block;
  overflow-wrap: anywhere;
}

.device-identity .ant-typography {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
}

.device-table-transport {
  color: var(--admin-ink-strong-muted);
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.device-identity strong {
  color: var(--admin-ink);
  font-size: 13px;
}

.device-identity small {
  color: var(--admin-ink-muted);
  font-size: 12px;
  margin-top: 2px;
}

.transport-chip,
.capability-chip,
.command-chip {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  padding: 5px 8px;
  white-space: nowrap;
}

.catalog-cell-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.transport-chip {
  background: var(--admin-success-wash);
  color: var(--admin-success-text);
}

.capability-chip {
  background: var(--admin-info-wash);
  color: var(--admin-info-text);
}

.command-chip {
  background: var(--admin-accent-wash);
  color: var(--admin-accent-text);
}

.form-panel {
  align-content: start;
  display: grid;
  gap: 10px;
}

.form-panel label {
  color: var(--admin-ink-secondary);
  font-size: 12px;
  font-weight: 800;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
  border: 1px solid var(--admin-line-strong);
  border-radius: var(--admin-radius);
  color: var(--admin-ink);
  min-height: 40px;
  outline: none;
  padding: 0 12px;
}

.form-panel textarea {
  line-height: 1.45;
  min-height: 94px;
  padding: 10px 12px;
  resize: vertical;
}

.form-panel input:focus,
.form-panel select:focus,
.form-panel textarea:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-focus-ring);
}

.stacked-form {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.template-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.form-fieldset {
  border: 1px solid var(--admin-line-subtle);
  border-radius: var(--admin-radius);
  display: grid;
  gap: 10px;
  margin: 2px 0;
  min-width: 0;
  padding: 12px;
}

.form-fieldset legend {
  color: var(--admin-ink-dim);
  font-size: 12px;
  font-weight: 900;
  padding: 0 6px;
}

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

.command-definition-row {
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-line-subtle);
  border-radius: var(--admin-radius);
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.command-row-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.command-row-header strong {
  color: var(--admin-ink);
  font-size: 13px;
}

.command-row-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(130px, 0.26fr) minmax(0, 0.74fr);
}

.command-row-grid label {
  align-self: start;
  padding-top: 10px;
}

.command-row-grid textarea {
  min-height: 66px;
}

.detail-title {
  min-width: 0;
}

.detail-title h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.detail-title span {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.device-detail-descriptions {
  margin-bottom: 16px;
}

.device-detail-descriptions .ant-descriptions-item-content,
.detail-block .ant-descriptions-item-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.device-detail-descriptions .ant-descriptions-item-label {
  min-width: 116px;
  overflow-wrap: normal;
  white-space: normal;
}

.health-overview-descriptions {
  margin-top: 16px;
}

.device-command-panel {
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-line-subtle);
  border-radius: var(--admin-radius);
  margin-top: 16px;
  padding: 12px;
}

.device-command-panel .payload-heading {
  margin: 0 0 10px;
}

.device-action-strip {
  margin-top: 0;
}

.command-hint {
  margin: 10px 0 0;
}

.ant-alert.local-control-banner {
  display: flex;
  margin-top: 16px;
}

.command-detail-metrics,
.audit-detail-metrics,
.provisioning-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.device-detail-sections {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 16px;
}

.device-activity-grid,
.payload-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.local-control-banner {
  align-items: center;
  background: var(--admin-success-wash-soft);
  border: 1px solid var(--admin-success-line);
  border-radius: var(--admin-radius);
  color: var(--admin-success-text);
  display: grid;
  gap: 4px;
  margin-top: 16px;
  min-height: 56px;
  padding: 10px 12px;
}

.local-control-banner strong,
.local-control-banner span {
  display: block;
  overflow-wrap: anywhere;
}

.local-control-banner strong {
  font-size: 13px;
}

.local-control-banner span {
  color: var(--admin-success-text-soft);
  font-size: 12px;
}

.command-detail-sections,
.audit-detail-sections,
.provisioning-detail-sections {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 16px;
}

.copy-status {
  align-items: center;
  color: var(--admin-ink-secondary);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  min-height: 40px;
}

.health-payload-panel {
  grid-column: 1 / -1;
}

.detail-block {
  min-width: 0;
}

.detail-block h4 {
  font-size: 13px;
  line-height: 1.2;
  margin: 0 0 10px;
}

.payload-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 12px;
}

.payload-subheading {
  color: var(--admin-ink-secondary);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.state-stack {
  display: grid;
  gap: 10px;
}

.state-row {
  align-items: center;
  border-bottom: 1px solid var(--admin-line-faint);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(96px, 0.75fr) minmax(0, 1.25fr);
  min-height: 36px;
}

.state-row span {
  color: var(--admin-ink-secondary);
  font-size: 13px;
  min-width: 0;
}

.state-row strong {
  font-size: 14px;
  justify-self: end;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

pre {
  background: var(--admin-code-bg);
  border-radius: var(--admin-radius);
  color: var(--admin-code-text);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 14px;
}

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

  .sidebar {
    min-height: auto;
  }

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

  .nav-item {
    justify-content: center;
    text-align: center;
  }

  .session-panel {
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin-top: 0;
    align-items: center;
  }

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

  .settings-grid,
  .device-types-grid,
  .health-page,
  .provisioning-page,
  .devices-page,
  .commands-page,
  .audit-page {
    grid-template-columns: 1fr;
  }

  .device-types-grid .catalog-panel {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .sidebar {
    gap: 16px;
  }

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

  .nav-item {
    justify-content: center;
    text-align: center;
  }

  .session-panel {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .topbar,
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .device-toolbar,
  .device-page-strip,
  .command-toolbar,
  .audit-toolbar,
  .device-detail-sections,
  .device-activity-grid,
  .payload-grid,
  .command-detail-sections,
  .audit-detail-sections,
  .provisioning-detail-sections {
    grid-template-columns: 1fr;
  }

  .device-page-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-filter-stack {
    justify-content: stretch;
  }
}

/* Alice projection editor -------------------------------------------------- */
/* The editor stacks a lot of short labelled controls. A single field layout
   keeps label, control and hint aligned everywhere they appear, so the form
   reads as one column rather than a pile of ad-hoc rows. */
.alice-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.alice-field-hint {
  font-size: 12px;
  line-height: 1.45;
}

.alice-entity-card {
  margin-bottom: 4px;
}

.alice-feature-card {
  background: var(--admin-row-tint);
}

.alice-feature-hint {
  margin-bottom: 4px !important;
}

/* The spoken example is the fastest way to understand what a function does, so
   it is set apart from the surrounding explanatory text. */
.alice-voice-example {
  font-style: italic;
  margin-bottom: 12px !important;
}

.alice-mode-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.alice-mode-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.alice-simulated-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.alice-preview-device .alice-preview-kind {
  display: block;
  font-size: 12px;
}

.alice-preview-features {
  margin: 8px 0 0;
  padding-left: 18px;
}

.alice-preview-loading {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.alice-preview-raw {
  font-size: 12px;
  margin: 0;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.alice-blockers {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 720px) {
  .alice-mode-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.app-content-lead,
.app-content-hint {
  color: var(--admin-ink-quiet);
  margin: 0 0 12px;
}

.app-content-tab {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.app-content-panel {
  display: grid;
  gap: 12px;
  max-width: 720px;
}

.app-content-asset {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.app-content-asset-preview {
  align-items: center;
  background: var(--admin-surface-subtle);
  border: 1px dashed var(--admin-line);
  border-radius: var(--admin-radius);
  display: flex;
  justify-content: center;
  min-height: 96px;
  overflow: hidden;
  width: 160px;
}

.app-content-asset-preview img {
  display: block;
  max-height: 160px;
  max-width: 100%;
}

.app-content-asset-empty,
.app-content-asset-hint,
.app-content-meta {
  color: var(--admin-ink-quiet);
  font-size: 12px;
}

.app-content-asset-actions {
  display: grid;
  gap: 6px;
  justify-items: start;
}

/* The picker is driven by the button next to it. The `hidden` attribute alone
   is not enough: an author rule that sets `display` on inputs outranks the
   user-agent's [hidden] rule, and the raw control reappears. */
.app-content-asset-actions input[type='file'] {
  display: none;
}

.app-content-asset-hint,
.app-content-meta {
  margin: 0;
}

.app-content-asset-id {
  background: var(--admin-code-bg);
  border-radius: var(--admin-radius);
  color: var(--admin-code-text);
  font-size: 11px;
  padding: 2px 6px;
}

.app-content-pages {
  display: grid;
  gap: 12px;
}

.app-content-page-row {
  background: var(--admin-surface-subtle);
  border: 1px solid var(--admin-line-subtle);
  border-radius: var(--admin-radius);
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
}

.app-content-page-controls {
  display: inline-flex;
  gap: 6px;
}

.app-content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
