/*
 * Integron Stage 3D — UX modernization.
 *
 * This file is intentionally isolated from the historical stylesheet so the
 * new shell and component language can be verified and migrated without
 * weakening route, RBAC, offline, or operational behavior.
 */

:root {
  --d-sidebar: 248px;
  --d-topbar: 64px;
  --d-canvas: #f5f7f6;
  --d-surface: #ffffff;
  --d-surface-subtle: #f8faf9;
  --d-surface-strong: #edf2ef;
  --d-border: #dfe7e2;
  --d-border-strong: #ccd9d1;
  --d-text: #17231d;
  --d-text-soft: #52645a;
  --d-text-faint: #718078;
  --d-brand: #0b7a4b;
  --d-brand-hover: #08663f;
  --d-brand-soft: #e9f6ef;
  --d-info: #2868d7;
  --d-info-soft: #edf3ff;
  --d-warning: #9b6800;
  --d-warning-soft: #fff7df;
  --d-danger: #b42335;
  --d-danger-soft: #fff0f2;
  --d-radius-sm: 8px;
  --d-radius: 12px;
  --d-radius-lg: 16px;
  --d-shadow-sm: 0 1px 2px rgba(25, 46, 35, .05);
  --d-shadow: 0 10px 30px rgba(25, 46, 35, .08);
  --d-focus: 0 0 0 3px rgba(11, 122, 75, .2);
}

/* Stage 3AM: training/demo must feel like real modes, not ordinary pages. */
body[data-route="training-center"] .workspace,
body[data-route="demo-center"] .workspace {
  background:
    radial-gradient(circle at top right, rgba(0, 145, 96, 0.12), transparent 34rem),
    linear-gradient(180deg, rgba(245, 251, 248, 0.98), rgba(255, 255, 255, 0.98));
}

body[data-route="demo-center"] .workspace {
  background:
    radial-gradient(circle at top right, rgba(0, 111, 145, 0.16), transparent 34rem),
    linear-gradient(180deg, rgba(245, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
}

body[data-environment-mode="training"] .workspace {
  background:
    radial-gradient(circle at 90% 10%, rgba(0, 145, 96, 0.14), transparent 34rem),
    linear-gradient(180deg, #f1fbf6 0%, #f8fbfa 44%, #ffffff 100%);
}

body[data-environment-mode="demo"] .workspace {
  background:
    radial-gradient(circle at 90% 10%, rgba(0, 111, 145, 0.18), transparent 34rem),
    linear-gradient(180deg, #eef9fc 0%, #f8fbfc 44%, #ffffff 100%);
}

.environment-top-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.environment-mode-button,
.environment-exit-button {
  border: 1px solid rgba(11, 122, 75, .28);
  border-radius: 999px;
  background: #fff;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 800;
  color: var(--d-text);
}

.environment-mode-button {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--d-brand-soft);
}

.environment-mode-button strong {
  border-radius: 999px;
  background: var(--d-brand);
  color: #fff;
  padding: 3px 8px;
  font-size: 11px;
}

.environment-exit-button {
  background: var(--d-surface);
}

.environment-top-switch.demo .environment-mode-button {
  background: #e8f7fb;
}

.environment-top-switch.demo .environment-mode-button strong {
  background: #0079a8;
}

.simulation-environment-banner,
.environment-hero,
.environment-launch-page,
.environment-guide-panel,
.environment-mission-board {
  border: 1px solid rgba(11, 122, 75, .22);
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(23, 35, 29, .08);
}

.simulation-environment-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .94);
  border-left: 6px solid var(--d-brand);
}

.simulation-environment-banner.demo {
  border-color: rgba(0, 111, 145, .28);
  border-left-color: #0079a8;
}

.simulation-environment-banner h3 {
  margin: 2px 0 4px;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -.03em;
}

.simulation-environment-banner p {
  margin: 0;
  color: var(--d-text-soft);
}

.simulation-environment-actions,
.environment-hero-actions,
.demo-control-actions,
.training-mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.environment-hero,
.environment-launch-page {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
  padding: 24px;
  background: rgba(255,255,255,.94);
}

.environment-hero h2,
.environment-launch-page h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -.05em;
}

.environment-hero.demo {
  border-color: rgba(0, 111, 145, .28);
}

.environment-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.environment-module-card {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon kicker"
    "icon title"
    "icon body";
  gap: 2px 12px;
  align-items: center;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: #fff;
  text-align: left;
  box-shadow: var(--d-shadow-sm);
  color: inherit;
  cursor: pointer;
  appearance: none;
  pointer-events: auto;
  touch-action: manipulation;
}

.environment-module-card > * {
  pointer-events: none;
}

.environment-module-card:hover,
.environment-module-card:focus-visible {
  border-color: rgba(11, 122, 75, .5);
  box-shadow: var(--d-focus);
}

.environment-module-icon {
  grid-area: icon;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--d-brand-soft);
  color: var(--d-brand);
}

.environment-module-icon svg {
  width: 24px;
  height: 24px;
}

/* Stage 3AQ: Training/Demo are simple launchers first, full fake-data modes only after Start. */
.stage3aq-launcher {
  align-items: stretch;
  overflow: hidden;
}

.stage3aq-launcher.training {
  border-left: 6px solid var(--d-brand);
}

.stage3aq-launcher.demo {
  border-color: rgba(0, 111, 145, .28);
  border-left: 6px solid #0079a8;
}

.stage3aq-launcher-copy {
  display: grid;
  gap: 14px;
  align-content: center;
}

.stage3aq-launcher-copy p {
  max-width: 64ch;
  color: var(--d-text-soft);
  line-height: 1.55;
}

.stage3aq-safe-note {
  display: grid;
  gap: 4px;
  max-width: 760px;
  padding: 14px 16px;
  border: 1px solid rgba(11, 122, 75, .2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(11, 122, 75, .08), rgba(255,255,255,.86));
}

.stage3aq-safe-note span {
  color: var(--d-text-soft);
}

.stage3aq-next-card {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(245,250,248,.96), rgba(255,255,255,.9));
  border: 1px solid var(--d-border);
  box-shadow: var(--d-shadow-sm);
}

.stage3aq-next-card > span {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--d-brand-soft);
  color: var(--d-brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stage3aq-next-card strong {
  font-size: 20px;
}

.stage3aq-next-card ol {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.stage3aq-next-card li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(204, 217, 209, .75);
}

.stage3aq-next-card small {
  color: var(--d-text-soft);
  line-height: 1.35;
}

.stage3aq-workflow-strip,
.stage3aq-widget-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.stage3aq-workflow-strip {
  margin: 0 0 16px;
}

.stage3aq-workflow-strip article,
.stage3aq-widget-tile,
.stage3aq-palette-panel {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--d-shadow-sm);
}

.stage3aq-workflow-strip article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.stage3aq-workflow-strip span,
.stage3aq-widget-tile > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--d-brand-soft);
  color: var(--d-brand);
  font-weight: 900;
}

.stage3aq-workflow-strip strong,
.stage3aq-workflow-strip small,
.stage3aq-widget-tile strong,
.stage3aq-widget-tile small {
  display: block;
}

.stage3aq-workflow-strip small,
.stage3aq-widget-tile small,
.stage3aq-palette-panel .panel-head p,
.stage3aq-module-preview .panel-head p {
  margin-top: 3px;
  color: var(--d-text-soft);
  line-height: 1.35;
}

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

.stage3aq-widget-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon body";
  gap: 3px 12px;
  min-height: 96px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.stage3aq-widget-tile > span {
  grid-area: icon;
}

.stage3aq-widget-tile strong {
  grid-area: title;
}

.stage3aq-widget-tile small {
  grid-area: body;
}

.stage3aq-widget-tile:hover,
.stage3aq-widget-tile:focus-visible {
  border-color: rgba(11, 122, 75, .5);
  background: rgba(11, 122, 75, .05);
  box-shadow: var(--d-focus);
}

.stage3aq-launcher.demo .stage3aq-safe-note,
.stage3aq-launcher.demo + .stage3aq-workflow-strip span,
.stage3aq-launcher.demo ~ .stage3aq-palette-panel .stage3aq-widget-tile > span {
  background: #e8f7fb;
  color: #0079a8;
}

/* Stage 3AR: practice workspaces use original Integron patterns inspired by device-console UX research. */
.stage3ar-practice-panel,
.stage3ar-device-blueprint {
  margin-bottom: 16px;
}

.stage3ar-practice-panel {
  padding: 18px;
  border: 1px solid var(--d-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,251,249,.94));
  box-shadow: var(--d-shadow-sm);
}

.stage3ar-kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stage3ar-kit-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "badge title"
    "badge body"
    "badge foot";
  gap: 4px 12px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(204, 217, 209, .86);
  border-radius: 18px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.stage3ar-kit-card > span {
  grid-area: badge;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--d-brand-soft);
  color: var(--d-brand);
  font-weight: 900;
}

.stage3ar-kit-card strong {
  grid-area: title;
  font-size: 18px;
}

.stage3ar-kit-card small {
  grid-area: body;
  color: var(--d-text-soft);
  line-height: 1.35;
}

.stage3ar-kit-card em {
  grid-area: foot;
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(16, 35, 29, .06);
  color: var(--d-text-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.stage3ar-widget-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.stage3ar-widget-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(204, 217, 209, .84);
  border-radius: 18px;
  background: rgba(255,255,255,.9);
}

.stage3ar-widget-group header {
  display: grid;
  gap: 3px;
}

.stage3ar-widget-group header strong {
  font-size: 16px;
}

.stage3ar-widget-group header small {
  color: var(--d-text-soft);
}

.stage3ar-widget-group .stage3aq-widget-palette {
  grid-template-columns: 1fr;
}

.stage3ar-widget-tile {
  min-height: 88px;
}

.stage3ar-workflow-panel .stage3aq-workflow-strip {
  margin-bottom: 0;
}

.stage3ar-device-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stage3ar-device-tabs article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(204, 217, 209, .84);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
}

.stage3ar-device-tabs strong {
  color: var(--d-brand);
}

.stage3ar-device-tabs small {
  color: var(--d-text-soft);
  line-height: 1.35;
}

.stage3ar-flow-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.stage3ar-flow-line span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(204, 217, 209, .84);
  border-radius: 999px;
  background: rgba(246,251,249,.96);
  color: var(--d-text);
  font-size: 13px;
  font-weight: 800;
}

.stage3ar-flow-line b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #10231d;
  color: #fff;
  font-size: 12px;
}

.stage3ar-kit-card:hover,
.stage3ar-kit-card:focus-visible,
.stage3ar-device-tabs article:hover {
  border-color: rgba(11, 122, 75, .5);
  box-shadow: var(--d-focus);
}

.stage3as-concept-panel {
  border-color: rgba(11, 122, 75, .22);
  background:
    radial-gradient(circle at top right, rgba(10, 150, 94, .08), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,251,249,.94));
}

.stage3as-flow,
.stage3as-pill-grid,
.stage3as-tab-grid,
.stage3as-widget-grid,
.stage3as-starter-grid,
.stage3as-entity-grid {
  display: grid;
  gap: 10px;
}

.stage3as-flow {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stage3as-flow article,
.stage3as-pill-grid article,
.stage3as-tab-grid article,
.stage3as-widget-grid article,
.stage3as-starter-grid article,
.stage3as-entity-grid article {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(204, 217, 209, .86);
  border-radius: 16px;
  background: rgba(255,255,255,.9);
}

.stage3as-flow article {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.stage3as-flow article > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #10231d;
  color: #fff;
  font-weight: 900;
}

.stage3as-concept-panel strong {
  color: var(--d-text);
}

.stage3as-concept-panel small {
  color: var(--d-text-soft);
  line-height: 1.35;
}

.stage3as-tab-grid,
.stage3as-widget-grid,
.stage3as-starter-grid,
.stage3as-entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.dashboard-layout-drawer .stage3as-widget-library {
  margin-bottom: 14px;
}

.stage3au-popup-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(11, 122, 75, .24);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(233, 246, 239, .92), rgba(255,255,255,.96));
}

.stage3au-popup-cta strong,
.stage3au-preview-card strong,
.stage3au-coach-board strong {
  display: block;
  color: var(--d-text);
}

.stage3au-popup-cta span,
.stage3au-preview-card span,
.stage3au-coach-board small {
  color: var(--d-text-soft);
  line-height: 1.35;
}

.stage3au-modal-card.wide {
  width: min(860px, calc(100vw - 28px));
}

.stage3au-modal-body {
  display: grid;
  gap: 14px;
}

.stage3au-popup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stage3au-popup-grid label {
  display: grid;
  gap: 6px;
  font-weight: 850;
  color: var(--d-text);
}

.stage3au-popup-grid select,
.stage3au-popup-grid input,
.stage3au-popup-grid textarea,
.stage3au-advanced-details textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--d-border-strong);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  color: var(--d-text);
}

.stage3au-preview-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(11, 122, 75, .22);
  border-radius: 16px;
  background: rgba(233, 246, 239, .55);
}

.stage3au-step-strip,
.stage3au-coach-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.stage3au-step-strip span,
.stage3au-coach-board article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--d-border);
  border-radius: 14px;
  background: var(--d-surface-subtle);
}

.stage3au-step-strip b,
.stage3au-coach-board span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #10231d;
  color: #fff;
  font-weight: 900;
}

.stage3au-advanced-details {
  border: 1px dashed var(--d-border-strong);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.74);
}

.stage3au-advanced-details summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--d-text);
}

.environment-module-card span:not(.environment-module-icon) {
  grid-area: kicker;
  color: var(--d-brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.environment-module-card strong {
  grid-area: title;
  font-size: 17px;
}

.environment-module-card small {
  grid-area: body;
  color: var(--d-text-soft);
  line-height: 1.35;
}

.environment-step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.environment-step-list article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--d-border);
  border-radius: 16px;
  background: var(--d-surface-subtle);
}

.environment-step-list article > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #10231d;
  color: #fff;
  font-weight: 900;
}

.environment-sandbox-tools {
  margin-top: 16px;
}

@media (max-width: 760px) {
  .simulation-environment-banner,
  .environment-hero,
  .environment-launch-page {
    grid-template-columns: 1fr;
  }

  .simulation-environment-actions,
  .environment-hero-actions,
  .environment-top-switch {
    justify-content: stretch;
  }

  .simulation-environment-actions .btn,
  .environment-hero-actions .btn,
  .environment-mode-button,
  .environment-exit-button {
    flex: 1 1 auto;
  }

  .stage3aq-launcher,
  .stage3aq-palette-panel {
    border-radius: 16px;
    padding: 16px;
  }

  .stage3aq-workflow-strip,
  .stage3aq-widget-palette {
    grid-template-columns: 1fr;
  }

  .stage3aq-workflow-strip {
    display: none;
  }

  .stage3aq-widget-palette {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .stage3aq-widget-tile {
    flex: 0 0 min(260px, 82vw);
    scroll-snap-align: start;
  }

  .stage3aq-next-card {
    padding: 14px;
  }

  .stage3aq-launcher-copy p {
    max-width: none;
  }

  .stage3ar-practice-panel,
  .stage3ar-device-blueprint {
    padding: 14px;
    border-radius: 16px;
  }

  .stage3ar-kit-grid,
  .stage3ar-widget-groups,
  .stage3ar-device-tabs {
    grid-template-columns: 1fr;
  }

  .stage3ar-kit-card {
    min-height: 118px;
  }

  .stage3ar-widget-group .stage3aq-widget-palette {
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: visible;
    overscroll-behavior-x: auto;
    scroll-snap-type: none;
    padding-bottom: 0;
  }

  .stage3ar-widget-group .stage3aq-widget-tile {
    flex: initial;
    scroll-snap-align: none;
    width: 100%;
  }

  .stage3ar-flow-line {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .stage3ar-flow-line span {
    flex: 1 1 100%;
    border-radius: 14px;
  }

  .stage3as-concept-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .stage3as-flow,
  .stage3as-tab-grid,
  .stage3as-widget-grid,
  .stage3as-starter-grid,
  .stage3as-entity-grid {
    grid-template-columns: 1fr;
  }

  .stage3as-flow article,
  .stage3as-pill-grid article {
    min-width: 0;
  }
}

.stage3am-mode-ribbon,
.stage3am-next-action,
.stage3am-debrief-panel,
.stage3am-demo-guest-guide {
  border: 1px solid rgba(0, 145, 96, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(16, 33, 27, 0.08);
  margin-bottom: 16px;
}

.stage3am-mode-ribbon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-left: 6px solid var(--accent, #009160);
}

.stage3am-mode-ribbon.demo {
  border-color: rgba(0, 111, 145, 0.24);
  border-left-color: #0079a8;
  background: linear-gradient(135deg, rgba(0, 111, 145, 0.12), rgba(255, 255, 255, 0.94));
}

.stage3am-mode-ribbon.training {
  background: linear-gradient(135deg, rgba(0, 145, 96, 0.13), rgba(255, 255, 255, 0.94));
}

.stage3am-mode-mark {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 92px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(16, 33, 27, 0.08);
}

.stage3am-mode-mark span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent, #009160);
  color: #fff;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.stage3am-mode-ribbon.demo .stage3am-mode-mark span {
  background: #0079a8;
}

.stage3am-mode-mark strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stage3am-mode-copy h2 {
  margin: 4px 0 7px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.04;
}

.stage3am-mode-copy p:last-child {
  margin: 0;
  color: var(--muted, #52635d);
  max-width: 76ch;
}

.stage3am-mode-proof,
.stage3am-demo-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.stage3am-mode-proof span,
.stage3am-demo-rules span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 145, 96, 0.1);
  color: var(--accent, #007f54);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.stage3am-mode-ribbon.demo .stage3am-mode-proof span,
.stage3am-demo-rules span {
  background: rgba(0, 111, 145, 0.11);
  color: #006f91;
}

.stage3am-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(210px, 0.55fr) minmax(230px, 0.65fr);
  gap: 14px;
  padding: 16px;
  border-left: 6px solid var(--accent, #009160);
}

.stage3am-next-action.demo {
  border-left-color: #0079a8;
  border-color: rgba(0, 111, 145, 0.23);
}

.stage3am-next-action h3 {
  margin: 4px 0 7px;
  font-size: 22px;
}

.stage3am-next-action p {
  margin: 0;
  color: var(--muted, #52635d);
}

.stage3am-click-card,
.stage3am-pass-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(0, 145, 96, 0.18);
  border-radius: 15px;
  background: rgba(0, 145, 96, 0.06);
}

.stage3am-next-action.demo .stage3am-click-card,
.stage3am-next-action.demo .stage3am-pass-card {
  border-color: rgba(0, 111, 145, 0.2);
  background: rgba(0, 111, 145, 0.07);
}

.stage3am-click-card span,
.stage3am-pass-card span {
  color: var(--muted, #52635d);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stage3am-click-card strong,
.stage3am-pass-card strong {
  font-size: 16px;
  line-height: 1.25;
}

.stage3am-click-card .btn {
  margin-top: 4px;
  justify-self: start;
}

.stage3am-click-card small,
.stage3am-pass-card small {
  color: var(--muted, #52635d);
  line-height: 1.35;
}

.stage3am-debrief-panel {
  padding: 16px;
}

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

.stage3am-demo-guest-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-left: 6px solid #0079a8;
}

.stage3am-demo-guest-guide h3 {
  margin: 4px 0 7px;
}

.stage3am-demo-guest-guide p {
  margin: 0;
  color: var(--muted, #52635d);
}

.training-practice-station {
  position: relative;
  border-color: rgba(0, 145, 96, 0.28);
  box-shadow: 0 18px 40px rgba(0, 145, 96, 0.09);
}

.training-recommended-start {
  align-content: center;
  gap: 10px;
}

.mode-pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 145, 96, 0.11);
  color: #007f54;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.training-one-off-panel {
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.training-practice-station::before {
  content: "Start here";
  position: absolute;
  top: -11px;
  left: 18px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent, #009160);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-control-room {
  border-color: rgba(0, 111, 145, 0.28);
  background: linear-gradient(135deg, rgba(0, 111, 145, 0.11), rgba(255, 255, 255, 0.94));
}

.demo-story-board {
  border-color: rgba(0, 111, 145, 0.22);
}

@media (max-width: 980px) {
  .stage3am-mode-ribbon,
  .stage3am-next-action,
  .stage3am-demo-guest-guide,
  .stage3am-debrief-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .stage3am-mode-proof,
  .stage3am-demo-rules {
    justify-content: flex-start;
  }

  .stage3am-mode-mark {
    justify-items: start;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .stage3am-mode-ribbon,
  .stage3am-next-action,
  .stage3am-debrief-panel,
  .stage3am-demo-guest-guide {
    padding: 14px;
    border-radius: 15px;
  }

  .stage3am-mode-copy h2 {
    font-size: 25px;
  }
}

/* Stage3AX - Beaver-inspired easy UX layer: calm summaries first, technical depth second. */
.stage3ax-device-easy-board {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 14px;
  align-items: stretch;
  border-color: rgba(0, 145, 96, 0.22);
  background:
    radial-gradient(circle at top left, rgba(0, 145, 96, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 247, 0.92));
}

.stage3ax-easy-copy {
  display: grid;
  gap: 12px;
  align-content: start;
}

.stage3ax-easy-copy h3,
.stage3ax-next-action-card h3 {
  margin: 0;
}

.stage3ax-easy-copy p,
.stage3ax-next-action-card p,
.stage3ax-device-story p,
.stage3ax-easy-mode-panel p,
.stage3ax-safe-note {
  margin: 0;
  color: var(--muted, #50635b);
}

.stage3ax-device-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.stage3ax-device-status-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--border, #d4dfda);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
}

button.stage3ax-device-status-card {
  cursor: pointer;
}

.stage3ax-device-status-card:hover,
.stage3ax-device-status-card:focus-visible {
  border-color: var(--accent, #009160);
  box-shadow: 0 10px 24px rgba(0, 88, 58, 0.10);
}

.stage3ax-device-status-card .metric-value {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1;
  font-weight: 950;
  color: var(--text, #10211b);
}

.stage3ax-device-status-card small {
  color: var(--muted, #50635b);
}

.stage3ax-device-status-card.warn {
  border-color: rgba(198, 133, 0, 0.35);
  background: rgba(255, 248, 229, 0.88);
}

.stage3ax-device-status-card.watch {
  border-color: rgba(58, 102, 166, 0.28);
  background: rgba(236, 244, 255, 0.88);
}

.stage3ax-device-status-card.good {
  border-color: rgba(0, 145, 96, 0.22);
}

.stage3ax-next-action-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid rgba(0, 145, 96, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.stage3ax-next-action-card .compact-actions {
  margin-top: 2px;
}

.stage3ax-device-canvas {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) repeat(3, minmax(150px, 0.8fr));
  gap: 12px;
  margin: 14px 0;
}

.stage3ax-canvas-card {
  display: grid;
  gap: 7px;
  min-height: 110px;
  padding: 15px;
  border: 1px solid var(--border, #d4dfda);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.stage3ax-canvas-card span {
  color: var(--muted, #50635b);
  font-weight: 850;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stage3ax-canvas-card strong {
  font-size: clamp(1.15rem, 2.4vw, 1.85rem);
}

.stage3ax-canvas-card.primary-value {
  border-color: rgba(0, 145, 96, 0.28);
  background: linear-gradient(135deg, rgba(229, 248, 240, 0.94), rgba(255, 255, 255, 0.92));
}

.stage3ax-canvas-card.next {
  border-color: rgba(198, 133, 0, 0.28);
  background: rgba(255, 249, 232, 0.86);
}

.stage3ax-device-story {
  padding: 13px 15px;
  border: 1px solid rgba(0, 145, 96, 0.16);
  border-radius: 15px;
  background: rgba(244, 250, 247, 0.88);
}

.stage3ax-easy-device-modal {
  max-width: 760px;
}

.stage3ax-setup-steps,
.stage3ax-easy-mode-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(84px, 1fr));
  gap: 8px;
}

.stage3ax-setup-steps article,
.stage3ax-easy-mode-steps article {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border, #d4dfda);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted, #52645b);
}

.stage3ax-setup-steps article.active,
.stage3ax-easy-mode-steps article.active {
  border-color: rgba(0, 145, 96, 0.34);
  background: rgba(229, 248, 240, 0.88);
  color: var(--text, #10231b);
}

.stage3ax-setup-steps span,
.stage3ax-easy-mode-steps span {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent, #009160);
  color: white;
  font-weight: 950;
  line-height: 1;
}

.stage3ax-setup-steps strong,
.stage3ax-easy-mode-steps strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage3ax-easy-mode-steps {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.stage3ax-easy-mode-steps article {
  min-height: 104px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
}

.stage3ax-easy-mode-steps span {
  width: 28px;
  height: 28px;
}

.stage3ax-easy-mode-steps strong {
  overflow: visible;
  font-size: 0.88rem;
  line-height: 1.22;
  text-overflow: clip;
  white-space: normal;
}

.stage3ax-easy-mode-steps small {
  grid-column: 2;
  display: block;
  margin-top: 3px;
  color: var(--muted, #52645b);
  font-size: 0.78rem;
  line-height: 1.35;
}

.stage3ax-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stage3ax-popup-grid label {
  display: grid;
  gap: 6px;
  font-weight: 850;
}

.stage3ax-popup-grid label:last-child {
  grid-column: 1 / -1;
}

.stage3ax-safe-note {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(0, 145, 96, 0.18);
  border-radius: 14px;
  background: rgba(229, 248, 240, 0.68);
}

.stage3ax-easy-mode-panel {
  margin-top: 16px;
  border-color: rgba(0, 145, 96, 0.20);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 248, 0.92));
}

.stage3ax-easy-mode-panel.demo {
  border-color: rgba(0, 102, 170, 0.20);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 255, 0.92));
}

@media (max-width: 980px) {
  .stage3ax-device-easy-board,
  .stage3ax-device-canvas {
    grid-template-columns: 1fr;
  }

  .stage3ax-device-status-grid,
  .stage3ax-easy-mode-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage3ax-setup-steps {
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    gap: 6px;
  }

  .stage3ax-setup-steps article {
    padding: 8px 6px;
  }
}

@media (max-width: 620px) {
  .stage3ax-device-easy-board,
  .stage3ax-next-action-card,
  .stage3ax-canvas-card,
  .stage3ax-device-story,
  .stage3ax-easy-mode-panel,
  .stage3ax-safe-note {
    padding: 13px;
    border-radius: 13px;
  }

  .stage3ax-device-status-grid,
  .stage3ax-easy-mode-steps,
  .stage3ax-popup-grid {
    grid-template-columns: 1fr;
  }

  body[data-route="devices"] .stage3ax-device-easy-board,
  html[data-theme] body[data-route="devices"] .stage3ax-device-easy-board {
    gap: 12px;
  }

  body[data-route="devices"] .stage3ax-device-status-grid,
  html[data-theme] body[data-route="devices"] .stage3ax-device-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-route="devices"] .stage3ax-device-status-card,
  html[data-theme] body[data-route="devices"] .stage3ax-device-status-card {
    min-height: 0;
    padding: 10px;
    gap: 5px;
    border-radius: 8px;
  }

  body[data-route="devices"] .stage3ax-device-status-card .metric-value,
  html[data-theme] body[data-route="devices"] .stage3ax-device-status-card .metric-value {
    font-size: 22px;
  }

  body[data-route="devices"] .stage3ax-device-status-card .btn,
  body[data-route="devices"] .stage3ax-device-status-card button,
  html[data-theme] body[data-route="devices"] .stage3ax-device-status-card .btn,
  html[data-theme] body[data-route="devices"] .stage3ax-device-status-card button {
    min-height: 38px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .stage3ax-setup-steps {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

  .stage3ax-setup-steps article {
    justify-content: center;
    padding: 7px 4px;
  }

  .stage3ax-setup-steps strong {
    display: none;
  }
}

html[data-theme="dark"] {
  --d-canvas: #0c1210;
  --d-surface: #111a16;
  --d-surface-subtle: #15201b;
  --d-surface-strong: #1c2923;
  --d-border: #26372f;
  --d-border-strong: #34493f;
  --d-text: #f2f6f3;
  --d-text-soft: #b2c0b7;
  --d-text-faint: #8d9d94;
  --d-brand: #39c982;
  --d-brand-hover: #50d694;
  --d-brand-soft: rgba(57, 201, 130, .12);
  --d-info: #77a5ff;
  --d-info-soft: rgba(77, 128, 230, .14);
  --d-warning: #efc361;
  --d-warning-soft: rgba(224, 165, 38, .12);
  --d-danger: #ff8895;
  --d-danger-soft: rgba(211, 56, 76, .14);
  --d-shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
  --d-shadow: 0 14px 34px rgba(0, 0, 0, .26);
}

html,
body {
  background: var(--d-canvas);
  color: var(--d-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--d-focus);
}

/* Modern application shell */
.app-shell,
html[data-theme] .app-shell {
  display: grid;
  grid-template-columns: var(--d-sidebar) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--d-canvas);
}

.app-shell.hidden {
  display: none;
}

.console-left,
html[data-theme] .console-left {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 45;
  width: var(--d-sidebar);
  height: 100dvh;
  display: block;
  background: var(--d-surface);
  border-right: 1px solid var(--d-border);
  overflow: hidden;
}

.console-left-body,
html[data-theme] .console-left-body {
  display: block;
  width: 100%;
  height: 100%;
}

.sidebar,
html[data-theme] .sidebar {
  position: static;
  width: 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  background: transparent;
  border: 0;
  overflow: hidden;
}

.sidebar-brand,
html[data-theme] .sidebar-brand {
  min-height: 48px;
  display: flex !important;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 12px;
  color: var(--d-text);
}

.sidebar-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.sidebar-brand div {
  min-width: 0;
  display: grid;
  gap: 0;
}

.sidebar-brand strong {
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.sidebar-brand span {
  color: var(--d-text-faint);
  font-size: 11px;
  font-weight: 600;
}

.site-context-selector,
html[data-theme] .site-context-selector {
  position: static;
  width: auto;
  min-width: 0;
  height: auto;
  margin: 4px 0 14px;
  padding: 0;
  background: transparent;
  border: 0;
}

.site-context-button,
html[data-theme] .site-context-button {
  min-height: 52px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface-subtle);
  color: var(--d-text);
  box-shadow: none;
}

.site-context-button:hover {
  border-color: var(--d-border-strong);
  background: var(--d-surface-strong);
}

.module-pane,
html[data-theme] .module-pane {
  display: none !important;
}

.main-nav,
html[data-theme] .main-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  padding: 0 2px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group,
html[data-theme] .nav-group {
  display: grid;
  gap: 3px;
  margin: 0 0 16px;
}

.nav-group + .nav-group {
  padding-top: 13px;
  border-top: 1px solid var(--d-border);
}

.nav-group-label {
  margin: 0;
  padding: 0 10px 6px;
  color: var(--d-text-faint);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.main-nav .nav-btn,
html[data-theme] .main-nav .nav-btn {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 42px;
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) auto !important;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--d-text-soft);
  text-align: left;
  box-shadow: none;
}

.main-nav .nav-btn:hover,
html[data-theme] .main-nav .nav-btn:hover {
  background: var(--d-surface-strong);
  color: var(--d-text);
}

.main-nav .nav-btn.active,
html[data-theme] .main-nav .nav-btn.active {
  background: var(--d-brand-soft);
  color: var(--d-brand);
  box-shadow: inset 3px 0 0 var(--d-brand);
}

.main-nav .nav-btn.environment-mode-on,
html[data-theme] .main-nav .nav-btn.environment-mode-on {
  grid-template-columns: 22px minmax(0, 1fr) auto auto !important;
  background: color-mix(in srgb, var(--d-brand-soft) 78%, #fff);
  color: var(--d-brand);
  box-shadow: inset 3px 0 0 var(--d-brand);
}

body[data-environment-mode="demo"] .main-nav .nav-btn.environment-mode-on,
html[data-theme] body[data-environment-mode="demo"] .main-nav .nav-btn.environment-mode-on {
  background: color-mix(in srgb, #e8f7fb 78%, #fff);
  color: #0079a8;
  box-shadow: inset 3px 0 0 #0079a8;
}

.main-nav .nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.main-nav .rail-svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.main-nav .nav-label,
html[data-theme] .main-nav .nav-label {
  display: block !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  clip: auto !important;
  clip-path: none !important;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav .nav-count {
  min-width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--d-surface-strong);
  color: var(--d-text-soft);
  font-size: 10px;
  font-weight: 750;
}

.main-nav .nav-mode-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.main-nav .nav-btn.active .nav-count {
  background: var(--d-surface);
  color: var(--d-brand);
}

.workspace,
html[data-theme] .workspace,
.app-shell.secondary-collapsed .workspace,
.app-shell.inspector-open .workspace {
  grid-column: 2;
  width: auto;
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: block;
  background: var(--d-canvas);
  overflow: visible;
}

.topbar,
html[data-theme] .topbar,
.app-shell.inspector-open .topbar {
  position: sticky;
  inset: 0 0 auto;
  z-index: 35;
  min-height: var(--d-topbar);
  height: var(--d-topbar);
  display: grid;
  grid-template-columns: minmax(220px, 580px) 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--d-surface) 94%, transparent);
  border: 0;
  border-bottom: 1px solid var(--d-border);
  backdrop-filter: blur(14px);
  box-shadow: none;
}

.top-search,
html[data-theme] .top-search {
  position: relative;
  width: 100%;
  max-width: 580px;
  display: block;
}

.top-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top-search input,
html[data-theme] .top-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--d-border);
  border-radius: 10px;
  background:
    linear-gradient(transparent, transparent),
    var(--d-surface-subtle);
  color: var(--d-text);
  box-shadow: none;
}

.top-search-icon {
  position: absolute;
  z-index: 1;
  left: 14px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: var(--d-text-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.top-search-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-brand {
  display: none;
}

.top-actions,
html[data-theme] .top-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-role-actions:empty {
  display: none;
}

.client-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 8px 5px 11px;
  border: 1px solid var(--d-border);
  border-radius: 999px;
  background: var(--d-surface);
  color: var(--d-text-soft);
  font-size: 11px;
  font-weight: 700;
}

.client-view-toggle strong {
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--d-surface-subtle);
  color: var(--d-text-faint);
  text-align: center;
}

.client-view-toggle.active {
  border-color: var(--d-brand);
  background: var(--d-brand-soft);
  color: var(--d-brand);
}

.client-view-toggle.active strong {
  background: var(--d-brand);
  color: white;
}

.api-status,
html[data-theme] .api-status {
  padding: 7px 11px;
  border: 1px solid rgba(0, 145, 96, .28);
  border-radius: 999px;
  background: #eefaf4;
  color: #006b48;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.api-status.online,
html[data-theme] .api-status.online {
  background: #e8f8f1;
  border-color: rgba(0, 145, 96, .38);
  color: #006b48;
}

.api-status.offline,
html[data-theme] .api-status.offline {
  background: #fff4e0;
  border-color: rgba(176, 116, 0, .32);
  color: #8a5200;
}

.user-switch-button,
html[data-theme] .user-switch-button,
.user-chip,
html[data-theme] .user-chip,
.top-actions > .icon-btn,
html[data-theme] .top-actions > .icon-btn {
  min-height: 38px;
  border: 1px solid var(--d-border);
  border-radius: 9px;
  background: var(--d-surface);
  color: var(--d-text);
  box-shadow: none;
}

.user-switch-button {
  max-width: 240px;
  padding: 6px 11px;
}

.user-switch-button > span {
  display: none;
}

.user-switch-button strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip {
  width: 38px;
  min-width: 38px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0 !important;
}

.user-chip::before {
  content: attr(data-initials);
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--d-brand);
  font-size: 11px;
  font-weight: 800;
}

.top-actions > .icon-btn {
  display: none !important;
}

.top-actions > .icon-btn span {
  font-size: 0;
}

.top-actions > .icon-btn span::before {
  content: "↗";
  font-size: 15px;
}

/* Page composition */
.workspace-head,
html[data-theme] .workspace-head {
  max-width: 1600px;
  margin: 0 auto;
  padding: 34px 40px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  background: transparent;
  border: 0;
}

.workspace-head .eyebrow,
.panel-head .eyebrow {
  margin: 0 0 6px;
  color: var(--d-brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.workspace-head h2 {
  margin: 0;
  color: var(--d-text);
  font-size: clamp(26px, 2.3vw, 34px);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: -.035em;
}

.workspace-head > div > p:last-child {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--d-text-soft);
  font-size: 14px;
}

.workspace-actions,
html[data-theme] .workspace-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.subnav,
html[data-theme] .subnav {
  position: static;
  max-width: calc(1600px - 80px);
  min-height: 0;
  margin: 0 auto 20px;
  padding: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  background: transparent;
  border: 0;
}

.subnav:empty {
  display: none;
}

.subnav-btn,
html[data-theme] .subnav-btn {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--d-text-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.subnav-btn:hover {
  background: var(--d-surface-strong);
  color: var(--d-text);
}

.subnav-btn.active,
html[data-theme] .subnav-btn.active {
  background: var(--d-surface);
  color: var(--d-brand);
  box-shadow: var(--d-shadow-sm), inset 0 0 0 1px var(--d-border);
}

.workspace-content,
html[data-theme] .workspace-content {
  width: auto;
  max-width: 1600px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 40px 72px;
  display: grid;
  gap: 18px;
  background: transparent;
  overflow: visible;
}

/* Buttons and fields */
.btn,
html[data-theme] .btn {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--d-border);
  border-radius: 9px;
  background: var(--d-surface);
  color: var(--d-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: var(--d-shadow-sm);
}

.btn:hover:not(:disabled) {
  border-color: var(--d-border-strong);
  background: var(--d-surface-strong);
  transform: none;
}

.btn.primary,
html[data-theme] .btn.primary {
  border-color: var(--d-brand);
  background: var(--d-brand);
  color: #fff;
  box-shadow: 0 2px 7px rgba(11, 122, 75, .18);
}

html[data-theme="dark"] .btn.primary {
  color: #07110c;
}

.btn.primary:hover:not(:disabled) {
  border-color: var(--d-brand-hover);
  background: var(--d-brand-hover);
}

.btn.secondary,
html[data-theme] .btn.secondary {
  border-color: var(--d-border);
  background: var(--d-surface);
  color: var(--d-text);
}

.btn.small {
  min-height: 34px;
  padding: 7px 11px;
}

input,
select,
textarea,
html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea {
  border: 1px solid var(--d-border);
  border-radius: 9px;
  background: var(--d-surface);
  color: var(--d-text);
  box-shadow: none;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--d-border-strong);
}

input::placeholder,
textarea::placeholder {
  color: var(--d-text-faint);
}

/* Calm surfaces */
.panel,
html[data-theme] .panel,
.role-dashboard-section,
.platform-card,
.dashboard-widget-shell,
.access-capability-panel,
.support-sla-note,
.console-strip,
.metric-strip {
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-lg);
  background: var(--d-surface);
  color: var(--d-text);
  box-shadow: var(--d-shadow-sm);
}

.panel,
html[data-theme] .panel {
  padding: 20px;
}

.panel-head,
html[data-theme] .panel-head {
  gap: 20px;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
}

.panel-head h3,
.panel h3,
.role-dashboard-section h3 {
  margin: 0;
  color: var(--d-text);
  font-size: 17px;
  font-weight: 730;
  line-height: 1.3;
  letter-spacing: -.015em;
}

.panel-head p,
.panel p,
.subtle,
html[data-theme] .subtle {
  color: var(--d-text-soft);
}

.status-badge,
.badge,
html[data-theme] .status-badge {
  border: 0;
  border-radius: 999px;
  background: var(--d-surface-strong);
  color: var(--d-text-soft);
  font-size: 10px;
  font-weight: 750;
}

.local-status-strip,
html[data-theme] .local-status-strip {
  max-width: 1520px;
  min-height: 38px;
  margin: 0 auto 18px;
  padding: 9px 14px;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface-subtle);
  color: var(--d-text-soft);
  box-shadow: none;
}

.stage2ca-route-cleanup-strip,
.stage2ca-console-shell,
[data-stage2ca="route-cleanup"] {
  display: none !important;
}

.dashboard-widget-grid,
.metric-grid,
.platform-grid,
.role-dashboard-grid {
  gap: 14px;
}

.dashboard-widget-card,
.metric,
.platform-stat,
.status-line,
.report-row,
.queue-card,
.work-card {
  border-color: var(--d-border);
  background: var(--d-surface-subtle);
  box-shadow: none;
}

.dashboard-widget-card:hover,
.report-row:hover,
.queue-card:hover {
  border-color: var(--d-border-strong);
  background: var(--d-surface-strong);
}

/* Tables become readable working surfaces */
.table-wrap,
.device-table-wrap,
html[data-theme] .table-wrap {
  width: 100%;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface);
  overflow: auto;
  box-shadow: none;
}

.ops-table,
html[data-theme] .ops-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--d-text);
}

.ops-table th,
html[data-theme] .ops-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  border-bottom: 1px solid var(--d-border);
  background: var(--d-surface-subtle);
  color: var(--d-text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ops-table td,
html[data-theme] .ops-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--d-border);
  background: var(--d-surface);
  color: var(--d-text);
  vertical-align: middle;
}

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

.ops-table tbody tr:hover td {
  background: var(--d-surface-subtle);
}

/* Device page */
.stage2ca-device-shell,
.stage2ca-device-shell.panel {
  padding: 0;
  overflow: hidden;
}

.stage2ca-device-shell .panel-head {
  padding: 20px 20px 0;
}

.stage2ca-device-shell .stage2ca-count-strip {
  margin: 0 20px 16px;
}

.device-filter-strip,
.device-filter-tabs {
  padding: 8px;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface);
}

