:root {
  --bg: #080c0e;
  --bg-2: #0d1315;
  --panel: #101719;
  --panel-2: #151f21;
  --panel-3: #1d282a;
  --line: rgba(65, 93, 88, 0.54);
  --line-soft: rgba(132, 157, 147, 0.13);
  --text: #f2efe5;
  --muted: #aeb8ad;
  --muted-2: #7d8f85;
  --green: #36d27d;
  --green-soft: rgba(54, 210, 125, 0.14);
  --teal: #1ea896;
  --stone: #b5a685;
  --warning: #e6b956;
  --danger: #f06767;
  --info: #36d27d;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --radius-sm: 6px;
  --side: 204px;
  --drawer: 480px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stage2bv-import-workbench .stage2bv-workbench-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.stage2bv-editor,
.stage2bv-output {
  display: grid;
  gap: 12px;
}

.stage2bv-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stage2bv-editor input,
.stage2bv-editor select,
.stage2bv-editor textarea {
  width: 100%;
}

.stage2bv-json {
  min-height: 250px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.stage2bv-output h4 {
  margin: 0;
  font-size: 13px;
}

.stage2bv-safe-preview,
.stage2bv-result {
  display: grid;
  gap: 8px;
}

.stage2bv-empty {
  min-height: 58px;
  display: grid;
  align-items: center;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage2bw-capture-pack {
  display: grid;
  gap: 14px;
}

.stage2bw-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.stage2bw-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.stage2bw-block h4 {
  margin: 0;
  font-size: 13px;
}

.stage2bw-checklist,
.stage2bw-template-stack {
  display: grid;
  gap: 8px;
}

.stage2bw-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.stage2bw-check strong,
.stage2bw-template strong {
  display: block;
  font-size: 12px;
}

.stage2bw-template {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}

.stage2bw-template pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.stage2bx-capture-session-tracker {
  display: grid;
  gap: 14px;
}

.stage2bx-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.stage2bx-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.stage2bx-block h4 {
  margin: 0;
  font-size: 13px;
}

.stage2bx-binder-list {
  display: grid;
  gap: 8px;
}

.stage2bx-binder-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.stage2bx-binder-row strong {
  display: block;
  font-size: 12px;
}

.stage2by-development-platform {
  display: grid;
  gap: 14px;
}

.stage2by-grid,
.stage2by-lower {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.stage2by-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.stage2by-block h4,
.stage2by-lower h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.stage2by-actions {
  display: grid;
  gap: 8px;
}

.stage2by-action {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.stage2by-action strong {
  display: block;
  font-size: 12px;
}

.stage2bz-console-ux {
  display: grid;
  gap: 14px;
}

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

.stage2bz-route {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.stage2bz-route strong,
.stage2bz-pattern strong,
.stage2bz-adjustment strong {
  display: block;
  min-width: 0;
  font-size: 12px;
}

.stage2bz-route small,
.stage2bz-pattern small,
.stage2bz-adjustment small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stage2bz-grid {
  display: grid;
  grid-template-columns: minmax(430px, 1.12fr) minmax(320px, 0.88fr);
  gap: 14px;
  align-items: start;
}

.stage2bz-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.stage2bz-block h4 {
  margin: 0;
  font-size: 13px;
}

.stage2bz-pattern-grid,
.stage2bz-adjustments {
  display: grid;
  gap: 8px;
}

.stage2bz-pattern {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.stage2bz-pattern p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.stage2bz-adjustment {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.stage2bz-safety {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stage2bz-safety span {
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

body[data-route="integration-center"] .workspace-content {
  gap: 10px;
}

body[data-route="integration-center"] .panel {
  border-radius: 6px;
  box-shadow: none;
}

body[data-route="integration-center"] .panel-head p {
  max-width: 860px;
}

body[data-route="integration-center"] .ops-table th,
body[data-route="integration-center"] .ops-table td {
  padding: 9px 10px;
}

@media (max-width: 980px) {
  .stage2bv-import-workbench .stage2bv-workbench-grid {
    grid-template-columns: 1fr;
  }

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

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

  .stage2by-grid,
  .stage2by-lower {
    grid-template-columns: 1fr;
  }

  .stage2bz-route-strip,
  .stage2bz-grid,
  .stage2bz-safety {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 25, 24, 0.92), rgba(7, 12, 13, 0.98) 260px),
    #070b0d;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
}

* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

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

button {
  cursor: pointer;
  min-width: 0;
}

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

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--stone);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(760px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 29, 31, 0.96), rgba(9, 14, 16, 0.98));
  box-shadow: var(--shadow);
}

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

.integron-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-weight: 900;
}

.integron-logo.large {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 112px;
}

.integron-logo.compact {
  display: grid;
  place-items: center;
}

.integron-logo-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(54, 210, 125, 0.46);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(54, 210, 125, 0.22), rgba(30, 168, 150, 0.08));
  color: var(--green);
  overflow: hidden;
}

.integron-logo-mark::before,
.integron-logo-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: currentColor;
}

.integron-logo-mark::before {
  width: 6px;
  height: 24px;
  left: 15px;
  bottom: 9px;
}

.integron-logo-mark::after {
  width: 8px;
  height: 8px;
  right: 12px;
  top: 10px;
  box-shadow: 8px 12px 0 rgba(54, 210, 125, 0.52);
}

.integron-logo-mark span {
  position: absolute;
  left: 21px;
  top: 15px;
  width: 16px;
  height: 1px;
  background: currentColor;
  transform: rotate(-35deg);
  transform-origin: left center;
  opacity: 0.78;
}

.integron-logo.large .integron-logo-mark {
  width: 58px;
  height: 58px;
}

.integron-logo.large .integron-logo-mark::before {
  width: 8px;
  height: 32px;
  left: 21px;
  bottom: 12px;
}

.integron-logo.large .integron-logo-mark::after {
  width: 10px;
  height: 10px;
  right: 16px;
  top: 13px;
  box-shadow: 10px 16px 0 rgba(54, 210, 125, 0.52);
}

.integron-logo.large .integron-logo-mark span {
  left: 29px;
  top: 22px;
  width: 20px;
}

.integron-logo-word {
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(54, 210, 125, 0.46);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(54, 210, 125, 0.22), rgba(30, 168, 150, 0.08));
  color: var(--green);
  font-weight: 900;
}

.brand-mark.large {
  width: 56px;
  height: 56px;
  font-size: 24px;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.login-sso {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.google-workspace-button {
  width: 100%;
  min-height: 46px;
  border-color: rgba(66, 133, 244, .55);
}

.login-method-divider {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.login-sso:not(:has(.google-workspace-button.hidden)) + .login-form {
  margin-top: 14px;
}

.identity-user-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.identity-person small {
  display: block;
  color: var(--muted);
}

@media (max-width: 760px) {
  .identity-user-table .access-user-header {
    display: none;
  }

  .identity-user-table .identity-user-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 16px;
    align-items: start;
  }

  .identity-user-row .identity-person {
    grid-column: 1 / -1;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  .identity-user-row > span:not(.identity-person)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

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

.login-form label,
.field,
.field label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0b1113;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(54, 210, 125, 0.8);
  outline-offset: 2px;
}

.form-status {
  margin: 0;
  color: var(--muted);
}

.form-status.helped {
  color: var(--text);
}

.form-actions,
.workspace-actions,
.top-actions,
.row-actions,
.card-actions,
.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-actions .btn {
  min-height: 42px;
  padding-inline: 14px;
  white-space: nowrap;
}

.login-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
}

.login-foot span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app-shell {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
  background: rgba(7, 11, 13, 0.97);
  overflow: hidden;
}

.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.sidebar-brand strong {
  display: block;
  font-size: 18px;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
}

.nav-group {
  margin-bottom: 10px;
}

.nav-group-title {
  margin: 10px 8px 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-btn {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 7px 8px;
  text-align: left;
  overflow: visible;
}

.nav-btn:hover,
.nav-btn.active {
  border-color: var(--line);
  background: rgba(54, 210, 125, 0.075);
  color: var(--text);
}

.nav-btn.active {
  box-shadow: inset 3px 0 0 var(--green);
}

.nav-icon,
.mini-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.nav-count {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(181, 166, 133, 0.12);
  color: var(--stone);
  font-size: 11px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.topbar {
  z-index: 20;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 520px) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 17, 0.95);
  backdrop-filter: blur(14px);
}

.breadcrumbs {
  color: var(--muted);
  font-size: 12px;
}

.top-search {
  position: relative;
}

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

.top-search input {
  min-height: 40px;
  padding-left: 38px;
  background-image: linear-gradient(90deg, transparent 0, transparent 30px, rgba(181, 166, 133, 0.18) 31px, transparent 32px);
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 20px 8px;
}

.workspace-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.1;
}

.workspace-head p {
  margin-top: 6px;
  color: var(--muted);
}

.workspace-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px 32px;
}

.workspace-content > * {
  min-width: 0;
  flex: 0 0 auto;
  position: relative;
}

.subnav {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow: hidden;
  padding: 0 20px 10px;
}

.subnav:empty {
  display: none;
}

.subnav-btn {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.subnav-btn.active {
  border-color: rgba(54, 210, 125, 0.54);
  background: var(--green-soft);
  color: var(--text);
}

.btn,
.icon-btn,
.user-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 800;
  overflow: visible;
}

.btn {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.btn.primary {
  border-color: rgba(54, 210, 125, 0.62);
  background: linear-gradient(180deg, rgba(54, 210, 125, 0.24), rgba(54, 210, 125, 0.12));
  color: #f7fff9;
}

.btn.secondary {
  color: var(--muted);
}

.btn.warning {
  border-color: rgba(230, 185, 86, 0.5);
  color: #ffe5a8;
}

.btn.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.icon-btn {
  position: relative;
  width: 38px;
  min-width: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-btn span {
  font-size: 10px;
  font-weight: 900;
}

.user-chip {
  padding: 0 10px;
  color: var(--muted);
}

.api-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(54, 210, 125, 0.42);
  border-radius: 999px;
  background: rgba(54, 210, 125, 0.08);
  color: #b9f5d0;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.role-select-wrap {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(130px, 170px);
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.role-select-wrap select {
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.floating-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(260px, calc(100vw - 20px));
  padding: 7px 9px;
  border: 1px solid rgba(54, 210, 125, 0.42);
  border-radius: var(--radius-sm);
  background: rgba(14, 22, 23, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
  color: var(--text);
  font-size: 12px;
  line-height: 1.28;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.floating-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.floating-tooltip.sensor-floating-tooltip {
  display: grid;
  gap: 3px;
  min-width: 186px;
  max-width: min(280px, calc(100vw - 20px));
  padding: 10px 12px;
  text-align: left;
}

.floating-tooltip.sensor-floating-tooltip strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.floating-tooltip.sensor-floating-tooltip b {
  color: var(--text);
  font-size: 18px;
  line-height: 1.06;
}

.floating-tooltip.sensor-floating-tooltip span,
.floating-tooltip.sensor-floating-tooltip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

/* Stage 1Q clean UX pass: calmer surfaces, per-user modules, less visual noise. */
:root {
  --side: 212px;
  --drawer: 500px;
  --line: rgba(63, 94, 87, 0.34);
  --line-soft: rgba(132, 157, 147, 0.10);
  --panel: #0e1517;
  --panel-2: #111a1c;
  --panel-3: #162224;
  --shadow: none;
}

body {
  background: #070b0d;
}

.sidebar {
  background: #070c0e;
  border-right-color: rgba(73, 104, 97, 0.32);
}

.topbar {
  min-height: 56px;
  padding: 9px 16px;
  border-bottom-color: rgba(73, 104, 97, 0.28);
  background: rgba(8, 13, 15, 0.96);
}

.workspace-head {
  padding: 12px 18px 6px;
}

.workspace-head h2 {
  font-size: clamp(22px, 1.8vw, 28px);
}

.workspace-content {
  gap: 10px;
  padding: 0 18px 28px;
}

.panel,
.metric,
.site-card,
.client-card,
.entity-card,
.drawer-section,
.field-column,
.client-preview-banner,
.client-safe-grid > .panel {
  border-color: rgba(73, 104, 97, 0.28);
  background: rgba(15, 23, 25, 0.82);
  box-shadow: none;
}

.panel {
  padding: 10px;
}

.panel-head {
  margin-bottom: 9px;
}

.role-home-hero {
  min-height: 128px;
  border-color: rgba(54, 210, 125, 0.34);
  background: linear-gradient(135deg, rgba(16, 45, 35, 0.82), rgba(10, 17, 19, 0.92));
}

.role-home-hero h3 {
  font-size: clamp(26px, 3vw, 40px);
}

.focus-strip.compact {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  margin: 0;
}

.access-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
  align-items: center;
}

.access-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.access-user {
  width: 100%;
  min-height: 116px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(73, 104, 97, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.access-user:hover,
.access-user.active {
  border-color: rgba(54, 210, 125, 0.46);
  background: rgba(54, 210, 125, 0.07);
}

.module-permission-grid {
  grid-template-columns: 1fr;
}

.module-role-card {
  padding: 10px;
}

.module-permission-row {
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1fr);
  gap: 12px;
}

.module-toggle {
  display: inline-grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.module-toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

.module-toggle.on strong {
  color: #c9f8dc;
}

.user-module-editor {
  display: grid;
  gap: 8px;
}

.user-module-row {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.026);
  padding: 9px;
}

.user-module-row.on {
  border-color: rgba(54, 210, 125, 0.28);
  background: rgba(54, 210, 125, 0.055);
}

.user-module-row > span {
  color: var(--muted);
  font-size: 12px;
}

.permission-chip {
  min-height: 26px;
  padding: 3px 7px;
}

.ops-table th,
.ops-table td {
  padding: 8px 10px;
}

.report-row,
.lane-item,
.notification-card,
.field-task,
.field-device,
.field-site {
  border-color: rgba(132, 157, 147, 0.11);
}

.panel,
.metric,
.site-card,
.client-card,
.entity-card,
.drawer-section {
  border: 1px solid rgba(73, 104, 97, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19, 29, 31, 0.82), rgba(10, 16, 18, 0.96));
  box-shadow: none;
}

.panel {
  min-width: 0;
  padding: 11px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel h3,
.panel h2,
.drawer-section h3 {
  margin: 0;
}

.panel p,
.drawer-section p {
  margin: 4px 0 0;
  color: var(--muted);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  min-height: 138px;
  padding: 18px;
  border: 1px solid rgba(54, 210, 125, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(54, 210, 125, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(21, 31, 33, 0.96), rgba(10, 15, 17, 0.98));
}

.hero-band h3 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.score-ring {
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0b1113 0 57%, transparent 58%),
    conic-gradient(var(--green) calc(var(--score, 91) * 1%), rgba(255, 255, 255, 0.08) 0);
  box-shadow: inset 0 0 0 1px var(--line);
}

.score-ring strong {
  display: block;
  font-size: 30px;
}

.score-ring span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.metric {
  min-height: 88px;
  padding: 12px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.metric small {
  color: var(--muted);
}

.metric.warn {
  border-color: rgba(230, 185, 86, 0.44);
}

.metric.danger {
  border-color: rgba(240, 103, 103, 0.52);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 14px;
}

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

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

.client-card,
.site-card,
.entity-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  text-align: left;
}

.entity-card.clickable,
.client-card.clickable,
.site-card.clickable {
  cursor: pointer;
}

.client-card:hover,
.site-card:hover,
.entity-card:hover,
.radio-row:hover,
.ops-table tr[data-entity]:hover {
  border-color: rgba(54, 210, 125, 0.46);
  background-color: rgba(54, 210, 125, 0.04);
}

.card-top,
.card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

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

.card-title strong {
  display: block;
  font-size: 16px;
}

.card-title span,
.subtle {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.health-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.health-bar i {
  display: block;
  width: var(--value, 70%);
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-stats div {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.mini-stats b {
  display: block;
  font-size: 18px;
}

.mini-stats span {
  color: var(--muted);
  font-size: 11px;
}

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

.lane {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.lane h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.lane-item,
.radio-row,
.log-row {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  padding: 9px;
  text-align: left;
}

.lane-item span,
.radio-row em,
.log-row span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.table-wrap {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(132, 157, 147, 0.11);
  border-radius: var(--radius);
}

.ops-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.ops-table th,
.ops-table td {
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.ops-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.025);
}

.ops-table td {
  font-size: 13px;
}

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

.ops-table tr[data-entity] {
  cursor: pointer;
}

.linkish {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  line-height: 1.1;
}

.badge.good {
  border-color: rgba(54, 210, 125, 0.5);
  color: #a7f5c5;
}

.badge.warn {
  border-color: rgba(230, 185, 86, 0.5);
  color: #ffe3a0;
}

.badge.danger {
  border-color: rgba(240, 103, 103, 0.55);
  color: #ffb6b6;
}

.badge.info {
  border-color: rgba(125, 185, 255, 0.45);
  color: #b9d9ff;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seg {
  min-width: max-content;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  padding: 5px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.seg.active {
  border-color: rgba(54, 210, 125, 0.55);
  color: var(--text);
  background: var(--green-soft);
}

.help-dot {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  border: 1px solid rgba(54, 210, 125, 0.58);
  border-radius: 50%;
  background: rgba(54, 210, 125, 0.12);
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
  vertical-align: middle;
}

.console-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.platform-stat {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 35, 38, 0.68), rgba(12, 18, 20, 0.78));
  padding: 12px;
}

.platform-stat.good {
  border-color: rgba(54, 210, 125, 0.42);
}

.platform-stat.warn {
  border-color: rgba(230, 185, 86, 0.46);
}

.platform-stat.info {
  border-color: rgba(125, 185, 255, 0.38);
}

.platform-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.platform-stat strong {
  font-size: 24px;
  line-height: 1.05;
}

/* Stage 2AI: platform stats must follow the same theme tokens as every other
   summary surface. The older dark gradient leaked into light mode. */
html[data-theme] .platform-stat {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-panel) !important;
  box-shadow: none !important;
}

html[data-theme] .platform-stat.good {
  border-color: color-mix(in srgb, var(--sx-green) 42%, var(--sx-line)) !important;
}

html[data-theme] .platform-stat.warn {
  border-color: color-mix(in srgb, var(--sx-warning) 52%, var(--sx-line)) !important;
  background: color-mix(in srgb, var(--sx-warning) 8%, var(--sx-panel)) !important;
}

html[data-theme] .platform-stat.info {
  border-color: color-mix(in srgb, #7db9ff 42%, var(--sx-line)) !important;
}

html[data-theme] .platform-stat span {
  color: var(--sx-muted) !important;
}

html[data-theme] .platform-stat strong {
  color: var(--sx-text) !important;
}

.platform-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.oversight-panel,
.side-status-panel {
  min-width: 0;
}

.compact-table {
  min-width: 0;
}

.compact-table th,
.compact-table td {
  padding: 8px 10px;
}

.status-stack {
  display: grid;
  gap: 8px;
}

.status-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.032);
  padding: 9px;
}

.status-line strong,
.status-line span {
  display: block;
}

.status-line span {
  color: var(--muted);
  font-size: 12px;
}

.pane-shortcut-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.032);
  color: var(--text);
  cursor: pointer;
  padding: 9px;
  text-align: left;
}

.pane-shortcut-row:hover,
.pane-shortcut-row:focus-visible {
  outline: none;
  border-color: rgba(54, 210, 125, 0.44);
  background: rgba(54, 210, 125, 0.08);
}

.pane-shortcut-row.passive {
  cursor: default;
}

.pane-shortcut-row.passive:hover {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.032);
}

.pane-shortcut-row strong,
.pane-shortcut-row span {
  display: block;
}

.pane-shortcut-row span {
  color: var(--muted);
  font-size: 12px;
}

.pane-shortcut-row b {
  min-width: 42px;
  justify-self: end;
  border: 1px solid rgba(73, 104, 97, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  padding: 6px 8px;
  text-align: center;
}

.connector-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.connector-mini {
  min-height: 86px;
  display: grid;
  justify-items: start;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.032);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.connector-mini:hover,
.workflow-item:hover {
  border-color: rgba(54, 210, 125, 0.46);
  background: rgba(54, 210, 125, 0.055);
}

.connector-mini span {
  color: var(--muted);
  font-size: 12px;
}

.api-scale-panel {
  overflow: hidden;
}

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

.api-access-card,
.api-rule-row {
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.032);
  padding: 11px;
}

.api-access-card > div,
.api-rule-row > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.api-access-card strong,
.api-rule-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.api-access-card p,
.api-rule-row p,
.api-rule-row small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.api-access-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.api-access-card dl > div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
}

.api-access-card dt,
.api-access-card dd {
  margin: 0;
  min-width: 0;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.api-access-card dt {
  color: var(--muted);
  text-transform: uppercase;
}

.api-access-card dd {
  color: var(--text);
}

.api-rule-list {
  display: grid;
  gap: 8px;
}

.api-endpoint-table td:nth-child(2),
.api-pipeline-table td:nth-child(1) {
  min-width: 190px;
}

.api-endpoint-table td,
.api-pipeline-table td {
  vertical-align: top;
}

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

.architecture-layer-card,
.architecture-mini-row {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.032);
  padding: 11px;
}

.architecture-layer-card > div,
.architecture-mini-row > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.architecture-layer-card strong,
.architecture-mini-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.architecture-layer-card p,
.architecture-layer-card small,
.architecture-layer-card span,
.architecture-mini-row p,
.architecture-mini-row small,
.architecture-mini-row em {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.architecture-layer-card span,
.architecture-mini-row em {
  color: var(--green);
  font-style: normal;
}

.architecture-mini-list {
  display: grid;
  gap: 8px;
}

.backend-model-table td {
  vertical-align: top;
}

.backend-model-table td:first-child {
  min-width: 150px;
}

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

.role-lane {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 35, 38, 0.62), rgba(12, 18, 20, 0.72));
  padding: 12px;
}

.role-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.role-head h3 {
  margin: 0;
  font-size: 15px;
}

.role-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 9px;
  text-align: left;
}

.workflow-item span,
.workflow-item small {
  display: block;
}

.workflow-item small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
}

.flow-step {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.flow-step b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(54, 210, 125, 0.48);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.flow-step span {
  color: var(--muted);
  font-size: 12px;
}

.integration-table td:first-child {
  min-width: 240px;
}

.map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 14px;
  align-items: start;
}

.map-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.map-shell {
  min-height: 660px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(247, 248, 245, 0.98), rgba(229, 232, 226, 0.98)),
    #eef0eb;
  color: #21302b;
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.28);
}

.map-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(46, 70, 62, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 70, 62, 0.055) 1px, transparent 1px);
  background-size: 78px 78px;
  pointer-events: none;
}

.map-floating-search {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 7;
  width: min(360px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  border: 1px solid rgba(37, 59, 52, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(34, 47, 43, 0.14);
}

.map-floating-search span {
  display: grid;
  place-items: center;
  height: 40px;
  color: #0b7b4f;
  font-size: 11px;
  font-weight: 900;
}

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

.map-floating-search input {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: #17231f;
  padding-left: 0;
}

.map-floating-search input::placeholder {
  color: rgba(33, 48, 43, 0.52);
}

.map-filter-bar,
.map-client-bar {
  position: absolute;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.map-filter-bar {
  top: 62px;
  left: 16px;
  right: 16px;
  justify-content: flex-start;
  max-width: none;
}

.map-client-bar {
  left: 16px;
  bottom: 16px;
  max-width: calc(100% - 180px);
}

.map-filter-control,
.map-client-chip {
  min-height: 32px;
  border: 1px solid rgba(37, 59, 52, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(33, 48, 43, 0.74);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(34, 47, 43, 0.09);
}

.map-filter-control.active,
.map-client-chip.active {
  border-color: rgba(0, 120, 255, 0.34);
  background: #0877ff;
  color: #fff;
}

.map-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(2, 36px);
  gap: 7px;
}

.map-controls .icon-btn {
  width: 36px;
  min-width: 36px;
  min-height: 34px;
  border-color: rgba(37, 59, 52, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: #21302b;
  box-shadow: 0 8px 20px rgba(34, 47, 43, 0.1);
}

.map-plane {
  position: absolute;
  inset: 126px 16px 76px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  transform: translate(var(--map-pan-x), var(--map-pan-y)) scale(var(--map-zoom));
  transform-origin: 72% 54%;
  transition: transform 0.18s ease;
}

.map-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-land.primary {
  fill: rgba(209, 215, 207, 0.86);
  stroke: rgba(86, 109, 101, 0.22);
  stroke-width: 2;
}

.map-land.secondary {
  fill: rgba(224, 229, 221, 0.72);
  stroke: rgba(86, 109, 101, 0.14);
  stroke-width: 1.5;
}

.map-road {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 0 rgba(70, 86, 80, 0.12));
}

.map-road.faint {
  stroke: rgba(255, 255, 255, 0.64);
  stroke-width: 5;
}

.map-label,
.map-gridline {
  position: absolute;
  pointer-events: none;
}

.map-label {
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  color: rgba(50, 68, 61, 0.52);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.map-label.country {
  font-size: 18px;
  color: rgba(50, 68, 61, 0.36);
}

.map-label.faint {
  color: rgba(50, 68, 61, 0.3);
}

.map-gridline {
  background: rgba(85, 110, 101, 0.09);
}

.map-gridline.horizontal {
  left: 0;
  right: 0;
  top: var(--p);
  height: 1px;
}

.map-gridline.vertical {
  top: 0;
  bottom: 0;
  left: var(--p);
  width: 1px;
}

.ops-map-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: 210px;
  border: 1px solid rgba(10, 68, 47, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #17231f;
  padding: 5px 9px 5px 5px;
  box-shadow: 0 12px 26px rgba(28, 45, 39, 0.18);
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.ops-map-marker:hover,
.ops-map-marker:focus-visible,
.ops-map-marker.selected {
  z-index: 10;
  border-color: rgba(0, 120, 255, 0.6);
  box-shadow: 0 15px 34px rgba(0, 85, 180, 0.22);
  transform: translate(-50%, -50%) scale(1.04);
}

.marker-dot,
.map-object-icon {
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.marker-dot {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  background: #0877ff;
}

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

.ops-map-marker:hover .marker-label,
.ops-map-marker:focus-visible .marker-label,
.ops-map-marker.selected .marker-label {
  display: grid;
}

.ops-map-marker:not(:hover):not(:focus-visible):not(.selected) {
  max-width: 35px;
  padding: 5px;
}

.marker-label b {
  overflow: hidden;
  max-width: 142px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.marker-label small {
  overflow: hidden;
  max-width: 142px;
  color: rgba(33, 48, 43, 0.62);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.ops-map-marker.site .marker-dot,
.map-object-icon.site {
  background: #0877ff;
}

.ops-map-marker.gateway .marker-dot,
.map-object-icon.gateway {
  background: #0d9a63;
}

.ops-map-marker.device .marker-dot,
.map-object-icon.device {
  background: #5b6ee1;
}

.ops-map-marker.asset .marker-dot,
.map-object-icon.asset {
  background: #8a6b18;
}

.ops-map-marker.unknown .marker-dot,
.map-object-icon.unknown {
  background: #d58a00;
}

.ops-map-marker.alert .marker-dot,
.map-object-icon.alert {
  background: #d84646;
}

.ops-map-marker.warn {
  border-color: rgba(230, 143, 0, 0.36);
}

.ops-map-marker.danger {
  border-color: rgba(216, 70, 70, 0.5);
}

.ops-map-marker.danger .marker-label b {
  color: #7d1717;
}

.map-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(37, 59, 52, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(33, 48, 43, 0.65);
  padding: 18px 22px;
  font-weight: 800;
}

.map-legend {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 58px;
  z-index: 6;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(33, 48, 43, 0.66);
  font-size: 12px;
  font-weight: 800;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0877ff;
}

.map-legend i.gateway { background: #0d9a63; }
.map-legend i.device { background: #5b6ee1; }
.map-legend i.alert { background: #d84646; }
.map-legend i.unknown { background: #d58a00; }

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

.map-dock-panel {
  min-height: 220px;
}

.map-side-panel {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 21, 19, 0.98);
  padding: 14px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
}

.map-side-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.map-side-head h3 {
  margin: 0;
  font-size: 18px;
}

.map-side-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.map-side-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.map-side-tabs button {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.map-side-tabs button.active,
.map-side-tabs button:hover {
  border-color: rgba(54, 210, 125, 0.42);
  background: var(--green-soft);
  color: var(--text);
}

.map-mini-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.map-mini-card strong,
.map-mini-card span {
  display: block;
}

.map-mini-card span {
  color: var(--muted);
  font-size: 12px;
}

.map-object-icon {
  width: 34px;
  height: 34px;
}

.detail-grid.compact {
  grid-template-columns: 1fr 1fr;
}

.map-side-section {
  padding: 10px;
}

.map-side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.clickable-row {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.clickable-row:hover {
  border-color: rgba(54, 210, 125, 0.42);
  background: rgba(54, 210, 125, 0.055);
}

.signal {
  display: inline-grid;
  grid-template-columns: repeat(4, 5px);
  align-items: end;
  gap: 2px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

.signal i {
  width: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.signal i:nth-child(1) { height: 6px; }
.signal i:nth-child(2) { height: 9px; }
.signal i:nth-child(3) { height: 13px; }
.signal i:nth-child(4) { height: 17px; }
.signal i.on { background: var(--green); }
.signal.warn i.on { background: var(--warning); }
.signal.danger i.on { background: var(--danger); }

.topology {
  min-height: 430px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(181, 166, 133, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(181, 166, 133, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgba(54, 210, 125, 0.11), transparent 15rem),
    #091311;
  background-size: 36px 36px, 36px 36px, auto, auto;
}

.topology::before,
.topology::after {
  content: "";
  position: absolute;
  border: 1px dashed rgba(54, 210, 125, 0.28);
  border-radius: 50%;
}

.topology::before {
  inset: 70px 16%;
}

.topology::after {
  inset: 124px 28%;
}

.map-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  min-width: 74px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(13, 27, 24, 0.94);
  color: var(--text);
  padding: 7px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  text-align: left;
}

.map-node b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 5px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
}

.map-node span {
  display: block;
  max-width: 150px;
  color: var(--muted);
  font-size: 11px;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(var(--drawer), calc(100vw - 22px));
  height: 100vh;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #091311;
  box-shadow: -22px 0 70px rgba(0, 0, 0, 0.42);
  transform: translateX(104%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.18s ease;
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(1px);
}

.drawer-scrim.hidden {
  display: none;
}

.detail-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 19, 17, 0.98);
}

.drawer-head h2 {
  margin: 3px 0 0;
  font-size: 22px;
}

.drawer-head .icon-btn {
  align-self: start;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-color: rgba(54, 210, 125, 0.32);
}

.drawer-head .icon-btn span {
  font-size: 12px;
}

.drawer-body {
  display: grid;
  gap: 12px;
  padding: 16px 22px 92px;
}

.drawer-action-footer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: rgba(9, 19, 17, 0.98);
  box-shadow: 0 -16px 28px rgba(0, 0, 0, 0.2);
}

.drawer-action-footer .btn.primary {
  min-width: 150px;
}

.drawer-section {
  padding: 12px;
}

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

.detail-grid div {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101d1a;
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.report-list {
  display: grid;
  gap: 9px;
}

.report-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.command-palette {
  display: grid;
  gap: 8px;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.workspace-tab {
  min-height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.api-settings {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.local-status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(132, 157, 147, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.016);
}

.role-scope-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(54, 210, 125, 0.26);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(54, 210, 125, 0.075), rgba(255, 255, 255, 0.02));
  padding: 10px 12px;
}

.role-scope-panel strong,
.role-scope-panel span {
  display: block;
}

.role-scope-panel span {
  color: var(--muted);
  font-size: 12px;
}

.ops-summary {
  min-height: 126px;
  display: grid;
  grid-template-columns: minmax(240px, 0.48fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 28, 30, 0.92), rgba(10, 15, 17, 0.96));
  padding: 14px;
}

.ops-summary h3 {
  margin: 0;
  font-size: 42px;
  line-height: 0.95;
}

.ops-summary p {
  color: var(--muted);
}

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

.ops-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
}

.compact-panel {
  padding: 10px;
}

.compact-list {
  max-height: none;
}

.role-home-hero {
  min-height: fit-content;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  overflow: visible;
  border: 1px solid rgba(54, 210, 125, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(54, 210, 125, 0.1), rgba(30, 168, 150, 0.05) 38%, rgba(10, 16, 18, 0.96)),
    #10191a;
  padding: 20px 22px 24px;
}

.role-home-hero > div:first-child {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0;
}

.role-home-hero h3 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.role-home-hero p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.role-home-hero.client {
  border-color: rgba(54, 210, 125, 0.3);
}

.role-home-hero.technician {
  min-height: 190px;
  padding-bottom: 28px;
  border-color: rgba(125, 185, 255, 0.3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 2px;
  overflow: visible;
}

.role-home-hero .btn {
  min-height: 42px;
  white-space: nowrap;
}

.role-home-hero.technician .score-ring {
  align-self: center;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
  align-items: stretch;
  z-index: 0;
}

.role-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
}

.action-panel {
  border-color: rgba(54, 210, 125, 0.36);
}

.calm-panel {
  background: linear-gradient(180deg, rgba(20, 30, 32, 0.74), rgba(10, 16, 18, 0.92));
}

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

.next-action-card {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.026);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.next-action-card:hover {
  border-color: rgba(54, 210, 125, 0.5);
  background: rgba(54, 210, 125, 0.065);
}

.next-action-card strong,
.next-action-card small {
  display: block;
}

.next-action-card small {
  margin-top: 3px;
  color: var(--muted);
}

.site-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.site-toolbar .toolbar-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.site-result-grid {
  align-items: stretch;
}

.setup-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
  gap: 12px;
}

.setup-main,
.setup-side {
  min-width: 0;
}

.setup-step-list {
  display: grid;
  gap: 8px;
}

.setup-step {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.024);
}

.setup-step > span:first-child {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.setup-step strong,
.setup-step p {
  display: block;
}

.setup-step p {
  margin: 3px 0 0;
  color: var(--muted);
}

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

.lifecycle-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.lifecycle-grid strong,
.lifecycle-grid span {
  display: block;
}

.lifecycle-grid span {
  margin-top: 4px;
  color: var(--muted);
}

.client-site-workspace {
  display: grid;
  gap: 12px;
}

.interactive-tabs {
  overflow: hidden;
}

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

.workflow-rail.vertical {
  grid-template-columns: 1fr;
}

.workflow-step {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.workflow-step > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(54, 210, 125, 0.42);
  border-radius: 50%;
  background: rgba(54, 210, 125, 0.09);
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.workflow-step strong,
.workflow-step small {
  display: block;
}

.workflow-step small {
  margin-top: 3px;
  color: var(--muted);
}

.mini-cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.role-matrix,
.access-preview-grid,
.access-user-grid {
  display: grid;
  gap: 10px;
}

.role-matrix {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.role-access-card,
.access-user {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.026);
  padding: 10px;
}

.role-access-card.active {
  border-color: rgba(54, 210, 125, 0.58);
  background: rgba(54, 210, 125, 0.07);
}

.role-access-card strong,
.role-access-card span,
.access-user strong,
.access-user span {
  display: block;
}

.role-access-card > div > span,
.access-user span,
.access-user p {
  color: var(--muted);
  font-size: 12px;
}

.role-access-card ul {
  margin: 9px 0 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 12px;
}

.role-route-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.role-route-chips span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.role-route-chips.large span.allowed {
  border-color: rgba(54, 210, 125, 0.45);
  color: #b9f5d0;
}

.role-route-chips.large span.blocked {
  opacity: 0.42;
}

.access-preview-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.access-party h3 {
  margin: 8px 0 4px;
  font-size: 14px;
}

.access-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.account-grid,
.notification-layout,
.email-provider-grid,
.policy-grid {
  display: grid;
  gap: 14px;
}

.account-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
}

.account-profile-panel {
  min-width: 0;
}

.profile-form-grid,
.device-workflow-grid,
.security-architecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.profile-form-grid {
  align-items: end;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.device-workflow-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

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

.security-card,
.module-role-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 31, 32, 0.78), rgba(10, 15, 16, 0.88));
  padding: 12px;
}

.security-card h3 {
  margin: 10px 0 6px;
  font-size: 16px;
}

.security-card p,
.module-permission-row span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.module-permission-panel {
  display: grid;
  gap: 12px;
}

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

.module-permission-list {
  display: grid;
  gap: 9px;
}

.module-permission-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.6fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
}

.module-permission-row strong,
.module-permission-row span {
  display: block;
}

.permission-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.permission-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
}

.permission-chip.on {
  border-color: rgba(54, 210, 125, 0.45);
  color: #c7f7d8;
  background: rgba(54, 210, 125, 0.08);
}

.permission-chip input {
  width: 12px;
  min-height: 12px;
  margin: 0;
  accent-color: var(--green);
}

.notification-preferences {
  border-color: rgba(54, 210, 125, 0.32);
}

.preference-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(220px, 0.9fr) minmax(260px, 1.05fr);
  gap: 12px;
}

.preference-grid h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
}

.check-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: start;
  margin-bottom: 7px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.026);
  padding: 8px;
  color: var(--text);
}

.check-row input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
}

.check-row strong,
.check-row small,
.check-row span {
  display: block;
}

.check-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.notification-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
}

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

.notification-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: 9px;
}

.notification-card:hover {
  border-color: rgba(54, 210, 125, 0.42);
  background: rgba(54, 210, 125, 0.055);
}

.notification-main,
.notification-recipients {
  min-width: 0;
  display: grid;
  gap: 3px;
  grid-column: 1;
}

.notification-main span,
.notification-recipients span {
  color: var(--muted);
  font-size: 12px;
}

.notification-recipients b {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.notification-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  grid-column: 1;
}

.notification-meta > span {
  color: var(--muted);
  font-size: 12px;
}

.notification-action {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: end;
}

.email-provider-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.provider-card,
.policy-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.028);
  padding: 10px;
}

.provider-card > span,
.policy-card span {
  color: var(--muted);
  font-size: 12px;
}

.provider-card .detail-grid {
  grid-template-columns: 1fr;
}

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

.search-results-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 31, 33, 0.96), rgba(10, 15, 17, 0.98));
  padding: 12px;
}

.search-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.search-result {
  min-height: 58px;
  display: grid;
  justify-items: start;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 9px;
  text-align: left;
}

.search-result:hover {
  border-color: rgba(54, 210, 125, 0.42);
  background: rgba(54, 210, 125, 0.055);
}

.search-result span {
  color: var(--muted);
  font-size: 12px;
}

.technician-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(340px, 1.25fr) minmax(260px, 1fr);
  gap: 14px;
}

.field-column,
.client-preview-banner,
.client-safe-grid > .panel {
  border: 1px solid rgba(73, 104, 97, 0.38);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 31, 33, 0.78), rgba(11, 17, 19, 0.96));
  padding: 11px;
}

.field-column {
  display: grid;
  align-content: start;
  gap: 9px;
}

.field-column.wide {
  min-width: 0;
}

.field-task,
.field-device,
.field-site {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(132, 157, 147, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 8px 9px;
  text-align: left;
  overflow: visible;
}

.field-site {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.field-device {
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.field-task:hover,
.field-device:hover,
.field-site:hover {
  border-color: rgba(54, 210, 125, 0.42);
  background: rgba(54, 210, 125, 0.055);
}

.field-task span,
.field-device small,
.field-site span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.client-preview-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.score-ring.compact {
  width: 92px;
}

.score-ring.compact strong {
  font-size: 22px;
}

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

.technician-grid.refined {
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
  align-items: start;
  gap: 12px;
}

.technician-grid.refined .field-column {
  min-height: 0;
}

.technician-grid.refined .panel-head {
  margin-bottom: 9px;
}

.client-site-card .card-bottom {
  gap: 12px;
}

.map-provider-note {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 8;
  width: min(340px, calc(100% - 396px));
  border: 1px solid rgba(37, 59, 52, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(33, 48, 43, 0.72);
  padding: 9px 10px;
  box-shadow: 0 10px 28px rgba(34, 47, 43, 0.12);
}

.map-provider-note strong,
.map-provider-note span {
  display: block;
}

.map-provider-note strong {
  color: #17231f;
  font-size: 12px;
}

.map-provider-note span {
  font-size: 11px;
}

.drawer-tabs {
  position: sticky;
  top: 73px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 14, 0.98);
}

.drawer-tabs button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.drawer-tabs button.active,
.drawer-tabs button:hover {
  border-color: rgba(54, 210, 125, 0.48);
  background: rgba(54, 210, 125, 0.12);
  color: var(--text);
}

.inspector-title {
  min-width: 0;
  padding-left: 4px;
}

.inspector-title h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.inspector-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.compact-drawer-section {
  background: rgba(255, 255, 255, 0.018);
}

.inspector-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.mini-kpi {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: 9px;
}

.mini-kpi span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.mini-kpi strong {
  overflow-wrap: anywhere;
}

.inspector-grid div {
  min-height: 50px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 32, 34, 0.98), rgba(10, 15, 17, 0.99));
  box-shadow: var(--shadow);
}

.modal-head,
.modal-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h3,
.modal-head p {
  margin: 0;
}

.modal-head p:last-child {
  margin-top: 4px;
  color: var(--muted);
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.modal-actions {
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .top-search {
    width: 100%;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .role-select-wrap {
    min-width: 220px;
  }

  .metric-grid,
  .action-lanes,
  .console-strip,
  .ops-summary-grid,
  .focus-strip,
  .workflow-rail,
  .workflow-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col,
  .three-col,
  .ops-summary,
  .ops-board,
  .setup-board,
  .map-workspace,
  .platform-layout,
  .account-grid,
  .notification-layout,
  .technician-grid,
  .technician-grid.refined,
  .role-dashboard-grid,
  .client-safe-grid,
  .device-workflow-grid,
  .module-permission-grid,
  .security-architecture-grid {
    grid-template-columns: 1fr;
  }

  .map-side-panel {
    position: relative;
    top: auto;
    max-height: none;
  }

  .map-lower-grid {
    grid-template-columns: 1fr;
  }

  .map-provider-note {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    margin: 104px 16px 0;
  }

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

  .site-toolbar,
  .lifecycle-grid {
    grid-template-columns: 1fr;
  }

  .role-home-hero.technician {
    min-height: 178px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
    max-height: 380px;
  }

  .nav-group {
    margin-bottom: 0;
  }

  .topbar {
    position: relative;
    grid-template-columns: 1fr;
  }

  .workspace {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .workspace-content {
    overflow: visible;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: start;
  }

  .role-select-wrap {
    grid-column: span 2;
  }

  .workspace-head {
    display: grid;
  }

  .api-settings {
    grid-template-columns: 1fr;
  }

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

  .console-strip,
  .ops-summary-grid,
  .focus-strip,
  .workflow-rail,
  .workflow-board,
  .client-safe-grid,
  .setup-board,
  .lifecycle-grid,
  .preference-grid,
  .device-workflow-grid,
  .module-permission-grid,
  .security-architecture-grid {
    grid-template-columns: 1fr;
  }

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

  .site-toolbar {
    grid-template-columns: 1fr;
  }

  .notification-card {
    grid-template-columns: 1fr;
  }

  .notification-main,
  .notification-recipients,
  .notification-meta,
  .notification-action {
    grid-column: auto;
    grid-row: auto;
  }

  .workflow-flow {
    grid-template-columns: 1fr;
  }

  .field-site,
  .field-device,
  .client-preview-banner,
  .role-home-hero,
  .role-scope-panel {
    grid-template-columns: 1fr;
  }

  .role-home-hero {
    min-height: 0;
    padding: 18px 16px 22px;
  }

  .role-home-hero.technician {
    min-height: 0;
    padding-bottom: 24px;
  }

  .role-home-hero .btn {
    width: auto;
    min-width: 120px;
  }

  .drawer-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    top: 69px;
  }

  .inspector-kpis,
  .detail-grid.compact {
    grid-template-columns: 1fr;
  }

  .map-filter-bar {
    left: 16px;
    right: 16px;
    top: 62px;
    justify-content: flex-start;
    max-width: none;
  }

  .map-shell {
    min-height: 720px;
  }

  .map-plane {
    inset: 156px 12px 130px;
  }

  .map-client-bar {
    right: 16px;
    bottom: 62px;
    max-width: none;
  }

  .map-legend {
    bottom: 112px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .login-screen,
  .workspace-content,
  .workspace-head {
    padding-left: 12px;
    padding-right: 12px;
  }

  .metric-grid,
  .action-lanes,
  .mini-stats,
  .detail-grid,
  .ops-summary-grid,
  .inspector-kpis,
  .setup-step {
    grid-template-columns: 1fr;
  }

  .hero-band h3 {
    font-size: 28px;
  }

  .role-home-hero h3 {
    font-size: 30px;
  }

  .score-ring {
    width: 112px;
  }

  .top-actions,
  .workspace-actions,
  .form-actions,
  .row-actions,
  .card-actions {
    align-items: stretch;
  }

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

  .role-select-wrap {
    grid-column: 1 / -1;
  }

  .btn {
    width: 100%;
  }

  .role-home-hero .btn {
    width: auto;
    justify-self: start;
  }

  .icon-btn {
    width: 38px;
  }

  .report-row,
  .lane-item,
  .radio-row,
  .status-line,
  .workflow-item,
  .notification-card {
    grid-template-columns: 1fr;
  }

  .notification-action {
    justify-self: stretch;
  }

  .map-floating-search {
    width: calc(100% - 24px);
    left: 12px;
    top: 12px;
  }

  .map-filter-bar {
    left: 12px;
    right: 12px;
    top: 60px;
  }

  .map-filter-control,
  .map-client-chip {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .map-client-bar {
    left: 12px;
    right: 12px;
  }

  .map-controls {
    right: 12px;
    bottom: 12px;
  }

  .map-legend {
    left: 12px;
    right: 94px;
    bottom: 72px;
  }

  .marker-label {
    display: none;
  }

  .ops-map-marker {
    padding: 5px;
  }

  .map-side-tabs,
  .map-side-actions,
  .modal-actions {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-tabs {
    grid-template-columns: 1fr 1fr;
  }
}

/* Stage 1Q final polish: UniFi/UISP-inspired density without copying the skin. */
:root {
  --side: 212px;
  --drawer: 500px;
  --line: rgba(70, 102, 95, 0.30);
  --line-soft: rgba(132, 157, 147, 0.10);
  --panel: #0d1516;
  --panel-2: #111a1c;
  --panel-3: #162224;
  --shadow: none;
}

body {
  background: #070b0d;
}

.app-shell {
  grid-template-columns: var(--side) minmax(0, 1fr);
}

.sidebar,
.topbar,
.workspace,
.detail-drawer,
.drawer-head,
.drawer-action-footer {
  background-color: #070c0e;
}

.sidebar {
  border-right-color: rgba(70, 102, 95, 0.28);
}

.main-nav {
  padding: 9px 8px;
}

.nav-group {
  margin-bottom: 6px;
}

.nav-group-title {
  margin: 11px 8px 6px;
}

.nav-btn {
  min-height: 34px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 7px;
}

.nav-icon,
.mini-icon {
  width: 24px;
  height: 24px;
  background: rgba(54, 210, 125, 0.055);
}

.topbar {
  min-height: 54px;
  grid-template-columns: minmax(130px, 0.64fr) minmax(280px, 520px) auto;
  padding: 8px 14px;
  border-bottom-color: rgba(70, 102, 95, 0.24);
}

.top-search input {
  min-height: 38px;
}

.workspace {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.workspace-head {
  padding: 12px 18px 6px;
}

.workspace-head h2 {
  font-size: clamp(22px, 1.8vw, 28px);
}

.workspace-head p {
  max-width: 920px;
}

.workspace-content {
  gap: 10px;
  padding: 0 18px 28px;
  scroll-padding-bottom: 110px;
}

.workspace-actions,
.top-actions,
.row-actions,
.card-actions,
.drawer-actions,
.form-actions {
  gap: 8px;
}

.local-status-strip {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(70, 102, 95, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.panel,
.metric,
.site-card,
.client-card,
.entity-card,
.drawer-section,
.field-column,
.search-results-panel,
.role-access-card,
.security-card,
.module-role-card,
.client-preview-banner,
.client-safe-grid > .panel {
  border-color: rgba(70, 102, 95, 0.26);
  background: rgba(14, 22, 23, 0.86);
  box-shadow: none;
}

.panel,
.drawer-section,
.security-card,
.module-role-card {
  padding: 10px;
}

.panel-head {
  min-height: 0;
  margin-bottom: 9px;
  gap: 10px;
}

.panel-head h3 {
  font-size: 16px;
}

.panel-head p,
.workspace-head p,
.role-home-hero p,
.client-preview-banner p {
  line-height: 1.45;
}

.role-home-hero,
.client-preview-banner {
  min-height: 132px;
  border-color: rgba(54, 210, 125, 0.34);
  background: linear-gradient(135deg, rgba(15, 45, 34, 0.82), rgba(8, 14, 16, 0.92));
}

.role-home-hero h3,
.client-preview-banner h3 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.role-home-hero .btn,
.client-preview-banner .btn {
  width: auto;
  min-width: 122px;
  justify-self: start;
}

.metric-grid,
.focus-strip,
.mini-stats,
.ops-summary-grid {
  gap: 10px;
}

.role-dashboard-grid,
.technician-grid.refined,
.client-safe-grid,
.client-site-workspace,
.account-grid,
.device-workflow-grid,
.security-architecture-grid {
  gap: 10px;
}

.table-wrap {
  border-color: rgba(132, 157, 147, 0.12);
  background: rgba(255, 255, 255, 0.012);
}

.ops-table {
  table-layout: fixed;
}

.ops-table th,
.ops-table td {
  padding: 8px 10px;
  border-bottom-color: rgba(132, 157, 147, 0.10);
}

.ops-table th {
  color: #aeb8ad;
  background: rgba(255, 255, 255, 0.018);
}

.ops-table tr:hover td,
.report-row:hover,
.lane-item:hover,
.access-user:hover,
.search-result:hover {
  background: rgba(54, 210, 125, 0.045);
}

.subnav {
  gap: 6px;
  padding: 0 18px 8px;
}

.subnav-btn,
.badge,
.btn,
.icon-btn,
.workspace-tab,
.permission-chip {
  border-color: rgba(88, 128, 118, 0.42);
}

.help-tip {
  color: var(--green);
  border-color: rgba(54, 210, 125, 0.55);
  background: rgba(54, 210, 125, 0.08);
}

.floating-tooltip {
  border-color: rgba(54, 210, 125, 0.40);
  background: #11191a;
}

.drawer-scrim {
  background: rgba(0, 0, 0, 0.10);
  backdrop-filter: none;
}

.detail-drawer {
  width: min(var(--drawer), calc(100vw - 18px));
  border-left-color: rgba(70, 102, 95, 0.30);
  background: #081111;
}

.drawer-head {
  padding: 15px 20px 13px;
}

.drawer-head h2 {
  font-size: 21px;
}

.drawer-body {
  gap: 10px;
  padding: 14px 20px 84px;
}

.drawer-action-footer {
  padding: 10px 20px;
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.18);
}

.drawer-tabs {
  top: 62px;
  margin: 0;
  padding: 7px 20px;
  background: rgba(8, 17, 17, 0.98);
}

.drawer-tabs button {
  min-height: 32px;
}

.detail-grid,
.inspector-kpis {
  gap: 7px;
}

.detail-grid div {
  min-height: 54px;
}

.access-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 10px;
  align-items: stretch;
}

.access-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 9px;
}

.access-user {
  width: 100%;
  min-height: 110px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(70, 102, 95, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.022);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.access-user.active {
  border-color: rgba(54, 210, 125, 0.46);
  background: rgba(54, 210, 125, 0.07);
}

.module-permission-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.module-permission-row {
  grid-template-columns: minmax(220px, 0.68fr) minmax(0, 1fr);
  gap: 10px;
}

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

.module-toggle input,
.permission-chip input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

.user-module-editor {
  display: grid;
  gap: 8px;
}

.user-module-row {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(132, 157, 147, 0.11);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  padding: 9px;
}

.user-module-row.on {
  border-color: rgba(54, 210, 125, 0.30);
  background: rgba(54, 210, 125, 0.055);
}

.map-workspace {
  border-color: rgba(70, 102, 95, 0.24);
}

@media (max-width: 1080px) {
  :root {
    --side: 72px;
    --drawer: 460px;
  }

  .access-hero-panel,
  .module-permission-row,
  .device-workflow-grid,
  .security-architecture-grid,
  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* Stage 1Q contextual support, update policy, and release surfaces */

.support-hero-panel,
.update-hero-panel,
.source-release-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.support-layout,
.support-payload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.support-category-grid,
.update-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.support-category-card,
.update-policy-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 9px;
  border: 1px solid rgba(132, 157, 147, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.026);
  padding: 11px;
}

.support-category-card strong,
.update-policy-card strong {
  display: block;
  font-size: 13px;
}

.support-category-card span,
.update-policy-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.support-category-card p,
.update-policy-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.support-payload-panel h4,
.support-payload-layout h4 {
  margin: 0 0 9px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--stone);
}

.support-payload-grid div b {
  font-size: 12px;
}

.support-modal-card {
  width: min(760px, 100%);
}

.support-modal-body {
  max-height: min(72vh, 720px);
  overflow: auto;
}

.support-context-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(54, 210, 125, 0.18);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: rgba(54, 210, 125, 0.045);
}

.support-request-row strong {
  overflow-wrap: anywhere;
}

.update-table td {
  vertical-align: top;
}

@media (max-width: 980px) {
  .support-hero-panel,
  .update-hero-panel,
  .source-release-panel,
  .support-layout,
  .support-payload-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .support-context-preview {
    grid-template-columns: 1fr;
  }
}

/* Stage 1Q rebuild: cleaner UniFi/UISP/Odoo-inspired operations UI in Integron colors. */
select,
option {
  color: var(--text);
  background: #0d1516;
}

.top-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.user-switcher {
  position: relative;
  min-width: 236px;
  max-width: 310px;
}

.top-actions .user-chip {
  width: auto;
  min-width: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
}

.user-switch-button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(54, 210, 125, 0.38);
  border-radius: var(--radius);
  background: rgba(54, 210, 125, 0.055);
  color: var(--text);
  padding: 6px 10px;
  text-align: left;
}

.user-switch-button span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.user-switch-menu,
.sort-menu {
  position: absolute;
  z-index: 80;
  right: 0;
  min-width: 100%;
  display: grid;
  gap: 4px;
  margin-top: 6px;
  border: 1px solid rgba(70, 102, 95, 0.44);
  border-radius: var(--radius);
  background: #0a1112;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  padding: 6px;
}

.user-switch-option,
.sort-menu button {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 9px;
  text-align: left;
}

.user-switch-option span,
.user-switch-option small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-switch-option:hover,
.user-switch-option.active,
.sort-menu button:hover,
.sort-menu button.active {
  border-color: rgba(54, 210, 125, 0.36);
  background: rgba(54, 210, 125, 0.075);
}

.clean-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.toolbar-copy {
  display: grid;
  gap: 3px;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-dropdown {
  position: relative;
}

.sort-menu {
  min-width: 190px;
}

.access-overview-panel {
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
}

.access-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.access-principles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.access-admin-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.2fr) minmax(360px, 0.8fr);
  gap: 10px;
}

.access-user-table {
  display: grid;
  gap: 4px;
}

.access-user-header,
.access-user-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) minmax(100px, 0.75fr) minmax(130px, 1fr) minmax(92px, 0.65fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(86px, 0.55fr);
  gap: 8px;
  align-items: center;
}

.access-user-header {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.access-user-row {
  min-height: 54px;
  border: 1px solid rgba(132, 157, 147, 0.11);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.access-user-row:hover,
.access-user-row.active {
  border-color: rgba(54, 210, 125, 0.36);
  background: rgba(54, 210, 125, 0.055);
}

.access-user-row strong,
.access-user-row small,
.access-user-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-user-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.selected-access-panel {
  align-self: start;
}

.access-risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.module-level-list {
  display: grid;
  gap: 8px;
}

.module-level-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.78fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(132, 157, 147, 0.11);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
  padding: 9px;
}

.module-level-row.on {
  border-color: rgba(54, 210, 125, 0.24);
  background: rgba(54, 210, 125, 0.042);
}

.module-level-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.access-level-control {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.access-level-control button {
  flex: 1 1 58px;
  min-width: 54px;
  min-height: 30px;
  border: 1px solid rgba(88, 128, 118, 0.34);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
  white-space: nowrap;
}

.access-level-control button.active {
  border-color: rgba(54, 210, 125, 0.52);
  background: rgba(54, 210, 125, 0.12);
  color: var(--text);
}

.advanced-permissions {
  margin-top: 10px;
  border: 1px solid rgba(132, 157, 147, 0.12);
  border-radius: var(--radius-sm);
  padding: 9px;
}

.advanced-permissions summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.preset-panel .role-matrix.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: minmax(110px, 0.45fr) minmax(240px, 1fr) auto;
  }

  .user-switcher {
    min-width: 210px;
  }

  .access-admin-layout,
  .access-overview-panel,
  .clean-toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .user-switcher {
    width: 100%;
    max-width: none;
  }

  .access-summary-grid,
  .access-principles,
  .preset-panel .role-matrix.compact,
  .module-level-row,
  .access-user-header,
  .access-user-row {
    grid-template-columns: 1fr;
  }

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

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

.field-device,
.report-row,
.map-client-chip,
.access-user-row,
.module-level-row,
.clean-site-card,
.client-card {
  min-width: 0;
  overflow: hidden;
}

.field-device span,
.field-device strong,
.report-row span,
.report-row strong,
.map-client-chip span,
.map-client-chip strong,
.module-level-row span,
.module-level-row strong,
.clean-site-card span,
.clean-site-card strong,
.client-card span,
.client-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-device button,
.report-row button,
.map-client-chip button,
.clean-site-card button,
.client-card button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions,
.card-actions,
.workspace-actions,
.hero-actions,
.drawer-action-footer {
  flex-wrap: wrap;
}

.top-actions .user-chip {
  width: auto;
  min-width: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 36px 36px minmax(78px, 1fr) 36px;
    justify-content: stretch;
    align-items: center;
  }

  .top-actions .api-status,
  .top-actions .user-switcher {
    grid-column: 1 / -1;
  }

  .top-actions .api-status {
    justify-self: start;
    max-width: 100%;
  }

  .top-actions .user-switcher {
    min-width: 0;
    width: 100%;
  }

  .top-actions .user-switch-button {
    min-width: 0;
  }

  .top-actions .icon-btn {
    width: 36px;
    min-width: 36px;
  }

  .top-actions .user-chip {
    width: 100%;
    min-width: 78px;
  }

  .subnav {
    flex-wrap: wrap;
    overflow: visible;
    padding-inline: 12px;
  }

  .subnav-btn {
    min-width: 0;
  }

  .workspace-actions .btn,
  .hero-actions .btn,
  .drawer-action-footer .btn {
    max-width: 100%;
  }

  .access-level-control button {
    font-size: 11px;
    padding: 0 3px;
  }
}

/* Stage 1Q field lifecycle pass: exception-first rollups, cleaner role homes, guided setup. */
.role-home-hero {
  padding: 22px;
  align-items: center;
  min-height: 0;
}

.role-home-hero h3 {
  max-width: 920px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.02;
}

.role-home-hero p {
  max-width: 860px;
}

.focus-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-safe-grid,
.role-dashboard-grid {
  gap: 10px;
}

.sensor-rollup-panel {
  align-self: stretch;
}

.sensor-rollup-list,
.onboarding-flow-grid,
.flow-mini-steps {
  display: grid;
  gap: 8px;
}

.sensor-rollup-row,
.onboarding-flow-card,
.client-site-summary {
  min-width: 0;
}

.sensor-rollup-row {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(132, 157, 147, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.sensor-rollup-row:hover {
  border-color: rgba(54, 210, 125, 0.35);
  background: rgba(54, 210, 125, 0.055);
}

.sensor-rollup-row strong,
.sensor-rollup-row small,
.sensor-rollup-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sensor-rollup-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  white-space: nowrap;
}

.sensor-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.onboarding-panel {
  border-color: rgba(54, 210, 125, 0.2);
  background: linear-gradient(180deg, rgba(10, 34, 28, 0.68), rgba(8, 17, 17, 0.92));
}

.onboarding-flow-grid {
  grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.onboarding-flow-card {
  display: grid;
  gap: 10px;
  min-height: 170px;
  border: 1px solid rgba(132, 157, 147, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
  padding: 12px;
}

.onboarding-flow-card strong,
.onboarding-flow-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onboarding-flow-card > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.flow-mini-steps {
  align-content: start;
}

.flow-mini-steps span {
  border-left: 2px solid rgba(54, 210, 125, 0.35);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  padding-left: 7px;
}

.stage1q-access-hero .access-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-level-list.compact {
  max-height: min(56vh, 560px);
  overflow: auto;
  padding-right: 3px;
}

.module-level-list.compact .module-level-row {
  grid-template-columns: minmax(170px, 0.8fr) minmax(0, 1fr);
}

.access-user-table {
  overflow: visible;
}

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

@media (max-width: 1400px) {
  .onboarding-flow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .focus-strip,
  .stage1q-access-hero .access-summary-grid,
  .lifecycle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .focus-strip,
  .stage1q-access-hero .access-summary-grid,
  .lifecycle-grid,
  .onboarding-flow-grid,
  .sensor-rollup-row {
    grid-template-columns: 1fr;
  }

  .role-home-hero {
    padding: 18px;
  }

  .role-home-hero h3 {
    font-size: 31px;
  }
}

/* Stage 1Q field lifecycle and role-logic pass */
.role-reality-panel,
.field-jobs-panel,
.recovery-playbooks-panel,
.lifecycle-overview-panel {
  margin-top: 12px;
}

.role-reality-grid,
.recovery-playbook-grid,
.lifecycle-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.role-reality-grid article,
.recovery-playbook-card,
.lifecycle-detail-grid > div,
.field-job-card {
  border: 1px solid rgba(67, 227, 142, 0.18);
  background: rgba(7, 20, 18, 0.72);
  border-radius: 8px;
  padding: 12px;
}

.role-reality-grid article,
.recovery-playbook-card,
.lifecycle-detail-grid > div,
.field-job-card {
  display: grid;
  gap: 9px;
}

.role-reality-grid strong,
.field-job-card strong,
.recovery-playbook-card strong,
.lifecycle-detail-grid strong {
  color: var(--text);
}

.role-reality-grid span,
.role-reality-grid small,
.field-job-card p,
.field-job-card span,
.recovery-playbook-card p,
.recovery-playbook-card small,
.lifecycle-detail-grid span {
  color: var(--muted);
  line-height: 1.35;
}

.field-job-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
}

.job-card-head,
.job-meta-row,
.field-job-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.job-card-head > div {
  display: grid;
  gap: 3px;
}

.job-meta-row {
  justify-content: flex-start;
}

.job-meta-row span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
}

.field-job-actions .btn,
.recovery-playbook-card .btn {
  min-height: 32px;
}

.recovery-playbook-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lifecycle-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.lifecycle-strip span {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  padding: 5px 8px;
}

.lifecycle-strip span.active,
.lifecycle-detail-grid > div.active {
  border-color: rgba(67, 227, 142, 0.7);
  background: rgba(17, 185, 104, 0.15);
  color: var(--text);
}

.button-row.compact {
  gap: 6px;
  margin-top: 0;
}

.drawer-body .lifecycle-strip {
  margin-top: 0;
}

.drawer-action-footer {
  gap: 8px;
}

@media (max-width: 720px) {
  .role-reality-grid,
  .field-job-list,
  .recovery-playbook-grid,
  .lifecycle-detail-grid {
    grid-template-columns: 1fr;
  }
}

#workspaceContent:focus,
#workspaceContent:focus-visible {
  outline: none;
}

/* Stage 1S role-safe readability and topology shell */
:root {
  --rail: 58px;
  --module-pane: 278px;
  --module-pane-collapsed: 48px;
  --left-chrome: calc(var(--rail) + var(--module-pane));
  --drawer: 430px;
  --topbar-h: 54px;
  --shell-bg: #070a0c;
  --rail-bg: #080b0d;
  --pane-bg: #0c1012;
  --canvas-bg: #0a0d0f;
  --surface-tight: #11161a;
  --surface-tight-2: #171d21;
  --line-tight: rgba(111, 134, 128, 0.18);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

body {
  background: var(--canvas-bg);
}

.app-shell {
  grid-template-columns: var(--left-chrome) minmax(0, 1fr);
  background: var(--canvas-bg);
}

.console-left {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  border-right: 1px solid var(--line-tight);
  background: var(--shell-bg);
}

.site-context-selector {
  min-width: 0;
  border-bottom: 1px solid var(--line-tight);
  background: #0b0f11;
  padding: 8px;
}

.site-context-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 16px;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(113, 137, 132, 0.17);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
}

.site-context-button:hover,
.site-context-button:focus-visible {
  border-color: rgba(54, 210, 125, 0.46);
  background: rgba(54, 210, 125, 0.06);
}

.context-status {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(54, 210, 125, 0.65);
}

.context-status.watch {
  background: var(--warning);
  box-shadow: 0 0 12px rgba(230, 185, 86, 0.56);
}

.context-status.bad {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(240, 103, 103, 0.56);
}

.context-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.context-copy strong,
.context-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-copy strong {
  font-size: 13px;
  line-height: 1.1;
}

.context-copy small {
  color: var(--muted);
  font-size: 11px;
}

.context-chevron {
  color: var(--muted-2);
  font-size: 13px;
}

.console-left-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--module-pane));
}

.sidebar {
  position: static;
  width: var(--rail);
  min-width: var(--rail);
  height: 100%;
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr) auto;
  border-right: 1px solid var(--line-tight);
  background: var(--rail-bg);
}

.sidebar-brand {
  min-height: 50px;
  justify-content: center;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line-tight);
}

.sidebar-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 14px;
}

.main-nav {
  display: grid;
  align-content: space-between;
  gap: 8px;
  overflow: auto;
  padding: 8px 6px;
}

.nav-group {
  display: grid;
  gap: 5px;
  margin: 0;
}

.nav-group-title {
  display: none;
}

.nav-btn {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 38px;
  min-height: 38px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.nav-btn:hover,
.nav-btn.active {
  border-color: rgba(78, 111, 105, 0.4);
  background: rgba(255, 255, 255, 0.045);
}

.nav-btn.active {
  color: var(--info);
  box-shadow: inset 3px 0 0 #36d27d;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 0;
}

.rail-svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nav-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #36d27d;
  color: white;
  font-size: 9px;
  line-height: 1;
}

.sidebar-footer {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 8px 6px;
  border-top: 1px solid var(--line-tight);
}

.sidebar-footer .icon-btn {
  width: 36px;
  min-width: 36px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 10px;
}

.module-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--pane-bg);
  overflow: hidden;
}

.module-pane-head {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-tight);
}

.module-pane-head h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-pane-head .eyebrow {
  margin-bottom: 3px;
  font-size: 9px;
}

.module-pane-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 18px;
}

.module-pane-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--line-tight);
  background: var(--pane-bg);
  overflow: hidden;
}

.module-pane-footer .module-layout-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
}

.pane-search {
  position: relative;
  margin-bottom: 10px;
}

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

.pane-search input {
  min-height: 34px;
  border-color: rgba(118, 139, 135, 0.18);
  border-radius: 6px;
  background: #11161a;
  padding: 7px 9px;
  font-size: 12px;
}

.pane-section {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.pane-section h3 {
  margin: 0 0 2px;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.pane-row {
  width: 100%;
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  text-align: left;
  font-size: 12px;
}

.pane-row:hover,
.pane-row.active {
  border-color: rgba(54, 210, 125, 0.46);
  background: rgba(54, 210, 125, 0.105);
  color: var(--text);
}

.pane-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-row b {
  color: var(--info);
  font-size: 11px;
}

.pane-toggle {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.pane-toggle input {
  width: 30px;
  min-height: 18px;
  accent-color: var(--green);
}

.help-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.help-chip {
  max-width: 100%;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid rgba(125, 185, 255, 0.22);
  border-radius: 999px;
  background: rgba(125, 185, 255, 0.08);
  color: #cfe4ff;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
}

.help-dot {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  border: 1px solid rgba(125, 185, 255, 0.7);
  border-radius: 999px;
  color: var(--info);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  vertical-align: 1px;
}

.app-shell.secondary-collapsed {
  --left-chrome: calc(var(--rail) + var(--module-pane-collapsed));
}

.app-shell.secondary-collapsed .console-left-body {
  grid-template-columns: var(--rail) var(--module-pane-collapsed);
}

.app-shell.secondary-collapsed .site-context-selector {
  padding: 8px 7px;
}

.app-shell.secondary-collapsed .site-context-button {
  min-height: 42px;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 0;
  padding: 0;
}

.app-shell.secondary-collapsed .site-context-button .context-status {
  width: 9px;
  height: 9px;
}

.app-shell.secondary-collapsed .context-copy,
.app-shell.secondary-collapsed .context-chevron,
.app-shell.secondary-collapsed .site-switcher-menu {
  display: none !important;
}

.module-pane.collapsed {
  width: var(--module-pane-collapsed);
  min-width: var(--module-pane-collapsed);
  border-right: 1px solid var(--line-tight);
}

.module-pane.collapsed .module-pane-head {
  min-height: 50px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 7px 6px;
}

.module-pane.collapsed .module-pane-head > div {
  display: none;
}

.module-pane.collapsed #secondaryPaneToggle {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}

.module-pane.collapsed .module-layout-button {
  display: none !important;
}

.module-pane.collapsed .module-pane-content {
  display: grid;
  align-content: start;
  justify-items: center;
  overflow: hidden;
  padding: 8px 5px;
}

.pane-expand-card {
  width: 36px;
  min-height: 74px;
  display: grid;
  grid-template-rows: 28px 28px;
  justify-items: center;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(54, 210, 125, 0.35);
  border-radius: 7px;
  background: rgba(54, 210, 125, 0.08);
  color: var(--text);
  padding: 7px 4px;
}

.pane-expand-card:hover,
.pane-expand-card:focus-visible {
  border-color: rgba(54, 210, 125, 0.72);
  background: rgba(54, 210, 125, 0.14);
}

.pane-expand-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--green);
}

.pane-expand-card small {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(54, 210, 125, 0.16);
  color: var(--green);
  font-size: 0;
}

.pane-expand-card small::before {
  content: "⇥";
  font-size: 12px;
  font-weight: 900;
}

.workspace {
  background: var(--canvas-bg);
  grid-template-rows: var(--topbar-h) auto minmax(0, 1fr);
  transition: padding-right 180ms ease;
}

.topbar {
  min-height: var(--topbar-h);
  grid-template-columns: minmax(120px, 0.48fr) minmax(220px, 520px) auto;
  padding: 8px 14px;
  background: #101417;
  border-bottom-color: var(--line-tight);
}

.workspace-head {
  padding: 12px 18px 8px;
}

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

.workspace-content {
  gap: 10px;
  padding: 0 18px 26px;
}

.subnav {
  display: none;
}

.panel,
.drawer-section,
.support-hero-panel,
.update-hero-panel,
.source-release-panel {
  border-color: var(--line-tight);
  border-radius: 7px;
  background: var(--surface-tight);
}

.panel-head h3 {
  font-size: 14px;
}

.btn,
.icon-btn,
.user-chip {
  border-radius: 6px;
}

.btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.icon-btn {
  min-width: 34px;
  min-height: 34px;
}

.ops-table th,
.ops-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.drawer-scrim {
  display: none;
}

.detail-drawer {
  width: var(--drawer);
  max-width: calc(100vw - 20px);
  border-left: 1px solid var(--line-tight);
  background: #101418;
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.32);
}

.app-shell.inspector-open .workspace {
  padding-right: var(--drawer);
}

.app-shell.inspector-open .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.app-shell.inspector-open .top-search,
.app-shell.inspector-open .api-status {
  display: none;
}

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

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

.app-shell.inspector-open .user-switch-button {
  max-width: 180px;
}

.drawer-head {
  min-height: auto;
  padding: 14px 14px 10px;
  border-bottom-color: var(--line-tight);
  background: #0d1114;
}

.drawer-head h2 {
  font-size: 16px;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-tight);
  background: #0d1114;
}

.drawer-tabs button {
  min-width: 0;
  min-height: 31px;
  border-radius: 6px;
  padding: 5px 3px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-body {
  padding: 10px;
}

.compact-drawer-section {
  padding: 12px;
}

.drawer-action-footer {
  padding: 10px;
  border-top-color: var(--line-tight);
  background: #0d1114;
}

.contextual-support-panel .support-category-grid.compact {
  grid-template-columns: 1fr;
  gap: 7px;
}

.support-category-choice {
  width: 100%;
  min-height: 42px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line-tight);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.support-category-choice:hover {
  border-color: rgba(54, 210, 125, 0.45);
  background: rgba(54, 210, 125, 0.08);
}

.support-category-choice span {
  color: var(--muted);
  font-size: 11px;
}

.settings-help-card h3 {
  display: flex;
  gap: 4px;
  align-items: center;
}

@media (max-width: 1440px) {
  :root {
    --module-pane: 252px;
    --drawer: 430px;
  }
}

@media (max-width: 1180px) {
  .app-shell.inspector-open .workspace {
    padding-right: 0;
  }

  .drawer-scrim:not(.hidden) {
    display: block;
  }
}

@media (max-width: 860px) {
  :root {
    --rail: 100vw;
    --module-pane: 0px;
    --left-chrome: 0px;
    --drawer: 100vw;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .console-left {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    height: 58px;
    grid-template-rows: 0 minmax(0, 1fr);
    border-right: 0;
    border-top: 1px solid var(--line-tight);
  }

  .site-context-selector {
    display: none;
  }

  .console-left-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    width: 100%;
    height: 58px;
    grid-template-rows: 1fr;
    grid-template-columns: minmax(0, 1fr);
    border-right: 0;
  }

  .sidebar-brand,
  .sidebar-footer {
    display: none;
  }

  .main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 7px 8px;
  }

  .nav-group {
    display: contents;
  }

  .module-pane {
    display: none;
  }

  .workspace {
    height: 100dvh;
    padding-bottom: 62px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .breadcrumbs,
  .api-status,
  .top-search {
    display: none;
  }

  .workspace-head {
    padding: 10px 12px 6px;
  }

  .workspace-content {
    padding: 0 12px 18px;
  }

  .detail-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .drawer-tabs {
    grid-template-columns: repeat(5, minmax(78px, 1fr));
    overflow-x: auto;
  }
}

/* Stage 1S role/readability/topology pass */
:root {
  --integron-green: #36d27d;
  --integron-green-2: #20b86d;
  --integron-green-soft: rgba(54, 210, 125, 0.12);
  --stage1s-neutral: #101518;
  --stage1s-neutral-2: #151b1f;
  --stage1s-line: rgba(184, 204, 194, 0.18);
  --info: var(--integron-green);
}

.nav-btn.active,
.drawer-tabs button.active,
.drawer-tabs button:hover,
.pane-row.active,
.pane-row:hover,
.subnav-btn.active,
.seg.active,
.map-filter-control.active,
.map-client-chip.active {
  border-color: rgba(54, 210, 125, 0.62) !important;
  background: rgba(54, 210, 125, 0.11) !important;
  color: #f7fff9 !important;
}

.nav-btn.active {
  color: var(--integron-green) !important;
  box-shadow: inset 3px 0 0 var(--integron-green) !important;
}

.nav-count {
  background: var(--integron-green) !important;
  color: #04110a !important;
  font-weight: 900;
}

.role-home-hero,
.role-home-hero.client,
.role-home-hero.technician,
.hero-band,
.support-hero-panel,
.update-hero-panel,
.source-release-panel {
  border-color: var(--stage1s-line) !important;
  background: var(--stage1s-neutral) !important;
  box-shadow: inset 4px 0 0 rgba(54, 210, 125, 0.72) !important;
}

.role-home-hero h3,
.hero-band h3 {
  color: #fff9e9;
}

.local-status-strip {
  gap: 8px;
}

.local-status-strip .badge,
.pill,
.badge,
.permission-chip,
.role-route-chips span,
.workspace-tab {
  min-height: 24px;
  border-color: rgba(198, 217, 208, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #edf7ef;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
}

.badge.good,
.badge.healthy,
.badge.ready,
.badge.active,
.badge.allowed,
.permission-chip.on {
  border-color: rgba(54, 210, 125, 0.48);
  background: rgba(54, 210, 125, 0.12);
  color: #d9ffe9;
}

.btn {
  color: #f7fff9;
  font-size: 12px;
  font-weight: 850;
}

.btn.primary {
  border-color: rgba(54, 210, 125, 0.72);
  background: rgba(54, 210, 125, 0.16);
  color: #f8fff8;
}

.btn.secondary,
.icon-btn,
.user-chip,
.user-switch-button {
  border-color: rgba(197, 216, 207, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: #eef7ef;
}

.btn:hover,
.icon-btn:hover,
.user-chip:hover,
.user-switch-button:hover {
  border-color: rgba(54, 210, 125, 0.56);
  background: rgba(54, 210, 125, 0.09);
}

.help-chip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.help-chip {
  width: 100%;
  min-height: 30px;
  justify-content: space-between;
  border-radius: 6px;
  border-color: rgba(54, 210, 125, 0.35);
  background: rgba(255, 255, 255, 0.045);
  color: #f4fff6;
  padding: 6px 8px;
  font-size: 12px;
}

.help-dot {
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-color: rgba(54, 210, 125, 0.7);
  color: #d9ffe9;
  background: rgba(54, 210, 125, 0.12);
  font-size: 11px;
}

.pane-section h3,
.field label,
.login-form label,
.detail-grid div span,
.inspector-grid div span,
.topology-group-label,
.topology-branch-label {
  color: #cdd9d1;
}

.pane-row,
.pane-toggle,
.subtle,
.muted,
.modal-head p,
.panel-head p {
  color: #c5d2c9;
}

.modal-card {
  border-color: var(--stage1s-line);
  background: #11171a;
}

input,
select,
textarea {
  border-color: rgba(199, 218, 208, 0.2);
  background: #080d0f;
  color: #f7fff8;
}

input::placeholder,
textarea::placeholder {
  color: #aebbb2;
}

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

.topology-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topology-workspace {
  display: grid;
  gap: 12px;
}

.topology-client,
.topology-site,
.topology-device-group {
  position: relative;
}

.topology-client {
  display: grid;
  gap: 12px;
  border: 1px solid var(--stage1s-line);
  border-radius: 7px;
  background: var(--stage1s-neutral);
  padding: 12px;
}

.topology-client-head {
  display: grid;
}

.topology-site-list {
  display: grid;
  gap: 12px;
}

.topology-site {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
}

.topology-site-spine {
  width: 2px;
  justify-self: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(54, 210, 125, 0.75), rgba(54, 210, 125, 0.08));
}

.topology-site-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.topology-node {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--stage1s-line);
  border-radius: 7px;
  background: #12181b;
  color: #f6fff8;
  padding: 8px 10px;
  text-align: left;
}

.topology-node:hover {
  border-color: rgba(54, 210, 125, 0.6);
  background: rgba(54, 210, 125, 0.08);
}

.topology-node-icon {
  width: 32px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--integron-green);
  font-size: 11px;
  font-weight: 900;
}

.topology-node-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.topology-node-copy strong,
.topology-node-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topology-node-copy strong {
  font-size: 13px;
}

.topology-node-copy small {
  color: #c5d2c9;
  font-size: 12px;
}

.topology-node-state {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 7px;
  color: #ecf5ef;
  font-size: 11px;
  font-weight: 850;
}

.topology-node.good .topology-node-state,
.topology-node.good .topology-node-icon {
  border-color: rgba(54, 210, 125, 0.48);
  background: rgba(54, 210, 125, 0.12);
  color: #dcffe9;
}

.topology-node.warn .topology-node-state,
.topology-alert .badge {
  border-color: rgba(230, 185, 86, 0.55);
  background: rgba(230, 185, 86, 0.12);
  color: #ffe9ad;
}

.topology-node.danger .topology-node-state {
  border-color: rgba(240, 103, 103, 0.55);
  background: rgba(240, 103, 103, 0.12);
  color: #ffd0d0;
}

.topology-branch,
.topology-group {
  display: grid;
  gap: 7px;
}

.topology-branch-label,
.topology-group-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.topology-node-list,
.topology-device-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.topology-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #eaf6ee;
}

.topology-group-head span {
  color: #c5d2c9;
  font-size: 12px;
}

.topology-alert-strip {
  display: grid;
  gap: 7px;
}

.topology-alert {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(230, 185, 86, 0.36);
  border-radius: 7px;
  background: rgba(230, 185, 86, 0.08);
  color: #fff5d1;
  padding: 7px 9px;
}

.topology-empty {
  border: 1px dashed rgba(199, 218, 208, 0.18);
  border-radius: 7px;
  color: #c5d2c9;
  padding: 10px;
}

.device-config-help {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

@media (max-width: 860px) {
  .topology-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topology-node-list,
  .topology-device-list {
    grid-template-columns: 1fr;
  }

  .topology-site {
    grid-template-columns: 10px minmax(0, 1fr);
  }
}

/* Stage 1S final rail/readability tightening */
:root {
  --rail: 54px;
  --module-pane: 286px;
}

.nav-btn {
  width: 40px;
  min-width: 40px;
  height: 36px;
  min-height: 36px;
  border-radius: 6px;
}

.nav-icon {
  width: 19px;
  height: 19px;
}

.rail-svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.75;
}

.nav-count {
  top: 1px;
  right: 1px;
  min-width: 14px;
  height: 14px;
  border: 1px solid rgba(6, 11, 12, 0.75);
  color: #05110a;
  font-size: 8px;
  font-weight: 950;
}

.module-pane {
  background: #0b1012;
}

.module-pane-head h2,
.pane-section h3,
.panel-head h3,
.drawer-section h3 {
  color: #f5fff7;
}

.pane-row span,
.pane-toggle span,
.support-category-choice span,
.report-row span,
.status-line p,
.fact span {
  color: #cfdbd2;
}

.local-status-strip .badge,
.workspace-tab,
.permission-chip,
.help-chip {
  text-shadow: none;
}

.drawer-actions .btn,
.workspace-actions .btn,
.form-actions .btn {
  min-width: 0;
}

.btn.small {
  min-height: 30px;
}

@media (max-width: 860px) {
  :root {
    --rail: 50px;
    --module-pane: 0px;
  }

  .nav-btn {
    width: 38px;
    min-width: 38px;
  }
}

/* Stage 1U guided workflow runner */
.disabled-action {
  border-style: dashed;
  opacity: 0.84;
}

.workflow-runner {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: start;
}

.workflow-progress-panel,
.workflow-main-panel,
.workflow-side-panel,
.empty-workflow {
  border: 1px solid rgba(199, 218, 208, 0.16);
  border-radius: 8px;
  background: #0e1517;
  padding: 14px;
}

.workflow-context-card {
  border: 1px solid rgba(54, 210, 125, 0.28);
  border-radius: 8px;
  background: #101b1a;
  padding: 12px;
  margin-bottom: 12px;
}

.workflow-context-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

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

.workflow-step-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid rgba(199, 218, 208, 0.14);
  border-radius: 7px;
  background: #101718;
  padding: 9px;
}

.workflow-step-list b {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #15201f;
  color: #eafff0;
  font-size: 11px;
}

.workflow-step-list li.active {
  border-color: rgba(54, 210, 125, 0.56);
  background: #10211a;
}

.workflow-step-list li.done b {
  background: rgba(54, 210, 125, 0.18);
  color: #8dffbd;
}

.workflow-step-list strong,
.workflow-side-panel h3 {
  color: #f4fff7;
}

.workflow-step-list small {
  display: block;
  margin-top: 3px;
  color: #c8d6ce;
}

.workflow-context-grid,
.workflow-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.workflow-context-grid > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workflow-context-grid span {
  color: #b6c6bc;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.workflow-context-grid b {
  color: #f4fff7;
  overflow-wrap: anywhere;
}

.workflow-field-grid {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding-top: 12px;
}

.workflow-field,
.workflow-check {
  display: grid;
  gap: 6px;
  color: #d9e7dd;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.workflow-field input,
.workflow-field select,
.workflow-field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(199, 218, 208, 0.22);
  border-radius: 7px;
  background: #091012;
  color: #f4fff7;
  padding: 9px 10px;
  font: inherit;
  text-transform: none;
}

.workflow-field textarea {
  min-height: 86px;
  resize: vertical;
}

.workflow-check {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(199, 218, 208, 0.16);
  border-radius: 7px;
  background: #101718;
  padding: 9px;
}

.workflow-rules {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.workflow-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.required-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.required-list span {
  border: 1px solid rgba(54, 210, 125, 0.36);
  border-radius: 999px;
  background: rgba(54, 210, 125, 0.09);
  color: #dffff0;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 1180px) {
  .workflow-runner {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .workflow-side-panel {
    grid-column: 1 / -1;
  }
}

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

  .workflow-actions {
    justify-content: stretch;
  }

  .workflow-actions .btn {
    flex: 1 1 140px;
  }
}

/* Stage 1U theme/account/dashboard widget system */
html[data-theme="dark"] {
  --bg: #080a0c;
  --bg-2: #0d1113;
  --panel: #111719;
  --panel-2: #171e20;
  --panel-3: #20282a;
  --line: rgba(169, 185, 178, 0.22);
  --line-soft: rgba(169, 185, 178, 0.1);
  --text: #f6f4ec;
  --muted: #c2cbc3;
  --muted-2: #93a098;
}

html[data-theme="light"] {
  --bg: #f4f7f5;
  --bg-2: #ebf0ed;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --panel-3: #eef4f1;
  --line: rgba(36, 60, 52, 0.18);
  --line-soft: rgba(36, 60, 52, 0.09);
  --text: #12201a;
  --muted: #4f6359;
  --muted-2: #66786f;
  --green: #087f4f;
  --green-soft: rgba(8, 127, 79, 0.12);
  --teal: #087f78;
  --stone: #7a6840;
  --warning: #a87300;
  --danger: #b4232f;
  --info: #087f4f;
  --shadow: 0 16px 38px rgba(24, 41, 34, 0.14);
  color-scheme: light;
}

html[data-theme] body {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(17, 21, 23, 0.98), rgba(8, 10, 12, 0.99) 280px),
    #080a0c;
}

html[data-theme="light"] .pane-shortcut-row {
  background: #ffffff;
  border-color: rgba(36, 60, 52, 0.12);
  color: #12201a;
}

html[data-theme="light"] .pane-shortcut-row:hover,
html[data-theme="light"] .pane-shortcut-row:focus-visible {
  background: #eaf8f1;
  border-color: rgba(8, 127, 79, 0.28);
}

html[data-theme="light"] .pane-shortcut-row span {
  color: #4f6359;
}

html[data-theme="light"] .pane-shortcut-row b {
  background: #f6faf8;
  border-color: rgba(36, 60, 52, 0.16);
  color: #4f6359;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .app-shell,
html[data-theme="light"] .workspace,
html[data-theme="light"] .topbar,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .primary-rail,
html[data-theme="light"] .module-pane,
html[data-theme="light"] .secondary-pane,
html[data-theme="light"] .detail-drawer,
html[data-theme="light"] .panel,
html[data-theme="light"] .metric,
html[data-theme="light"] .report-row,
html[data-theme="light"] .field-site,
html[data-theme="light"] .field-device,
html[data-theme="light"] .status-line,
html[data-theme="light"] .workflow-progress-panel,
html[data-theme="light"] .workflow-main-panel,
html[data-theme="light"] .workflow-side-panel,
html[data-theme="light"] .workflow-context-card {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="light"] .role-home-hero,
html[data-theme="light"] .support-hero-panel,
html[data-theme="light"] .update-hero-panel,
html[data-theme="light"] .client-site-workspace {
  background: linear-gradient(135deg, #ffffff, #eef6f1);
  color: var(--text);
}

html[data-theme="light"] .muted,
html[data-theme="light"] .subtle,
html[data-theme="light"] .report-row span,
html[data-theme="light"] .status-line p,
html[data-theme="light"] .fact span,
html[data-theme="light"] .pane-row span,
html[data-theme="light"] .pane-toggle span {
  color: var(--muted);
}

html[data-theme="light"] .nav-btn,
html[data-theme="light"] .pane-button,
html[data-theme="light"] .subnav-btn,
html[data-theme="light"] .user-switch-button,
html[data-theme="light"] .user-chip,
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .theme-trigger,
html[data-theme="light"] .btn.secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="light"] .nav-btn.active,
html[data-theme="light"] .pane-button.active,
html[data-theme="light"] .subnav-btn.active,
html[data-theme="light"] .btn.primary {
  background: #0a7f50;
  color: #ffffff;
  border-color: #0a7f50;
}

.top-actions {
  position: relative;
  align-items: center;
}

.top-role-actions,
.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-dev-action {
  width: 40px;
  min-width: 40px;
  height: 38px;
  font-size: 12px;
}

.theme-switcher {
  position: relative;
}

.theme-trigger {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 11px;
  font-weight: 850;
}

.theme-menu,
.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  z-index: 80;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.theme-menu {
  right: 0;
  width: 150px;
  padding: 6px;
}

.theme-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 9px;
  font-weight: 800;
  text-align: left;
}

.theme-option.active,
.theme-option:hover {
  background: var(--green-soft);
}

.theme-dot {
  width: 14px;
  min-width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-block;
}

.theme-dot.light {
  background: #ffffff;
  color: #66766e;
}

.theme-dot.dark {
  background: #101517;
  color: #c6d2ca;
}

.theme-dot.system {
  background: linear-gradient(135deg, #ffffff 0 48%, #101517 52% 100%);
  color: #87958d;
}

.account-menu {
  right: 48px;
  width: min(360px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
}

.account-menu-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
}

.account-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(54, 210, 125, 0.36);
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 950;
}

.account-menu-head strong,
.account-menu-head span,
.account-menu-head small,
.account-menu-foot span {
  display: block;
  overflow-wrap: anywhere;
}

.account-menu-head span,
.account-menu-head small,
.account-menu-foot span {
  color: var(--muted);
  font-size: 12px;
}

.account-menu-list,
.account-menu-tools {
  display: grid;
  padding: 6px;
}

.account-menu-list button,
.account-menu-tools button {
  display: grid;
  gap: 3px;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.account-menu-list button:hover,
.account-menu-tools button:hover {
  background: var(--green-soft);
}

.account-menu-list span,
.account-menu-tools span {
  font-weight: 850;
}

.account-menu-list small,
.account-menu-tools small {
  color: var(--muted);
}

.account-menu-tools {
  border-top: 1px solid var(--line-soft);
}

.account-menu-foot {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel-2);
  font-size: 12px;
}

.dashboard-widget-shell {
  position: relative;
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .dashboard-widget-shell {
  background: #f7faf8;
}

.widget-shell-head {
  align-items: center;
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.dashboard-widget-card {
  min-height: 170px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 13px;
  color: var(--text);
}

.dashboard-widget-card.wide {
  grid-column: span 2;
}

.dashboard-widget-card.compact {
  min-height: 132px;
}

.dashboard-widget-card.good {
  border-color: rgba(54, 210, 125, 0.34);
}

.dashboard-widget-card.warn {
  border-color: rgba(230, 185, 86, 0.42);
}

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

.widget-card-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.widget-card-head span {
  color: var(--stone);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.widget-card-head strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.widget-value {
  color: var(--text);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.dashboard-widget-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-widget-drawer {
  position: fixed;
  top: 164px;
  right: 18px;
  bottom: 18px;
  width: min(390px, calc(100vw - 32px));
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 14px;
  overflow: hidden;
}

.widget-control-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.widget-control-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
}

.widget-control-row.muted-row {
  opacity: 0.72;
}

.widget-row-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.widget-drag-handle {
  width: 48px;
  min-width: 48px;
  height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(54, 210, 125, 0.26);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.08);
  color: var(--green);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.widget-drag-handle:active,
.widget-control-row.dragging .widget-drag-handle {
  cursor: grabbing;
}

.widget-drag-handle span {
  display: block;
  color: inherit;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  transform: rotate(90deg);
}

.widget-drag-handle small {
  display: block;
  color: inherit;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.widget-drag-handle:hover,
.widget-drag-handle:focus-visible {
  outline: none;
  border-color: rgba(54, 210, 125, 0.62);
  background: rgba(54, 210, 125, 0.16);
}

.widget-drag-handle:disabled {
  cursor: default;
  opacity: 0.44;
}

.widget-control-row.dragging {
  border-color: rgba(54, 210, 125, 0.72);
  background: rgba(54, 210, 125, 0.12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  opacity: 0.92;
}

.widget-control-list.dragging .widget-control-row:not(.dragging) {
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

body.widget-row-dragging {
  user-select: none;
  cursor: grabbing;
}

.widget-control-row .check-row {
  align-items: start;
}

.widget-control-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  text-transform: none;
}

.widget-control-actions {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding-left: 58px;
}

.widget-control-actions .icon-btn {
  width: 36px;
  min-width: 36px;
  height: 34px;
  font-size: 10px;
}

.widget-control-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.widget-size-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.widget-size-segment button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.widget-size-segment button:hover,
.widget-size-segment button:focus-visible,
.widget-size-segment button.active {
  outline: none;
  background: rgba(54, 210, 125, 0.14);
  border-color: rgba(54, 210, 125, 0.46);
  color: var(--green);
}

.widget-size-segment button:disabled {
  cursor: default;
  opacity: 0.5;
}

.detail-drawer .dashboard-layout-drawer {
  position: static;
  inset: auto;
  width: 100%;
  min-height: 0;
  box-shadow: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.detail-drawer .dashboard-layout-drawer .widget-control-list {
  max-height: none;
  overflow: visible;
}

.widget-control-actions select {
  min-height: 34px;
}

.appearance-panel,
.widget-settings-panel,
.account-summary-panel {
  margin-bottom: 12px;
}

.appearance-segment {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.appearance-segment button {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-weight: 850;
}

.appearance-segment button.active {
  border-color: rgba(54, 210, 125, 0.42);
  background: var(--green-soft);
  color: var(--text);
}

@media (max-width: 1280px) {
  .dashboard-widget-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .top-actions {
    gap: 5px;
  }

  .theme-trigger strong,
  .api-status {
    display: none;
  }

  .account-menu {
    right: 0;
  }

  .dashboard-widget-grid,
  .dashboard-widget-card.wide,
  .appearance-segment {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }

  .dashboard-widget-drawer {
    top: 90px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}

/* Stage 1U final light/readability overrides */
.topbar {
  grid-template-columns: minmax(120px, 0.55fr) minmax(240px, 420px) minmax(0, auto);
}

.top-actions {
  justify-content: flex-end;
  min-width: 0;
}

.top-search input {
  text-overflow: ellipsis;
}

.api-status {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="light"] .role-home-hero,
html[data-theme="light"] .role-home-hero.client,
html[data-theme="light"] .role-home-hero.technician,
html[data-theme="light"] .hero-band,
html[data-theme="light"] .support-hero-panel,
html[data-theme="light"] .update-hero-panel,
html[data-theme="light"] .source-release-panel {
  border-color: rgba(8, 127, 79, 0.28) !important;
  background: linear-gradient(135deg, #ffffff, #eef6f1) !important;
  color: #12201a !important;
  box-shadow: inset 4px 0 0 rgba(8, 127, 79, 0.72) !important;
}

html[data-theme="light"] .role-home-hero h3,
html[data-theme="light"] .hero-band h3,
html[data-theme="light"] .panel-head h3,
html[data-theme="light"] .widget-shell-head h3,
html[data-theme="light"] .sidebar-brand strong,
html[data-theme="light"] .workspace-head h2 {
  color: #12201a !important;
}

html[data-theme="light"] .role-home-hero p,
html[data-theme="light"] .panel-head p,
html[data-theme="light"] .widget-shell-head p,
html[data-theme="light"] .sidebar-brand span,
html[data-theme="light"] .workspace-head p {
  color: #4f6359 !important;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .module-pane,
html[data-theme="light"] .secondary-pane {
  background: #fbfdfb !important;
  color: #12201a !important;
}

html[data-theme="light"] .nav-group-title,
html[data-theme="light"] .pane-label,
html[data-theme="light"] .pane-title,
html[data-theme="light"] .pane-section-title,
html[data-theme="light"] .eyebrow {
  color: #526a5e !important;
}

html[data-theme="light"] .nav-btn,
html[data-theme="light"] .pane-row,
html[data-theme="light"] .pane-button,
html[data-theme="light"] .pane-toggle,
html[data-theme="light"] .subnav-btn {
  color: #263a31 !important;
}

html[data-theme="light"] .nav-btn.active,
html[data-theme="light"] .nav-btn:hover,
html[data-theme="light"] .drawer-tabs button.active,
html[data-theme="light"] .drawer-tabs button:hover,
html[data-theme="light"] .pane-row.active,
html[data-theme="light"] .pane-row:hover,
html[data-theme="light"] .subnav-btn.active,
html[data-theme="light"] .seg.active,
html[data-theme="light"] .map-filter-control.active,
html[data-theme="light"] .map-client-chip.active {
  border-color: rgba(8, 127, 79, 0.42) !important;
  background: rgba(8, 127, 79, 0.11) !important;
  color: #08462f !important;
}

html[data-theme="light"] .local-status-strip .badge,
html[data-theme="light"] .pill,
html[data-theme="light"] .badge,
html[data-theme="light"] .permission-chip,
html[data-theme="light"] .role-route-chips span,
html[data-theme="light"] .workspace-tab {
  border-color: rgba(8, 127, 79, 0.2) !important;
  background: rgba(8, 127, 79, 0.06) !important;
  color: #194031 !important;
  text-shadow: none !important;
}

html[data-theme="light"] .btn.primary {
  background: #087f4f !important;
  color: #ffffff !important;
}

html[data-theme="light"] .btn.secondary,
html[data-theme="light"] .user-chip,
html[data-theme="light"] .theme-trigger,
html[data-theme="light"] .icon-btn {
  color: #12201a !important;
}

html[data-theme="light"] .api-status {
  color: #075c3c !important;
  background: rgba(8, 127, 79, 0.08) !important;
}

html[data-theme="light"] .dashboard-widget-shell {
  background: #f8fbf9 !important;
  color: #12201a !important;
}

html[data-theme="light"] .site-context-button,
html[data-theme="light"] .module-pane-head,
html[data-theme="light"] .pane-search input {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
}

html[data-theme="light"] .context-copy strong,
html[data-theme="light"] .module-pane-head h2,
html[data-theme="light"] .pane-section h3,
html[data-theme="light"] .pane-row span,
html[data-theme="light"] .pane-row b,
html[data-theme="light"] .pane-toggle span,
html[data-theme="light"] .module-pane .btn,
html[data-theme="light"] .module-pane .help-chip {
  color: #12201a !important;
}

html[data-theme="light"] .context-copy small,
html[data-theme="light"] .module-pane-head .eyebrow,
html[data-theme="light"] .pane-search input::placeholder,
html[data-theme="light"] .pane-section .subtle {
  color: #4f6359 !important;
}

html[data-theme="light"] .modal-layer {
  background: rgba(18, 32, 26, 0.34) !important;
}

html[data-theme="light"] .modal-card,
html[data-theme="light"] .support-modal-card,
html[data-theme="light"] .command-palette,
html[data-theme="light"] .account-menu,
html[data-theme="light"] .theme-menu,
html[data-theme="light"] .dashboard-widget-drawer,
html[data-theme="light"] .detail-drawer,
html[data-theme="light"] .drawer-head,
html[data-theme="light"] .drawer-body,
html[data-theme="light"] .drawer-action-footer {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .modal-card,
html[data-theme="light"] .support-modal-card,
html[data-theme="light"] .command-palette,
html[data-theme="light"] .account-menu,
html[data-theme="light"] .theme-menu,
html[data-theme="light"] .dashboard-widget-drawer,
html[data-theme="light"] .detail-drawer {
  box-shadow: 0 18px 52px rgba(24, 41, 34, 0.18) !important;
}

html[data-theme="light"] .modal-head,
html[data-theme="light"] .modal-body,
html[data-theme="light"] .modal-actions,
html[data-theme="light"] .support-modal-body {
  background: transparent !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.12) !important;
}

html[data-theme="light"] .modal-head h3,
html[data-theme="light"] .modal-card h3,
html[data-theme="light"] .modal-card h4,
html[data-theme="light"] .modal-card label,
html[data-theme="light"] .modal-card strong,
html[data-theme="light"] .modal-card b,
html[data-theme="light"] .support-modal-card h3,
html[data-theme="light"] .support-modal-card strong,
html[data-theme="light"] .command-palette h3,
html[data-theme="light"] .account-menu strong,
html[data-theme="light"] .theme-menu strong,
html[data-theme="light"] .dashboard-widget-drawer h3,
html[data-theme="light"] .widget-control-row strong,
html[data-theme="light"] .drawer-head h2,
html[data-theme="light"] .drawer-section h3,
html[data-theme="light"] .compact-drawer-section h3,
html[data-theme="light"] .inspector-title h2,
html[data-theme="light"] .drawer-section strong,
html[data-theme="light"] .detail-grid b,
html[data-theme="light"] .inspector-grid b,
html[data-theme="light"] .mini-kpi strong,
html[data-theme="light"] .fact b,
html[data-theme="light"] .lifecycle-detail-grid strong,
html[data-theme="light"] .workflow-main-panel h3,
html[data-theme="light"] .workflow-side-panel h3 {
  color: #12201a !important;
}

html[data-theme="light"] .modal-head p,
html[data-theme="light"] .modal-card p,
html[data-theme="light"] .modal-card small,
html[data-theme="light"] .support-modal-card p,
html[data-theme="light"] .support-modal-card small,
html[data-theme="light"] .command-palette p,
html[data-theme="light"] .account-menu span,
html[data-theme="light"] .theme-menu span,
html[data-theme="light"] .dashboard-widget-drawer p,
html[data-theme="light"] .widget-control-row small,
html[data-theme="light"] .drawer-head .muted,
html[data-theme="light"] .drawer-section p,
html[data-theme="light"] .detail-grid span,
html[data-theme="light"] .inspector-grid span,
html[data-theme="light"] .mini-kpi span,
html[data-theme="light"] .fact span,
html[data-theme="light"] .lifecycle-detail-grid span,
html[data-theme="light"] .workflow-main-panel p,
html[data-theme="light"] .workflow-side-panel p {
  color: #4f6359 !important;
}

html[data-theme="light"] .modal-card input,
html[data-theme="light"] .modal-card select,
html[data-theme="light"] .modal-card textarea,
html[data-theme="light"] .support-modal-card input,
html[data-theme="light"] .support-modal-card select,
html[data-theme="light"] .support-modal-card textarea,
html[data-theme="light"] .dashboard-widget-drawer input,
html[data-theme="light"] .dashboard-widget-drawer select,
html[data-theme="light"] .dashboard-widget-drawer textarea,
html[data-theme="light"] .detail-drawer input,
html[data-theme="light"] .detail-drawer select,
html[data-theme="light"] .detail-drawer textarea {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.22) !important;
  text-shadow: none !important;
}

html[data-theme="light"] .modal-card input::placeholder,
html[data-theme="light"] .modal-card textarea::placeholder,
html[data-theme="light"] .support-modal-card input::placeholder,
html[data-theme="light"] .support-modal-card textarea::placeholder,
html[data-theme="light"] .dashboard-widget-drawer input::placeholder,
html[data-theme="light"] .detail-drawer input::placeholder,
html[data-theme="light"] .detail-drawer textarea::placeholder {
  color: #718176 !important;
}

html[data-theme="light"] .drawer-tabs button,
html[data-theme="light"] .appearance-segment button,
html[data-theme="light"] .theme-menu button,
html[data-theme="light"] .account-menu button,
html[data-theme="light"] .command-palette button {
  background: #f7faf8 !important;
  color: #263a31 !important;
  border-color: rgba(36, 60, 52, 0.12) !important;
  text-shadow: none !important;
}

html[data-theme="light"] .drawer-section,
html[data-theme="light"] .compact-drawer-section,
html[data-theme="light"] .mini-kpi,
html[data-theme="light"] .detail-grid div,
html[data-theme="light"] .inspector-grid div,
html[data-theme="light"] .status-line,
html[data-theme="light"] .report-row,
html[data-theme="light"] .workflow-step-list li,
html[data-theme="light"] .workflow-context-card,
html[data-theme="light"] .workflow-progress-panel,
html[data-theme="light"] .workflow-main-panel,
html[data-theme="light"] .workflow-side-panel,
html[data-theme="light"] .lifecycle-grid div,
html[data-theme="light"] .lifecycle-detail-grid > div,
html[data-theme="light"] .widget-control-row,
html[data-theme="light"] .account-menu-row,
html[data-theme="light"] .command-item {
  background: #f8fbf9 !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .lifecycle-detail-grid > div.active,
html[data-theme="light"] .lifecycle-strip span.active,
html[data-theme="light"] .appearance-segment button.active,
html[data-theme="light"] .theme-menu button.active,
html[data-theme="light"] .command-item.active,
html[data-theme="light"] .command-item:hover {
  background: rgba(8, 127, 79, 0.12) !important;
  border-color: rgba(8, 127, 79, 0.36) !important;
  color: #08462f !important;
}

html[data-theme="light"] .widget-drag-handle {
  background: #ecf8f2 !important;
  border-color: rgba(8, 127, 79, 0.24) !important;
  color: #087f4f !important;
}

html[data-theme="light"] .widget-drag-handle:hover,
html[data-theme="light"] .widget-drag-handle:focus-visible,
html[data-theme="light"] .widget-control-row.dragging {
  background: #dff4e9 !important;
  border-color: rgba(8, 127, 79, 0.42) !important;
  color: #08462f !important;
}

html[data-theme="light"] .widget-size-segment {
  background: #ffffff !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .widget-size-segment button {
  color: #263a31 !important;
  background: transparent !important;
  border-color: transparent !important;
}

html[data-theme="light"] .widget-size-segment button:hover,
html[data-theme="light"] .widget-size-segment button:focus-visible,
html[data-theme="light"] .widget-size-segment button.active {
  background: rgba(8, 127, 79, 0.12) !important;
  border-color: rgba(8, 127, 79, 0.36) !important;
  color: #08462f !important;
}

html[data-theme="light"] .lifecycle-strip span,
html[data-theme="light"] .workflow-step-pill,
html[data-theme="light"] .support-context-block,
html[data-theme="light"] .support-payload-row {
  background: #ffffff !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
  color: #263a31 !important;
}

html[data-theme="light"] .drawer-action-footer {
  box-shadow: 0 -12px 24px rgba(255, 255, 255, 0.88) !important;
}

html[data-theme="light"] .drawer-scrim {
  background: rgba(18, 32, 26, 0.18) !important;
}

.support-context-preview .fact,
.support-context-preview div,
.support-payload-grid div {
  display: grid;
  gap: 4px;
  align-content: start;
}

.support-context-preview span,
.support-payload-grid span {
  display: block;
}

.support-context-preview b,
.support-payload-grid b {
  display: block;
  margin-top: 0;
}

html[data-theme="light"] .drawer-tabs {
  background: #ffffff !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .drawer-tabs button.active,
html[data-theme="light"] .drawer-tabs button:hover {
  background: #087f4f !important;
  border-color: #087f4f !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .login-screen {
  background:
    radial-gradient(circle at 22% 18%, rgba(54, 210, 125, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(17, 21, 23, 0.98), rgba(8, 10, 12, 0.99) 280px),
    #080a0c;
}

html[data-theme="dark"] .login-panel {
  background: linear-gradient(145deg, rgba(20, 29, 31, 0.96), rgba(9, 14, 16, 0.98));
  color: var(--text);
}

html[data-theme="light"] .login-screen {
  background:
    radial-gradient(circle at 24% 18%, rgba(8, 127, 79, 0.12), transparent 32%),
    linear-gradient(180deg, #f9fbfa 0, #eef5f1 58%, #f7faf8 100%) !important;
  color: #12201a !important;
}

html[data-theme="light"] .login-panel {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
  box-shadow: 0 22px 58px rgba(24, 41, 34, 0.14) !important;
}

html[data-theme="light"] .login-panel h1,
html[data-theme="light"] .login-panel strong,
html[data-theme="light"] .login-form label {
  color: #12201a !important;
}

html[data-theme="light"] .login-panel .muted,
html[data-theme="light"] .login-panel .form-status,
html[data-theme="light"] .login-panel .login-foot span {
  color: #4f6359 !important;
}

html[data-theme="light"] .login-panel .eyebrow {
  color: #526a5e !important;
}

html[data-theme="light"] .login-foot span {
  background: #f8fbf9 !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .login-panel input {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.24) !important;
}

html[data-theme="light"] .login-panel input::placeholder {
  color: #718176 !important;
}

html[data-theme="light"] .integron-logo-mark {
  background: linear-gradient(160deg, rgba(8, 127, 79, 0.16), rgba(8, 127, 120, 0.06)) !important;
  border-color: rgba(8, 127, 79, 0.38) !important;
  color: #087f4f !important;
}

html[data-theme="light"] .integron-logo-word {
  color: #12201a !important;
}

html[data-theme="light"] .toast {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
  box-shadow: 0 16px 38px rgba(24, 41, 34, 0.18) !important;
}

html[data-theme="light"] .toast.show {
  opacity: 1;
}

html[data-theme="dark"] .toast {
  background: #101d1a;
  color: #f6f4ec;
  border-color: rgba(169, 185, 178, 0.22);
}

@media (max-width: 640px) {
  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .integron-logo.large {
    justify-items: start;
  }
}

/* Stage 1U final light-mode dark residue scrub */
html[data-theme="light"] {
  --shell-bg: #fbfdfb;
  --rail-bg: #ffffff;
  --pane-bg: #fbfdfb;
  --canvas-bg: #ffffff;
  --surface-tight: #ffffff;
  --surface-tight-2: #f7faf8;
  --stage1s-neutral: #ffffff;
  --stage1s-neutral-2: #f8fbf9;
  --stage1s-line: rgba(36, 60, 52, 0.16);
  --integron-green: #087f4f;
  --integron-green-2: #0a9660;
}

html[data-theme="light"] body,
html[data-theme="light"] .app-shell,
html[data-theme="light"] .workspace,
html[data-theme="light"] .workspace-content,
html[data-theme="light"] .topbar {
  background: #ffffff !important;
  color: #12201a !important;
}

html[data-theme="light"] .console-left,
html[data-theme="light"] .console-left-body,
html[data-theme="light"] .site-context-selector,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .primary-rail,
html[data-theme="light"] .module-pane,
html[data-theme="light"] .secondary-pane {
  background: #fbfdfb !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .site-context-selector {
  border-bottom-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .site-context-button {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .pane-expand-card {
  background: rgba(8, 127, 79, 0.08) !important;
  color: #12201a !important;
  border-color: rgba(8, 127, 79, 0.34) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .pane-expand-card:hover,
html[data-theme="light"] .pane-expand-card:focus-visible {
  background: rgba(8, 127, 79, 0.14) !important;
  border-color: rgba(8, 127, 79, 0.55) !important;
}

html[data-theme="light"] .pane-expand-card strong {
  color: #12201a !important;
}

html[data-theme="light"] .pane-expand-card small {
  background: rgba(8, 127, 79, 0.14) !important;
  color: #087f4f !important;
}

html[data-theme="light"] .panel,
html[data-theme="light"] .metric,
html[data-theme="light"] .site-card,
html[data-theme="light"] .client-card,
html[data-theme="light"] .entity-card,
html[data-theme="light"] .clean-site-card,
html[data-theme="light"] .field-site,
html[data-theme="light"] .field-device,
html[data-theme="light"] .field-job-card,
html[data-theme="light"] .field-column,
html[data-theme="light"] .role-reality-grid article,
html[data-theme="light"] .recovery-playbook-card,
html[data-theme="light"] .onboarding-panel,
html[data-theme="light"] .onboarding-flow-card,
html[data-theme="light"] .next-action-card,
html[data-theme="light"] .workflow-step-card,
html[data-theme="light"] .client-preview-banner,
html[data-theme="light"] .client-safe-grid > .panel,
html[data-theme="light"] .search-results-panel,
html[data-theme="light"] .role-access-card,
html[data-theme="light"] .security-card,
html[data-theme="light"] .module-role-card,
html[data-theme="light"] .client-site-workspace,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .local-status-strip {
  background: #ffffff !important;
  background-image: none !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .role-reality-grid strong,
html[data-theme="light"] .field-job-card strong,
html[data-theme="light"] .recovery-playbook-card strong,
html[data-theme="light"] .onboarding-flow-card strong,
html[data-theme="light"] .next-action-card strong,
html[data-theme="light"] .workflow-step-card strong {
  color: #12201a !important;
}

html[data-theme="light"] .role-reality-grid span,
html[data-theme="light"] .role-reality-grid small,
html[data-theme="light"] .field-job-card p,
html[data-theme="light"] .field-job-card span,
html[data-theme="light"] .recovery-playbook-card p,
html[data-theme="light"] .recovery-playbook-card small,
html[data-theme="light"] .onboarding-flow-card span,
html[data-theme="light"] .next-action-card small,
html[data-theme="light"] .workflow-step-card span {
  color: #4f6359 !important;
}

html[data-theme="light"] .role-home-hero,
html[data-theme="light"] .role-home-hero.client,
html[data-theme="light"] .role-home-hero.technician,
html[data-theme="light"] .hero-band,
html[data-theme="light"] .support-hero-panel,
html[data-theme="light"] .update-hero-panel,
html[data-theme="light"] .source-release-panel {
  background: linear-gradient(135deg, #ffffff, #eef6f1) !important;
  color: #12201a !important;
  border-color: rgba(8, 127, 79, 0.28) !important;
}

html[data-theme="light"] .score-ring {
  background:
    radial-gradient(circle, #ffffff 0 57%, transparent 58%),
    conic-gradient(var(--green) calc(var(--score, 91) * 1%), rgba(36, 60, 52, 0.12) 0) !important;
  box-shadow: inset 0 0 0 1px rgba(36, 60, 52, 0.14) !important;
  color: #12201a !important;
}

html[data-theme="light"] .score-ring strong {
  color: #12201a !important;
}

html[data-theme="light"] .score-ring span {
  color: #4f6359 !important;
}

html[data-theme="light"] .health-bar {
  background: rgba(36, 60, 52, 0.12) !important;
}

html[data-theme="light"] .mini-stats div,
html[data-theme="light"] .detail-grid div,
html[data-theme="light"] .inspector-grid div,
html[data-theme="light"] .account-summary-panel,
html[data-theme="light"] .widget-settings-panel,
html[data-theme="light"] .appearance-panel {
  background: #f8fbf9 !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .topology-client,
html[data-theme="light"] .topology-site,
html[data-theme="light"] .topology-device-group,
html[data-theme="light"] .topology-branch,
html[data-theme="light"] .topology-group {
  background: transparent !important;
  color: #12201a !important;
}

html[data-theme="light"] .topology-client {
  background: #ffffff !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
}

html[data-theme="light"] .topology-node,
html[data-theme="light"] .topology-empty,
html[data-theme="light"] .topology-alert {
  background: #f8fbf9 !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
}

html[data-theme="light"] .topology-node:hover,
html[data-theme="light"] .site-card:hover,
html[data-theme="light"] .client-card:hover,
html[data-theme="light"] .entity-card:hover,
html[data-theme="light"] .clean-site-card:hover {
  background: rgba(8, 127, 79, 0.06) !important;
  border-color: rgba(8, 127, 79, 0.35) !important;
}

html[data-theme="light"] .topology-node-icon {
  background: rgba(8, 127, 79, 0.1) !important;
  color: #087f4f !important;
}

html[data-theme="light"] .topology-node-state,
html[data-theme="light"] .topology-node.good .topology-node-state,
html[data-theme="light"] .topology-node.good .topology-node-icon,
html[data-theme="light"] .badge.good,
html[data-theme="light"] .badge.healthy,
html[data-theme="light"] .badge.ready,
html[data-theme="light"] .badge.active,
html[data-theme="light"] .badge.allowed,
html[data-theme="light"] .permission-chip.on {
  background: rgba(8, 127, 79, 0.1) !important;
  color: #075c3c !important;
  border-color: rgba(8, 127, 79, 0.34) !important;
}

html[data-theme="light"] .topology-node.warn .topology-node-state,
html[data-theme="light"] .topology-alert .badge,
html[data-theme="light"] .badge.watch,
html[data-theme="light"] .badge.warning {
  background: rgba(168, 115, 0, 0.1) !important;
  color: #6d4c00 !important;
  border-color: rgba(168, 115, 0, 0.3) !important;
}

html[data-theme="light"] .topology-node-copy strong,
html[data-theme="light"] .topology-node-copy small,
html[data-theme="light"] .topology-group-label,
html[data-theme="light"] .topology-branch-label,
html[data-theme="light"] .card-title strong,
html[data-theme="light"] .card-title span,
html[data-theme="light"] .mini-stats b,
html[data-theme="light"] .mini-stats span,
html[data-theme="light"] .panel-head p,
html[data-theme="light"] .metric span,
html[data-theme="light"] .metric small {
  color: #12201a !important;
}

html[data-theme="light"] .topology-node-copy small,
html[data-theme="light"] .card-title span,
html[data-theme="light"] .mini-stats span,
html[data-theme="light"] .panel-head p,
html[data-theme="light"] .metric span,
html[data-theme="light"] .metric small {
  color: #4f6359 !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .pane-search input {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.22) !important;
}

html[data-theme="light"] .floating-tooltip {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(8, 127, 79, 0.36) !important;
  box-shadow: 0 16px 38px rgba(24, 41, 34, 0.18) !important;
}

html[data-theme="light"] .user-switch-menu,
html[data-theme="light"] .sort-menu {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
  box-shadow: 0 18px 44px rgba(24, 41, 34, 0.16) !important;
}

html[data-theme="light"] .user-switch-option,
html[data-theme="light"] .sort-menu button {
  background: transparent !important;
  color: #12201a !important;
  border-color: transparent !important;
}

html[data-theme="light"] .user-switch-option strong,
html[data-theme="light"] .sort-menu button {
  color: #12201a !important;
}

html[data-theme="light"] .user-switch-option span,
html[data-theme="light"] .user-switch-option small {
  color: #4f6359 !important;
}

html[data-theme="light"] .user-switch-option:hover,
html[data-theme="light"] .user-switch-option.active,
html[data-theme="light"] .sort-menu button:hover,
html[data-theme="light"] .sort-menu button.active {
  background: #e8f6ee !important;
  border-color: rgba(8, 127, 79, 0.34) !important;
}

html[data-theme="light"] .user-switch-option.active strong {
  color: #065f3c !important;
}

/* Stage 1V main-area information architecture pass */
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.page-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 12px;
  font-weight: 850;
  cursor: pointer;
}

.page-tabs button.active {
  border-color: rgba(54, 210, 125, 0.52);
  background: var(--green-soft);
  color: var(--text);
}

.overview-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 34%);
  gap: 12px;
  align-items: start;
}

.workbench-main,
.workbench-side {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.workbench-panel .panel-head {
  align-items: flex-start;
}

.workbench-table th,
.workbench-table td {
  vertical-align: top;
}

.workbench-panel .table-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.workbench-table {
  min-width: 0;
  table-layout: fixed;
}

.workbench-table th {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.workbench-table td {
  overflow-wrap: break-word;
}

.table-wrap.sticky-actions .workbench-table {
  min-width: 760px;
  table-layout: auto;
}

.table-wrap.sticky-actions .workbench-table th:last-child,
.table-wrap.sticky-actions .workbench-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 1%;
  white-space: nowrap;
  background: var(--panel);
  box-shadow: -10px 0 16px rgba(0, 0, 0, 0.12);
}

.table-wrap.sticky-actions .workbench-table th:last-child {
  z-index: 3;
}

.workbench-table .btn {
  min-width: 92px;
  white-space: nowrap;
}

.workbench-table .badge {
  max-width: 100%;
  white-space: nowrap;
}

.workbench-table .health-bar {
  min-width: 86px;
  margin-top: 3px;
  margin-bottom: 6px;
}

.workbench-table td > .subtle,
.workbench-table td span.subtle {
  display: block;
  margin-top: 4px;
}

.device-table-wrap .workbench-table {
  min-width: 980px;
  table-layout: fixed;
}

.device-table-wrap .workbench-table th:nth-child(1),
.device-table-wrap .workbench-table td:nth-child(1) {
  width: 18%;
}

.device-table-wrap .workbench-table th:nth-child(2),
.device-table-wrap .workbench-table td:nth-child(2) {
  width: 23%;
}

.device-table-wrap .workbench-table th:nth-child(3),
.device-table-wrap .workbench-table td:nth-child(3) {
  width: 14%;
}

.device-table-wrap .workbench-table th:nth-child(4),
.device-table-wrap .workbench-table td:nth-child(4) {
  width: 15%;
}

.device-table-wrap .workbench-table th:nth-child(5),
.device-table-wrap .workbench-table td:nth-child(5) {
  width: 9%;
}

.device-table-wrap .workbench-table th:nth-child(6),
.device-table-wrap .workbench-table td:nth-child(6) {
  width: 13%;
}

.device-table-wrap .workbench-table th:nth-child(7),
.device-table-wrap .workbench-table td:nth-child(7) {
  width: 116px;
}

.device-table-wrap .workbench-table td,
.device-table-wrap .workbench-table .linkish {
  line-height: 1.35;
}

.device-table-wrap .workbench-table .linkish strong {
  display: block;
}

.context-panel .status-stack {
  gap: 8px;
}

.expert-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  overflow: hidden;
}

.expert-details summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

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

.expert-details summary::after {
  content: "+";
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-weight: 900;
}

.expert-details[open] summary::after {
  content: "-";
}

.expert-details summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.expert-details summary strong {
  font-size: 14px;
}

.expert-details summary small {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.4;
}

.expert-details-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

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

.empty-row td {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.settings-workbench .appearance-panel,
.settings-workbench .widget-settings-panel {
  min-width: 0;
  margin: 0;
}

.settings-workbench .dashboard-widget-shell,
.settings-workbench .dashboard-widget-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.settings-workbench .dashboard-widget-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-workbench .dashboard-widget-card.wide {
  grid-column: span 2;
}

html[data-theme="light"] .page-tabs,
html[data-theme="light"] .expert-details {
  background: #ffffff;
  color: #12201a;
  border-color: rgba(36, 60, 52, 0.18);
}

html[data-theme="light"] .table-wrap.sticky-actions .workbench-table th:last-child,
html[data-theme="light"] .table-wrap.sticky-actions .workbench-table td:last-child {
  background: #ffffff;
  box-shadow: -10px 0 16px rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .page-tabs button {
  background: #ffffff;
  color: #12201a;
  border-color: rgba(36, 60, 52, 0.22);
}

html[data-theme="light"] .page-tabs button.active {
  background: #e4f5ec;
  color: #063f2b;
  border-color: rgba(8, 127, 79, 0.36);
}

html[data-theme="light"] .expert-details summary small {
  color: #4f6359;
}

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

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

@media (max-width: 720px) {
  .overview-row,
  .expert-grid,
  .settings-category-grid {
    grid-template-columns: 1fr;
  }

  .page-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }

  .page-tabs button {
    flex: 0 0 auto;
  }
}

/* Stage 1W workflow usability pass: actionable summary cards and beginner-safe click paths. */
.metric.metric-action {
  position: relative;
  width: 100%;
  appearance: none;
  text-align: left;
  cursor: pointer;
}

.metric.metric-action:hover,
.metric.metric-action:focus-visible {
  border-color: rgba(54, 210, 125, 0.62);
  background: rgba(54, 210, 125, 0.07);
  outline: none;
}

.metric.metric-action em {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 42px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(54, 210, 125, 0.38);
  border-radius: 999px;
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.quick-path-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-color: rgba(54, 210, 125, 0.34);
  background: linear-gradient(180deg, rgba(54, 210, 125, 0.08), rgba(10, 16, 18, 0.94));
}

.quick-path-panel h3,
.quick-path-panel p {
  margin: 0;
}

.quick-path-panel p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
}

.quick-path-actions,
.drawer-guide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-drill {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.inline-drill:hover,
.inline-drill:focus-visible {
  text-decoration: underline;
  outline: none;
}

.workbench-table tr.needs-work td:first-child {
  box-shadow: inset 3px 0 0 rgba(230, 185, 86, 0.86);
}

.workbench-table tr.needs-work:hover td {
  background: rgba(230, 185, 86, 0.055);
}

.drawer-action-guide {
  display: grid;
  gap: 12px;
  border-color: rgba(54, 210, 125, 0.36);
  background: rgba(54, 210, 125, 0.075);
}

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

.drawer-action-guide p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
}

.stage2c-action-summary {
  display: grid;
  gap: 12px;
  border-color: rgba(54, 210, 125, 0.28);
  background: rgba(9, 15, 16, 0.72);
}

.stage2c-action-summary.warn {
  border-color: rgba(230, 185, 86, 0.38);
}

.stage2c-action-summary.danger {
  border-color: rgba(255, 111, 111, 0.42);
}

.stage2c-action-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.stage2c-action-summary-head h3,
.stage2c-action-summary-head p {
  margin: 0;
}

.stage2c-action-summary-head p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.stage2c-action-grid .status-line {
  min-height: 58px;
  align-items: start;
}

html[data-theme="light"] .metric.metric-action:hover,
html[data-theme="light"] .metric.metric-action:focus-visible {
  background: rgba(8, 127, 79, 0.06) !important;
  border-color: rgba(8, 127, 79, 0.36) !important;
}

html[data-theme="light"] .quick-path-panel,
html[data-theme="light"] .drawer-action-guide,
html[data-theme="light"] .stage2c-action-summary {
  background: #f4fbf7 !important;
  color: #12201a !important;
  border-color: rgba(8, 127, 79, 0.28) !important;
}

html[data-theme="light"] .quick-path-panel p:not(.eyebrow),
html[data-theme="light"] .drawer-action-guide p:not(.eyebrow),
html[data-theme="light"] .stage2c-action-summary-head p:not(.eyebrow) {
  color: #4f6359 !important;
}

html[data-theme="light"] .inline-drill,
html[data-theme="light"] .metric.metric-action em {
  color: #087f4f !important;
}

@media (max-width: 860px) {
  .quick-path-panel {
    grid-template-columns: 1fr;
  }

  .quick-path-actions,
  .drawer-guide-actions {
    justify-content: flex-start;
  }

  .stage2c-action-grid {
    grid-template-columns: 1fr;
  }
}

/* Stage 1X role layout clarity: first-glance panels and direct work paths. */
.role-command-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.7fr);
  gap: 12px;
  margin: 10px 0;
}

.first-action-card,
.role-command-card,
.operator-triage-lane,
.technician-priority-panel,
.client-health-panel {
  border-color: rgba(54, 210, 125, 0.22);
}

.first-action-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 172px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.075);
}

.first-action-card h3,
.first-action-card p {
  margin: 0;
}

.first-action-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

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

.role-command-card {
  position: relative;
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

button.role-command-card {
  cursor: pointer;
}

button.role-command-card:hover,
button.role-command-card:focus-visible {
  border-color: rgba(54, 210, 125, 0.58);
  background: rgba(54, 210, 125, 0.08);
  outline: none;
}

.role-command-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.role-command-card strong {
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1;
}

.role-command-card small {
  color: var(--text);
  line-height: 1.35;
}

.role-command-card em {
  position: absolute;
  right: 10px;
  top: 10px;
  min-height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(54, 210, 125, 0.36);
  border-radius: 999px;
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.role-command-card.good {
  border-color: rgba(54, 210, 125, 0.34);
}

.role-command-card.warn {
  border-color: rgba(230, 185, 86, 0.48);
}

.role-command-card.danger {
  border-color: rgba(255, 107, 107, 0.52);
}

.client-first-glance {
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.9fr);
}

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

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

.client-health-list {
  display: grid;
  gap: 8px;
}

.client-health-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) repeat(5, minmax(96px, 0.72fr)) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.client-health-row.warn {
  border-color: rgba(230, 185, 86, 0.44);
}

.client-health-row.danger {
  border-color: rgba(255, 107, 107, 0.5);
}

.client-health-main,
.client-health-cell {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.client-health-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.client-health-main span {
  display: grid;
  gap: 3px;
}

.client-health-cell {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 10px;
}

.client-health-cell span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.client-health-cell b {
  font-size: 13px;
  line-height: 1.2;
}

.client-health-cell.good b {
  color: var(--green);
}

.client-health-cell.warn b {
  color: var(--yellow);
}

.client-health-cell.danger b {
  color: var(--red);
}

.client-health-main:hover,
.client-health-main:focus-visible,
.client-health-cell:hover,
.client-health-cell:focus-visible {
  border-color: rgba(54, 210, 125, 0.48);
  outline: none;
}

.technician-command-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.technician-priority-panel {
  margin: 10px 0;
}

.priority-work-list {
  display: grid;
  gap: 8px;
}

.priority-work-row,
.operator-triage-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.priority-work-row.warn,
.operator-triage-item.warn {
  border-color: rgba(230, 185, 86, 0.42);
}

.priority-work-row.danger,
.operator-triage-item.danger {
  border-color: rgba(255, 107, 107, 0.52);
}

.priority-work-main,
.operator-triage-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.priority-work-main span,
.operator-triage-main span {
  display: grid;
  gap: 4px;
}

.priority-work-main small,
.operator-triage-main small {
  color: var(--muted);
}

.priority-work-main:hover,
.priority-work-main:focus-visible,
.operator-triage-main:hover,
.operator-triage-main:focus-visible {
  color: var(--green);
  outline: none;
}

.operator-triage-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0;
}

.stage2i-operator-board {
  align-items: stretch;
}

.operator-triage-lane {
  display: grid;
  align-content: start;
  gap: 10px;
}

.operator-triage-lane .panel-head {
  align-items: flex-start;
}

.operator-triage-list {
  display: grid;
  gap: 8px;
}

.operator-triage-item {
  grid-template-columns: 1fr;
}

.operator-triage-item .row-actions {
  justify-content: flex-start;
}

.badge-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(54, 210, 125, 0.32);
  border-radius: 999px;
  background: rgba(54, 210, 125, 0.08);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.badge-button:hover,
.badge-button:focus-visible {
  border-color: rgba(54, 210, 125, 0.6);
  outline: none;
}

html[data-theme="light"] .first-action-card,
html[data-theme="light"] .role-command-card,
html[data-theme="light"] .client-health-row,
html[data-theme="light"] .client-health-main,
html[data-theme="light"] .client-health-cell,
html[data-theme="light"] .priority-work-row,
html[data-theme="light"] .operator-triage-item,
html[data-theme="light"] .badge-button {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
}

html[data-theme="light"] .first-action-card {
  background: #f4fbf7 !important;
  border-color: rgba(8, 127, 79, 0.24) !important;
}

html[data-theme="light"] button.role-command-card:hover,
html[data-theme="light"] button.role-command-card:focus-visible,
html[data-theme="light"] .client-health-main:hover,
html[data-theme="light"] .client-health-main:focus-visible,
html[data-theme="light"] .client-health-cell:hover,
html[data-theme="light"] .client-health-cell:focus-visible {
  background: #f4fbf7 !important;
  border-color: rgba(8, 127, 79, 0.38) !important;
}

html[data-theme="light"] .first-action-card p:not(.eyebrow),
html[data-theme="light"] .role-command-card span,
html[data-theme="light"] .priority-work-main small,
html[data-theme="light"] .operator-triage-main small,
html[data-theme="light"] .client-health-cell span {
  color: #4f6359 !important;
}

html[data-theme="light"] .role-command-card small,
html[data-theme="light"] .role-command-card strong,
html[data-theme="light"] .client-health-cell b,
html[data-theme="light"] .priority-work-main,
html[data-theme="light"] .operator-triage-main {
  color: #12201a !important;
}

html[data-theme="light"] .role-command-card.good,
html[data-theme="light"] .client-health-cell.good {
  border-color: rgba(8, 127, 79, 0.26) !important;
}

html[data-theme="light"] .role-command-card.warn,
html[data-theme="light"] .client-health-row.warn,
html[data-theme="light"] .client-health-cell.warn,
html[data-theme="light"] .priority-work-row.warn,
html[data-theme="light"] .operator-triage-item.warn {
  border-color: rgba(165, 117, 22, 0.36) !important;
}

html[data-theme="light"] .role-command-card.danger,
html[data-theme="light"] .client-health-row.danger,
html[data-theme="light"] .client-health-cell.danger,
html[data-theme="light"] .priority-work-row.danger,
html[data-theme="light"] .operator-triage-item.danger {
  border-color: rgba(176, 57, 57, 0.36) !important;
}

@media (max-width: 1280px) {
  .client-command-grid,
  .technician-command-grid,
  .operator-triage-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-health-row {
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(100px, 0.65fr));
  }
}

@media (max-width: 900px) {
  .role-command-panel {
    grid-template-columns: 1fr;
  }

  .command-card-grid,
  .operator-triage-board {
    grid-template-columns: 1fr;
  }

  .client-health-row,
  .priority-work-row {
    grid-template-columns: 1fr;
  }

  .client-health-main,
  .priority-work-main {
    min-height: 50px;
  }
}

/* Stage 1Y first-glance oversight: role-specific pages explain the next click before detail. */
.role-home-hero.compact-client-hero {
  min-height: 154px;
  padding: 18px 22px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.role-home-hero.compact-client-hero h3 {
  font-size: clamp(30px, 3.4vw, 46px);
}

.client-today-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(54, 210, 125, 0.08), rgba(10, 17, 14, 0.72));
}

.client-today-strip.warn {
  border-color: rgba(230, 185, 86, 0.42);
  background: linear-gradient(135deg, rgba(230, 185, 86, 0.08), rgba(10, 17, 14, 0.72));
}

.client-today-strip.danger {
  border-color: rgba(255, 107, 107, 0.42);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.07), rgba(10, 17, 14, 0.72));
}

.client-today-strip .role-command-card {
  min-height: 96px;
  padding: 12px;
}

.client-today-strip .role-command-card strong {
  font-size: clamp(18px, 2vw, 27px);
}

.client-today-status {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(54, 210, 125, 0.34);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.11);
}

.client-today-strip.warn .client-today-status {
  border-color: rgba(230, 185, 86, 0.4);
  background: rgba(230, 185, 86, 0.1);
}

.client-today-strip.danger .client-today-status {
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.1);
}

.client-today-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-today-status strong {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.client-today-status small {
  color: var(--text);
  line-height: 1.35;
}

.client-attention-panel {
  margin: 10px 0;
}

.client-attention-list {
  display: grid;
  gap: 8px;
}

.client-attention-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(230, 185, 86, 0.44);
  border-radius: 8px;
  background: rgba(230, 185, 86, 0.045);
}

.client-attention-row.danger {
  border-color: rgba(255, 107, 107, 0.52);
  background: rgba(255, 107, 107, 0.045);
}

.client-attention-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.client-attention-main span {
  display: grid;
  gap: 4px;
}

.client-attention-main small {
  color: var(--muted);
  line-height: 1.35;
}

.client-attention-main:hover,
.client-attention-main:focus-visible {
  color: var(--green);
  outline: none;
}

.client-attention-empty {
  display: grid;
  gap: 4px;
  min-height: 88px;
  align-content: center;
  padding: 16px;
  border: 1px dashed rgba(54, 210, 125, 0.28);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.055);
}

.client-attention-empty span {
  color: var(--muted);
}

.client-mini-topology {
  grid-column: span 2;
}

.client-topology-tree {
  display: grid;
  gap: 8px;
}

.client-topology-root,
.client-topology-site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--text);
}

.client-topology-root {
  border-color: rgba(54, 210, 125, 0.3);
  background: rgba(54, 210, 125, 0.07);
}

.client-topology-root span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.client-topology-site {
  position: relative;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.client-topology-site::before {
  content: "";
  width: 2px;
  align-self: stretch;
  border-radius: 999px;
  background: rgba(54, 210, 125, 0.52);
}

.client-topology-site.warn::before {
  background: rgba(230, 185, 86, 0.72);
}

.client-topology-site span {
  display: grid;
  gap: 3px;
  margin-right: auto;
}

.client-topology-site small {
  color: var(--muted);
}

.client-topology-site:hover,
.client-topology-site:focus-visible {
  border-color: rgba(54, 210, 125, 0.48);
  background: rgba(54, 210, 125, 0.06);
  outline: none;
}

.client-more-modules-panel {
  margin-top: 12px;
  border-color: rgba(54, 210, 125, 0.22);
}

.client-more-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
}

.client-more-module {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.client-more-module span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.client-more-module:hover,
.client-more-module:focus-visible {
  border-color: rgba(54, 210, 125, 0.48);
  outline: none;
}

.technician-readiness-panel,
.operator-handoff-panel,
.admin-role-visibility-panel {
  margin: 10px 0;
}

.readiness-row-grid,
.handoff-quality-grid,
.role-visibility-grid {
  display: grid;
  gap: 8px;
}

.readiness-row-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.handoff-quality-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.role-visibility-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.readiness-row,
.handoff-quality-card,
.role-visibility-card {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--text);
}

.readiness-row,
.handoff-quality-card {
  display: grid;
  align-content: start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.role-visibility-card {
  display: grid;
  gap: 8px;
}

.readiness-row span,
.role-visibility-card span {
  display: grid;
  gap: 4px;
}

.readiness-row small,
.handoff-quality-card small,
.role-visibility-card span {
  color: var(--muted);
  line-height: 1.35;
}

.readiness-row.good,
.handoff-quality-card.good,
.role-visibility-card.good {
  border-color: rgba(54, 210, 125, 0.34);
}

.readiness-row.warn,
.handoff-quality-card.warn,
.role-visibility-card.warn {
  border-color: rgba(230, 185, 86, 0.44);
}

.role-visibility-card.admin {
  border-color: rgba(106, 176, 255, 0.38);
}

.readiness-row:hover,
.readiness-row:focus-visible,
.handoff-quality-card:hover,
.handoff-quality-card:focus-visible {
  border-color: rgba(54, 210, 125, 0.54);
  background: rgba(54, 210, 125, 0.06);
  outline: none;
}

.handoff-quality-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.handoff-quality-card strong {
  font-size: 24px;
}

html[data-theme="light"] .role-home-hero.compact-client-hero,
html[data-theme="light"] .client-today-strip,
html[data-theme="light"] .client-attention-panel,
html[data-theme="light"] .client-attention-row,
html[data-theme="light"] .client-attention-main,
html[data-theme="light"] .client-attention-empty,
html[data-theme="light"] .client-mini-topology,
html[data-theme="light"] .client-topology-root,
html[data-theme="light"] .client-topology-site,
html[data-theme="light"] .client-more-modules-panel,
html[data-theme="light"] .client-more-module,
html[data-theme="light"] .technician-readiness-panel,
html[data-theme="light"] .operator-handoff-panel,
html[data-theme="light"] .admin-role-visibility-panel,
html[data-theme="light"] .readiness-row,
html[data-theme="light"] .handoff-quality-card,
html[data-theme="light"] .role-visibility-card {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
}

html[data-theme="light"] .client-today-strip,
html[data-theme="light"] .client-today-status,
html[data-theme="light"] .client-attention-empty,
html[data-theme="light"] .client-topology-root {
  background: #f4fbf7 !important;
  border-color: rgba(8, 127, 79, 0.24) !important;
}

html[data-theme="light"] .client-today-strip.warn,
html[data-theme="light"] .client-attention-row.warn,
html[data-theme="light"] .readiness-row.warn,
html[data-theme="light"] .handoff-quality-card.warn,
html[data-theme="light"] .role-visibility-card.warn {
  border-color: rgba(165, 117, 22, 0.36) !important;
}

html[data-theme="light"] .client-today-strip.danger,
html[data-theme="light"] .client-attention-row.danger {
  border-color: rgba(176, 57, 57, 0.36) !important;
}

html[data-theme="light"] .client-today-status span,
html[data-theme="light"] .client-today-status small,
html[data-theme="light"] .client-attention-main small,
html[data-theme="light"] .client-attention-empty span,
html[data-theme="light"] .client-topology-root span,
html[data-theme="light"] .client-topology-site small,
html[data-theme="light"] .client-more-module span,
html[data-theme="light"] .readiness-row small,
html[data-theme="light"] .handoff-quality-card span,
html[data-theme="light"] .handoff-quality-card small,
html[data-theme="light"] .role-visibility-card span {
  color: #4f6359 !important;
}

html[data-theme="light"] .client-today-status strong,
html[data-theme="light"] .client-attention-main,
html[data-theme="light"] .client-more-module,
html[data-theme="light"] .readiness-row,
html[data-theme="light"] .handoff-quality-card,
html[data-theme="light"] .role-visibility-card {
  color: #12201a !important;
}

@media (max-width: 1500px) {
  .client-today-strip {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }

  .client-today-status {
    grid-column: span 2;
  }

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

@media (max-width: 1180px) {
  .handoff-quality-grid,
  .role-visibility-grid,
  .client-more-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-mini-topology {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .role-home-hero.compact-client-hero,
  .client-today-strip,
  .client-attention-row,
  .client-topology-root,
  .client-topology-site {
    grid-template-columns: 1fr;
  }

  .client-today-strip,
  .readiness-row-grid,
  .handoff-quality-grid,
  .role-visibility-grid,
  .client-more-module-grid {
    grid-template-columns: 1fr;
  }

  .client-today-status,
  .client-mini-topology {
    grid-column: auto;
  }
}

/* Sleek workbench baseline: one primary surface, slim status strips, contextual inspector. */
.sleek-status-strip.overview-row,
.sleek-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 8px 0 10px;
  padding: 0;
  border: 1px solid rgba(73, 104, 97, 0.22);
  border-radius: 8px;
  background: rgba(9, 14, 15, 0.46);
  overflow: hidden;
}

.sleek-status-segment {
  min-width: 126px;
  min-height: 42px;
  flex: 1 1 140px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "label value"
    "note note";
  align-content: center;
  gap: 1px 8px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid rgba(73, 104, 97, 0.18);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.sleek-status-segment:last-child {
  border-right: 0;
}

button.sleek-status-segment {
  cursor: pointer;
}

button.sleek-status-segment:hover,
button.sleek-status-segment:focus-visible {
  background: rgba(54, 210, 125, 0.06);
  outline: none;
}

.sleek-status-segment span {
  grid-area: label;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.sleek-status-segment strong {
  grid-area: value;
  justify-self: end;
  font-size: 18px;
  line-height: 1;
}

.sleek-status-segment small {
  grid-area: note;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sleek-status-segment.good strong {
  color: var(--green);
}

.sleek-status-segment.warn strong {
  color: var(--yellow);
}

.sleek-status-segment.danger strong {
  color: var(--red);
}

.client-today-strip.sleek-status-strip {
  display: flex;
  padding: 0;
  background: rgba(54, 210, 125, 0.045);
}

.client-today-strip > .sleek-status-strip {
  display: contents;
}

.client-today-status.sleek-status-segment {
  flex: 1.15 1 190px;
  background: rgba(54, 210, 125, 0.07);
  border-right-color: rgba(54, 210, 125, 0.2);
}

.client-today-status.sleek-status-segment strong {
  justify-self: end;
  font-size: 19px;
}

.workbench-layout.sleek-workbench,
.workbench-layout.no-side {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.sleek-workbench .workbench-main {
  gap: 8px;
}

.workbench-chrome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.18);
}

.workbench-title {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 9px;
}

.section-mini-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1px solid rgba(54, 210, 125, 0.35);
  border-radius: 6px;
  background: rgba(54, 210, 125, 0.09);
  color: #36d27d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.workbench-chrome h3,
.workbench-chrome p {
  margin: 0;
}

.workbench-chrome h3 {
  font-size: 15px;
}

.workbench-chrome p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workbench-chrome-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.section-footer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 36px;
  padding: 8px 12px;
  border-top: 1px solid rgba(73, 104, 97, 0.16);
}

.section-link-action {
  appearance: none;
  min-height: 26px;
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.section-link-action:hover,
.section-link-action:focus-visible {
  background: rgba(54, 210, 125, 0.09);
  color: var(--text);
  outline: none;
}

.section-link-action.disabled-action {
  color: var(--muted);
}

.section-action-divider {
  width: 1px;
  height: 16px;
  margin: 0 10px;
  background: rgba(73, 104, 97, 0.2);
}

.quick-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin: 8px 0;
  padding: 7px 10px;
  border: 1px solid rgba(73, 104, 97, 0.18);
  border-radius: 8px;
  background: rgba(10, 15, 17, 0.42);
}

.quick-filter-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quick-filter-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(133, 151, 144, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.quick-filter b {
  color: var(--accent);
  font-size: 11px;
}

.quick-filter.active {
  border-color: rgba(54, 210, 125, 0.75);
  background: rgba(54, 210, 125, 0.12);
  color: var(--text);
}

.quick-filter.warn b,
.quick-filter.warn {
  border-color: rgba(230, 185, 60, 0.45);
}

.quick-filter.danger b,
.quick-filter.danger {
  border-color: rgba(255, 92, 92, 0.45);
}

.site-toolbar.quick-filter-bar {
  align-items: flex-start;
}

.site-toolbar .toolbar-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-toolbar .toolbar-row {
  margin: 0;
}

.compact-config-section {
  padding: 12px;
}

.sleek-list-panel {
  padding: 0;
  border-color: rgba(73, 104, 97, 0.18);
  background: rgba(10, 15, 17, 0.54);
  overflow: hidden;
}

.sleek-list-panel .table-wrap {
  border: 0;
  border-radius: 0;
  overflow-x: auto;
}

.sleek-list-panel .ops-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(16, 23, 25, 0.98);
}

.sleek-list-panel .ops-table th,
.sleek-list-panel .ops-table td {
  padding: 9px 12px;
  border-bottom-color: rgba(73, 104, 97, 0.16);
}

.sleek-list-panel .ops-table tr[data-entity]:hover td {
  background: rgba(54, 210, 125, 0.045);
}

.sleek-list-panel .linkish strong {
  font-size: 13px;
}

.sleek-list-panel .btn.small {
  min-height: 30px;
  min-width: 82px;
}

.compact-filter-bar,
.filter-bar {
  margin: 8px 0;
}

.filter-bar .seg,
.compact-filter-bar button,
.toolbar-row.status-filter .seg {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.quick-path-panel {
  min-height: 48px;
  padding: 8px 10px;
  border-width: 1px;
  background: rgba(54, 210, 125, 0.045);
}

.quick-path-panel h3 {
  font-size: 14px;
}

.quick-path-panel p:not(.eyebrow) {
  max-width: 900px;
  font-size: 12px;
}

.quick-path-actions .btn {
  min-height: 30px;
  padding: 0 10px;
}

.role-home-hero {
  min-height: 120px;
}

.role-command-panel,
.operator-triage-board,
.technician-readiness-panel,
.operator-handoff-panel,
.admin-role-visibility-panel,
.client-attention-panel {
  margin-top: 8px;
}

html[data-theme="light"] .sleek-status-strip,
html[data-theme="light"] .sleek-status-strip.overview-row,
html[data-theme="light"] .client-today-strip.sleek-status-strip,
html[data-theme="light"] .client-today-status.sleek-status-segment,
html[data-theme="light"] .sleek-list-panel {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .sleek-status-segment {
  background: #ffffff !important;
  color: #12201a !important;
  border-right-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] button.sleek-status-segment:hover,
html[data-theme="light"] button.sleek-status-segment:focus-visible {
  background: #f4fbf7 !important;
}

html[data-theme="light"] .client-today-status.sleek-status-segment {
  background: #f4fbf7 !important;
}

html[data-theme="light"] .workbench-chrome {
  border-bottom-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .section-mini-icon {
  background: #e9f7f0 !important;
  color: #04794f !important;
  border-color: rgba(4, 121, 79, 0.28) !important;
}

html[data-theme="light"] .quick-filter-bar {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .quick-filter-label {
  color: #5a6d63 !important;
}

html[data-theme="light"] .quick-filter {
  background: #ffffff !important;
  color: #12201a !important;
  border-color: rgba(36, 60, 52, 0.2) !important;
}

html[data-theme="light"] .quick-filter.active {
  background: #e8f8f0 !important;
  border-color: rgba(4, 121, 79, 0.42) !important;
}

html[data-theme="light"] .section-footer-actions {
  border-top-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .section-link-action:hover,
html[data-theme="light"] .section-link-action:focus-visible {
  background: #e8f8f0 !important;
  color: #102018 !important;
}

html[data-theme="light"] .section-action-divider {
  background: rgba(36, 60, 52, 0.18) !important;
}

html[data-theme="light"] .sleek-list-panel .ops-table th {
  background: #f7faf8 !important;
}

html[data-theme="light"] .sleek-list-panel .ops-table tr[data-entity]:hover td {
  background: #f4fbf7 !important;
}

html[data-theme="light"] .sleek-status-segment span,
html[data-theme="light"] .sleek-status-segment small,
html[data-theme="light"] .workbench-chrome p {
  color: #4f6359 !important;
}

@media (max-width: 980px) {
  .sleek-status-segment {
    flex-basis: 46%;
  }

  .workbench-chrome {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .sleek-status-segment {
    flex-basis: 100%;
    border-right: 0;
    border-bottom: 1px solid rgba(73, 104, 97, 0.16);
  }

  .sleek-status-segment:last-child {
    border-bottom: 0;
  }
}

/* Real role dashboard layout controlled from the right-side layout drawer. */
.role-dashboard-sections {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.role-dashboard-section {
  min-width: 0;
}

.role-dashboard-section.layout-wide {
  grid-column: 1 / -1;
}

.role-dashboard-section.layout-compact .stage2a-workbench-header {
  padding: 13px 15px;
}

.role-dashboard-section.layout-compact .stage2a-workbench-header h3 {
  font-size: 22px;
}

.role-dashboard-section.layout-compact .stage2a-primary-queue .stage2a-queue-row:nth-child(n+4),
.role-dashboard-section.layout-compact .stage2a-secondary-rail .status-line:nth-child(n+5) {
  display: none;
}

.role-dashboard-section.layout-compact .stage2a-primary-queue .panel-head p,
.role-dashboard-section.layout-compact .stage2a-secondary-rail .panel-head p {
  max-width: 740px;
}

.dashboard-layout-empty {
  display: grid;
  gap: 12px;
}

/* Stage 2A role workbench clarity: command strip, one primary queue, resolution drawers. */
.stage2a-workbench-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  min-height: 0;
  padding: 18px 20px;
  border: 1px solid rgba(73, 104, 97, 0.22);
  border-radius: 10px;
  background-color: #0b1113;
  background-image: linear-gradient(180deg, rgba(11, 17, 19, 0.9), rgba(8, 14, 15, 0.78));
  box-shadow: none;
}

.stage2a-workbench-header h3 {
  margin: 2px 0 6px;
  color: var(--text);
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.05;
  letter-spacing: 0;
}

.stage2a-workbench-header p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.stage2a-header-copy {
  min-width: 0;
}

.stage2a-header-actions,
.stage2a-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.stage2a-header-meta {
  margin-top: 12px;
}

.stage2a-command-strip {
  margin: 8px 0;
}

.stage2a-command-strip .sleek-status-segment {
  min-height: 74px;
  border-color: rgba(73, 104, 97, 0.18);
}

.stage2a-command-strip button.sleek-status-segment {
  cursor: pointer;
}

.stage2a-command-strip .sleek-status-segment strong {
  font-size: 20px;
}

.stage2a-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 34%);
  gap: 10px;
  align-items: start;
  margin-top: 8px;
}

.stage2a-primary-queue {
  padding: 0;
  overflow: hidden;
}

.stage2a-primary-queue .panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.18);
}

.stage2a-primary-queue .panel-head h3 {
  font-size: 15px;
}

.stage2a-primary-queue .panel-head p {
  margin-top: 4px;
  font-size: 12px;
}

.stage2a-queue-list {
  display: grid;
  gap: 0;
}

.stage2a-queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.14);
  background: rgba(255, 255, 255, 0.012);
}

.stage2a-queue-row:last-child {
  border-bottom: 0;
}

.stage2a-queue-row[role="button"] {
  cursor: pointer;
}

.stage2a-queue-row[role="button"]:hover,
.stage2a-queue-row[role="button"]:focus-visible {
  background: rgba(54, 210, 125, 0.055);
  outline: none;
}

.stage2a-queue-row.warn {
  box-shadow: inset 3px 0 0 rgba(230, 185, 60, 0.9);
}

.stage2a-queue-row.danger {
  box-shadow: inset 3px 0 0 rgba(255, 92, 92, 0.9);
}

.stage2a-queue-row.good {
  box-shadow: inset 3px 0 0 rgba(54, 210, 125, 0.8);
}

.stage2a-queue-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.stage2a-queue-main strong,
.stage2a-queue-main span,
.stage2a-queue-main small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage2a-queue-main strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.stage2a-queue-main span {
  color: var(--text);
  font-size: 12px;
}

.stage2a-queue-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stage2a-queue-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.stage2a-secondary-rail {
  position: sticky;
  top: 72px;
  min-width: 0;
}

.stage2a-secondary-rail .status-stack {
  gap: 6px;
}

.stage2a-secondary-rail .status-line {
  min-height: 52px;
  border-radius: 8px;
}

.stage2a-widget-shelf {
  margin-top: 10px;
  border-top: 1px solid rgba(73, 104, 97, 0.16);
  padding-top: 10px;
}

.stage2a-widget-shelf .dashboard-widget-shell {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.stage2a-widget-shelf .widget-shell-head h3 {
  font-size: 14px;
}

.stage2a-widget-shelf .widget-shell-head p {
  font-size: 12px;
}

.stage2a-widget-shelf .dashboard-widget-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.stage2a-widget-shelf .dashboard-widget-card {
  min-height: 86px;
  padding: 10px;
  border-radius: 8px;
}

.stage2a-widget-shelf .dashboard-widget-card strong {
  font-size: 14px;
}

.stage2a-widget-shelf .dashboard-widget-card p {
  font-size: 11px;
}

.stage2a-resolution-block {
  background: rgba(54, 210, 125, 0.045);
  border-color: rgba(54, 210, 125, 0.18);
}

.stage2a-resolution-block h3 {
  margin: 0 0 8px;
}

.resolution-grid {
  display: grid;
  gap: 6px;
}

.client-topology-root {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(73, 104, 97, 0.18);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.06);
  color: var(--text);
}

.client-topology-root span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stage2a-compat-hooks {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.client-workbench-grid,
.technician-workbench-grid,
.operator-workbench-grid,
.admin-workbench-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 32%);
}

html[data-theme="light"] .stage2a-workbench-header {
  background-color: #ffffff !important;
  background-image: linear-gradient(180deg, #ffffff, #f6fbf8) !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .stage2a-workbench-header.role-home-hero,
html[data-theme="light"] .stage2a-workbench-header.role-home-hero.client,
html[data-theme="light"] .stage2a-workbench-header.role-home-hero.technician,
html[data-theme="light"] .stage2a-workbench-header.role-home-hero.operator,
html[data-theme="light"] .stage2a-workbench-header.role-home-hero.admin {
  background-color: #ffffff !important;
  background-image: linear-gradient(180deg, #ffffff, #f6fbf8) !important;
}

html[data-theme="light"] .stage2a-workbench-header h3,
html[data-theme="light"] .stage2a-queue-main strong,
html[data-theme="light"] .stage2a-queue-main span {
  color: #102018 !important;
}

html[data-theme="light"] .stage2a-workbench-header p,
html[data-theme="light"] .stage2a-queue-main small {
  color: #4f6359 !important;
}

html[data-theme="light"] .stage2a-primary-queue,
html[data-theme="light"] .stage2a-secondary-rail,
html[data-theme="light"] .stage2a-widget-shelf .dashboard-widget-shell,
html[data-theme="light"] .stage2a-resolution-block,
html[data-theme="light"] .client-topology-root {
  background: #ffffff !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .stage2a-queue-row {
  background: #ffffff !important;
  border-bottom-color: rgba(36, 60, 52, 0.12) !important;
}

html[data-theme="light"] .stage2a-queue-row[role="button"]:hover,
html[data-theme="light"] .stage2a-queue-row[role="button"]:focus-visible {
  background: #f4fbf7 !important;
}

html[data-theme="light"] .stage2a-primary-queue .panel-head {
  border-bottom-color: rgba(36, 60, 52, 0.14) !important;
}

@media (max-width: 1040px) {
  .stage2a-workbench-header,
  .stage2a-workbench-grid,
  .client-workbench-grid,
  .technician-workbench-grid,
  .operator-workbench-grid,
  .admin-workbench-grid {
    grid-template-columns: 1fr;
  }

  .stage2a-secondary-rail {
    position: static;
  }
}

@media (max-width: 700px) {
  .stage2a-workbench-header {
    padding: 14px;
  }

  .stage2a-header-actions {
    justify-content: stretch;
  }

  .stage2a-header-actions .btn {
    flex: 1 1 150px;
  }

  .stage2a-queue-row {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .stage2a-queue-actions {
    justify-content: flex-start;
  }

  .stage2a-command-strip .sleek-status-segment {
    min-height: 64px;
  }
}

/* Stage 2B client clarity: site switcher, SLA-aware support, cleaner client surfaces. */
.site-context-selector {
  position: relative;
  z-index: 30;
}

.site-switcher-menu {
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(100% + 6px);
  display: grid;
  gap: 8px;
  max-height: min(560px, calc(100vh - 88px));
  padding: 10px;
  border: 1px solid rgba(73, 104, 97, 0.28);
  border-radius: 8px;
  background: #101719;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  overflow: auto;
}

.site-switcher-search {
  display: grid;
  gap: 5px;
}

.site-switcher-search label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-switcher-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(112, 138, 130, 0.24);
  border-radius: 6px;
  background: #0b1113;
  color: var(--text);
  padding: 0 10px;
}

.site-switcher-list {
  display: grid;
  gap: 3px;
}

.site-switcher-row {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.site-switcher-row:hover,
.site-switcher-row:focus-visible,
.site-switcher-row.active {
  border-color: rgba(54, 210, 125, 0.38);
  background: rgba(54, 210, 125, 0.065);
  outline: none;
}

.site-switcher-row span:not(.context-status) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.site-switcher-row strong,
.site-switcher-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-switcher-row strong {
  font-size: 13px;
}

.site-switcher-row small {
  color: var(--muted);
  font-size: 11px;
}

.site-switcher-row b {
  color: var(--green);
  font-size: 12px;
}

.site-switcher-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.site-switcher-footer {
  display: flex;
  gap: 6px;
  border-top: 1px solid rgba(73, 104, 97, 0.18);
  padding-top: 8px;
}

.pane-status-note {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  padding: 9px;
  border: 1px solid rgba(54, 210, 125, 0.26);
  border-radius: 7px;
  background: rgba(54, 210, 125, 0.055);
}

.pane-status-note strong {
  color: var(--text);
  font-size: 12px;
}

.pane-status-note span {
  color: var(--muted);
  font-size: 11px;
}

.pane-row.quiet {
  opacity: 0.9;
}

.support-sla-note,
.stage2b-support-band {
  border: 1px solid rgba(73, 104, 97, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.support-sla-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.support-sla-note strong {
  color: var(--text);
}

.support-sla-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.support-sla-note.email-only {
  border-color: rgba(230, 185, 86, 0.38);
  background: rgba(230, 185, 86, 0.06);
}

.support-sla-note.managed {
  border-color: rgba(54, 210, 125, 0.32);
  background: rgba(54, 210, 125, 0.055);
}

.stage2b-support-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 10px 0;
  padding: 14px 16px;
  background: #0f1516;
}

.stage2b-support-band h3 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
}

.stage2b-support-band p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stage2b-support-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.client-service-status-band {
  margin-top: 0;
}

.client-service-inline {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid rgba(54, 210, 125, 0.24);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.045);
  padding: 10px 12px;
}

.client-service-inline > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.client-service-inline span,
.client-service-inline small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.client-service-inline span {
  color: var(--stone);
  font-weight: 850;
  text-transform: uppercase;
}

.client-service-inline strong {
  color: var(--text);
  font-size: 14px;
}

.client-service-inline.warn {
  border-color: rgba(230, 185, 86, 0.36);
  background: rgba(230, 185, 86, 0.055);
}

.stage2a-workbench-header.client .stage2a-header-actions {
  min-width: min(320px, 32vw);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: stretch;
}

.stage2a-workbench-header.client .stage2a-header-actions .btn {
  justify-self: end;
}

.client-service-hero {
  width: 100%;
  min-height: 112px;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(230, 185, 86, 0.38);
  border-radius: 8px;
  background: rgba(230, 185, 86, 0.06);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.client-service-hero span,
.client-service-hero small,
.client-service-hero em {
  overflow-wrap: anywhere;
}

.client-service-hero span {
  color: var(--stone);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.client-service-hero strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.05;
}

.client-service-hero small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.client-service-hero em {
  justify-self: start;
  margin-top: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(230, 185, 86, 0.38);
  border-radius: 999px;
  color: var(--text);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.client-service-hero:hover,
.client-service-hero:focus-visible {
  outline: none;
  border-color: rgba(230, 185, 86, 0.72);
  background: rgba(230, 185, 86, 0.11);
}

.client-service-hero.good {
  border-color: rgba(54, 210, 125, 0.34);
  background: rgba(54, 210, 125, 0.06);
}

.service-status-row {
  width: 100%;
  text-align: left;
}

.service-status-row .badge {
  margin-left: auto;
}

.stage2h-client-support-settings {
  grid-column: 1 / -1;
}

.support-visibility-list {
  display: grid;
  gap: 10px;
}

.support-visibility-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 240px) minmax(240px, 320px);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(73, 104, 97, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.support-visibility-row > div {
  display: grid;
  gap: 4px;
}

.support-visibility-row strong {
  color: var(--text);
}

.support-visibility-row span,
.support-visibility-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.compact-field {
  margin: 0;
}

.support-communication-toggle {
  margin: 0;
}

.client-workbench-grid .stage2a-primary-queue,
.client-health-panel.stage2a-primary-queue {
  border-radius: 9px;
}

.client-workbench-grid .stage2a-primary-queue .panel-head,
.client-health-panel.stage2a-primary-queue .panel-head {
  background: rgba(255, 255, 255, 0.012);
}

.client-today-strip.sleek-status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  background: #0f1516;
}

.client-today-strip .sleek-status-segment {
  min-width: 0;
  flex: none;
  min-height: 62px;
}

html[data-theme="light"] .site-switcher-menu,
html[data-theme="light"] .site-switcher-search input,
html[data-theme="light"] .stage2b-support-band,
html[data-theme="light"] .client-service-inline,
html[data-theme="light"] .support-sla-note,
html[data-theme="light"] .pane-status-note,
html[data-theme="light"] .support-visibility-row {
  background: #ffffff !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
  box-shadow: 0 18px 44px rgba(26, 47, 38, 0.14);
}

html[data-theme="light"] .site-switcher-row,
html[data-theme="light"] .site-switcher-row strong,
html[data-theme="light"] .stage2b-support-band h3,
html[data-theme="light"] .client-service-inline strong,
html[data-theme="light"] .support-sla-note strong,
html[data-theme="light"] .pane-status-note strong,
html[data-theme="light"] .support-visibility-row strong {
  color: #102018 !important;
}

html[data-theme="light"] .site-switcher-row small,
html[data-theme="light"] .stage2b-support-band p,
html[data-theme="light"] .client-service-inline span,
html[data-theme="light"] .client-service-inline small,
html[data-theme="light"] .support-sla-note span,
html[data-theme="light"] .pane-status-note span,
html[data-theme="light"] .support-visibility-row span,
html[data-theme="light"] .support-visibility-row small,
html[data-theme="light"] .site-switcher-search label {
  color: #4f6359 !important;
}

html[data-theme="light"] .site-switcher-row:hover,
html[data-theme="light"] .site-switcher-row:focus-visible,
html[data-theme="light"] .site-switcher-row.active {
  background: #edf8f2 !important;
  border-color: rgba(0, 151, 92, 0.36) !important;
}

html[data-theme="light"] .client-today-strip.sleek-status-strip {
  background: #ffffff !important;
}

html[data-theme="light"] .client-service-hero {
  background: #fffdf4 !important;
  border-color: rgba(181, 134, 28, 0.34) !important;
  color: #102018 !important;
}

html[data-theme="light"] .client-service-hero:hover,
html[data-theme="light"] .client-service-hero:focus-visible {
  background: #fff8dc !important;
  border-color: rgba(181, 134, 28, 0.56) !important;
}

html[data-theme="light"] .client-service-hero span,
html[data-theme="light"] .client-service-hero small {
  color: #5c6354 !important;
}

html[data-theme="light"] .client-service-hero strong,
html[data-theme="light"] .client-service-hero em {
  color: #102018 !important;
}

html[data-theme="light"] .client-service-hero.good {
  background: #effaf4 !important;
  border-color: rgba(8, 127, 79, 0.26) !important;
}

@media (max-width: 900px) {
  .support-visibility-row {
    grid-template-columns: 1fr;
  }

  .stage2a-workbench-header.client .stage2a-header-actions {
    min-width: 0;
    width: 100%;
  }

  .stage2a-workbench-header.client .stage2a-header-actions .btn {
    justify-self: stretch;
  }

  .client-today-strip.sleek-status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stage2b-support-band {
    grid-template-columns: 1fr;
  }

  .client-service-inline {
    grid-template-columns: 1fr;
  }

  .stage2b-support-actions {
    justify-content: flex-start;
  }
}

/* Stage 2F permission-based access and calm layout refinements. */
.pane-help-section {
  padding: 0;
  border: 0;
  background: transparent;
}

.pane-help-details {
  border: 1px solid rgba(54, 210, 125, 0.28);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.045);
  overflow: hidden;
}

.pane-help-details summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.pane-help-details summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.pane-help-details .help-chip-grid {
  padding: 0 10px 10px;
}

.access-capability-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(132, 157, 147, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.access-capability-panel.warning {
  border-color: rgba(230, 185, 86, 0.26);
}

.access-capability-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

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

.widget-control-row.muted-row {
  opacity: 0.72;
}

.widget-control-row input:disabled,
.widget-control-row button:disabled,
.widget-control-row select:disabled {
  opacity: 0.5;
}

.dashboard-widget-shell {
  border-color: rgba(73, 104, 97, 0.18);
  background: rgba(255, 255, 255, 0.012);
}

.dashboard-widget-card,
.stage2a-primary-queue,
.stage2a-secondary-rail,
.stage2a-workbench-header,
.workbench-chrome {
  border-color: rgba(73, 104, 97, 0.18);
}

.stage2a-primary-queue,
.stage2a-secondary-rail {
  background: rgba(255, 255, 255, 0.012);
}

.stage2a-queue-row {
  background: transparent;
}

html[data-theme="light"] .pane-help-details,
html[data-theme="light"] .access-capability-panel,
html[data-theme="light"] .dashboard-widget-shell {
  background: #ffffff !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.16) !important;
}

html[data-theme="light"] .pane-help-details summary,
html[data-theme="light"] .access-capability-panel h4 {
  color: #102018 !important;
}

@media (max-width: 980px) {
  .access-preview-grid.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .client-today-strip.sleek-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Stage 2L: centered Integron top brand, left-first search, and visible compact section headers. */
@media (min-width: 861px) {
  .sidebar {
    grid-template-rows: minmax(0, 1fr) auto !important;
  }

  .sidebar-brand {
    display: none !important;
  }
}

.topbar {
  position: relative;
  grid-template-columns: minmax(280px, 520px) minmax(160px, 1fr) minmax(0, auto) !important;
  gap: 14px;
}

.breadcrumbs {
  display: none !important;
}

.top-search {
  grid-column: 1;
  justify-self: start;
  width: min(520px, max(280px, calc(50vw - var(--left-chrome) - 104px)));
}

.top-brand {
  position: absolute;
  left: calc(50vw - var(--left-chrome));
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.top-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.top-brand-mark::before {
  width: 4px;
  height: 16px;
  left: 10px;
  bottom: 6px;
}

.top-brand-mark::after {
  width: 5px;
  height: 5px;
  right: 7px;
  top: 6px;
  box-shadow: 6px 9px 0 rgba(54, 210, 125, 0.52);
}

.top-brand-mark span {
  left: 14px;
  top: 11px;
  width: 10px;
}

.top-actions {
  grid-column: 3;
  justify-self: end;
}

.app-shell.inspector-open .topbar {
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) !important;
}

.stage2a-primary-queue > .workbench-chrome,
.stage2a-secondary-rail > .workbench-chrome,
.context-panel > .workbench-chrome {
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.18);
  background: rgba(255, 255, 255, 0.01);
}

.stage2a-secondary-rail,
.context-panel {
  padding: 0;
  overflow: hidden;
}

.stage2a-secondary-rail > .status-stack,
.context-panel > .status-stack {
  padding: 10px;
}

html[data-theme="light"] .top-brand {
  color: #102018 !important;
}

html[data-theme="light"] .top-brand-mark {
  background: linear-gradient(160deg, rgba(8, 127, 79, 0.16), rgba(8, 127, 120, 0.06)) !important;
  border-color: rgba(8, 127, 79, 0.36) !important;
  color: #087f4f !important;
}

html[data-theme="light"] .stage2a-primary-queue > .workbench-chrome,
html[data-theme="light"] .stage2a-secondary-rail > .workbench-chrome,
html[data-theme="light"] .context-panel > .workbench-chrome {
  background: #ffffff !important;
  border-bottom-color: rgba(36, 60, 52, 0.14) !important;
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(240px, 440px) minmax(96px, 1fr) minmax(0, auto) !important;
  }

  .top-brand strong {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 860px) {
  .top-brand {
    left: 50%;
  }

  .top-brand strong {
    display: none;
  }
}

/* Stage 2N: official Integron brand assets with cross-browser PNG rendering. */
.brand-icon-real,
.brand-logo-real {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.brand-logo-light {
  display: none;
}

.brand-logo-dark {
  display: block;
}

html[data-theme="light"] .brand-logo-light {
  display: block;
}

html[data-theme="light"] .brand-logo-dark {
  display: none;
}

.login-brand-asset {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  min-width: 188px;
  padding: 6px 4px;
}

.login-brand-icon {
  width: 66px;
  height: 72px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.22));
}

.login-brand-asset .brand-logo-real {
  width: 150px;
  height: auto;
  max-height: 24px;
}

.top-brand {
  gap: 7px;
  font-size: 15px;
}

.top-brand-icon {
  width: 28px;
  height: 30px;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.22));
}

.top-brand strong {
  color: var(--text);
}

html[data-theme="light"] .top-brand strong {
  color: #102018 !important;
}

@media (max-width: 900px) {
  .login-brand-asset {
    min-width: 150px;
    justify-items: start;
  }

  .login-brand-icon {
    width: 58px;
    height: 62px;
  }

  .login-brand-asset .brand-logo-real {
    width: 150px;
  }
}

/* Stage 2O: business-value sensor readings, report ranges, logs, and guarded workflow rules. */
.monitored-values-panel,
.report-builder-panel,
.log-explorer-panel,
.threshold-settings-panel,
.automation-rules-panel {
  padding: 0;
  overflow: hidden;
}

.sensor-value-list,
.threshold-profile-list,
.automation-rule-list {
  display: grid;
  gap: 0;
}

.sensor-value-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(118px, 0.55fr) minmax(120px, 0.5fr) repeat(3, minmax(88px, 0.45fr)) minmax(170px, auto);
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.14);
  background: transparent;
  box-shadow: inset 3px 0 0 rgba(54, 210, 125, 0.72);
}

.sensor-value-row.warn {
  box-shadow: inset 3px 0 0 rgba(230, 185, 60, 0.86);
}

.sensor-value-row.danger {
  box-shadow: inset 3px 0 0 rgba(255, 92, 92, 0.86);
}

.sensor-value-row:last-child,
.threshold-profile-row:last-child,
.automation-rule-row:last-child {
  border-bottom: 0;
}

.sensor-value-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.sensor-value-main strong,
.sensor-value-main small,
.automation-rule-row strong,
.automation-rule-row span,
.automation-rule-row small,
.threshold-profile-row strong,
.threshold-profile-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sensor-value-main strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.sensor-value-main small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sensor-type-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(54, 210, 125, 0.34);
  border-radius: 7px;
  background: rgba(54, 210, 125, 0.08);
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.sensor-value-reading,
.sensor-value-mini,
.sensor-value-health {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sensor-value-reading strong,
.primary-reading {
  color: var(--text);
  font-size: 18px;
  line-height: 1.05;
}

.sensor-value-reading small,
.sensor-value-health span,
.sensor-value-health b {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.sensor-value-reading .sensor-range-note {
  color: var(--text);
  font-weight: 800;
  opacity: 0.82;
}

.sensor-value-health b {
  color: var(--text);
  font-size: 12px;
}

.primary-reading.good,
.sensor-value-row.good .sensor-value-reading strong {
  color: var(--green);
}

.primary-reading.warn,
.sensor-value-row.warn .sensor-value-reading strong {
  color: var(--yellow);
}

.primary-reading.danger,
.sensor-value-row.danger .sensor-value-reading strong {
  color: var(--red);
}

.sensor-value-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.sensor-value-pill {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon label value"
    "icon note note";
  gap: 2px 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(73, 104, 97, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.sensor-value-pill b {
  grid-area: icon;
  color: var(--green);
}

.sensor-value-pill span {
  grid-area: label;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.sensor-value-pill strong {
  grid-area: value;
  color: var(--text);
  font-size: 15px;
}

.sensor-value-pill small {
  grid-area: note;
  color: var(--muted);
  font-size: 11px;
}

.range-preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.14);
}

.range-preset {
  min-height: 44px;
  min-width: 118px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 7px 10px;
  border: 1px solid rgba(133, 151, 144, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.range-preset.active,
.range-preset:hover,
.range-preset:focus-visible {
  border-color: rgba(54, 210, 125, 0.52);
  background: rgba(54, 210, 125, 0.08);
  outline: none;
}

.range-preset strong {
  font-size: 12px;
}

.range-preset span {
  color: var(--muted);
  font-size: 10px;
}

.report-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.threshold-profile-row,
.automation-rule-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.14);
}

.threshold-profile-row > div:first-child,
.automation-rule-row > div:first-child {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.automation-rule-row > div:first-child {
  grid-template-columns: minmax(0, 1fr);
}

.threshold-profile-row strong,
.automation-rule-row strong {
  color: var(--text);
  font-size: 13px;
}

.threshold-profile-row small,
.automation-rule-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.automation-rule-row span {
  display: block;
  margin: 2px 0;
  color: var(--text);
  font-size: 12px;
}

.threshold-range-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.threshold-range-list span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid rgba(133, 151, 144, 0.24);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.threshold-range-list span.good {
  border-color: rgba(54, 210, 125, 0.34);
  color: var(--green);
}

.threshold-range-list span.warn {
  border-color: rgba(230, 185, 60, 0.4);
  color: var(--yellow);
}

.threshold-range-list span.danger {
  border-color: rgba(255, 92, 92, 0.4);
  color: var(--red);
}

.sensor-log-row {
  min-height: 54px;
}

/* Stage 2BE: graphical sensor history and client-safe insight curves. */
.sensor-insights-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
}

.sensor-insight-summary {
  margin-bottom: 10px;
}

.sensor-filter-strip,
.sensor-insight-controls,
.sensor-sort-strip {
  margin-bottom: 10px;
}

.sensor-insight-controls,
.sensor-sort-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(73, 104, 97, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.sensor-control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sensor-control-group > span,
.sensor-sort-strip > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.segmented-control,
.sensor-sort-strip {
  min-width: 0;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.segmented-control button,
.sensor-sort-strip button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(133, 151, 144, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.segmented-control button.active,
.segmented-control button:hover,
.sensor-sort-strip button.active,
.sensor-sort-strip button:hover {
  border-color: rgba(54, 210, 125, 0.5);
  background: rgba(54, 210, 125, 0.1);
  color: var(--text);
}

.custom-range label {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.custom-range input {
  min-height: 32px;
  max-width: 142px;
  border: 1px solid rgba(133, 151, 144, 0.26);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 5px 8px;
}

.sensor-control-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.sensor-chart-panel,
.sensor-insight-list-panel {
  overflow: hidden;
}

.sensor-chart-hero {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border-top: 1px solid rgba(73, 104, 97, 0.14);
}

.sensor-current-reading {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 210px;
  padding: 14px;
  border: 1px solid rgba(73, 104, 97, 0.18);
  border-radius: var(--radius);
  background: rgba(54, 210, 125, 0.055);
  box-shadow: inset 3px 0 0 rgba(54, 210, 125, 0.74);
}

.sensor-current-reading.warn {
  background: rgba(230, 185, 60, 0.08);
  box-shadow: inset 3px 0 0 rgba(230, 185, 60, 0.8);
}

.sensor-current-reading.danger {
  background: rgba(240, 103, 103, 0.08);
  box-shadow: inset 3px 0 0 rgba(240, 103, 103, 0.8);
}

.sensor-current-reading span,
.sensor-current-reading small {
  color: var(--muted);
}

.sensor-current-reading strong {
  color: var(--text);
  font-size: clamp(28px, 4vw, 50px);
  line-height: 1;
}

.sensor-chart-wrap {
  min-width: 0;
  min-height: 260px;
}

.sensor-history-chart {
  width: 100%;
  height: auto;
  display: block;
  color: var(--green);
}

.sensor-history-chart.compact {
  height: 46px;
}

.sensor-chart-bg {
  fill: rgba(255, 255, 255, 0.018);
  stroke: rgba(73, 104, 97, 0.16);
}

.sensor-grid-line {
  stroke: rgba(132, 157, 147, 0.16);
  stroke-width: 1;
}

.sensor-target-band {
  fill: rgba(54, 210, 125, 0.09);
}

.sensor-history-area {
  color: var(--green);
  opacity: 0.55;
}

.sensor-history-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sensor-event-dot {
  fill: var(--warning);
  stroke: var(--panel);
  stroke-width: 2;
}

.sensor-event-dot.danger {
  fill: var(--danger);
}

.sensor-axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sensor-axis-label.latest {
  text-anchor: end;
  fill: var(--text);
}

.sensor-empty-chart {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(133, 151, 144, 0.24);
  border-radius: var(--radius);
}

.sensor-chart-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid rgba(73, 104, 97, 0.14);
}

.sensor-chart-stats .metric {
  border: 0;
  border-right: 1px solid rgba(73, 104, 97, 0.14);
  border-radius: 0;
  background: transparent;
}

.sensor-chart-stats .metric:last-child {
  border-right: 0;
}

.sensor-insight-list {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(73, 104, 97, 0.14);
}

.sensor-insight-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.7fr) minmax(120px, 0.55fr) repeat(4, minmax(70px, 0.35fr)) minmax(145px, auto);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.14);
  background: transparent;
  box-shadow: inset 3px 0 0 rgba(54, 210, 125, 0.45);
}

.sensor-insight-row.warn {
  box-shadow: inset 3px 0 0 rgba(230, 185, 60, 0.8);
}

.sensor-insight-row.danger {
  box-shadow: inset 3px 0 0 rgba(240, 103, 103, 0.8);
}

.sensor-insight-row.active {
  background: rgba(54, 210, 125, 0.075);
}

.sensor-insight-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.sensor-insight-open strong,
.sensor-insight-open small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sensor-insight-open small,
.sensor-insight-reading small,
.sensor-insight-stats span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.sensor-insight-reading,
.sensor-insight-stats {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sensor-insight-reading strong {
  color: var(--text);
  font-size: 17px;
}

.sensor-insight-stats b {
  color: var(--text);
  font-size: 12px;
}

.sensor-insight-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.sensor-insight-spark,
.sensor-value-mini {
  min-width: 0;
  opacity: 0.96;
}

html[data-theme="light"] .monitored-values-panel,
html[data-theme="light"] .report-builder-panel,
html[data-theme="light"] .log-explorer-panel,
html[data-theme="light"] .threshold-settings-panel,
html[data-theme="light"] .automation-rules-panel,
html[data-theme="light"] .sensor-value-row,
html[data-theme="light"] .range-preset,
html[data-theme="light"] .sensor-value-pill,
html[data-theme="light"] .threshold-profile-row,
html[data-theme="light"] .automation-rule-row {
  background: #ffffff !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .sensor-type-icon {
  background: #e8f8f0 !important;
  color: #04794f !important;
  border-color: rgba(4, 121, 79, 0.28) !important;
}

html[data-theme="light"] .range-preset.active,
html[data-theme="light"] .range-preset:hover,
html[data-theme="light"] .range-preset:focus-visible {
  background: #e8f8f0 !important;
  border-color: rgba(4, 121, 79, 0.36) !important;
}

html[data-theme="light"] .sensor-value-main strong,
html[data-theme="light"] .sensor-value-reading strong,
html[data-theme="light"] .sensor-value-health b,
html[data-theme="light"] .threshold-profile-row strong,
html[data-theme="light"] .automation-rule-row strong,
html[data-theme="light"] .automation-rule-row span {
  color: #102018 !important;
}

html[data-theme="light"] .sensor-value-main small,
html[data-theme="light"] .sensor-value-reading small,
html[data-theme="light"] .sensor-value-health span,
html[data-theme="light"] .range-preset span,
html[data-theme="light"] .threshold-profile-row small,
html[data-theme="light"] .automation-rule-row small {
  color: #4f6359 !important;
}

html[data-theme="light"] .sensor-insight-controls,
html[data-theme="light"] .sensor-sort-strip,
html[data-theme="light"] .sensor-chart-panel,
html[data-theme="light"] .sensor-insight-list-panel,
html[data-theme="light"] .sensor-chart-bg,
html[data-theme="light"] .sensor-current-reading,
html[data-theme="light"] .sensor-insight-row,
html[data-theme="light"] .custom-range input {
  background: #ffffff !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .sensor-current-reading,
html[data-theme="light"] .sensor-insight-row.active {
  background: #f3fbf7 !important;
}

html[data-theme="light"] .segmented-control button,
html[data-theme="light"] .sensor-sort-strip button {
  background: #ffffff !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.18) !important;
}

html[data-theme="light"] .segmented-control button.active,
html[data-theme="light"] .segmented-control button:hover,
html[data-theme="light"] .sensor-sort-strip button.active,
html[data-theme="light"] .sensor-sort-strip button:hover {
  background: #e8f8f0 !important;
  border-color: rgba(4, 121, 79, 0.34) !important;
}

html[data-theme="light"] .sensor-grid-line {
  stroke: rgba(36, 60, 52, 0.14);
}

html[data-theme="light"] .sensor-chart-bg {
  fill: #ffffff;
  stroke: rgba(36, 60, 52, 0.14);
}

html[data-theme="light"] .sensor-target-band {
  fill: rgba(4, 121, 79, 0.09);
}

html[data-theme="light"] .sensor-axis-label,
html[data-theme="light"] .sensor-control-group > span,
html[data-theme="light"] .sensor-sort-strip > span,
html[data-theme="light"] .sensor-control-note,
html[data-theme="light"] .custom-range label,
html[data-theme="light"] .sensor-insight-open small,
html[data-theme="light"] .sensor-insight-reading small,
html[data-theme="light"] .sensor-insight-stats span {
  color: #4f6359 !important;
  fill: #4f6359 !important;
}

html[data-theme="light"] .sensor-axis-label.latest,
html[data-theme="light"] .sensor-current-reading strong,
html[data-theme="light"] .sensor-current-reading small,
html[data-theme="light"] .sensor-insight-open strong,
html[data-theme="light"] .sensor-insight-reading strong,
html[data-theme="light"] .sensor-insight-stats b {
  color: #102018 !important;
  fill: #102018 !important;
}

@media (max-width: 1180px) {
  .sensor-value-row {
    grid-template-columns: minmax(220px, 1fr) minmax(130px, auto) minmax(120px, 0.55fr) repeat(2, minmax(92px, 0.5fr));
  }

  .sensor-value-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .sensor-insights-layout {
    grid-template-columns: 1fr;
  }

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

  .sensor-current-reading {
    min-height: auto;
  }

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

  .sensor-insight-row {
    grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.7fr) minmax(110px, 0.5fr) repeat(2, minmax(76px, 0.35fr));
  }

  .sensor-insight-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .threshold-profile-row,
  .automation-rule-row,
  .report-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .sensor-value-row {
    grid-template-columns: 1fr;
  }

  .sensor-value-actions {
    grid-column: auto;
  }

  .sensor-insight-controls,
  .sensor-sort-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .sensor-filter-strip.quick-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    padding: 12px;
  }

  .sensor-filter-strip .quick-filter-label {
    min-width: 0;
  }

  .sensor-filter-strip .quick-filter-buttons,
  .segmented-control,
  .sensor-sort-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .sensor-filter-strip .quick-filter,
  .segmented-control button,
  .sensor-sort-strip button {
    width: 100%;
    justify-content: center;
    min-height: 36px;
    padding-inline: 8px;
    white-space: normal;
    text-align: center;
  }

  .sensor-sort-strip > span,
  .sensor-control-group > span,
  .sensor-control-note {
    grid-column: 1 / -1;
  }

  .sensor-control-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .custom-range label,
  .custom-range input {
    width: 100%;
    max-width: none;
  }

  .sensor-chart-stats,
  .sensor-insight-row {
    grid-template-columns: 1fr;
  }

  .sensor-insight-actions {
    grid-column: auto;
  }

  .range-preset {
    flex: 1 1 140px;
  }
}

@media (max-width: 460px) {
  .sensor-filter-strip .quick-filter-buttons,
  .segmented-control,
  .sensor-sort-strip {
    grid-template-columns: 1fr;
  }

  .sensor-chart-hero,
  .sensor-chart-stats,
  .sensor-insight-row {
    padding-inline: 8px;
  }

  .sensor-chart-wrap {
    min-height: 190px;
  }
}

/* Stage 2P guarded workflow rules */
.workflow-rules-strip {
  margin-bottom: 12px;
}

.workflow-rule-builder-panel,
.workflow-rule-dryrun-panel {
  overflow: hidden;
}

.workflow-builder-intro {
  overflow: hidden;
}

.workflow-draft-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.workflow-template-grid,
.workflow-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.workflow-template-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-template-intro strong {
  color: var(--text);
  font-size: 13px;
}

.workflow-template-more {
  margin: 0 12px 12px;
  border: 1px solid rgba(73, 104, 97, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.workflow-template-more summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.workflow-template-more .workflow-template-grid {
  padding: 0 10px 10px;
}

.workflow-template-grid.compact .workflow-template-card {
  min-height: 94px;
}

.workflow-template-card,
.workflow-mode-card,
.workflow-source-row {
  min-width: 0;
  border: 1px solid rgba(73, 104, 97, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
}

.workflow-template-card,
.workflow-mode-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
  text-align: left;
}

.workflow-template-card:hover,
.workflow-template-card:focus-visible,
.workflow-template-card.active,
.workflow-mode-card:hover,
.workflow-mode-card:focus-visible,
.workflow-mode-card.active,
.workflow-source-row:hover,
.workflow-source-row:focus-visible,
.workflow-source-row.active {
  outline: none;
  border-color: rgba(54, 210, 125, 0.52);
  background: rgba(54, 210, 125, 0.08);
}

.workflow-template-card strong,
.workflow-mode-card strong {
  color: var(--text);
  font-size: 13px;
}

.workflow-template-card span,
.workflow-mode-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workflow-template-card small {
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
}

.workflow-source-list {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.workflow-source-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  min-height: 56px;
  padding: 9px 10px;
  text-align: left;
}

.workflow-source-row strong,
.workflow-source-row small {
  display: block;
}

.workflow-source-row small {
  color: var(--muted);
  font-size: 11px;
}

.workflow-source-row b {
  color: var(--text);
  font-size: 15px;
}

.workflow-draft-sentence {
  border-bottom: 0;
}

.workflow-setup-path,
.workflow-device-capability-panel,
.workflow-adapter-panel,
.workflow-guard-panel,
.workflow-action-catalog,
.workflow-execution-preview-panel {
  overflow: hidden;
}

.workflow-setup-flow {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 12px;
}

.workflow-action-chain {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 14px;
}

.workflow-action-chain span {
  min-width: 0;
  border: 1px solid rgba(73, 104, 97, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
  padding: 9px 10px;
}

.workflow-action-chain small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.workflow-adapter-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.workflow-adapter-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.workflow-clean-grid,
.workflow-jobs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 12px;
  align-items: start;
}

.workflow-clean-inspector,
.workflow-jobs-rail {
  position: sticky;
  top: 78px;
}

.workflow-guide-panel {
  position: sticky;
  top: 78px;
  overflow: hidden;
}

.workflow-guide-actions {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.workflow-guide-action {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 64px;
  border: 1px solid rgba(73, 104, 97, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.workflow-guide-action.primary {
  border-color: rgba(0, 147, 88, 0.54);
  background: rgba(0, 147, 88, 0.09);
}

.workflow-guide-action:hover,
.workflow-guide-action:focus-visible {
  outline: none;
  border-color: rgba(0, 147, 88, 0.62);
  background: rgba(0, 147, 88, 0.12);
}

.workflow-guide-action strong,
.workflow-guide-action span {
  display: block;
}

.workflow-guide-action strong {
  font-size: 13px;
  line-height: 1.25;
}

.workflow-guide-action span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workflow-selected-summary {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.workflow-selected-rule-body {
  display: block;
  border: 0;
  background: transparent;
}

.workflow-selected-rule-body > .workbench-chrome {
  display: none;
}

.workflow-selected-rule-body .rule-sentence,
.workflow-selected-rule-body .workflow-action-chain,
.workflow-selected-rule-body .rule-current-strip,
.workflow-selected-rule-body .automation-safety-grid,
.workflow-selected-rule-body .rule-builder-actions {
  padding-left: 12px;
  padding-right: 12px;
}

.workflow-jobs-clean-queue .stage2a-queue-row,
.workflow-rules-clean-queue .stage2a-queue-row {
  min-height: 74px;
}

.workflow-path-panel .compact-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.rule-sentence {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.14);
  color: var(--muted);
  font-weight: 850;
}

.rule-sentence strong {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(54, 210, 125, 0.32);
  border-radius: 8px;
  background: rgba(54, 210, 125, 0.08);
  color: var(--text);
}

.rule-current-strip,
.automation-safety-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(73, 104, 97, 0.14);
}

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

.rule-builder-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.automation-rule-current {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.automation-rule-current strong {
  font-size: 15px;
}

.automation-rule-actions,
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-rule-table td:last-child {
  min-width: 220px;
}

.workflow-timeline {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.workflow-timeline .flow-step {
  min-height: 62px;
  border-radius: 8px;
}

html[data-theme="light"] .workflow-rule-builder-panel,
html[data-theme="light"] .workflow-rule-dryrun-panel,
html[data-theme="light"] .workflow-builder-intro,
html[data-theme="light"] .workflow-setup-path,
html[data-theme="light"] .workflow-device-capability-panel,
html[data-theme="light"] .workflow-adapter-panel,
html[data-theme="light"] .workflow-guard-panel,
html[data-theme="light"] .workflow-action-catalog,
html[data-theme="light"] .workflow-execution-preview-panel,
html[data-theme="light"] .workflow-template-intro,
html[data-theme="light"] .workflow-template-more,
html[data-theme="light"] .workflow-template-card,
html[data-theme="light"] .workflow-mode-card,
html[data-theme="light"] .workflow-source-row,
html[data-theme="light"] .workflow-action-chain span,
html[data-theme="light"] .rule-sentence strong {
  background: #ffffff !important;
  color: #102018 !important;
  border-color: rgba(36, 60, 52, 0.14) !important;
}

html[data-theme="light"] .workflow-template-card.active,
html[data-theme="light"] .workflow-template-card:hover,
html[data-theme="light"] .workflow-mode-card.active,
html[data-theme="light"] .workflow-mode-card:hover,
html[data-theme="light"] .workflow-source-row.active,
html[data-theme="light"] .workflow-source-row:hover {
  background: #e8f8f0 !important;
  border-color: rgba(4, 121, 79, 0.28) !important;
}

html[data-theme="light"] .rule-sentence,
html[data-theme="light"] .rule-current-strip,
html[data-theme="light"] .automation-safety-grid {
  border-color: rgba(36, 60, 52, 0.12) !important;
}

html[data-theme="light"] .rule-sentence strong {
  background: #e8f8f0 !important;
  border-color: rgba(4, 121, 79, 0.28) !important;
}

@media (max-width: 1100px) {
  .workflow-template-grid,
  .workflow-mode-grid,
  .workflow-draft-summary,
  .workflow-setup-flow,
  .workflow-action-chain,
  .workflow-clean-grid,
  .workflow-jobs-layout,
  .workflow-path-panel .compact-flow,
  .rule-current-strip,
  .automation-safety-grid {
    grid-template-columns: 1fr;
  }

  .workflow-clean-inspector,
  .workflow-guide-panel,
  .workflow-jobs-rail {
    position: static;
  }

  .automation-rule-actions,
  .table-actions {
    justify-content: flex-start;
  }

  .workflow-source-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .workflow-source-row > b,
  .workflow-source-row > .badge {
    justify-self: start;
    grid-column: 2;
  }
}

/* Stage 2R: role UX cleanup, collision-safe top bar, and calm collapsed pane. */
.topbar,
.app-shell.inspector-open .topbar {
  grid-template-columns: minmax(220px, 440px) minmax(0, 1fr) minmax(320px, auto) !important;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.top-search {
  grid-column: 1 !important;
  width: min(100%, max(260px, calc(50vw - var(--left-chrome) - 88px))) !important;
  max-width: 430px;
  justify-self: start;
}

.top-brand {
  position: absolute !important;
  left: calc(50vw - var(--left-chrome));
  top: 50%;
  grid-column: auto !important;
  transform: translate(-50%, -50%) !important;
  min-width: 118px;
  max-width: 180px;
  justify-self: auto;
  pointer-events: none;
}

.top-actions {
  grid-column: 3 !important;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  flex-wrap: nowrap;
}

.top-role-actions,
.user-switcher,
.user-switch-button {
  min-width: 0;
}

.top-role-actions {
  max-width: 220px;
  overflow: hidden;
}

.user-switcher {
  max-width: 292px;
}

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

#userSwitchName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell.inspector-open .top-actions .api-status,
.app-shell.inspector-open .top-actions .top-role-actions,
.app-shell.inspector-open .top-actions .user-switcher {
  display: none;
}

.app-shell.inspector-open .user-switcher,
.app-shell.inspector-open .user-switch-button {
  max-width: 210px;
}

.pane-expand-card {
  width: 38px;
  min-height: 48px;
  grid-template-rows: 1fr;
  gap: 0;
  padding: 6px;
}

.pane-expand-card small {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.pane-expand-card small::before {
  content: "";
}

.pane-expand-card .pane-expand-icon {
  width: 26px;
  height: 26px;
}

.client-health-panel,
.client-attention-panel,
.client-today-strip,
.monitored-values-panel,
.report-workbench,
.workflow-rules-layout {
  scroll-margin-top: 78px;
}

@media (max-width: 1360px) {
  .top-actions .api-status {
    display: none;
  }

  .top-role-actions {
    max-width: 180px;
  }

  .user-switcher,
  .user-switch-button {
    max-width: 240px;
  }
}

@media (max-width: 1120px) {
  .topbar,
  .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(200px, 360px) minmax(0, 1fr) minmax(260px, auto) !important;
  }

  .top-brand strong {
    max-width: 82px;
  }

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

@media (max-width: 860px) {
  .topbar,
  .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .top-search {
    grid-column: 1 !important;
  }

  .top-brand {
    display: none !important;
  }

  .top-actions {
    grid-column: 2 !important;
  }
}

/* Stage 2T: role switcher recovery and unclipped header menus. */
.topbar,
.app-shell.inspector-open .topbar {
  z-index: 110 !important;
  overflow: visible !important;
}

.top-actions,
.app-shell.inspector-open .top-actions {
  overflow: visible !important;
}

.user-switcher,
.app-shell.inspector-open .user-switcher {
  display: block !important;
  position: relative;
  min-width: 218px;
  max-width: 292px;
  flex: 0 1 292px;
  z-index: 112;
}

.user-switch-button,
.app-shell.inspector-open .user-switch-button {
  max-width: 100%;
}

.user-switch-menu,
.account-menu,
.theme-menu {
  z-index: 130 !important;
}

.app-shell.inspector-open .top-actions .api-status,
.app-shell.inspector-open .top-actions .top-role-actions {
  display: none !important;
}

.app-shell.inspector-open .top-brand {
  display: none !important;
}

.app-shell.inspector-open .top-search {
  max-width: 360px;
}

@media (max-width: 1360px) {
  .app-shell.inspector-open .top-search {
    max-width: 300px;
  }

  .app-shell.inspector-open .user-switcher {
    min-width: 190px;
    max-width: 230px;
    flex-basis: 230px;
  }
}

@media (max-width: 980px) {
  .user-switcher,
  .app-shell.inspector-open .user-switcher {
    min-width: 172px;
    max-width: 210px;
    flex-basis: 210px;
  }

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

  .user-switch-button {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar,
  .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .top-search {
    max-width: 100% !important;
  }

  .user-switcher,
  .app-shell.inspector-open .user-switcher {
    min-width: 138px;
    max-width: 168px;
    flex-basis: 168px;
  }

  .top-actions .user-chip {
    min-width: 44px;
    padding: 0 8px;
  }
}

/* Stage 2AB: cleaner, role-aware My Account surface. */
.account-clean-page,
html[data-theme] .account-clean-page {
  display: grid;
  gap: 14px;
  max-width: 1180px;
}

.account-hero-panel,
html[data-theme] .account-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px !important;
}

.account-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.account-identity h3 {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
}

.account-identity p {
  margin: 2px 0 0;
  color: var(--sx-muted);
}

.account-avatar-xl,
html[data-theme] .account-avatar-xl {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid color-mix(in srgb, var(--sx-green) 34%, var(--sx-line));
  border-radius: 10px;
  background: var(--sx-green-faint);
  color: var(--sx-green);
  font-weight: 900;
}

.account-hero-meta,
.account-hero-actions,
.account-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.account-hero-meta {
  justify-content: flex-end;
}

.account-modern-grid,
html[data-theme] .account-modern-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.account-card-main,
.account-preferences-panel {
  grid-column: span 1;
}

.account-preferences-panel {
  grid-column: 1 / -1;
}

.account-appearance-slot .appearance-panel,
html[data-theme] .account-appearance-slot .appearance-panel,
.account-security-panel,
html[data-theme] .account-security-panel {
  height: 100%;
}

.account-preference-columns,
html[data-theme] .account-preference-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-preference-columns h4,
.account-quiet-box h4 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--sx-muted);
}

.account-preferences-panel .check-row,
html[data-theme] .account-preferences-panel .check-row {
  min-height: 42px;
  margin: 0 0 8px;
  border-color: var(--sx-line);
  background: var(--sx-panel-soft);
}

.account-quiet-box,
html[data-theme] .account-quiet-box {
  min-width: 0;
}

.account-security-panel .status-stack.compact {
  gap: 8px;
}

.account-admin-details,
html[data-theme] .account-admin-details {
  grid-column: 1 / -1;
  border: 1px solid var(--sx-line);
  border-radius: var(--sx-radius);
  background: var(--sx-panel-soft);
  overflow: hidden;
}

.account-admin-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--sx-text);
  font-weight: 800;
}

.account-admin-details .detail-grid {
  padding: 0 14px 14px;
}

@media (max-width: 980px) {
  .account-hero-panel,
  html[data-theme] .account-hero-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .account-hero-meta,
  .account-hero-actions {
    justify-content: flex-start;
  }

  .account-modern-grid,
  html[data-theme] .account-modern-grid,
  .account-preference-columns,
  html[data-theme] .account-preference-columns {
    grid-template-columns: 1fr;
  }
}

/* Stage 2X: modern visual refinement across shell, bars, tables, panels, drawers, and forms. */
:root {
  --sx-bg: #070b0c;
  --sx-bg-elevated: #0a0f10;
  --sx-panel: rgba(13, 20, 21, 0.92);
  --sx-panel-solid: #0e1516;
  --sx-panel-soft: rgba(18, 27, 28, 0.78);
  --sx-panel-hover: rgba(54, 210, 125, 0.07);
  --sx-line: rgba(136, 162, 154, 0.15);
  --sx-line-strong: rgba(136, 162, 154, 0.28);
  --sx-text: #f4f1e8;
  --sx-muted: #aeb9b0;
  --sx-muted-soft: #778a82;
  --sx-green: #36d27d;
  --sx-green-strong: #1fc873;
  --sx-green-soft: rgba(54, 210, 125, 0.13);
  --sx-green-faint: rgba(54, 210, 125, 0.06);
  --sx-warning: #e6b956;
  --sx-danger: #f06767;
  --sx-radius: 8px;
  --sx-radius-sm: 6px;
  --sx-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --sx-shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] {
  --sx-bg: #f7faf8;
  --sx-bg-elevated: #ffffff;
  --sx-panel: rgba(255, 255, 255, 0.96);
  --sx-panel-solid: #ffffff;
  --sx-panel-soft: rgba(248, 251, 249, 0.94);
  --sx-panel-hover: rgba(4, 121, 79, 0.06);
  --sx-line: rgba(27, 54, 45, 0.14);
  --sx-line-strong: rgba(27, 54, 45, 0.24);
  --sx-text: #102018;
  --sx-muted: #56685f;
  --sx-muted-soft: #72847c;
  --sx-green: #00895a;
  --sx-green-strong: #007a50;
  --sx-green-soft: rgba(0, 137, 90, 0.12);
  --sx-green-faint: rgba(0, 137, 90, 0.055);
  --sx-shadow: 0 18px 44px rgba(22, 39, 34, 0.12);
  --sx-shadow-soft: 0 10px 28px rgba(22, 39, 34, 0.08);
}

*,
*::before,
*::after {
  letter-spacing: 0 !important;
}

body,
button,
input,
select,
textarea {
  line-height: 1.42;
  text-rendering: geometricPrecision;
}

* {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(116, 144, 136, 0.34) transparent !important;
}

*::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

*::-webkit-scrollbar-track {
  background: transparent !important;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent !important;
  border-radius: 999px !important;
  background: rgba(116, 144, 136, 0.34) padding-box !important;
}

html[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: rgba(49, 78, 68, 0.24) padding-box !important;
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sx-green) 72%, white) !important;
  outline-offset: 2px !important;
}

body,
html[data-theme] body {
  background: var(--sx-bg) !important;
  color: var(--sx-text) !important;
}

.app-shell,
html[data-theme] .app-shell {
  background: var(--sx-bg) !important;
}

.workspace,
.workspace-content,
html[data-theme] .workspace,
html[data-theme] .workspace-content {
  background: var(--sx-bg) !important;
}

.console-left,
.console-left-body,
.sidebar,
.module-pane,
.site-context-selector,
.primary-rail,
.secondary-pane,
html[data-theme] .console-left,
html[data-theme] .console-left-body,
html[data-theme] .sidebar,
html[data-theme] .module-pane,
html[data-theme] .site-context-selector,
html[data-theme] .primary-rail,
html[data-theme] .secondary-pane {
  background: var(--sx-bg-elevated) !important;
  border-color: var(--sx-line) !important;
}

.topbar,
.app-shell.inspector-open .topbar,
html[data-theme] .topbar,
html[data-theme] .app-shell.inspector-open .topbar {
  min-height: 58px !important;
  padding: 9px 16px !important;
  border-bottom: 1px solid var(--sx-line) !important;
  background: color-mix(in srgb, var(--sx-bg-elevated) 92%, transparent) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset !important;
}

.top-search,
.top-search label {
  min-width: 0;
}

.top-search input,
.pane-search input,
input,
select,
textarea,
html[data-theme] .top-search input,
html[data-theme] .pane-search input,
html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea {
  min-height: 38px;
  border: 1px solid var(--sx-line-strong) !important;
  border-radius: var(--sx-radius-sm) !important;
  background: var(--sx-panel-solid) !important;
  color: var(--sx-text) !important;
  box-shadow: none !important;
}

.top-search input {
  height: 40px !important;
  padding-inline: 16px !important;
  background: var(--sx-panel-soft) !important;
}

.top-search input:focus,
.pane-search input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--sx-green) 54%, var(--sx-line-strong)) !important;
  box-shadow: 0 0 0 3px var(--sx-green-faint) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--sx-muted-soft) !important;
  opacity: 1;
}

.top-brand,
html[data-theme] .top-brand {
  gap: 8px;
  color: var(--sx-text) !important;
  font-weight: 850;
}

.top-brand-icon,
.brand-icon-real {
  filter: drop-shadow(0 4px 12px rgba(54, 210, 125, 0.13));
}

.top-actions {
  gap: 8px !important;
}

.api-status,
.user-chip,
.user-switch-button,
.theme-trigger,
.icon-btn,
.top-role-actions .btn,
html[data-theme] .api-status,
html[data-theme] .user-chip,
html[data-theme] .user-switch-button,
html[data-theme] .theme-trigger,
html[data-theme] .icon-btn {
  min-height: 38px;
  border: 1px solid var(--sx-line-strong) !important;
  border-radius: var(--sx-radius-sm) !important;
  background: var(--sx-panel-soft) !important;
  color: var(--sx-text) !important;
  box-shadow: none !important;
}

.top-dev-action.named,
html[data-theme] .top-dev-action.named {
  width: auto !important;
  min-width: 46px !important;
  max-width: none !important;
  padding-inline: 10px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  overflow: visible !important;
}

.top-dev-action.named span,
html[data-theme] .top-dev-action.named span {
  display: block;
  max-width: none !important;
  font-size: 11px !important;
  line-height: 1 !important;
  overflow: visible !important;
}

.user-switch-button {
  padding-inline: 12px !important;
}

.user-switch-button span,
.api-status,
.muted,
.subtle,
.panel-head p,
.drawer-section p,
.workspace-head p,
html[data-theme] .muted,
html[data-theme] .subtle,
html[data-theme] .panel-head p,
html[data-theme] .drawer-section p,
html[data-theme] .workspace-head p {
  color: var(--sx-muted) !important;
}

.site-context-button,
html[data-theme] .site-context-button {
  min-height: 44px;
  border-color: var(--sx-line-strong) !important;
  border-radius: var(--sx-radius-sm) !important;
  background: var(--sx-panel-soft) !important;
}

.site-context-button:hover,
.site-context-button:focus-visible,
.user-switch-button:hover,
.theme-trigger:hover,
.icon-btn:hover,
.user-chip:hover,
html[data-theme] .site-context-button:hover,
html[data-theme] .user-switch-button:hover,
html[data-theme] .theme-trigger:hover,
html[data-theme] .icon-btn:hover,
html[data-theme] .user-chip:hover {
  border-color: color-mix(in srgb, var(--sx-green) 48%, var(--sx-line-strong)) !important;
  background: var(--sx-panel-hover) !important;
}

.sidebar-brand {
  border-bottom-color: var(--sx-line) !important;
}

.sidebar-brand .brand-mark,
.integron-logo-mark,
html[data-theme] .integron-logo-mark {
  border-color: color-mix(in srgb, var(--sx-green) 42%, transparent) !important;
  background: var(--sx-green-faint) !important;
  color: var(--sx-green) !important;
}

.main-nav {
  gap: 6px !important;
  padding: 8px 7px !important;
}

.nav-btn,
.sidebar-footer .icon-btn,
html[data-theme] .nav-btn,
html[data-theme] .sidebar-footer .icon-btn {
  width: 42px !important;
  min-width: 42px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: var(--sx-radius-sm) !important;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--sx-muted) !important;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-btn:hover,
.nav-btn.active,
.sidebar-footer .icon-btn:hover,
html[data-theme] .nav-btn:hover,
html[data-theme] .nav-btn.active {
  background: var(--sx-panel-hover) !important;
  border-color: color-mix(in srgb, var(--sx-green) 30%, transparent) !important;
  color: var(--sx-green) !important;
}

.nav-btn.active {
  box-shadow: inset 3px 0 0 var(--sx-green) !important;
}

.nav-count,
.count-badge {
  background: var(--sx-green) !important;
  color: #06100b !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(54, 210, 125, 0.18) !important;
}

.module-pane-head,
html[data-theme] .module-pane-head {
  min-height: 58px;
  padding: 12px 12px !important;
  border-bottom: 1px solid var(--sx-line) !important;
  background: var(--sx-bg-elevated) !important;
}

.module-pane-head h2,
.workspace-head h2,
.panel-head h3,
.drawer-head h2,
.modal-head h3,
html[data-theme] .module-pane-head h2,
html[data-theme] .workspace-head h2,
html[data-theme] .panel-head h3,
html[data-theme] .drawer-head h2,
html[data-theme] .modal-head h3 {
  color: var(--sx-text) !important;
}

.eyebrow,
.pane-label,
.pane-title,
.pane-section-title,
.nav-group-title,
html[data-theme] .eyebrow,
html[data-theme] .pane-label,
html[data-theme] .pane-title,
html[data-theme] .pane-section-title,
html[data-theme] .nav-group-title {
  color: color-mix(in srgb, var(--sx-muted) 80%, var(--sx-green)) !important;
  font-size: 11px !important;
  font-weight: 760 !important;
  text-transform: uppercase;
}

.module-pane-content {
  padding: 12px 10px 18px !important;
}

.pane-section {
  padding-block: 10px !important;
  border-color: var(--sx-line) !important;
}

.pane-row,
.pane-button,
.pane-toggle,
.subnav-btn,
.seg,
.quick-filter,
.page-tabs button,
.drawer-tabs button,
html[data-theme] .pane-row,
html[data-theme] .pane-button,
html[data-theme] .pane-toggle,
html[data-theme] .subnav-btn,
html[data-theme] .seg,
html[data-theme] .quick-filter,
html[data-theme] .page-tabs button,
html[data-theme] .drawer-tabs button {
  min-height: 34px;
  border: 1px solid transparent !important;
  border-radius: var(--sx-radius-sm) !important;
  background: transparent !important;
  color: var(--sx-text) !important;
}

.pane-row:hover,
.pane-row.active,
.pane-button:hover,
.pane-button.active,
.pane-toggle:hover,
.pane-toggle.active,
.subnav-btn:hover,
.subnav-btn.active,
.seg:hover,
.seg.active,
.quick-filter:hover,
.quick-filter.active,
.page-tabs button:hover,
.page-tabs button.active,
.drawer-tabs button:hover,
.drawer-tabs button.active,
html[data-theme] .pane-row:hover,
html[data-theme] .pane-row.active,
html[data-theme] .pane-button:hover,
html[data-theme] .pane-button.active,
html[data-theme] .pane-toggle:hover,
html[data-theme] .pane-toggle.active,
html[data-theme] .subnav-btn:hover,
html[data-theme] .subnav-btn.active,
html[data-theme] .seg:hover,
html[data-theme] .seg.active,
html[data-theme] .quick-filter:hover,
html[data-theme] .quick-filter.active,
html[data-theme] .page-tabs button:hover,
html[data-theme] .page-tabs button.active,
html[data-theme] .drawer-tabs button:hover,
html[data-theme] .drawer-tabs button.active {
  border-color: color-mix(in srgb, var(--sx-green) 36%, var(--sx-line)) !important;
  background: var(--sx-green-faint) !important;
  color: var(--sx-green) !important;
}

.pane-row b,
.pane-button b,
.pane-toggle b {
  color: var(--sx-green) !important;
}

.workspace {
  min-width: 0;
}

.workspace-head {
  padding: 18px 18px 12px !important;
  border-bottom: 0 !important;
}

.workspace-head h2 {
  font-size: 25px !important;
  line-height: 1.16 !important;
}

.workspace-content {
  padding: 0 18px 18px !important;
}

.subnav,
.page-tabs,
.quick-filter-bar,
html[data-theme] .subnav,
html[data-theme] .page-tabs,
html[data-theme] .quick-filter-bar {
  margin: 0 18px 12px !important;
  padding: 5px !important;
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-panel-soft) !important;
}

.page-tabs {
  margin-inline: 0 !important;
}

.quick-filter-bar {
  margin-inline: 0 !important;
}

.role-home-hero,
.stage2a-workbench-header,
.hero-band,
.support-hero-panel,
.update-hero-panel,
.source-release-panel,
html[data-theme] .role-home-hero,
html[data-theme] .stage2a-workbench-header,
html[data-theme] .hero-band,
html[data-theme] .support-hero-panel,
html[data-theme] .update-hero-panel,
html[data-theme] .source-release-panel {
  border: 1px solid var(--sx-line) !important;
  border-left: 3px solid var(--sx-green) !important;
  border-radius: var(--sx-radius) !important;
  background: linear-gradient(180deg, var(--sx-panel), var(--sx-panel-soft)) !important;
  box-shadow: none !important;
}

.role-home-hero h3,
.stage2a-workbench-header h3,
.hero-band h3 {
  font-size: clamp(23px, 2.4vw, 34px) !important;
  line-height: 1.08 !important;
}

.stage2a-header-actions,
.hero-actions,
.workspace-actions,
.card-actions,
.drawer-actions,
.form-actions,
.modal-actions,
.table-actions {
  gap: 8px !important;
}

.panel,
.metric,
.drawer-section,
.compact-drawer-section,
.dashboard-widget-shell,
.workbench-panel,
.stage2a-primary-queue,
.stage2a-secondary-rail,
.stage2a-resolution-block,
.client-attention-panel,
.client-more-modules-panel,
.technician-readiness-panel,
.operator-handoff-panel,
.admin-role-visibility-panel,
.monitored-values-panel,
.report-builder-panel,
.log-explorer-panel,
.threshold-settings-panel,
.automation-rules-panel,
.workflow-rule-builder-panel,
.workflow-rule-dryrun-panel,
.workflow-builder-intro,
.client-site-workspace,
.topology-workbench,
.sleek-list-panel,
html[data-theme] .panel,
html[data-theme] .metric,
html[data-theme] .drawer-section,
html[data-theme] .compact-drawer-section,
html[data-theme] .dashboard-widget-shell,
html[data-theme] .workbench-panel,
html[data-theme] .stage2a-primary-queue,
html[data-theme] .stage2a-secondary-rail,
html[data-theme] .stage2a-resolution-block,
html[data-theme] .client-attention-panel,
html[data-theme] .client-more-modules-panel,
html[data-theme] .technician-readiness-panel,
html[data-theme] .operator-handoff-panel,
html[data-theme] .admin-role-visibility-panel,
html[data-theme] .monitored-values-panel,
html[data-theme] .report-builder-panel,
html[data-theme] .log-explorer-panel,
html[data-theme] .threshold-settings-panel,
html[data-theme] .automation-rules-panel,
html[data-theme] .workflow-rule-builder-panel,
html[data-theme] .workflow-rule-dryrun-panel,
html[data-theme] .workflow-builder-intro,
html[data-theme] .client-site-workspace,
html[data-theme] .topology-workbench,
html[data-theme] .sleek-list-panel {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-panel) !important;
  box-shadow: none !important;
}

.panel:hover,
.metric:hover,
.dashboard-widget-shell:hover,
.stage2a-primary-queue:hover,
.stage2a-secondary-rail:hover,
.sleek-list-panel:hover {
  border-color: var(--sx-line-strong) !important;
}

.panel-head,
.workbench-chrome,
.widget-shell-head,
html[data-theme] .panel-head,
html[data-theme] .workbench-chrome,
html[data-theme] .widget-shell-head {
  min-height: 48px;
  padding: 13px 14px !important;
  border-bottom: 1px solid var(--sx-line) !important;
  background: transparent !important;
}

.panel-head h3,
.workbench-chrome h3,
.widget-shell-head h3 {
  font-size: 15px !important;
  line-height: 1.2 !important;
}

.metric-grid {
  gap: 10px !important;
}

.metric {
  min-height: 82px;
  padding: 14px !important;
}

.metric span,
.metric small {
  color: var(--sx-muted) !important;
}

.metric strong {
  color: var(--sx-text) !important;
  font-size: 25px !important;
}

.metric.warn,
.status-line.warn,
.stage2a-queue-row.warn,
.client-attention-row.warn,
.operator-triage-item.warn {
  border-color: color-mix(in srgb, var(--sx-warning) 48%, var(--sx-line)) !important;
}

.metric.danger,
.status-line.danger,
.stage2a-queue-row.danger,
.client-attention-row.danger,
.operator-triage-item.danger {
  border-color: color-mix(in srgb, var(--sx-danger) 50%, var(--sx-line)) !important;
}

.btn,
button.btn,
html[data-theme] .btn {
  min-height: 36px;
  border-radius: var(--sx-radius-sm) !important;
  border: 1px solid var(--sx-line-strong) !important;
  background: var(--sx-panel-soft) !important;
  color: var(--sx-text) !important;
  box-shadow: none !important;
  font-weight: 780 !important;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.btn:hover,
button.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--sx-green) 46%, var(--sx-line-strong)) !important;
  background: var(--sx-panel-hover) !important;
}

.btn.primary,
button.btn.primary,
html[data-theme] .btn.primary {
  border-color: color-mix(in srgb, var(--sx-green) 64%, transparent) !important;
  background: linear-gradient(180deg, var(--sx-green-strong), color-mix(in srgb, var(--sx-green-strong) 82%, #043d27)) !important;
  color: #04100a !important;
}

html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] button.btn.primary {
  color: #031009 !important;
}

.btn.secondary,
button.btn.secondary,
html[data-theme] .btn.secondary {
  background: transparent !important;
}

.btn.warning,
.btn.danger {
  border-color: color-mix(in srgb, var(--sx-danger) 52%, var(--sx-line)) !important;
}

.btn.small,
.workbench-table .btn,
.sleek-list-panel .btn.small {
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.badge,
.pill,
.permission-chip,
.role-route-chips span,
.workspace-tab,
html[data-theme] .badge,
html[data-theme] .pill,
html[data-theme] .permission-chip,
html[data-theme] .role-route-chips span,
html[data-theme] .workspace-tab {
  min-height: 24px;
  border: 1px solid var(--sx-line-strong) !important;
  border-radius: 999px !important;
  background: var(--sx-panel-soft) !important;
  color: var(--sx-text) !important;
  box-shadow: none !important;
}

.badge.good,
.badge.healthy,
.badge.ready,
.badge.active,
.badge.allowed,
.permission-chip.on,
html[data-theme] .badge.good,
html[data-theme] .badge.healthy,
html[data-theme] .badge.ready,
html[data-theme] .badge.active,
html[data-theme] .badge.allowed,
html[data-theme] .permission-chip.on {
  border-color: color-mix(in srgb, var(--sx-green) 46%, transparent) !important;
  background: var(--sx-green-faint) !important;
  color: var(--sx-green) !important;
}

.badge.warn,
.badge.warning,
.badge.watch {
  border-color: color-mix(in srgb, var(--sx-warning) 54%, transparent) !important;
  background: rgba(230, 185, 86, 0.08) !important;
  color: var(--sx-warning) !important;
}

.badge.danger,
.badge.critical,
.badge.attention {
  border-color: color-mix(in srgb, var(--sx-danger) 54%, transparent) !important;
  background: rgba(240, 103, 103, 0.08) !important;
  color: var(--sx-danger) !important;
}

.table-wrap,
.workbench-panel .table-wrap,
.sleek-list-panel .table-wrap,
html[data-theme] .table-wrap,
html[data-theme] .workbench-panel .table-wrap,
html[data-theme] .sleek-list-panel .table-wrap {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-panel-solid) !important;
  overflow: auto;
}

.ops-table,
.workbench-table,
html[data-theme] .ops-table,
html[data-theme] .workbench-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: transparent !important;
}

.ops-table th,
.ops-table td,
.workbench-table th,
.workbench-table td,
html[data-theme] .ops-table th,
html[data-theme] .ops-table td,
html[data-theme] .workbench-table th,
html[data-theme] .workbench-table td {
  border-bottom: 1px solid var(--sx-line) !important;
  border-right: 0 !important;
  color: var(--sx-text) !important;
}

.ops-table th,
.workbench-table th,
html[data-theme] .ops-table th,
html[data-theme] .workbench-table th {
  height: 38px;
  padding: 8px 12px !important;
  background: var(--sx-panel-soft) !important;
  color: color-mix(in srgb, var(--sx-muted) 86%, var(--sx-text)) !important;
  font-size: 11px !important;
  font-weight: 820 !important;
  text-transform: uppercase;
}

.ops-table td,
.workbench-table td,
html[data-theme] .ops-table td,
html[data-theme] .workbench-table td {
  padding: 10px 12px !important;
  background: transparent !important;
}

.ops-table tr:hover td,
.ops-table tr[data-entity]:hover td,
.workbench-table tr:hover td,
html[data-theme] .ops-table tr:hover td,
html[data-theme] .ops-table tr[data-entity]:hover td,
html[data-theme] .workbench-table tr:hover td {
  background: var(--sx-panel-hover) !important;
}

.ops-table tr:last-child td,
.workbench-table tr:last-child td {
  border-bottom: 0 !important;
}

.status-line,
.report-row,
.command-item,
.account-menu-row,
.widget-control-row,
.client-attention-row,
.client-health-row,
.priority-work-row,
.operator-triage-item,
.stage2a-queue-row,
.readiness-row,
.workflow-source-row,
.automation-rule-row,
.threshold-profile-row,
.sensor-value-row,
.site-switcher-row,
html[data-theme] .status-line,
html[data-theme] .report-row,
html[data-theme] .command-item,
html[data-theme] .account-menu-row,
html[data-theme] .widget-control-row,
html[data-theme] .client-attention-row,
html[data-theme] .client-health-row,
html[data-theme] .priority-work-row,
html[data-theme] .operator-triage-item,
html[data-theme] .stage2a-queue-row,
html[data-theme] .readiness-row,
html[data-theme] .workflow-source-row,
html[data-theme] .automation-rule-row,
html[data-theme] .threshold-profile-row,
html[data-theme] .sensor-value-row,
html[data-theme] .site-switcher-row {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius-sm) !important;
  background: var(--sx-panel-soft) !important;
  color: var(--sx-text) !important;
  box-shadow: none !important;
}

button.status-line:hover,
button.report-row:hover,
.clickable-row:hover,
.command-item:hover,
.account-menu-row:hover,
.widget-control-row:hover,
.client-attention-row:hover,
.client-health-row:hover,
.priority-work-row:hover,
.operator-triage-item:hover,
.stage2a-queue-row[role="button"]:hover,
.workflow-source-row:hover,
.automation-rule-row:hover,
.threshold-profile-row:hover,
.sensor-value-row:hover,
.site-switcher-row:hover {
  border-color: color-mix(in srgb, var(--sx-green) 40%, var(--sx-line)) !important;
  background: var(--sx-panel-hover) !important;
}

.status-line strong,
.report-row strong,
.stage2a-queue-main strong,
.client-attention-main,
.sensor-value-main strong,
.threshold-profile-row strong,
.automation-rule-row strong,
html[data-theme] .status-line strong,
html[data-theme] .report-row strong,
html[data-theme] .stage2a-queue-main strong,
html[data-theme] .client-attention-main,
html[data-theme] .sensor-value-main strong,
html[data-theme] .threshold-profile-row strong,
html[data-theme] .automation-rule-row strong {
  color: var(--sx-text) !important;
}

.status-line span,
.status-line p,
.report-row span,
.stage2a-queue-main small,
.client-attention-main small,
.sensor-value-main small,
.threshold-profile-row small,
.automation-rule-row small,
html[data-theme] .status-line span,
html[data-theme] .status-line p,
html[data-theme] .report-row span,
html[data-theme] .stage2a-queue-main small,
html[data-theme] .client-attention-main small,
html[data-theme] .sensor-value-main small,
html[data-theme] .threshold-profile-row small,
html[data-theme] .automation-rule-row small {
  color: var(--sx-muted) !important;
}

.sleek-status-strip,
.client-today-strip,
.overview-row,
html[data-theme] .sleek-status-strip,
html[data-theme] .client-today-strip,
html[data-theme] .overview-row {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-panel) !important;
  overflow: hidden;
}

.sleek-status-segment,
.client-today-status,
html[data-theme] .sleek-status-segment,
html[data-theme] .client-today-status {
  border-color: var(--sx-line) !important;
  background: transparent !important;
}

button.sleek-status-segment:hover,
button.client-today-status:hover {
  background: var(--sx-panel-hover) !important;
}

.client-service-hero,
.stage2b-support-band,
.client-service-inline,
html[data-theme] .client-service-hero,
html[data-theme] .stage2b-support-band,
html[data-theme] .client-service-inline {
  border: 1px solid color-mix(in srgb, var(--sx-green) 34%, var(--sx-line)) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-green-faint) !important;
  color: var(--sx-text) !important;
  box-shadow: none !important;
}

.client-service-hero:hover,
.client-service-hero:focus-visible {
  background: var(--sx-green-soft) !important;
}

.detail-drawer,
.dashboard-widget-drawer,
html[data-theme] .detail-drawer,
html[data-theme] .dashboard-widget-drawer {
  border-left: 1px solid var(--sx-line) !important;
  background: var(--sx-bg-elevated) !important;
  box-shadow: var(--sx-shadow) !important;
}

.drawer-head,
.drawer-action-footer,
html[data-theme] .drawer-head,
html[data-theme] .drawer-action-footer {
  border-color: var(--sx-line) !important;
  background: color-mix(in srgb, var(--sx-bg-elevated) 96%, transparent) !important;
}

.drawer-head {
  padding: 18px 18px 14px !important;
}

.drawer-body {
  padding: 14px !important;
  background: var(--sx-bg) !important;
}

.drawer-tabs,
html[data-theme] .drawer-tabs {
  padding: 5px !important;
  border-bottom: 1px solid var(--sx-line) !important;
  background: var(--sx-bg-elevated) !important;
}

.drawer-action-footer {
  padding: 12px 14px !important;
}

.detail-grid,
.inspector-grid {
  gap: 8px !important;
}

.detail-grid div,
.inspector-grid div,
.mini-kpi,
.lifecycle-detail-grid > div,
.support-context-block,
.support-payload-row,
html[data-theme] .detail-grid div,
html[data-theme] .inspector-grid div,
html[data-theme] .mini-kpi,
html[data-theme] .lifecycle-detail-grid > div,
html[data-theme] .support-context-block,
html[data-theme] .support-payload-row {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius-sm) !important;
  background: var(--sx-panel-soft) !important;
}

.detail-grid span,
.inspector-grid span,
.mini-kpi span,
.fact span {
  color: var(--sx-muted) !important;
}

.detail-grid b,
.inspector-grid b,
.mini-kpi strong,
.fact b {
  color: var(--sx-text) !important;
}

.drawer-action-guide,
.stage2c-action-summary,
.quick-path-panel,
html[data-theme] .drawer-action-guide,
html[data-theme] .stage2c-action-summary,
html[data-theme] .quick-path-panel {
  background: var(--sx-panel-soft) !important;
  border-color: var(--sx-line) !important;
}

.modal-layer {
  background: rgba(3, 6, 7, 0.56) !important;
  backdrop-filter: blur(8px);
}

.modal-card,
.support-modal-card,
.command-palette,
.account-menu,
.theme-menu,
.user-switch-menu,
.site-switcher-menu,
.sort-menu,
html[data-theme] .modal-card,
html[data-theme] .support-modal-card,
html[data-theme] .command-palette,
html[data-theme] .account-menu,
html[data-theme] .theme-menu,
html[data-theme] .user-switch-menu,
html[data-theme] .site-switcher-menu,
html[data-theme] .sort-menu {
  border: 1px solid var(--sx-line-strong) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-bg-elevated) !important;
  color: var(--sx-text) !important;
  box-shadow: var(--sx-shadow) !important;
}

.modal-head,
.modal-body,
.modal-actions,
.support-modal-body,
html[data-theme] .modal-head,
html[data-theme] .modal-body,
html[data-theme] .modal-actions,
html[data-theme] .support-modal-body {
  border-color: var(--sx-line) !important;
  background: transparent !important;
}

.account-menu button,
.theme-menu button,
.user-switch-option,
.sort-menu button,
.command-palette button,
html[data-theme] .account-menu button,
html[data-theme] .theme-menu button,
html[data-theme] .user-switch-option,
html[data-theme] .sort-menu button,
html[data-theme] .command-palette button {
  border-radius: var(--sx-radius-sm) !important;
  color: var(--sx-text) !important;
}

.account-menu button:hover,
.theme-menu button:hover,
.theme-menu button.active,
.user-switch-option:hover,
.user-switch-option.active,
.sort-menu button:hover,
.sort-menu button.active,
.command-palette button:hover,
html[data-theme] .account-menu button:hover,
html[data-theme] .theme-menu button:hover,
html[data-theme] .theme-menu button.active,
html[data-theme] .user-switch-option:hover,
html[data-theme] .user-switch-option.active,
html[data-theme] .sort-menu button:hover,
html[data-theme] .sort-menu button.active,
html[data-theme] .command-palette button:hover {
  background: var(--sx-panel-hover) !important;
  color: var(--sx-green) !important;
}

.login-screen {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sx-green) 7%, transparent), transparent 36%),
    var(--sx-bg) !important;
}

.login-panel,
html[data-theme] .login-panel {
  border: 1px solid var(--sx-line-strong) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-panel) !important;
  box-shadow: var(--sx-shadow-soft) !important;
}

.login-panel h1 {
  color: var(--sx-text) !important;
}

.workflow-template-card,
.workflow-mode-card,
.range-preset,
.client-more-module,
.topology-node,
.topology-empty,
.topology-alert,
.clean-site-card,
.site-card,
.client-card,
.entity-card,
html[data-theme] .workflow-template-card,
html[data-theme] .workflow-mode-card,
html[data-theme] .range-preset,
html[data-theme] .client-more-module,
html[data-theme] .topology-node,
html[data-theme] .topology-empty,
html[data-theme] .topology-alert,
html[data-theme] .clean-site-card,
html[data-theme] .site-card,
html[data-theme] .client-card,
html[data-theme] .entity-card {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius) !important;
  background: var(--sx-panel-soft) !important;
  box-shadow: none !important;
}

.workflow-template-card:hover,
.workflow-template-card.active,
.workflow-mode-card:hover,
.workflow-mode-card.active,
.range-preset:hover,
.range-preset.active,
.topology-node:hover,
.clean-site-card:hover,
.site-card:hover,
.client-card:hover,
.entity-card:hover {
  border-color: color-mix(in srgb, var(--sx-green) 38%, var(--sx-line)) !important;
  background: var(--sx-panel-hover) !important;
}

.widget-drag-handle,
html[data-theme] .widget-drag-handle {
  border-color: color-mix(in srgb, var(--sx-green) 34%, var(--sx-line)) !important;
  background: var(--sx-green-faint) !important;
  color: var(--sx-green) !important;
}

.widget-size-segment,
html[data-theme] .widget-size-segment {
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius-sm) !important;
  background: var(--sx-panel-solid) !important;
}

.widget-size-segment button,
html[data-theme] .widget-size-segment button {
  color: var(--sx-text) !important;
  border-radius: 5px !important;
}

.widget-size-segment button:hover,
.widget-size-segment button.active,
html[data-theme] .widget-size-segment button:hover,
html[data-theme] .widget-size-segment button.active {
  background: var(--sx-green-faint) !important;
  color: var(--sx-green) !important;
}

html[data-theme="light"] .btn.primary,
html[data-theme="light"] button.btn.primary {
  color: #ffffff !important;
  background: linear-gradient(180deg, #069866, #007a50) !important;
}

html[data-theme="light"] .nav-count,
html[data-theme="light"] .count-badge {
  color: #ffffff !important;
}

html[data-theme="light"] .modal-layer {
  background: rgba(17, 29, 25, 0.28) !important;
}

html[data-theme="light"] .ops-table th,
html[data-theme="light"] .workbench-table th {
  background: #f5faf7 !important;
}

html[data-theme="light"] .drawer-body {
  background: #f7faf8 !important;
}

@media (max-width: 1180px) {
  .workspace-content {
    padding-inline: 12px !important;
  }

  .workspace-head {
    padding-inline: 12px !important;
  }

  .subnav,
  .page-tabs,
  .quick-filter-bar {
    margin-inline: 12px !important;
  }
}

@media (max-width: 860px) {
  .topbar,
  .app-shell.inspector-open .topbar {
    min-height: 54px !important;
    padding-inline: 10px !important;
  }

  .top-actions {
    gap: 6px !important;
  }

  .user-chip,
  .theme-trigger,
  .icon-btn {
    min-height: 36px;
  }

  .workspace-head h2 {
    font-size: 22px !important;
  }
}

@media (max-width: 640px) {
  .role-home-hero,
  .stage2a-workbench-header {
    grid-template-columns: 1fr !important;
    padding: 15px !important;
  }

  .stage2a-header-actions,
  .hero-actions,
  .workspace-actions,
  .drawer-guide-actions {
    justify-content: flex-start !important;
  }

  .btn,
  button.btn {
    min-width: 0;
  }
}

.app-shell.secondary-collapsed .site-context-selector {
  display: grid !important;
  place-items: center !important;
  padding: 8px 5px !important;
}

.app-shell.secondary-collapsed .site-context-button,
html[data-theme] .app-shell.secondary-collapsed .site-context-button {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  border-radius: var(--sx-radius-sm) !important;
}

.console-left,
.console-left-body,
.sidebar,
.main-nav,
.module-pane,
.module-pane-content,
html[data-theme] .console-left,
html[data-theme] .console-left-body,
html[data-theme] .sidebar,
html[data-theme] .main-nav,
html[data-theme] .module-pane,
html[data-theme] .module-pane-content {
  overflow-x: hidden !important;
}

.module-pane,
html[data-theme] .module-pane {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.module-pane-head,
html[data-theme] .module-pane-head {
  grid-template-columns: minmax(0, 1fr) 36px !important;
}

.module-pane-footer,
html[data-theme] .module-pane-footer {
  min-height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 8px 10px !important;
  border-top: 1px solid var(--sx-line) !important;
  background: var(--sx-bg-elevated) !important;
}

.module-pane-footer .module-layout-button,
html[data-theme] .module-pane-footer .module-layout-button {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
}

.module-pane.collapsed .module-pane-footer {
  display: none !important;
}

#secondaryPane,
#secondaryPane *,
#secondaryPaneContent,
#secondaryPaneContent *,
.module-pane-footer,
.module-pane-footer *,
html[data-theme] #secondaryPane,
html[data-theme] #secondaryPane *,
html[data-theme] #secondaryPaneContent,
html[data-theme] #secondaryPaneContent *,
html[data-theme] .module-pane-footer,
html[data-theme] .module-pane-footer * {
  box-sizing: border-box !important;
}

#secondaryPane,
#secondaryPaneContent,
.module-pane-footer,
.console-left-body,
html[data-theme] #secondaryPane,
html[data-theme] #secondaryPaneContent,
html[data-theme] .module-pane-footer,
html[data-theme] .console-left-body {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

#secondaryPaneContent > *,
html[data-theme] #secondaryPaneContent > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.report-builder-panel .detail-grid,
.report-builder-panel .inspector-grid {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px 12px !important;
}

.report-builder-panel .detail-grid div,
.report-builder-panel .inspector-grid div,
html[data-theme] .report-builder-panel .detail-grid div,
html[data-theme] .report-builder-panel .inspector-grid div {
  display: grid !important;
  grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 10px !important;
  padding: 10px 12px !important;
}

.report-builder-panel .detail-grid span,
.report-builder-panel .inspector-grid span {
  min-width: 0;
}

.report-builder-panel .detail-grid b,
.report-builder-panel .inspector-grid b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-config-grid > div,
html[data-theme] .report-config-grid > div {
  display: grid !important;
  grid-template-columns: minmax(96px, 0.34fr) minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: start !important;
  padding: 10px 12px !important;
  border: 1px solid var(--sx-line) !important;
  border-radius: var(--sx-radius-sm) !important;
  background: var(--sx-panel-soft) !important;
}

.report-config-grid > div span,
.report-config-grid > div b {
  min-width: 0;
}

.report-config-grid > div b {
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .report-builder-panel .detail-grid,
  .report-builder-panel .inspector-grid,
  .report-config-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Stage 2Z: deep system audit containment for dense tables and small screens. */
.workspace,
.workspace-content,
.panel,
.workbench-panel,
.table-wrap,
.access-list-panel,
.access-user-table,
.operator-triage-board,
.operator-triage-lane,
.workflow-rules-layout,
.workflow-rule-builder-panel,
.workflow-rule-dryrun-panel,
.automation-rules-panel,
html[data-theme] .workspace,
html[data-theme] .workspace-content,
html[data-theme] .panel,
html[data-theme] .workbench-panel,
html[data-theme] .table-wrap,
html[data-theme] .access-list-panel,
html[data-theme] .access-user-table,
html[data-theme] .operator-triage-board,
html[data-theme] .operator-triage-lane,
html[data-theme] .workflow-rules-layout,
html[data-theme] .workflow-rule-builder-panel,
html[data-theme] .workflow-rule-dryrun-panel,
html[data-theme] .automation-rules-panel {
  min-width: 0 !important;
  max-width: 100% !important;
}

.table-wrap,
.workbench-panel .table-wrap,
.sleek-list-panel .table-wrap,
html[data-theme] .table-wrap,
html[data-theme] .workbench-panel .table-wrap,
html[data-theme] .sleek-list-panel .table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden;
}

.table-wrap > table,
.ops-table,
.workbench-table,
html[data-theme] .table-wrap > table,
html[data-theme] .ops-table,
html[data-theme] .workbench-table {
  max-width: none;
}

.ops-table th,
.ops-table td,
.workbench-table th,
.workbench-table td,
.access-user-row > *,
.access-user-header > *,
.operator-triage-lane *,
.automation-rule-row *,
html[data-theme] .ops-table th,
html[data-theme] .ops-table td,
html[data-theme] .workbench-table th,
html[data-theme] .workbench-table td,
html[data-theme] .access-user-row > *,
html[data-theme] .access-user-header > *,
html[data-theme] .operator-triage-lane *,
html[data-theme] .automation-rule-row * {
  min-width: 0 !important;
  overflow-wrap: anywhere;
}

.access-user-table,
html[data-theme] .access-user-table {
  overflow-x: auto;
  padding-bottom: 2px;
}

.access-user-header,
.access-user-row,
html[data-theme] .access-user-header,
html[data-theme] .access-user-row {
  min-width: min(920px, 100%);
  width: 100%;
}

.operator-triage-board,
html[data-theme] .operator-triage-board {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
}

.operator-triage-lane,
html[data-theme] .operator-triage-lane {
  overflow: hidden;
}

@media (max-width: 720px) {
  .topbar,
  .app-shell.inspector-open .topbar,
  html[data-theme] .topbar,
  html[data-theme] .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 6px !important;
    padding-inline: 8px !important;
  }

  .top-actions,
  html[data-theme] .top-actions {
    max-width: min(100%, 252px) !important;
    gap: 5px !important;
  }

  .user-switcher,
  .user-switch-button,
  html[data-theme] .user-switcher,
  html[data-theme] .user-switch-button {
    max-width: 172px !important;
    min-width: 0 !important;
  }

  .user-switch-button {
    padding-inline: 8px !important;
  }

  .user-chip,
  html[data-theme] .user-chip {
    max-width: 78px !important;
    min-width: 0 !important;
    padding-inline: 8px !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Stage 2AC: responsive topbar collision fix.
   Keep the Integron mark visible only while the search and user controls have enough room. */
.topbar,
.app-shell.inspector-open .topbar,
html[data-theme] .topbar,
html[data-theme] .app-shell.inspector-open .topbar {
  grid-template-columns: minmax(220px, 460px) minmax(92px, 1fr) minmax(260px, auto) !important;
  overflow: visible !important;
}

.top-search,
html[data-theme] .top-search {
  display: block !important;
  grid-column: 1 !important;
  width: 100% !important;
  max-width: 460px !important;
  min-width: 0 !important;
  justify-self: stretch !important;
  z-index: 3;
}

.app-shell.inspector-open .top-search,
html[data-theme] .app-shell.inspector-open .top-search {
  display: block !important;
}

.top-search input,
html[data-theme] .top-search input {
  width: 100% !important;
}

.top-brand,
html[data-theme] .top-brand {
  position: static !important;
  grid-column: 2 !important;
  justify-self: center !important;
  align-self: center !important;
  transform: none !important;
  min-width: 0 !important;
  max-width: 148px !important;
  width: auto !important;
  overflow: hidden !important;
  z-index: 1;
}

.top-brand-icon,
html[data-theme] .top-brand-icon {
  flex: 0 0 auto;
}

.top-brand strong,
html[data-theme] .top-brand strong {
  min-width: 0 !important;
  max-width: 96px !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions,
html[data-theme] .top-actions {
  grid-column: 3 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  justify-self: end !important;
  z-index: 4;
}

@media (max-width: 1260px) {
  .topbar,
  .app-shell.inspector-open .topbar,
  html[data-theme] .topbar,
  html[data-theme] .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(210px, 380px) minmax(34px, 64px) minmax(240px, auto) !important;
  }

  .top-brand,
  html[data-theme] .top-brand {
    max-width: 40px !important;
  }

  .top-brand strong,
  html[data-theme] .top-brand strong {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .topbar,
  .app-shell.inspector-open .topbar,
  html[data-theme] .topbar,
  html[data-theme] .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, auto) !important;
  }

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

  .top-search,
  html[data-theme] .top-search {
    grid-column: 1 !important;
    max-width: none !important;
  }

  .top-actions,
  html[data-theme] .top-actions {
    grid-column: 2 !important;
  }
}

@media (max-width: 720px) {
  .topbar,
  .app-shell.inspector-open .topbar,
  html[data-theme] .topbar,
  html[data-theme] .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(130px, 1fr) minmax(156px, auto) !important;
  }

  .top-search input,
  html[data-theme] .top-search input {
    padding-inline: 10px !important;
  }
}

@media (max-width: 520px) {
  .workspace,
  html[data-theme] .workspace {
    --topbar-h: 104px;
  }

  .topbar,
  .app-shell.inspector-open .topbar,
  html[data-theme] .topbar,
  html[data-theme] .app-shell.inspector-open .topbar {
    grid-template-columns: 1fr !important;
    grid-template-rows: 40px 42px !important;
    align-content: start !important;
    gap: 6px !important;
    min-height: var(--topbar-h) !important;
    padding: 8px !important;
    overflow: hidden !important;
  }

  .top-search,
  html[data-theme] .top-search {
    grid-column: 1 !important;
    grid-row: 1 !important;
    max-width: none !important;
  }

  .top-actions,
  html[data-theme] .top-actions {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    justify-self: stretch !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  .top-actions .user-chip,
  html[data-theme] .top-actions .user-chip {
    flex: 1 1 auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .top-actions .btn,
  .top-actions .icon-btn,
  html[data-theme] .top-actions .btn,
  html[data-theme] .top-actions .icon-btn {
    flex: 0 0 auto !important;
    min-width: 42px !important;
  }
}

/* Stage 2AD: screenshot QA guardrails for dense operations and 1000+ device clients. */
.badge,
.pill,
.permission-chip,
.role-route-chips span,
.count-badge,
.badge-button,
html[data-theme] .badge,
html[data-theme] .pill,
html[data-theme] .permission-chip,
html[data-theme] .role-route-chips span,
html[data-theme] .count-badge,
html[data-theme] .badge-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: fit-content !important;
  max-width: 100% !important;
  min-width: max-content !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

.badge-button,
html[data-theme] .badge-button {
  min-height: 30px !important;
  padding-inline: 12px !important;
}

.panel-head,
html[data-theme] .panel-head {
  min-width: 0 !important;
}

.panel-head > div,
html[data-theme] .panel-head > div {
  min-width: 0 !important;
}

.operator-triage-board,
html[data-theme] .operator-triage-board {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
  align-items: start !important;
  max-width: 100% !important;
  overflow: clip !important;
}

.operator-triage-lane,
html[data-theme] .operator-triage-lane {
  overflow: hidden !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.operator-triage-lane .panel-head,
html[data-theme] .operator-triage-lane .panel-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 10px !important;
}

.operator-triage-main,
html[data-theme] .operator-triage-main,
.priority-work-main,
html[data-theme] .priority-work-main,
.report-row,
html[data-theme] .report-row,
.status-line,
html[data-theme] .status-line {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px !important;
}

.operator-triage-main > span,
.priority-work-main > span,
.report-row > div,
.status-line > div,
html[data-theme] .operator-triage-main > span,
html[data-theme] .priority-work-main > span,
html[data-theme] .report-row > div,
html[data-theme] .status-line > div {
  min-width: 0 !important;
}

.operator-triage-main .badge,
.priority-work-main .badge,
.report-row .badge,
.status-line .badge,
html[data-theme] .operator-triage-main .badge,
html[data-theme] .priority-work-main .badge,
html[data-theme] .report-row .badge,
html[data-theme] .status-line .badge {
  justify-self: end !important;
  align-self: center !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.operator-triage-item .row-actions,
.priority-work-row .row-actions,
html[data-theme] .operator-triage-item .row-actions,
html[data-theme] .priority-work-row .row-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.scale-notice,
html[data-theme] .scale-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid var(--sx-line, var(--line));
  border-radius: var(--sx-radius-sm, var(--radius-sm));
  background: color-mix(in srgb, var(--sx-green, var(--green)) 7%, transparent);
  color: var(--sx-text, var(--text));
  font-size: 12px;
}

.scale-notice strong,
.scale-notice span {
  min-width: 0;
}

.scale-notice span {
  color: var(--sx-muted, var(--muted));
}

.table-cell-stack,
html[data-theme] .table-cell-stack {
  display: grid !important;
  gap: 4px !important;
  align-content: start !important;
  justify-items: start !important;
  min-width: 0 !important;
}

.table-cell-stack > strong,
html[data-theme] .table-cell-stack > strong {
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.inline-drill,
html[data-theme] .inline-drill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.user-switch-search,
html[data-theme] .user-switch-search {
  padding: 4px;
}

.user-switch-search input,
html[data-theme] .user-switch-search input {
  width: 100% !important;
  min-height: 36px;
  border: 1px solid var(--sx-line, var(--line));
  border-radius: var(--sx-radius-sm, var(--radius-sm));
  background: var(--sx-panel-soft, var(--panel-2));
  color: var(--sx-text, var(--text));
  padding: 0 10px;
}

.user-switch-menu .scale-notice,
html[data-theme] .user-switch-menu .scale-notice {
  margin: 2px 4px 6px !important;
  padding: 7px 9px !important;
  font-size: 11px !important;
}

.user-switch-options,
html[data-theme] .user-switch-options {
  display: grid;
  gap: 4px;
  max-height: min(62vh, 520px);
  overflow: auto;
  padding-right: 2px;
}

.field-scale-note,
html[data-theme] .field-scale-note {
  display: block;
  margin-top: 5px;
  color: var(--sx-muted, var(--muted));
  font-size: 11px;
  line-height: 1.35;
}

.device-table-wrap,
html[data-theme] .device-table-wrap {
  max-height: min(68vh, 720px) !important;
  overflow: auto !important;
}

.device-table-wrap .ops-table thead th,
.device-table-wrap .workbench-table thead th,
html[data-theme] .device-table-wrap .ops-table thead th,
html[data-theme] .device-table-wrap .workbench-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--sx-panel-solid, var(--panel-2)) !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

@media (max-width: 1120px) {
  .operator-triage-board,
  html[data-theme] .operator-triage-board {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
  }
}

/* Stage 2AS: production backbone, client-safe workflow access, and backend-first guardrails. */
.workflow-wizard-coach {
  overflow: hidden;
}

.workflow-wizard-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.workflow-wizard-step {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 96%, var(--accent) 4%);
}

.workflow-wizard-step b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

.workflow-wizard-step span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workflow-wizard-step strong {
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.workflow-wizard-step small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workflow-wizard-step.done b,
.workflow-wizard-step.active b {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.workflow-wizard-step.active,
.workflow-wizard-step.guarded {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.workflow-wizard-step.guarded b {
  border-color: color-mix(in srgb, var(--warn) 70%, var(--line));
  color: var(--warn);
}

.workflow-wizard-callout {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.workflow-wizard-callout > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workflow-wizard-callout span {
  color: var(--muted);
  line-height: 1.35;
}

.rule-builder-actions.compact {
  padding: 0;
  flex-shrink: 0;
}

.top-role-actions,
html[data-theme] .top-role-actions {
  display: inline-flex !important;
  flex-shrink: 0 !important;
  max-width: none !important;
  overflow: visible !important;
}

.toast.quiet {
  left: 50%;
  right: auto;
  bottom: 12px;
  max-width: min(240px, calc(100vw - 36px));
  padding: 8px 10px;
  text-align: center;
  transform: translate(-50%, 8px);
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(5, 14, 12, 0.16);
}

.toast.quiet.show {
  transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
  .workflow-wizard-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-wizard-callout {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .workflow-wizard-strip {
    grid-template-columns: 1fr;
  }
}





/* Stage 2AT: access templates, saved module rights, and no-leak user setup. */
.access-template-grid,
.access-bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.access-template-card,
.access-bundle-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
  text-align: left;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 94%, var(--accent) 6%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.access-template-card span,
.access-bundle-card span,
.access-template-card small,
.access-bundle-card small {
  color: var(--muted);
  line-height: 1.35;
}

.access-template-card.active,
.access-bundle-card.active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 68%, var(--panel));
}

.access-template-card:disabled,
.access-bundle-card:disabled {
  cursor: default;
  opacity: 0.72;
}

.access-template-picker,
.access-bundle-picker {
  display: grid;
  gap: 10px;
}

.access-user-table,
html[data-theme] .access-user-table {
  overflow-x: hidden !important;
}

.access-user-header,
.access-user-row,
html[data-theme] .access-user-header,
html[data-theme] .access-user-row {
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(0, 0.86fr)
    minmax(0, 0.95fr)
    minmax(52px, 0.46fr)
    minmax(0, 0.78fr)
    minmax(0, 0.72fr)
    minmax(58px, 0.48fr) !important;
  min-width: 0 !important;
  width: 100% !important;
}

.access-user-row > *,
.access-user-header > *,
html[data-theme] .access-user-row > *,
html[data-theme] .access-user-header > * {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 720px) {
  .access-template-grid,
  .access-bundle-grid {
    grid-template-columns: 1fr;
  }
}

/* Stage 2AT: dense action tables must fit the shell instead of creating page-level sideways scroll. */
.table-wrap.sticky-actions,
html[data-theme] .table-wrap.sticky-actions {
  overflow-x: hidden !important;
}

.table-wrap.sticky-actions .workbench-table,
.device-table-wrap.sticky-actions .workbench-table,
html[data-theme] .table-wrap.sticky-actions .workbench-table,
html[data-theme] .device-table-wrap.sticky-actions .workbench-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

.table-wrap.sticky-actions .workbench-table th:last-child,
.table-wrap.sticky-actions .workbench-table td:last-child,
html[data-theme] .table-wrap.sticky-actions .workbench-table th:last-child,
html[data-theme] .table-wrap.sticky-actions .workbench-table td:last-child {
  position: static !important;
  width: auto !important;
  white-space: normal !important;
  background: transparent !important;
  box-shadow: none !important;
}

.table-wrap.sticky-actions .table-actions,
html[data-theme] .table-wrap.sticky-actions .table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.table-wrap.sticky-actions .btn,
html[data-theme] .table-wrap.sticky-actions .btn {
  min-width: 0 !important;
  white-space: normal !important;
}

/* Stage 2BE final responsive polish: sensor filters remain clearly tappable after global flat-button refinement. */
.sensor-filter-strip .quick-filter,
html[data-theme] .sensor-filter-strip .quick-filter,
.sensor-insight-controls .segmented-control button,
html[data-theme] .sensor-insight-controls .segmented-control button,
.sensor-sort-strip button,
html[data-theme] .sensor-sort-strip button {
  border-color: color-mix(in srgb, var(--sx-line) 88%, var(--sx-green) 12%) !important;
  background: color-mix(in srgb, var(--sx-panel-soft) 94%, var(--sx-green) 6%) !important;
}

.sensor-filter-strip .quick-filter:hover,
.sensor-filter-strip .quick-filter.active,
html[data-theme] .sensor-filter-strip .quick-filter:hover,
html[data-theme] .sensor-filter-strip .quick-filter.active,
.sensor-insight-controls .segmented-control button:hover,
.sensor-insight-controls .segmented-control button.active,
html[data-theme] .sensor-insight-controls .segmented-control button:hover,
html[data-theme] .sensor-insight-controls .segmented-control button.active,
.sensor-sort-strip button:hover,
.sensor-sort-strip button.active,
html[data-theme] .sensor-sort-strip button:hover,
html[data-theme] .sensor-sort-strip button.active {
  border-color: color-mix(in srgb, var(--sx-green) 58%, var(--sx-line)) !important;
  background: var(--sx-green-faint) !important;
  color: var(--sx-green) !important;
}

@media (max-width: 700px) {
  .sensor-filter-strip.quick-filter-bar,
  html[data-theme] .sensor-filter-strip.quick-filter-bar,
  .sensor-insight-controls,
  html[data-theme] .sensor-insight-controls,
  .sensor-sort-strip,
  html[data-theme] .sensor-sort-strip {
    margin-inline: 0 !important;
  }
}

/* Stage 2BF: modern sensor graphics refinement. The insight page should feel like an instrument panel, not a table report. */
.sensor-insight-page {
  display: grid;
  gap: 12px;
}

.sensor-insight-page .sensor-insight-summary.sleek-status-strip,
html[data-theme] .sensor-insight-page .sensor-insight-summary.sleek-status-strip {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--sx-line) 80%, transparent) !important;
  background: color-mix(in srgb, var(--sx-panel-soft) 92%, transparent) !important;
}

.sensor-insight-page .sensor-insight-summary .sleek-status-segment,
html[data-theme] .sensor-insight-page .sensor-insight-summary .sleek-status-segment {
  min-height: 64px;
  padding: 11px 14px !important;
  border-right-color: color-mix(in srgb, var(--sx-line) 72%, transparent) !important;
  background: transparent !important;
}

.sensor-insight-page .sensor-insight-summary .sleek-status-segment strong {
  font-size: 22px !important;
  letter-spacing: 0;
}

.sensor-control-dock,
html[data-theme] .sensor-control-dock {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 82%, transparent);
  border-radius: var(--sx-radius);
  background: color-mix(in srgb, var(--sx-panel-soft) 94%, transparent);
}

.sensor-control-dock-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 8px;
  align-items: center;
}

.sensor-control-dock .quick-filter-bar,
.sensor-control-dock .sensor-insight-controls,
.sensor-control-dock .sensor-sort-strip,
html[data-theme] .sensor-control-dock .quick-filter-bar,
html[data-theme] .sensor-control-dock .sensor-insight-controls,
html[data-theme] .sensor-control-dock .sensor-sort-strip {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.sensor-control-dock .quick-filter-bar {
  display: flex;
  min-height: 36px;
}

.sensor-control-dock .quick-filter-label,
.sensor-control-dock .sensor-control-group > span,
.sensor-control-dock .sensor-sort-strip > span {
  color: color-mix(in srgb, var(--sx-muted) 84%, var(--sx-green)) !important;
  font-size: 10px !important;
  font-weight: 780 !important;
}

.sensor-control-dock .quick-filter,
.sensor-control-dock .segmented-control button,
.sensor-control-dock .sensor-sort-strip button,
html[data-theme] .sensor-control-dock .quick-filter,
html[data-theme] .sensor-control-dock .segmented-control button,
html[data-theme] .sensor-control-dock .sensor-sort-strip button {
  min-height: 30px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  border-color: color-mix(in srgb, var(--sx-line) 84%, transparent) !important;
  background: color-mix(in srgb, var(--sx-panel) 78%, transparent) !important;
  box-shadow: none !important;
}

.sensor-control-dock .quick-filter.active,
.sensor-control-dock .segmented-control button.active,
.sensor-control-dock .sensor-sort-strip button.active,
html[data-theme] .sensor-control-dock .quick-filter.active,
html[data-theme] .sensor-control-dock .segmented-control button.active,
html[data-theme] .sensor-control-dock .sensor-sort-strip button.active {
  border-color: color-mix(in srgb, var(--sx-green) 62%, var(--sx-line)) !important;
  background: color-mix(in srgb, var(--sx-green-faint) 92%, var(--sx-panel)) !important;
  color: var(--sx-green) !important;
}

.sensor-control-dock .sensor-insight-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 12px;
  align-items: center;
}

.sensor-control-dock .custom-range {
  margin-left: auto;
}

.sensor-control-dock .custom-range input,
html[data-theme] .sensor-control-dock .custom-range input {
  min-height: 30px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sx-panel) 78%, transparent) !important;
}

.sensor-control-dock .sensor-control-note {
  margin-left: 0;
  font-size: 11px;
}

.sensor-chart-stage,
html[data-theme] .sensor-chart-stage {
  overflow: hidden;
  padding: 0 !important;
  border-color: color-mix(in srgb, var(--sx-line) 70%, transparent) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sx-panel) 96%, transparent), color-mix(in srgb, var(--sx-panel-soft) 98%, transparent)) !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.08);
}

.sensor-chart-stage-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px 10px;
}

.sensor-selected-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.sensor-selected-copy h3,
.sensor-selected-copy p,
.sensor-selected-copy small {
  display: block;
  margin: 0;
  min-width: 0;
}

.sensor-selected-copy h3 {
  color: var(--sx-text);
  font-size: 21px;
  line-height: 1.16;
}

.sensor-selected-copy p {
  margin-top: 3px;
  color: var(--sx-muted);
  font-size: 12px;
}

.sensor-selected-copy small {
  margin-top: 6px;
  max-width: 760px;
  color: color-mix(in srgb, var(--sx-muted) 88%, var(--sx-text));
}

.sensor-live-reading,
html[data-theme] .sensor-live-reading {
  min-width: 158px;
  display: grid;
  gap: 3px;
  justify-items: end;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--sx-green) 28%, var(--sx-line));
  border-radius: var(--sx-radius-sm);
  background: color-mix(in srgb, var(--sx-green-faint) 72%, transparent);
}

.sensor-live-reading.warn,
html[data-theme] .sensor-live-reading.warn {
  border-color: color-mix(in srgb, var(--warning) 50%, var(--sx-line));
  background: rgba(230, 185, 60, 0.1);
}

.sensor-live-reading.danger,
html[data-theme] .sensor-live-reading.danger {
  border-color: color-mix(in srgb, var(--danger) 52%, var(--sx-line));
  background: rgba(240, 103, 103, 0.1);
}

.sensor-live-reading small,
.sensor-live-reading span {
  color: var(--sx-muted);
  font-size: 11px;
}

.sensor-live-reading strong {
  color: var(--sx-text);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 0.95;
}

.sensor-chart-canvas {
  margin: 0 14px;
  padding: 8px 10px 4px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 54%, transparent);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sx-panel-soft) 70%, transparent), transparent),
    radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--sx-green) 12%, transparent), transparent 30%);
}

.sensor-chart-stage .sensor-chart-wrap {
  min-height: 292px;
}

.sensor-chart-figure {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sensor-history-chart:not(.compact) {
  min-height: 292px;
}

.sensor-chart-bg,
html[data-theme="light"] .sensor-chart-bg {
  fill: transparent !important;
  stroke: transparent !important;
}

.sensor-grid-line {
  stroke: color-mix(in srgb, var(--sx-muted) 14%, transparent) !important;
}

.sensor-target-band {
  fill: color-mix(in srgb, var(--sx-green) 8%, transparent) !important;
}

.sensor-history-area {
  opacity: 0.38;
}

.sensor-history-line {
  fill: none;
  stroke: var(--sx-green);
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 7px 12px color-mix(in srgb, var(--sx-green) 22%, transparent));
}

.sensor-sample-dot {
  opacity: 0;
  pointer-events: none;
}

.sensor-event-dot {
  stroke: var(--sx-panel);
  stroke-width: 2.4;
  fill: #e33838;
  filter: drop-shadow(0 3px 7px rgba(227, 56, 56, 0.32));
}

.sensor-event-dot.warn,
.sensor-event-dot.danger,
.sensor-event-dot.alarm {
  fill: #e33838;
}

.sensor-command-dot {
  stroke: var(--sx-panel);
  stroke-width: 2.4;
  fill: #087f4f;
  filter: drop-shadow(0 3px 7px rgba(8, 127, 79, 0.28));
}

.sensor-command-dot.control {
  fill: #0aa66a;
}

.sensor-command-dot.control-alt {
  fill: #2f80ed;
}

.sensor-command-dot.integration {
  fill: #2f80ed;
}

.sensor-command-dot.service {
  fill: #d69619;
}

.sensor-command-dot.notify,
.sensor-command-dot.command {
  fill: #7b61ff;
}

.sensor-service-dot {
  stroke: var(--sx-panel);
  stroke-width: 2.4;
  fill: #d69619;
  filter: drop-shadow(0 3px 7px rgba(214, 150, 25, 0.25));
}

.sensor-service-dot.notify {
  fill: #7b61ff;
}

.sensor-hover-point {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  cursor: crosshair;
}

.sensor-chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding: 0 4px 2px;
  color: var(--sx-muted);
  font-size: 11px;
  font-weight: 760;
}

.sensor-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sensor-chart-legend i {
  display: inline-block;
  flex: 0 0 auto;
}

.sensor-legend-line {
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: var(--sx-green);
}

.sensor-legend-band {
  width: 22px;
  height: 10px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--sx-green) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--sx-green) 22%, transparent);
}

.sensor-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #087f4f;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sx-panel) 88%, transparent);
}

.sensor-legend-dot.alarm {
  background: #e33838;
}

.sensor-legend-dot.control {
  background: #0aa66a;
}

.sensor-legend-dot.control-alt,
.sensor-legend-dot.integration {
  background: #2f80ed;
}

.sensor-legend-dot.service {
  background: #d69619;
}

.sensor-legend-dot.notify,
.sensor-legend-dot.command {
  background: #7b61ff;
}

.sensor-event-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 8px;
  padding: 2px 0 4px;
}

.sensor-event-timeline.empty {
  display: block;
  color: var(--sx-muted);
  font-size: 11px;
  font-weight: 720;
}

.sensor-timeline-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 9px;
  align-items: start;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 58%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sx-panel-soft) 72%, transparent);
}

.sensor-timeline-item i {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--sx-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sx-green) 10%, transparent);
}

.sensor-timeline-item.alarm i {
  background: #e33838;
  box-shadow: 0 0 0 3px rgba(227, 56, 56, 0.12);
}

.sensor-timeline-item.service i {
  background: #d69619;
  box-shadow: 0 0 0 3px rgba(214, 150, 25, 0.13);
}

.sensor-timeline-item.control-alt i,
.sensor-timeline-item.integration i {
  background: #2f80ed;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.13);
}

.sensor-timeline-item.notify i,
.sensor-timeline-item.command i {
  background: #7b61ff;
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.13);
}

.sensor-timeline-item strong,
.sensor-timeline-item span,
.sensor-timeline-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sensor-timeline-item strong {
  color: var(--sx-text);
  font-size: 12px;
  line-height: 1.15;
}

.sensor-timeline-item span,
.sensor-timeline-item small {
  color: var(--sx-muted);
  font-size: 10.5px;
  font-weight: 720;
}

.sensor-timeline-item small {
  grid-column: 2;
}

.sensor-events-block .sensor-event-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sensor-event-toggle-row button {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--sx-panel) 84%, transparent);
  color: var(--sx-muted);
  font-size: 12px;
  font-weight: 820;
}

.sensor-event-toggle-row button.active {
  border-color: color-mix(in srgb, var(--sx-green) 58%, transparent);
  background: color-mix(in srgb, var(--sx-green) 12%, transparent);
  color: var(--sx-text);
}

.sensor-axis-label {
  fill: color-mix(in srgb, var(--sx-muted) 76%, transparent) !important;
  font-size: 10px;
  font-weight: 720;
}

.sensor-insight-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--sx-line) 64%, transparent);
}

.sensor-insight-metrics span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 14px 13px;
  border-right: 1px solid color-mix(in srgb, var(--sx-line) 56%, transparent);
}

.sensor-insight-metrics span:last-child {
  border-right: 0;
}

.sensor-insight-metrics b {
  color: var(--sx-text);
  font-size: 20px;
  line-height: 1;
}

.sensor-insight-metrics small {
  color: var(--sx-muted);
  font-size: 11px;
}

.sensor-insight-list-panel,
html[data-theme] .sensor-insight-list-panel {
  padding-bottom: 0 !important;
  overflow: hidden;
  background: color-mix(in srgb, var(--sx-panel) 96%, transparent) !important;
}

.sensor-insight-list {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden !important;
  border-top-color: color-mix(in srgb, var(--sx-line) 58%, transparent) !important;
}

.sensor-insight-row,
html[data-theme] .sensor-insight-row {
  min-width: 0 !important;
  max-width: 100% !important;
  grid-template-columns: minmax(170px, 1.18fr) minmax(104px, 0.45fr) minmax(78px, 0.3fr) minmax(126px, 0.58fr) minmax(92px, auto) !important;
  min-height: 66px;
  padding: 9px 12px !important;
  border-bottom-color: color-mix(in srgb, var(--sx-line) 56%, transparent) !important;
  background: transparent !important;
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--sx-green) 52%, transparent) !important;
}

.sensor-insight-row > *,
html[data-theme] .sensor-insight-row > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.sensor-insight-row.warn {
  box-shadow: inset 2px 0 0 rgba(230, 185, 60, 0.82) !important;
}

.sensor-insight-row.danger {
  box-shadow: inset 2px 0 0 rgba(240, 103, 103, 0.86) !important;
}

.sensor-insight-row.active,
html[data-theme] .sensor-insight-row.active {
  background: color-mix(in srgb, var(--sx-green-faint) 70%, transparent) !important;
}

.sensor-insight-spark .sensor-history-chart.compact {
  height: 38px;
}

.sensor-row-range {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--sx-muted);
  font-size: 11px;
}

.sensor-row-range b {
  color: var(--sx-text);
  font-size: 12px;
}

.sensor-side-card,
html[data-theme] .sensor-side-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 76%, transparent);
  border-radius: var(--sx-radius);
  background: color-mix(in srgb, var(--sx-panel) 94%, transparent);
}

.sensor-side-card .workbench-chrome {
  min-height: 0;
  padding-bottom: 8px;
}

.sensor-side-status {
  display: grid;
  gap: 8px;
}

@media (max-width: 1180px) {
  .sensor-control-dock-row {
    grid-template-columns: 1fr;
  }

  .sensor-chart-stage-head {
    grid-template-columns: 1fr;
  }

  .sensor-live-reading {
    justify-items: start;
  }

  .sensor-insight-row,
  html[data-theme] .sensor-insight-row {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.5fr) minmax(120px, 0.42fr) !important;
  }

  .sensor-row-range,
  .sensor-insight-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .sensor-insight-page {
    gap: 10px;
  }

  .sensor-insight-page .sensor-insight-summary .sleek-status-segment {
    min-height: 56px;
  }

  .sensor-control-dock {
    padding: 7px;
  }

  .sensor-control-dock .quick-filter-bar,
  .sensor-control-dock .sensor-insight-controls,
  .sensor-control-dock .sensor-sort-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sensor-control-dock .quick-filter-buttons,
  .sensor-control-dock .segmented-control,
  .sensor-control-dock .sensor-sort-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sensor-control-dock .custom-range {
    margin-left: 0;
  }

  .sensor-chart-stage-head {
    padding: 14px 14px 8px;
  }

  .sensor-selected-copy {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .sensor-selected-copy h3 {
    font-size: 18px;
  }

  .sensor-chart-canvas {
    margin-inline: 10px;
    padding-inline: 4px;
  }

  .sensor-chart-stage .sensor-chart-wrap,
  .sensor-history-chart:not(.compact) {
    min-height: 220px;
  }

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

  .sensor-insight-metrics span {
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--sx-line) 56%, transparent);
  }

  .sensor-insight-row,
  html[data-theme] .sensor-insight-row {
    grid-template-columns: 1fr !important;
  }
}

/* Stage 2BG: full interface QA. Keep dense admin tables readable without leaking off the shell. */
.api-endpoint-table > table,
.api-pipeline-table > table,
html[data-theme] .api-endpoint-table > table,
html[data-theme] .api-pipeline-table > table {
  width: 100% !important;
  table-layout: fixed !important;
}

.api-endpoint-table > table th,
.api-endpoint-table > table td,
.api-pipeline-table > table th,
.api-pipeline-table > table td,
html[data-theme] .api-endpoint-table > table th,
html[data-theme] .api-endpoint-table > table td,
html[data-theme] .api-pipeline-table > table th,
html[data-theme] .api-pipeline-table > table td {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

.api-endpoint-table .badge,
.api-pipeline-table .badge,
html[data-theme] .api-endpoint-table .badge,
html[data-theme] .api-pipeline-table .badge {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.selected-access-panel .access-level-control button,
html[data-theme] .selected-access-panel .access-level-control button {
  overflow: visible;
  text-overflow: clip;
}

/* Stage 2BH: professional sensor analytics and calmer client first-glance status. */
.sensor-chart-panel,
html[data-theme] .sensor-chart-panel {
  background: color-mix(in srgb, var(--sx-panel) 97%, transparent) !important;
}

.sensor-chart-stage-head,
html[data-theme] .sensor-chart-stage-head {
  padding: 14px 16px 10px !important;
  border-bottom: 1px solid color-mix(in srgb, var(--sx-line) 58%, transparent);
}

.sensor-chart-canvas,
html[data-theme] .sensor-chart-canvas {
  margin: 0 !important;
  padding: 8px 12px 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.sensor-chart-stage .sensor-chart-wrap,
html[data-theme] .sensor-chart-stage .sensor-chart-wrap {
  min-height: 318px !important;
}

.sensor-history-chart:not(.compact),
html[data-theme] .sensor-history-chart:not(.compact) {
  min-height: 318px !important;
  color: var(--sx-green);
}

.sensor-history-chart.compact,
html[data-theme] .sensor-history-chart.compact {
  min-height: 38px;
}

.sensor-chart-bg,
html[data-theme] .sensor-chart-bg {
  fill: color-mix(in srgb, var(--sx-panel-soft) 50%, transparent) !important;
  stroke: color-mix(in srgb, var(--sx-line) 56%, transparent) !important;
}

.sensor-grid-line,
html[data-theme] .sensor-grid-line {
  stroke: color-mix(in srgb, var(--sx-muted) 18%, transparent) !important;
  stroke-width: 1;
  shape-rendering: crispEdges;
  pointer-events: none;
}

.sensor-grid-line.vertical,
html[data-theme] .sensor-grid-line.vertical {
  stroke: color-mix(in srgb, var(--sx-muted) 10%, transparent) !important;
}

.sensor-axis-line,
html[data-theme] .sensor-axis-line {
  stroke: color-mix(in srgb, var(--sx-muted) 34%, transparent);
  stroke-width: 1.2;
  shape-rendering: crispEdges;
  pointer-events: none;
}

.sensor-target-band,
html[data-theme] .sensor-target-band {
  fill: color-mix(in srgb, var(--sx-green) 11%, transparent) !important;
  pointer-events: none;
}

.sensor-history-area,
html[data-theme] .sensor-history-area {
  opacity: 0.52 !important;
  pointer-events: none;
}

.sensor-history-line,
html[data-theme] .sensor-history-line {
  stroke: var(--sx-green) !important;
  stroke-width: 2.75 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  shape-rendering: geometricPrecision !important;
  vector-effect: non-scaling-stroke !important;
  filter: none !important;
  pointer-events: none;
}

.sensor-history-line.warn,
html[data-theme] .sensor-history-line.warn {
  stroke: var(--warning) !important;
}

.sensor-history-line.danger,
html[data-theme] .sensor-history-line.danger {
  stroke: var(--danger) !important;
}

.sensor-sample-dot,
html[data-theme] .sensor-sample-dot {
  fill: transparent !important;
  stroke: transparent !important;
  stroke-width: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sensor-sample-dot.warn,
html[data-theme] .sensor-sample-dot.warn {
  fill: color-mix(in srgb, var(--warning) 22%, var(--sx-panel));
  stroke: var(--warning);
}

.sensor-sample-dot.danger,
html[data-theme] .sensor-sample-dot.danger {
  fill: color-mix(in srgb, var(--danger) 22%, var(--sx-panel));
  stroke: var(--danger);
}

.sensor-sample-dot:hover,
html[data-theme] .sensor-sample-dot:hover {
  r: 1.35;
  stroke-width: 0;
}

.sensor-now-line,
html[data-theme] .sensor-now-line {
  stroke: color-mix(in srgb, var(--sx-green) 46%, transparent);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.sensor-now-dot,
html[data-theme] .sensor-now-dot {
  fill: var(--sx-green);
  stroke: var(--sx-panel);
  stroke-width: 2;
}

.sensor-now-dot.warn,
html[data-theme] .sensor-now-dot.warn {
  fill: var(--warning);
}

.sensor-now-dot.danger,
html[data-theme] .sensor-now-dot.danger {
  fill: var(--danger);
}

.sensor-y-axis-label,
.sensor-x-axis-label,
.sensor-chart-unit,
.sensor-axis-label,
html[data-theme] .sensor-y-axis-label,
html[data-theme] .sensor-x-axis-label,
html[data-theme] .sensor-chart-unit,
html[data-theme] .sensor-axis-label {
  fill: color-mix(in srgb, var(--sx-muted) 82%, transparent) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.sensor-y-axis-label {
  text-anchor: end;
}

.sensor-x-axis-label {
  text-anchor: middle;
}

.sensor-chart-unit,
html[data-theme] .sensor-chart-unit {
  fill: var(--sx-text) !important;
  font-size: 12px;
  font-weight: 900;
}

.sensor-axis-label.latest,
html[data-theme] .sensor-axis-label.latest {
  text-anchor: end;
  fill: var(--sx-text) !important;
  font-size: 12px;
  font-weight: 900;
}

.sensor-insight-metrics,
html[data-theme] .sensor-insight-metrics {
  margin-top: 0 !important;
  border-top-color: color-mix(in srgb, var(--sx-line) 58%, transparent) !important;
  background: color-mix(in srgb, var(--sx-panel-soft) 38%, transparent);
}

.sensor-insight-metrics span,
html[data-theme] .sensor-insight-metrics span {
  padding: 10px 14px !important;
}

.sensor-insight-metrics b,
html[data-theme] .sensor-insight-metrics b {
  font-size: 18px !important;
}

.stage2a-workbench-header.client,
html[data-theme] .stage2a-workbench-header.client {
  min-height: 0 !important;
  align-items: center !important;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 300px) !important;
  gap: 14px !important;
  padding: 16px 18px !important;
  background: linear-gradient(180deg, var(--sx-panel), color-mix(in srgb, var(--sx-panel-soft) 72%, transparent)) !important;
}

.stage2a-workbench-header.client h3,
html[data-theme] .stage2a-workbench-header.client h3 {
  margin-bottom: 5px !important;
  font-size: clamp(22px, 2.1vw, 30px) !important;
  line-height: 1.08 !important;
}

.stage2a-workbench-header.client p,
html[data-theme] .stage2a-workbench-header.client p {
  max-width: 840px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.stage2a-workbench-header.client .stage2a-header-meta,
html[data-theme] .stage2a-workbench-header.client .stage2a-header-meta {
  margin-top: 10px !important;
}

.stage2a-workbench-header.client .stage2a-header-actions,
html[data-theme] .stage2a-workbench-header.client .stage2a-header-actions {
  min-width: 0 !important;
  width: 100% !important;
  gap: 8px !important;
}

.client-service-hero,
html[data-theme] .client-service-hero {
  min-height: 86px !important;
  padding: 11px 12px !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--warning) 8%, var(--sx-panel-soft)) !important;
  border-color: color-mix(in srgb, var(--warning) 42%, var(--sx-line)) !important;
}

.client-service-hero strong,
html[data-theme] .client-service-hero strong {
  font-size: 18px !important;
  line-height: 1.08 !important;
}

.client-service-hero small,
html[data-theme] .client-service-hero small {
  font-size: 11px !important;
  line-height: 1.32 !important;
}

.client-service-hero em,
html[data-theme] .client-service-hero em {
  margin-top: 2px !important;
  padding: 3px 7px !important;
  font-size: 10px !important;
}

.client-service-hero.good,
html[data-theme] .client-service-hero.good {
  background: color-mix(in srgb, var(--sx-green) 8%, var(--sx-panel-soft)) !important;
  border-color: color-mix(in srgb, var(--sx-green) 36%, var(--sx-line)) !important;
}

.client-today-strip.sleek-status-strip,
html[data-theme] .client-today-strip.sleek-status-strip {
  margin-top: 8px !important;
  background: color-mix(in srgb, var(--sx-panel) 96%, transparent) !important;
}

.client-today-strip .sleek-status-segment,
html[data-theme] .client-today-strip .sleek-status-segment {
  min-height: 54px !important;
  padding-block: 9px !important;
}

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

@media (max-width: 980px) {
  .stage2a-workbench-header.client,
  html[data-theme] .stage2a-workbench-header.client {
    grid-template-columns: 1fr !important;
  }

  .stage2a-workbench-header.client .stage2a-header-actions,
  html[data-theme] .stage2a-workbench-header.client .stage2a-header-actions {
    max-width: none;
  }
}

@media (max-width: 700px) {
  .sensor-chart-stage .sensor-chart-wrap,
  html[data-theme] .sensor-chart-stage .sensor-chart-wrap,
  .sensor-history-chart:not(.compact),
  html[data-theme] .sensor-history-chart:not(.compact) {
    min-height: 248px !important;
  }

  .sensor-chart-canvas,
  html[data-theme] .sensor-chart-canvas {
    padding-inline: 6px !important;
  }
}

/* Stage 2BI: device-level sensor units, alarm bands, tank capacity, flow conversion, and workflow-ready settings. */
.sensor-device-settings-panel,
html[data-theme] .sensor-device-settings-panel {
  display: grid;
  gap: 12px;
}

.sensor-setting-live-preview,
html[data-theme] .sensor-setting-live-preview {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 72%, transparent);
  border-left: 3px solid var(--sx-green);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sx-panel-soft) 58%, transparent);
}

.sensor-setting-live-preview.warn,
html[data-theme] .sensor-setting-live-preview.warn {
  border-left-color: var(--warning);
}

.sensor-setting-live-preview.danger,
html[data-theme] .sensor-setting-live-preview.danger {
  border-left-color: var(--danger);
}

.sensor-setting-live-preview strong,
.sensor-setting-live-preview b,
html[data-theme] .sensor-setting-live-preview strong,
html[data-theme] .sensor-setting-live-preview b {
  color: var(--sx-text);
}

.sensor-setting-live-preview small,
html[data-theme] .sensor-setting-live-preview small {
  display: block;
  margin-top: 2px;
  color: var(--sx-muted);
  line-height: 1.35;
}

.sensor-settings-grid,
.sensor-setting-subgrid,
html[data-theme] .sensor-settings-grid,
html[data-theme] .sensor-setting-subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sensor-settings-grid.workflow,
html[data-theme] .sensor-settings-grid.workflow {
  align-items: stretch;
}

.sensor-setting-field,
.sensor-setting-check,
html[data-theme] .sensor-setting-field,
html[data-theme] .sensor-setting-check {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 66%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sx-panel) 84%, transparent);
  color: var(--sx-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sensor-setting-field input,
.sensor-setting-field select,
html[data-theme] .sensor-setting-field input,
html[data-theme] .sensor-setting-field select {
  min-height: 36px;
  width: 100%;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 78%, transparent);
  background: var(--sx-bg);
  color: var(--sx-text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
  padding: 7px 9px;
}

.sensor-setting-check,
html[data-theme] .sensor-setting-check {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  text-transform: none;
}

.sensor-setting-check input,
html[data-theme] .sensor-setting-check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--sx-green);
}

.sensor-setting-check strong,
html[data-theme] .sensor-setting-check strong {
  display: block;
  color: var(--sx-text);
  font-size: 13px;
}

.sensor-setting-check small,
html[data-theme] .sensor-setting-check small {
  display: block;
  margin-top: 3px;
  color: var(--sx-muted);
  font-size: 11px;
  line-height: 1.35;
}

.sensor-threshold-editor,
html[data-theme] .sensor-threshold-editor {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 62%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sx-panel-soft) 44%, transparent);
}

.sensor-threshold-head,
html[data-theme] .sensor-threshold-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  align-items: center;
  gap: 10px;
}

.sensor-threshold-head strong,
html[data-theme] .sensor-threshold-head strong {
  color: var(--sx-text);
}

.sensor-threshold-head small,
.sensor-setting-note,
html[data-theme] .sensor-threshold-head small,
html[data-theme] .sensor-setting-note {
  display: block;
  color: var(--sx-muted);
  font-size: 11px;
  line-height: 1.35;
}

.sensor-settings-preview,
html[data-theme] .sensor-settings-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sensor-settings-admin-panel,
html[data-theme] .sensor-settings-admin-panel {
  overflow: hidden;
}

.sensor-settings-device-list,
html[data-theme] .sensor-settings-device-list {
  display: grid;
  gap: 0;
}

.sensor-settings-device-row,
html[data-theme] .sensor-settings-device-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, .55fr) minmax(220px, 1fr) minmax(150px, .75fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-top: 1px solid color-mix(in srgb, var(--sx-line) 58%, transparent);
  box-shadow: inset 3px 0 0 var(--sx-green);
  background: color-mix(in srgb, var(--sx-panel) 88%, transparent);
}

.sensor-settings-device-row.warn,
html[data-theme] .sensor-settings-device-row.warn {
  box-shadow: inset 3px 0 0 var(--warning);
}

.sensor-settings-device-row.danger,
html[data-theme] .sensor-settings-device-row.danger {
  box-shadow: inset 3px 0 0 var(--danger);
}

.sensor-settings-device-main,
html[data-theme] .sensor-settings-device-main {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.sensor-settings-device-row span,
.sensor-settings-device-row strong,
html[data-theme] .sensor-settings-device-row span,
html[data-theme] .sensor-settings-device-row strong {
  color: var(--sx-text);
  font-weight: 850;
}

.sensor-settings-device-row small,
html[data-theme] .sensor-settings-device-row small {
  display: block;
  margin-top: 2px;
  color: var(--sx-muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .sensor-settings-device-row,
  html[data-theme] .sensor-settings-device-row {
    grid-template-columns: 1fr;
  }

  .sensor-settings-grid,
  .sensor-setting-subgrid,
  .sensor-settings-preview,
  html[data-theme] .sensor-settings-grid,
  html[data-theme] .sensor-setting-subgrid,
  html[data-theme] .sensor-settings-preview {
    grid-template-columns: 1fr;
  }

  .sensor-threshold-head,
  html[data-theme] .sensor-threshold-head {
    grid-template-columns: 1fr;
  }
}

/* Stage 2BJ: visual inspection cleanup. Keep telemetry controls obvious without turning the page into button soup. */
.sensor-insight-page .sensor-insight-summary.sleek-status-strip,
html[data-theme] .sensor-insight-page .sensor-insight-summary.sleek-status-strip {
  border-radius: 8px !important;
  background: var(--sx-panel) !important;
  box-shadow: none !important;
}

.sensor-insight-page .sensor-insight-summary .sleek-status-segment,
html[data-theme] .sensor-insight-page .sensor-insight-summary .sleek-status-segment {
  min-height: 56px !important;
  padding: 10px 14px !important;
}

.sensor-insight-page .sensor-insight-summary .sleek-status-segment strong,
html[data-theme] .sensor-insight-page .sensor-insight-summary .sleek-status-segment strong {
  font-size: 20px !important;
  line-height: 1 !important;
}

.sensor-insight-page .sensor-insight-summary .sleek-status-segment.good strong,
html[data-theme] .sensor-insight-page .sensor-insight-summary .sleek-status-segment.good strong {
  color: var(--sx-green) !important;
  font-size: 18px !important;
}

.sensor-control-dock,
html[data-theme] .sensor-control-dock {
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 9px !important;
  background: color-mix(in srgb, var(--sx-panel) 92%, var(--sx-bg)) !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
}

.sensor-control-dock-row,
html[data-theme] .sensor-control-dock-row {
  display: grid !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.sensor-control-dock-top,
html[data-theme] .sensor-control-dock-top {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.75fr) !important;
}

.sensor-control-dock-bottom,
html[data-theme] .sensor-control-dock-bottom {
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr) !important;
}

.sensor-control-block,
html[data-theme] .sensor-control-block {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--sx-line) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sx-panel-soft) 54%, transparent);
}

.sensor-control-block-head,
.sensor-control-group,
html[data-theme] .sensor-control-block-head,
html[data-theme] .sensor-control-group {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.sensor-control-block-head span,
.sensor-control-group > span,
html[data-theme] .sensor-control-block-head span,
html[data-theme] .sensor-control-group > span {
  color: color-mix(in srgb, var(--sx-muted) 72%, var(--sx-green)) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .02em !important;
  text-transform: uppercase;
}

.sensor-control-block-head small,
html[data-theme] .sensor-control-block-head small {
  color: var(--sx-muted);
  font-size: 11px;
  line-height: 1.25;
}

.sensor-chip-row,
.sensor-sort-buttons,
.sensor-control-dock .segmented-control,
html[data-theme] .sensor-chip-row,
html[data-theme] .sensor-sort-buttons,
html[data-theme] .sensor-control-dock .segmented-control {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}

.sensor-control-dock .quick-filter,
.sensor-control-dock .segmented-control button,
.sensor-control-dock .sensor-sort-buttons button,
html[data-theme] .sensor-control-dock .quick-filter,
html[data-theme] .sensor-control-dock .segmented-control button,
html[data-theme] .sensor-control-dock .sensor-sort-buttons button {
  min-height: 28px !important;
  padding: 4px 9px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--sx-line) 80%, transparent) !important;
  background: var(--sx-panel) !important;
  color: var(--sx-text) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}

.sensor-control-dock .quick-filter b,
html[data-theme] .sensor-control-dock .quick-filter b {
  margin-left: 5px;
  color: currentColor;
}

.sensor-control-dock .quick-filter.active,
.sensor-control-dock .quick-filter:hover,
.sensor-control-dock .segmented-control button.active,
.sensor-control-dock .segmented-control button:hover,
.sensor-control-dock .sensor-sort-buttons button.active,
.sensor-control-dock .sensor-sort-buttons button:hover,
html[data-theme] .sensor-control-dock .quick-filter.active,
html[data-theme] .sensor-control-dock .quick-filter:hover,
html[data-theme] .sensor-control-dock .segmented-control button.active,
html[data-theme] .sensor-control-dock .segmented-control button:hover,
html[data-theme] .sensor-control-dock .sensor-sort-buttons button.active,
html[data-theme] .sensor-control-dock .sensor-sort-buttons button:hover {
  border-color: color-mix(in srgb, var(--sx-green) 54%, var(--sx-line)) !important;
  background: color-mix(in srgb, var(--sx-green-faint) 88%, var(--sx-panel)) !important;
  color: var(--sx-green) !important;
}

.sensor-control-dock .custom-range,
html[data-theme] .sensor-control-dock .custom-range {
  display: grid !important;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, .8fr) minmax(82px, 1fr) minmax(82px, 1fr) minmax(54px, auto);
  gap: 6px;
  align-items: end;
  margin-left: 0 !important;
}

.sensor-control-dock .custom-range > span,
html[data-theme] .sensor-control-dock .custom-range > span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.sensor-control-dock .custom-range label,
html[data-theme] .sensor-control-dock .custom-range label {
  min-width: 0;
  display: grid !important;
  gap: 4px;
  color: var(--sx-muted) !important;
  font-size: 10px !important;
  font-weight: 850;
}

.sensor-control-dock .custom-range label small,
html[data-theme] .sensor-control-dock .custom-range label small {
  color: var(--sx-muted);
  font-size: 10px;
  line-height: 1;
}

.sensor-control-dock .custom-range input,
html[data-theme] .sensor-control-dock .custom-range input {
  width: 100%;
  min-width: 0;
  min-height: 30px !important;
  max-width: none !important;
  border-radius: 7px !important;
}

.sensor-control-dock .custom-range .btn,
html[data-theme] .sensor-control-dock .custom-range .btn {
  min-height: 30px;
  min-width: 54px;
  padding-left: 8px !important;
  padding-right: 8px !important;
  align-self: end;
  white-space: nowrap;
}

.sensor-control-note,
html[data-theme] .sensor-control-note {
  margin: 0 !important;
  color: var(--sx-muted) !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.sensor-chart-stage-head,
html[data-theme] .sensor-chart-stage-head {
  grid-template-columns: minmax(0, 1fr) minmax(152px, 210px) !important;
  padding: 16px 18px 8px !important;
  border-bottom: 1px solid color-mix(in srgb, var(--sx-line) 42%, transparent);
}

.sensor-selected-copy h3,
html[data-theme] .sensor-selected-copy h3 {
  font-size: 20px !important;
}

.sensor-selected-copy small,
html[data-theme] .sensor-selected-copy small {
  max-width: 680px !important;
}

.sensor-live-reading,
html[data-theme] .sensor-live-reading {
  min-width: 0 !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--sx-panel-soft) 70%, transparent) !important;
}

.sensor-live-reading.danger,
html[data-theme] .sensor-live-reading.danger {
  background: color-mix(in srgb, var(--danger) 9%, var(--sx-panel)) !important;
}

.sensor-live-reading.warn,
html[data-theme] .sensor-live-reading.warn {
  background: color-mix(in srgb, var(--warning) 10%, var(--sx-panel)) !important;
}

.sensor-live-reading strong,
html[data-theme] .sensor-live-reading strong {
  font-size: clamp(24px, 2.4vw, 36px) !important;
}

.sensor-chart-canvas,
html[data-theme] .sensor-chart-canvas {
  margin: 12px 12px 0 !important;
  padding: 10px 10px 6px !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--sx-panel-soft) 62%, transparent) !important;
}

.sensor-side-card,
html[data-theme] .sensor-side-card,
.workbench-side .context-card,
html[data-theme] .workbench-side .context-card {
  border-radius: 8px !important;
  box-shadow: none !important;
}

.workbench-chrome,
html[data-theme] .workbench-chrome {
  min-width: 0;
}

.workbench-title h3,
html[data-theme] .workbench-title h3 {
  letter-spacing: 0 !important;
}

.panel,
html[data-theme] .panel,
.table-wrap,
html[data-theme] .table-wrap {
  border-radius: 8px !important;
}

.page-tabs,
.filter-bar,
.quick-filter-bar,
html[data-theme] .page-tabs,
html[data-theme] .filter-bar,
html[data-theme] .quick-filter-bar {
  border-radius: 8px !important;
}

@media (max-width: 1180px) {
  .sensor-control-dock-top,
  .sensor-control-dock-bottom,
  html[data-theme] .sensor-control-dock-top,
  html[data-theme] .sensor-control-dock-bottom {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 700px) {
  .sensor-insight-page .sensor-insight-summary.sleek-status-strip,
  html[data-theme] .sensor-insight-page .sensor-insight-summary.sleek-status-strip {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .sensor-control-dock,
  html[data-theme] .sensor-control-dock {
    padding: 8px !important;
  }

  .sensor-control-block,
  html[data-theme] .sensor-control-block {
    padding: 9px !important;
  }

  .sensor-chip-row,
  .sensor-sort-buttons,
  .sensor-control-dock .segmented-control,
  html[data-theme] .sensor-chip-row,
  html[data-theme] .sensor-sort-buttons,
  html[data-theme] .sensor-control-dock .segmented-control {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100%;
  }

  .sensor-control-dock .quick-filter,
  .sensor-control-dock .segmented-control button,
  .sensor-control-dock .sensor-sort-buttons button,
  html[data-theme] .sensor-control-dock .quick-filter,
  html[data-theme] .sensor-control-dock .segmented-control button,
  html[data-theme] .sensor-control-dock .sensor-sort-buttons button {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .sensor-control-dock .custom-range,
  html[data-theme] .sensor-control-dock .custom-range {
    grid-template-columns: 1fr 1fr;
  }

  .sensor-control-dock .custom-range > span,
  .sensor-control-dock .custom-range .btn,
  html[data-theme] .sensor-control-dock .custom-range > span,
  html[data-theme] .sensor-control-dock .custom-range .btn {
    grid-column: 1 / -1;
  }

  .sensor-chart-stage-head,
  html[data-theme] .sensor-chart-stage-head {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 13px 12px 8px !important;
  }

  .sensor-live-reading,
  html[data-theme] .sensor-live-reading {
    justify-items: start !important;
  }
}

/* Stage 2BK: client-first clarity pass. Keep capability, reduce first-screen noise. */
.client-pane-menu-section,
html[data-theme] .client-pane-menu-section,
.client-pane-action-section,
html[data-theme] .client-pane-action-section {
  padding-top: 2px !important;
}

.client-pane-menu,
html[data-theme] .client-pane-menu {
  display: grid;
  gap: 2px;
}

.client-pane-menu .pane-row,
html[data-theme] .client-pane-menu .pane-row {
  min-height: 36px !important;
  padding: 8px 10px !important;
  border-color: transparent !important;
  background: transparent !important;
  border-radius: 7px !important;
  font-size: 13px !important;
}

.client-pane-menu .pane-row:hover,
.client-pane-menu .pane-row:focus-visible,
.client-pane-menu .pane-row.active,
html[data-theme] .client-pane-menu .pane-row:hover,
html[data-theme] .client-pane-menu .pane-row:focus-visible,
html[data-theme] .client-pane-menu .pane-row.active {
  border-color: color-mix(in srgb, var(--sx-green) 40%, var(--sx-line)) !important;
  background: color-mix(in srgb, var(--sx-green-faint) 72%, transparent) !important;
}

.client-focus-panel,
html[data-theme] .client-focus-panel {
  padding: 0 !important;
  overflow: hidden;
  border-left: 3px solid var(--sx-green) !important;
  background: linear-gradient(180deg, var(--sx-panel), color-mix(in srgb, var(--sx-panel-soft) 70%, transparent)) !important;
}

.client-focus-head,
html[data-theme] .client-focus-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 17px 18px 12px;
}

.client-focus-head h3,
html[data-theme] .client-focus-head h3 {
  margin: 2px 0 6px !important;
  font-size: clamp(23px, 2vw, 31px) !important;
  line-height: 1.08 !important;
}

.client-focus-head p:not(.eyebrow),
html[data-theme] .client-focus-head p:not(.eyebrow) {
  margin: 0 !important;
  max-width: 820px;
  color: var(--sx-muted) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

.client-focus-meta,
html[data-theme] .client-focus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.client-focus-actions,
html[data-theme] .client-focus-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.client-focus-actions .btn,
html[data-theme] .client-focus-actions .btn {
  min-height: 38px !important;
}

.client-focus-strip.sleek-status-strip,
html[data-theme] .client-focus-strip.sleek-status-strip {
  margin: 0 !important;
  border-width: 1px 0 0 !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--sx-panel-soft) 48%, transparent) !important;
}

.client-focus-strip .sleek-status-segment,
html[data-theme] .client-focus-strip .sleek-status-segment {
  min-height: 58px !important;
  padding: 10px 14px !important;
}

.client-attention-panel .empty,
html[data-theme] .client-attention-panel .empty {
  min-height: 74px !important;
  align-content: center;
  color: var(--sx-muted) !important;
}

.client-simple-toolbar,
html[data-theme] .client-simple-toolbar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px !important;
  background: color-mix(in srgb, var(--sx-panel) 96%, transparent) !important;
}

.client-simple-toolbar .toolbar-copy,
html[data-theme] .client-simple-toolbar .toolbar-copy {
  min-width: 0;
}

.client-simple-toolbar .toolbar-copy span,
html[data-theme] .client-simple-toolbar .toolbar-copy span {
  display: block;
  margin-top: 2px;
  font-size: 12px !important;
}

.client-report-helper,
html[data-theme] .client-report-helper {
  padding-bottom: 12px !important;
}

.client-report-steps,
html[data-theme] .client-report-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.client-report-steps .pane-shortcut-row,
html[data-theme] .client-report-steps .pane-shortcut-row {
  min-height: 66px !important;
}

.client-sensor-control-dock,
html[data-theme] .client-sensor-control-dock {
  gap: 8px !important;
  padding: 10px !important;
}

.client-more-controls,
html[data-theme] .client-more-controls {
  border: 1px solid color-mix(in srgb, var(--sx-line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--sx-panel-soft) 42%, transparent);
}

.client-more-controls summary,
html[data-theme] .client-more-controls summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--sx-text);
  font-weight: 850;
  list-style: none;
}

.client-more-controls summary::-webkit-details-marker {
  display: none;
}

.client-more-controls summary::after {
  content: "+";
  float: right;
  color: var(--sx-muted);
}

.client-more-controls[open] summary::after {
  content: "-";
}

.client-more-controls .sensor-control-dock-row,
html[data-theme] .client-more-controls .sensor-control-dock-row {
  padding: 0 10px 10px;
}

.client-more-controls:not([open]) .sensor-control-dock-row,
html[data-theme] .client-more-controls:not([open]) .sensor-control-dock-row {
  display: none !important;
}

.client-report-strip.quick-filter-bar,
html[data-theme] .client-report-strip.quick-filter-bar {
  justify-content: flex-start !important;
}

@media (max-width: 980px) {
  .client-focus-head,
  html[data-theme] .client-focus-head,
  .client-report-steps,
  html[data-theme] .client-report-steps {
    grid-template-columns: 1fr;
  }

  .client-focus-actions,
  html[data-theme] .client-focus-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .client-simple-toolbar,
  html[data-theme] .client-simple-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .client-focus-strip.sleek-status-strip,
  html[data-theme] .client-focus-strip.sleek-status-strip {
    grid-template-columns: 1fr !important;
  }
}

/* Stage 2BL: affordance and alignment pass.
   Passive states must not look like buttons; real actions stay visibly clickable. */
.badge.passive-badge,
.passive-badge,
.state-label,
html[data-theme] .badge.passive-badge,
html[data-theme] .passive-badge,
html[data-theme] .state-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--sx-muted) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  white-space: normal !important;
  cursor: default !important;
  pointer-events: none !important;
}

.passive-badge::before,
.state-label::before,
html[data-theme] .passive-badge::before,
html[data-theme] .state-label::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.75;
}

.badge.passive-badge.good,
.passive-badge.good,
.passive-badge.healthy,
.passive-badge.ready,
.passive-badge.active,
.passive-badge.allowed,
.state-label.good,
html[data-theme] .badge.passive-badge.good,
html[data-theme] .passive-badge.good,
html[data-theme] .passive-badge.healthy,
html[data-theme] .passive-badge.ready,
html[data-theme] .passive-badge.active,
html[data-theme] .passive-badge.allowed,
html[data-theme] .state-label.good {
  color: var(--sx-green) !important;
  background: transparent !important;
}

.badge.passive-badge.warn,
.passive-badge.warn,
.passive-badge.warning,
.passive-badge.watch,
.state-label.warn,
html[data-theme] .badge.passive-badge.warn,
html[data-theme] .passive-badge.warn,
html[data-theme] .passive-badge.warning,
html[data-theme] .passive-badge.watch,
html[data-theme] .state-label.warn {
  color: var(--sx-warning) !important;
  background: transparent !important;
}

.badge.passive-badge.danger,
.passive-badge.danger,
.passive-badge.critical,
.passive-badge.attention,
.state-label.danger,
html[data-theme] .badge.passive-badge.danger,
html[data-theme] .passive-badge.danger,
html[data-theme] .passive-badge.critical,
html[data-theme] .passive-badge.attention,
html[data-theme] .state-label.danger {
  color: var(--sx-danger) !important;
  background: transparent !important;
}

.workbench-chrome-actions .passive-badge,
.panel-head .passive-badge,
html[data-theme] .workbench-chrome-actions .passive-badge,
html[data-theme] .panel-head .passive-badge {
  justify-content: flex-end !important;
  text-align: right;
  white-space: nowrap !important;
}

.sensor-value-row,
html[data-theme] .sensor-value-row {
  grid-template-columns:
    minmax(230px, 1.65fr)
    minmax(124px, 0.7fr)
    minmax(118px, 0.58fr)
    minmax(66px, 0.32fr)
    minmax(88px, 0.4fr)
    minmax(112px, 0.44fr)
    minmax(188px, max-content) !important;
  gap: 12px !important;
  align-items: center !important;
  min-height: 72px !important;
  padding: 10px 14px !important;
  border-radius: 0 !important;
  border-width: 0 0 1px !important;
  background: transparent !important;
}

.sensor-value-row:hover,
html[data-theme] .sensor-value-row:hover {
  background: color-mix(in srgb, var(--sx-green-faint) 28%, transparent) !important;
}

.sensor-value-main,
html[data-theme] .sensor-value-main {
  min-height: 48px;
  padding: 0 !important;
}

.sensor-value-main:hover strong,
.sensor-value-main:focus-visible strong,
html[data-theme] .sensor-value-main:hover strong,
html[data-theme] .sensor-value-main:focus-visible strong {
  color: var(--sx-green) !important;
}

.sensor-value-reading,
.sensor-value-mini,
.sensor-value-health,
html[data-theme] .sensor-value-reading,
html[data-theme] .sensor-value-mini,
html[data-theme] .sensor-value-health {
  align-content: center !important;
}

.sensor-value-health b,
.sensor-value-updated b,
html[data-theme] .sensor-value-health b,
html[data-theme] .sensor-value-updated b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sensor-value-updated,
html[data-theme] .sensor-value-updated {
  justify-items: start;
}

.sensor-value-actions,
html[data-theme] .sensor-value-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  min-width: 188px;
}

.sensor-value-actions .state-label,
html[data-theme] .sensor-value-actions .state-label {
  min-width: 52px !important;
  justify-content: flex-end !important;
  text-align: right;
  white-space: nowrap !important;
}

.sensor-value-actions .btn.small,
html[data-theme] .sensor-value-actions .btn.small {
  flex: 0 0 auto;
  min-width: 68px !important;
}

.stage2a-queue-row,
html[data-theme] .stage2a-queue-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, max-content) !important;
  gap: 18px !important;
  align-items: center !important;
  padding: 12px 14px !important;
}

.stage2a-queue-actions,
html[data-theme] .stage2a-queue-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  min-width: 150px;
}

.stage2a-queue-actions .btn.small,
html[data-theme] .stage2a-queue-actions .btn.small {
  min-width: 64px !important;
}

.workflow-jobs-clean-queue .stage2a-queue-row,
.workflow-rules-clean-queue .stage2a-queue-row,
.handover-sites .stage2a-queue-row,
.handover-devices .stage2a-queue-row,
.handover-workflows .stage2a-queue-row,
html[data-theme] .workflow-jobs-clean-queue .stage2a-queue-row,
html[data-theme] .workflow-rules-clean-queue .stage2a-queue-row,
html[data-theme] .handover-sites .stage2a-queue-row,
html[data-theme] .handover-devices .stage2a-queue-row,
html[data-theme] .handover-workflows .stage2a-queue-row {
  min-height: 64px !important;
}

.simple-choice-row,
html[data-theme] .simple-choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--sx-line);
}

.simple-choice,
html[data-theme] .simple-choice {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--sx-line);
  border-radius: var(--sx-radius-sm);
  background: color-mix(in srgb, var(--sx-panel-soft) 74%, transparent);
}

.simple-choice span,
html[data-theme] .simple-choice span {
  color: var(--sx-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.simple-choice strong,
html[data-theme] .simple-choice strong {
  min-width: 0;
  color: var(--sx-text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.advanced-details,
html[data-theme] .advanced-details {
  border-top: 1px solid var(--sx-line);
  background: transparent;
}

.advanced-details:not([open]) > :not(summary),
html[data-theme] .advanced-details:not([open]) > :not(summary) {
  display: none !important;
}

.advanced-details > summary,
html[data-theme] .advanced-details > summary {
  cursor: pointer;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--sx-text);
  font-size: 12px;
  font-weight: 860;
  list-style: none;
}

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

.advanced-details > summary::after,
html[data-theme] .advanced-details > summary::after {
  content: "+";
  color: var(--sx-muted);
  font-size: 16px;
}

.advanced-details[open] > summary::after,
html[data-theme] .advanced-details[open] > summary::after {
  content: "-";
}

.report-advanced-details .range-preset-strip,
html[data-theme] .report-advanced-details .range-preset-strip {
  border-top: 1px solid var(--sx-line);
}

.handover-advanced-details,
html[data-theme] .handover-advanced-details {
  margin-top: 12px;
  border: 1px solid var(--sx-line);
  border-radius: var(--sx-radius);
  overflow: hidden;
}

.handover-advanced-details .handover-devices,
html[data-theme] .handover-advanced-details .handover-devices {
  border: 0 !important;
  border-radius: 0 !important;
}

.report-row .row-actions,
html[data-theme] .report-row .row-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

.btn,
button.btn,
.section-link-action,
.quick-filter,
.range-preset,
.pane-row,
html[data-theme] .btn,
html[data-theme] button.btn,
html[data-theme] .section-link-action,
html[data-theme] .quick-filter,
html[data-theme] .range-preset,
html[data-theme] .pane-row {
  cursor: pointer !important;
}

@media (max-width: 1320px) {
  .sensor-value-row,
  html[data-theme] .sensor-value-row {
    grid-template-columns:
      minmax(220px, 1.5fr)
      minmax(124px, 0.68fr)
      minmax(108px, 0.54fr)
      minmax(70px, 0.34fr)
      minmax(94px, 0.42fr)
      minmax(178px, max-content) !important;
  }

  .sensor-value-updated,
  html[data-theme] .sensor-value-updated {
    display: none !important;
  }
}

@media (max-width: 1100px) {
  .sensor-value-row,
  html[data-theme] .sensor-value-row {
    grid-template-columns: minmax(220px, 1fr) minmax(122px, 0.62fr) minmax(70px, 0.34fr) minmax(92px, 0.42fr) minmax(172px, max-content) !important;
  }

  .sensor-value-mini,
  html[data-theme] .sensor-value-mini,
  html[data-theme] .sensor-value-mini {
    display: none !important;
  }

  .simple-choice-row,
  html[data-theme] .simple-choice-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .sensor-value-row,
  html[data-theme] .sensor-value-row,
  .stage2a-queue-row,
  html[data-theme] .stage2a-queue-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .sensor-value-actions,
  .stage2a-queue-actions,
  html[data-theme] .sensor-value-actions,
  html[data-theme] .stage2a-queue-actions {
    justify-content: flex-start !important;
    min-width: 0;
    flex-wrap: wrap !important;
  }

  .sensor-value-actions .state-label,
  html[data-theme] .sensor-value-actions .state-label {
    justify-content: flex-start !important;
    text-align: left;
  }
}

/* Stage 3A identity governance: readable cards at tablet/mobile widths. */
@media (max-width: 760px) {
  .identity-user-table .access-user-header {
    display: none !important;
  }

  .identity-user-table .identity-user-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 16px !important;
    padding: 16px !important;
    align-items: start !important;
  }

  .identity-user-table .identity-user-row > span {
    grid-column: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .identity-user-table .identity-user-row .identity-person {
    grid-column: 1 / -1 !important;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  .identity-user-table .identity-user-row > span:not(.identity-person)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

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

/* Stage 2CC: keep the full desktop command cluster clear at sidebar widths. */
@media (min-width: 981px) and (max-width: 1360px) {
  .topbar,
  .app-shell.inspector-open .topbar,
  html[data-theme] .topbar,
  html[data-theme] .app-shell.inspector-open .topbar {
    grid-template-columns: minmax(210px, 380px) minmax(34px, 64px) minmax(240px, auto) !important;
  }

  .top-brand,
  html[data-theme] .top-brand {
    max-width: 40px !important;
  }

  .top-brand strong,
  html[data-theme] .top-brand strong {
    display: none !important;
  }
}

/* Stage 2CC: runtime startup, health, and recovery states. */
.runtime-health-banner,
html[data-theme] .runtime-health-banner {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border: 1px solid rgba(230, 180, 72, 0.42);
  border-left: 3px solid #e6b448;
  border-radius: 5px;
  background: rgba(230, 180, 72, 0.08);
  box-sizing: border-box;
}

.runtime-health-banner.danger,
html[data-theme] .runtime-health-banner.danger {
  border-color: rgba(238, 99, 108, 0.46);
  border-left-color: #ee636c;
  background: rgba(238, 99, 108, 0.08);
}

.runtime-health-banner.success,
html[data-theme] .runtime-health-banner.success {
  border-color: rgba(54, 210, 125, 0.42);
  border-left-color: var(--green);
  background: rgba(54, 210, 125, 0.08);
}

.runtime-health-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.runtime-health-copy strong {
  color: var(--text);
  font-size: 13px;
}

.runtime-health-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.runtime-health-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
}

.api-status.online,
html[data-theme] .api-status.online {
  border-color: rgba(54, 210, 125, 0.45) !important;
  color: #d9ffe9 !important;
}

.api-status.offline,
html[data-theme] .api-status.offline {
  border-color: rgba(238, 99, 108, 0.45) !important;
  color: #ffd7da !important;
}

@media (max-width: 700px) {
  .runtime-health-banner,
  html[data-theme] .runtime-health-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .runtime-health-actions,
  html[data-theme] .runtime-health-actions {
    width: 100%;
  }

  .runtime-health-actions .btn,
  html[data-theme] .runtime-health-actions .btn {
    flex: 1 1 0;
  }
}

/* Stage 2CA: console shell cleanup inspired by the read-only Milesight review, rebuilt in Integron-owned UI. */
body[data-stage2ca="console-shell-cleanup"] {
  --topbar-h: 52px;
  --radius: 6px;
  --radius-sm: 5px;
  --sx-radius: 6px;
  --sx-radius-sm: 5px;
  --stage2ca-ink: var(--sx-text, var(--text));
  --stage2ca-muted: var(--sx-muted, var(--muted));
  --stage2ca-line: var(--sx-line, rgba(112, 132, 128, 0.18));
  --stage2ca-soft: color-mix(in srgb, var(--sx-panel-soft, #12191b) 86%, transparent);
}

body[data-stage2ca="console-shell-cleanup"] .topbar,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .topbar {
  min-height: 52px !important;
  padding-block: 7px !important;
}

body[data-stage2ca="console-shell-cleanup"] .workspace-head,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head {
  min-height: 76px;
  align-items: end;
  padding-block: 12px 9px !important;
}

body[data-stage2ca="console-shell-cleanup"] .workspace-head h2,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head h2 {
  font-size: 23px !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
}

body[data-stage2ca="console-shell-cleanup"] .workspace-head p,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head p {
  max-width: 980px;
}

body[data-stage2ca="console-shell-cleanup"] .workspace-actions,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-actions {
  align-self: end;
  gap: 7px !important;
}

body[data-stage2ca="console-shell-cleanup"] .workspace-content,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-content {
  gap: 9px !important;
}

body[data-stage2ca="console-shell-cleanup"] .panel,
body[data-stage2ca="console-shell-cleanup"] .stage2a-primary-queue,
body[data-stage2ca="console-shell-cleanup"] .stage2a-secondary-rail,
body[data-stage2ca="console-shell-cleanup"] .workbench-panel,
body[data-stage2ca="console-shell-cleanup"] .sleek-list-panel,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .panel,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .stage2a-primary-queue,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .stage2a-secondary-rail,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workbench-panel,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .sleek-list-panel {
  border-radius: 6px !important;
  box-shadow: none !important;
}

body[data-stage2ca="console-shell-cleanup"] .panel-head,
body[data-stage2ca="console-shell-cleanup"] .workbench-chrome,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .panel-head,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workbench-chrome {
  min-height: 44px;
  padding: 11px 12px !important;
}

body[data-stage2ca="console-shell-cleanup"] .ops-table th,
body[data-stage2ca="console-shell-cleanup"] .ops-table td,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .ops-table th,
html[data-theme] body[data-stage2ca="console-shell-cleanup"] .ops-table td {
  padding: 8px 10px !important;
}

.stage2ca-console-shell {
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.stage2ca-shell-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
  padding: 0 12px;
}

.stage2ca-rule-grid,
.stage2ca-guard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 0 12px;
}

.stage2ca-rule-card,
.stage2ca-guard-card,
.stage2ca-empty-row,
html[data-theme] .stage2ca-rule-card,
html[data-theme] .stage2ca-guard-card,
html[data-theme] .stage2ca-empty-row {
  min-width: 0;
  border: 1px solid var(--stage2ca-line);
  border-radius: 5px;
  background: var(--stage2ca-soft);
  color: var(--stage2ca-ink);
  box-shadow: none;
}

.stage2ca-rule-card,
.stage2ca-guard-card {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
}

.stage2ca-rule-card strong,
.stage2ca-guard-card strong,
.stage2ca-empty-row strong {
  min-width: 0;
  color: var(--stage2ca-ink);
  overflow-wrap: anywhere;
}

.stage2ca-rule-card p,
.stage2ca-rule-card small,
.stage2ca-guard-card p,
.stage2ca-guard-card span,
.stage2ca-empty-row span {
  min-width: 0;
  margin: 0;
  color: var(--stage2ca-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stage2ca-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr);
  gap: 10px;
  padding: 0 12px;
}

.stage2ca-split > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.stage2ca-split h4 {
  margin: 0;
  color: var(--stage2ca-ink);
  font-size: 12px;
  font-weight: 880;
}

.stage2ca-empty-list {
  display: grid;
  gap: 7px;
}

.stage2ca-empty-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
}

.stage2ca-empty-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stage2ca-empty-row b {
  min-width: 0;
  color: var(--sx-green, var(--green));
  font-size: 11px;
  text-align: left;
  overflow-wrap: anywhere;
}

.stage2ca-safety {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px;
}

.stage2ca-safety span {
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--sx-warning, #e6b956) 44%, var(--stage2ca-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--sx-warning, #e6b956) 9%, transparent);
  color: var(--stage2ca-ink);
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stage2ca-route-cleanup-strip,
html[data-theme] .stage2ca-route-cleanup-strip {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--sx-green, #36d27d) 32%, var(--stage2ca-line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--sx-green, #36d27d) 6%, var(--sx-panel, #101719));
  padding: 10px 12px;
  overflow: hidden;
}

.stage2ca-route-cleanup-strip > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stage2ca-route-cleanup-strip span {
  color: color-mix(in srgb, var(--stage2ca-muted) 76%, var(--sx-green, #36d27d));
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.stage2ca-route-cleanup-strip strong {
  color: var(--stage2ca-ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.stage2ca-route-cleanup-strip small {
  color: var(--stage2ca-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stage2ca-route-cleanup-strip > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

body[data-route="integration-center"] .stage2ca-console-shell {
  order: -1;
}

body[data-route="integration-center"] .console-strip,
body[data-route="workflow-center"] .workflow-jobs-strip,
body[data-route="workflow-rules"] .workflow-rules-strip,
html[data-theme] body[data-route="integration-center"] .console-strip,
html[data-theme] body[data-route="workflow-center"] .workflow-jobs-strip,
html[data-theme] body[data-route="workflow-rules"] .workflow-rules-strip {
  border-radius: 6px !important;
}

@media (max-width: 980px) {
  .stage2ca-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body[data-stage2ca="console-shell-cleanup"] .workspace-head,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head {
    min-height: 0;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .app-shell,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .app-shell {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .workspace,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .topbar,
  body[data-stage2ca="console-shell-cleanup"] .workspace-head,
  body[data-stage2ca="console-shell-cleanup"] .workspace-content,
  body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .topbar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-content,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .topbar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .topbar {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
    min-height: 0 !important;
  }

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

  body[data-stage2ca="console-shell-cleanup"] .top-brand,
  body[data-stage2ca="console-shell-cleanup"] .api-status,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .top-brand,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .api-status {
    display: none !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .top-actions,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .top-actions {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-self: start !important;
    min-height: 42px !important;
    height: 42px !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .top-actions > *,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .top-actions > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .user-switcher,
  body[data-stage2ca="console-shell-cleanup"] .user-switch-button,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .user-switcher,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .user-switch-button {
    width: 128px !important;
    max-width: 128px !important;
    flex: 0 1 128px !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: auto !important;
    flex: 1 1 auto !important;
    max-width: none !important;
  }

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

  body[data-stage2ca="console-shell-cleanup"] .workspace-head > div,
  body[data-stage2ca="console-shell-cleanup"] .workspace-head p,
  body[data-stage2ca="console-shell-cleanup"] #workspaceSubtitle,
  body[data-stage2ca="console-shell-cleanup"] .workspace-head h2,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head > div,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head p,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] #workspaceSubtitle,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .workspace-head h2 {
    min-width: 0 !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !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: 1fr !important;
    justify-items: stretch !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"] .quick-filter-buttons,
  body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-buttons,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-bar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter-label,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-label {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter-buttons,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter-buttons {
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  body[data-stage2ca="console-shell-cleanup"] .quick-filter,
  html[data-theme] body[data-stage2ca="console-shell-cleanup"] .quick-filter {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: center !important;
  }

  .stage2ca-route-cleanup-strip,
  html[data-theme] .stage2ca-route-cleanup-strip {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .stage2ca-route-cleanup-strip > div:last-child {
    justify-content: flex-start;
  }

  .stage2ca-rule-grid,
  .stage2ca-guard-grid,
  .stage2ca-shell-strip {
    grid-template-columns: 1fr;
  }
}

.badge.passive-badge,
html[data-theme] .badge.passive-badge {
  display: inline !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  white-space: normal !important;
}

.badge.passive-badge::before,
html[data-theme] .badge.passive-badge::before {
  display: inline-block;
  vertical-align: 0.08em;
}

.state-label,
html[data-theme] .state-label {
  display: inline-flex !important;
}

/* Stage 2BM: full visible-surface cleanup.
   Keep high-scale admin surfaces scannable while preserving the current green/white/dark identity. */
.entity-name-cell,
html[data-theme] .entity-name-cell {
  max-width: 100%;
}

.entity-name-cell > strong,
html[data-theme] .entity-name-cell > strong {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.entity-name-cell .subtle,
html[data-theme] .entity-name-cell .subtle {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.metric,
html[data-theme] .metric,
.mini-kpi,
html[data-theme] .mini-kpi {
  min-width: 0 !important;
  overflow: hidden;
}

.metric strong,
.metric small,
.mini-kpi strong,
.mini-kpi span,
html[data-theme] .metric strong,
html[data-theme] .metric small,
html[data-theme] .mini-kpi strong,
html[data-theme] .mini-kpi span {
  max-width: 100%;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.access-setup-details,
html[data-theme] .access-setup-details {
  background: color-mix(in srgb, var(--sx-panel-soft) 72%, transparent) !important;
}

.access-setup-details > summary,
html[data-theme] .access-setup-details > summary {
  color: var(--sx-text) !important;
}

.access-setup-details .access-capability-panel,
html[data-theme] .access-setup-details .access-capability-panel {
  margin-top: 10px;
}

.selected-access-panel .access-template-grid,
.selected-access-panel .access-bundle-grid,
html[data-theme] .selected-access-panel .access-template-grid,
html[data-theme] .selected-access-panel .access-bundle-grid {
  grid-template-columns: 1fr !important;
}

.selected-access-panel .access-template-card,
.selected-access-panel .access-bundle-card,
html[data-theme] .selected-access-panel .access-template-card,
html[data-theme] .selected-access-panel .access-bundle-card {
  min-height: auto !important;
}

@media (max-width: 700px) {
  :root {
    --rail: 100vw !important;
    --module-pane: 0px !important;
  }

  body,
  html[data-theme] body {
    overflow-x: hidden;
  }

  .app-shell,
  html[data-theme] .app-shell,
  .workspace,
  html[data-theme] .workspace,
  .workspace-content,
  html[data-theme] .workspace-content {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .topbar,
  html[data-theme] .topbar,
  .workspace-actions,
  html[data-theme] .workspace-actions,
  .top-actions,
  html[data-theme] .top-actions {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .main-nav,
  html[data-theme] .main-nav {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .console-left,
  html[data-theme] .console-left,
  .sidebar,
  html[data-theme] .sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .console-left-body,
  html[data-theme] .console-left-body {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100vw !important;
    height: 58px !important;
    overflow: visible !important;
  }

  .sidebar,
  html[data-theme] .sidebar {
    position: absolute !important;
    inset: 0 !important;
    height: 58px !important;
  }

  .nav-btn,
  html[data-theme] .nav-btn {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
  }

  .nav-count,
  html[data-theme] .nav-count {
    right: 0 !important;
  }

  .main-nav,
  html[data-theme] .main-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-inline: 8px !important;
  }

  .main-nav .nav-btn,
  html[data-theme] .main-nav .nav-btn {
    display: none !important;
    flex: 0 0 38px !important;
  }

  .main-nav .nav-btn.active,
  .main-nav .nav-btn[data-route="dashboard"],
  .main-nav .nav-btn[data-route="sites"],
  .main-nav .nav-btn[data-route="devices"],
  .main-nav .nav-btn[data-route="tickets"],
  .main-nav .nav-btn[data-route="users-access"],
  .main-nav .nav-btn[data-route="my-account"],
  html[data-theme] .main-nav .nav-btn.active,
  html[data-theme] .main-nav .nav-btn[data-route="dashboard"],
  html[data-theme] .main-nav .nav-btn[data-route="sites"],
  html[data-theme] .main-nav .nav-btn[data-route="devices"],
  html[data-theme] .main-nav .nav-btn[data-route="tickets"],
  html[data-theme] .main-nav .nav-btn[data-route="users-access"],
  html[data-theme] .main-nav .nav-btn[data-route="my-account"] {
    display: grid !important;
  }
}

/* Stage 2BF: sensor row alignment and inspector-first actions. */
.sensor-value-row,
html[data-theme] .sensor-value-row {
  grid-template-columns:
    minmax(280px, 1.7fr)
    minmax(132px, 0.56fr)
    minmax(112px, 0.42fr)
    minmax(64px, 0.22fr)
    minmax(88px, 0.3fr)
    minmax(108px, 0.34fr)
    minmax(84px, max-content) !important;
  column-gap: 12px !important;
  cursor: pointer;
}

.sensor-value-row:focus-visible,
.sensor-insight-row:focus-visible,
html[data-theme] .sensor-value-row:focus-visible,
html[data-theme] .sensor-insight-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sx-green) 72%, transparent);
  outline-offset: -2px;
}

.sensor-value-main,
html[data-theme] .sensor-value-main,
.sensor-insight-open,
html[data-theme] .sensor-insight-open {
  pointer-events: none;
}

.sensor-value-mini,
html[data-theme] .sensor-value-mini {
  justify-self: stretch !important;
}

.sensor-value-mini .sensor-history-chart.compact,
html[data-theme] .sensor-value-mini .sensor-history-chart.compact {
  width: 100%;
}

.sensor-value-actions,
html[data-theme] .sensor-value-actions {
  min-width: 84px !important;
  justify-content: flex-end !important;
}

.sensor-value-actions .btn.small,
html[data-theme] .sensor-value-actions .btn.small {
  min-width: 78px !important;
}

.sensor-insight-row,
html[data-theme] .sensor-insight-row {
  grid-template-columns:
    minmax(220px, 1.3fr)
    minmax(112px, 0.42fr)
    minmax(96px, 0.32fr)
    minmax(150px, 0.72fr)
    minmax(86px, max-content) !important;
  column-gap: 12px !important;
  cursor: pointer;
}

.sensor-insight-open,
html[data-theme] .sensor-insight-open {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
}

.sensor-insight-actions,
html[data-theme] .sensor-insight-actions {
  justify-content: flex-end !important;
  min-width: 86px !important;
}

.sensor-insight-actions .btn.small,
html[data-theme] .sensor-insight-actions .btn.small {
  min-width: 82px !important;
}

@media (max-width: 1320px) {
  .sensor-value-row,
  html[data-theme] .sensor-value-row {
    grid-template-columns:
      minmax(250px, 1.54fr)
      minmax(126px, 0.52fr)
      minmax(104px, 0.42fr)
      minmax(64px, 0.24fr)
      minmax(88px, 0.32fr)
      minmax(84px, max-content) !important;
  }

  .sensor-value-updated,
  html[data-theme] .sensor-value-updated {
    display: none !important;
  }
}

@media (max-width: 780px) {
  .sensor-value-row,
  html[data-theme] .sensor-value-row,
  .sensor-insight-row,
  html[data-theme] .sensor-insight-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .sensor-value-reading,
  .sensor-value-mini,
  .sensor-value-health,
  .sensor-value-actions,
  .sensor-insight-spark,
  .sensor-insight-reading,
  .sensor-row-range,
  .sensor-insight-actions,
  html[data-theme] .sensor-value-reading,
  html[data-theme] .sensor-value-mini,
  html[data-theme] .sensor-value-health,
  html[data-theme] .sensor-value-actions,
  html[data-theme] .sensor-insight-spark,
  html[data-theme] .sensor-insight-reading,
  html[data-theme] .sensor-row-range,
  html[data-theme] .sensor-insight-actions {
    grid-column: 1 / -1 !important;
    justify-self: stretch !important;
  }

  .sensor-value-actions,
  .sensor-insight-actions,
  html[data-theme] .sensor-value-actions,
  html[data-theme] .sensor-insight-actions {
    justify-content: flex-start !important;
  }
}

@media (max-width: 1120px) {
  .sensor-value-row,
  html[data-theme] .sensor-value-row,
  .sensor-insight-row,
  html[data-theme] .sensor-insight-row {
    grid-template-columns: minmax(240px, 1fr) minmax(132px, 0.48fr) minmax(96px, max-content) !important;
  }

  .sensor-value-health,
  .sensor-value-mini,
  .sensor-row-range,
  html[data-theme] .sensor-value-health,
  html[data-theme] .sensor-value-mini,
  html[data-theme] .sensor-row-range {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .sensor-value-row,
  html[data-theme] .sensor-value-row,
  .sensor-insight-row,
  html[data-theme] .sensor-insight-row {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .sensor-value-row > *,
  .sensor-insight-row > *,
  html[data-theme] .sensor-value-row > *,
  html[data-theme] .sensor-insight-row > * {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }

  .sensor-history-chart,
  .sensor-history-chart svg,
  .sensor-value-mini svg,
  .sensor-insight-spark svg,
  html[data-theme] .sensor-history-chart,
  html[data-theme] .sensor-history-chart svg,
  html[data-theme] .sensor-value-mini svg,
  html[data-theme] .sensor-insight-spark svg {
    width: 100% !important;
    max-width: 100% !important;
  }

  .sensor-value-actions,
  .sensor-insight-actions,
  html[data-theme] .sensor-value-actions,
  html[data-theme] .sensor-insight-actions {
    min-width: 0 !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Stage 3A final responsive identity-card override. */
@media (max-width: 760px) {
  .identity-user-table .access-user-header {
    display: none !important;
  }

  html body .identity-user-table .identity-user-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 16px !important;
    padding: 16px !important;
    align-items: start !important;
  }

  html body .identity-user-table .identity-user-row > span {
    grid-column: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  html body .identity-user-table .identity-user-row .identity-person {
    grid-column: 1 / -1 !important;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  html body .identity-user-table .identity-user-row > span:not(.identity-person)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

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