:root {
  --primary: #0b5fff;
  --primary-hover: #004bcc;
  --primary-soft: #e8f1ff;
  --sidebar-bg: #0f2744;
  --sidebar-accent: #1a3a5c;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e8ecf1;
  --border-strong: #d7dee8;
  --text: #1a2332;
  --text-muted: #5c6b7f;
  --text-subtle: #8b99a8;
  --success-bg: #e8f7ef;
  --success-border: #9dd9b8;
  --success-text: #0d5c2e;
  --shadow-sm: 0 1px 2px rgb(15 39 68 / 6%);
  --shadow-md: 0 4px 14px rgb(15 39 68 / 8%);
  --radius: 10px;
  --radius-pill: 999px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --app-header-offset: 104px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body.app {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-muted);
  display: flex;
}

.app-loading-screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgb(12 18 31 / 42%);
  z-index: 2000;
}

.app-loading-screen__card {
  min-width: 240px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: grid;
  justify-items: center;
  gap: 10px;
}

.app-loading-screen__spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #d8e2f1;
  border-top-color: var(--primary);
  animation: app-spin 0.8s linear infinite;
}

.app-loading-screen__message {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

body.app.app-loading #authGate,
body.app.app-loading .app-sidebar,
body.app.app-loading #appWorkspace {
  visibility: hidden;
}

body.app.app-loading .app-loading-screen {
  display: flex;
}

/* —— Primary sidebar (icons + short labels) —— */
.app-sidebar {
  width: 212px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0a1a2e 100%);
  border-right: 1px solid rgb(255 255 255 / 6%);
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 16px 10px 20px;
  position: sticky;
  top: 0;
}

.app-sidebar-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 6px 8px;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.app-sidenav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-customer-switcher {
  padding: 4px 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-customer-switcher__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: stretch;
}

.sidebar-customer-switcher__trigger {
  text-align: left;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 18%);
  background: rgb(7 17 30 / 75%);
  color: #fff;
  box-shadow: none;
  padding: 8px 10px;
}

.sidebar-customer-switcher__trigger-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 72%);
}

.sidebar-customer-switcher__trigger-value {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-customer-switcher__cog-btn {
  min-width: 36px;
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 16%);
  background: rgb(255 255 255 / 4%);
  color: rgb(255 255 255 / 92%);
  box-shadow: none;
}

.sidebar-customer-switcher__cog-btn:hover:not(:disabled) {
  background: rgb(255 255 255 / 12%);
}

.sidebar-customer-switcher__cog-btn svg {
  display: block;
}

#tenantSettingsModal .stack > button {
  padding: 9px 11px;
  border-radius: 8px;
  text-align: left;
}

.sidebar-customer-switcher__select {
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 20%);
  background: rgb(7 17 30 / 75%);
  color: #fff;
  font-family: var(--font);
  font-size: 0.8125rem;
  padding: 8px 10px;
}

.sidebar-customer-switcher__select:focus {
  outline: 2px solid rgb(11 95 255 / 55%);
  outline-offset: 1px;
}

.app-sidenav__btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: rgb(255 255 255 / 78%);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.app-sidenav__btn:hover {
  color: #fff;
  background: rgb(255 255 255 / 8%);
}

.app-sidenav__btn.is-active {
  color: #fff;
  background: rgb(255 255 255 / 14%);
  box-shadow: inset 3px 0 0 0 var(--primary);
}

.app-sidenav__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-sidenav__icon {
  flex: 0 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.app-sidenav__label {
  flex: 1;
  min-width: 0;
}

@media (max-width: 520px) {
  .app-sidebar {
    width: 72px;
  }

  .app-sidenav__btn {
    position: relative;
  }

  .app-sidenav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .app-sidenav__btn {
    justify-content: center;
    padding: 10px 8px;
  }

  .app-sidebar-mark {
    margin: 0 auto 8px;
  }
}

/* —— Main shell —— */
.app-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  :root {
    --app-header-offset: 156px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .app-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .status-chip {
    max-width: none;
    text-align: left;
  }

  #statusText.status-chip {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-header-mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
}

.app-header-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  min-width: 0;
}