/* Identity management */
.identity-governance-panel {
  overflow: hidden;
}

.identity-user-table,
html[data-theme] .identity-user-table {
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface);
  overflow: hidden;
}

.identity-user-table .access-user-header,
html[data-theme] .identity-user-table .access-user-header {
  padding: 10px 14px;
  background: var(--d-surface-subtle);
  color: var(--d-text-faint);
  border-bottom: 1px solid var(--d-border);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.identity-user-table .identity-user-row,
html body .identity-user-table .identity-user-row {
  min-height: 72px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--d-border);
  background: var(--d-surface);
}

.identity-user-table .identity-user-row:last-child {
  border-bottom: 0;
}

.identity-user-table .identity-user-row:hover {
  background: var(--d-surface-subtle);
}

.identity-person {
  display: grid;
  gap: 2px;
}

.identity-person strong {
  color: var(--d-text);
  font-size: 13px;
}

.identity-person small {
  color: var(--d-text-soft);
}

.identity-job,
.identity-phone {
  color: var(--d-text-faint) !important;
  font-size: 10px;
}

.advanced-permissions,
html[data-theme] .advanced-permissions {
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface-subtle);
}

.advanced-permissions summary {
  min-height: 44px;
  padding: 12px 14px;
  color: var(--d-text);
  font-weight: 700;
}

.employee-access-steps,
.employee-preset-grid,
.scope-choice-grid {
  display: grid;
  gap: 10px;
}

.employee-access-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.employee-access-steps article,
.employee-preset-grid article,
.scope-choice {
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface);
}

.employee-access-steps article {
  display: flex;
  gap: 10px;
  padding: 13px;
}

.employee-access-steps article > span {
  display: grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--d-brand-soft);
  color: var(--d-brand);
  font-weight: 800;
}

.employee-access-steps p,
.employee-preset-grid p {
  margin: 4px 0 0;
  color: var(--d-text-soft);
  font-size: 12px;
}

.employee-preset-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.employee-preset-grid article {
  padding: 13px;
}

.access-editor-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--d-border);
}

.access-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.access-editor-heading > div {
  display: grid;
  gap: 3px;
}

.access-editor-heading span {
  color: var(--d-text-soft);
  font-size: 12px;
}

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

.scope-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 58px;
  padding: 11px;
  cursor: pointer;
}

.scope-choice:has(input:checked) {
  border-color: var(--d-brand);
  background: var(--d-brand-soft);
}

.scope-choice input {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--d-brand);
}

.scope-choice span {
  display: grid;
  gap: 2px;
}

.scope-choice small {
  color: var(--d-text-soft);
}

.client-view-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--d-brand);
  border-radius: var(--d-radius);
  background: var(--d-brand-soft);
  color: var(--d-text);
}

.client-view-preview-banner > div:first-child {
  display: grid;
  gap: 3px;
}

.client-view-preview-banner .eyebrow {
  margin: 0;
}

.client-view-preview-banner span {
  color: var(--d-text-soft);
  font-size: 12px;
}

.client-view-preview-controls {
  display: flex;
  align-items: end;
  gap: 8px;
}

.client-view-preview-controls label {
  display: grid;
  gap: 3px;
  min-width: 150px;
  color: var(--d-text-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-view-preview-controls select {
  min-height: 38px;
  border: 1px solid var(--d-border);
  border-radius: 8px;
  background: var(--d-surface);
  color: var(--d-text);
}

.client-view-preview-controls .btn {
  min-width: 80px;
  white-space: nowrap;
}

.stage3av-client-view-banner {
  border-width: 1.5px;
  box-shadow: 0 10px 28px rgba(0, 137, 90, 0.08);
}

.stage3av-client-view-banner strong {
  font-size: 15px;
}

.stage3av-device-open-row {
  cursor: pointer;
}

.stage3av-device-open-row:focus-visible,
.stage3av-device-open-row:hover {
  outline: 2px solid color-mix(in srgb, var(--d-brand) 36%, transparent);
  outline-offset: -2px;
  background: var(--d-brand-soft);
}

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

.client-device-workspace .sensor-value-mini.large {
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--d-border);
  border-radius: 12px;
  background: var(--d-canvas);
}

.integron-device-graphics {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--d-brand) 22%, var(--d-border));
  background: linear-gradient(180deg, var(--d-surface), var(--d-canvas));
}

.integron-device-visual-strip {
  margin: 10px 0 14px;
}

.integron-device-graphics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.integron-device-chart {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--d-border);
  border-radius: 14px;
  background: var(--d-canvas);
}

.integron-device-chart .sensor-chart-wrap {
  min-width: 0;
  overflow-x: hidden;
}

.sensor-device-inline-graphs {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.sensor-device-inline-graph {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--d-border);
  border-radius: 8px;
  background: var(--d-surface);
}

.sensor-device-inline-graph-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.sensor-device-inline-graph-head h4 {
  margin: 0;
  color: var(--d-text);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.sensor-device-inline-graph-head p {
  margin: 3px 0 0;
  color: var(--d-text-soft);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sensor-device-inline-graph-head strong {
  flex: 0 0 auto;
  max-width: 42%;
  color: var(--d-text);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 950;
  text-align: right;
  overflow-wrap: anywhere;
}

.sensor-device-inline-graph .sensor-chart-wrap {
  min-width: 0;
  overflow-x: hidden;
}

.sensor-device-inline-graph .sensor-history-chart:not(.compact) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
}

.integron-device-chart .sensor-history-chart:not(.compact) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
}

.integron-device-visual-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: start;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--d-border);
  border-radius: 14px;
  background: var(--d-surface);
}

.integron-device-visual-status .compact-actions {
  justify-content: flex-end;
}

.integron-device-visual-status .compact-actions .btn {
  flex: 1 1 120px;
}

@media (max-width: 980px) {
  .integron-device-graphics-grid {
    grid-template-columns: 1fr;
  }

  .integron-device-chart .sensor-history-chart:not(.compact) {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .integron-device-chart {
    padding: 8px;
  }

  .sensor-device-inline-graph-head {
    display: grid;
    gap: 4px;
  }

  .sensor-device-inline-graph-head strong {
    max-width: 100%;
    text-align: left;
  }

  .sensor-device-inline-graph .sensor-history-chart:not(.compact) {
    min-width: 0;
  }

  .integron-device-chart .sensor-history-chart:not(.compact) {
    min-width: 0;
  }

  .integron-device-visual-status {
    grid-template-columns: 1fr;
  }

  .integron-device-visual-status .compact-actions {
    justify-content: stretch;
  }
}

/* Remote operations */
.operations-tab-strip {
  padding: 5px;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface);
}

.operations-tab-strip button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--d-text-soft);
}

.operations-tab-strip button.active {
  background: var(--d-brand-soft);
  color: var(--d-brand);
}

/* Stage 3S: Integron-native guided adoption and shared task center */
.adoption-step-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 18px;
}

.adoption-step-grid > * {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--d-border);
  border-radius: 10px;
  background: var(--d-canvas);
  color: var(--d-text-soft);
  font-size: 12px;
  line-height: 1.35;
}

.adoption-step-grid > *.active {
  border-color: var(--d-brand);
  background: var(--d-brand-soft);
  color: var(--d-brand);
}

.adoption-step-grid b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  border-radius: 999px;
  background: var(--d-surface);
  color: inherit;
}

.setup-center-checklist {
  margin-bottom: 14px;
}

.setup-center-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.setup-center-steps .flow-step {
  min-height: 96px;
  border-color: color-mix(in srgb, var(--d-brand) 28%, var(--d-border));
  background: linear-gradient(180deg, var(--d-surface), var(--d-canvas));
}

.adoption-modal-card {
  width: min(840px, calc(100vw - 32px));
}

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

.adoption-check-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.adoption-check-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--d-border);
  border-radius: 9px;
  font-size: 12px;
}

.adoption-check-list li.pass {
  border-color: var(--d-brand);
  color: var(--d-brand);
}

.adoption-check-list li.fail {
  border-color: var(--d-danger, #b42318);
  color: var(--d-danger, #b42318);
}

.support-sla-note.success {
  border-color: var(--d-brand);
  background: var(--d-brand-soft);
}

.adoption-primary-panel .workbench-chrome-actions {
  flex: 0 0 auto;
}

.adoption-primary-panel .workbench-chrome-actions .btn {
  min-width: 92px;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}

/* Drawers, modals, toasts */
.detail-drawer,
html[data-theme] .detail-drawer {
  width: min(520px, 100vw);
  border-left: 1px solid var(--d-border);
  background: var(--d-surface);
  color: var(--d-text);
  box-shadow: var(--d-shadow);
}

.drawer-scrim,
.modal-layer {
  background: rgba(17, 28, 22, .42);
  backdrop-filter: blur(3px);
}

.modal-card,
html[data-theme] .modal-card {
  width: min(620px, calc(100vw - 32px));
  max-height: min(860px, calc(100dvh - 32px));
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: var(--d-surface);
  color: var(--d-text);
  box-shadow: 0 24px 80px rgba(16, 39, 27, .22);
}

.modal-head,
.modal-actions {
  border-color: var(--d-border);
  background: var(--d-surface);
}

.modal-head,
html[data-theme] .modal-head {
  align-items: flex-start;
}

.modal-head > .icon-btn,
html[data-theme] .modal-head > .icon-btn {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-self: flex-start;
}

.toast,
html[data-theme] .toast {
  top: 58px;
  left: 50%;
  right: auto;
  bottom: auto;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-text);
  color: var(--d-surface);
  box-shadow: var(--d-shadow);
  max-width: min(360px, calc(100vw - 36px));
  font-size: 13px;
  line-height: 1.35;
  transform: translate(-50%, -8px);
}

.toast.show,
html[data-theme] .toast.show {
  transform: translate(-50%, 0);
}

.workspace > .toast.in-workspace,
html[data-theme] .workspace > .toast.in-workspace {
  position: sticky;
  top: 8px;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 12;
  width: fit-content;
  max-width: min(560px, calc(100% - 32px));
  margin: 0 auto 10px;
  padding: 10px 13px;
  transform: translateY(-6px);
}

.workspace > .toast.in-workspace.show,
html[data-theme] .workspace > .toast.in-workspace.show {
  transform: translateY(0);
}

@media (max-width: 720px) {
  .toast,
  html[data-theme] .toast {
    top: auto;
    right: 16px;
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    max-width: none;
    transform: translateY(8px);
  }

  .toast.show,
  html[data-theme] .toast.show {
    transform: translateY(0);
  }

  .workspace > .toast.in-workspace,
  html[data-theme] .workspace > .toast.in-workspace {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    max-width: none;
    margin: 0 24px 12px;
    transform: none;
  }

  .workspace > .toast.in-workspace.show,
  html[data-theme] .workspace > .toast.in-workspace.show {
    transform: none;
  }

  body[data-stage3ei="visual-matrix-hardening"] .page-tabs,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .page-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
    overflow-x: visible;
    flex-wrap: wrap;
  }

  body[data-stage3ei="visual-matrix-hardening"] .page-tabs button,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .page-tabs button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
}

/* Login stays focused and brand-forward */
.login-screen,
html[data-theme] .login-screen {
  background:
    radial-gradient(circle at 18% 15%, rgba(15, 140, 86, .12), transparent 34%),
    radial-gradient(circle at 82% 85%, rgba(40, 104, 215, .08), transparent 32%),
    var(--d-canvas);
}

.login-panel,
html[data-theme] .login-panel {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid var(--d-border);
  border-radius: 20px;
  background: var(--d-surface);
  box-shadow: var(--d-shadow);
}

