@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/Vazirmatn-33.0.3-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Vazirmatn", "IRANSans", "Segoe UI", Roboto, "Helvetica Neue", Arial, Tahoma, sans-serif;
  color: #172033;
  background: #f4f6fb;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-subtle: #f8faff;
  --surface-muted: #eef2f8;
  --line: #e3e8f1;
  --line-strong: #cbd4e3;
  --ink: #172033;
  --ink-soft: #34415a;
  --muted: #6d7890;
  --muted-2: #99a4b8;
  --nav: #111827;
  --nav-hover: #1c2740;
  --nav-active: #253252;
  --primary: #3d5af1;
  --primary-hover: #304be0;
  --primary-soft: #eef1ff;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warn: #9a6700;
  --warn-soft: #fffaeb;
  --danger: #b42318;
  --danger-hover: #912018;
  --danger-soft: #fef3f2;
  --focus: #3d5af1;
  --focus-halo: #ffffff;
  --primary-active: #263bc2;
  --danger-border: #f1b5b0;
  --danger-border-hover: #ea8f88;
  --toast: #1d2939;
  --toast-danger: #7a271a;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-dialog: 0 24px 64px rgba(16, 24, 40, .18);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 8px 24px rgba(23, 32, 51, .06);
  --shadow-nav: 12px 0 40px rgba(15, 23, 42, .08);
  --signal: #14b8a6;
  --signal-soft: #eafaf7;
  --nav-ink: #d6dbea;
  --nav-muted: #8f9bb3;
  --nav-line: rgba(255,255,255,.08);
}


html:lang(fa),
html[dir="rtl"] {
  font-family: -apple-system, BlinkMacSystemFont, "Vazirmatn", "IRANSans", "Segoe UI", Roboto, "Helvetica Neue", Arial, Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

.skip-link {
  position: fixed;
  inset-inline-start: var(--space-4);
  inset-block-start: var(--space-3);
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-halo);
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible), input:focus:not(:focus-visible), select:focus:not(:focus-visible), textarea:focus:not(:focus-visible) { outline: none; }

.topbar {
  min-height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-5);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-size: 14px; }
.brand-copy span { font-size: 12px; color: var(--muted); }
.release, .mini {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}
.top-actions { display: flex; gap: var(--space-2); align-items: center; flex: 0 0 auto; }
.user-context {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  min-width: auto;
}
.user-context strong { font-size: 13px; }
.user-context small { font-size: 11px; color: var(--muted); }
.health {
  min-height: 36px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: #d6a000; }
.health.ok { color: var(--success); }
.health.ok .health-dot { background: var(--success); }

.workspace-scope {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  min-width: 0;
  flex: 0 1 auto;
  margin-inline-start: var(--space-2);
  margin-inline-end: auto;
}
.workspace-scope label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  min-width: 100px;
  max-width: 140px;
}
.workspace-scope select, .workspace-scope input {
  height: 38px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 12px;
  max-width: 140px;
}
.workspace-scope .scope-search { min-width: 120px; max-width: 160px; }