.app-header-text h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.app-active-customer-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  max-width: min(320px, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.app-tagline {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.45;
}

.app-header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.status-chip {
  display: inline-block;
  max-width: min(380px, 42vw);
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  text-align: right;
  word-break: break-word;
}

#statusText.status-chip {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 50;
  max-width: min(520px, calc(100vw - 28px));
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.home-panel {
  margin: 0 20px 24px;
  padding: 20px 22px 24px;
}

.home-panel__title {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.home-panel__lead {
  margin: 0 0 18px;
  max-width: 44rem;
}

.home-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.home-panel__card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.home-panel__stat {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-panel__stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.home-panel__stat-note {
  margin: 0 0 10px;
  font-size: 0.8125rem;
}

.home-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-panel__total {
  margin: 10px 0 0;
  font-size: 0.875rem;
}

.home-panel__actions {
  gap: 10px;
  align-items: center;
}

.migration-contributors-list-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.migration-contributors-list-mount {
  min-height: 1.5rem;
}

.migration-contributors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.migration-contributors-table th,
.migration-contributors-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.migration-contributors-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
}

.migration-contributors-table .row-actions {
  white-space: nowrap;
  text-align: right;
}

.home-status-chart {
  margin: 12px 0 14px;
}

.home-status-chart__bar {
  display: flex;
  height: 22px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.home-status-chart__seg {
  min-width: 3px;
  height: 100%;
  transition: opacity 0.15s ease;
}

.home-status-chart__seg:hover {
  opacity: 0.88;
}

.home-status-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.home-status-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-status-chart__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.dashboard-panel {
  margin: 0 20px 24px;
  padding: 20px 22px 24px;
}

.dashboard-panel__title {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.dashboard-panel__lead {
  margin: 0 0 16px;
  max-width: 52rem;
}

.dashboard-filters {
  gap: 12px 16px;
  margin-bottom: 14px;
  align-items: flex-end;
}

.dashboard-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.dashboard-filter--grow {
  flex: 1 1 220px;
  min-width: 200px;
}

.dashboard-filter__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-filters__actions {
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.dashboard-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-summary__chip {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.dashboard-summary__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  width: 100%;
}

.dashboard-table-wrap {
  margin-bottom: 12px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.dashboard-table th,
.dashboard-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
}

.dashboard-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
}

.dashboard-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.dashboard-table tbody tr:hover {
  background: rgb(11 95 255 / 4%);
}

.dashboard-table tbody tr.is-selected {
  background: var(--primary-soft);
}

.dashboard-table .cell-mono {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.75rem;
  word-break: break-all;
}

.dashboard-table .cell-error {
  max-width: 14rem;
  color: #9a3412;
  word-break: break-word;
}

.dashboard-pagination {
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.dashboard-detail {
  padding: 16px 18px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dashboard-detail__actions {
  gap: 8px;
  margin-bottom: 12px;
}

/* —— Horizontal tabs (stepper) —— */
.app-tabs-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 12px 0 20px;
}

#wizardChromeAppTabs.app-tabs-bar {
  position: sticky;
  top: var(--app-header-offset);
  z-index: 35;
  min-height: 56px;
}

.stepper {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stepper::-webkit-scrollbar {
  display: none;
}

.stepper li {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 18px 12px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--text-subtle);
  font-size: 0.8125rem;
  font-weight: 600;
  user-select: none;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.stepper li.clickable {
  cursor: pointer;
  color: var(--text-muted);
}

.stepper li.clickable:hover {
  color: var(--primary);
  background: rgb(11 95 255 / 4%);
}

.stepper li.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  cursor: default;
}

.stepper-index {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

.stepper li.active .stepper-index {
  opacity: 1;
}

.stepper-label {
  white-space: nowrap;
}


/* —— Wizard content —— */
.wizard {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 40px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.step {
  display: none;
}

.step.active {
  display: block;
}

/* Wizard scope: steps outside allowed range are not shown (migration contributor). */
.step.wizard-step-hidden {
  display: none !important;
}

.panel-subtitle {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.client-deeplink-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

h2 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

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

.row-snapshot-toolbar {
  align-items: stretch;
}

.snapshot-select {
  flex: 1 1 16rem;
  min-width: min(100%, 14rem);
  max-width: 100%;
}

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

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

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

input:not([type="file"]),
select,
textarea {
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:not([type="file"]):hover,
select:hover,
textarea:hover {
  border-color: #c5ced9;
}

input:not([type="file"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(11 95 255 / 18%);
}

button {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  font-weight: 500;
  box-shadow: 0 1px 0 rgb(0 0 0 / 3%);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: #c5ced9;
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(11 95 255 / 22%);
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgb(11 95 255 / 25%);
}

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

.btn-ghost {
  background: var(--surface);
  font-size: 0.75rem;
  padding: 4px 10px;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.wizard-nav button {
  min-width: 112px;
}

.btn-ghost-nav {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.btn-ghost-nav:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-primary-nav {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  border-radius: var(--radius-pill);
  padding: 10px 28px;
  font-weight: 600;
  min-width: 120px;
  box-shadow: var(--shadow-md);
}

.btn-primary-nav:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.output {
  max-height: 240px;
  overflow: auto;
  background: #1e293b;
  color: #f1f5f9;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.45;
  border: 1px solid #334155;
}

.tree {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 10px;
  background: var(--surface-muted);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.75rem;
}

.stage-panel > .tree,
.stage-panel .stack > .tree {
  margin-top: 0;
}

.tree-row {
  padding: 4px 8px;
  border-radius: 6px;
  margin: 2px 0;
}

.tree-row.unmapped {
  color: var(--text);
}

.tree-row.mapped-direct {
  background: #e8f7ef;
  color: #0d5c2e;
}

.tree-row.mapped-inherited {
  background: var(--primary-soft);
  color: #0a3d91;
}

.row-locked {
  background: var(--surface-muted);
  color: var(--text-subtle);
}

.row-direct {
  background: #f0fdf4;
}

.folder-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-indent {
  display: inline-block;
  width: 14px;
  height: 1px;
}

.icon-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  min-width: 32px;
  height: 32px;
  line-height: 1;
  padding: 0;
  border-radius: 8px;
  color: var(--primary);
  box-shadow: none;
}

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

.table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

th {
  background: var(--surface-muted);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 12px 14px;
}

td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 12px 14px;
  vertical-align: middle;
}

tbody tr:hover td {
  background: rgb(11 95 255 / 3%);
}

.muted {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.permission-grid,
.stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .permission-grid,
  .stage-grid {
    grid-template-columns: 1fr;
  }
}

.permission-panel,
.stage-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface-muted);
}

/* Stages 1 & 5 — one panel uses full content width (within .wizard max-width) */
.stage-panel--full {
  width: 100%;
  max-width: none;
}

/* Force one column (instructions above, content below) — Stages 2, 3, 4, 10 */
.stage-grid--stacked {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
  width: 100%;
}

.wizard-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.wizard-list li {
  margin-bottom: 0.35em;
}

.wizard-list li:last-child {
  margin-bottom: 0;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row.wrap {
  flex-wrap: wrap;
}

.token-generate-row,
.token-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

[data-tenant-setup-step="0"] .panel-title {
  margin-top: 10px;
  margin-bottom: 14px;
}

[data-tenant-setup-step="0"] .token-generate-row {
  margin-bottom: 8px;
}

[data-tenant-setup-step="0"] .token-copy-row {
  margin-bottom: 6px;
}

[data-tenant-setup-step="1"] .panel-title {
  margin-top: 10px;
  margin-bottom: 12px;
}

[data-tenant-setup-step="1"] .hint {
  margin-bottom: 8px;
}

[data-tenant-setup-step="1"] .wizard-list {
  margin-bottom: 10px;
}

[data-tenant-setup-step="1"] .form-grid {
  margin-top: 4px;
}

.token-generate-row button,
.token-copy-row button {
  min-width: 136px;
  white-space: nowrap;
}

.token-generate-row input,
.token-copy-row input {
  width: 100%;
  min-width: 0;
}

input.grow,
select.grow {
  flex: 1 1 200px;
  min-width: 160px;
}

.inline-label span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.user-multiselect {
  width: 100%;
  min-height: 220px;
  font-size: 0.8125rem;
  border-radius: 8px;
}

.roles-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
}

.role-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.role-card:hover {
  border-color: #c5ced9;
}

.role-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.role-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.role-card-title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
}

.role-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.role-members {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-height: 72px;
  overflow: auto;
}

.actions-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.actions-bar--flush {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.actions-bar.wrap {
  flex-wrap: wrap;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
}

.status-pill[data-state="ok"] {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.status-pill[data-state="pending"] {
  color: var(--text-muted);
  border-style: dashed;
}

.output-download-bar {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 6px;
}

.btn-download-output {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  box-shadow: none;
}

.btn-download-output:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.debug-details {
  margin-top: 16px;
  font-size: 0.8125rem;
}

.debug-details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
}

.debug-details summary:hover {
  color: var(--primary);
}

.assignments-table select {
  min-width: 160px;
}

.row-parent-read td {
  font-size: 0.8125rem;
  background: var(--primary-soft);
}

.row-parent-read:hover td {
  background: #dceaff;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.row-parent-read .level-pill {
  background: #fff;
  border-color: rgb(11 95 255 / 35%);
  color: var(--primary);
}

code {
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--surface-muted);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* —— Full-screen login (gate) —— */
body.app.auth-mode {
  min-height: 100vh;
}

body.app.landing-mode {
  min-height: 100vh;
}

body.app.auth-mode .app-sidebar,
body.app.auth-mode #appWorkspace {
  display: none !important;
}

body.app.landing-mode .app-sidebar,
body.app.landing-mode #appWorkspace,
body.app.landing-mode #authGate {
  display: none !important;
}

body.app.auth-mode #authGate {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}

body.app.landing-mode #landingPage {
  display: flex;
}

body.app:not(.auth-mode) #authGate {
  display: none !important;
}

body.app:not(.landing-mode) #landingPage {
  display: none !important;
}

/* TrailTracker-style landing layout */
#landingPage.landing-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

#landingPage .container {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

#landingPage .navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgb(255 255 255 / 98%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgb(226 232 240 / 80%);
  z-index: 1000;
  padding: 1rem 0;
}

#landingPage .navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#landingPage .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2563eb;
}