.login-panel .brand-lockup,
html[data-theme] .login-panel .brand-lockup {
  display: grid;
  grid-template-columns: minmax(118px, 188px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.login-copy,
html[data-theme] .login-copy {
  min-width: 0;
  max-width: 100%;
}

.login-panel h1,
html[data-theme] .login-panel h1 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.login-brand-word-stack.brand-assets-ready .login-brand-fallback,
html[data-theme] .login-brand-word-stack.brand-assets-ready .login-brand-fallback {
  display: none;
}

@media (max-width: 560px) {
  .login-panel .brand-lockup,
  html[data-theme] .login-panel .brand-lockup {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 12px;
  }

  .login-brand-asset,
  html[data-theme] .login-brand-asset {
    min-width: 0;
    width: 100%;
  }

  .login-panel h1,
  html[data-theme] .login-panel h1 {
    font-size: 30px;
    line-height: 1.08;
  }
}

@media (max-width: 360px) {
  .login-panel,
  html[data-theme] .login-panel {
    padding: 20px;
  }

  .login-brand-icon,
  html[data-theme] .login-brand-icon {
    width: 54px;
    height: 58px;
  }

  .login-brand-asset .brand-logo-real,
  .login-brand-word-stack,
  html[data-theme] .login-brand-asset .brand-logo-real,
  html[data-theme] .login-brand-word-stack {
    width: 136px;
  }

  .login-panel h1,
  html[data-theme] .login-panel h1 {
    font-size: 26px;
  }
}

/* Tablet */
@media (max-width: 1120px) {
  :root {
    --d-sidebar: 240px;
  }

  .topbar,
  html[data-theme] .topbar {
    padding-inline: 24px;
  }

  .workspace-head,
  html[data-theme] .workspace-head,
  .workspace-content,
  html[data-theme] .workspace-content {
    padding-left: 28px;
    padding-right: 28px;
  }

  .subnav,
  html[data-theme] .subnav {
    max-width: calc(100% - 56px);
  }

  .user-switch-button {
    max-width: 180px;
  }
}

/* Stage 3AI: final readable runtime badge override. The legacy base stylesheet
 * still contains older pale topbar badge rules, so keep this late and explicit. */
body .api-status,
html[data-theme] body .api-status,
body[data-stage2ca="console-shell-cleanup"] .api-status,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .api-status {
  padding: 7px 11px !important;
  border: 1px solid rgba(0, 145, 96, .38) !important;
  border-radius: 999px !important;
  background: #e8f8f1 !important;
  color: #006b48 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  white-space: nowrap !important;
}

body .api-status.offline,
html[data-theme] body .api-status.offline,
body[data-stage2ca="console-shell-cleanup"] .api-status.offline,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .api-status.offline {
  border-color: rgba(176, 116, 0, .34) !important;
  background: #fff4e0 !important;
  color: #8a5200 !important;
}

/* Mobile and narrow tablet: genuinely recomposed, not compressed desktop */
@media (max-width: 1024px) {
  :root {
    --d-sidebar: 0px;
    --d-topbar: 58px;
  }

  .app-shell,
  html[data-theme] .app-shell {
    display: block;
    padding-bottom: 70px;
  }

  .console-left,
  html[data-theme] .console-left {
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    width: 100%;
    height: 64px;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--d-border);
    background: color-mix(in srgb, var(--d-surface) 96%, transparent);
    backdrop-filter: blur(16px);
  }

  .console-left-body,
  .sidebar {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: visible;
  }

  .sidebar-brand,
  .site-context-selector,
  .nav-group-label,
  .nav-group + .nav-group {
    display: none !important;
  }

  html[data-theme] .sidebar-brand,
  html[data-theme] .site-context-selector {
    display: none !important;
  }

  .main-nav,
  html[data-theme] .main-nav {
    width: 100%;
    height: 100%;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    overflow: hidden;
  }

  .nav-group,
  html[data-theme] .nav-group {
    display: contents;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .main-nav .nav-btn,
  html[data-theme] .main-nav .nav-btn {
    width: 62px;
    min-width: 54px;
    min-height: 52px;
    display: none !important;
    grid-template-columns: 1fr;
    grid-template-rows: 24px 13px;
    place-items: center;
    gap: 2px;
    padding: 5px 3px;
    border-radius: 10px;
    text-align: center;
    box-shadow: none;
  }

  .main-nav .nav-btn.mobile-window,
  html[data-theme] .main-nav .nav-btn.mobile-window {
    display: grid !important;
  }

  .main-nav .nav-btn.active,
  html[data-theme] .main-nav .nav-btn.active {
    background: var(--d-brand-soft);
    box-shadow: none;
  }

  .main-nav .nav-label,
  html[data-theme] .main-nav .nav-label {
    display: block;
    max-width: 58px;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
  }

  .main-nav .nav-count {
    position: absolute;
    transform: translate(14px, -9px);
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--d-brand);
    color: #fff;
    font-size: 9px;
  }

  .workspace,
  html[data-theme] .workspace,
  .app-shell.secondary-collapsed .workspace,
  .app-shell.inspector-open .workspace {
    width: 100%;
    min-height: calc(100dvh - 64px);
  }

  .topbar,
  html[data-theme] .topbar,
  .app-shell.inspector-open .topbar {
    width: 100%;
    height: auto;
    min-height: var(--d-topbar);
    grid-template-columns: minmax(0, 1fr) 40px !important;
    gap: 8px;
    padding: 9px 18px;
  }

  .top-search,
  html[data-theme] .top-search {
    max-width: none;
  }

  .top-search input,
  html[data-theme] .top-search input {
    height: 40px;
    padding-left: 42px;
    font-size: 12px;
  }

  .api-status,
  .user-switcher,
  .top-actions > .icon-btn {
    display: none !important;
  }

  .top-actions {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .user-chip {
    display: block !important;
    width: 38px !important;
    min-width: 38px !important;
  }

  .workspace-head,
  html[data-theme] .workspace-head {
    padding: 24px 18px 14px;
    display: grid;
    gap: 16px;
  }

  .workspace-head h2 {
    font-size: 26px;
  }

  .workspace-head > div > p:last-child {
    font-size: 13px;
  }

  .workspace-actions,
  html[data-theme] .workspace-actions {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .workspace-actions .btn {
    width: auto;
  }

  .workspace-actions .btn.primary {
    flex: 1 1 180px;
  }

  .subnav,
  html[data-theme] .subnav {
    max-width: none;
    margin: 0 18px 16px;
  }

  .workspace-content,
  html[data-theme] .workspace-content {
    padding: 0 18px 36px;
    gap: 14px;
  }

  .local-status-strip,
  html[data-theme] .local-status-strip {
    margin: 0 0 14px;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
  }

  .panel,
  html[data-theme] .panel {
    padding: 16px;
    border-radius: 14px;
  }

  .panel-head,
  html[data-theme] .panel-head {
    display: grid;
    gap: 10px;
  }

  .quick-filter-bar,
  html[data-theme] .quick-filter-bar {
    display: block !important;
    padding: 10px !important;
    overflow: hidden !important;
  }

  .quick-filter-label {
    width: auto !important;
    padding: 0 2px 8px;
  }

  .quick-filter-buttons,
  html[data-theme] .quick-filter-buttons {
    width: 100% !important;
    display: flex !important;
    grid-template-columns: none !important;
    gap: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
  }

  .quick-filter,
  html[data-theme] .quick-filter {
    width: auto !important;
    min-width: max-content !important;
    flex: 0 0 auto !important;
    padding: 8px 10px !important;
  }

  .identity-user-table,
  html[data-theme] .identity-user-table {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .identity-user-table .access-user-header {
    display: none;
  }

  html body .identity-user-table .identity-user-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 14px;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-surface-subtle);
  }

  .identity-user-table .identity-user-row > span {
    min-width: 0;
  }

  .identity-user-table .identity-person {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--d-border);
  }

  .identity-user-table .identity-action {
    grid-column: 1 / -1;
  }

  .identity-user-table .identity-action .btn {
    width: 100%;
  }

  .table-wrap,
  .device-table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .device-table-wrap .ops-table,
  .device-table-wrap .ops-table tbody,
  .device-table-wrap .ops-table tr,
  .device-table-wrap .ops-table td {
    display: block;
    width: 100%;
  }

  .device-table-wrap .ops-table thead {
    display: none;
  }

  .device-table-wrap .ops-table tr {
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-surface);
  }

  .device-table-wrap .ops-table td {
    padding: 6px 0;
    border: 0;
    background: transparent;
  }

  .device-table-wrap .ops-table td:last-child {
    padding-top: 12px;
  }

  .device-table-wrap .ops-table td:last-child .btn {
    width: 100%;
  }

  .modal-layer {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card,
  html[data-theme] .modal-card {
    width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .detail-drawer,
  html[data-theme] .detail-drawer {
    width: 100%;
  }
}

/* Stage 3P: native form controls must follow the selected application theme.
 * The legacy base intentionally defaulted to a dark color scheme, which caused
 * Windows/Chromium option popups to remain black after switching to light mode. */
html[data-theme="light"] select,
html[data-theme="light"] optgroup,
html[data-theme="light"] option {
  color-scheme: light !important;
  background-color: #ffffff !important;
  color: #12201a !important;
}

select option,
select optgroup {
  background-color: var(--d-surface, #ffffff);
  color: var(--d-text, #12201a);
}

html[data-theme="dark"] select,
html[data-theme="dark"] optgroup,
html[data-theme="dark"] option {
  color-scheme: dark !important;
  background-color: #101719 !important;
  color: #f6f4ec !important;
}

.workflow-client-destination {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid var(--d-border);
  border-radius: 11px;
  background: var(--d-green-soft);
}

.workflow-client-destination span {
  color: var(--d-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.workflow-client-destination strong {
  color: var(--d-text);
  font-size: 14px;
}

.workflow-client-destination small,
.client-safe-workflow .workflow-side-panel p {
  color: var(--d-text-muted);
  line-height: 1.5;
}

.client-safe-workflow .workflow-context-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 860px) {
  .client-safe-workflow .workflow-context-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .workspace-head,
  html[data-theme] .workspace-head {
    padding-inline: 14px;
  }

  .workspace-content,
  html[data-theme] .workspace-content {
    padding-inline: 14px;
  }

  .subnav,
  html[data-theme] .subnav {
    margin-left: 14px;
    margin-right: 14px;
  }

  .main-nav .nav-btn {
    width: 56px;
  }

  .identity-user-table .identity-user-row {
    grid-template-columns: 1fr !important;
  }

  .identity-user-table .identity-user-row > span {
    grid-column: 1 / -1;
  }
}

/* Stage 3F: production Google Maps canvas and branded operational overlays. */
.google-map-shell {
  min-height: 680px;
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 26%, rgba(8, 151, 96, .12), transparent 34%),
    linear-gradient(135deg, #e7eee9, #dce7e0);
  box-shadow: 0 22px 62px rgba(23, 55, 43, .16);
}

.google-map-shell::before {
  display: none;
}

.google-map-plane {
  inset: 0 !important;
  border-radius: inherit;
  transform: none !important;
  transition: none !important;
}

.google-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(rgba(26, 79, 59, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 79, 59, .045) 1px, transparent 1px),
    #e7eee9;
  background-size: 42px 42px;
}

.google-map-shell .map-floating-search {
  top: 18px;
  left: 18px;
  z-index: 12;
  width: min(390px, calc(100% - 108px));
  min-height: 46px;
  border: 1px solid rgba(18, 49, 38, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 38px rgba(17, 48, 37, .18);
  backdrop-filter: blur(14px);
}

.google-map-shell .map-floating-search > span {
  width: 42px;
  height: 44px;
  color: #087d55;
}

.google-map-shell .map-floating-search .rail-svg {
  width: 19px;
  height: 19px;
}

.google-map-shell .map-floating-search input {
  min-height: 44px;
  padding-right: 13px;
  font-size: 13px;
}

.google-map-shell .map-filter-bar,
.google-map-shell .map-client-bar {
  left: 18px;
  right: 82px;
  bottom: auto;
  z-index: 12;
  width: fit-content;
  max-width: calc(100% - 104px);
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid rgba(18, 49, 38, .1);
  border-radius: 11px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 28px rgba(17, 48, 37, .12);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.google-map-shell .map-filter-bar {
  top: 76px;
}

.google-map-shell .map-client-bar {
  top: 122px;
}

.google-map-shell .map-filter-control,
.google-map-shell .map-client-chip {
  min-width: max-content;
  min-height: 32px;
  flex: 0 0 auto;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #486158;
}

.google-map-shell .map-filter-control:hover,
.google-map-shell .map-client-chip:hover {
  background: rgba(9, 138, 91, .08);
  color: #075d40;
}

.google-map-shell .map-filter-control.active,
.google-map-shell .map-client-chip.active {
  border-color: rgba(4, 119, 78, .18);
  background: #087d55;
  color: #fff;
  box-shadow: 0 5px 14px rgba(4, 107, 71, .2);
}

.google-map-shell .map-legend {
  left: 18px;
  right: auto;
  bottom: 18px;
  z-index: 12;
  width: auto;
  max-width: calc(100% - 190px);
  gap: 11px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 9px 12px;
  border: 1px solid rgba(18, 49, 38, .1);
  border-radius: 11px;
  background: rgba(255, 255, 255, .92);
  color: #405b51;
  box-shadow: 0 10px 28px rgba(17, 48, 37, .13);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.google-map-state {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  max-width: 290px;
  padding: 9px 12px;
  border: 1px solid rgba(18, 49, 38, .12);
  border-radius: 11px;
  background: rgba(255, 255, 255, .94);
  color: #1c342b;
  box-shadow: 0 10px 28px rgba(17, 48, 37, .15);
  backdrop-filter: blur(12px);
}

.google-map-state strong,
.google-map-state span {
  display: block;
}

.google-map-state strong {
  font-size: 11px;
}

.google-map-state span {
  margin-top: 1px;
  color: #60746c;
  font-size: 9px;
  line-height: 1.3;
}

.google-map-state-dot {
  width: 9px;
  height: 9px;
  margin: 0 !important;
  border-radius: 50%;
  background: #159667;
  box-shadow: 0 0 0 4px rgba(21, 150, 103, .13);
}

.google-map-state.loading .google-map-state-dot {
  animation: map-provider-pulse 1.2s ease-in-out infinite;
}

.google-map-state.error .google-map-state-dot,
.google-map-state.offline .google-map-state-dot {
  background: #d84c4c;
  box-shadow: 0 0 0 4px rgba(216, 76, 76, .13);
}

.google-map-state.unconfigured {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: min(390px, calc(100% - 36px));
  max-width: none;
  padding: 18px;
  transform: translate(-50%, -50%);
}

.google-map-state.unconfigured .google-map-state-dot {
  background: #c78a24;
  box-shadow: 0 0 0 4px rgba(199, 138, 36, .14);
}

.google-map-state.unconfigured strong {
  font-size: 14px;
}

.google-map-state.unconfigured span {
  margin-top: 4px;
  font-size: 11px;
}

.integron-google-marker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 34px;
  min-height: 34px;
  padding: 4px;
  border: 2px solid rgba(255, 255, 255, .96);
  border-radius: 999px;
  background: #fff;
  color: #183128;
  box-shadow: 0 8px 22px rgba(16, 46, 35, .25);
  transform: translateY(-3px);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}

.integron-google-marker:hover,
.integron-google-marker:focus-visible,
.integron-google-marker.selected {
  z-index: 4;
  padding-right: 10px;
  border-color: rgba(8, 125, 85, .88);
  box-shadow: 0 12px 30px rgba(6, 91, 61, .3);
  transform: translateY(-5px) scale(1.03);
  outline: 0;
}

.integron-google-marker-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #5b6ee1;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.integron-google-marker.site .integron-google-marker-icon { background: #0877ff; }
.integron-google-marker.gateway .integron-google-marker-icon { background: #0b9461; }
.integron-google-marker.asset .integron-google-marker-icon { background: #856719; }
.integron-google-marker.unknown .integron-google-marker-icon { background: #cf8613; }
.integron-google-marker.alert .integron-google-marker-icon,
.integron-google-marker.danger .integron-google-marker-icon { background: #d44949; }
.integron-google-marker.warn .integron-google-marker-icon { background: #c88419; }

.integron-google-marker-label {
  display: none;
  min-width: 0;
  text-align: left;
}

.integron-google-marker:hover .integron-google-marker-label,
.integron-google-marker:focus-visible .integron-google-marker-label,
.integron-google-marker.selected .integron-google-marker-label {
  display: grid;
}

.integron-google-marker-label b,
.integron-google-marker-label small {
  overflow: hidden;
  max-width: 170px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integron-google-marker-label b {
  color: #183128;
  font-size: 11px;
}

.integron-google-marker-label small {
  color: #667b72;
  font-size: 9px;
}

.google-map-hard-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 5px;
  width: min(360px, calc(100% - 36px));
  padding: 18px;
  border: 1px solid var(--d-border);
  border-radius: 13px;
  background: var(--d-surface);
  box-shadow: 0 18px 44px rgba(17, 48, 37, .16);
  transform: translate(-50%, -50%);
}

.google-map-hard-fallback span {
  color: var(--d-muted);
  font-size: 12px;
}

@keyframes map-provider-pulse {
  0%, 100% { opacity: .45; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 1024px) {
  .google-map-shell {
    min-height: 540px !important;
    height: min(68dvh, 620px) !important;
  }

  .google-map-plane {
    inset: 0 !important;
  }

  .google-map-shell .map-floating-search {
    top: 10px !important;
    left: 10px !important;
    width: calc(100% - 64px) !important;
  }

  .google-map-shell .map-filter-bar {
    top: 66px !important;
  }

  .google-map-shell .map-client-bar {
    top: 110px !important;
  }

  .google-map-shell .map-filter-bar,
  .google-map-shell .map-client-bar {
    left: 10px !important;
    right: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: none !important;
  }

  .google-map-shell .map-legend {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-width: none !important;
    padding: 7px 9px !important;
  }

  .google-map-state {
    right: 10px;
    bottom: 54px;
    max-width: min(250px, calc(100% - 20px));
  }

  .google-map-state.ready {
    grid-template-columns: 8px 1fr;
    padding: 7px 9px;
  }

  .google-map-state.ready span {
    display: none;
  }
}

/* Stage 3D final alignment pass: override legacy high-specificity shell rules. */
body .top-search input,
html[data-theme] body .top-search input {
  padding-left: 42px !important;
}

body .subnav:empty,
html[data-theme] body .subnav:empty {
  display: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

@media (max-width: 1024px) {
  body .topbar,
  html[data-theme] body .topbar,
  body .app-shell.inspector-open .topbar {
    padding: 9px 18px !important;
  }

  body .workspace-head,
  html[data-theme] body .workspace-head {
    padding: 24px 18px 14px !important;
  }

  body .workspace-content,
  html[data-theme] body .workspace-content {
    padding: 0 18px 36px !important;
  }

  body .subnav,
  html[data-theme] body .subnav {
    margin: 0 18px 16px !important;
  }

  body .local-status-strip,
  html[data-theme] body .local-status-strip {
    width: 100% !important;
    margin: 0 0 14px !important;
  }
}

@media (max-width: 460px) {
  body .topbar,
  html[data-theme] body .topbar,
  body .app-shell.inspector-open .topbar {
    padding-inline: 14px !important;
  }

  body .workspace-head,
  html[data-theme] body .workspace-head,
  body .workspace-content,
  html[data-theme] body .workspace-content {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body .subnav,
  html[data-theme] body .subnav {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }
}

@media (max-width: 720px) {
  body[data-stage2ca="console-shell-cleanup"] .console-left-body,
  body[data-stage2ca="console-shell-cleanup"] .sidebar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .console-left-body,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .sidebar {
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 64px !important;
    padding: 0 !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav {
    width: 100% !important;
    height: 64px !important;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom)) !important;
    align-items: stretch !important;
    justify-content: space-around !important;
    overflow: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .topbar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .topbar,
  body[data-stage2ca="console-shell-cleanup"] .app-shell.inspector-open .topbar {
    height: 58px !important;
    min-height: 58px !important;
    grid-template-columns: minmax(0, 1fr) 40px !important;
    grid-template-rows: 40px !important;
    align-content: center !important;
    gap: 8px !important;
    padding: 9px 14px !important;
    overflow: visible !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .top-search,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .top-search {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .top-actions,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .top-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .top-actions .user-chip,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .top-actions .user-chip {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex: 0 0 38px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .subnav,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .subnav {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  body[data-stage2ca="console-shell-cleanup"] .subnav::-webkit-scrollbar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .subnav::-webkit-scrollbar,
  body[data-stage2ca="console-shell-cleanup"] .local-status-strip::-webkit-scrollbar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip::-webkit-scrollbar {
    display: none;
  }

  body[data-stage2ca="console-shell-cleanup"] .local-status-strip,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip {
    scrollbar-width: none;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group,
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group + .nav-group,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group + .nav-group {
    display: contents !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="dashboard"],
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="sites"],
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="devices"],
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="tickets"],
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="users"],
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.active,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="dashboard"],
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="sites"],
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="devices"],
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="tickets"],
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn[data-module="users"],
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.active {
    width: 62px !important;
    min-width: 54px !important;
    max-width: 68px !important;
    height: 52px !important;
    min-height: 52px !important;
    flex: 0 1 62px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label {
    font-size: 0 !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label::after,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label::after {
    content: attr(data-mobile-label);
    font-size: 9px;
    line-height: 1.1;
  }

  body[data-stage2ca="console-shell-cleanup"] .local-status-strip > span,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip > span,
  body[data-stage2ca="console-shell-cleanup"] .local-status-strip .badge,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip .badge {
    min-width: max-content !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .local-status-strip,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
    overflow: visible !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .local-status-strip > span,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip > span,
  body[data-stage2ca="console-shell-cleanup"] .local-status-strip .badge,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip .badge {
    min-width: 0 !important;
    flex: 0 1 auto !important;
    white-space: normal !important;
  }
}

@media (max-width: 520px) {
  body[data-stage2ca="console-shell-cleanup"] .workspace,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace {
    --topbar-h: 58px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .workspace-actions,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn {
    width: 100% !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn.primary,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn.primary {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 861px) {
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn {
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
    justify-items: stretch !important;
    column-gap: 10px !important;
    padding: 8px 10px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-icon,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-icon {
    grid-column: 1 !important;
    justify-self: center !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label {
    grid-column: 2 !important;
    width: 100% !important;
    justify-self: stretch !important;
    text-align: left !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-count,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-count {
    position: static !important;
    grid-column: 3 !important;
    justify-self: end !important;
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Stage 3E: online IoT map, disabled wildlife tracking, and mobile-first cleanup. */
.mobile-more-nav {
  display: none !important;
}

@media (min-width: 861px) {
  body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-more-nav,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-more-nav {
    display: none !important;
    visibility: hidden !important;
  }
}

.nav-btn.online-only-offline,
.dashboard-map-card.offline .btn {
  cursor: not-allowed;
  opacity: .58;
}

.dashboard-map-card {
  min-height: 156px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 22%, rgba(15, 140, 86, .13), transparent 32%),
    var(--d-surface);
}

.dashboard-map-card.offline {
  background: var(--d-surface-subtle);
}

.dashboard-map-copy h3 {
  margin: 2px 0 6px;
  font-size: 21px;
}

.dashboard-map-copy > p:last-of-type {
  max-width: 720px;
  margin: 0;
  color: var(--d-muted);
}

.dashboard-map-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.dashboard-map-stats span {
  padding: 6px 9px;
  border: 1px solid var(--d-border);
  border-radius: 999px;
  background: var(--d-surface);
  color: var(--d-muted);
  font-size: 11px;
}

.dashboard-map-stats b {
  color: var(--d-text);
}

.map-connection-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.map-connection-layer line {
  vector-effect: non-scaling-stroke;
  stroke: color-mix(in srgb, var(--d-brand) 42%, transparent);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}

.map-connection-layer line.warn {
  stroke: #c68721;
}

.map-connection-layer line.danger {
  stroke: #cf4b4b;
  stroke-width: 1.7;
}

.ops-map-marker {
  z-index: 4;
}

.mobile-nav-sheet {
  max-width: 660px;
}

.mobile-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 20px 22px;
}

.mobile-module-card {
  min-height: 100px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--d-border);
  border-radius: 13px;
  background: var(--d-surface-subtle);
  color: var(--d-text);
  text-align: left;
}

.mobile-module-card:hover,
.mobile-module-card.active {
  border-color: var(--d-brand);
  background: var(--d-brand-soft);
}

.mobile-module-card .rail-svg {
  width: 22px;
  height: 22px;
}

.mobile-module-card small {
  color: var(--d-muted);
}

@media (max-width: 1024px) {
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn {
    display: none !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window {
    width: calc((100vw - 24px) / 5) !important;
    min-width: 0 !important;
    max-width: 76px !important;
    height: 52px !important;
    display: grid !important;
    flex: 1 1 20% !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-before-2,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-before-2 {
    order: 1;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-before-1,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-before-1 {
    order: 2;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-center,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-center {
    order: 3;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-after-1,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-after-1 {
    order: 4;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-after-2,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .mobile-after-2 {
    order: 5;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.online-only-offline {
    display: grid !important;
  }

  body .workspace-head,
  html[data-theme] body .workspace-head {
    gap: 9px !important;
    padding: 14px 14px 9px !important;
  }

  body .workspace-head h2,
  html[data-theme] body .workspace-head h2 {
    font-size: 22px !important;
    line-height: 1.12 !important;
  }

  body .workspace-head > div > p:last-child,
  html[data-theme] body .workspace-head > div > p:last-child {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 12px !important;
    line-height: 1.45;
  }

  body[data-stage2ca="console-shell-cleanup"] .workspace-actions,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-actions {
    display: flex !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn,
  body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn.primary,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-actions .btn.primary {
    width: auto !important;
    min-width: max-content !important;
    flex: 0 0 auto !important;
    grid-column: auto !important;
    padding: 9px 12px !important;
  }

  body .workspace-content,
  html[data-theme] body .workspace-content {
    gap: 10px !important;
    padding: 0 14px 28px !important;
  }

  body .local-status-strip,
  html[data-theme] body .local-status-strip {
    min-height: 36px;
    margin-bottom: 8px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 10px;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar {
    display: block !important;
    padding: 8px !important;
    overflow: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter-label,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-label {
    width: auto !important;
    padding: 0 2px 6px !important;
    font-size: 9px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter-buttons,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-buttons {
    width: 100% !important;
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter {
    width: auto !important;
    min-width: max-content !important;
    flex: 0 0 auto !important;
    padding: 7px 9px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .stage2ca-route-cleanup-strip,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .stage2ca-route-cleanup-strip {
    display: none !important;
  }

  body .panel,
  html[data-theme] body .panel {
    padding: 13px !important;
    border-radius: 12px !important;
  }

  body .panel-head,
  html[data-theme] body .panel-head {
    gap: 6px !important;
  }

  body .panel-head h3,
  html[data-theme] body .panel-head h3 {
    font-size: 16px;
    line-height: 1.2;
  }

  body .panel-head p,
  html[data-theme] body .panel-head p {
    font-size: 11px;
    line-height: 1.45;
  }

  body .stage2a-workbench-header,
  html[data-theme] body .stage2a-workbench-header {
    min-height: 0 !important;
    gap: 11px !important;
    padding: 14px !important;
    border-radius: 12px !important;
  }

  body .stage2a-workbench-header h3 {
    margin: 1px 0 4px !important;
    font-size: 21px !important;
    line-height: 1.12 !important;
  }

  body .stage2a-header-copy > p:not(.eyebrow) {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 12px !important;
    line-height: 1.45;
  }

  body .stage2a-header-meta {
    display: none !important;
  }

  body .stage2a-header-meta .badge {
    min-width: max-content;
  }

  body .stage2a-header-actions {
    display: flex !important;
    gap: 7px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body .stage2a-header-actions .btn {
    width: auto !important;
    min-width: max-content;
    flex: 0 0 auto;
  }

  body .sleek-status-strip,
  html[data-theme] body .sleek-status-strip {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    border-radius: 12px !important;
  }

  body .sleek-status-segment,
  html[data-theme] body .sleek-status-segment {
    min-height: 72px !important;
    padding: 11px 12px !important;
  }

  body .sleek-status-segment span,
  html[data-theme] body .sleek-status-segment span {
    font-size: 10px !important;
  }

  body .sleek-status-segment strong,
  html[data-theme] body .sleek-status-segment strong {
    font-size: 19px !important;
  }

  .dashboard-map-card {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .dashboard-map-card .btn {
    width: 100%;
  }

  .dashboard-map-copy h3 {
    font-size: 18px;
  }

  .dashboard-map-copy > p:last-of-type {
    font-size: 12px;
    line-height: 1.45;
  }

  .dashboard-map-stats {
    gap: 5px;
    margin-top: 10px;
  }

  .dashboard-map-stats span {
    padding: 5px 7px;
    font-size: 10px;
  }

  body .table-wrap,
  body .device-table-wrap {
    overflow: visible !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .workbench-layout .table-wrap,
  body[data-stage2ca="console-shell-cleanup"] .workbench-layout .device-table-wrap,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workbench-layout .table-wrap,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workbench-layout .device-table-wrap {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
  }

  body .mobile-card-table,
  body .mobile-card-table tbody,
  body .mobile-card-table tr,
  body .mobile-card-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body .mobile-card-table thead {
    display: none !important;
  }

  body .mobile-card-table tbody {
    display: grid !important;
    gap: 9px;
  }

  body .mobile-card-table tbody tr {
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 1px solid var(--d-border) !important;
    border-radius: 12px !important;
    background: var(--d-surface) !important;
  }

  body .mobile-card-table tbody td {
    display: grid !important;
    grid-template-columns: minmax(92px, 38%) minmax(0, 1fr) !important;
    align-items: start;
    gap: 9px;
    padding: 7px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--d-border) 62%, transparent) !important;
    overflow-wrap: anywhere;
    font-size: 12px !important;
  }

  body .mobile-card-table tbody td:last-child {
    border-bottom: 0 !important;
  }

  body .mobile-card-table tbody td::before {
    content: attr(data-mobile-label);
    color: var(--d-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  body .mobile-card-table tbody td .btn {
    width: 100% !important;
  }

  .map-workspace {
    grid-template-columns: 1fr !important;
  }

  .map-shell {
    min-height: 500px !important;
    height: min(66dvh, 560px) !important;
    border-radius: 13px !important;
  }

  .map-side-panel {
    position: static !important;
    max-height: none !important;
  }

  .map-floating-search {
    inset: 10px 10px auto !important;
    width: calc(100% - 20px) !important;
  }

  .map-filter-bar {
    left: 10px !important;
    right: 10px !important;
    top: 64px !important;
    overflow-x: auto !important;
  }

  .map-client-bar {
    left: 10px !important;
    right: 10px !important;
    top: 110px !important;
    overflow-x: auto !important;
  }

  body .map-filter-bar,
  body .map-client-bar,
  html[data-theme] body .map-filter-bar,
  html[data-theme] body .map-client-bar {
    height: 38px !important;
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  body .map-filter-control,
  body .map-client-chip,
  html[data-theme] body .map-filter-control,
  html[data-theme] body .map-client-chip {
    width: auto !important;
    min-width: max-content !important;
    flex: 0 0 auto !important;
  }

  .map-provider-note {
    top: 152px !important;
    right: 10px !important;
    bottom: auto !important;
    max-width: calc(100% - 20px) !important;
  }

  body .map-provider-note,
  html[data-theme] body .map-provider-note {
    width: auto !important;
    max-width: 170px !important;
    padding: 7px 9px !important;
    border-radius: 9px !important;
  }

  body .map-provider-note span,
  html[data-theme] body .map-provider-note span {
    display: none !important;
  }

  .map-legend {
    left: 10px !important;
    right: 10px !important;
    bottom: 8px !important;
    overflow-x: auto;
  }

  .marker-label {
    display: none !important;
  }

  .modal-card.mobile-nav-sheet {
    max-height: 88dvh !important;
    overflow-y: auto;
  }

  .mobile-nav-sheet .modal-head {
    align-items: start !important;
  }

  .mobile-nav-sheet .modal-head > .icon-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    align-self: start !important;
  }

  .mobile-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .mobile-module-card {
    min-height: 92px;
    padding: 12px;
  }

  .detail-drawer {
    top: 58px !important;
    bottom: 64px !important;
    height: auto !important;
    max-height: calc(100dvh - 122px) !important;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .drawer-actions,
  .button-row,
  .map-side-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  .drawer-actions .btn,
  .button-row .btn,
  .map-side-actions .btn {
    width: 100% !important;
    min-height: 42px;
  }
}

@media (max-width: 460px) {
  body .workspace-head,
  html[data-theme] body .workspace-head,
  body .workspace-content,
  html[data-theme] body .workspace-content {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body .workspace-content,
  html[data-theme] body .workspace-content {
    padding-bottom: 24px !important;
  }

  .mobile-module-grid {
    gap: 8px;
  }
}

/* Stage 3G: one document scroll root.
   Legacy styles locked html/body/app-shell to 100dvh with hidden overflow.
   Long pages then scrolled the hidden app shell when a low card was focused,
   displacing the fixed navigation rail after a drawer opened or closed. */
html,
html[data-theme],
body,
html[data-theme] body {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body,
html[data-theme] body {
  min-height: 100dvh;
}

body .app-shell,
html[data-theme] body .app-shell {
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

body .workspace,
html[data-theme] body .workspace,
body .app-shell.secondary-collapsed .workspace,
body .app-shell.inspector-open .workspace,
html[data-theme] body .app-shell.secondary-collapsed .workspace,
html[data-theme] body .app-shell.inspector-open .workspace {
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

html,
body {
  scrollbar-width: thin;
  scrollbar-color: var(--d-border-strong) var(--d-canvas);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  border: 2px solid var(--d-canvas);
  border-radius: 999px;
  background: var(--d-border-strong);
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--d-canvas);
}

@media (max-width: 1024px) {
  html,
  body {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  body .app-shell,
  html[data-theme] body .app-shell {
    min-height: calc(100dvh - 64px) !important;
    overflow: visible !important;
  }

  body .workspace,
  html[data-theme] body .workspace,
  body .app-shell.secondary-collapsed .workspace,
  body .app-shell.inspector-open .workspace,
  html[data-theme] body .app-shell.secondary-collapsed .workspace,
  html[data-theme] body .app-shell.inspector-open .workspace {
    min-height: calc(100dvh - 64px) !important;
  }

  /* 100vw includes reserved scrollbar space in some mobile browsers and
     caused the navigation rail and workspace to drift sideways. */
  body[data-stage2ca="console-shell-cleanup"] .app-shell,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .app-shell,
  body[data-stage2ca="console-shell-cleanup"] .workspace,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace,
  .app-shell,
  html[data-theme] .app-shell,
  .workspace,
  html[data-theme] .workspace,
  .main-nav,
  html[data-theme] .main-nav {
    width: 100% !important;
    max-width: 100% !important;
  }

  .console-left,
  html[data-theme] .console-left,
  .sidebar,
  html[data-theme] .sidebar {
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    max-width: none !important;
  }

  .console-left-body,
  html[data-theme] .console-left-body {
    width: 100% !important;
    max-width: 100% !important;
  }
}
/* Stage 3I: final mobile interaction layer (loaded after the legacy base). */
@media (max-width: 1024px) {
  html,
  body {
    overscroll-behavior-y: contain;
    scroll-behavior: auto !important;
  }

  body {
    touch-action: pan-y;
  }

  .workspace-content,
  .detail-drawer,
  .drawer-body,
  .modal-body,
  .main-nav,
  .drawer-tabs {
    -webkit-overflow-scrolling: touch;
  }

  .detail-drawer,
  .drawer-body,
  .modal-body {
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .main-nav {
    touch-action: pan-y;
  }

  /* The legacy 720px rule used to be the only place that restored every
     navigation group and gave the bottom rail a real 64px layout box. Once
     the compact shell is used up to 1024px, that restoration must cover the
     whole tablet band as well. */
  body[data-stage2ca="console-shell-cleanup"] .console-left-body,
  body[data-stage2ca="console-shell-cleanup"] .sidebar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .console-left-body,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .sidebar {
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 64px !important;
    padding: 0 !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav {
    width: 100% !important;
    height: 64px !important;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom)) !important;
    align-items: stretch !important;
    justify-content: space-around !important;
    overflow: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group,
  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group + .nav-group,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-group + .nav-group {
    display: contents !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window {
    visibility: visible !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-count,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-count {
    position: absolute !important;
    top: 1px !important;
    right: auto !important;
    left: 50% !important;
    display: grid !important;
    place-items: center !important;
    min-width: 16px !important;
    width: auto !important;
    max-width: 24px !important;
    height: 16px !important;
    padding: 0 3px !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    font-size: 8px !important;
    line-height: 16px !important;
    transform: translateX(8px) !important;
  }

  /* The account menu is a child of the 40px mobile action cell. A legacy
     max-width rule therefore collapsed it to that cell's width even though
     the menu itself requested a viewport-sized width. Anchor it to the
     viewport and give it an independent scroll root so account settings and
     sign-out remain reachable on every phone and narrow tablet. */
  .top-actions > .account-menu,
  html[data-theme] .top-actions > .account-menu {
    position: fixed !important;
    top: 66px !important;
    right: 8px !important;
    left: auto !important;
    width: min(360px, calc(100vw - 16px)) !important;
    min-width: min(300px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 74px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    z-index: 190 !important;
  }

  html body .workspace button:not(.nav-btn),
  html body .detail-drawer button:not(.nav-btn),
  html body .modal-layer button:not(.nav-btn),
  .btn,
  .quick-filter,
  .page-tabs button,
  .subnav button,
  .drawer-tabs button,
  .mobile-card-table button,
  .account-menu button,
  .theme-menu button,
  .user-switch-option,
  .sort-menu button {
    min-height: 44px !important;
  }

  html body .workspace .icon-btn,
  html body .detail-drawer .icon-btn,
  html body .modal-layer .icon-btn {
    width: 44px !important;
    min-width: 44px !important;
  }

  .mobile-card-table td[data-mobile-label="ACTION"] .btn,
  .mobile-card-table td[data-mobile-label="ACTION"] button {
    width: 100%;
    min-width: 0;
  }

  .modal-layer {
    align-items: stretch;
    padding: max(8px, env(safe-area-inset-top, 0)) 8px max(8px, env(safe-area-inset-bottom, 0));
  }

  .modal-card {
    width: 100%;
    max-height: 100%;
  }

  .adoption-step-grid,
  .adoption-check-list,
  .form-grid.two-column {
    grid-template-columns: 1fr;
  }
}

/* Stage 3I desktop rail correction.
   Keep the navigation scroll root independent and render the context chooser
   as a real viewport popover. Focusing its search field must never scroll the
   fixed application rail or move navigation controls out of view. */
@media (min-width: 1025px) {
  .console-left,
  html[data-theme] .console-left,
  .console-left-body,
  html[data-theme] .console-left-body,
  .sidebar,
  html[data-theme] .sidebar {
    overflow: visible !important;
  }

  .main-nav,
  html[data-theme] .main-nav {
    padding: 0 2px 8px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .nav-group,
  html[data-theme] .nav-group {
    gap: 1px !important;
    margin-bottom: 4px !important;
  }

  .nav-group + .nav-group,
  html[data-theme] .nav-group + .nav-group {
    padding-top: 4px !important;
  }

  .nav-group-label,
  html[data-theme] .nav-group-label {
    padding: 0 9px 2px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 4px 8px !important;
    column-gap: 8px !important;
    border-radius: 8px !important;
  }

  .main-nav .nav-icon,
  html[data-theme] .main-nav .nav-icon {
    width: 16px !important;
    height: 16px !important;
  }

  .main-nav .rail-svg,
  html[data-theme] .main-nav .rail-svg {
    width: 16px !important;
    height: 16px !important;
  }

  .main-nav .nav-count,
  html[data-theme] .main-nav .nav-count {
    min-width: 20px !important;
    height: 18px !important;
    padding-inline: 5px !important;
  }

  .site-context-selector,
  html[data-theme] .site-context-selector {
    z-index: 180 !important;
  }

  .site-switcher-menu,
  html[data-theme] .site-switcher-menu {
    position: fixed !important;
    top: 126px !important;
    right: auto !important;
    left: 12px !important;
    width: min(360px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 138px) !important;
    padding: 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    z-index: 190 !important;
  }

  .site-switcher-footer,
  html[data-theme] .site-switcher-footer {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-switcher-footer .btn,
  html[data-theme] .site-switcher-footer .btn {
    min-width: 0;
  }
}

/* A desktop rail still leaves less than 900px of workspace on small laptops.
   Present operational tables as two readable cards per row instead of
   squeezing action labels and telemetry into unusable narrow columns. */
@media (min-width: 1025px) and (max-width: 1200px) {
  body .table-wrap:has(.mobile-card-table),
  body .device-table-wrap:has(.mobile-card-table) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
  }

  body .mobile-card-table,
  body .mobile-card-table tbody {
    display: block !important;
    width: 100% !important;
  }

  body .mobile-card-table thead {
    display: none !important;
  }

  body .mobile-card-table tbody {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body .mobile-card-table tbody tr {
    display: block !important;
    min-width: 0;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid var(--d-border) !important;
    border-radius: 12px !important;
    background: var(--d-surface) !important;
  }

  body .mobile-card-table tbody td {
    display: grid !important;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr) !important;
    align-items: start;
    gap: 8px;
    width: 100% !important;
    min-width: 0 !important;
    padding: 7px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--d-border) 62%, transparent) !important;
    overflow-wrap: anywhere;
  }

  body .mobile-card-table tbody td:last-child {
    border-bottom: 0 !important;
  }

  body .mobile-card-table tbody td::before {
    content: attr(data-mobile-label);
    color: var(--d-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  body .mobile-card-table tbody td[data-mobile-label="ACTION"] .btn,
  body .mobile-card-table tbody td[data-mobile-label="ACTION"] button {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 521px) and (max-width: 1024px) {
  body[data-stage2ca="console-shell-cleanup"] .main-nav,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav {
    justify-content: center !important;
    gap: 8px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window {
    width: calc((100% - 32px) / 5) !important;
    min-width: 0 !important;
    max-width: 180px !important;
    flex: 1 1 0 !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-label {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 10px !important;
    text-overflow: ellipsis;
  }
}
/* Production identity is rendered by the authenticated user chip. When the
 * employee switcher is hidden it must never reserve header width, even though
 * older console-shell rules intentionally force the switcher to display. */
html body #userSwitcher.hidden {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0 !important;
}

@media (max-width: 1024px) {
  .top-role-actions .client-view-toggle span {
    display: none;
  }

  .client-view-toggle {
    padding: 4px;
    min-width: 42px;
    justify-content: center;
  }

  .client-view-preview-banner,
  .client-view-preview-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .client-view-preview-controls label {
    width: 100%;
    min-width: 0;
  }

  .setup-center-steps {
    grid-template-columns: 1fr;
  }

  .compact-actions {
    width: 100%;
  }

  .employee-access-steps,
  .employee-preset-grid,
  .scope-choice-grid {
    grid-template-columns: 1fr;
  }

  .identity-governance-panel .access-user-header {
    display: none;
  }

  .identity-governance-panel .identity-user-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 12px;
  }

  .identity-governance-panel .identity-person,
  .identity-governance-panel .identity-action {
    grid-column: 1 / -1;
  }

  .identity-governance-panel .identity-action .btn {
    width: 100%;
  }
}

/* Stage 3P RC18B: a higher-specificity desktop rail rule could leak into the
 * compact footer and render icons, labels, and counters in one horizontal
 * row. Explicitly compose a five-column, two-row mobile rail so counters
 * remain attached to the icon and never cover a label. */
@media (max-width: 1024px) {
  body[data-stage2ca="console-shell-cleanup"] .main-nav,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-flow: column !important;
    gap: 4px !important;
    justify-content: stretch !important;
    overflow: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 52px !important;
    min-height: 52px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 24px 14px !important;
    grid-auto-flow: row !important;
    place-items: center !important;
    align-content: center !important;
    gap: 2px !important;
    padding: 4px 2px !important;
    overflow: visible !important;
    flex: none !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-icon,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: center !important;
    width: 18px !important;
    height: 18px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-label,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-label {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: start !important;
    justify-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 2px !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 1.1 !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-label::after,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-label::after {
    content: attr(data-mobile-label);
    font-size: 9px !important;
    line-height: 1.1 !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-count,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-count {
    position: absolute !important;
    top: 1px !important;
    right: auto !important;
    left: calc(50% + 6px) !important;
    min-width: 16px !important;
    width: auto !important;
    max-width: 24px !important;
    height: 16px !important;
    padding: 0 3px !important;
    transform: none !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-mode-dot,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window .nav-mode-dot {
    position: absolute !important;
    top: 5px !important;
    left: calc(50% - 19px) !important;
    width: 8px !important;
    height: 8px !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window.active,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .main-nav .nav-btn.mobile-window.active {
    box-shadow: inset 3px 0 0 var(--d-brand) !important;
  }
}
/* Stage 3T: calm Phase 1 communications and subscription surfaces. */
.communication-page,
.subscription-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.communication-summary > article {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line, #d7e1dd);
  border-radius: 12px;
  background: var(--panel, #fff);
  display: grid;
  gap: 3px;
}

.communication-summary span,
.communication-summary small {
  color: var(--muted, #5f716b);
  overflow-wrap: anywhere;
}

.communication-summary strong {
  color: var(--ink, #10221c);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.1;
}

.communication-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.communication-center-panel,
.communication-settings-card,
.subscription-card {
  min-width: 0;
}

.communication-settings-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.communication-event-list {
  display: grid;
  gap: 8px;
}

.communication-event {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line, #d7e1dd);
  border-radius: 10px;
  background: var(--panel, #fff);
}

.communication-event.read {
  background: var(--surface-soft, #f7faf8);
}

.communication-event-marker {
  width: 4px;
  min-height: 54px;
  border-radius: 99px;
  background: #87958f;
}

.communication-event.warning .communication-event-marker {
  background: #b77a00;
}

.communication-event.critical .communication-event-marker {
  background: #c63d3d;
}

.communication-event-heading,
.communication-event-meta,
.communication-event-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.communication-event-copy {
  min-width: 0;
}

.communication-event-copy p {
  margin: 5px 0 8px;
  color: var(--muted, #5f716b);
  overflow-wrap: anywhere;
}

.communication-event-meta {
  color: var(--muted, #5f716b);
  font-size: .78rem;
}

.communication-event-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
}

.communication-event-action {
  justify-content: flex-end;
}

.communication-done {
  color: var(--success, #008c5a);
  font-weight: 700;
  font-size: .82rem;
}

.communication-toggle-list {
  display: grid;
  gap: 8px;
}

.communication-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 9px 0;
}

.communication-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand, #009b67);
}

.communication-toggle span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.communication-toggle small,
.communication-push-box span {
  color: var(--muted, #5f716b);
  line-height: 1.35;
}

.communication-push-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft, #f2f7f4);
  display: grid;
  gap: 8px;
}

.communication-advanced {
  margin: 10px 0 14px;
  border-top: 1px solid var(--line, #d7e1dd);
  padding-top: 10px;
}

.communication-advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.btn.full {
  width: 100%;
}

.email-verification-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.email-verification-banner > div {
  display: grid;
  gap: 3px;
}

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

.subscription-grid > .purpose-empty {
  grid-column: 1 / -1;
}

.communication-event-list > .purpose-empty {
  display: grid;
  gap: 6px;
}

.subscription-card.expired,
.subscription-card.suspended {
  border-color: color-mix(in srgb, #c63d3d 35%, var(--line, #d7e1dd));
}

.subscription-card.expiring {
  border-color: color-mix(in srgb, #b77a00 40%, var(--line, #d7e1dd));
}

.subscription-date-row,
.subscription-usage-list {
  display: grid;
  gap: 10px;
}

.subscription-date-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.subscription-usage-row {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(100px, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.subscription-usage-row > div:first-child {
  display: grid;
}

.subscription-usage-row span {
  color: var(--muted, #5f716b);
  font-size: .8rem;
}

.subscription-usage-row b {
  text-align: right;
}

.subscription-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft, #e8efeb);
}

.subscription-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #009b67;
}

.subscription-meter > span.warning {
  background: #b77a00;
}

.subscription-meter > span.danger {
  background: #c63d3d;
}

.subscription-internal-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-soft, #f2f7f4);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.subscription-admin-modal {
  width: min(720px, calc(100vw - 24px));
}

.subscription-admin-form {
  display: grid;
  gap: 12px;
}

/* Stage 3T: legacy console sections used content-box widths plus route-specific
   padding, which could extend two pixels beyond the document at desktop
   scrollbar widths. Keep every routed surface inside the workspace box. */
.workspace-content .panel-head,
.workspace-content .console-strip,
.workspace-content .status-stack,
.workspace-content .stage2by-grid,
.workspace-content .stage2by-lower {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.workspace-content .stage2by-grid,
.workspace-content .stage2by-lower {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-content .stage2by-grid > *,
.workspace-content .stage2by-lower > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .communication-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .communication-layout,
  .subscription-grid,
  .workspace-content .stage2by-grid,
  .workspace-content .stage2by-lower {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .communication-page,
  .subscription-page {
    gap: 10px;
  }

  .communication-summary {
    gap: 7px;
  }

  .communication-summary > article {
    padding: 11px;
  }

  .communication-event {
    grid-template-columns: 4px minmax(0, 1fr);
    padding: 10px;
  }

  .communication-event-action {
    grid-column: 2;
    justify-content: flex-start;
  }

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

  .subscription-usage-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .subscription-usage-row > div:first-child {
    grid-column: 1 / -1;
  }

  .email-verification-banner,
  .subscription-internal-note {
    align-items: stretch;
    flex-direction: column;
  }

  .subscription-admin-modal {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }
}
/* Stage 3V: capability-rich, low-clutter primary experience. */
.main-nav .nav-group-label {
  display: none;
}

.main-nav .nav-group {
  border: 0;
  padding-top: 0;
}

.simple-more-intro,
.simple-start-card,
.training-hero,
.training-playbook article,
.simulation-route-card,
.simulation-banner,
.simulation-objective {
  border: 1px solid var(--border, #d4dfda);
  border-radius: 14px;
  background: var(--panel, #fff);
  padding: 20px;
  margin-bottom: 16px;
}

.simple-more-intro {
  background: linear-gradient(135deg, rgba(0, 145, 96, 0.08), rgba(255, 255, 255, 0.92));
}

.training-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 145, 96, 0.1), rgba(255, 255, 255, 0.96));
}

.training-hero.demo-hero {
  background: linear-gradient(135deg, rgba(0, 111, 145, 0.1), rgba(255, 255, 255, 0.96));
}

.training-start-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(0, 145, 96, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 22px rgba(16, 33, 27, 0.06);
}

.training-start-panel label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.training-start-panel small {
  color: var(--muted, #52635d);
  line-height: 1.35;
}

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

/* Stage 3Z: make training/demo feel like useful product areas, not placeholder pages. */
.training-role-paths {
  border: 1px solid var(--border, #d4dfda);
  border-radius: 14px;
  background: var(--panel, #fff);
  padding: 18px;
  margin-bottom: 16px;
}

.training-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.training-path-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border: 1px solid rgba(0, 145, 96, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 252, 249, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: 0 10px 26px rgba(16, 33, 27, 0.05);
}

.training-path-card h3 {
  margin: 0;
  font-size: 16px;
}

.training-path-card p {
  margin: 0;
  color: var(--muted, #52635d);
}

.training-path-badge {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 145, 96, 0.1);
  color: var(--brand, #008f60);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.training-path-course-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.training-path-course-list small {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(19, 38, 31, 0.06);
  color: var(--muted, #52635d);
  font-weight: 700;
}

.training-course-card .btn {
  width: max-content;
}

.training-playbook article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  margin-bottom: 0;
}

.training-playbook span,
.simulation-step > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent, #009160);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

.training-playbook p,
.mini-proof-list small,
.simulation-step small {
  margin: 3px 0 0;
  color: var(--muted, #52635d);
  line-height: 1.35;
}

.simple-more-intro h2,
.simple-start-card h2,
.training-hero h2,
.simulation-banner h3,
.simulation-objective h3 {
  margin: 3px 0 7px;
}

.simple-more-intro p:last-child,
.simple-start-card p,
.training-hero p,
.simulation-banner p,
.training-course-card p,
.scenario-card p {
  margin: 0;
  color: var(--muted, #52635d);
}

.simple-more-section {
  margin-bottom: 14px;
}

.simple-more-grid,
.scenario-grid,
.training-course-grid,
.simulation-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.simple-more-card,
.scenario-card,
.training-course-card,
.simulation-device {
  border: 1px solid var(--border, #d4dfda);
  border-radius: 11px;
  background: var(--panel, #fff);
  color: var(--text, #10211b);
  min-width: 0;
}

.simple-more-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.simple-more-card:hover,
.simple-more-card:focus-visible {
  border-color: var(--accent, #009160);
  background: rgba(0, 145, 96, 0.06);
}

.simple-more-card > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: rgba(0, 145, 96, 0.1);
  color: var(--accent, #007f54);
  font-weight: 800;
  font-size: 11px;
}

.simple-more-card div,
.simulation-device div {
  min-width: 0;
}

.simple-more-card strong,
.simple-more-card small,
.simulation-device strong,
.simulation-device small {
  display: block;
}

.simple-more-card small,
.simulation-device small {
  margin-top: 3px;
  color: var(--muted, #52635d);
  line-height: 1.35;
}

.simple-start-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px) auto;
  gap: 18px;
  align-items: end;
}

.simple-start-card label,
.simulation-invite-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.scenario-grid,
.training-course-grid {
  margin-bottom: 16px;
}

.scenario-card,
.training-course-card {
  padding: 16px;
}

.scenario-card > span,
.training-course-card > span {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 145, 96, 0.1);
  color: var(--accent, #007f54);
  font-size: 11px;
  font-weight: 800;
}

.scenario-card h3,
.training-course-card h3 {
  margin: 10px 0 6px;
  font-size: 16px;
}

.mini-proof-list {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.mini-proof-list b {
  font-size: 12px;
  color: var(--text, #10211b);
}

.simulation-guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  margin-bottom: 16px;
}

.demo-sandbox-banner {
  background: linear-gradient(135deg, rgba(0, 145, 96, 0.09), rgba(255, 255, 255, 0.96));
}

.demo-control-room,
.demo-story-board,
.training-mission-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 145, 96, 0.24);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 145, 96, 0.1), rgba(255, 255, 255, 0.94));
  box-shadow: 0 14px 35px rgba(16, 33, 27, 0.08);
}

.demo-story-board,
.training-mission-board {
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  align-items: start;
}

.demo-control-room h3,
.demo-story-board h3,
.training-mission-board h3 {
  margin: 4px 0 7px;
}

.demo-control-actions,
.training-mission-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.training-mission-main {
  min-width: 0;
}

.training-mission-checklist {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border, #d4dfda);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.training-mission-checklist h4 {
  margin: 0 0 2px;
}

.training-path-progress-panel,
.training-practice-station {
  margin-bottom: 16px;
}

.training-module-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.training-module-pill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  min-width: 185px;
  padding: 10px 12px;
  border: 1px solid var(--border, #d4dfda);
  border-radius: 13px;
  background: var(--panel, #fff);
  color: var(--text, #10211b);
  text-align: left;
}

.training-module-pill span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(19, 38, 31, 0.08);
  font-weight: 900;
}

.training-module-pill strong,
.training-module-pill small {
  display: block;
  min-width: 0;
}

.training-module-pill small {
  color: var(--muted, #52635d);
}

.training-module-pill.active {
  border-color: var(--accent, #009160);
  background: rgba(0, 145, 96, 0.07);
}

.training-module-pill.done span {
  background: var(--accent, #009160);
  color: #fff;
}

.training-practice-brief {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.training-practice-brief div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  padding: 12px;
  border: 1px solid rgba(0, 145, 96, 0.16);
  border-radius: 12px;
  background: rgba(0, 145, 96, 0.05);
}

.training-practice-brief span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent, #009160);
  color: #fff;
  font-weight: 900;
}

.training-practice-brief small {
  color: var(--muted, #52635d);
  line-height: 1.35;
}

.training-practice-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.training-practice-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.training-practice-form textarea {
  resize: vertical;
}

.training-evidence {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 145, 96, 0.2);
  border-radius: 11px;
  background: rgba(0, 145, 96, 0.06);
}

.mission-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.mission-check input {
  accent-color: var(--accent, #009160);
}

.demo-sandbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.demo-sandbox-card {
  min-width: 0;
}

.demo-sandbox-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.demo-sandbox-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.demo-sandbox-form .btn {
  min-height: 42px;
}

.simulation-route-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

.simulation-route-card h3 {
  margin: 3px 0 7px;
}

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

.simulation-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border, #d4dfda);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
}

.simulation-step.done {
  opacity: 0.74;
}

.simulation-step.done > span {
  background: #6a7b73;
}

.simulation-step.current {
  border-color: var(--accent, #009160);
  background: rgba(0, 145, 96, 0.08);
  box-shadow: inset 3px 0 0 var(--accent, #009160);
}

.simulation-step.upcoming > span {
  background: rgba(16, 33, 27, 0.14);
  color: var(--text, #10211b);
}

.simulation-banner,
.simulation-objective {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.simulation-banner {
  border-left: 4px solid var(--accent, #009160);
}

.simulation-banner.offline {
  border-left-color: #c68500;
  background: rgba(255, 183, 0, 0.08);
}

.simulation-progress {
  height: 8px;
  overflow: hidden;
  margin: -8px 4px 16px;
  border-radius: 999px;
  background: rgba(99, 119, 111, 0.16);
}

.simulation-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #009160);
  transition: width 180ms ease;
}

.simulation-objective .page-actions {
  justify-content: flex-end;
}

.simulation-guide-grid .simulation-objective {
  align-items: flex-start;
}

.simulation-device {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 12px;
}

.simulation-device b {
  white-space: nowrap;
}

.simulation-invite-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 860px) {
  .simple-start-card,
  .training-hero,
  .training-playbook,
  .demo-control-room,
  .demo-story-board,
  .training-mission-board,
  .simulation-guide-grid,
  .simulation-route-card,
  .demo-sandbox-grid,
  .demo-sandbox-form,
  .training-practice-brief,
  .training-practice-form,
  .simulation-invite-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .simulation-banner,
  .simulation-objective {
    align-items: flex-start;
    flex-direction: column;
  }

  .simulation-objective .page-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .demo-control-actions,
  .training-mission-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .simple-more-intro,
  .simple-start-card,
  .training-hero,
  .training-playbook article,
  .simulation-route-card,
  .simulation-banner,
  .simulation-objective {
    padding: 15px;
    border-radius: 11px;
  }

  .simple-more-grid,
  .scenario-grid,
  .training-course-grid,
  .simulation-device-grid,
  .training-module-rail {
    grid-template-columns: 1fr;
  }

  .training-module-rail {
    display: grid;
  }

  .simulation-objective .page-actions .btn {
    flex: 1 1 calc(50% - 6px);
  }
}

@media (max-width: 520px) {
  body[data-stage2ca="console-shell-cleanup"] .local-status-strip,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip,
  body .local-status-strip,
  html[data-theme] body .local-status-strip {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    white-space: normal !important;
    scrollbar-width: auto !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .local-status-strip > span,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip > span,
  body[data-stage2ca="console-shell-cleanup"] .local-status-strip .badge,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .local-status-strip .badge,
  body .local-status-strip > span,
  html[data-theme] body .local-status-strip > span,
  body .local-status-strip .badge,
  html[data-theme] body .local-status-strip .badge {
    min-width: 0 !important;
    flex: 0 1 auto !important;
    white-space: normal !important;
  }
}

/* Stage3AY - make Beaver-inspired device behavior visible everywhere, not hidden in one route. */
.stage3ay-client-device-board {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) minmax(220px, 0.7fr);
  gap: 12px;
  align-items: stretch;
  margin: 12px 0;
  border-color: color-mix(in srgb, var(--d-brand) 24%, var(--d-border));
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--d-brand) 13%, transparent), transparent 34%),
    linear-gradient(135deg, var(--d-surface), var(--d-canvas));
}

.stage3ay-board-copy,
.stage3ay-board-next {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.stage3ay-board-copy h3,
.stage3ay-board-copy p,
.stage3ay-board-next strong,
.stage3ay-board-next small {
  margin: 0;
}

.stage3ay-board-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 1fr));
  gap: 9px;
  min-width: 0;
}

.stage3ay-board-next {
  padding: 13px;
  border: 1px solid var(--d-border);
  border-radius: 15px;
  background: var(--d-surface);
}

.stage3ay-board-next .btn {
  justify-self: start;
}

.stage3ay-device-open-card,
.stage2a-queue-row[data-stage3ay="queue-device-opens-workspace"],
.log-row[data-stage3ay="log-device-opens-workspace"],
.field-device[data-stage3ay="field-device-opens-workspace"],
.search-result[data-stage3ay="search-device-opens-workspace"] {
  cursor: pointer;
}

.stage3ay-device-open-card:hover,
.stage3ay-device-open-card:focus-visible,
.stage2a-queue-row[data-stage3ay="queue-device-opens-workspace"]:hover,
.stage2a-queue-row[data-stage3ay="queue-device-opens-workspace"]:focus-visible,
.log-row[data-stage3ay="log-device-opens-workspace"]:hover,
.log-row[data-stage3ay="log-device-opens-workspace"]:focus-visible,
.field-device[data-stage3ay="field-device-opens-workspace"]:hover,
.field-device[data-stage3ay="field-device-opens-workspace"]:focus-visible,
.search-result[data-stage3ay="search-device-opens-workspace"]:hover,
.search-result[data-stage3ay="search-device-opens-workspace"]:focus-visible {
  border-color: color-mix(in srgb, var(--d-brand) 42%, var(--d-border));
  box-shadow: 0 12px 28px rgba(0, 88, 58, 0.10);
}

.stage3ay-client-device-canvas {
  margin: 14px 0;
}

@media (max-width: 980px) {
  .stage3ay-client-device-board {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .stage3ay-board-pills {
    grid-template-columns: 1fr;
  }

  .stage3ay-client-device-board,
  .stage3ay-board-next {
    border-radius: 13px;
  }
}

/* Stage3AZ - visible Beaver-inspired operations layer: simple cards, predictable click paths. */
.stage3az-device-board {
  margin: 14px 0;
  border-color: color-mix(in srgb, var(--d-brand) 24%, var(--d-border));
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--d-brand) 10%, transparent), transparent 32%),
    linear-gradient(180deg, var(--d-surface), color-mix(in srgb, var(--d-canvas) 92%, var(--d-surface)));
}

.stage3az-board-head p {
  max-width: 760px;
}

.stage3az-device-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.stage3az-embedded-device-cards {
  grid-column: 1 / -1;
  min-width: 0;
}

.stage3az-device-tile {
  display: grid;
  gap: 12px;
  min-width: 0;
  min-height: 214px;
  padding: 14px;
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: var(--d-surface);
  box-shadow: 0 10px 24px rgba(3, 22, 16, 0.06);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.stage3az-device-tile:hover,
.stage3az-device-tile:focus-visible,
.stage3az-site-open-card:hover,
.stage3az-site-open-card:focus-visible,
.stage3az-site-open-row:hover,
.stage3az-site-open-row:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--d-brand) 44%, var(--d-border));
  box-shadow: 0 16px 34px rgba(0, 88, 58, 0.14);
  outline: none;
}

.stage3az-device-tile.warn {
  border-color: color-mix(in srgb, #b7791f 34%, var(--d-border));
}

.stage3az-device-tile header,
.stage3az-device-tile footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.stage3az-device-tile header strong,
.stage3az-device-tile header small,
.stage3az-device-tile footer span {
  min-width: 0;
}

.stage3az-device-tile header small,
.stage3az-device-tile footer span {
  color: var(--d-muted);
  font-size: 0.78rem;
}

.stage3az-device-tile footer {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 10px;
  border-top: 1px solid var(--d-border);
}

.stage3az-device-tile footer b {
  display: block;
  color: var(--d-ink);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stage3az-device-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--d-brand) 13%, var(--d-surface));
  color: var(--d-brand);
  font-weight: 900;
}

.stage3az-device-value {
  display: grid;
  gap: 3px;
}

.stage3az-device-value strong {
  font-size: clamp(1.45rem, 2.8vw, 2.35rem);
  line-height: 1;
}

.stage3az-device-value span {
  color: var(--d-muted);
}

.stage3az-device-spark {
  display: grid;
  align-items: stretch;
  width: 100%;
  min-height: 104px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(0, 142, 92, .055);
}

.stage3az-device-spark .spark,
.stage3az-device-spark svg {
  width: 100%;
  max-width: none;
  height: clamp(96px, 12vw, 138px) !important;
  min-height: 96px !important;
}

.stage3az-site-open-card,
.stage3az-site-open-row {
  cursor: pointer;
}

@media (max-width: 700px) {
  .stage3az-device-tile-grid {
    grid-template-columns: 1fr;
  }

  .stage3az-device-tile {
    border-radius: 15px;
    padding: 12px;
  }

  .stage3az-device-tile footer {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

/* Stage3BA - lean interface cleanup.
   Keep the useful paths visible, move explanation/reference material out of the daily view. */
body[data-stage3ba="lean-interface-cleanup"],
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] {
  --d-canvas: #f7faf8;
}

body[data-stage3ba="lean-interface-cleanup"] .workspace-head,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-head {
  padding: 14px 18px 8px !important;
  gap: 12px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .workspace-head h2,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-head h2 {
  font-size: clamp(22px, 2vw, 30px) !important;
  letter-spacing: -0.045em !important;
}

body[data-stage3ba="lean-interface-cleanup"] .workspace-head p,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-head p {
  max-width: 760px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
}

body[data-stage3ba="lean-interface-cleanup"] .workspace-content,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-content {
  gap: 12px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .topbar,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .topbar {
  min-height: 56px !important;
  padding-block: 8px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .api-status,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .api-status {
  display: none !important;
}

body[data-stage3ba="lean-interface-cleanup"] .subnav,
body[data-stage3ba="lean-interface-cleanup"] .page-tabs,
body[data-stage3ba="lean-interface-cleanup"] .quick-filter-bar,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .subnav,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .page-tabs,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .quick-filter-bar {
  margin-bottom: 8px !important;
  padding: 4px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .panel,
body[data-stage3ba="lean-interface-cleanup"] .metric,
body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card,
body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .panel,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .metric,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile {
  border-radius: 14px !important;
  box-shadow: none !important;
}

body[data-stage3ba="lean-interface-cleanup"] .panel-head,
body[data-stage3ba="lean-interface-cleanup"] .widget-shell-head,
body[data-stage3ba="lean-interface-cleanup"] .workbench-chrome,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .panel-head,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .widget-shell-head,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workbench-chrome {
  min-height: 42px !important;
  padding: 10px 12px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .panel-head p,
body[data-stage3ba="lean-interface-cleanup"] .widget-shell-head p,
body[data-stage3ba="lean-interface-cleanup"] .workbench-chrome p,
body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card p,
body[data-stage3ba="lean-interface-cleanup"] .stage3az-board-head p,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .panel-head p,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .widget-shell-head p,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workbench-chrome p,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card p,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-board-head p {
  display: none !important;
}

body[data-stage3ba="lean-interface-cleanup"] .focus-strip,
body[data-stage3ba="lean-interface-cleanup"] .metric-grid,
body[data-stage3ba="lean-interface-cleanup"] .overview-row,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .focus-strip,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .metric-grid,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .overview-row {
  gap: 8px !important;
  margin-block: 8px 10px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .metric,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .metric {
  min-height: 66px !important;
  padding: 10px 12px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .metric strong,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .metric strong {
  font-size: clamp(20px, 2vw, 26px) !important;
}

body[data-stage3ba="lean-interface-cleanup"] .metric small,
body[data-stage3ba="lean-interface-cleanup"] .metric span,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .metric small,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .metric span {
  font-size: 11px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .role-home-hero,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .role-home-hero {
  min-height: 0 !important;
  padding: 16px !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
}

body[data-stage3ba="lean-interface-cleanup"] .role-home-hero p,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .role-home-hero p {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
}

body[data-stage3ba="lean-interface-cleanup"] .score-ring,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .score-ring {
  width: 76px !important;
  height: 76px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .score-ring span,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .score-ring span {
  display: none !important;
}

body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-shell,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-shell {
  margin-block: 8px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .lean-widget-grid,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .lean-widget-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 8px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card {
  min-height: 0 !important;
  padding: 12px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card .widget-card-head .badge,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .dashboard-widget-card .widget-card-head .badge {
  display: none !important;
}

body[data-stage3ba="lean-interface-cleanup"] .stage3as-concept-panel,
body[data-stage3ba="lean-interface-cleanup"] .stage3ar-device-blueprint,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3as-concept-panel,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3ar-device-blueprint {
  display: none !important;
}

body[data-stage3ba="lean-interface-cleanup"] .lean-details-panel,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .lean-details-panel {
  padding: 0 !important;
  overflow: hidden;
}

body[data-stage3ba="lean-interface-cleanup"] .lean-details-panel > summary,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .lean-details-panel > summary {
  cursor: pointer;
  min-height: 42px;
  padding: 12px 14px;
  color: var(--d-text);
  font-weight: 850;
  list-style-position: inside;
}

body[data-stage3ba="lean-interface-cleanup"] .lean-details-panel > section,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .lean-details-panel > section {
  margin: 10px 12px 12px !important;
}

body[data-stage3ba="lean-interface-cleanup"] details.advanced-permissions:not([open]) > :not(summary),
body[data-stage3ba="lean-interface-cleanup"] details.access-setup-details:not([open]) > :not(summary),
body[data-stage3ba="lean-interface-cleanup"] details.lean-details-panel:not([open]) > :not(summary),
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] details.advanced-permissions:not([open]) > :not(summary),
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] details.access-setup-details:not([open]) > :not(summary),
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] details.lean-details-panel:not([open]) > :not(summary) {
  display: none !important;
}

body[data-stage3ba="lean-interface-cleanup"] .local-status-strip,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .local-status-strip {
  width: fit-content;
  max-width: min(100%, 760px);
  margin: 0 auto 10px !important;
  padding: 5px 8px !important;
  gap: 6px !important;
  border-radius: 999px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .local-status-strip .badge,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .local-status-strip .badge {
  font-size: 11px !important;
  padding: 3px 7px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-board,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-board {
  margin: 8px 0 !important;
}

body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile-grid,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile-grid {
  gap: 9px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile {
  gap: 9px !important;
  padding: 12px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile footer,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-tile footer {
  padding-top: 7px !important;
}

body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-value strong,
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-value strong {
  font-size: clamp(1.35rem, 2vw, 2rem) !important;
}

@media (max-width: 760px) {
  body[data-stage3ba="lean-interface-cleanup"] .workspace-head,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-head {
    padding: 10px 12px 6px !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] .workspace-head p,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-head p {
    display: none !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] .workspace-actions,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-actions {
    gap: 6px !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] .workspace-actions .btn.secondary,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .workspace-actions .btn.secondary {
    display: none !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] .role-home-hero,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .role-home-hero {
    grid-template-columns: 1fr !important;
    padding: 13px !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] .score-ring,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .score-ring {
    display: none !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] .panel,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .panel {
    border-radius: 12px !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] [data-quick-view="true"],
  body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-board .btn.secondary[data-action="open-easy-device-setup"],
  body[data-stage3ba="lean-interface-cleanup"] .section-link-action,
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] [data-quick-view="true"],
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .stage3az-device-board .btn.secondary[data-action="open-easy-device-setup"],
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .section-link-action {
    display: none !important;
  }

  body[data-stage3ba="lean-interface-cleanup"] .quick-filter-buttons .quick-filter:nth-of-type(n+6),
  html[data-theme] body[data-stage3ba="lean-interface-cleanup"] .quick-filter-buttons .quick-filter:nth-of-type(n+6) {
    display: none !important;
  }
}

body[data-stage3ba="lean-interface-cleanup"] button.btn[data-quick-view="true"],
body[data-stage3ba="lean-interface-cleanup"] button.btn.small.secondary[data-quick-view="true"],
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] button.btn[data-quick-view="true"],
html[data-theme] body[data-stage3ba="lean-interface-cleanup"] button.btn.small.secondary[data-quick-view="true"] {
  display: none !important;
}

/* Stage3BB - client-view site jumping and practical layout customization.
   Designer note: make preview mode feel deliberate, quiet, and fast to switch. */
body[data-stage3bb="client-view-site-jump-widget-layout"] .site-context-button.client-view-mode,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-context-button.client-view-mode {
  border-color: color-mix(in srgb, var(--d-brand) 52%, var(--d-border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--d-brand-soft) 85%, #fff), var(--d-surface));
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-context-button.client-view-mode .context-copy strong,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-context-button.client-view-mode .context-copy strong {
  letter-spacing: -0.02em;
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-menu,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-menu {
  border: 1px solid var(--d-border);
  border-radius: 16px;
  background: var(--d-surface);
  box-shadow: 0 18px 45px rgba(10, 31, 25, 0.13);
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-list,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-list {
  display: grid;
  gap: 5px;
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--d-text);
  text-align: left;
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row:hover,
body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row.active,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row:hover,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row.active {
  border-color: color-mix(in srgb, var(--d-brand) 34%, var(--d-border));
  background: var(--d-brand-soft);
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row span:nth-child(2),
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 1px;
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row strong,
body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row small,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row strong,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row small,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .site-switcher-row small {
  color: var(--d-text-soft);
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-controls select,
body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-controls option,
body[data-stage3bb="client-view-site-jump-widget-layout"] .widget-size-segment button,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-controls select,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-controls option,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .widget-size-segment button {
  color-scheme: light;
}

body[data-stage3bb="client-view-site-jump-widget-layout"] .widget-shell-actions,
html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .widget-shell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Stage3BC - lean visual hierarchy: one primary visual surface per job.
   Tables, model detail, raw context and repeated technical explanations stay available,
   but they no longer compete with the first screen. */
body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details {
  border: 1px solid color-mix(in srgb, var(--d-border) 86%, transparent);
  background: color-mix(in srgb, var(--d-surface) 92%, var(--d-brand-soft));
  box-shadow: none !important;
  margin-block: 8px !important;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  list-style: none;
  cursor: pointer;
  color: var(--d-text);
  font-weight: 900;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary::-webkit-details-marker,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary::-webkit-details-marker {
  display: none;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary::before,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary::before {
  content: "+";
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--d-brand-soft);
  color: var(--d-brand);
  font-weight: 950;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details[open] > summary::before,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details[open] > summary::before {
  content: "–";
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body > .panel,
body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body > .workbench-layout,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body > .panel,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body > .workbench-layout {
  margin: 0 !important;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .client-device-workspace .role-home-hero,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .client-device-workspace .role-home-hero {
  margin-bottom: 8px !important;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .integron-device-graphics .stage3ax-device-story,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .integron-device-graphics .stage3ax-device-story {
  margin: 8px 0 !important;
  padding: 9px 12px !important;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3az-device-board + .unifi-filter-strip,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3az-device-board + .unifi-filter-strip {
  margin-top: 4px !important;
}

body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-client-device-support,
html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-client-device-support {
  margin: 0 !important;
}

@media (max-width: 760px) {
  body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-banner,
  html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-banner {
    display: grid;
    gap: 12px;
  }

  body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-controls,
  html[data-theme] body[data-stage3bb="client-view-site-jump-widget-layout"] .client-view-preview-controls {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary,
  html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-supporting-details > summary {
    min-height: 44px;
    padding: 11px 12px;
  }

  body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body,
  html[data-theme] body[data-stage3bc="lean-visual-hierarchy-no-duplicates"] .stage3bc-details-body {
    padding-inline: 8px;
  }
}

/* Stage3BD - calm product shell visual QA.
   Users should see one obvious first action. Advanced tabs, tables and
   technical explanations remain available, but no longer compete for the
   first screen on normal work pages. */
body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head {
  align-items: flex-start;
  gap: 18px;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head .eyebrow,
body[data-stage3bd="calm-product-shell-visual-qa"] .panel-head .eyebrow,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head .eyebrow,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .panel-head .eyebrow {
  letter-spacing: 0.045em;
  color: color-mix(in srgb, var(--d-text-soft) 76%, transparent);
}

body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head > div > p:last-child,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head > div > p:last-child {
  max-width: 760px;
  line-height: 1.48;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-content,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-content {
  gap: 16px;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .subnav:empty,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .subnav:empty {
  display: none !important;
  margin: 0 !important;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .stage3ax-device-easy-board,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .stage3ax-device-easy-board {
  grid-template-columns: minmax(0, 1fr);
  border-color: color-mix(in srgb, var(--d-brand) 20%, var(--d-border));
  background:
    radial-gradient(circle at top left, rgba(0, 145, 96, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.94));
}

body[data-stage3bd="calm-product-shell-visual-qa"] .detail-drawer:not(.open),
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .detail-drawer:not(.open) {
  display: none !important;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .stage3ax-easy-copy p:not(.eyebrow),
body[data-stage3bd="calm-product-shell-visual-qa"] .stage3az-board-head p:not(.eyebrow),
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .stage3ax-easy-copy p:not(.eyebrow),
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .stage3az-board-head p:not(.eyebrow) {
  max-width: 58ch;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .unifi-filter-strip,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .unifi-filter-strip {
  padding: 10px;
  gap: 7px;
  border-radius: 16px;
  box-shadow: none;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .stage3bc-supporting-details,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .stage3bc-supporting-details {
  opacity: 0.92;
}

body[data-stage3bd="calm-product-shell-visual-qa"] .stage3bc-supporting-details:not([open]) .stage3bc-details-body,
html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .stage3bc-supporting-details:not([open]) .stage3bc-details-body {
  display: none;
}

@media (max-width: 760px) {
  body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head {
    gap: 12px;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head > div > p:last-child,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .workspace-head > div > p:last-child {
    font-size: 13px;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .unifi-filter-strip,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .unifi-filter-strip {
    overflow: visible;
    flex-wrap: wrap;
    scroll-snap-type: none;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .unifi-filter-strip .filter-chip,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .unifi-filter-strip .filter-chip {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    scroll-snap-align: none;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .quick-filter-buttons,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .quick-filter-buttons {
    overflow: visible !important;
    flex-wrap: wrap !important;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .quick-filter-buttons .quick-filter,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .quick-filter-buttons .quick-filter {
    min-width: 0 !important;
    flex: 1 1 calc(50% - 8px) !important;
    justify-content: center;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .subnav,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .subnav {
    flex-wrap: wrap;
    overflow: visible;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .subnav .subnav-btn,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .subnav .subnav-btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .integron-device-chart .sensor-chart-wrap,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .integron-device-chart .sensor-chart-wrap {
    overflow-x: hidden;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .integron-device-chart .sensor-history-chart:not(.compact),
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .integron-device-chart .sensor-history-chart:not(.compact) {
    min-width: 0;
    max-width: 100%;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .site-toolbar.quick-filter-bar,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .site-toolbar.quick-filter-bar {
    align-items: stretch;
  }
}

@media (max-width: 1024px) {
  body[data-stage3bd="calm-product-shell-visual-qa"] .console-left,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .console-left {
    height: 64px !important;
    min-height: 64px !important;
    overflow: visible !important;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .sidebar,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .sidebar,
  body[data-stage3bd="calm-product-shell-visual-qa"] .console-left-body,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .console-left-body {
    height: 64px !important;
    min-height: 64px !important;
    overflow: visible !important;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .site-context-selector,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .site-context-selector {
    display: none !important;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .main-nav,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .main-nav {
    height: 64px !important;
    min-height: 64px !important;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    align-items: center !important;
    align-content: center !important;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .main-nav .nav-btn.mobile-window,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .main-nav .nav-btn.mobile-window {
    height: 52px !important;
    min-height: 52px !important;
    align-self: center !important;
  }

  body[data-stage3bd="calm-product-shell-visual-qa"] .main-nav .nav-btn.mobile-window.active,
  html[data-theme] body[data-stage3bd="calm-product-shell-visual-qa"] .main-nav .nav-btn.mobile-window.active {
    box-shadow: none !important;
    background: var(--d-brand-soft) !important;
  }
}

/* Stage3BF - client view clarity.
   This is not another hidden CSS layer over the old dashboard: the client home is now a dedicated,
   low-noise overview with one status answer, one attention list, one values strip, and details on demand. */
body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .workspace-head,
html[data-theme] body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .workspace-head {
  padding-bottom: 4px !important;
}

body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .workspace-head .workspace-actions,
html[data-theme] body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .workspace-head .workspace-actions {
  display: none !important;
}

.client-clarity-shell {
  display: grid;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.client-clarity-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: clamp(18px, 2.2vw, 28px) !important;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--d-brand) 20%, var(--d-border));
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--d-brand) 11%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--d-surface) 94%, white), color-mix(in srgb, var(--d-canvas) 86%, white));
}

.client-clarity-hero.warn {
  border-color: color-mix(in srgb, #b7791f 35%, var(--d-border));
  background:
    radial-gradient(circle at 0% 0%, rgba(183, 121, 31, 0.12), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--d-surface) 96%, white), color-mix(in srgb, var(--d-canvas) 88%, white));
}

.client-clarity-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.client-clarity-copy .eyebrow,
.client-clarity-copy h3,
.client-clarity-copy p {
  margin: 0;
}

.client-clarity-copy h3 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.client-clarity-copy p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--d-muted);
  font-size: clamp(14px, 1.45vw, 16px);
}

.client-clarity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.client-clarity-health {
  display: grid;
  place-items: center;
  width: clamp(96px, 10vw, 132px);
  height: clamp(96px, 10vw, 132px);
  border-radius: 34px;
  border: 1px solid color-mix(in srgb, var(--d-brand) 30%, var(--d-border));
  background: color-mix(in srgb, var(--d-brand-soft) 48%, white);
  color: var(--d-brand);
}

.client-clarity-health strong {
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.client-clarity-health span {
  color: var(--d-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

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

.client-clarity-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: var(--d-surface);
  color: var(--d-text);
  text-align: left;
  box-shadow: none;
}

button.client-clarity-stat {
  cursor: pointer;
}

button.client-clarity-stat:hover,
button.client-clarity-stat:focus-visible {
  border-color: color-mix(in srgb, var(--d-brand) 40%, var(--d-border));
  outline: none;
}

.client-clarity-stat span {
  color: var(--d-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-clarity-stat strong {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.client-clarity-stat small {
  color: var(--d-muted);
  font-size: 12px;
}

.client-clarity-stat.good {
  border-color: color-mix(in srgb, var(--d-brand) 20%, var(--d-border));
}

.client-clarity-stat.warn {
  border-color: color-mix(in srgb, #b7791f 35%, var(--d-border));
  background: color-mix(in srgb, #fff7ed 45%, var(--d-surface));
}

.client-clarity-stat.danger {
  border-color: color-mix(in srgb, #b42318 34%, var(--d-border));
  background: color-mix(in srgb, #fff1f2 42%, var(--d-surface));
}

.client-clarity-main {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(0, 1.14fr);
  gap: 14px;
  align-items: start;
}

.client-clarity-card {
  display: grid;
  gap: 14px;
  padding: 18px !important;
}

.client-clarity-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.client-clarity-card-head .eyebrow,
.client-clarity-card-head h3 {
  margin: 0;
}

.client-clarity-card-head h3 {
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -0.045em;
}

.client-clarity-list {
  display: grid;
  gap: 8px;
}

.client-clarity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--d-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--d-surface) 95%, white);
}

.client-clarity-row.warn {
  border-color: color-mix(in srgb, #b7791f 30%, var(--d-border));
}

.client-clarity-row.danger {
  border-color: color-mix(in srgb, #b42318 30%, var(--d-border));
}

.client-clarity-row-main {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--d-text);
  text-align: left;
  cursor: pointer;
}

.client-clarity-row-main strong,
.client-clarity-row-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-clarity-row-main small {
  color: var(--d-muted);
  font-size: 12px;
}

.client-clarity-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--d-brand);
}

.client-clarity-row.warn .client-clarity-dot {
  background: #b7791f;
}

.client-clarity-row.danger .client-clarity-dot {
  background: #b42318;
}

.client-clarity-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--d-brand) 24%, var(--d-border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--d-brand-soft) 45%, var(--d-surface));
}

.client-clarity-empty-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 14px;
  background: var(--d-brand);
  color: white;
  font-weight: 950;
}

.client-clarity-empty strong,
.client-clarity-empty small {
  display: block;
}

.client-clarity-empty small {
  color: var(--d-muted);
}

.client-clarity-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-clarity-device {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: var(--d-surface);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.client-clarity-device:hover,
.client-clarity-device:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--d-brand) 42%, var(--d-border));
  outline: none;
}

.client-clarity-device.warn {
  border-color: color-mix(in srgb, #b7791f 32%, var(--d-border));
}

.client-clarity-device header,
.client-clarity-device footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.client-clarity-device header > span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: color-mix(in srgb, var(--d-brand) 12%, var(--d-surface));
  color: var(--d-brand);
  font-weight: 950;
}

.client-clarity-device header div {
  min-width: 0;
}

.client-clarity-device header strong,
.client-clarity-device header small,
.client-clarity-device footer span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-clarity-device header small,
.client-clarity-device footer span,
.client-clarity-value small {
  color: var(--d-muted);
  font-size: 12px;
}

.client-clarity-value {
  display: grid;
  gap: 2px;
}

.client-clarity-value strong {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.client-clarity-spark .spark,
.client-clarity-spark svg {
  width: 100%;
  max-width: none;
}

.client-clarity-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.client-clarity-last-update {
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--d-border);
  border-radius: 999px;
  background: var(--d-surface);
  color: var(--d-muted);
  font-size: 12px;
  font-weight: 800;
}

.client-clarity-details {
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: var(--d-surface);
  overflow: hidden;
}

.client-clarity-details > summary {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 15px 18px;
  cursor: pointer;
  list-style-position: inside;
}

.client-clarity-details > summary strong,
.client-clarity-details > summary small {
  display: block;
}

.client-clarity-details > summary small {
  color: var(--d-muted);
  font-weight: 600;
}

.client-clarity-details-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.client-clarity-detail-panel {
  box-shadow: none !important;
}

body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .role-dashboard-client,
html[data-theme] body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .role-dashboard-client {
  display: none !important;
}

@media (max-width: 980px) {
  .client-clarity-hero,
  .client-clarity-main {
    grid-template-columns: 1fr;
  }

  .client-clarity-health {
    justify-self: start;
  }

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

@media (max-width: 640px) {
  body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .workspace-head,
  html[data-theme] body[data-stage3bf="client-view-clarity"][data-route="client-preview"] .workspace-head {
    padding-inline: 12px !important;
  }

  .client-clarity-shell {
    gap: 10px;
  }

  .client-clarity-hero,
  .client-clarity-card {
    border-radius: 16px !important;
    padding: 14px !important;
  }

  .client-clarity-copy h3 {
    font-size: clamp(25px, 9vw, 34px);
  }

  .client-clarity-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .client-clarity-health {
    display: none;
  }

  .client-clarity-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .client-clarity-device-grid {
    grid-template-columns: 1fr;
  }

  .client-clarity-stat {
    min-height: 58px;
    padding: 10px;
  }

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

  .client-clarity-row .btn {
    justify-self: stretch;
  }

  .client-clarity-row-main strong,
  .client-clarity-row-main small,
  .client-clarity-device header strong,
  .client-clarity-device header small,
  .client-clarity-device footer span {
    white-space: normal;
  }

  .client-clarity-device footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* Stage3BG - client Home visual QA.
   This pass intentionally makes the client-facing home calmer: less hero drama, fewer visual boxes,
   clearer alignment, and only the information a client needs to decide what to do next. */
body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] #workspaceTitle,
html[data-theme] body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] #workspaceTitle {
  letter-spacing: -0.04em;
}

body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] #workspaceSubtitle,
html[data-theme] body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] #workspaceSubtitle {
  max-width: 54ch;
  color: color-mix(in srgb, var(--d-muted) 82%, var(--d-text));
}

.client-polish-home {
  max-width: 1100px;
  gap: 12px;
}

.client-polish-hero {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 18px 20px !important;
  border-radius: 24px !important;
  border-color: color-mix(in srgb, var(--d-brand) 16%, var(--d-border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--d-surface) 98%, white), color-mix(in srgb, var(--d-canvas) 72%, white));
  box-shadow: 0 18px 50px rgba(8, 21, 17, 0.045);
}

.client-polish-hero > * {
  min-width: 0;
}

.client-polish-hero.warn {
  border-color: color-mix(in srgb, #b7791f 24%, var(--d-border));
  background:
    linear-gradient(135deg, color-mix(in srgb, #fffbeb 38%, var(--d-surface)), color-mix(in srgb, var(--d-canvas) 72%, white));
}

.client-polish-copy {
  gap: 5px;
}

.client-polish-copy h3 {
  max-width: 18ch;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.06;
  letter-spacing: -0.052em;
  overflow-wrap: anywhere;
}

.client-polish-copy p:not(.eyebrow) {
  max-width: 58ch;
  font-size: 14px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.client-polish-score {
  display: grid;
  place-items: start end;
  box-sizing: border-box;
  width: auto;
  height: auto;
  min-width: 104px;
  padding: 11px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--d-brand-soft) 34%, var(--d-surface));
}

.client-polish-score span {
  order: -1;
  display: block;
  max-width: 100%;
  color: var(--d-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.client-polish-score strong {
  display: block;
  max-width: 100%;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.055em;
}

.client-polish-score em {
  display: none;
  font-style: normal;
}

.client-polish-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.client-polish-actions .btn,
.client-polish-actions .section-link-action {
  min-height: 40px;
  border-radius: 14px;
}

.client-polish-actions .section-link-action {
  padding-inline: 12px;
  border: 1px solid var(--d-border);
  background: var(--d-surface);
}

.client-polish-status-rail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.client-polish-status-rail .client-clarity-stat {
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--d-surface) 97%, white);
}

.client-polish-status-rail .client-clarity-stat strong {
  font-size: 18px;
  letter-spacing: -0.035em;
}

.client-polish-status-rail .client-clarity-stat small,
.client-polish-status-rail .client-clarity-stat span {
  font-size: 10.5px;
}

.client-polish-board {
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.client-polish-board .client-clarity-card {
  padding: 16px !important;
  border-radius: 22px !important;
  box-shadow: 0 14px 44px rgba(8, 21, 17, 0.035);
}

.client-polish-board .client-clarity-card-head h3 {
  font-size: clamp(18px, 1.8vw, 22px);
}

.client-polish-board .client-clarity-card-head .badge {
  align-self: center;
}

.client-clarity-row {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.client-clarity-row-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--d-brand-soft) 55%, var(--d-surface));
  color: var(--d-brand);
  font-size: 11px;
  font-weight: 900;
}

.client-clarity-row:hover,
.client-clarity-row:focus-visible {
  border-color: color-mix(in srgb, var(--d-brand) 40%, var(--d-border));
  outline: none;
  transform: translateY(-1px);
}

.client-polish-board .client-clarity-device-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.client-polish-board .client-clarity-device {
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 10px 14px;
  padding: 12px;
  border-radius: 16px;
}

.client-polish-board .client-clarity-device header {
  justify-content: flex-start;
}

.client-polish-board .client-clarity-device .client-clarity-value {
  justify-items: end;
  text-align: right;
}

.client-polish-board .client-clarity-device .client-clarity-value strong {
  font-size: clamp(20px, 2.4vw, 28px);
}

.client-polish-board .client-clarity-device .client-clarity-spark {
  grid-column: 1 / -1;
}

.client-polish-board .client-clarity-device footer {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.client-clarity-details {
  border-radius: 16px;
}

.client-clarity-details > summary {
  min-height: 48px;
  padding: 13px 16px;
}

.client-clarity-last-update {
  justify-self: end;
  margin-top: -4px;
}

@media (max-width: 1120px) {
  .client-polish-hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .client-polish-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] .workspace,
  body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] .workspace-main,
  body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] .workspace-body,
  body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] #workspaceContent,
  html[data-theme] body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] .workspace,
  html[data-theme] body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] .workspace-main,
  html[data-theme] body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] .workspace-body,
  html[data-theme] body[data-stage3bg="client-home-visual-qa"][data-route="client-preview"] #workspaceContent {
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }

  .client-polish-home,
  .client-polish-home > *,
  .client-polish-hero,
  .client-polish-status-rail,
  .client-polish-board,
  .client-polish-board > *,
  .client-clarity-row,
  .client-clarity-device {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
  }

  .client-polish-home {
    gap: 9px;
    width: 100%;
    overflow-x: hidden;
  }

  .client-polish-hero,
  .client-polish-board {
    grid-template-columns: 1fr;
  }

  .client-polish-hero {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .client-polish-copy h3 {
    max-width: 100%;
    font-size: clamp(23px, 7vw, 30px);
    line-height: 1.08;
  }

  .client-polish-score {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    gap: 12px;
    overflow: hidden;
  }

  .client-polish-score strong {
    display: none;
  }

  .client-polish-score span {
    flex: 1 1 auto;
    text-align: left;
  }

  .client-polish-score em {
    display: inline;
    margin-left: 8px;
    color: var(--d-brand);
    font-weight: 950;
    letter-spacing: -0.02em;
  }

  .client-polish-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .client-polish-actions .btn,
  .client-polish-actions .section-link-action {
    width: 100%;
    justify-content: center;
  }

  .client-polish-status-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-polish-status-rail .client-clarity-stat {
    min-height: 50px;
  }

  .client-polish-board .client-clarity-card {
    padding: 14px !important;
    border-radius: 18px !important;
  }

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

  .client-clarity-row-open {
    display: none;
  }

  .client-polish-board .client-clarity-device {
    grid-template-columns: 1fr;
  }

  .client-polish-board .client-clarity-device .client-clarity-value {
    justify-items: start;
    text-align: left;
  }

  .client-clarity-last-update {
    justify-self: stretch;
    text-align: center;
  }
}

/* Stage3BH - client Home redesign.
   The client-facing home should read like a calm operational cockpit, not a stack of admin cards.
   Stage3BG selectors remain above for compatibility; this layer takes priority on the client Home route. */
body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-body,
body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-body,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent {
  width: 100%;
  max-width: none;
  overflow-x: hidden;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceTitle,
body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceSubtitle,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceTitle,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceSubtitle {
  display: none !important;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-head,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-head {
  display: none !important;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace,
body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-main,
body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-body,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-main,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .workspace-body {
  border-color: transparent !important;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent::before,
body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent::after,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent::before,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] #workspaceContent::after {
  display: none !important;
  content: none !important;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner {
  width: min(100%, 1420px);
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 10px 12px;
  border-radius: 16px;
  border-color: color-mix(in srgb, var(--d-brand) 28%, var(--d-border));
  background: color-mix(in srgb, var(--d-brand-soft) 54%, var(--d-surface));
  box-shadow: none;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner strong,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner strong {
  font-size: 13px;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner span,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner span {
  font-size: 11.5px;
}

body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-controls select,
html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-controls select {
  min-height: 36px;
  border-radius: 12px;
}

.client-home-redesign {
  width: min(100%, 1420px);
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  gap: 12px;
}

.client-home-redesign .client-home-topline {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px !important;
  border-radius: 26px !important;
  border: 1px solid color-mix(in srgb, var(--d-brand) 18%, var(--d-border));
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--d-brand-soft) 48%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--d-surface) 98%, white), color-mix(in srgb, var(--d-canvas) 86%, white));
  box-shadow: 0 18px 52px rgba(7, 22, 18, 0.045);
}

.client-home-redesign .client-home-topline.warn {
  border-color: color-mix(in srgb, #b7791f 34%, var(--d-border));
  background:
    radial-gradient(circle at 0 0, rgba(183, 121, 31, 0.10), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, #fffaf0 34%, var(--d-surface)), color-mix(in srgb, var(--d-canvas) 88%, white));
}

.client-home-redesign .client-home-titleblock {
  gap: 5px;
}

.client-home-redesign .client-home-titleblock h3 {
  max-width: 28ch;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1;
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
  white-space: normal;
}

.client-home-redesign .client-home-titleblock p:not(.eyebrow) {
  max-width: 60ch;
  color: color-mix(in srgb, var(--d-muted) 82%, var(--d-text));
  font-size: 14px;
}

.client-home-redesign .client-home-health {
  display: grid;
  place-items: center;
  min-width: 106px;
  min-height: 68px;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--d-brand) 22%, var(--d-border));
  background: color-mix(in srgb, var(--d-brand-soft) 38%, var(--d-surface));
}

.client-home-redesign .client-home-health.warn {
  border-color: color-mix(in srgb, #b7791f 35%, var(--d-border));
  background: color-mix(in srgb, #fff4d6 52%, var(--d-surface));
  color: #8a5a0a;
}

.client-home-redesign .client-home-health.danger {
  border-color: color-mix(in srgb, #b42318 34%, var(--d-border));
  background: color-mix(in srgb, #fee4e2 50%, var(--d-surface));
  color: #b42318;
}

.client-home-redesign .client-home-health strong {
  font-size: clamp(26px, 2.8vw, 36px);
}

.client-home-redesign .client-home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 280px;
}

.client-home-redesign .client-home-actions .btn,
.client-home-redesign .client-home-actions .section-link-action {
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 14px;
  white-space: nowrap;
}

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

.client-home-redesign .client-home-metric {
  display: grid;
  justify-items: start;
  align-content: center;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--d-border) 88%, var(--d-brand-soft));
  background: color-mix(in srgb, var(--d-surface) 98%, white);
  box-shadow: none;
  text-align: left;
}

.client-home-redesign button.client-home-metric {
  cursor: pointer;
}

.client-home-redesign .client-home-metric:hover,
.client-home-redesign .client-home-metric:focus-visible {
  border-color: color-mix(in srgb, var(--d-brand) 38%, var(--d-border));
  outline: none;
}

.client-home-redesign .client-home-metric span {
  color: var(--d-muted);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.client-home-redesign .client-home-metric strong {
  margin-top: 3px;
  font-size: clamp(18px, 1.65vw, 24px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.client-home-redesign .client-home-metric small {
  margin-top: 3px;
  color: var(--d-text-soft);
  font-size: 12px;
}

.client-home-redesign .client-home-workbench {
  display: grid;
  grid-template-columns: minmax(380px, 0.78fr) minmax(560px, 1.22fr);
  align-items: start;
  gap: 12px;
}

.client-home-redesign .client-home-focus,
.client-home-redesign .client-home-values {
  padding: 18px !important;
  border-radius: 24px !important;
  border-color: color-mix(in srgb, var(--d-border) 88%, var(--d-brand-soft));
  background: color-mix(in srgb, var(--d-surface) 98%, white);
  box-shadow: 0 16px 46px rgba(7, 22, 18, 0.035);
}

.client-home-redesign .client-home-focus {
  min-height: 250px;
}

.client-home-redesign .client-home-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.client-home-redesign .client-home-card-head > div {
  min-width: 0;
}

.client-home-redesign .client-home-card-head h3 {
  margin: 2px 0 0;
  max-width: 100%;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  white-space: normal;
}

.client-home-redesign .client-home-card-head small {
  display: block;
  max-width: 58ch;
  margin-top: 5px;
  color: var(--d-text-soft);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.client-home-redesign .client-home-attention-list {
  display: grid;
  gap: 8px;
}

.client-home-redesign .client-clarity-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--d-canvas) 58%, var(--d-surface));
  box-shadow: none;
}

.client-home-redesign .client-clarity-row-main {
  min-width: 0;
}

.client-home-redesign .client-clarity-row-main strong {
  font-size: 13.5px;
}

.client-home-redesign .client-clarity-row-main small {
  color: var(--d-text-soft);
  font-size: 12px;
  line-height: 1.35;
}

.client-home-redesign .client-clarity-row-open {
  min-height: 32px;
  padding-inline: 12px;
}

.client-home-redesign .client-home-value-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.client-home-redesign .client-home-value-row {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(116px, auto) minmax(130px, 0.8fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--d-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--d-surface) 98%, white);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.client-home-redesign .client-home-value-row:hover,
.client-home-redesign .client-home-value-row:focus-visible {
  border-color: color-mix(in srgb, var(--d-brand) 38%, var(--d-border));
  outline: none;
  transform: translateY(-1px);
}

.client-home-redesign .client-home-value-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--d-brand-soft) 58%, var(--d-surface));
  color: var(--d-brand);
  font-size: 12px;
  font-weight: 950;
}

.client-home-redesign .client-home-value-name,
.client-home-redesign .client-home-value-reading,
.client-home-redesign .client-home-value-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.client-home-redesign .client-home-value-name strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-home-redesign .client-home-value-name small,
.client-home-redesign .client-home-value-reading small,
.client-home-redesign .client-home-value-meta small {
  color: var(--d-text-soft);
  font-size: 11.5px;
  line-height: 1.25;
}

.client-home-redesign .client-home-value-reading {
  justify-items: end;
  text-align: right;
}

.client-home-redesign .client-home-value-reading strong {
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.client-home-redesign .client-home-value-spark {
  display: grid;
  place-items: center;
  min-width: 0;
}

.client-home-redesign .client-home-value-meta {
  justify-items: end;
  text-align: right;
}

.client-home-redesign .client-home-last-update {
  justify-self: end;
  margin-top: -2px;
  color: var(--d-text-soft);
  font-size: 11.5px;
}

.client-home-redesign .client-clarity-details {
  border-radius: 18px;
  background: color-mix(in srgb, var(--d-surface) 96%, white);
}

.client-home-redesign .client-clarity-details > summary {
  min-height: 44px;
  padding: 12px 14px;
}

.client-home-redesign .client-clarity-details > summary strong {
  font-size: 13px;
}

.client-home-redesign .client-clarity-details > summary small {
  display: none;
}

@media (max-width: 1180px) {
  .client-home-redesign .client-home-topline {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .client-home-redesign .client-home-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    min-width: 0;
  }

  .client-home-redesign .client-home-workbench {
    grid-template-columns: 1fr;
  }

  .client-home-redesign .client-home-focus {
    min-height: 0;
  }
}

@media (max-width: 860px) {
  body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner,
  html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner,
  .client-home-redesign {
    width: 100%;
    max-width: 100%;
  }

  body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner,
  html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-banner {
    display: grid;
    gap: 10px;
  }

  body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-controls,
  html[data-theme] body[data-stage3bh="client-home-redesign"][data-route="client-preview"] .client-view-preview-controls {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .client-home-redesign .client-home-topline,
  .client-home-redesign .client-home-workbench,
  .client-home-redesign .client-home-value-row {
    grid-template-columns: 1fr;
  }

  .client-home-redesign .client-home-topline {
    padding: 16px !important;
    border-radius: 22px !important;
  }

  .client-home-redesign .client-home-titleblock h3 {
    max-width: 100%;
    font-size: clamp(24px, 7.2vw, 31px);
    line-height: 1.05;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .client-home-redesign .client-home-health {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 56px;
  }

  .client-home-redesign .client-home-actions,
  .client-home-redesign .client-home-actions .btn,
  .client-home-redesign .client-home-actions .section-link-action {
    width: 100%;
  }

  .client-home-redesign .client-home-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .client-home-redesign .client-home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-home-redesign .client-home-card-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .client-home-redesign .client-home-card-head .badge,
  .client-home-redesign .client-home-card-head .section-link-action {
    justify-self: start;
  }

  .client-home-redesign .client-home-value-reading,
  .client-home-redesign .client-home-value-meta {
    justify-items: start;
    text-align: left;
  }

  .client-home-redesign .client-home-last-update {
    justify-self: stretch;
    text-align: center;
  }
}

@media (max-width: 340px) {
  .client-home-redesign .client-home-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .client-home-redesign .client-home-focus,
  .client-home-redesign .client-home-values {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    padding: 14px !important;
    border-radius: 20px !important;
  }

  .client-home-redesign .client-home-card-head h3 {
    font-size: clamp(20px, 5.8vw, 24px);
    word-break: break-word;
    white-space: normal !important;
  }
}

/* Stage 3BJ: one predictable page scroll.
 * Earlier mobile rescue layers contained overscroll on html/body and the
 * bottom rail only advertised horizontal touch handling. That made real
 * mousepads/touchpads feel stuck on long Training, Demo, and Client screens.
 * Keep containment for drawers/modals, but let the main document scroll like
 * normal software everywhere. */
html,
body {
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto !important;
  scroll-behavior: auto !important;
}

body {
  min-width: 0;
  touch-action: pan-y pinch-zoom;
}

body[data-stage3bj="scroll-and-human-logic-qa"] .app-shell,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .app-shell,
body[data-stage3bj="scroll-and-human-logic-qa"] .workspace,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .workspace,
body[data-stage3bj="scroll-and-human-logic-qa"] .workspace-content,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .workspace-content {
  min-height: 0;
  overflow-y: visible !important;
  overscroll-behavior-y: auto !important;
}

body[data-stage3bj="scroll-and-human-logic-qa"] .main-nav,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .main-nav {
  overscroll-behavior: auto !important;
  touch-action: pan-x pan-y pinch-zoom !important;
}

body[data-stage3bj="scroll-and-human-logic-qa"] .detail-drawer,
body[data-stage3bj="scroll-and-human-logic-qa"] .drawer-body,
body[data-stage3bj="scroll-and-human-logic-qa"] .modal-body,
body[data-stage3bj="scroll-and-human-logic-qa"] .account-menu,
body[data-stage3bj="scroll-and-human-logic-qa"] .site-switcher-menu,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .detail-drawer,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .drawer-body,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .modal-body,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .account-menu,
html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .site-switcher-menu {
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1024px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
  }

  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-stage3bj="scroll-and-human-logic-qa"] .app-shell,
  html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .app-shell {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-stage3bj="scroll-and-human-logic-qa"] .workspace,
  html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .workspace {
    min-height: auto !important;
  }

  body[data-stage3bj="scroll-and-human-logic-qa"] .workspace-content,
  html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .workspace-content {
    padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-stage3bj="scroll-and-human-logic-qa"] .console-left,
  html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .console-left,
  body[data-stage3bj="scroll-and-human-logic-qa"] .main-nav,
  html[data-theme] body[data-stage3bj="scroll-and-human-logic-qa"] .main-nav {
    touch-action: pan-x pan-y pinch-zoom !important;
  }
}
/* Stage 3BL: large-site device board and control-room wallboard */
.stage3bl-device-board {
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}

.stage3bl-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.stage3bl-board-head h3 {
  margin: 0;
  font-size: clamp(1.05rem, 1vw + .9rem, 1.45rem);
  letter-spacing: -.02em;
}

.stage3bl-board-head p {
  margin: 4px 0 0;
  color: var(--muted, #60736b);
  line-height: 1.35;
}

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

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

.stage3bl-status-strip span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(16, 44, 34, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink, #102c22);
  font-size: .82rem;
}

.stage3bl-status-strip b {
  font-size: 1rem;
}

.stage3bl-status-strip .good {
  border-color: rgba(0, 142, 92, .2);
  background: rgba(232, 250, 242, .75);
}

.stage3bl-status-strip .warn {
  border-color: rgba(190, 132, 0, .26);
  background: rgba(255, 248, 229, .8);
}

.stage3bl-group-grid {
  display: grid;
  gap: 12px;
}

.stage3bl-device-group {
  display: grid;
  gap: 10px;
}

.stage3bl-device-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink, #102c22);
}

.stage3bl-device-group > header small {
  color: var(--muted, #60736b);
}

.stage3bl-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.stage3bl-device-card {
  container-type: inline-size;
  display: grid;
  gap: 6px;
  min-width: 0;
  min-height: 138px;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid rgba(16, 44, 34, .12);
  border-left: 4px solid var(--stage3bl-tone, #00975f);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  color: var(--ink, #102c22);
  box-shadow: 0 8px 24px rgba(13, 37, 29, .05);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.stage3bl-device-card:hover,
.stage3bl-device-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(0, 142, 92, .35);
  background: #fff;
  box-shadow: 0 14px 32px rgba(13, 37, 29, .1);
  outline: none;
}

.stage3bl-device-card.good { --stage3bl-tone: #00975f; }
.stage3bl-device-card.watch { --stage3bl-tone: #5b8def; }
.stage3bl-device-card.warn { --stage3bl-tone: #c88700; }
.stage3bl-device-card.danger { --stage3bl-tone: #c73939; }

.stage3bl-device-main {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.stage3bl-device-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(0, 142, 92, .11);
  color: #00794f;
  font-weight: 800;
}

.stage3bl-device-main strong,
.stage3bl-device-main small,
.stage3bl-device-reading strong,
.stage3bl-device-reading small,
.stage3bl-device-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage3bl-device-main strong {
  font-size: .92rem;
}

.stage3bl-device-main small,
.stage3bl-device-reading small,
.stage3bl-device-meta small {
  color: var(--muted, #60736b);
  font-size: .74rem;
}

.stage3bl-device-reading {
  min-width: 0;
}

.stage3bl-device-reading strong {
  font-size: clamp(1.05rem, .75vw + .9rem, 1.45rem);
  letter-spacing: -.03em;
}

.stage3bl-device-spark {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  width: 100%;
  min-height: 72px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(0, 142, 92, .06);
}

.stage3bl-device-spark .sensor-history-chart.compact,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact {
  display: block;
  width: 100% !important;
  height: clamp(72px, 12cqw, 118px) !important;
  min-height: 72px !important;
}

.stage3bl-device-spark .sensor-chart-bg,
html[data-theme] .stage3bl-device-spark .sensor-chart-bg {
  rx: 10;
}

.stage3bl-device-spark .sensor-history-chart.compact[data-stage3fd="compact-measured-preview"],
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact[data-stage3fd="compact-measured-preview"],
.stage3az-device-spark .sensor-history-chart.compact[data-stage3fd="compact-measured-preview"],
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact[data-stage3fd="compact-measured-preview"] {
  color: var(--d-brand);
  overflow: visible;
}

.stage3bl-device-spark .sensor-history-chart.compact .sensor-history-line,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact .sensor-history-line,
.stage3az-device-spark .sensor-history-chart.compact .sensor-history-line,
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact .sensor-history-line {
  stroke: var(--d-brand) !important;
  stroke-width: 2.4 !important;
  vector-effect: non-scaling-stroke;
  opacity: .95 !important;
  filter: none !important;
}

.stage3bl-device-spark .sensor-history-chart.compact .sensor-history-area,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact .sensor-history-area,
.stage3az-device-spark .sensor-history-chart.compact .sensor-history-area,
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact .sensor-history-area {
  opacity: .14 !important;
}

.stage3bl-device-spark .sensor-history-chart.compact .sensor-target-band,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact .sensor-target-band,
.stage3az-device-spark .sensor-history-chart.compact .sensor-target-band,
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact .sensor-target-band {
  fill: color-mix(in srgb, var(--d-brand) 8%, transparent) !important;
}

.stage3bl-device-spark .sensor-history-chart.compact .sensor-sample-dot,
.stage3bl-device-spark .sensor-history-chart.compact .sensor-event-dot,
.stage3bl-device-spark .sensor-history-chart.compact .sensor-command-dot,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact .sensor-sample-dot,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact .sensor-event-dot,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact .sensor-command-dot,
.stage3az-device-spark .sensor-history-chart.compact .sensor-sample-dot,
.stage3az-device-spark .sensor-history-chart.compact .sensor-event-dot,
.stage3az-device-spark .sensor-history-chart.compact .sensor-command-dot,
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact .sensor-sample-dot,
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact .sensor-event-dot,
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact .sensor-command-dot {
  display: none !important;
}

.stage3bl-device-spark .sensor-compact-latest-dot,
html[data-theme] .stage3bl-device-spark .sensor-compact-latest-dot,
.stage3az-device-spark .sensor-compact-latest-dot,
html[data-theme] .stage3az-device-spark .sensor-compact-latest-dot {
  fill: var(--d-brand) !important;
  stroke: var(--d-surface) !important;
  stroke-width: 1.9 !important;
  vector-effect: non-scaling-stroke;
}

.stage3bl-device-spark .sensor-compact-state-line,
.stage3az-device-spark .sensor-compact-state-line,
.sensor-device-measurement-chart .sensor-compact-state-line,
.sensor-value-mini .sensor-compact-state-line,
html[data-theme] .stage3bl-device-spark .sensor-compact-state-line,
html[data-theme] .stage3az-device-spark .sensor-compact-state-line,
html[data-theme] .sensor-device-measurement-chart .sensor-compact-state-line,
html[data-theme] .sensor-value-mini .sensor-compact-state-line {
  stroke: color-mix(in srgb, var(--d-ink) 34%, transparent) !important;
  stroke-width: 1.6 !important;
  stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke;
}

.sensor-compact-state-wrap,
html[data-theme] .sensor-compact-state-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.stage3bl-device-spark .sensor-compact-state-label,
.stage3az-device-spark .sensor-compact-state-label,
.sensor-device-measurement-chart .sensor-compact-state-label,
.sensor-value-mini .sensor-compact-state-label,
html[data-theme] .stage3bl-device-spark .sensor-compact-state-label,
html[data-theme] .stage3az-device-spark .sensor-compact-state-label,
html[data-theme] .sensor-device-measurement-chart .sensor-compact-state-label,
html[data-theme] .sensor-value-mini .sensor-compact-state-label {
  fill: var(--d-ink-muted) !important;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0;
}

.sensor-compact-state-wrap .sensor-compact-state-label,
html[data-theme] .sensor-compact-state-wrap .sensor-compact-state-label {
  position: absolute;
  top: 9px;
  left: 14px;
  max-width: calc(100% - 28px);
  overflow: hidden;
  color: var(--d-ink-muted);
  fill: currentColor !important;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage3bl-device-spark .sensor-hover-point.compact-card,
html[data-theme] .stage3bl-device-spark .sensor-hover-point.compact-card {
  fill: rgba(255, 255, 255, .001);
  stroke: transparent;
  pointer-events: all;
  cursor: crosshair;
}

/* Stage 3FK: compact charts are readable previews; full charts stay exact and time-scaled. */
.sensor-device-measurement-chart .sensor-history-chart.compact,
html[data-theme] .sensor-device-measurement-chart .sensor-history-chart.compact,
.sensor-value-mini .sensor-history-chart.compact,
html[data-theme] .sensor-value-mini .sensor-history-chart.compact,
.stage3az-device-spark .sensor-history-chart.compact,
html[data-theme] .stage3az-device-spark .sensor-history-chart.compact,
.stage3bl-device-spark .sensor-history-chart.compact,
html[data-theme] .stage3bl-device-spark .sensor-history-chart.compact {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  height: clamp(82px, 10vw, 118px) !important;
  min-height: 82px !important;
  max-height: 132px !important;
}

.sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-line,
html[data-theme] .sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-line,
.sensor-value-mini .sensor-history-chart.compact .sensor-history-line,
html[data-theme] .sensor-value-mini .sensor-history-chart.compact .sensor-history-line {
  stroke: var(--d-brand) !important;
  stroke-width: 2.4 !important;
  vector-effect: non-scaling-stroke;
  opacity: .96 !important;
  filter: none !important;
}

.sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-area,
html[data-theme] .sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-area,
.sensor-value-mini .sensor-history-chart.compact .sensor-history-area,
html[data-theme] .sensor-value-mini .sensor-history-chart.compact .sensor-history-area {
  opacity: .11 !important;
}

.sensor-device-measurement-chart .sensor-history-chart.compact .sensor-target-band,
html[data-theme] .sensor-device-measurement-chart .sensor-history-chart.compact .sensor-target-band,
.sensor-value-mini .sensor-history-chart.compact .sensor-target-band,
html[data-theme] .sensor-value-mini .sensor-history-chart.compact .sensor-target-band {
  fill: color-mix(in srgb, var(--d-brand) 7%, transparent) !important;
}

.sensor-device-measurement-chart .sensor-hover-point.compact-card,
html[data-theme] .sensor-device-measurement-chart .sensor-hover-point.compact-card,
.sensor-value-mini .sensor-hover-point.compact-card,
html[data-theme] .sensor-value-mini .sensor-hover-point.compact-card,
.stage3az-device-spark .sensor-hover-point.compact-card,
html[data-theme] .stage3az-device-spark .sensor-hover-point.compact-card {
  fill: transparent !important;
  stroke: transparent !important;
  pointer-events: none !important;
}

.sensor-device-measurement-chart .sensor-hover-point.compact-card {
  pointer-events: none !important;
}

.stage3bl-device-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stage3bl-device-meta small {
  max-width: 33%;
}

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

.stage3bl-device-board.comfortable .stage3bl-device-card {
  min-height: 120px;
  padding: 12px;
}

.stage3bl-wallboard-modal {
  width: min(1440px, 96vw);
  max-height: 92vh;
}

.stage3bl-wallboard-body {
  max-height: calc(92vh - 96px);
  overflow: auto;
}

.stage3bl-device-board.wallboard {
  background: linear-gradient(135deg, rgba(246, 252, 249, .98), rgba(255, 255, 255, .96));
}

.stage3bl-device-board.wallboard .stage3bl-device-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stage3bl-device-board.wallboard .stage3bl-device-card {
  min-height: 124px;
}

@container (min-width: 430px) {
  .stage3bl-device-card {
    grid-template-columns: minmax(170px, .85fr) minmax(220px, 1.35fr);
    grid-template-rows: auto auto minmax(92px, auto) auto;
    align-items: stretch;
    min-height: 152px;
  }

  .stage3bl-device-card .stage3bl-device-main {
    grid-column: 1;
    grid-row: 1;
  }

  .stage3bl-device-card .stage3bl-device-reading {
    grid-column: 1;
    grid-row: 2;
  }

  .stage3bl-device-card .stage3bl-device-spark {
    grid-column: 2;
    grid-row: 1 / 4;
    min-height: 98px;
    padding: 6px;
  }

  .stage3bl-device-card .stage3bl-device-spark .sensor-history-chart.compact,
  html[data-theme] .stage3bl-device-card .stage3bl-device-spark .sensor-history-chart.compact {
    height: 100% !important;
    min-height: 94px !important;
  }

  .stage3bl-device-card .stage3bl-device-meta {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

@container (min-width: 760px) {
  .stage3bl-device-card {
    grid-template-columns: minmax(240px, .58fr) minmax(480px, 1.42fr);
    min-height: 176px;
  }

  .stage3bl-device-card .stage3bl-device-spark {
    min-height: 126px;
  }

  .stage3bl-device-card .stage3bl-device-spark .sensor-history-chart.compact,
  html[data-theme] .stage3bl-device-card .stage3bl-device-spark .sensor-history-chart.compact {
    min-height: 118px !important;
  }
}

@media (max-width: 760px) {
  .stage3bl-device-board {
    padding: 14px;
  }

  .stage3bl-board-head {
    display: grid;
    gap: 12px;
  }

  .stage3bl-board-actions {
    justify-content: stretch;
  }

  .stage3bl-board-actions .btn {
    flex: 1 1 120px;
  }

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

  .stage3bl-device-grid,
  .stage3bl-device-board.comfortable .stage3bl-device-grid,
  .stage3bl-device-board.wallboard .stage3bl-device-grid {
    grid-template-columns: 1fr;
  }

  .stage3bl-device-card,
  .stage3bl-device-board.comfortable .stage3bl-device-card {
    min-height: 118px;
    padding: 11px;
  }

  .stage3bl-device-meta {
    display: grid;
    gap: 2px;
  }

  .stage3bl-device-meta small {
    max-width: 100%;
  }
}

@media (max-width: 430px) {
  .stage3bl-device-grid,
  .stage3bl-device-board.comfortable .stage3bl-device-grid,
  .stage3bl-device-board.wallboard .stage3bl-device-grid {
    grid-template-columns: 1fr;
  }
}

/* Stage 3BO: Beaver-style visual reset.
   The product should feel like a simple IoT control board: fewer panels, bigger useful tiles,
   quiet chrome, and device cards that carry the overview without duplicate dashboard widgets. */
body[data-stage3bo="beaver-visual-reset"] .client-view-preview-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(235, 250, 243, .78);
  box-shadow: none;
}

body[data-stage3bo="beaver-visual-reset"][data-route="client-preview"] #workspaceContent,
html[data-theme] body[data-stage3bo="beaver-visual-reset"][data-route="client-preview"] #workspaceContent {
  width: min(100%, 1560px);
  max-width: calc(100vw - 28px);
  margin-inline: auto;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-client-home {
  gap: 14px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-client-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 0;
  padding: 18px 20px;
  border: 1px solid rgba(0, 142, 92, .12);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(0, 151, 95, .11), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(244, 250, 247, .94));
  box-shadow: 0 18px 46px rgba(15, 38, 30, .07);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-client-hero h3 {
  margin: 0;
  font-size: clamp(1.55rem, 1.5vw + 1rem, 2.45rem);
  line-height: .98;
  letter-spacing: -.055em;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-client-hero p {
  max-width: 760px;
  margin-top: 7px;
  color: rgba(16, 44, 34, .68);
}

body[data-stage3bo="beaver-visual-reset"] .client-polish-score {
  min-width: 96px;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .74);
  box-shadow: inset 0 0 0 1px rgba(16, 44, 34, .1);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-status-chips .client-home-metric {
  flex: 0 1 auto;
  min-width: 138px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  box-shadow: none;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-status-chips .client-home-metric strong {
  font-size: .96rem;
  letter-spacing: -.02em;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-beaver-board,
html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-beaver-board {
  padding: 4px 0 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-head {
  align-items: center;
  padding: 0 2px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-head h3 {
  font-size: clamp(1.12rem, .9vw + 1rem, 1.75rem);
  letter-spacing: -.04em;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-head p {
  margin-top: 3px;
  font-size: .9rem;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-actions .btn {
  border-radius: 999px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-actions [data-action="toggle-client-device-density"] {
  display: none;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-status-strip span {
  justify-content: flex-start;
  min-width: 0;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: .78rem;
  background: rgba(255, 255, 255, .66);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-status-strip b {
  margin-right: 3px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-group-grid {
  gap: 18px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-device-group {
  gap: 8px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-device-group > header {
  padding: 0 2px;
  color: rgba(16, 44, 34, .78);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-device-group > header strong {
  font-size: .86rem;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bl-device-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile,
html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile {
  position: relative;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto minmax(104px, auto) auto;
  min-height: 198px;
  padding: 12px;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(16, 44, 34, .1);
  border-left: 0;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,253,251,.95)),
    radial-gradient(circle at 100% 0%, rgba(0, 142, 92, .12), transparent 42%);
  box-shadow: 0 16px 40px rgba(12, 36, 28, .075);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--stage3bl-tone, #00975f);
  opacity: .9;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile:hover,
body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(12, 36, 28, .12);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top .stage3bl-device-title,
html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top .stage3bl-device-title,
body[data-stage3ei="visual-matrix-hardening"] .stage3bl-device-title,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3bl-device-title,
body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: start;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top .stage3bl-device-title strong,
body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top .stage3bl-device-title small,
html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top .stage3bl-device-title strong,
html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top .stage3bl-device-title small,
body[data-stage3ei="visual-matrix-hardening"] .stage3bl-device-title strong,
body[data-stage3ei="visual-matrix-hardening"] .stage3bl-device-title small,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3bl-device-title strong,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3bl-device-title small,
body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title strong,
body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title small,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title strong,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title small {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top .stage3bl-device-icon {
  width: 30px;
  height: 30px;
  border-radius: 12px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top strong {
  font-size: .94rem;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-status {
  max-width: 92px;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 142, 92, .09);
  color: #00794f;
  font-size: .68rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-status.warn {
  background: rgba(200, 135, 0, .12);
  color: #8c5f00;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-status.danger {
  background: rgba(199, 57, 57, .12);
  color: #a02e2e;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-reading strong {
  font-size: clamp(1.32rem, 1.2vw + .95rem, 1.95rem);
  line-height: .95;
  letter-spacing: -.06em;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-reading small {
  margin-top: 4px;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-graph {
  width: 100%;
  min-height: 122px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(0, 142, 92, .055);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-graph .sensor-history-chart.compact,
html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-graph .sensor-history-chart.compact {
  width: 100% !important;
  height: clamp(108px, 16cqw, 150px) !important;
  min-height: 108px !important;
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(16, 44, 34, .58);
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-footer small {
  max-width: 42%;
  font-size: .7rem;
}

@media (max-width: 1024px) {
  #mainNav.main-nav,
  html[data-theme] #mainNav.main-nav {
    touch-action: manipulation !important;
  }
}

body[data-stage3bo="beaver-visual-reset"] .stage3bo-secondary-workbench {
  grid-template-columns: 1fr;
}

body[data-stage3bo="beaver-visual-reset"] .client-home-focus {
  padding: 14px 16px;
  border-radius: 20px;
}

body[data-stage3bo="beaver-visual-reset"] .client-home-values {
  display: none !important;
}

body[data-stage3bo="beaver-visual-reset"] .client-home-last-update {
  color: rgba(16, 44, 34, .54);
  font-size: .78rem;
  text-align: right;
}

body[data-stage3bo="beaver-visual-reset"] .client-clarity-details {
  border-radius: 18px;
  background: rgba(255, 255, 255, .58);
}

@container (min-width: 430px) {
  body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(122px, auto) auto;
  }

  body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile .stage3bo-tile-top,
  body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile .stage3bo-tile-reading,
  body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile .stage3bo-tile-graph,
  body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile .stage3bo-tile-footer {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 520px) {
  body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top,
  html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-status,
  html[data-theme] body[data-stage3bo="beaver-visual-reset"] .stage3bo-tile-status {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  body[data-stage3bo="beaver-visual-reset"] .stage3bo-client-hero {
    grid-template-columns: 1fr;
  }

  body[data-stage3bo="beaver-visual-reset"] .client-polish-score {
    width: fit-content;
  }

  body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-head,
  body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-actions {
    display: grid;
    justify-content: stretch;
  }

  body[data-stage3bo="beaver-visual-reset"] .stage3bl-board-actions .btn {
    width: 100%;
  }
}

@media (max-width: 540px) {
  body[data-stage3bo="beaver-visual-reset"][data-route="client-preview"] #workspaceContent {
    max-width: calc(100vw - 14px);
  }

  body[data-stage3bo="beaver-visual-reset"] .stage3bo-client-hero {
    padding: 14px;
    border-radius: 20px;
  }

  body[data-stage3bo="beaver-visual-reset"] .stage3bo-status-chips .client-home-metric {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  body[data-stage3bo="beaver-visual-reset"] .stage3bo-device-tile {
    min-height: 184px;
  }
}

/* Stage3BQ — legal governance, acceptance evidence, and data assurance. */
body[data-stage3bq="legal-governance-data-security-logs"] .legal-governance-shell,
body[data-stage3bq="legal-governance-data-security-logs"] .legal-acceptance-shell {
  display: grid;
  gap: 16px;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  align-items: stretch;
  gap: 18px;
  background: linear-gradient(135deg, rgba(242, 250, 246, .96), rgba(255, 255, 255, .98));
  border-color: rgba(0, 139, 92, .22);
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-hero h3 {
  margin: 0 0 8px;
  max-width: 760px;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-hero-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(16, 44, 34, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 14px 34px rgba(16, 44, 34, .06);
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-card h3,
body[data-stage3bq="legal-governance-data-security-logs"] .legal-form-panel h3,
body[data-stage3bq="legal-governance-data-security-logs"] .legal-acceptance-card h3 {
  margin: 0;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-card p {
  margin: 8px 0 0;
  color: rgba(16, 44, 34, .68);
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 8px;
  min-width: 180px;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-workbench {
  align-items: start;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-form-panel textarea {
  min-height: 110px;
  resize: vertical;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-safety-note,
body[data-stage3bq="legal-governance-data-security-logs"] .legal-result-card,
body[data-stage3bq="legal-governance-data-security-logs"] .legal-hash-box {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 139, 92, .22);
  border-radius: 14px;
  background: rgba(234, 250, 243, .78);
  color: rgba(16, 44, 34, .78);
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-hash-box {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-release-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

body[data-stage3bq="legal-governance-data-security-logs"] .legal-acceptance-card {
  max-width: 780px;
  margin: 30px auto;
  padding: 28px;
}

@media (max-width: 860px) {
  body[data-stage3bq="legal-governance-data-security-logs"] .legal-hero,
  body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-grid,
  body[data-stage3bq="legal-governance-data-security-logs"] .legal-form-grid {
    grid-template-columns: 1fr;
  }

  body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-card {
    display: grid;
  }

  body[data-stage3bq="legal-governance-data-security-logs"] .legal-doc-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}

/* Stage 3CR: live UX polish for cramped header/profile layouts.
 * Keep this last so it wins over older mobile-shell overrides. */
body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar,
body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .app-shell.inspector-open .topbar {
  grid-template-columns: minmax(240px, 620px) minmax(0, 1fr) auto !important;
  gap: 14px !important;
  overflow: visible !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-search,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-search {
  min-width: 0 !important;
  max-width: 620px !important;
  z-index: 1 !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions {
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  height: auto !important;
  min-height: 40px !important;
  grid-column: 3 !important;
  justify-content: flex-end !important;
  overflow: visible !important;
  z-index: 2 !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-role-actions,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-role-actions {
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  min-width: 0 !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .client-view-toggle,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .client-view-toggle {
  flex: 0 0 auto !important;
  min-width: 42px !important;
  white-space: nowrap !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions .user-chip,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions .user-chip {
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)) !important;
  gap: 18px 14px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid .field,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid .field {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
  min-width: 0 !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid .profile-email-field,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid .profile-email-field {
  grid-column: span 2 !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .account-card-actions,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .account-card-actions {
  display: flex !important;
  justify-content: flex-start !important;
  margin-top: 18px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--d-border) !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .account-card-actions .btn,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .account-card-actions .btn {
  min-width: 132px !important;
}

body[data-stage3cr="live-ux-polish-header-profile-cleanup"] select,
html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] select {
  background-color: var(--d-surface) !important;
  color: var(--d-text) !important;
}

@media (max-width: 1024px) {
  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar,
  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .app-shell.inspector-open .topbar,
  body[data-stage2ca="console-shell-cleanup"][data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"][data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(96px, auto) !important;
    grid-template-rows: 40px !important;
    gap: 10px !important;
    padding: 9px 14px !important;
  }

  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-search,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-search {
    grid-column: 1 !important;
    max-width: none !important;
  }

  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions,
  body[data-stage2ca="console-shell-cleanup"][data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"][data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-actions {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 96px !important;
    max-width: 132px !important;
    height: 40px !important;
    gap: 6px !important;
    justify-content: flex-end !important;
  }

  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid .profile-email-field,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid .profile-email-field {
    grid-column: auto !important;
  }
}

@media (max-width: 560px) {
  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .topbar,
  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(88px, auto) !important;
  }

  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-search input,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .top-search input {
    padding-right: 10px !important;
    font-size: 11px !important;
    text-overflow: ellipsis !important;
  }

  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .profile-form-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .account-card-actions .btn,
  html[data-theme] body[data-stage3cr="live-ux-polish-header-profile-cleanup"] .account-card-actions .btn {
    width: 100% !important;
  }
}

/* Stage 3CV: compact product hardening rails for client safety, academy guidance, sandbox isolation and honest sync state. */
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-strip,
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-strip,
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-offline-sync-truth {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(16, 44, 34, .13);
  border-radius: 8px;
  background: color-mix(in srgb, var(--d-surface, #fff) 94%, #e8f4ef);
  box-shadow: 0 8px 24px rgba(16, 44, 34, .05);
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-strip,
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-strip {
  grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr);
  align-items: stretch;
  padding: 14px;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-offline-sync-truth {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-copy,
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-copy h3,
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-copy h3 {
  margin: 0;
  color: var(--d-text, #102c22);
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-copy p:not(.eyebrow),
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--d-muted, rgba(16, 44, 34, .68));
  font-size: .9rem;
  line-height: 1.35;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-grid,
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 78px;
  padding: 10px;
  border: 1px solid rgba(16, 44, 34, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item.good {
  border-color: rgba(0, 139, 92, .25);
  background: rgba(234, 250, 243, .82);
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item.warn {
  border-color: rgba(175, 122, 0, .25);
  background: rgba(255, 248, 223, .82);
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item.safe {
  border-color: rgba(48, 96, 160, .22);
  background: rgba(235, 243, 255, .82);
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item strong,
body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item strong {
  color: var(--d-text, #102c22);
  font-size: .86rem;
  line-height: 1.15;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item small {
  color: var(--d-muted, rgba(16, 44, 34, .68));
  font-size: .76rem;
  line-height: 1.28;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .simulation-environment-banner + .stage3cv-proof-strip {
  margin-top: 10px;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-strip + .stage3cv-offline-sync-truth {
  margin-top: 8px;
  margin-bottom: 12px;
}

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"][data-route="client-preview"] .stage3cv-trust-strip {
  margin-top: -4px;
}

@media (max-width: 1080px) {
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-strip,
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-strip {
    grid-template-columns: 1fr;
  }

  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-grid,
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-grid,
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-offline-sync-truth {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-strip,
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-strip,
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-offline-sync-truth {
    padding: 10px;
  }

  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-grid,
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-offline-sync-truth {
    grid-template-columns: 1fr;
  }

body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item {
    flex: 0 0 min(74vw, 178px);
    min-height: 0;
    scroll-snap-align: start;
  }
}

/* Stage 3DA: current sensors can report several values, so visible device UI must show each channel. */
.stage3ax-device-canvas,
html[data-theme] .stage3ax-device-canvas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.stage3ax-canvas-card,
html[data-theme] .stage3ax-canvas-card {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(92, 118, 106, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.stage3ax-canvas-card.primary-value,
html[data-theme] .stage3ax-canvas-card.primary-value {
  border-color: rgba(0, 145, 96, 0.34);
  background: rgba(232, 250, 242, 0.92);
}

.stage3ax-canvas-card.secondary-value,
html[data-theme] .stage3ax-canvas-card.secondary-value {
  border-color: rgba(28, 139, 128, 0.3);
  background: rgba(242, 250, 249, 0.92);
}

.stage3ax-canvas-card span,
.stage3ax-canvas-card small,
html[data-theme] .stage3ax-canvas-card span,
html[data-theme] .stage3ax-canvas-card small {
  min-width: 0;
  color: var(--d-muted, #50635b);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.stage3ax-canvas-card strong,
html[data-theme] .stage3ax-canvas-card strong {
  min-width: 0;
  color: var(--d-text, #102c22);
  font-size: 24px;
  line-height: 1.05;
  font-weight: 900;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.stage3ax-canvas-card.secondary-value strong,
html[data-theme] .stage3ax-canvas-card.secondary-value strong {
  font-size: 21px;
}

.sensor-secondary-reading-line,
html[data-theme] .sensor-secondary-reading-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  min-width: 0;
}

.sensor-secondary-reading-line span,
html[data-theme] .sensor-secondary-reading-line span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid rgba(28, 139, 128, 0.22);
  border-radius: 999px;
  background: rgba(28, 139, 128, 0.08);
  color: var(--d-muted, #50635b);
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sensor-secondary-reading-line b,
html[data-theme] .sensor-secondary-reading-line b {
  color: var(--d-text, #102c22);
  font-weight: 850;
}

.sensor-multi-reading-strip,
html[data-theme] .sensor-multi-reading-strip {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 8px 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(92, 118, 106, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.sensor-multi-reading-title,
html[data-theme] .sensor-multi-reading-title {
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  color: var(--d-muted, #50635b);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.sensor-multi-reading-chips,
html[data-theme] .sensor-multi-reading-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.sensor-multi-reading-chip,
html[data-theme] .sensor-multi-reading-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(28, 139, 128, 0.22);
  border-radius: 999px;
  background: rgba(28, 139, 128, 0.08);
  font-size: 11px;
  line-height: 1.2;
}

.sensor-multi-reading-chip b,
.sensor-multi-reading-chip strong,
html[data-theme] .sensor-multi-reading-chip b,
html[data-theme] .sensor-multi-reading-chip strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sensor-multi-reading-chip b,
html[data-theme] .sensor-multi-reading-chip b {
  color: var(--d-muted, #50635b);
  font-weight: 800;
}

.sensor-multi-reading-chip strong,
html[data-theme] .sensor-multi-reading-chip strong {
  color: var(--d-text, #102c22);
  font-weight: 900;
}

.sensor-history-source-note,
html[data-theme] .sensor-history-source-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(175, 122, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 248, 223, 0.72);
}

.sensor-history-source-note span,
.sensor-history-source-note strong,
html[data-theme] .sensor-history-source-note span,
html[data-theme] .sensor-history-source-note strong {
  min-width: 0;
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sensor-history-source-note span,
html[data-theme] .sensor-history-source-note span {
  color: var(--d-muted, #50635b);
  font-weight: 850;
}

.sensor-history-source-note strong,
html[data-theme] .sensor-history-source-note strong {
  color: var(--d-text, #102c22);
  font-weight: 850;
}

.device-gateway-context-panel,
html[data-theme] .device-gateway-context-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.35fr) minmax(132px, auto);
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(13, 148, 97, 0.24);
  border-radius: 8px;
  background: rgba(237, 251, 244, 0.72);
}

.device-gateway-context-panel h3,
.device-gateway-context-panel p,
.gateway-device-grid-label strong,
.gateway-device-grid-label span,
html[data-theme] .device-gateway-context-panel h3,
html[data-theme] .device-gateway-context-panel p,
html[data-theme] .gateway-device-grid-label strong,
html[data-theme] .gateway-device-grid-label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.device-gateway-context-panel h3,
html[data-theme] .device-gateway-context-panel h3 {
  margin: 2px 0 4px;
  font-size: 16px;
}

.device-gateway-context-panel p,
html[data-theme] .device-gateway-context-panel p {
  margin: 0;
  color: var(--d-muted, #50635b);
  font-size: 12px;
  font-weight: 750;
}

.device-gateway-facts,
html[data-theme] .device-gateway-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 8px;
  min-width: 0;
}

.device-gateway-facts > div,
html[data-theme] .device-gateway-facts > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-content: start;
}

.device-gateway-facts span,
.device-gateway-facts b,
html[data-theme] .device-gateway-facts span,
html[data-theme] .device-gateway-facts b {
  display: block;
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.device-gateway-facts span,
html[data-theme] .device-gateway-facts span {
  letter-spacing: 0;
}

.device-gateway-facts b,
html[data-theme] .device-gateway-facts b {
  font-size: 13px;
}

.gateway-connected-devices-panel .stage3az-device-tile-grid,
html[data-theme] .gateway-connected-devices-panel .stage3az-device-tile-grid {
  margin: 10px 0 14px;
}

.gateway-device-grid-label,
html[data-theme] .gateway-device-grid-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}

.gateway-device-grid-label strong,
html[data-theme] .gateway-device-grid-label strong {
  color: var(--d-text, #102c22);
  font-size: 13px;
  font-weight: 900;
}

.gateway-device-grid-label span,
html[data-theme] .gateway-device-grid-label span {
  color: var(--d-muted, #50635b);
  font-size: 12px;
  font-weight: 750;
}

.gateway-unknown-list,
html[data-theme] .gateway-unknown-list {
  margin-top: 10px;
}

.gateway-linked-device-table,
html[data-theme] .gateway-linked-device-table {
  max-height: none;
  overflow-x: auto;
}

.gateway-linked-device-table .ops-table,
html[data-theme] .gateway-linked-device-table .ops-table {
  min-width: 1320px;
  table-layout: fixed;
}

.gateway-linked-device-table .gateway-device-col-item,
html[data-theme] .gateway-linked-device-table .gateway-device-col-item {
  width: 390px;
}

.gateway-linked-device-table .gateway-device-col-reading,
html[data-theme] .gateway-linked-device-table .gateway-device-col-reading {
  width: 190px;
}

.gateway-linked-device-table .gateway-device-col-site,
html[data-theme] .gateway-linked-device-table .gateway-device-col-site {
  width: 210px;
}

.gateway-linked-device-table .gateway-device-col-problem,
html[data-theme] .gateway-linked-device-table .gateway-device-col-problem {
  width: 150px;
}

.gateway-linked-device-table .gateway-device-col-link,
html[data-theme] .gateway-linked-device-table .gateway-device-col-link {
  width: 170px;
}

.gateway-linked-device-table .gateway-device-col-update,
html[data-theme] .gateway-linked-device-table .gateway-device-col-update {
  width: 170px;
}

.gateway-linked-device-table .gateway-device-col-action,
html[data-theme] .gateway-linked-device-table .gateway-device-col-action {
  width: 120px;
}

.gateway-linked-device-table .ops-table th,
.gateway-linked-device-table .ops-table td,
html[data-theme] .gateway-linked-device-table .ops-table th,
html[data-theme] .gateway-linked-device-table .ops-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.gateway-linked-device-table .entity-name-cell,
html[data-theme] .gateway-linked-device-table .entity-name-cell {
  min-width: 0;
}

.gateway-linked-device-table .entity-name-cell strong,
.gateway-linked-device-table .entity-name-cell .subtle,
html[data-theme] .gateway-linked-device-table .entity-name-cell strong,
html[data-theme] .gateway-linked-device-table .entity-name-cell .subtle {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
  line-height: 1.35;
}

.gateway-linked-device-table .entity-name-cell .subtle,
html[data-theme] .gateway-linked-device-table .entity-name-cell .subtle {
  margin-top: 3px;
}

.stage3az-device-value .sensor-secondary-reading-line,
.stage3bl-device-reading .sensor-secondary-reading-line,
.client-clarity-value .sensor-secondary-reading-line,
.client-home-value-reading .sensor-secondary-reading-line,
html[data-theme] .stage3az-device-value .sensor-secondary-reading-line,
html[data-theme] .stage3bl-device-reading .sensor-secondary-reading-line,
html[data-theme] .client-clarity-value .sensor-secondary-reading-line,
html[data-theme] .client-home-value-reading .sensor-secondary-reading-line {
  margin-top: 4px;
}

@media (max-width: 780px) {
  .stage3ax-device-canvas,
  html[data-theme] .stage3ax-device-canvas {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage3ax-canvas-card,
  html[data-theme] .stage3ax-canvas-card {
    min-height: 82px;
  }

  .device-gateway-context-panel,
  html[data-theme] .device-gateway-context-panel,
  .device-gateway-facts,
  html[data-theme] .device-gateway-facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Stage 3EI: hard visual matrix guard.
   The daily shell uses a fixed bottom rail on tablet/mobile widths; later compact
   spacing rules must never let real workspace content sit underneath it. */
body[data-stage3ei="visual-matrix-hardening"] .workspace-content,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .workspace-content,
body[data-stage3ei="visual-matrix-hardening"] .workspace-content *,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .workspace-content * {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-stage3ei="visual-matrix-hardening"] .table-wrap,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

body[data-stage3ei="visual-matrix-hardening"] .ops-table td,
body[data-stage3ei="visual-matrix-hardening"] .ops-table th,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .ops-table td,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .ops-table th {
  vertical-align: top;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .platform-layout,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .email-provider-panel,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .platform-layout,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .email-provider-panel {
  position: relative;
  isolation: isolate;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .platform-layout button,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .email-provider-panel button,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .platform-layout button,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .email-provider-panel button {
  position: relative;
  z-index: 3;
  pointer-events: auto !important;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain;
  contain: layout paint;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table {
  display: table !important;
  min-width: 760px !important;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table thead,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table thead,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table thead,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table thead {
  display: table-header-group !important;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table tbody,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table tbody,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table tbody,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table tbody {
  display: table-row-group !important;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table tr,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table tr,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table tr,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table tr {
  display: table-row !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table th,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table td,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table th,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table td,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table th,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table td,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table th,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table td {
  display: table-cell !important;
  width: auto !important;
  min-width: 0 !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--d-border) !important;
  vertical-align: top;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table td::before,
body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table td::before,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .stage2au-api-contract-table .mobile-card-table td::before,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="platform-center"] .api-endpoint-table .mobile-card-table td::before {
  content: none !important;
}

body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile header,
body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile footer,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile header,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile footer {
  align-items: start;
}

body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(76px, .42fr) minmax(180px, .9fr) auto;
}

body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row > *,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row > * {
  min-width: 0;
}

body[data-stage3ei="visual-matrix-hardening"] .help-dot,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .help-dot {
  position: relative;
  z-index: 2;
  padding: 0;
  appearance: none;
  font-family: inherit;
  line-height: 1;
  cursor: help;
  pointer-events: auto;
}

body[data-stage3ei="visual-matrix-hardening"] .sensor-settings-device-row,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .sensor-settings-device-row {
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(108px, .72fr));
  align-items: start;
}

body[data-stage3ei="visual-matrix-hardening"] .sensor-settings-device-row > .btn[data-action="open-device-settings"],
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .sensor-settings-device-row > .btn[data-action="open-device-settings"] {
  grid-column: 1 / -1;
  justify-self: start;
  width: auto;
  min-width: 116px;
  white-space: nowrap;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="gateways"] .ops-table:has(button[data-action="open-workspace"][data-type="gateway"]) th:last-child,
body[data-stage3ei="visual-matrix-hardening"][data-route="gateways"] .ops-table:has(button[data-action="open-workspace"][data-type="gateway"]) td:last-child,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="gateways"] .ops-table:has(button[data-action="open-workspace"][data-type="gateway"]) th:last-child,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="gateways"] .ops-table:has(button[data-action="open-workspace"][data-type="gateway"]) td:last-child {
  min-width: 116px;
  width: 116px;
  white-space: nowrap;
}

body[data-stage3ei="visual-matrix-hardening"][data-route="gateways"] .ops-table button[data-action="open-workspace"][data-type="gateway"],
html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="gateways"] .ops-table button[data-action="open-workspace"][data-type="gateway"] {
  min-width: 104px;
  width: max-content;
  white-space: nowrap;
}

body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table {
  table-layout: fixed;
}

body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table th:nth-child(1),
body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table td:nth-child(1),
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table th:nth-child(1),
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table td:nth-child(1) {
  width: 28%;
  min-width: 210px;
}

body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table th:nth-child(2),
body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table td:nth-child(2),
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table th:nth-child(2),
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-guided-setup-panel .ops-table td:nth-child(2) {
  width: 34%;
  min-width: 280px;
}

body[data-stage3ei="visual-matrix-hardening"] .gateway-setup-values,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-setup-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px;
  align-items: start;
}

body[data-stage3ei="visual-matrix-hardening"] .gateway-setup-value,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-setup-value {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 4px;
  min-width: 0;
  line-height: 1.35;
}

body[data-stage3ei="visual-matrix-hardening"] .gateway-setup-value span,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .gateway-setup-value span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  body[data-stage3ei="visual-matrix-hardening"],
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body[data-stage3ei="visual-matrix-hardening"] .app-shell,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .app-shell {
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  body[data-stage3ei="visual-matrix-hardening"] .console-left,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .console-left,
  body[data-stage3ei="visual-matrix-hardening"] .main-nav,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .main-nav {
    height: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-stage3ei="visual-matrix-hardening"] .workspace,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .workspace {
    height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px)) !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  body[data-stage3ei="visual-matrix-hardening"] .workspace-content,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .workspace-content {
    padding-bottom: calc(188px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-stage3ei="visual-matrix-hardening"][data-route="integration-center"] .workspace-content,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"][data-route="integration-center"] .workspace-content {
    padding-bottom: calc(216px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body[data-stage3ei="visual-matrix-hardening"] .detail-drawer,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .detail-drawer {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 130px - env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 900px) {
  body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row .btn,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .sensor-device-measurement-row .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile header,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile header > :last-child,
  html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-tile header > :last-child {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 1024px) {
  html body[data-stage2ca="console-shell-cleanup"][data-stage3bj="scroll-and-human-logic-qa"][data-stage3ei="visual-matrix-hardening"] #appShell.app-shell .workspace,
  html body[data-stage2ca="console-shell-cleanup"][data-stage3bj="scroll-and-human-logic-qa"][data-stage3ei="visual-matrix-hardening"] #appShell.app-shell.secondary-collapsed .workspace,
  html body[data-stage2ca="console-shell-cleanup"][data-stage3bj="scroll-and-human-logic-qa"][data-stage3ei="visual-matrix-hardening"] #appShell.app-shell.inspector-open .workspace,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"][data-stage3bj="scroll-and-human-logic-qa"][data-stage3ei="visual-matrix-hardening"] #appShell.app-shell .workspace,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"][data-stage3bj="scroll-and-human-logic-qa"][data-stage3ei="visual-matrix-hardening"] #appShell.app-shell.secondary-collapsed .workspace,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"][data-stage3bj="scroll-and-human-logic-qa"][data-stage3ei="visual-matrix-hardening"] #appShell.app-shell.inspector-open .workspace {
    height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px)) !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* Stage 3FN visual QA: keep tooltip/info buttons square in the final app cascade. */
body[data-stage3ei="visual-matrix-hardening"] .help-dot,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .help-dot,
body[data-stage3ei="visual-matrix-hardening"] button.help-dot,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] button.help-dot {
  inline-size: 36px !important;
  block-size: 36px !important;
  min-inline-size: 36px !important;
  min-block-size: 36px !important;
  max-inline-size: 36px !important;
  max-block-size: 36px !important;
  flex: 0 0 36px !important;
  display: inline-grid !important;
  place-items: center !important;
  align-self: center !important;
  justify-self: start !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 140, 95, 0.45) !important;
  background: rgba(0, 140, 95, 0.08) !important;
  color: var(--green, #087a55) !important;
  font-size: 13px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-indent: 0 !important;
  text-transform: none !important;
  aspect-ratio: 1 / 1;
  vertical-align: middle;
}

/* Stage 3FO: final entity visual refinement.
   Put the human's first question on top: what is this, is it healthy, and what is connected? */
body[data-stage3fo="entity-visual-refinement"] #workspaceContent,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] #workspaceContent {
  gap: 12px !important;
}

body[data-stage3fo="entity-visual-refinement"] #workspaceContent > .local-status-strip,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] #workspaceContent > .local-status-strip {
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: 6px 10px;
  border-radius: 8px;
}

body[data-stage3fo="entity-visual-refinement"][data-detail-type] .workspace-head,
html[data-theme] body[data-stage3fo="entity-visual-refinement"][data-detail-type] .workspace-head {
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0;
  margin: 0 0 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(0, 142, 92, .18);
  background: rgba(255, 255, 255, .9);
}

body[data-stage3fo="entity-visual-refinement"][data-detail-type] .workspace-head > div:first-child,
html[data-theme] body[data-stage3fo="entity-visual-refinement"][data-detail-type] .workspace-head > div:first-child {
  display: none;
}

body[data-stage3fo="entity-visual-refinement"][data-detail-type] .workspace-actions,
html[data-theme] body[data-stage3fo="entity-visual-refinement"][data-detail-type] .workspace-actions {
  width: 100%;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-stage3fo="entity-visual-refinement"] .hero-band,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .hero-band {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  min-height: 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--d-brand, #009160) 18%, var(--d-border, #d4dfda));
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,248,.96));
  box-shadow: 0 8px 22px rgba(6, 38, 27, .05);
}

body[data-stage3fo="entity-visual-refinement"] .hero-band .eyebrow,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .hero-band .eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
  letter-spacing: 0;
}

body[data-stage3fo="entity-visual-refinement"] .hero-band h3,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .hero-band h3 {
  margin: 0;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.1;
  letter-spacing: 0 !important;
}

body[data-stage3fo="entity-visual-refinement"] .hero-band .muted,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .hero-band .muted {
  max-width: 760px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
}

body[data-stage3fo="entity-visual-refinement"] .workspace-tabs,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  margin-top: 10px;
  padding: 0;
  overflow: visible;
}

body[data-stage3fo="entity-visual-refinement"] .workspace-tab,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .workspace-tab {
  flex: 0 1 auto;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(43, 72, 62, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  color: var(--text, #10211b);
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0 !important;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

body[data-stage3fo="entity-visual-refinement"] .workspace-tab:hover,
body[data-stage3fo="entity-visual-refinement"] .workspace-tab:focus-visible,
body[data-stage3fo="entity-visual-refinement"] .workspace-tab.active,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .workspace-tab:hover,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .workspace-tab:focus-visible,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .workspace-tab.active {
  border-color: rgba(0, 145, 96, .45);
  background: rgba(226, 246, 237, .95);
  color: var(--brand-dark, #006b48);
  box-shadow: none;
}

/* Stage3HL: final visual QA polish.
   Fixed bottom navigation must never sit on top of page cards during visual or human inspection. */
body[data-stage3fo="entity-visual-refinement"] .workspace-content,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .workspace-content {
  padding-bottom: clamp(112px, 14vh, 176px) !important;
}

@media (min-width: 1025px) {
  body[data-stage3fo="entity-visual-refinement"] .workspace-content,
  html[data-theme] body[data-stage3fo="entity-visual-refinement"] .workspace-content {
    padding-bottom: 48px !important;
  }
}

body[data-stage3fo="entity-visual-refinement"] .score-ring,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .score-ring {
  width: 66px;
  height: 66px;
  min-width: 66px;
  border-radius: 50%;
  box-shadow: none;
}

body[data-stage3fo="entity-visual-refinement"] .score-ring strong,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .score-ring strong {
  font-size: 20px;
  letter-spacing: 0 !important;
}

body[data-stage3fo="entity-visual-refinement"] .score-ring span,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .score-ring span {
  font-size: 10px;
  letter-spacing: 0 !important;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel,
body[data-stage3fo="entity-visual-refinement"] .integron-device-graphics,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .integron-device-graphics {
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(6, 38, 27, .045);
}

body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .panel-head,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .panel-head,
body[data-stage3fo="entity-visual-refinement"] .integron-device-graphics > .panel-head,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .integron-device-graphics > .panel-head {
  align-items: start;
  padding-bottom: 8px;
}

body[data-stage3fo="entity-visual-refinement"] .stage3ax-device-canvas,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3ax-device-canvas {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card {
  min-height: 92px;
  padding: 12px;
  border-radius: 8px;
}

body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card span,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card span {
  font-size: 11px;
  letter-spacing: 0 !important;
}

body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card strong,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card strong {
  min-width: 0;
  font-size: clamp(17px, 1.05vw, 21px);
  line-height: 1.08;
  letter-spacing: 0 !important;
  overflow-wrap: anywhere;
}

body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card.primary-value strong,
body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card.secondary-value strong,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card.primary-value strong,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card.secondary-value strong {
  font-size: clamp(23px, 1.5vw, 29px);
}

body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card small,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3ax-canvas-card small {
  font-size: 11px;
  line-height: 1.25;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-device-grid-label,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-device-grid-label {
  margin: 4px 0 8px;
  padding: 0;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-board .stage3az-device-tile-grid,
body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .stage3az-device-tile-grid,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-board .stage3az-device-tile-grid,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .stage3az-device-tile-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 380px));
  justify-content: start;
  gap: 12px;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-tile,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-tile {
  min-height: 0;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(6, 38, 27, .045);
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-tile:hover,
body[data-stage3fo="entity-visual-refinement"] .stage3az-device-tile:focus-visible,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-tile:hover,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-tile:focus-visible {
  transform: none;
  box-shadow: 0 8px 20px rgba(0, 88, 58, .09);
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-icon,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-value strong,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-value strong {
  font-size: 24px;
  letter-spacing: 0 !important;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-value span,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-value span {
  font-size: 12px;
  line-height: 1.25;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark {
  min-height: 108px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 142, 92, .09);
  border-radius: 8px;
  background: rgba(0, 142, 92, .035);
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-history-chart.compact,
body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark svg,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-history-chart.compact,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark svg {
  height: clamp(96px, 12vw, 138px) !important;
  min-height: 96px !important;
  max-height: 138px !important;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-history-line,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-history-line {
  stroke-width: 1.9 !important;
  opacity: .88 !important;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-history-area,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-history-area {
  opacity: .06 !important;
}

body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-target-band,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-spark .sensor-target-band {
  opacity: .48;
}

body[data-stage3fo="entity-visual-refinement"] .sensor-device-measurement-panel,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .sensor-device-measurement-panel {
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
}

body[data-stage3fo="entity-visual-refinement"] .sensor-device-measurement-row,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .sensor-device-measurement-row {
  border-radius: 8px;
}

body[data-stage3fo="entity-visual-refinement"] .sensor-device-measurement-chart .sensor-history-chart.compact,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .sensor-device-measurement-chart .sensor-history-chart.compact {
  height: 84px !important;
  min-height: 84px !important;
  max-height: 92px !important;
}

body[data-stage3fo="entity-visual-refinement"] .sensor-device-inline-graph,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .sensor-device-inline-graph {
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(6, 38, 27, .04);
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout {
  display: block;
  min-width: 0;
  border: 1px solid rgba(16, 44, 34, .13);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary::-webkit-details-marker,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary::-webkit-details-marker {
  display: none;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary span,
body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary strong,
body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary small,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary span,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary strong,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary small {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary span,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary span {
  display: grid;
  gap: 2px;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary strong,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary strong {
  color: var(--d-text, #102c22);
  font-size: 14px;
  line-height: 1.2;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary small,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary small {
  color: var(--d-muted, #50635b);
  font-size: 12px;
  line-height: 1.3;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary em,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout > summary em {
  padding: 5px 8px;
  border: 1px solid rgba(0, 142, 92, .18);
  border-radius: 999px;
  background: rgba(0, 142, 92, .07);
  color: var(--d-brand, #008c5f);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout-body,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout-body {
  padding: 0 10px 10px;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout .gateway-guided-setup-panel,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-setup-foldout .gateway-guided-setup-panel {
  max-height: min(820px, 76vh);
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  box-shadow: none;
}

body[data-stage3fo="entity-visual-refinement"] .gateway-technical-support,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-technical-support {
  border-radius: 8px;
}

@media (max-width: 780px) {
  body[data-stage3fo="entity-visual-refinement"] .hero-band,
  html[data-theme] body[data-stage3fo="entity-visual-refinement"] .hero-band {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-stage3fo="entity-visual-refinement"] .score-ring,
  html[data-theme] body[data-stage3fo="entity-visual-refinement"] .score-ring {
    justify-self: start;
  }

  body[data-stage3fo="entity-visual-refinement"] .stage3az-device-board .stage3az-device-tile-grid,
  body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .stage3az-device-tile-grid,
  html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-board .stage3az-device-tile-grid,
  html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .stage3az-device-tile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Stage3FT: Claude-flag remediation keeps device cards using the available width. */
body[data-stage3fo="entity-visual-refinement"] .stage3az-device-board .stage3az-device-tile-grid,
body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .stage3az-device-tile-grid,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .stage3az-device-board .stage3az-device-tile-grid,
html[data-theme] body[data-stage3fo="entity-visual-refinement"] .gateway-connected-devices-panel .stage3az-device-tile-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important;
  justify-content: stretch !important;
}

body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title strong,
body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title small,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title strong,
html[data-theme] body[data-stage3ei="visual-matrix-hardening"] .stage3az-device-title small {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.stage3az-device-title,
html[data-theme] .stage3az-device-title {
  min-width: 0 !important;
  max-width: 100% !important;
}

.stage3az-device-tile header,
html[data-theme] .stage3az-device-tile header {
  grid-template-columns: auto minmax(0, 1fr) max-content !important;
}

/* Stage3FU: graph history and touch-input hardening. Compact charts are previews; full charts stay unchanged. */
body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark,
body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark,
body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini,
body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart {
  contain: layout paint;
  overflow: hidden;
}

body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-history-chart.compact,
body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-history-chart.compact,
body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-history-chart.compact,
body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-history-chart.compact,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-history-chart.compact,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-history-chart.compact,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-history-chart.compact,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-history-chart.compact {
  display: block;
  width: 100% !important;
  height: clamp(96px, 11vw, 132px) !important;
  min-height: 88px !important;
  max-height: 142px !important;
  overflow: hidden !important;
  color: var(--d-brand);
}

body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-history-chart.compact .sensor-history-line,
body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-history-chart.compact .sensor-history-line,
body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-history-chart.compact .sensor-history-line,
body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-line,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-history-chart.compact .sensor-history-line,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-history-chart.compact .sensor-history-line,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-history-chart.compact .sensor-history-line,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-line {
  stroke-width: 2.1 !important;
  opacity: .94 !important;
  filter: none !important;
  vector-effect: non-scaling-stroke;
}

body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-history-chart.compact .sensor-history-area,
body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-history-chart.compact .sensor-history-area,
body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-history-chart.compact .sensor-history-area,
body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-area,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-history-chart.compact .sensor-history-area,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-history-chart.compact .sensor-history-area,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-history-chart.compact .sensor-history-area,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-history-chart.compact .sensor-history-area {
  opacity: .09 !important;
}

body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-hover-point.compact-card,
body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-hover-point.compact-card,
body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-hover-point.compact-card,
body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-hover-point.compact-card,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3bl-device-spark .sensor-hover-point.compact-card,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .stage3az-device-spark .sensor-hover-point.compact-card,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-value-mini .sensor-hover-point.compact-card,
html[data-theme] body[data-stage3fu="graph-history-touch-fix"] .sensor-device-measurement-chart .sensor-hover-point.compact-card {
  fill: transparent !important;
  stroke: transparent !important;
  pointer-events: none !important;
  cursor: default !important;
}

/* Stage3GX: current windows with no packets must explain the gap while retained history remains available. */
body[data-stage3gx="retained-history-empty-window"] .sensor-empty-chart,
html[data-theme] body[data-stage3gx="retained-history-empty-window"] .sensor-empty-chart {
  gap: 12px;
  align-content: center;
  padding: 18px;
  text-align: center;
  border-radius: 10px;
  border-color: color-mix(in srgb, var(--sx-line, #b8c8bf) 64%, transparent);
  background: color-mix(in srgb, var(--sx-panel-soft, #f6fbf8) 58%, transparent);
}

body[data-stage3gx="retained-history-empty-window"] .sensor-empty-chart.compact,
html[data-theme] body[data-stage3gx="retained-history-empty-window"] .sensor-empty-chart.compact {
  min-height: 82px;
  padding: 10px;
}

body[data-stage3gx="retained-history-empty-window"] .sensor-empty-copy,
html[data-theme] body[data-stage3gx="retained-history-empty-window"] .sensor-empty-copy {
  display: grid;
  gap: 6px;
  max-width: 640px;
}

body[data-stage3gx="retained-history-empty-window"] .sensor-empty-copy strong,
html[data-theme] body[data-stage3gx="retained-history-empty-window"] .sensor-empty-copy strong {
  color: var(--sx-text, var(--text));
}

body[data-stage3gx="retained-history-empty-window"] .sensor-empty-copy span,
html[data-theme] body[data-stage3gx="retained-history-empty-window"] .sensor-empty-copy span {
  color: var(--sx-muted, var(--muted));
  line-height: 1.45;
}

body[data-stage3gx="retained-history-empty-window"] .sensor-empty-actions,
html[data-theme] body[data-stage3gx="retained-history-empty-window"] .sensor-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 620px) {
  .stage3az-device-tile header,
  html[data-theme] .stage3az-device-tile header {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .stage3az-device-tile header > :last-child,
  html[data-theme] .stage3az-device-tile header > :last-child {
    grid-column: 2;
    justify-self: start;
  }
}

/* ============================================================
   Stage3FV - Claude visual polish (leaner entity headers)
   Goal: remove duplicated header chrome and reclaim above-the-fold
   space on device/gateway/site workspaces without changing layout
   structure, colours, or the large chart design.
   ============================================================ */

/* The sticky page header already shows the eyebrow and subtitle.
   The inner hero now carries only the section title, tabs and health
   ring, so it no longer needs the tall hero proportions. */
.hero-band.hero-band-compact {
  min-height: 0;
  padding: 14px 18px;
  align-items: center;
  row-gap: 10px;
}

.hero-band.hero-band-compact h3 {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.2;
}

/* A smaller ring keeps the score visible without dominating the band. */
.hero-band.hero-band-compact .score-ring {
  width: 84px;
}

.hero-band.hero-band-compact .score-ring strong {
  font-size: 22px;
}

/* Tabs sit directly under the title; tighten the gap left by the
   removed subtitle line. */
.hero-band.hero-band-compact .tab-strip,
.hero-band.hero-band-compact [class*="tab"] {
  margin-top: 8px;
}

@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .hero-band.hero-band-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 14px;
  }
  .hero-band.hero-band-compact .score-ring {
    width: 64px;
  }
  .hero-band.hero-band-compact .score-ring strong {
    font-size: 18px;
  }
}

/* ------------------------------------------------------------
   Stage3FV - device grids must not leave dead space
   With a single production device the auto-fit grids left one
   narrow card beside ~1000px of empty row, which forced the
   device name to truncate. Let sparse grids fill the row.
   ------------------------------------------------------------ */
.stage3bl-device-grid > :only-child,
.stage3az-embedded-device-cards > :only-child,
.sensor-device-measurement-table > :only-child {
  grid-column: 1 / -1;
}

/* Two cards should split the row rather than hug the left edge. */
.stage3bl-device-grid > :first-child:nth-last-child(2),
.stage3bl-device-grid > :first-child:nth-last-child(2) ~ * {
  grid-column: span 1;
}

.stage3bl-device-grid:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}

/* Device names should wrap rather than truncate when there is room. */
.stage3bl-device-card [data-stage3bl-title],
.stage3bl-device-card strong,
.sensor-value-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------
   Stage3FW - live phone visual polish
   The mobile shell should feel like a native operations app: no
   tiny horizontal tab rails or side-scrolling proof cards where
   wrapping/stacking is clearer and easier to tap.
   ------------------------------------------------------------ */
@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  body[data-stage3fp="mobile-speed-responsiveness"] .subnav,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .subnav {
    flex-wrap: wrap !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
  }

  body[data-stage3fp="mobile-speed-responsiveness"] .subnav::-webkit-scrollbar,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .subnav::-webkit-scrollbar {
    display: none !important;
  }

  body[data-stage3fp="mobile-speed-responsiveness"] .subnav .subnav-btn,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .subnav .subnav-btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body[data-stage3fp="mobile-speed-responsiveness"][data-route="sensor-insights"] [data-action="set-sensor-type"],
  body[data-stage3fp="mobile-speed-responsiveness"][data-route="sensor-insights"] [data-action="set-sensor-range"],
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"][data-route="sensor-insights"] [data-action="set-sensor-type"],
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"][data-route="sensor-insights"] [data-action="set-sensor-range"] {
    min-height: 44px !important;
  }

  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-grid,
  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-grid,
  html[data-theme] body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-grid,
  html[data-theme] body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-proof-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible !important;
    overflow-x: visible !important;
    scroll-snap-type: none !important;
  }

  body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item,
  html[data-theme] body[data-stage3cv="product-hardening-client-academy-sandbox-sync"] .stage3cv-trust-item {
    flex: initial !important;
    width: auto !important;
    min-width: 0 !important;
    scroll-snap-align: none !important;
  }
}

/* ------------------------------------------------------------
   Stage3FX - post-deploy live visual/touch refinement
   Sensor Insight rows live inside a narrow operations workspace on
   normal laptops, so the row must adapt to the content area rather
   than to the whole viewport.
   ------------------------------------------------------------ */
body[data-route="sensor-insights"] .sensor-insight-row,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-row {
  grid-template-columns: minmax(0, 1fr) minmax(92px, max-content) minmax(112px, max-content) !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body[data-route="sensor-insights"] .sensor-insight-row > *,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-row > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-route="sensor-insights"] .sensor-insight-open,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-open {
  grid-column: 1 / 2 !important;
}

body[data-route="sensor-insights"] .sensor-insight-reading,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-reading {
  grid-column: 2 / 3 !important;
  justify-self: end !important;
}

body[data-route="sensor-insights"] .sensor-insight-actions,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-actions {
  grid-column: 3 / 4 !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
}

body[data-route="sensor-insights"] .sensor-insight-spark,
body[data-route="sensor-insights"] .sensor-row-range,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-spark,
html[data-theme] body[data-route="sensor-insights"] .sensor-row-range {
  grid-column: 1 / -1 !important;
  justify-self: stretch !important;
}

body[data-route="sensor-insights"] .sensor-insight-open strong,
body[data-route="sensor-insights"] .sensor-insight-open small,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-open strong,
html[data-theme] body[data-route="sensor-insights"] .sensor-insight-open small {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  body[data-stage3fp="mobile-speed-responsiveness"] .workspace button,
  body[data-stage3fp="mobile-speed-responsiveness"] .workspace .btn,
  body[data-stage3fp="mobile-speed-responsiveness"] .main-nav .nav-btn,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .workspace button,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .workspace .btn,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .main-nav .nav-btn {
    touch-action: manipulation;
    transition: none !important;
    transform: none !important;
  }

  body[data-stage3fp="mobile-speed-responsiveness"] .workspace .btn.small,
  body[data-stage3fp="mobile-speed-responsiveness"] .detail-drawer .btn.small,
  body[data-stage3fp="mobile-speed-responsiveness"] .modal-layer .btn.small,
  body[data-stage3fp="mobile-speed-responsiveness"] .sensor-sort-buttons button,
  body[data-stage3fp="mobile-speed-responsiveness"] .segmented-control button,
  body[data-stage3fp="mobile-speed-responsiveness"] .quick-filter,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .workspace .btn.small,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .detail-drawer .btn.small,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .modal-layer .btn.small,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .sensor-sort-buttons button,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .segmented-control button,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .quick-filter {
    min-height: 44px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  body[data-route="sensor-insights"] .sensor-insight-row,
  html[data-theme] body[data-route="sensor-insights"] .sensor-insight-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-route="sensor-insights"] .sensor-insight-open,
  body[data-route="sensor-insights"] .sensor-insight-reading,
  body[data-route="sensor-insights"] .sensor-insight-actions,
  body[data-route="sensor-insights"] .sensor-insight-spark,
  body[data-route="sensor-insights"] .sensor-row-range,
  html[data-theme] body[data-route="sensor-insights"] .sensor-insight-open,
  html[data-theme] body[data-route="sensor-insights"] .sensor-insight-reading,
  html[data-theme] body[data-route="sensor-insights"] .sensor-insight-actions,
  html[data-theme] body[data-route="sensor-insights"] .sensor-insight-spark,
  html[data-theme] body[data-route="sensor-insights"] .sensor-row-range {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
  }

  body[data-route="sensor-insights"] .sensor-insight-actions,
  html[data-theme] body[data-route="sensor-insights"] .sensor-insight-actions {
    justify-content: flex-start !important;
  }
}

/* Stage3GI: capped device groups.
   A 400-device client previously rendered 400 cards in one paint. Devices are
   sorted attention-first, so the capped view shows the ones needing a human and
   keeps the rest one click away. */
.stage3gi-show-more {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}
.stage3bl-device-group > .stage3gi-show-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 700px) {
  .stage3gi-show-more { width: 100%; }
}

/* ==========================================================================
   Stage3GJ — modern visual refresh
   --------------------------------------------------------------------------
   The interface read as dated for specific, fixable reasons: 8px radii, a
   single heavy drop shadow, hard high-contrast borders, flat surfaces, and no
   spacing or type scale.

   Strategy: this layer changes APPEARANCE ONLY -- radius, elevation, colour,
   typography, motion. It never touches display, grid, flex, width, height or
   position, so no layout can shift. That is what makes a restyle of a
   4,635-rule stylesheet safe.

   Leverage: overriding the :root tokens propagates through ~580 existing
   var() references without fighting specificity. The rules that follow exist
   only for primitives that hard-code their values (404 border-radius and 87
   box-shadow declarations do not read tokens).
   ========================================================================== */

:root {
  /* Elevation: a real scale, layered and soft, instead of one 52px slab. */
  --elev-1: 0 1px 2px rgba(0, 0, 0, .28), 0 1px 1px rgba(0, 0, 0, .18);
  --elev-2: 0 2px 4px rgba(0, 0, 0, .26), 0 4px 12px rgba(0, 0, 0, .22);
  --elev-3: 0 8px 24px rgba(0, 0, 0, .30), 0 2px 6px rgba(0, 0, 0, .22);
  --elev-4: 0 16px 48px rgba(0, 0, 0, .40), 0 4px 12px rgba(0, 0, 0, .26);
  --shadow: var(--elev-3);

  /* Radii: 8px reads as 2015. Cards want 14, controls 10, pills stay round. */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Hairlines. The old --line sat at 54% opacity, which draws boxes rather
     than separating content. Modern UI separates with the faintest line that
     still reads. */
  --line: rgba(150, 178, 168, .16);
  --line-soft: rgba(150, 178, 168, .09);
  --line-strong: rgba(150, 178, 168, .26);

  /* Spacing scale -- 4px base. Referenced by the rules below; existing rules
     keep their own values, so nothing reflows. */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  /* Surfaces: a touch more separation between layers so depth reads without
     borders doing the work. */
  --panel: #121a1c;
  --panel-2: #172124;
  --panel-3: #1e2a2d;

  /* Motion. One curve, two durations. */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-1: .14s;
  --dur-2: .24s;

  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--green);
}

/* --- Typography -----------------------------------------------------------
   Tighter tracking on headings and tabular figures for data are the two
   changes that most separate a modern product from a 2015 admin panel. */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .stage3bl-board-head h3, .hero-band h3 {
  letter-spacing: -.021em;
  line-height: 1.18;
  font-weight: 650;
}
h1 { letter-spacing: -.03em; }
.eyebrow {
  letter-spacing: .07em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  opacity: .72;
}
/* Numbers in a data product should never shift width as they tick. */
.number, .metric-value, .stage3bl-status-strip b, td, .kpi, .stat-value,
[class*="-value"], [class*="-count"], [class*="-metric"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
p, li { line-height: 1.55; }

/* --- Surfaces -------------------------------------------------------------
   A very slight top-light gradient reads as a lit surface rather than a flat
   rectangle. Kept subtle enough to survive on a cheap panel. */
.panel, .card, .stage3bl-device-group, .stage3bl-device-board,
.hero-band, .drawer, .modal, .sheet, [class*="-panel"], [class*="-card"] {
  border-radius: var(--radius);
  border-color: var(--line);
  box-shadow: var(--elev-2);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .022), rgba(255, 255, 255, 0) 42%);
  transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.stage3bl-device-card, .device-card, [class*="device-card"] {
  border-radius: var(--radius-sm);
  border-color: var(--line);
  box-shadow: var(--elev-1);
  transition: box-shadow var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
/* Lift on hover -- the single cheapest cue that a surface is interactive. */
.stage3bl-device-card:hover, .device-card:hover, [class*="device-card"]:hover {
  border-color: var(--line-strong);
  box-shadow: var(--elev-3);
  transform: translateY(-1px);
}

/* --- Controls -------------------------------------------------------------
   Buttons were square-ish and static. Rounded, with a real pressed state. */
button, .btn, input[type="button"], input[type="submit"] {
  border-radius: var(--radius-sm);
  letter-spacing: -.005em;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
button:hover, .btn:hover { transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }
button.small, .btn.small { border-radius: var(--radius-xs); }
.pill, .badge, .chip, .tag, [class*="-pill"], [class*="-badge"], [class*="-chip"] {
  border-radius: var(--radius-pill);
  letter-spacing: .01em;
}

input, select, textarea {
  border-radius: var(--radius-sm);
  border-color: var(--line);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }

/* --- Focus ----------------------------------------------------------------
   A visible, consistent ring. :focus-visible so it appears for keyboard users
   without outlining every mouse click. */
:where(button, .btn, a, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* --- Tables ---------------------------------------------------------------
   Zebra striping and heavy grid lines are the most dated pattern in the app.
   Hairline row separation and a hover row read as current. */
table { border-collapse: separate; border-spacing: 0; }
th {
  letter-spacing: .045em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  opacity: .7;
  border-bottom: 1px solid var(--line);
}
td { border-bottom: 1px solid var(--line-soft); }
tbody tr { transition: background-color var(--dur-1) var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, .028); }

/* --- Scrollbars -----------------------------------------------------------
   Default chrome scrollbars on a dark UI are a strong "old" signal. */
* { scrollbar-width: thin; scrollbar-color: rgba(150, 178, 168, .28) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(150, 178, 168, .22);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(150, 178, 168, .38); background-clip: content-box; }

/* --- Status colour --------------------------------------------------------
   Status should read at a glance without relying on hue alone. */
.stage3bl-status-strip span {
  border-radius: var(--radius-pill);
  transition: background-color var(--dur-1) var(--ease);
}
.stage3bl-status-strip .warn { color: var(--warning); }
.stage3bl-status-strip .good { color: var(--green); }

/* --- Empty states ---------------------------------------------------------
   Softer than a bordered box; empty should feel calm, not broken. */
.empty, [class*="-empty"] {
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, .016);
}

/* --- Motion preference ----------------------------------------------------
   Previously a single prefers-reduced-motion rule existed in 758 KB of CSS.
   Everything this layer animates is disabled here. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .stage3bl-device-card:hover, .device-card:hover,
  button:hover, .btn:hover { transform: none; }
}

/* --- Touch targets --------------------------------------------------------
   Technicians use this on a phone, outdoors, sometimes in gloves. 44px is the
   accepted minimum for a reliable tap. */
@media (max-width: 860px) {
  button, .btn, input[type="button"], input[type="submit"] { min-height: 44px; }
  input, select { min-height: 44px; }
  .stage3gi-show-more { min-height: 44px; }
}

/* Stage3HF — nearest-point chart hover.
   Replaces one focusable <circle> per data point (measured: 3,132 KB of markup and
   8,640 tab stops on a 90-day chart) with a single transparent surface and one
   moving indicator. Appearance only; no layout properties. */
.sensor-hover-surface { cursor: crosshair; }
.sensor-hover-surface:focus-visible { outline: 2px solid var(--focus, #2f7d5b); outline-offset: 2px; }
.sensor-hover-indicator { opacity: 0; transition: opacity .12s ease; pointer-events: none; }
.sensor-hover-indicator.active { opacity: 1; }
.sensor-hover-indicator .sensor-hover-line {
  stroke: currentColor; stroke-width: 1; stroke-dasharray: 3 3; opacity: .55;
}
.sensor-hover-indicator .sensor-hover-dot {
  fill: var(--surface, #fff); stroke: currentColor; stroke-width: 2.2;
}
@media (prefers-reduced-motion: reduce) {
  .sensor-hover-indicator { transition: none !important; }
}

/* Stage 3HQ device-detail cleanup: clearer technician/client scan path. */
.hero-band .device-status-ring,
html[data-theme] .hero-band .device-status-ring {
  min-width: 76px !important;
  min-height: 76px !important;
}

.device-status-ring strong,
html[data-theme] .device-status-ring strong {
  max-width: 62px !important;
  font-size: 11px !important;
  line-height: 1.05 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.device-status-ring span,
html[data-theme] .device-status-ring span {
  font-size: 9px !important;
  letter-spacing: 0 !important;
}

.sensor-device-measurement-head,
html[data-theme] .sensor-device-measurement-head {
  align-items: center !important;
}

.sensor-device-measurement-row,
html[data-theme] .sensor-device-measurement-row {
  grid-template-columns: minmax(220px, .72fr) minmax(112px, .28fr) minmax(300px, 1fr) minmax(132px, max-content) !important;
  gap: 14px !important;
  padding: 12px 14px !important;
}

.sensor-device-measurement-name strong,
html[data-theme] .sensor-device-measurement-name strong {
  font-size: 12.5px !important;
  line-height: 1.22 !important;
}

.sensor-device-measurement-value,
html[data-theme] .sensor-device-measurement-value {
  align-content: center !important;
}

.sensor-device-measurement-value b,
html[data-theme] .sensor-device-measurement-value b {
  font-size: 13px !important;
}

.sensor-device-measurement-value span,
html[data-theme] .sensor-device-measurement-value span {
  color: color-mix(in srgb, var(--muted) 88%, var(--text)) !important;
}

.sensor-device-measurement-row .btn,
html[data-theme] .sensor-device-measurement-row .btn {
  width: 132px !important;
  min-height: 40px !important;
  justify-self: end !important;
  white-space: normal !important;
}

.hero-band.hero-band-compact .subnav-btn,
.hero-band.hero-band-compact .tab-strip button,
.hero-band.hero-band-compact .workspace-tab,
html[data-theme] .hero-band.hero-band-compact .subnav-btn,
html[data-theme] .hero-band.hero-band-compact .tab-strip button,
html[data-theme] .hero-band.hero-band-compact .workspace-tab {
  min-height: 40px !important;
  padding-block: 8px !important;
  align-items: center !important;
}

.sensor-history-source-note,
html[data-theme] .sensor-history-source-note {
  border-color: color-mix(in srgb, var(--line) 72%, transparent) !important;
  background: color-mix(in srgb, var(--panel) 88%, transparent) !important;
  color: var(--muted) !important;
}

.sensor-history-source-note span,
html[data-theme] .sensor-history-source-note span {
  color: color-mix(in srgb, var(--text) 72%, var(--muted)) !important;
  font-size: 10px !important;
  text-transform: uppercase;
}

.sensor-history-source-note strong,
html[data-theme] .sensor-history-source-note strong {
  color: color-mix(in srgb, var(--text) 78%, var(--muted)) !important;
  font-size: 10.75px !important;
  font-weight: 760 !important;
}

.integron-device-graphics-grid,
html[data-theme] .integron-device-graphics-grid {
  align-items: start !important;
  grid-template-columns: minmax(0, 1fr) !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

.integron-device-graphics-grid > *,
.sensor-device-inline-graph,
.sensor-chart-wrap,
.sensor-chart-canvas,
.integron-device-chart,
html[data-theme] .integron-device-graphics-grid > *,
html[data-theme] .sensor-device-inline-graph,
html[data-theme] .sensor-chart-wrap,
html[data-theme] .sensor-chart-canvas,
html[data-theme] .integron-device-chart {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: clip !important;
}

@media (max-width: 980px) {
  .sensor-device-measurement-row,
  html[data-theme] .sensor-device-measurement-row {
    grid-template-columns: minmax(0, 1fr) minmax(120px, max-content) !important;
  }

  .sensor-device-measurement-chart,
  html[data-theme] .sensor-device-measurement-chart {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .sensor-device-measurement-row,
  html[data-theme] .sensor-device-measurement-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .sensor-device-measurement-row .btn,
  html[data-theme] .sensor-device-measurement-row .btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-self: stretch !important;
  }

  .hero-band.hero-band-compact .subnav-btn,
  .hero-band.hero-band-compact .tab-strip button,
  .hero-band.hero-band-compact .workspace-tab,
  html[data-theme] .hero-band.hero-band-compact .subnav-btn,
  html[data-theme] .hero-band.hero-band-compact .tab-strip button,
  html[data-theme] .hero-band.hero-band-compact .workspace-tab {
    min-height: 44px !important;
  }

  body[data-stage3fp="mobile-speed-responsiveness"] .nav-btn,
  html[data-theme] body[data-stage3fp="mobile-speed-responsiveness"] .nav-btn {
    min-height: 44px !important;
    align-items: center !important;
  }
}

/* Stage3IP: final hit-target hardening for drawer tabs and runtime banners.
   These rules live at the end of the final stylesheet so later visual polish cannot
   make visible controls lose clicks to their own shell or to the workspace behind. */
.detail-drawer.open,
html[data-theme] .detail-drawer.open {
  pointer-events: auto !important;
}

.detail-drawer.open .drawer-head,
.detail-drawer.open .drawer-body,
.detail-drawer.open .drawer-tabs,
.detail-drawer.open .drawer-action-footer,
.detail-drawer.open button,
html[data-theme] .detail-drawer.open .drawer-head,
html[data-theme] .detail-drawer.open .drawer-body,
html[data-theme] .detail-drawer.open .drawer-tabs,
html[data-theme] .detail-drawer.open .drawer-action-footer,
html[data-theme] .detail-drawer.open button {
  pointer-events: auto !important;
}

.runtime-health-banner,
html[data-theme] .runtime-health-banner {
  pointer-events: auto !important;
}

.runtime-health-actions,
.runtime-health-actions .btn,
html[data-theme] .runtime-health-actions,
html[data-theme] .runtime-health-actions .btn {
  pointer-events: auto !important;
}

.runtime-health-banner .runtime-health-actions,
html[data-theme] .runtime-health-banner .runtime-health-actions {
  position: relative !important;
  z-index: 20 !important;
  isolation: isolate !important;
}

.runtime-health-check-label,
html[data-theme] .runtime-health-check-label {
  position: relative !important;
  z-index: 30 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important;
}

.stage3az-device-tile[data-action="open-workspace"],
html[data-theme] .stage3az-device-tile[data-action="open-workspace"] {
  position: relative;
  pointer-events: auto !important;
}

.stage3az-device-tile[data-action="open-workspace"] > *,
html[data-theme] .stage3az-device-tile[data-action="open-workspace"] > * {
  pointer-events: none !important;
}

.floating-tooltip,
.sensor-floating-tooltip,
html[data-theme] .floating-tooltip,
html[data-theme] .sensor-floating-tooltip {
  pointer-events: none !important;
}

/* Stage3IL: the account menu header/footer are readable chrome only. They must
   never intercept clicks on underlying workflow controls after a route change. */
.account-menu-head,
html[data-theme] .account-menu-head,
.account-menu-foot,
html[data-theme] .account-menu-foot {
  pointer-events: none !important;
}

.account-menu-list,
html[data-theme] .account-menu-list,
.account-menu-tools,
html[data-theme] .account-menu-tools {
  pointer-events: auto !important;
}

/* Stage3IW: lifecycle actions, dense graph markers, and gateway table polish. */
body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card {
  border-radius: 14px !important;
  max-width: min(640px, calc(100vw - 28px)) !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .modal-head,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .modal-head {
  gap: 14px !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .modal-head h3,
body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .modal-head p,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .modal-head h3,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .modal-head p {
  overflow-wrap: anywhere !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .support-sla-note,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .support-sla-note {
  display: grid !important;
  gap: 5px !important;
  color: var(--d-text, #102c22) !important;
  background: color-mix(in srgb, var(--d-surface, #ffffff) 82%, var(--d-warning-soft, #fff7df)) !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .support-sla-note.warning,
body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card.warning .support-sla-note,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card .support-sla-note.warning,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card.warning .support-sla-note {
  border-color: color-mix(in srgb, var(--d-warning, #9b6800) 60%, var(--d-border, #cfd8d3)) !important;
  background: var(--d-warning-soft, #fff7df) !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card.danger .support-sla-note,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .confirm-modal-card.danger .support-sla-note {
  border-color: color-mix(in srgb, var(--d-danger, #b42335) 64%, var(--d-border, #cfd8d3)) !important;
  background: var(--d-danger-soft, #fff0f2) !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .sensor-history-chart:not(.compact) .sensor-sample-dot:not(.measured-point),
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .sensor-history-chart:not(.compact) .sensor-sample-dot:not(.measured-point) {
  opacity: .54 !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .sensor-history-chart:not(.compact) .sensor-sample-dot.good:not(.measured-point),
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .sensor-history-chart:not(.compact) .sensor-sample-dot.good:not(.measured-point) {
  opacity: .32 !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table {
  border-radius: 12px !important;
  border: 1px solid color-mix(in srgb, var(--d-border, #cfd8d3) 78%, transparent) !important;
  overflow-x: visible !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .ops-table,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .ops-table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-item,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-item {
  width: 31% !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-reading,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-reading {
  width: 16% !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-site,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-site {
  width: 15% !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-problem,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-problem {
  width: 18% !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-link,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-link {
  width: 10% !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-update,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-update {
  width: 10% !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-action,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .gateway-device-col-action {
  width: 8% !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .entity-name-cell strong,
body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .entity-name-cell .subtle,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .entity-name-cell strong,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-linked-device-table .entity-name-cell .subtle {
  line-height: 1.28 !important;
}

body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-unknown-list .report-row,
html[data-theme] body[data-stage3iw="lifecycle-ui-final-polish"] .gateway-unknown-list .report-row {
  min-height: 52px !important;
}