.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar {
  background: var(--nav);
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: auto;
}
.sidebar-intro { padding: 8px 10px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.09); margin-bottom: 6px; }
.sidebar-intro strong, .sidebar-intro small { display: block; }
.sidebar-intro strong { font-size: 14px; margin-top: 2px; }
.sidebar-intro small { font-size: 12px; color: #98a2b3; margin-top: 4px; line-height: 1.6; }
.sidebar-kicker { font-size: 11px; color: #8da2bf; letter-spacing: .08em; text-transform: uppercase; }
.nav-caption { color: #7f8ea3; font-size: 11px; font-weight: 700; padding: 18px 10px 7px; }
.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-inline-start: 3px solid transparent;
  background: transparent;
  color: #c3cad5;
  text-align: start;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.nav-item:hover { background: var(--nav-hover); color: #fff; }
.nav-item.active { background: var(--nav-active); color: #fff; border-inline-start-color: #84adff; font-weight: 700; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.09); padding: 14px 10px 4px; color: #8491a3; }
.sidebar-footer span, .sidebar-footer small { display: block; }
.sidebar-footer span { font-size: 12px; }
.sidebar-footer small { font-size: 12px; margin-top: 3px; }
.hidden { display: none !important; }

main { padding: 32px 36px 56px; max-width: 1480px; width: 100%; margin: 0 auto; min-width: 0; }
main:focus { outline: none; }
.view { display: none; }
.view.active { display: block; }
.page-hero {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
}
.page-hero h1 { margin: 4px 0 6px; font-size: clamp(24px, 2vw, 30px); line-height: 1.25; letter-spacing: -.02em; }
.page-hero p { margin: 0; color: var(--muted); max-width: 760px; font-size: 14px; }
.eyebrow { font-size: 12px; color: var(--primary); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.page-actions { display: flex; gap: var(--space-2); align-items: center; }
.page-head, .panel-head, .dialog-head, .dialog-actions, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.page-head { margin-bottom: var(--space-5); }
.page-head h1, .panel-head h2, .dialog-head h2, .section-head h2, .section-head strong { margin: 0; letter-spacing: -.012em; }
.page-head h1 { font-size: 25px; line-height: 1.3; }
.panel-head h2, .section-head h2 { font-size: 17px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.page-head p, .panel-head p, .dialog-head p, .section-head p, .section-head small { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.overview-section { margin-top: 24px; }
.overview-section > .section-head { margin-bottom: 10px; }

.cards, .readiness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.cards article, .panel, .architecture-grid article, .readiness-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.cards article { padding: 16px; display: flex; flex-direction: column; min-height: 88px; justify-content: center; }
.cards span { font-size: 12px; color: var(--muted); }
.cards strong { font-size: 24px; letter-spacing: -.025em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cards article small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.overview-metrics article { border-top: 3px solid var(--line-strong); }
.overview-metrics article:first-child { border-top-color: var(--primary); }
.readiness-grid { grid-template-columns: repeat(5, minmax(0,1fr)); margin-top: 10px; }
.readiness-card {
  min-height: 76px;
  padding: 13px 14px;
  display: flex;
  text-align: start;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease;
}
.readiness-card:hover { border-color: var(--line-strong); background: var(--surface-subtle); }
.readiness-card > span { font-size: 16px; color: var(--muted-2); line-height: 1.3; }
.readiness-card.ok > span { color: var(--success); }
.readiness-card strong, .readiness-card small { display: block; }
.readiness-card strong { font-size: 13px; }
.readiness-card small { font-size: 12px; color: var(--muted); margin-top: 3px; }

.panel { padding: 18px 20px; margin-top: 14px; }
.panel + .panel { margin-top: 12px; }
.panel-head { padding-bottom: 12px; }
.panel-head + .table-wrap, .panel-head + .cluster-status { margin-top: 4px; }
.panel .panel-head:not(:first-child) { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.journey {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.journey b { color: var(--ink-soft); }
.journey i { font-style: normal; color: var(--muted-2); }
.compact-journey { margin-bottom: 14px; }

.primary, .secondary, .ghost, .link, .icon, button.danger {
  min-height: 44px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
  font-weight: 600;
}
.primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); padding: 8px 14px; }
.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.secondary { background: #fff; color: var(--ink-soft); border: 1px solid var(--line-strong); padding: 8px 13px; }
.secondary:hover, .ghost:hover { background: var(--surface-subtle); border-color: var(--line-strong); }
.secondary:active, .ghost:active, .link:active, .icon:active { background: var(--surface-muted); }
.ghost, .link, .icon { background: transparent; border: 1px solid transparent; color: var(--ink-soft); padding: 8px 10px; }
.link { color: var(--primary); padding-inline: 8px; }
.link:hover { background: var(--primary-soft); text-decoration: none; }
button.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--danger-border); padding: 8px 12px; }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger-border-hover); color: var(--danger-hover); }
button.danger:active { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-hover); }
.compact { min-height: 44px; padding: 8px 10px; }
.small { min-height: 44px; padding: 8px 10px; font-size: 12px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 780px; font-variant-numeric: tabular-nums; }
th, td { text-align: start; padding: 12px 11px; border-bottom: 1px solid #edf0f3; font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 12px; background: var(--surface-subtle); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
td small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; line-height: 1.5; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #d8e2f4;
  background: var(--primary-soft);
  color: #344f8f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.badge.ready { background: var(--success-soft); border-color: #abeac9; color: var(--success); }
.badge.failed { background: var(--danger-soft); border-color: #f6c5c1; color: var(--danger); }
.badge.warn { background: var(--warn-soft); border-color: #f2d58a; color: var(--warn); }
.progress { width: 120px; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: #eaecf0; vertical-align: middle; }
.progress::-webkit-progress-bar { background: #eaecf0; border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

.architecture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.architecture-grid article { padding: 18px; }
.architecture-grid h3 { margin: 0 0 6px; font-size: 15px; }
.architecture-grid p { color: var(--muted); margin: 0; font-size: 13px; }

.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; }
.site-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; transition: background-color .14s ease, border-color .14s ease; }
.site-card:hover { border-color: var(--line-strong); background: #fdfdfd; }
.site-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.site-card h3 { font-size: 15px; margin: 0; }
.site-domain { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.site-health-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.site-health-cell { background: var(--surface-subtle); border: 1px solid #edf0f3; border-radius: var(--radius-sm); padding: 9px; }
.site-health-cell small, .site-health-cell strong { display: block; }
.site-health-cell small { font-size: 11px; color: var(--muted); }
.site-health-cell strong { font-size: 12px; margin-top: 3px; }
.site-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #edf0f3; padding-top: 12px; }
.site-card-foot > small { font-size: 12px; color: var(--muted); max-width: 58%; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.action-card {
  min-height: 70px;
  border: 1px solid var(--line);
  border-inline-start-width: 4px;
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  background: #fff;
  text-align: start;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease;
}
.action-card:hover { border-color: var(--line-strong); background: var(--surface-subtle); }
.action-card.warning { border-inline-start-color: #d39a00; }
.action-card.critical { border-inline-start-color: var(--danger); }
.action-card.info { border-inline-start-color: var(--primary); }
.action-card strong, .action-card small { display: block; }
.action-card strong { font-size: 13px; }
.action-card small { color: var(--muted); margin-top: 4px; font-size: 12px; }
.health-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; margin: 12px 0; }
.health-item { background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.health-item strong, .health-item small { display: block; }
.health-item small { font-size: 11px; color: var(--muted); }
.portal-site-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 13px; margin: 8px 0; background: #fff; }
.portal-site-card > small { display: block; margin: 3px 0 10px; color: var(--muted); }
.cockpit-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 12px; margin: 10px 0 16px; }
.cockpit-summary, .cockpit-actions { background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; }
.cockpit-summary h3, .cockpit-actions h3 { margin: 0 0 8px; font-size: 14px; }
.cockpit-primary-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cockpit-primary-actions a, .cockpit-primary-actions button { display: flex; justify-content: center; align-items: center; min-height: 44px; }
.cockpit-secondary { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.cockpit-ai { margin: 14px 0 18px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-subtle); }
.cockpit-ai .section-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:12px; }
.cockpit-ai .section-head h3 { margin:3px 0 4px; }
.cockpit-ai .section-head p { margin:0; color:var(--muted); max-width:72ch; }
.ai-context-preview { margin-top:12px; padding:12px; border:1px dashed var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); overflow-wrap:anywhere; }
.ai-context-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:8px; }
.ai-context-grid article { border:1px solid var(--line); border-radius:var(--radius-sm); padding:8px; background:var(--surface); }
.ai-context-grid small,.ai-context-grid strong { display:block; }

.cluster-status:empty, .table-wrap:empty { min-height: 48px; }
.runtime-recovery { margin-top: 14px; }
.inventory { display: flex; gap: 5px; flex-wrap: wrap; }
.scope-notice { margin: 14px 0 0; border: 1px solid #efd17a; background: var(--warn-soft); border-radius: var(--radius-md); padding: 11px 12px; color: #744d00; }
.scope-notice strong, .scope-notice small { display: block; }
.scope-notice small { font-size: 12px; margin-top: 3px; direction: ltr; unicode-bidi: plaintext; }
.warning-box { border: 1px solid #efd17a; background: var(--warn-soft); border-radius: var(--radius-md); padding: 11px 12px; margin: 9px 0; display: flex; justify-content: space-between; gap: 10px; color: #744d00; }
.error-state { padding: 12px; border: 1px solid #f2b8b3; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger); }
.danger-zone { border: 1px solid #f2b8b3; background: var(--danger-soft); border-radius: var(--radius-md); padding: 14px; display: grid; gap: 12px; }
.danger-zone code { display: block; padding: 8px 10px; background: rgba(16,24,40,.05); border-radius: var(--radius-sm); direction: ltr; text-align: start; }
.danger:not(button) { color: var(--danger); }
.muted-action { opacity: .55; cursor: not-allowed; }

.migration-grid, .telemetry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 12px 0; }
.migration-grid article, .telemetry-grid article { border: 1px solid var(--line); background: var(--surface-subtle); border-radius: var(--radius-md); padding: 12px; min-width: 0; }
.migration-grid small, .migration-grid strong, .migration-grid span, .telemetry-grid small, .telemetry-grid strong, .telemetry-grid b { display: block; }
.migration-grid small, .telemetry-grid small { color: var(--muted); font-size: 12px; }
.telemetry-grid small, .telemetry-grid b { overflow-wrap: anywhere; }
#telemetry-dialog { max-inline-size: min(100vw - 24px, 1100px); }
#telemetry-dialog .table-wrap { max-inline-size: 100%; }
.migration-grid strong { font-size: 13px; }
.migration-grid span { font-size: 12px; color: var(--muted); margin-top: 3px; }
.telemetry-toolbar { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; margin: 14px 0; }
.telemetry-toolbar label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.telemetry-toolbar select, .telemetry-toolbar input { min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 9px; background: #fff; min-width: 130px; }
.telemetry-search { flex: 1; }
.telemetry-search input { width: 100%; }
.sparkline { width: 100%; height: 52px; color: var(--primary); margin-top: 8px; overflow: visible; }
.log-view { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: #101828; color: #e4e7ec; }
.log-line { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.log-line code { display: block; color: #f2f4f7; white-space: pre-wrap; word-break: break-word; font-size: 12px; }
.log-line small { display: block; color: #98a2b3; font-size: 11px; margin-top: 3px; }

dialog { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: 780px; width: calc(100% - 28px); box-shadow: var(--shadow-dialog); background: #fff; color: var(--ink); }
dialog#site-cockpit-dialog { max-width: 980px; }
dialog::backdrop { background: rgba(16,24,40,.62); }
dialog form { padding: 22px; }
.dialog-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.form-grid label { font-size: 13px; color: var(--ink-soft); font-weight: 600; min-height: 44px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}
.form-grid textarea { min-height: 96px; resize: vertical; }
.full { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-md); display: flex; gap: 16px; flex-wrap: wrap; padding: 12px; }
fieldset legend { font-size: 12px; color: var(--muted); padding: 0 5px; }
fieldset > label { min-height: 44px; display: inline-flex; align-items: center; gap: var(--space-2); }
.checkbox, .danger-check { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 44px; }
.checkbox input, .danger-check input { width: 18px; height: 18px; min-height: 18px; margin-top: 2px; }
.hint { font-size: 12px; color: var(--muted); }
.error { color: var(--danger); min-height: 20px; font-size: 12px; }
.dialog-actions { justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 14px; }
.icon { font-size: 20px; padding: 4px 9px; }
.dialog-outcome { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-subtle); color: var(--muted); font-size: 12px; line-height: 1.8; }
.toast { position: fixed; inset-inline-start: 16px; bottom: 16px; background: var(--toast); color: #fff; padding: 10px 12px; border-radius: var(--radius-md); z-index: 30; width: min(440px, calc(100vw - 32px)); box-sizing: border-box; box-shadow: var(--shadow-dialog); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.toast-message { flex: 1 1 auto; min-width: 0; line-height: 1.6; }
.toast-action { flex: 0 0 auto; min-height: 44px; padding: 7px 11px; border: 1px solid currentColor; border-radius: var(--radius-sm); background: transparent; color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.toast-action:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; box-shadow: none; }
.toast-close { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; min-width: 32px; min-height: 32px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.toast-close:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.toast.error { padding-inline-end: 40px; }
.toast.error { background: var(--toast-danger); }

details > summary { cursor: pointer; color: var(--ink-soft); padding: 8px 0 10px; min-height: 44px; }
details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }

[dir="ltr"] .layout { direction: ltr; }
[dir="ltr"] code { direction: ltr; unicode-bidi: isolate; }

@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; }
  .workspace-scope { order: 3; width: 100%; padding-top: 2px; }
  .layout { min-height: calc(100vh - 112px); }
  .sidebar { top: 112px; height: calc(100vh - 112px); }
  .readiness-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-height: auto; display: block; padding: 8px; white-space: nowrap; overflow-x: auto; }
  .sidebar-intro, .sidebar-footer, .nav-caption { display: none; }
  .sidebar nav { display: flex; gap: 4px; }
  .nav-item { width: auto; display: inline-flex; min-height: 44px; border-inline-start: 0; border-bottom: 3px solid transparent; }
  .nav-item.active { border-bottom-color: #84adff; }
  .advanced-only:not(.hidden) { display: contents !important; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .readiness-grid { grid-template-columns: repeat(2, 1fr); }
  .architecture-grid { grid-template-columns: 1fr 1fr; }
  main { padding: 24px 20px 48px; }
  .cockpit-hero { grid-template-columns: 1fr; }
  .ai-context-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand-copy span, .release, .user-context { display: none; }
  .top-actions { margin-inline-start: auto; }
  .health { max-width: 150px; overflow: hidden; }
  .workspace-scope { display: grid; grid-template-columns: 1fr 1fr; }
  .workspace-scope .scope-search { grid-column: 1 / -1; }
  .workspace-scope label { min-width: 0; }
  .workspace-scope select, .workspace-scope input { max-width: none; width: 100%; }
  main { padding: 20px 12px 42px; }
  .page-hero, .page-head, .panel-head { align-items: stretch; flex-direction: column; }
  .page-actions, .page-head > .row-actions, .panel-head > .row-actions { width: 100%; }
  .page-actions > button, .page-head > button { width: 100%; }
  .cards, .readiness-grid, .architecture-grid, .form-grid, .site-health-row, .cockpit-primary-actions, .migration-grid, .telemetry-grid { grid-template-columns: 1fr; }
  .site-grid { grid-template-columns: 1fr; }
  .panel { padding: 15px; }
  .site-card-foot { align-items: flex-start; flex-direction: column; }
  .site-card-foot > small { max-width: none; }
  .table-wrap { margin-inline: -2px; border-radius: var(--radius-sm); }
}

/* Mobile task tables keep identity/action anchors visible without duplicating Product authority into card state. */
.table-wrap[tabindex="0"]:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
@media (max-width:680px){
  .table-wrap{overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
  .mobile-task-table table th:first-child,
  .mobile-task-table table td:first-child,
  .mobile-identity-table table th:first-child,
  .mobile-identity-table table td:first-child,
  .mobile-select-table table th:first-child,
  .mobile-select-table table td:first-child{position:sticky;inset-inline-start:0;z-index:2;background:var(--surface)}
  .mobile-task-table table th:last-child,
  .mobile-task-table table td:last-child{position:sticky;inset-inline-end:0;z-index:2;background:var(--surface);box-shadow:-8px 0 12px -12px rgba(16,24,40,.45)}
  [dir="rtl"] .mobile-task-table table th:last-child,
  [dir="rtl"] .mobile-task-table table td:last-child{box-shadow:8px 0 12px -12px rgba(16,24,40,.45)}
  .mobile-select-table table th:first-child,
  .mobile-select-table table td:first-child{inline-size:52px;min-inline-size:52px;max-inline-size:52px}
  .mobile-select-table table th:nth-child(2),
  .mobile-select-table table td:nth-child(2){position:sticky;inset-inline-start:52px;z-index:2;background:var(--surface);box-shadow:8px 0 12px -12px rgba(16,24,40,.32)}
  [dir="rtl"] .mobile-select-table table th:nth-child(2),
  [dir="rtl"] .mobile-select-table table td:nth-child(2){box-shadow:-8px 0 12px -12px rgba(16,24,40,.32)}
  .mobile-task-table tbody tr:hover td:first-child,
  .mobile-task-table tbody tr:hover td:last-child,
  .mobile-identity-table tbody tr:hover td:first-child,
  .mobile-select-table tbody tr:hover td:first-child,
  .mobile-select-table tbody tr:hover td:nth-child(2){background:var(--surface-subtle)}
}

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


/* Bootstrap installer / platform authentication portal */
.auth-dialog:not([open]) {
  display: none;
}
.auth-dialog[open] {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: var(--space-6);
  border: none;
  background: radial-gradient(ellipse at 50% 15%, #1e293b 0%, #0f172a 55%, #020617 100%);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  box-sizing: border-box;
  overflow-y: auto;
}
.auth-dialog::backdrop {
  background: #020617;
}
.auth-wrapper {
  width: min(500px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: auto;
}
.auth-brand-badge {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-content: center;
  padding-bottom: var(--space-2);
}
.auth-brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  letter-spacing: -0.5px;
}
.auth-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.auth-brand-text strong {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}
.auth-brand-text span {
  font-size: 13px;
  color: #94a3b8;
}
.auth-dialog-card {
  display: grid;
  gap: var(--space-5);
  padding: 32px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 35px rgba(59, 130, 246, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-sizing: border-box;
}
.auth-dialog-header {
  display: grid;
  gap: var(--space-2);
  text-align: center;
}
.auth-dialog-header .eyebrow {
  color: #60a5fa;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.auth-dialog-header h2 {
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}
.auth-dialog-header p {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: rgba(30, 41, 59, 0.7);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-tab {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.auth-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}
.auth-tab.active {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}
.auth-panel {
  display: grid;
  gap: var(--space-4);
}
.auth-panel.hidden {
  display: none;
}
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input-wrap input {
  padding-inline-end: 46px;
  padding-inline-start: 14px;
}
.toggle-password-btn {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 16px;
  opacity: 0.7;
  color: #94a3b8;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.toggle-password-btn:hover {
  opacity: 1;
  color: #f8fafc;
}
.field-stack { display: grid; gap: var(--space-2); }
.field-stack > span { font-weight: 700; }
.auth-dialog-card input {
  min-height: 44px;
  width: 100%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 14px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}
.auth-dialog-card input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}
.auth-dialog-card .dialog-actions {
  display: flex;
  background: transparent;
  border-top: none;
  padding: 0;
  position: static;
}
.auth-submit-btn {
  width: 100%;
  min-height: 46px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.auth-submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}
.auth-submit-btn:active:not(:disabled) {
  background: #1e40af;
}
.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.auth-quick-helper {
  background: rgba(30, 41, 59, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: var(--space-3) var(--space-4);
  display: grid;
  gap: var(--space-2);
}
.auth-helper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.auth-helper-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}
.auth-helper-header small {
  font-size: 11px;
  color: #94a3b8;
}
.auth-helper-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: 4px;
}
.auth-helper-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  box-sizing: border-box;
}
.auth-helper-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Enterprise data truth states: operational, compact, and color-independent. */
.dataset-state{display:flex;align-items:center;gap:var(--space-2,8px);min-height:36px;padding:6px 0;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}
.dataset-state strong{font-weight:600;color:var(--ink)}
.dataset-state small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:52ch}
.dataset-state.stale,.dataset-state.failed{color:var(--danger,#9f2f2f)}
.dataset-state.forbidden{color:var(--warn)}
.collection-pager{display:flex;justify-content:flex-end;padding-top:var(--space-2,8px)}

.operator-action-dialog { max-width: 620px; }
.operator-action-dialog #operator-action-message { white-space: pre-line; }
.operator-action-dialog .field-stack { margin-block: var(--space-4); }
.operator-action-dialog[data-mode="alert"] #operator-action-cancel { display: none; }
.operator-impact { margin: 0 0 var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-subtle); overflow: hidden; }
.operator-impact-grid { display: grid; }
.operator-impact-row { display: grid; grid-template-columns: minmax(120px,.34fr) 1fr; gap: var(--space-3); padding: 10px 12px; align-items: start; border-bottom: 1px solid var(--line); }
.operator-impact-row:last-child { border-bottom: 0; }
.operator-impact-row > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.operator-impact-row > strong { color: var(--ink); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.operator-action-dialog[data-risk="high"] .operator-impact { border-color: var(--danger-border); }
.operator-action-dialog[data-risk="high"] .operator-impact-row.risk { background: var(--danger-soft); }
.operator-action-dialog[data-risk="high"] .operator-impact-row.risk > span, .operator-action-dialog[data-risk="high"] .operator-impact-row.risk > strong { color: var(--danger); }
@media (max-width: 680px) { .operator-impact-row { grid-template-columns: 1fr; gap: 4px; padding: 10px; } }
/* Modal control target contract: applies even when a dialog workflow does not use .form-grid. */
dialog input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
dialog select,
dialog textarea {
  min-height: 44px;
}

/* Remote authority directory pickers: bounded server search without directory preloading. */
.remote-picker-native{
  position:absolute!important;
  inline-size:1px!important;
  block-size:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.remote-picker{position:relative;display:grid;gap:var(--space-1,4px);min-width:0}
.remote-picker-input{width:100%;min-height:44px}
.remote-picker-results{position:absolute;z-index:40;inset-inline:0;top:calc(100% + 4px);max-height:280px;overflow:auto;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow-dialog);padding:4px}
.remote-picker-results.hidden{display:none}
.remote-picker-option{display:grid;width:100%;gap:2px;padding:9px 10px;text-align:start;background:transparent;border:0;border-radius:var(--radius-sm);color:var(--ink);cursor:pointer}
.remote-picker-option:hover,.remote-picker-option.active{background:var(--surface-subtle)}
.remote-picker-option strong{font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.remote-picker-option small,.remote-picker-hint,.remote-picker-empty{color:var(--muted);font-size:12px}
.remote-picker-empty{padding:10px}
.remote-picker-hint{min-height:1.25em;line-height:1.4}
.remote-picker-input:disabled{cursor:not-allowed;opacity:.7}


/* 4SO Control Fabric — operator shell inspired by the open-source TailAdmin information grammar.
   Product-owned implementation: no TailAdmin runtime, Tailwind runtime, Bootstrap runtime, or third-party UI CDN. */
body {
  min-height: 100vh;
  background-color: var(--bg);
}


.topbar {
  min-height: 72px;
  padding: 10px 18px;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}
.brand { gap: 11px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #101a35;
  border: 1px solid #25345f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  font-size: 12px;
  letter-spacing: -.04em;
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset-inline-end: 5px;
  inset-block-end: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(20,184,166,.14);
}
.brand-copy strong { font-size: 14px; letter-spacing: -.01em; }
.brand-copy span { font-size: 11px; letter-spacing: .025em; }
.release {
  border-color: #dce3f0;
  background: #f6f8fc;
  color: #516078;
  font-weight: 700;
}

.workspace-scope {
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.workspace-scope label { min-width: 130px; gap: 2px; }
.workspace-scope label > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-inline: 5px;
}
.workspace-scope select,
.workspace-scope input {
  height: 38px;
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  border-radius: 8px;
}
.workspace-scope select:hover,
.workspace-scope input:hover,
.workspace-scope select:focus,
.workspace-scope input:focus { background: #fff; border-color: var(--line-strong); }

.health {
  min-height: 40px;
  background: #f8fafc;
  border-radius: 10px;
  font-weight: 600;
}
.health-dot { box-shadow: 0 0 0 4px rgba(214,160,0,.1); }
.health.ok .health-dot { box-shadow: 0 0 0 4px rgba(6,118,71,.1); }

.layout { grid-template-columns: 256px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar {
  top: 72px;
  height: calc(100vh - 72px);
  min-height: calc(100vh - 72px);
  padding: 14px 12px;
  background: var(--nav);
  border-inline-end: 1px solid #202b45;
  box-shadow: var(--shadow-nav);
}
.sidebar-intro {
  margin: 0 4px 8px;
  padding: 11px 10px 16px;
  border-bottom-color: var(--nav-line);
}
.sidebar-kicker { color: #7182a6; font-weight: 800; }
.sidebar-intro strong { font-size: 14px; }
.sidebar-intro small { color: var(--nav-muted); }
.nav-caption {
  color: #71809b;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 18px 12px 8px;
}
.nav-item {
  min-height: 46px;
  gap: 10px;
  border-inline-start: 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--nav-ink);
  font-size: 13px;
  font-weight: 550;
}
.nav-item::before {
  content: "·";
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  color: #9aa8c4;
  background: rgba(255,255,255,.025);
  font-size: 14px;
  font-weight: 800;
}
.nav-item:hover { background: #18233a; color: #fff; text-decoration: none; }
.nav-item:hover::before { color: #dbe3ff; border-color: rgba(132,173,255,.2); }
.nav-item.active {
  background: #202d4d;
  color: #fff;
  box-shadow: inset -3px 0 0 #6d86ff;
}
[dir="ltr"] .nav-item.active { box-shadow: inset 3px 0 0 #6d86ff; }
.nav-item.active::before { background: #304474; border-color: #435d96; color: #fff; }
.nav-item[data-view="overview"]::before { content: "⌂"; }
.nav-item[data-view="sites"]::before { content: "◫"; }
.nav-item[data-view="domains"]::before { content: "◎"; }
.nav-item[data-view="backups"]::before { content: "↺"; }
.nav-item[data-view="performance"]::before { content: "⌁"; }
.nav-item[data-view="operations"]::before { content: "↯"; }
.nav-item[data-view="access"]::before { content: "♙"; }
.nav-item[data-view="commercial"]::before { content: "◇"; }
.nav-item[data-view="authority"]::before { content: "⊙"; }
.nav-item[data-view="infrastructure"]::before { content: "▦"; }
.nav-item[data-view="trust"]::before { content: "◆"; }
.nav-item[data-view="architecture"]::before { content: "⌘"; }
.nav-item[href="/ai-operations.html"]::before { content: "✦"; }
.nav-item[href="/lab-guide.html"]::before { content: "▹"; }
.nav-item[href="/ai-native.html"]::before { content: "AI"; font-size: 11px; }
.sidebar-footer { border-top-color: var(--nav-line); color: #7f8da8; }
.sidebar-footer span { color: #aab6cc; font-weight: 700; }

main { padding: 30px 34px 64px; max-width: 1540px; }
.page-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  align-items: center;
}
.page-hero h1 { font-size: clamp(25px, 2vw, 31px); }
.eyebrow {
  color: var(--primary);
  font-size: 11px;
  letter-spacing: .09em;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  display: inline-flex;
  width: fit-content;
}
.page-head { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 24px; }
.overview-section { margin-top: 20px; }

.cards, .readiness-grid { gap: 12px; }
.cards article, .panel, .architecture-grid article, .readiness-card, .site-card, .portal-site-card {
  border-color: #e1e7f0;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}
.cards article { min-height: 100px; padding: 17px 18px; position: relative; overflow: hidden; }
.cards article::after {
  content: "";
  position: absolute;
  inset-inline-end: 14px;
  inset-block-start: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8deea;
}
.cards article:first-child::after { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.cards strong { font-size: 25px; }
.overview-metrics article { border-top-width: 1px; }
.overview-metrics article:first-child { border-top-color: #e1e7f0; }

.readiness-card { min-height: 82px; padding: 14px; background: #fff; }
.readiness-card > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f1f4f9;
}
.readiness-card.ok > span { background: var(--success-soft); }
.readiness-card:hover { border-color: #cfd8e8; background: #fbfcff; }

.panel { padding: 18px 20px; margin-top: 14px; background: #fff; }
.panel-head { min-height: 42px; }
.panel-head h2, .section-head h2 { font-size: 16px; }
.journey {
  background: #f8faff;
  border-color: #dfe6f2;
  border-radius: 10px;
  padding: 10px 13px;
}
.journey b { color: #33415c; }

.primary, .secondary, .ghost, .link, .icon, button.danger { border-radius: 9px; }
.primary { box-shadow: 0 1px 2px rgba(61,90,241,.22); }
.secondary { background: #fff; }
.ghost { color: #516078; }

.table-wrap { border-radius: 10px; border-color: #e1e7f0; box-shadow: var(--shadow-xs); }
th, td { padding: 11px 12px; }
th {
  background: #f7f9fc;
  color: #66738a;
  font-size: 11px;
  letter-spacing: .025em;
  text-transform: none;
}
tbody tr:hover { background: #f8faff; }
.badge { border-radius: 7px; min-height: 23px; }

.action-card {
  border-inline-start-width: 1px;
  border-radius: 10px;
  min-height: 78px;
  box-shadow: var(--shadow-xs);
  position: relative;
  padding-inline-start: 16px;
}
.action-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 11px;
  width: 3px;
  border-radius: 999px;
  background: #cfd6e4;
}
.action-card.warning::before { background: #d39a00; }
.action-card.critical::before { background: var(--danger); }
.action-card.info::before { background: var(--primary); }

.site-card { padding: 17px; }
.site-health-cell { background: #f8faff; border-color: #e9edf5; border-radius: 9px; }
.health-item, .cockpit-summary, .cockpit-actions, .migration-grid article, .telemetry-grid article {
  background: #f8faff;
  border-color: #e4e9f2;
  border-radius: 10px;
}

/* Dark mode is presentation-only; product authority and advanced/simple mode are unchanged. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #111827;
  --surface-subtle: #151e2f;
  --surface-muted: #1b2638;
  --line: #263349;
  --line-strong: #34445e;
  --ink: #edf2fb;
  --ink-soft: #d3dbea;
  --muted: #9ba8bc;
  --muted-2: #78869c;
  --primary-soft: #1b2855;
  --focus-halo: #0b1120;
  --success-soft: #102b24;
  --warn-soft: #30270f;
  --danger-soft: #351a1d;
  --toast: #e6ecf7;
  --toast-danger: #f9d3d0;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .cards article,
html[data-theme="dark"] .readiness-card,
html[data-theme="dark"] .site-card,
html[data-theme="dark"] .portal-site-card,
html[data-theme="dark"] .architecture-grid article,
html[data-theme="dark"] dialog { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .workspace-scope,
html[data-theme="dark"] .health,
html[data-theme="dark"] .journey,
html[data-theme="dark"] .site-health-cell,
html[data-theme="dark"] .health-item,
html[data-theme="dark"] .cockpit-summary,
html[data-theme="dark"] .cockpit-actions,
html[data-theme="dark"] .migration-grid article,
html[data-theme="dark"] .telemetry-grid article { background: var(--surface-subtle); }
html[data-theme="dark"] .workspace-scope select,
html[data-theme="dark"] .workspace-scope input,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .telemetry-toolbar select,
html[data-theme="dark"] .telemetry-toolbar input,
html[data-theme="dark"] .table-wrap { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] th { background: #151e2f; color: #a5b0c2; }
html[data-theme="dark"] tbody tr:hover { background: #151e2f; }
html[data-theme="dark"] .page-hero { background: #101827; }
html[data-theme="dark"] .release { background: #151e2f; border-color: #2b3850; color: #b7c2d5; }
html[data-theme="dark"] a { color: #8da6ff; }
html[data-theme="dark"] .primary { color: #fff; }
html[data-theme="dark"] .toast { background: #e6ecf7; color: #172033; }
html[data-theme="dark"] .toast.error { background: #f9d3d0; color: #7a271a; }

.theme-toggle::before { content: "◐"; margin-inline-end: 6px; }
.sidebar-toggle { display: none; }
.sidebar-scrim { display: none; }

@media (max-width: 1180px) {
  .layout { min-height: calc(100vh - 120px); }
  .sidebar { top: 120px; height: calc(100vh - 120px); }
}

@media (max-width: 960px) {
  .layout { display: block; }
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    z-index: 60;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(294px, 88vw);
    height: 100vh;
    min-height: 100vh;
    padding: 14px 12px;
    display: flex;
    white-space: normal;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(110%);
    transition: transform .18s ease;
    box-shadow: 0 24px 64px rgba(3,10,26,.34);
  }
  [dir="ltr"] .sidebar { transform: translateX(-110%); }
  body:not(.sidebar-open) .sidebar { visibility: hidden; pointer-events: none; }
  body.sidebar-open .sidebar { transform: translateX(0); visibility: visible; pointer-events: auto; }
  .sidebar-intro, .sidebar-footer, .nav-caption { display: block; }
  .sidebar nav { display: block; }
  .nav-item { width: 100%; display: flex; border-bottom: 0; }
  .nav-item.active { border-bottom: 0; }
  .advanced-only:not(.hidden) { display: block !important; }
  .sidebar-scrim {
    position: fixed;
    z-index: 55;
    inset: 0;
    background: rgba(6,12,24,.54);
  }
  body.sidebar-open .sidebar-scrim { display: block; }
  main { padding: 24px 20px 48px; }
}

@media (max-width: 680px) {
  .topbar { min-height: 64px; min-width: 0; max-width: 100%; overflow: hidden; }
  .top-actions { min-width: 0; max-width: 100%; overflow: hidden; }
  .health { min-width: 0; max-width: min(150px, 46vw); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  .brand { min-width: 0; flex-shrink: 1; }
  .brand-mark { width: 38px; height: 38px; flex: 0 0 38px; }
  .workspace-scope { border-radius: 10px; }
  .page-hero { padding: 18px; border-radius: 13px; }
  .panel { border-radius: 11px; }
}

/* 0.0.219 code-owned interaction primitives. Inspired by open-code/composition
   patterns, not imported from a third-party framework. */
.command-trigger,.notification-trigger{display:inline-flex;align-items:center;gap:.45rem}.command-trigger kbd{font:inherit;font-size:.72rem;opacity:.65;border:1px solid var(--line);border-radius:.4rem;padding:.08rem .35rem;background:var(--surface-subtle)}
.notification-trigger{position:relative}.notification-unread-badge{min-width:1.25rem;height:1.25rem;padding:0 .32rem;border-radius:999px;display:inline-grid;place-items:center;background:var(--danger,#b42318);color:#fff;font-size:.72rem;font-weight:800}.notification-unread-badge.hidden{display:none}
.ui-command-dialog,.notification-center{border:0;padding:0;background:transparent;max-width:none;max-height:none}.ui-command-dialog::backdrop,.notification-center::backdrop{background:color-mix(in srgb,#0f172a 52%,transparent);backdrop-filter:blur(2px)}
.ui-command-card{width:min(680px,calc(100vw - 2rem));max-height:min(720px,calc(100vh - 2rem));display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:1rem;box-shadow:0 24px 70px #0003;overflow:hidden}.ui-command-head,.notification-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;padding:1rem 1rem .65rem}.ui-command-head h2,.notification-head h2{margin:.15rem 0}.ui-command-search{padding:.5rem 1rem}.ui-command-search input{width:100%;font-size:1rem}.ui-command-results{padding:.4rem;overflow:auto;min-height:14rem}.ui-command-item{width:100%;border:0;background:transparent;color:inherit;border-radius:.65rem;padding:.7rem .8rem;display:flex;align-items:center;justify-content:space-between;text-align:start;cursor:pointer}.ui-command-item:hover,.ui-command-item.selected{background:var(--surface-subtle)}.ui-command-item small{opacity:.62}.ui-command-footer{display:flex;gap:1rem;padding:.7rem 1rem;border-top:1px solid var(--line);font-size:.8rem;opacity:.7}.ui-command-footer kbd{margin-inline:.1rem;border:1px solid var(--line);border-radius:.3rem;padding:.05rem .28rem}.ui-empty{min-height:10rem;display:grid;place-items:center;align-content:center;gap:.4rem;text-align:center;padding:1.5rem;color:var(--muted)}.ui-empty strong{color:var(--ink)}.ui-empty.error strong{color:var(--danger,#b42318)}
.notification-center{margin-inline-start:auto;margin-inline-end:0;width:min(620px,100vw);height:100vh}.notification-card{height:100%;background:var(--surface);border-inline-start:1px solid var(--line);box-shadow:0 0 70px #0002;display:flex;flex-direction:column}.notification-head{border-bottom:1px solid var(--line)}.notification-head p{margin:.25rem 0 0;color:var(--muted);max-width:48rem}.notification-toolbar{display:flex;gap:.5rem;padding:.7rem 1rem}.ui-status-line{padding:0 1rem .65rem;color:var(--muted);font-size:.82rem}.notification-list{flex:1;overflow:auto;padding:.25rem .75rem .75rem;display:grid;align-content:start;gap:.55rem}.notification-item{border:1px solid var(--line);border-radius:.8rem;padding:.8rem;background:var(--surface);box-shadow:0 1px 2px #00000008}.notification-item.unread{border-inline-start-width:4px;border-inline-start-color:var(--primary,#2563eb)}.notification-item.severity-critical{border-color:color-mix(in srgb,var(--danger,#b42318) 45%,var(--line))}.notification-item.severity-warning{border-color:color-mix(in srgb,#d97706 40%,var(--line))}.notification-item-head{display:flex;align-items:center;gap:.45rem;margin-bottom:.5rem}.notification-item-head time{margin-inline-start:auto;font-size:.72rem;color:var(--muted)}.notification-item .severity{font-size:.72rem;color:var(--muted)}.notification-item>strong{display:block}.notification-item p{margin:.35rem 0;color:var(--muted);line-height:1.55}.notification-item footer{display:flex;align-items:center;gap:.45rem;font-size:.75rem;color:var(--muted)}.notification-item footer code{max-width:18rem;overflow:hidden;text-overflow:ellipsis}.notification-item footer .link{margin-inline-start:auto}.notification-preferences{border-top:1px solid var(--line);padding:.75rem 1rem}.notification-preferences summary{cursor:pointer;font-weight:700}.notification-preferences form{padding-top:.8rem}.notification-pref-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;margin-bottom:.75rem}.notification-pref-grid label{display:flex;gap:.35rem;align-items:center;min-height:44px;padding:.25rem .35rem;border-radius:.5rem;cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:840px){.command-trigger span:not(:first-child),.notification-trigger span:not(:first-child){display:none}.command-trigger kbd{display:none}.notification-center{width:100vw}.notification-pref-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ui-command-card{width:calc(100vw - 1rem)}.topbar{min-width:0;max-width:100%}.top-actions{min-width:0;max-width:100%}.health{min-width:0;max-width:min(150px,32vw);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}}

/* 0.0.227 workflow inspection: read-only operation authority + recovery decision path. */
#operation-inspect-dialog{width:min(980px,calc(100vw - 2rem));max-width:980px}#operation-inspect-body{display:grid;gap:1rem}.compact-panel{margin:0;padding:1rem}.key-value-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem}.key-value-grid>div{min-width:0;border:1px solid var(--line);border-radius:.65rem;padding:.7rem;background:var(--surface-subtle)}.key-value-grid span{display:block;color:var(--muted);font-size:.78rem;margin-bottom:.25rem}.key-value-grid code{display:block;overflow-wrap:anywhere}.runtime-recovery+.dataset-state{margin-top:1rem}@media(max-width:760px){.key-value-grid{grid-template-columns:1fr}#operation-inspect-dialog{width:calc(100vw - 1rem)}}

/* Site Operations projection: Product Authority only, no local UI SoT. */
.cockpit-ops { margin: 14px 0 18px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.cockpit-ops .section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.cockpit-ops .section-head h3, .cockpit-ops .section-head h4 { margin:3px 0 4px; }
.cockpit-ops .section-head p { margin:0; color:var(--muted); max-width:78ch; }
.cockpit-ops .compact-head { margin-top:16px; }
.site-ops-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.site-ops-grid article { border:1px solid var(--line); border-radius:var(--radius-sm); padding:12px; background:var(--surface-subtle); }
.site-ops-grid article > span, .site-ops-capabilities span { display:block; color:var(--muted); font-size:12px; }
.site-ops-grid article > strong { display:block; margin:5px 0; }
.site-ops-grid article > small, .site-ops-capabilities small { display:block; color:var(--muted); line-height:1.5; }
.site-ops-capabilities { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:10px; }
.site-ops-capabilities > div { border:1px dashed var(--line-strong); border-radius:var(--radius-sm); padding:10px; }
.site-ops-timeline { display:grid; gap:0; border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; }
.timeline-item { position:relative; display:grid; grid-template-columns:12px minmax(0,1fr); gap:10px; padding:11px 12px; border-bottom:1px solid var(--line); background:var(--surface); }
.timeline-item:last-child { border-bottom:0; }
.timeline-marker { width:8px; height:8px; border-radius:999px; margin-top:7px; background:var(--muted); }
.timeline-marker.warning { background:var(--warn); }
.timeline-marker.critical { background:var(--danger); }
.timeline-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.timeline-item p { margin:5px 0; color:var(--muted); }
@media (max-width: 760px) { .site-ops-grid, .site-ops-capabilities { grid-template-columns:1fr; } }

/* 0.0.255 goal-first operator UX convergence. */
.scope-toggle { display: none; max-width: min(320px, 48vw); }
.scope-toggle #scope-toggle-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-guide {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 2fr);
  gap: var(--space-4);
  align-items: stretch;
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.workflow-guide-copy { display: grid; align-content: center; gap: var(--space-2); min-width: 0; }
.workflow-guide-copy strong { font-size: 15px; line-height: 1.8; }
.workflow-guide ol { list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-2); padding: 0; margin: 0; counter-reset: none; }
.workflow-guide li { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: var(--space-2); align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-subtle); }
.workflow-guide li > span { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-variant-numeric: tabular-nums; }
.workflow-guide li p { margin: 2px 0 0; color: var(--ink-soft); line-height: 1.65; }

/* Long operator forms stay understandable without changing their API contract. */
.form-section { margin-block: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.form-section > legend { font-size: 13px; font-weight: 800; color: var(--ink); padding-inline: var(--space-2); }
.form-section-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; width: 100%; }
.form-section-grid > label { font-size: 13px; color: var(--ink-soft); font-weight: 600; min-height: 44px; }
.form-section-grid > label.full { grid-column: 1 / -1; }
.form-section-grid input:not([type="checkbox"]):not([type="radio"]), .form-section-grid select, .form-section-grid textarea { width: 100%; margin-top: 6px; min-height: 44px; }
.form-advanced { margin-block: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-subtle); }
.form-advanced > summary { padding: 10px 12px; font-weight: 800; cursor: pointer; }
.form-advanced > .form-section { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.form-advanced-hint { margin: 0; padding: 0 12px 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* Long dialogs are usable on short laptop and mobile viewports: context and actions remain reachable. */
dialog { max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; }
dialog .dialog-head { position: sticky; inset-block-start: -1px; z-index: 3; background: var(--surface); padding-block: 4px 12px; }
dialog .dialog-actions { position: sticky; inset-block-end: -1px; z-index: 3; background: var(--surface); padding-block: 12px 4px; }

@media (max-width: 960px) {
  .workflow-guide { grid-template-columns: 1fr; }
  .workflow-guide ol { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .scope-toggle { display: inline-flex; }
  .workspace-scope { display: none; order: 4; width: 100%; }
  body.scope-open .workspace-scope { display: grid; grid-template-columns: 1fr 1fr; }
  body.scope-open .topbar { overflow: visible; }
  .workflow-guide { padding: 12px; margin-bottom: var(--space-4); }
  .workflow-guide ol { grid-template-columns: 1fr; }
  .workflow-guide li { padding: 9px; }
  .form-section-grid { grid-template-columns: 1fr; }
  .form-section-grid > label.full { grid-column: auto; }
  dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: var(--radius-md); }
  dialog form { padding: 16px; }
}

/* 0.0.258 actionable truth states: no dead-end empty/error screens and no stale-data mutations. */
.global-state-notices{display:grid;gap:8px;margin:0 0 14px}.global-state-notices:empty{display:none}.scope-notice[role="alert"],.scope-notice.info{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.scope-notice[role="alert"]>div{display:grid;gap:3px}.actionable-empty{display:grid;justify-items:center;gap:8px;min-height:132px;align-content:center}.actionable-empty strong{color:var(--ink);font-size:14px}.actionable-empty small{max-width:48rem;line-height:1.6}.actionable-empty button{min-height:44px;margin-top:3px}.dataset-state{justify-content:space-between;flex-wrap:wrap}.dataset-state>div{display:grid;gap:2px;min-width:0}.dataset-state>div small{display:block}.dataset-state>button{min-height:40px}.admission-blocked{opacity:.58;cursor:not-allowed}.admission-blocked::after{content:''}@media(max-width:680px){.global-state-notices{margin-inline:0}.scope-notice[role="alert"],.scope-notice.info{align-items:stretch}.scope-notice[role="alert"] button{width:100%;min-height:44px}.dataset-state>button{width:100%;min-height:44px}}

/* 0.0.259 accessible validation and error-recovery: invalid fields are visible without relying on color alone. */
form [aria-invalid="true"]{border-color:var(--danger);outline:2px solid color-mix(in srgb,var(--danger) 28%,transparent);outline-offset:2px}
form .error[role="alert"]:not(:empty),form .form-error[role="alert"]:not(:empty){padding:10px 12px;border:1px solid color-mix(in srgb,var(--danger) 38%,var(--line));border-radius:var(--radius-md);background:var(--danger-soft);line-height:1.65}
form [aria-invalid="true"]:focus{scroll-margin-block:96px}
@media (max-width:680px){form .error[role="alert"]:not(:empty),form .form-error[role="alert"]:not(:empty){font-size:13px;padding:10px}.dialog-actions button{min-height:44px}}

/* Persian-writing v1.3.5: joined Persian script must never use tracking. */
html[dir="rtl"] :not(code):not(pre):not(kbd):not(.mono) {
  letter-spacing: normal !important;
}

/* 4SO Enterprise Cloud Design System — World-Class Operator Experience */
:root {
  --vf-accent: #6366f1;
  --vf-accent-soft: #eef2ff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-muted: #e2e8f0;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --nav: #0b0f19;
  --nav-hover: #172133;
  --nav-active: rgba(99, 102, 241, 0.16);
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-active: #3730a3;
  --primary-soft: #eef2ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --signal: #0891b2;
  --signal-soft: #ecfeff;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

body {
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
}

/* Header & Top Navigation Bar */
.topbar {
  min-height: 68px;
  padding: 8px 24px;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
  border: 0;
}

.brand-copy strong {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}

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

.release {
  min-height: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, monospace;
}

.workspace-scope {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  flex: 0 1 auto;
  margin-inline-start: 8px;
  margin-inline-end: auto;
}

.workspace-scope label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin: 0;
  min-width: auto;
  max-width: none;
}

.workspace-scope label > span {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  padding-inline: 4px;
}

.workspace-scope select,
.workspace-scope input {
  min-height: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--ink);
  transition: all 0.15s ease;
}

.workspace-scope select:hover,
.workspace-scope input:hover {
  border-color: var(--line-strong);
}

.workspace-scope select:focus,
.workspace-scope input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.workspace-scope .scope-search input {
  min-width: 130px;
  max-width: 170px;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.command-trigger {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.command-trigger:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.command-trigger kbd {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted-2);
}

.notification-trigger,
.theme-toggle,
.mode-toggle,
.sidebar-toggle {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.notification-trigger:hover,
.theme-toggle:hover,
.mode-toggle:hover,
.sidebar-toggle:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
  color: var(--ink);
}

.notification-unread-badge {
  margin-inline-start: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.user-context {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  min-height: 36px;
}

.user-context strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.user-context small {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.25;
}

.health {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--success-soft);
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  animation: pulse-health 2s infinite ease-in-out;
}

@keyframes pulse-health {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.75; }
}

/* Sidebar Navigation */
.layout {
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.sidebar {
  top: 68px;
  height: calc(100vh - 68px);
  min-height: calc(100vh - 68px);
  padding: 16px 12px;
  background: var(--nav);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-intro {
  margin: 0 4px 12px;
  padding: 10px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-kicker {
  color: #6366f1;
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-intro strong {
  color: #f8fafc;
  font-size: 14.5px;
  font-weight: 700;
  margin-top: 4px;
}

.sidebar-intro small {
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.6;
}

.nav-caption {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  padding: 16px 12px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-item {
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease;
  border: 0;
  border-inline-start: 3px solid transparent;
  text-align: start;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(-2px);
}

html[dir="ltr"] .nav-item:hover {
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.16);
  color: #ffffff;
  border-inline-start-color: #6366f1;
  font-weight: 700;
  box-shadow: inset 0 0 16px rgba(99, 102, 241, 0.08);
}

.nav-item.active::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-start: auto;
  border-radius: 999px;
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 10px 4px;
  color: #64748b;
  margin-top: auto;
}

.sidebar-footer span {
  color: #d4d4d8;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-footer small {
  color: #64748b;
  font-size: 11px;
}

/* Main Content Area */
main {
  padding: 28px 32px 64px;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
}

/* Page Hero */
.page-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.page-hero-copy {
  flex: 1 1 auto;
}

.page-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.page-hero p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
  max-width: 680px;
  margin: 0;
}

.eyebrow {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.page-head {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-head h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

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

/* Workflow Guide (Streamlined & Compact Banner) */
.workflow-guide {
  margin: 16px 0 20px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.workflow-guide-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.workflow-guide-copy strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.workflow-guide ol {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.workflow-guide li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
}

.workflow-guide li > span {
  width: 20px;
  height: 20px;
  font-size: 11px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 20px;
}

.workflow-guide li p {
  margin: 0;
  color: var(--ink-soft);
  white-space: normal;
  font-size: 12px;
}

/* Service Readiness & Metric Cards */
.cards, .readiness-grid {
  gap: 12px;
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.cards article {
  min-height: 106px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cards article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.cards article span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.cards article strong {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
  letter-spacing: -0.02em;
}

.cards article small {
  font-size: 11.5px;
  color: var(--muted-2);
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.readiness-card {
  min-height: 74px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.readiness-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: none;
}

.readiness-card > span {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 28px;
}

/* Panels, Action Grids & Data Tables */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

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

.action-card {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.action-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.table-wrap {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  vertical-align: middle;
  transition: background-color 0.15s ease;
}

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

tbody tr:hover td {
  background: var(--surface-subtle);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge.ready,
.badge.completed,
.badge.ok,
.badge.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.25);
}

.badge.running,
.badge.pending,
.badge.converging {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(79, 70, 229, 0.25);
}

.badge.warn,
.badge.warning,
.badge.degraded {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.25);
}

.badge.failed,
.badge.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.25);
}

/* Buttons */
.primary {
  background: var(--primary);
  color: #ffffff;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 20px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary:hover {
  transform: none;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.38);
  filter: brightness(1.05);
}

.secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.secondary:hover {
  background: var(--surface-subtle);
  border-color: var(--muted);
}

.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ghost:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

button.danger {
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--danger);
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

button.danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Progress Bars */
.progress, progress, .op-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
  border: 0;
}

.op-progress::-webkit-progress-value, .progress-fill {
  background: var(--primary);
  border-radius: 999px;
}

/* Form Controls */
.form-section,
.form-advanced,
.operator-impact,
.key-value-grid > div {
  border-color: var(--line);
  border-radius: 12px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-radius: 9px;
}

/* Unified Enterprise Dark Theme */
html[data-theme="dark"] {
  color-scheme: dark;
  --vf-accent: #818cf8;
  --vf-accent-soft: rgba(99, 102, 241, 0.16);
  --bg: #090d16;
  --surface: #111827;
  --surface-subtle: #172133;
  --surface-muted: #1e293b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-active: #4338ca;
  --primary-soft: rgba(99, 102, 241, 0.16);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.16);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.16);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.16);
  --focus-halo: #090d16;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .cards article,
html[data-theme="dark"] .readiness-card,
html[data-theme="dark"] .site-card,
html[data-theme="dark"] .portal-site-card,
html[data-theme="dark"] .ui-empty,
html[data-theme="dark"] .actionable-empty {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme="dark"] .workspace-scope,
html[data-theme="dark"] .health,
html[data-theme="dark"] .journey,
html[data-theme="dark"] .workflow-guide,
html[data-theme="dark"] .site-health-cell,
html[data-theme="dark"] .health-item,
html[data-theme="dark"] .cockpit-summary,
html[data-theme="dark"] .cockpit-actions,
html[data-theme="dark"] .migration-grid article,
html[data-theme="dark"] .telemetry-grid article {
  background: var(--surface-subtle);
  border-color: var(--line);
}

html[data-theme="dark"] .workspace-scope select,
html[data-theme="dark"] .workspace-scope input,
html[data-theme="dark"] .workflow-guide li,
html[data-theme="dark"] .secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] th,
html[data-theme="dark"] tbody tr:hover td {
  background: var(--surface-subtle);
}

html[data-theme="dark"] .command-trigger,
html[data-theme="dark"] .notification-trigger,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .mode-toggle,
html[data-theme="dark"] .sidebar-toggle {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}

html[data-theme="dark"] .command-trigger:hover,
html[data-theme="dark"] .notification-trigger:hover,
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .mode-toggle:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
  color: var(--ink);
}

html[data-theme="dark"] .release {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

/* Responsive Overrides */
@media (max-width: 1180px) {
  .layout { min-height: calc(100vh - 120px); }
  .sidebar { top: 120px; height: calc(100vh - 120px); }
  .workflow-guide { flex-direction: column; align-items: stretch; }
  .workflow-guide ol { justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 960px) {
  .sidebar { top: 0; height: 100vh; }
  main { padding: 20px 16px 48px; }
  .overview-metrics { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; }
}

@media (max-width: 680px) {
  .topbar { min-height: 60px; padding: 8px 12px; }
  .page-hero { padding: 18px; border-radius: 12px; }
  .panel { padding: 16px; border-radius: 12px; }
  .overview-metrics { grid-template-columns: 1fr; }
  .workflow-guide ol { flex-direction: column; align-items: stretch; }
}



/* R7 E2E shell hardening: direction-safe sequence cues and reachable mobile controls. */
.journey i { display: inline-block; }
html[dir="ltr"] .journey i { transform: scaleX(-1); }

@media (max-width: 960px) {
  body.sidebar-open { overflow: hidden; }
}

@media (max-width: 680px) {
  .top-actions {
    width: 100%;
    margin-inline-start: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: visible;
  }
  .mode-toggle {
    width: 44px;
    min-width: 44px;
    padding-inline: 0;
    font-size: 0;
    display: inline-grid;
    place-items: center;
  }
  .mode-toggle::before {
    content: "⚙";
    font-size: 16px;
    line-height: 1;
  }
}

/* ==========================================================================
   4SO Documentation Knowledge Base View
   ========================================================================== */
#view-docs {
  display: none;
}
#view-docs.active {
  display: block;
}

.docs-nav-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding: var(--space-2);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.docs-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
}

.docs-tab-btn:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.docs-tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--primary-soft);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.docs-panel {
  display: none;
}
.docs-panel.active {
  display: block;
  animation: fadeInDocs 0.2s ease-in-out;
}

@keyframes fadeInDocs {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.docs-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}
.docs-banner strong {
  display: block;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: var(--space-1);
}
.docs-banner p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.docs-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.docs-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.docs-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease;
}
.docs-card:hover {
  border-color: var(--line-strong);
}
.docs-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.docs-card h3, .docs-card h4 {
  margin: 0 0 var(--space-2) 0;
  font-size: 16px;
  color: var(--ink);
}
.docs-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.6;
}
.docs-card ul {
  margin: 0;
  padding-inline-start: var(--space-5);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.docs-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.docs-badge.primary { background: var(--primary-soft); color: var(--primary); }
.docs-badge.success { background: var(--success-soft); color: var(--success); }
.docs-badge.info { background: #e0f2fe; color: #0369a1; }
.docs-badge.warn { background: var(--warn-soft); color: var(--warn); }

.docs-step-card {
  display: flex;
  gap: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.step-num {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(61, 90, 241, 0.2);
}
.step-body {
  flex: 1;
  min-inline-size: 0;
}
.step-body h4 {
  margin: 0 0 var(--space-2) 0;
  font-size: 16px;
  color: var(--ink);
}
.step-body p {
  margin: 0 0 var(--space-3) 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.code-box {
  position: relative;
  background: #0f172a;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.code-box pre {
  margin: 0;
  padding: 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
  direction: ltr;
  text-align: start;
}
.copy-code-btn {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.docs-accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.docs-trouble-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.trouble-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.trouble-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.trouble-body p {
  margin: 0 0 var(--space-2) 0;
}

.bench-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.bench-kpi {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  text-align: center;
}
.bench-kpi small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.bench-kpi strong {
  display: block;
  font-size: 15px;
  color: var(--primary);
  font-weight: 700;
}


/* 2026-09-27 VibeFarsi-informed Persian operator redesign — RTL invariants
   restored after the enterprise overhaul dropped them: progress fill follows
   reading direction in Persian. */
html[dir="rtl"] .progress { direction: rtl; }

/* ==========================================================================
   Dedicated Tabbed Site Management Workspace (Cloudflare/AWS Console Style)
   ========================================================================== */
.site-workspace-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-2) 0;
}

.site-workspace-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
}

.site-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 13px;
}

.btn-back-sites {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.btn-back-sites:hover {
  background: var(--primary-soft);
}

.breadcrumb-sep {
  color: var(--muted-2);
}

.breadcrumb-current {
  color: var(--ink-soft);
  font-weight: 600;
}

.site-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-identity-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.site-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.site-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.site-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.site-id-pill {
  background: var(--surface-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.site-url-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.site-meta-dot {
  color: var(--line-strong);
}

.site-quick-actions-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.site-workspace-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 2px solid var(--line);
  padding: 0 var(--space-1);
  margin: 0;
  overflow-x: auto;
}

.site-workspace-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.15s ease;
  margin-bottom: -2px;
}

.site-workspace-tab-btn:hover:not(.active) {
  color: var(--ink);
  background: var(--surface-muted);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.site-workspace-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.site-workspace-tab-btn .tab-icon {
  font-size: 16px;
}

.site-workspace-body {
  min-height: 480px;
}

.site-tab-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  animation: fadeInWorkspace 0.2s ease-in-out;
}

@keyframes fadeInWorkspace {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-health-ribbon-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
}

.ribbon-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.ribbon-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.site-health-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.health-strip-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}

.health-strip-item.ok {
  border-color: rgba(6, 118, 71, 0.25);
  background: var(--success-soft);
}

.health-strip-item.warn {
  border-color: rgba(154, 103, 0, 0.25);
  background: var(--warn-soft);
}

.health-indicator {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.health-strip-item.ok .health-indicator {
  background: var(--success);
  color: #ffffff;
}

.health-strip-item.warn .health-indicator {
  background: var(--warn);
  color: #ffffff;
}

.health-item-text {
  display: flex;
  flex-direction: column;
}

.health-item-text strong {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}

.health-item-text small {
  font-size: 11px;
  color: var(--muted);
}

.site-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 24px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-section-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-xs);
}

.section-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.section-desc {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.site-specs-card,
.site-topology-specs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid var(--line);
}

.spec-label {
  color: var(--muted);
  font-weight: 500;
}

.site-lifecycle-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.action-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
  text-align: start;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-tile:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.action-tile .tile-icon {
  font-size: 24px;
}

.action-tile strong {
  font-size: 14px;
  color: var(--ink);
}

.action-tile small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.action-tile.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.vrt-runner-banner {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
}

.vrt-banner-text h3 {
  margin: 0 0 var(--space-2) 0;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.vrt-banner-text p {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
  max-width: 680px;
  line-height: 1.6;
}

.danger-panel {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.danger-title {
  color: var(--danger);
}

.danger-actions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.danger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--danger-border);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.danger-item strong {
  color: var(--ink);
}

.danger-item strong.danger-text {
  color: var(--danger);
}

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

.empty-state-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.policy-summary-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.policy-item {
  font-size: 13px;
}

.empty-backups-box,
.empty-content-box {
  padding: var(--space-6);
  text-align: center;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  color: var(--muted);
}


/* Installer/HA boundary. app.js sets body[data-service-role] from /healthz.
   Controls that call installer-only routes (404 on the HA Product API) carry
   data-installer-only and are removed on the HA panel; one notice per page
   (data-installer-notice) says where the action runs instead. */
body[data-service-role="product"] [data-installer-only] { display: none !important; }
[data-installer-notice] { display: none; }
body[data-service-role="product"] [data-installer-notice] { display: block; }
.installer-console-notice { margin: 0 0 16px; }
.installer-only-unknown small { color: var(--muted, #6b7280); }
.workflow-guide-close { justify-self: start; min-height: 32px; }
@media (max-width: 640px) { #topbar-queue-chip, #topbar-autopilot-chip { display: none !important; } }