#landingPage .brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

#landingPage .navbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

#landingPage .nav-link {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

#landingPage .nav-link:hover {
  color: #2563eb;
}

#landingPage .hero {
  padding: 6.5rem 0 5rem;
  min-height: 100vh;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  display: flex;
  align-items: center;
}

#landingPage .hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

#landingPage .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgb(59 130 246 / 10%);
  color: #2563eb;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

#landingPage .hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: #0f172a;
}

#landingPage .text-gradient {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#landingPage .hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 1.5rem;
}

#landingPage .hero-actions,
#landingPage .cta-actions {
  display: flex;
  gap: 0.9rem;
}

#landingPage .dashboard-preview {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 25%);
  overflow: hidden;
}

#landingPage .preview-header {
  background: #f8fafc;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#landingPage .preview-dots {
  display: flex;
  gap: 0.4rem;
}

#landingPage .preview-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

#landingPage .preview-content {
  padding: 1rem;
}

#landingPage .preview-chart {
  height: 110px;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
  border: 1px solid #dbe7fb;
  margin-bottom: 1rem;
}

#landingPage .preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

#landingPage .stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  padding: 0.75rem;
  text-align: center;
}

#landingPage .stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

#landingPage .stat-label {
  font-size: 0.74rem;
  color: #64748b;
}

#landingPage .features,
#landingPage .benefits,
#landingPage .faq,
#landingPage .cta {
  padding: 5rem 0;
}

#landingPage .landing-logos {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.1rem 0;
}

#landingPage .landing-logos__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

#landingPage .landing-logos__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe7fb;
  background: #f8fbff;
  color: #334155;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
}

#landingPage .features {
  background: #fff;
}

#landingPage .benefits,
#landingPage .faq {
  background: #f8fafc;
}

#landingPage .section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

#landingPage .section-badge {
  display: inline-block;
  background: rgb(59 130 246 / 10%);
  color: #2563eb;
  padding: 0.45rem 0.9rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

#landingPage .section-header h2 {
  font-size: 2.2rem;
  margin: 0 0 0.6rem;
}

#landingPage .section-header p {
  margin: 0 auto;
  max-width: 680px;
  color: #64748b;
}

#landingPage .features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

#landingPage .feature-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
}

#landingPage .feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  margin-bottom: 0.7rem;
}

#landingPage .feature-icon svg {
  display: block;
}

#landingPage .benefits-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

#landingPage .benefit-list {
  display: grid;
  gap: 1rem;
}

#landingPage .benefit-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
}

#landingPage .benefit-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}

#landingPage .benefit-icon svg {
  display: block;
}

#landingPage .stats-showcase {
  display: grid;
  gap: 0.8rem;
}

#landingPage .stat-card-large {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
}

#landingPage .stat-card-large .stat-number {
  font-weight: 800;
  color: #2563eb;
  font-size: 1.35rem;
}

#landingPage .stat-trend {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #0f3f9a;
  font-size: 0.78rem;
  font-weight: 600;
}

#landingPage .faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

#landingPage .faq-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  overflow: hidden;
}

#landingPage .faq-question {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

#landingPage .faq-question h4 {
  margin: 0;
  font-size: 1rem;
}

#landingPage .faq-answer {
  display: none;
  padding: 0 1rem 1rem;
  color: #64748b;
}

#landingPage .faq-item.active .faq-answer {
  display: block;
}

#landingPage .cta {
  background: #fff;
}

#landingPage .cta-content {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

#landingPage .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.2rem;
  border-radius: 0.6rem;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

#landingPage .btn-primary {
  background: #2563eb;
  color: #fff;
}

#landingPage .btn-outline {
  background: transparent;
  color: #2563eb;
  border: 2px solid #2563eb;
}

#landingPage .btn-lg {
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
}

#landingPage .pricing-toggle {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: 0.8rem;
  background: #eaf1ff;
  border: 1px solid #d4e1fb;
  margin: 0 auto 1.25rem;
}

#landingPage .pricing-toggle--secondary {
  margin-top: -0.4rem;
}

#landingPage .pricing-toggle__btn {
  border: 1px solid transparent;
  background: transparent;
  color: #1e3a8a;
  border-radius: 0.6rem;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#landingPage .pricing-toggle__btn.is-active {
  background: #fff;
  border-color: #b9ccf4;
  box-shadow: 0 4px 10px rgb(15 39 68 / 8%);
}

#landingPage .pricing-panel {
  margin-top: 0.75rem;
}

#landingPage .pricing-section-split + .pricing-section-split {
  margin-top: 1rem;
}

#landingPage .pricing-section-title {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  color: #0f172a;
}

#landingPage .pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

#landingPage .pricing-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  transition: all 0.25s ease;
  position: relative;
}

#landingPage .pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 10%);
  border-color: #bfdbfe;
}

#landingPage .pricing-card.featured {
  border-color: #3b82f6;
  box-shadow: 0 10px 25px rgb(59 130 246 / 15%);
}

#landingPage .pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

#landingPage .pricing-header {
  text-align: center;
  margin-bottom: 1rem;
}

#landingPage .pricing-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.7rem;
}

#landingPage .price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

#landingPage .currency {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
}

#landingPage .amount {
  font-size: 2rem;
  font-weight: 800;
  color: #2563eb;
  line-height: 1;
}

#landingPage .period {
  font-size: 0.88rem;
  color: #64748b;
}

#landingPage .pricing-header p {
  color: #475569;
  font-size: 0.9rem;
  margin: 0;
}

#landingPage .pricing-features {
  margin-bottom: 0.35rem;
}

#landingPage .pricing-features .feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.45;
}

#landingPage .pricing-features .feature-item::before {
  content: "•";
  color: #10b981;
  font-weight: 700;
  line-height: 1;
}

#landingPage .pricing-policy-note {
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.84rem;
}

@media (max-width: 900px) {
  #landingPage .hero-content,
  #landingPage .benefits-content,
  #landingPage .features-grid,
  #landingPage .faq-grid,
  #landingPage .pricing-grid {
    grid-template-columns: 1fr;
  }

  #landingPage .hero-title {
    font-size: 2.2rem;
  }

  #landingPage .navbar-actions .nav-link {
    display: none;
  }
}

.landing-page {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.landing-page__hero,
.landing-page__section,
.landing-page__footer {
  width: 100%;
  border-radius: 0;
}

.landing-page__hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  transform: none;
}

.landing-page__brand-banner {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: linear-gradient(165deg, #0f1f38 0%, #0a1528 55%, #0d2138 100%);
  border: 1px solid #102341;
  border-bottom: none;
}

.landing-page__brand-banner-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  padding-top: 9px;
  padding-bottom: 9px;
  padding-left: max(14px, calc((100vw - 1160px) / 2 + 14px));
  padding-right: max(14px, calc((100vw - 1160px) / 2 + 14px));
}

.landing-page__brand-logo {
  width: 33px;
  height: 33px;
  object-fit: contain;
  display: block;
}

.landing-page__brand-name {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
}

.landing-page__hero {
  padding: 20px 28px 42px;
  min-height: 75vh;
  color: #fff;
  border: none;
  box-shadow: none;
  background:
    radial-gradient(circle at 82% 23%, rgb(255 255 255 / 18%) 0 54px, transparent 55px),
    radial-gradient(circle at 12% 80%, rgb(255 255 255 / 14%) 0 5px, transparent 6px),
    linear-gradient(165deg, #0f1f38 0%, #0a1528 55%, #0d2138 100%);
  position: relative;
  overflow: hidden;
}

/*
  Keep hero background full-bleed while aligning hero content
  with the same framed page margins as the sections below.
*/
.landing-page__hero {
  --landing-frame-max: 1160px;
  --landing-frame-gutter: 14px;
  padding-left: max(14px, calc((100vw - var(--landing-frame-max)) / 2 + var(--landing-frame-gutter)));
  padding-right: max(14px, calc((100vw - var(--landing-frame-max)) / 2 + var(--landing-frame-gutter)));
}

.landing-page__hero::before {
  content: "";
  position: absolute;
  left: -18%;
  right: -16%;
  bottom: -94px;
  height: 180px;
  background: rgb(255 255 255 / 13%);
  border-radius: 50%;
  pointer-events: none;
}

.landing-page__hero::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -8%;
  bottom: -114px;
  height: 174px;
  background: rgb(255 255 255 / 28%);
  border-radius: 50%;
  pointer-events: none;
}

.landing-page__hero,
.landing-page__section,
.landing-page__footer {
  padding-left: clamp(18px, 3.2vw, 52px);
  padding-right: clamp(18px, 3.2vw, 52px);
}

.landing-page__header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: calc(1160px - 28px);
  margin-left: auto;
  margin-right: auto;
}

.landing-page__logo {
  height: auto;
}

.landing-page__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 10%);
  backdrop-filter: blur(4px);
}

.landing-page__nav a {
  color: rgb(255 255 255 / 86%);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.landing-page__nav a:hover {
  color: #fff;
}

.landing-page__cta-top {
  border: none;
  border-radius: 10px;
  background: #c45c26;
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  margin-left: 0;
}

.landing-page__cta-top:hover {
  background: #af4f1d;
}

.landing-page__hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 740px;
  margin: 44px auto 0;
}

.landing-page__hero-content h1 {
  margin: 8px auto 12px;
  max-width: 20ch;
  font-size: clamp(1.95rem, 3.2vw, 2.75rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.landing-page__lead {
  margin: 0 auto;
  color: rgb(235 241 255 / 92%);
  max-width: 68ch;
}

.landing-page__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: rgb(222 231 255 / 85%);
  font-weight: 700;
}

.landing-page__hero-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.landing-page__hero-metrics {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.landing-page__hero-metrics span {
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 30%);
  background: rgb(255 255 255 / 12%);
  padding: 6px 10px;
  font-size: 0.78rem;
  color: rgb(240 245 255 / 95%);
}

.landing-page__ghost-light {
  border-radius: 10px;
  border: 1px solid rgb(141 184 255 / 46%);
  background: rgb(255 255 255 / 10%);
  color: #dbeaff;
  text-decoration: none;
  padding: 9px 14px;
  font-weight: 600;
}

.landing-page__ghost-light:hover {
  background: rgb(141 184 255 / 20%);
}

.landing-page__hero-points {
  list-style: none;
  margin: 16px auto 0;
  padding: 0;
  color: rgb(235 241 255 / 88%);
  display: grid;
  gap: 3px;
  max-width: 540px;
}

.landing-page__hero-accent {
  position: absolute;
  left: 22px;
  bottom: 18px;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.landing-page__hero-dots {
  display: flex;
  gap: 7px;
}

.landing-page__hero-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 35%);
}

.landing-page__hero-dots span.is-active {
  background: #fff;
}

.landing-page__hero-icon-row {
  display: flex;
  gap: 8px;
}

.landing-page__hero-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(255 255 255 / 35%);
  background: rgb(255 255 255 / 11%);
  color: #fff;
}

.landing-page__section {
  padding-top: 44px;
  padding-bottom: 44px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #e6edf9;
  box-shadow: 0 12px 28px rgb(15 39 68 / 6%);
}

.landing-page__section h2,
.landing-page__footer h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.landing-page__section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 16px;
}

.landing-page__section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d5e2fb;
  background: #eef4ff;
  color: #325fbe;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

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

.landing-page__card {
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid #dfe9fb;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 18px rgb(15 39 68 / 7%);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.landing-page__card:hover {
  transform: translateY(-3px);
  border-color: #cfe0fb;
  box-shadow: 0 16px 26px rgb(15 39 68 / 10%);
}

.landing-page__card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.landing-page__card p,
.landing-page__section p {
  margin: 0;
  color: var(--text-muted);
}

.landing-page__steps {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
  counter-reset: landing-step;
}

.landing-page__steps li {
  counter-increment: landing-step;
  position: relative;
  border: 1px solid #dfe9fb;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px 12px 44px;
  box-shadow: 0 8px 16px rgb(15 39 68 / 6%);
}

.landing-page__steps li::before {
  content: counter(landing-step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3f6de0;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.landing-page__steps p {
  margin-top: 2px;
}

.landing-page__split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: start;
}

.landing-page__split-copy h2 {
  margin-bottom: 12px;
}

.landing-page__benefit-list {
  display: grid;
  gap: 12px;
}

.landing-page__benefit-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e6edf9;
  background: #f8fbff;
}

.landing-page__benefit-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: #3f6de0;
}

.landing-page__benefit-item h3 {
  margin: 0 0 4px;
  font-size: 0.96rem;
}

.landing-page__benefit-item p {
  margin: 0;
}

.landing-page__split-stats {
  display: grid;
  gap: 10px;
}

.landing-page__stat-card-large {
  border: 1px solid #e6edf9;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 6px 14px rgb(15 39 68 / 6%);
}

.landing-page__stat-card-large strong {
  display: block;
  font-size: 0.94rem;
}

.landing-page__stat-card-large span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.landing-page__section--faq .landing-page__section-header {
  margin-bottom: 14px;
}

.landing-page__faq-list {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 8px;
}

.landing-page__faq-item {
  border: 1px solid #dbe7fb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 16px rgb(15 39 68 / 6%);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.landing-page__faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgb(15 39 68 / 10%);
}

.landing-page__faq-question {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.landing-page__faq-question:hover {
  background: #eef4ff;
}

.landing-page__faq-answer {
  padding: 0 14px 12px;
}

.landing-page__faq-answer p {
  margin: 0;
  color: var(--text-muted);
}

.landing-page__section--trust {
  background: linear-gradient(180deg, #f7fbff 0%, #eef4ff 100%);
}

.landing-page__section--trust p {
  max-width: 880px;
  margin: 0 auto;
  border: 1px solid #d8e4fb;
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 16px rgb(15 39 68 / 6%);
}

.landing-page__strip {
  background: #f7f8fc;
  border-top: 1px solid #e8ebf4;
  border-bottom: 1px solid #e8ebf4;
  border-left: 1px solid #e8ecf5;
  border-right: 1px solid #e8ecf5;
}

.landing-page__strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  justify-content: center;
  align-items: center;
  color: #7f8aa0;
  font-weight: 600;
  padding: 16px clamp(18px, 3.2vw, 52px);
}

.landing-page__band {
  background: linear-gradient(165deg, #0f1f38 0%, #0a1528 55%, #0d2138 100%);
  padding: 50px clamp(18px, 3.2vw, 52px);
  border-left: 1px solid #dce5f8;
  border-right: 1px solid #dce5f8;
  border-radius: 0 0 30px 30px;
}

.landing-page__band-card {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e9f4;
  padding: 24px;
  text-align: center;
  box-shadow: 0 8px 20px rgb(15 39 68 / 10%);
}

.landing-page__band-card h2 {
  margin: 0 0 10px;
}

.landing-page__band-card p {
  margin: 0;
  color: var(--text-muted);
}

.landing-page__band-points {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-page__band-points div {
  background: #f8fbff;
  border: 1px solid #e7edf9;
  border-radius: 10px;
  padding: 12px;
}

.landing-page__band-points strong {
  display: block;
  font-size: 0.9rem;
}

.landing-page__band-points span {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.landing-page__feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px solid #dfe9fb;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f6faff);
  box-shadow: 0 8px 18px rgb(15 39 68 / 7%);
}

.landing-page__feature-row + .landing-page__feature-row {
  margin-top: 14px;
}

.landing-page__feature-row--reverse .landing-page__feature-visual {
  order: 2;
}

.landing-page__feature-row--reverse .landing-page__feature-copy {
  order: 1;
}

.landing-page__feature-visual {
  background: linear-gradient(180deg, #f9fbff, #f2f7ff);
  border: 1px solid #e3eaf8;
  border-radius: 14px;
  min-height: 210px;
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.landing-page__mock-chart {
  width: 64%;
  height: 125px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f1f5fe);
  border: 1px solid #e4eaf7;
  box-shadow: 0 8px 16px rgb(15 39 68 / 8%);
}

.landing-page__mock-chart::before {
  content: "";
  display: block;
  width: 86%;
  height: 2px;
  margin: 20px auto 0;
  background: #d8e2f6;
  box-shadow:
    0 20px 0 #d8e2f6,
    0 40px 0 #d8e2f6,
    0 60px 0 #d8e2f6;
}

.landing-page__mock-ring {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 8px solid #d8e5ff;
  border-top-color: #4b7ef5;
  display: grid;
  place-items: center;
  color: #3f6de0;
  font-weight: 700;
}

.landing-page__feature-copy h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.landing-page__feature-copy p {
  margin: 0;
}

.landing-page__footer {
  background: #fff;
  padding-top: 32px;
  padding-bottom: 32px;
  border: 1px solid #e8ecf5;
  border-top: none;
  border-radius: 0 0 22px 22px;
}

.landing-page__footer p {
  margin: 0;
  color: var(--text-muted);
}

.landing-page__hero {
  border-radius: 0 0 26px 26px;
}

.landing-page__strip {
  border-radius: 0 0 18px 18px;
}

.landing-page__section {
  border-radius: 18px;
  margin-top: 10px;
}

.landing-page__section--trust {
  border-radius: 20px;
}

@media (max-width: 860px) {
  .landing-page {
    padding: 8px 8px 20px;
  }

  .landing-page__header {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }

  .landing-page__brand-banner-inner {
    padding-left: max(8px, calc((100vw - 1160px) / 2 + 8px));
    padding-right: max(8px, calc((100vw - 1160px) / 2 + 8px));
  }

  .landing-page__nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .landing-page__hero {
    padding: 18px 16px 40px;
    min-height: 70vh;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    transform: none;
    --landing-frame-gutter: 8px;
    padding-left: max(8px, calc((100vw - var(--landing-frame-max)) / 2 + var(--landing-frame-gutter)));
    padding-right: max(8px, calc((100vw - var(--landing-frame-max)) / 2 + var(--landing-frame-gutter)));
  }

  .landing-page__section,
  .landing-page__footer,
  .landing-page__hero {
    padding-left: 14px;
    padding-right: 14px;
  }

  .landing-page__hero-content {
    margin-top: 34px;
  }

  .landing-page__hero-accent {
    left: 12px;
    bottom: 12px;
  }

  .landing-page__grid {
    grid-template-columns: 1fr;
  }

  .landing-page__band {
    padding: 30px 14px;
  }

  .landing-page__band-points {
    grid-template-columns: 1fr;
  }

  .landing-page__feature-row {
    grid-template-columns: 1fr;
  }

  .landing-page__split {
    grid-template-columns: 1fr;
  }

  .landing-page__feature-row--reverse .landing-page__feature-visual,
  .landing-page__feature-row--reverse .landing-page__feature-copy {
    order: initial;
  }
}

.auth-page {
  background: var(--surface-muted);
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.auth-page__inner {
  display: flex;
  width: 100%;
  max-width: 960px;
  min-height: min(640px, 100vh);
  margin: auto;
  background: var(--surface);
  border-radius: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

@media (min-width: 769px) {
  .auth-page {
    padding: 32px 24px;
    align-items: center;
  }

  .auth-page__inner {
    border-radius: 16px;
    min-height: 520px;
    max-height: calc(100vh - 64px);
  }
}

.auth-page__aside {
  flex: 0 0 38%;
  min-width: 0;
  background: linear-gradient(165deg, #0f1f38 0%, #0a1528 55%, #0d2138 100%);
  color: rgb(255 255 255 / 92%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 28px 28px;
  position: relative;
}

.auth-page__aside-content {
  position: relative;
  z-index: 1;
}

.auth-page__logo-badge {
  width: auto;
  height: auto;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  box-shadow: none;
}

.auth-page__logo-img {
  display: block;
  max-height: 56px;
  width: auto;
  max-width: min(220px, 88vw);
  object-fit: contain;
}

.auth-page__welcome {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.auth-page__lead {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgb(255 255 255 / 72%);
  max-width: 22rem;
}

.auth-page__dots {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

.auth-page__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(255 255 255 / 22%);
}

.auth-page__dots span.is-active {
  background: var(--primary);
  width: 22px;
  border-radius: 4px;
}

.auth-page__illustration {
  margin-top: 24px;
  opacity: 0.95;
}

.auth-page__illustration-svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.auth-page__main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 32px 32px;
  background: var(--surface);
}

.auth-page__main-inner {
  width: 100%;
  max-width: 400px;
  min-height: 620px;
}

.auth-page__eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.auth-page__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-page__subtitle {
  margin: 0 0 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.auth-page__info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

@media (max-width: 520px) {
  .auth-page__info-row {
    grid-template-columns: 1fr;
  }
}

.auth-page__info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: var(--surface-muted);
}

.auth-page__info-card p {
  margin: 0;
}

.auth-page__info-icon {
  display: flex;
  color: var(--primary);
  margin-bottom: 8px;
}

.auth-page__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 14px;
}

.auth-page__label:first-child {
  margin-top: 0;
}

.auth-page__fields--compact .auth-page__label:first-child {
  margin-top: 0;
}

.auth-page__input,
.auth-page__select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
}

.auth-page__input:focus,
.auth-page__select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.auth-page__btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.auth-page__btn--primary {
  background: var(--primary);
  color: #fff;
}

.auth-page__btn--primary:hover {
  background: var(--primary-hover);
}

.auth-page__btn--secondary {
  margin-top: 12px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.auth-page__btn--secondary:hover {
  background: var(--primary-soft);
}

.auth-page__signup-field {
  display: grid;
  gap: 8px;
}

.auth-flow-create-only.is-hidden {
  visibility: hidden;
}

.auth-page__create-toggle {
  margin: 8px 0 2px;
  text-align: center;
}

.auth-page__create-toggle-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-subtle);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.auth-page__create-toggle-btn:hover {
  color: var(--text-default);
}

.auth-page__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 8px;
  color: var(--text-subtle);
  font-size: 0.8125rem;
}

.auth-page__divider-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-page__divider-action:hover {
  color: var(--text-default);
}

.auth-page__divider::before,
.auth-page__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-page__msp-sales-note {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.auth-page__inline-link {
  color: var(--accent, #3d8aed);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-page__inline-link:hover {
  text-decoration: none;
}

.auth-page__footer {
  margin: 24px 0 0;
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-align: center;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .auth-page__inner {
    flex-direction: column;
    max-height: none;
    min-height: 100vh;
    border-radius: 0;
  }

  .auth-page__aside {
    flex: none;
    padding: 28px 24px 20px;
  }

  .auth-page__illustration {
    display: none;
  }

  .auth-page__main {
    padding: 28px 20px 40px;
  }

  .auth-page__main-inner {
    min-height: 0;
  }
}

.preflight-staleness-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border, #2a3340);
  background: var(--surface-elevated, #151b24);
  font-size: 0.9rem;
  line-height: 1.45;
}

.preflight-staleness-banner[data-variant="warn"] {
  border-color: #8a6d2b;
  background: rgba(138, 109, 43, 0.12);
}

.preflight-staleness-banner[data-variant="ok"] {
  border-color: #2d6a4f;
  background: rgba(45, 106, 79, 0.1);
}

.preflight-staleness-inline {
  margin-top: 8px;
}

.preflight-diff-summary {
  margin-top: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.preflight-diff-summary table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.85rem;
}

.preflight-diff-summary th,
.preflight-diff-summary td {
  border: 1px solid var(--border, #2a3340);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.preflight-diff-summary th {
  background: var(--surface-elevated, #151b24);
}

.preflight-ack-row {
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.preflight-path {
  word-break: break-all;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.82em;
}

.preflight-rule-head {
  margin: 12px 0 6px;
  font-size: 0.92rem;
}

.preflight-nested-table {
  margin-bottom: 12px;
}

.preflight-jump-link {
  color: var(--accent, #3d8aed);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.preflight-jump-link:hover {
  text-decoration: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

.modal-shell[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(10 18 32 / 55%);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 18px;
}

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

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
}

.tenant-selector-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.tenant-selector-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-muted);
}
