/*
 * Iderwell Hotspot quality system
 *
 * This is the single product-level contract for identity, typography, density,
 * page families and shared controls. Older route styles remain responsible for
 * route-specific composition; this file owns the cross-product decisions.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext-400-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-400-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --iderwell-navy-950: #05243f;
  --iderwell-navy-900: #003b7a;
  --iderwell-navy-800: #084a83;
  --iderwell-blue-600: #0078d4;
  --iderwell-blue-400: #50a8e8;
  --iderwell-blue-100: #dceffd;
  --iderwell-blue-050: #eef7fe;

  --ui-canvas: #f4f7fa;
  --ui-surface: #ffffff;
  --ui-surface-subtle: #f8fafc;
  --ui-ink: #172435;
  --ui-ink-soft: #334357;
  --ui-muted: #5e6d80;
  --ui-faint: #7b8899;
  --ui-line: #d8e0e9;
  --ui-line-strong: #bdc9d6;

  --ui-success: #16734f;
  --ui-success-bg: #e9f6ef;
  --ui-warning: #9a5a12;
  --ui-warning-bg: #fff5e6;
  --ui-danger: #b13b3b;
  --ui-danger-bg: #fdefef;

  --ui-font: "Inter", "Segoe UI", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  --ui-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --ui-radius-sm: 6px;
  --ui-radius: 8px;
  --ui-radius-lg: 10px;
  --ui-shadow-popover: 0 18px 46px rgba(5, 36, 63, 0.16);

  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-8: 32px;
  --ui-space-10: 40px;

  --page-focused: 900px;
  --page-standard: 1180px;
  --page-dashboard: 1480px;
  --page-data-wide: 1600px;

  --v2-ink: var(--ui-ink);
  --v2-ink-2: var(--ui-ink-soft);
  --v2-canvas: var(--ui-canvas);
  --v2-paper: var(--ui-surface);
  --v2-line: var(--ui-line);
  --v2-muted: var(--ui-muted);
  --v2-accent: var(--iderwell-blue-600);
  --v2-accent-soft: var(--iderwell-blue-050);
  --v2-font: var(--ui-font);
  --v2-display: var(--ui-font);
}

html {
  font-family: var(--ui-font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
  font-family: var(--ui-font);
}

.mono,
code,
pre {
  font-family: var(--ui-font-mono);
}

.brand-lockup {
  display: inline-flex;
  width: auto;
  height: 30px;
  align-items: center;
  color: inherit;
}

.brand-lockup img {
  display: block;
  width: 140px;
  height: 28px;
  object-fit: contain;
  object-position: left center;
}

.brand-lockup.is-compact,
.brand-lockup.is-compact img {
  width: 32px;
  height: 32px;
}

/* Shared interaction language */

body > .skip-link:focus,
body :is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 3px solid var(--iderwell-blue-600);
  outline-offset: 3px;
}

body > .skip-link:focus {
  outline-offset: -3px;
  background: var(--iderwell-navy-900);
  color: #fff;
}

.password-control [data-toggle-password] {
  background: var(--iderwell-blue-050);
  color: var(--iderwell-navy-900);
}

.password-control [data-toggle-password]:hover {
  background: var(--iderwell-blue-100);
}

body.theme-dark:is(.route-app, .route-seller) .password-control [data-toggle-password] {
  border-left-color: #315878;
  background: #173b59;
  color: #a8d5ff;
}

.button {
  min-height: 40px;
  padding: 0 16px;
  gap: 8px;
  border-radius: var(--ui-radius);
  box-shadow: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.button .icon {
  width: 16px;
  height: 16px;
}

.button-small {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 13px;
}

.button-large {
  min-height: 46px;
  padding-inline: 20px;
  font-size: 14px;
}

.button-primary {
  border-color: var(--iderwell-blue-600);
  background: var(--iderwell-blue-600);
  color: #fff;
}

.button-primary:not(:disabled):hover {
  border-color: var(--iderwell-navy-800);
  background: var(--iderwell-navy-800);
  box-shadow: none;
  transform: none;
}

.button-secondary {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface);
  color: var(--ui-ink-soft);
}

.button-secondary:not(:disabled):hover {
  border-color: #8fa1b4;
  background: var(--ui-surface-subtle);
  color: var(--ui-ink);
  transform: none;
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--iderwell-navy-900);
}

.button-ghost:not(:disabled):hover {
  border-color: transparent;
  background: var(--iderwell-blue-050);
  color: var(--iderwell-navy-900);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ui-ink);
  font-size: 14px;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: 42px;
}

input:focus,
select:focus,
textarea:focus,
.route-app input:focus,
.route-app select:focus,
.route-app textarea:focus {
  border-color: var(--iderwell-blue-600);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.14);
}

label {
  color: var(--ui-ink-soft);
  font-size: 14px;
  font-weight: 620;
}

.field-help,
label > small,
.form-note {
  color: var(--ui-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Workspace shell and page-width families */

.route-app {
  --cream: var(--ui-canvas);
  --paper: var(--ui-surface);
  --ink: var(--ui-ink);
  --ink-2: var(--ui-ink-soft);
  --muted: var(--ui-muted);
  --soft: var(--ui-faint);
  --line: var(--ui-line);
  --line-strong: var(--ui-line-strong);
  /* Legacy aliases. New product CSS uses the explicit Iderwell tokens above. */
  --green: var(--iderwell-blue-600);
  --green-dark: var(--iderwell-navy-800);
  --green-bright: var(--iderwell-blue-400);
  --mint: var(--iderwell-blue-050);
  --mint-2: #f6faff;
  --blue: var(--iderwell-blue-600);
  --violet: var(--iderwell-blue-600);
  --sidebar: var(--iderwell-navy-950);
  --radius-sm: var(--ui-radius-sm);
  --radius: var(--ui-radius);
  --radius-lg: var(--ui-radius-lg);
  --shadow-sm: none;
  --shadow: var(--ui-shadow-popover);
  color: var(--ui-ink);
  font-size: 15px;
}

.route-app,
.route-app .dashboard-shell,
.route-app .app-main,
.route-app .app-footer {
  background: var(--ui-canvas);
}

.route-app .dashboard-shell {
  grid-template-columns: clamp(232px, 13vw, 248px) minmax(0, 1fr);
}

.route-app .app-main {
  min-width: 0;
}

.route-app .app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  padding: 21px 14px 16px;
  background: var(--iderwell-navy-950);
  color: #bbccdc;
  scrollbar-color: #315878 transparent;
}

.route-app .sidebar-brand {
  min-height: 36px;
  padding: 0 10px 20px;
}

.route-app .sidebar-brand .brand-lockup,
.route-app .sidebar-brand .brand-lockup img {
  width: 138px;
  height: 28px;
}

.route-app .workspace-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  min-height: 62px;
  gap: 11px;
  margin: 0 0 22px;
  overflow: hidden;
  padding: 11px;
  border: 1px solid #315878;
  border-radius: var(--ui-radius);
  background: #0a3558;
}

.route-app .workspace-card > span:last-child {
  min-width: 0;
  overflow: hidden;
}

.route-app .workspace-card strong,
.route-app .workspace-card small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-app .workspace-card .workspace-avatar {
  display: grid;
  width: 54px;
  height: 38px;
  padding: 4px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--ui-radius-sm);
  background: #fff;
  color: var(--iderwell-navy-900);
  font-size: 12px;
}

.route-app .workspace-card .workspace-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: contain;
}

.tenant-logo-fallback {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--iderwell-navy-900);
  font-size: 12px;
  font-weight: 700;
}

[data-tenant-logo].is-broken img,
.captive-logo.is-broken img {
  display: none;
}

.route-app .workspace-card [data-tenant-logo].is-broken img,
.route-app [data-tenant-logo].is-broken img,
.route-connect .captive-logo.is-broken img {
  display: none;
}

[data-tenant-logo].is-broken .tenant-logo-fallback,
.captive-logo.is-broken .tenant-logo-fallback {
  display: grid;
}

.route-app .workspace-card strong {
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.route-app .workspace-card small {
  margin-top: 3px;
  color: #9fb6ca;
  font-size: 12px;
}

.route-app .app-sidebar nav {
  gap: 18px;
}

.route-app .sidebar-group {
  gap: 5px;
}

.route-app .sidebar-group h2 {
  padding-inline: 10px;
  color: #86a3ba;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.route-app .sidebar-group-links,
.route-app .sidebar-secondary {
  gap: 3px;
}

.route-app .app-sidebar nav a,
.route-app .sidebar-secondary a {
  position: relative;
  min-height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--ui-radius-sm);
  color: #bbccdc;
  font-size: 13.5px;
  font-weight: 560;
}

.route-app .app-sidebar nav a:hover,
.route-app .sidebar-secondary a:hover {
  background: #103e65;
  color: #fff;
  transform: none;
}

.route-app .app-sidebar nav a.active,
.route-app .sidebar-secondary a.active {
  background: #124b79;
  box-shadow: inset 3px 0 var(--iderwell-blue-400);
  color: #fff;
}

.route-app .app-sidebar nav a.active .icon,
.route-app .sidebar-secondary a.active .icon {
  color: #a8d5ff;
}

.route-app .app-sidebar nav a.sidebar-launch-link:not(.active) {
  border: 1px solid #3c6d91;
  background: #0b385d;
  color: #e7f4ff;
}

.route-app .sidebar-launch-badge {
  background: #dceffd;
  color: var(--iderwell-navy-900);
}

.route-app .sidebar-secondary {
  margin-top: auto;
  padding-top: 14px;
  border-color: #31506b;
}

.route-app .app-header,
.workspace-settings-shell .app-header {
  position: sticky;
  top: 0;
  right: auto;
  z-index: 40;
  width: 100%;
  min-height: 72px;
  padding: 0 clamp(24px, 2.3vw, 40px);
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  background: rgba(244, 247, 250, 0.94);
  backdrop-filter: blur(14px);
}

.workspace-settings-shell .app-header-title,
.workspace-settings-shell .top-search {
  display: flex;
}

.route-app .app-header-title,
.workspace-settings-shell .app-header-title {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.route-app .app-breadcrumb {
  color: var(--ui-faint);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.08em;
}

.route-app .app-header h1 {
  color: var(--ui-ink);
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -0.035em;
}

.route-app .header-actions {
  gap: 8px;
}

.route-app .top-search,
.route-app .icon-button,
.route-app .profile-chip,
.workspace-settings-shell .icon-button,
.workspace-settings-shell .profile-chip {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.route-app .icon-button,
.workspace-settings-shell .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
}

.route-app .profile-chip,
.workspace-settings-shell .profile-chip {
  width: auto;
  min-width: 0;
  max-width: min(268px, 28vw);
  height: 44px;
  overflow: hidden;
  padding: 4px 9px 4px 5px;
  justify-content: flex-start;
}

.route-app .profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--ui-radius-sm);
  background: var(--iderwell-blue-100);
  color: var(--iderwell-navy-900);
  font-size: 12px;
}

.route-app .profile-copy,
.workspace-settings-shell .profile-copy {
  display: block;
  min-width: 0;
  max-width: 190px;
}

.route-app .profile-copy strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-app .profile-copy small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-app .app-content,
.workspace-settings-shell .app-content {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: clamp(26px, 2.35vw, 40px) clamp(24px, 2.3vw, 40px) 64px;
}

.route-app .app-main,
.workspace-settings-shell .app-main {
  min-width: 0;
}

.route-app .app-page {
  width: 100%;
  min-width: 0;
  margin-inline: auto;
}

.route-app .app-page-dashboard { max-width: var(--page-dashboard); }
.route-app .app-page-data-wide { max-width: var(--page-data-wide); }
.route-app .app-page-standard { max-width: var(--page-standard); }
.route-app .app-page-focused { max-width: var(--page-focused); }

.route-app .app-footer {
  padding: 18px clamp(24px, 2.3vw, 40px);
  border-color: var(--ui-line);
  color: var(--ui-faint);
  font-size: 12px;
}

.route-app .app-footer a {
  color: var(--iderwell-navy-900);
}

/* Workspace typography and ordered density */

.route-app h1,
.route-app h2,
.route-app h3,
.route-app strong {
  text-wrap: pretty;
}

.route-app .settings-page-header :is(h1, h2),
.route-app .settings-directory-intro h1,
.route-app .payment-provider-heading h2 {
  color: var(--ui-ink);
  font-size: clamp(28px, 2vw, 34px);
  font-weight: 640;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.route-app .settings-page-header p,
.route-app .settings-directory-intro p,
.route-app .payment-provider-heading p,
.route-app .iderwell-today-intro p {
  color: var(--ui-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.route-app p:not(.flagship-device p):not(.premium-portal-preview p):not(.portal-preview-scroll p) {
  font-size: 14px;
  line-height: 1.55;
}

.route-app small:not(.flagship-device small):not(.premium-portal-preview small):not(.portal-preview-scroll small),
.route-app dt,
.route-app .table-sub {
  font-size: 12px;
  line-height: 1.45;
}

.route-app .data-balance-readable,
.route-app .data-balance-exact {
  font-variant-numeric: tabular-nums;
}

.route-app .data-balance-exact {
  color: var(--ui-muted);
  white-space: normal;
}

.route-app label,
.route-app dd,
.route-app summary,
.route-app button,
.route-app input:not([type="checkbox"]):not([type="radio"]),
.route-app select,
.route-app textarea {
  font-size: 14px;
}

.route-app .eyebrow,
.route-app .iderwell-overline,
.route-app .kicker {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.075em;
}

.route-app .surface,
.route-app .table-surface,
.route-app .operations-card,
.route-app .network-summary,
.route-app .iderwell-today-panel,
.route-app .iderwell-today-stats,
.route-app .settings-section {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: none;
}

.route-app .surface-head h2,
.route-app .settings-section-header h2,
.route-app .iderwell-today-panel h2 {
  color: var(--ui-ink);
  font-size: 18px;
  font-weight: 640;
  letter-spacing: -0.025em;
}

/* Dashboard: a readable status band with unequal operational sections below. */

.route-app .iderwell-today {
  gap: 24px;
}

.route-app .iderwell-today-intro {
  align-items: end;
  padding-bottom: 22px;
  border-bottom-color: var(--ui-line);
}

.route-app .iderwell-today-intro h2 {
  margin: 7px 0 5px;
  color: var(--ui-ink);
  font-size: clamp(30px, 2.45vw, 40px);
  font-weight: 640;
  letter-spacing: -0.05em;
  line-height: 1;
}

.route-app .iderwell-today-intro time {
  color: var(--ui-muted);
  font-size: 12px;
}

.route-app .iderwell-today-intro time i {
  width: 7px;
  height: 7px;
  background: var(--ui-success);
  box-shadow: 0 0 0 3px var(--ui-success-bg);
}

.route-app .iderwell-today-intro-actions > a,
.route-app .iderwell-today-panel > header > a {
  color: var(--iderwell-navy-900);
  font-size: 13px;
  font-weight: 650;
}

.route-app .iderwell-today-stats {
  grid-template-columns: minmax(190px, 1.25fr) repeat(3, minmax(150px, 1fr));
}

.route-app .iderwell-today-stats > div,
.route-app .iderwell-today-stats > div:first-child {
  min-height: 128px;
  padding: 22px 24px;
  border-color: var(--ui-line);
}

.route-app .iderwell-today-stats dt {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.055em;
}

.route-app .iderwell-today-stats dd {
  margin: 10px 0 0;
  color: var(--ui-ink);
  font-size: clamp(24px, 1.7vw, 30px);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.route-app .iderwell-today-stats dd > small {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 460;
  letter-spacing: 0;
}

.route-app .overview-insights-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.72fr);
  gap: 20px;
}

.route-app .overview-operations-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.route-app .overview-utility-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.64fr);
  gap: 20px;
}

.route-app .iderwell-today-panel {
  padding: 24px;
}

.route-app .overview-quick-actions button > strong,
.route-app .customer-managed-accesses article > header strong,
.route-app .customer-access-allowance strong,
.route-app .router-fleet-card .router-fleet-identity p,
.route-app .router-fleet-card > .router-health-copy,
.route-app .router-fleet-card > .router-fleet-telemetry,
.route-app .router-fleet-facts dd {
  font-size: 13px;
}

/* Operational controls must remain readable at 125% and 150% display scaling. */

.route-app .router-fleet-summary small,
.route-app .router-fleet-summary p,
.route-app .router-fleet-accounting-alert > summary small,
.route-app .router-fleet-facts dt,
.route-app .ussd-session-facts small,
.route-app .ussd-session-timeline li small,
.route-app .ussd-session-truncated,
.route-app .location-stats small,
.route-app .location-card footer a {
  font-size: 12px;
  line-height: 1.45;
}

.route-app .router-fleet-accounting-alert > summary strong,
.route-app .router-fleet-accounting-alert p,
.route-app .router-fleet-card .router-fleet-identity p,
.route-app .router-fleet-card > .router-health-copy,
.route-app .router-fleet-card > .router-fleet-telemetry,
.route-app .router-fleet-facts dd,
.route-app .ussd-session-lookup-head p,
.route-app .ussd-session-result > header p,
.route-app .ussd-session-facts p,
.route-app .ussd-session-timeline li p {
  font-size: 13px;
  line-height: 1.5;
}

.route-app .router-fleet-filters select,
.route-app .router-search-field input,
.route-app .ussd-session-lookup > form input {
  font-size: 14px;
}

.route-app .router-primary-actions .button,
.route-app .router-fleet-card > .router-maintenance .router-actions .button,
.route-app .location-card footer button,
.route-app .package-card footer button {
  font-size: 13px;
}

.route-app .ussd-session-lookup > form label {
  color: var(--ui-ink-soft);
  font-size: 13px;
}

.route-app .ussd-session-facts strong,
.route-app .ussd-session-timeline li strong,
.route-app .location-stats strong {
  font-size: 14px;
}

.route-app :is(.onboarding-hero, .platform-banner, .support-center-hero, .team-hero, .ussd-hero) {
  border-radius: var(--ui-radius-lg);
  background: var(--iderwell-navy-950);
  box-shadow: none;
}

.route-app :is(.onboarding-hero, .platform-banner, .support-center-hero, .team-hero, .ussd-hero) :is(.eyebrow, .kicker) {
  color: #a8d5ff;
}

/* Tables use compact, readable rows instead of micro typography. */

.route-app .table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #aab9c8 transparent;
}

.route-app .settings-table-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.route-app .settings-team-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.route-app .settings-action-menu:not([open]) > div {
  display: none;
}

.route-app table {
  color: var(--ui-ink-soft);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.route-app th,
.route-app .settings-team-table th,
.route-app .settings-table-section th,
.route-app .report-table th,
.route-app .subscriber-table th {
  padding: 11px 13px;
  border-color: var(--ui-line);
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: none;
}

.route-app td,
.route-app .settings-team-table td {
  padding: 14px 13px;
  border-color: #e7edf3;
  color: var(--ui-ink-soft);
  font-size: 13.5px;
  line-height: 1.42;
}

.route-app td strong {
  color: var(--ui-ink);
  font-weight: 620;
}

.route-app tbody tr:hover {
  background: #f7fafc;
}

/* Statuses are quiet text-and-marker signals; badges remain compact exceptions. */

.route-app .settings-status {
  gap: 7px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 620;
}

.route-app .settings-status i,
.route-app .notification-dot {
  width: 7px;
  height: 7px;
}

.route-app .settings-status.is-success { color: var(--ui-success); }
.route-app .settings-status.is-warning { color: var(--ui-warning); }
.route-app .settings-status.is-danger { color: var(--ui-danger); }

.route-app .badge {
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 620;
}

/* Settings remain a navigation index and a family of administrative documents. */

.route-app .settings-directory,
.route-app .settings-stack,
.route-app .settings-team-page,
.route-app .payment-provider-page,
.route-app .settings-billing-content,
.route-app .operational-alerts,
.route-app .settings-document {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.route-app .settings-directory-intro {
  padding: 0;
}

.route-app .settings-directory-group {
  margin-top: 28px;
}

.route-app .settings-directory-group > h2 {
  margin-bottom: 9px;
  color: var(--ui-ink-soft);
  font-size: 14px;
  font-weight: 640;
}

.route-app .settings-directory-group > div {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: none;
}

.route-app .settings-directory-row {
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.2fr) auto 18px;
  min-height: 68px;
  gap: 18px;
  padding: 13px 17px;
  border-color: #e7edf3;
}

.route-app .settings-directory-row:hover {
  background: #f6faff;
}

.route-app .settings-directory-row strong {
  color: var(--ui-ink);
  font-size: 14px;
  font-weight: 630;
}

.route-app .settings-directory-row small {
  color: var(--ui-muted);
  font-size: 13px;
}

.route-app .settings-page-header {
  min-height: 80px;
  align-items: end;
}

.route-app .settings-page-breadcrumb,
.route-app .settings-page-breadcrumb a.settings-back {
  color: var(--ui-muted);
  font-size: 12px;
}

.route-app .settings-page-breadcrumb a:hover {
  color: var(--iderwell-blue-600);
}

.route-app .settings-section,
.route-app .settings-stack .surface,
.route-app .settings-team-page .surface,
.route-app .payment-provider-page .surface {
  min-width: 0;
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: none;
}

.route-app .settings-section-header {
  min-height: 66px;
  gap: 18px;
  padding: 16px 20px;
}

.route-app .settings-section-header p {
  margin-top: 4px;
  color: var(--ui-muted);
  font-size: 13px;
}

.route-app .settings-section-body,
.route-app .settings-form {
  min-width: 0;
  padding: 20px;
}

.route-app .settings-form-grid {
  gap: 18px;
}

.route-app .settings-save-bar {
  min-height: 64px;
  padding: 12px 20px;
  border-color: var(--ui-line);
}

.route-app .settings-tabs {
  gap: 28px;
  min-height: 48px;
  border-color: var(--ui-line);
}

.route-app .settings-tabs button {
  min-height: 48px;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 620;
}

.route-app .settings-tabs button[aria-selected="true"] {
  border-color: var(--iderwell-blue-600);
  color: var(--iderwell-navy-900);
}

.route-app .settings-disclosure > summary {
  min-height: 58px;
  padding: 12px 18px;
}

.route-app .settings-disclosure > summary strong {
  color: var(--ui-ink);
  font-size: 14px;
  font-weight: 630;
}

.route-app .settings-disclosure > summary small {
  color: var(--ui-muted);
  font-size: 12.5px;
}

.route-app .settings-inline-notice {
  border-radius: var(--ui-radius);
}

.route-app .settings-inline-notice.is-info {
  border-color: #bfdbef;
  background: var(--iderwell-blue-050);
  color: var(--iderwell-navy-900);
}

.route-app .tenant-logo-control {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-subtle);
}

.route-app .tenant-logo-preview {
  width: 92px;
  height: 64px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius);
}

.route-app .tenant-logo-preview img {
  padding: 7px;
  object-fit: contain;
}

/* Account popover */

.route-app .top-popover-panel,
.seller-shell .top-popover-panel {
  width: min(380px, calc(100vw - 30px));
  padding: 10px;
  border-color: var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-popover);
}

.route-app .profile-summary,
.seller-shell .profile-summary {
  align-items: flex-start;
  gap: 11px;
  padding: 7px 7px 14px;
  border-color: var(--ui-line);
}

.route-app .profile-summary strong,
.seller-shell .profile-summary strong {
  color: var(--ui-ink);
  font-size: 14px;
  font-weight: 650;
}

.route-app .profile-summary small,
.seller-shell .profile-summary small {
  max-width: 290px;
  overflow-wrap: anywhere;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.42;
}

.route-app .profile-context {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--ui-line);
}

.route-app .profile-context .workspace-avatar {
  width: 46px;
  height: 34px;
  padding: 4px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-sm);
  background: #fff;
  color: var(--iderwell-navy-900);
}

.route-app .profile-context .workspace-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.route-app .profile-context > span:nth-child(2) {
  min-width: 0;
}

.route-app .profile-context strong,
.route-app .profile-context small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-app .profile-context strong { color: var(--ui-ink); font-size: 13px; }
.route-app .profile-context small { margin-top: 3px; color: var(--ui-muted); font-size: 12px; }
.route-app .profile-context-role { color: var(--iderwell-navy-900); font-size: 12px; font-weight: 650; }

.route-app .profile-menu,
.seller-shell .profile-menu {
  gap: 2px;
  padding-top: 8px;
}

.route-app .profile-menu a,
.route-app .profile-menu button,
.seller-shell .profile-menu a,
.seller-shell .profile-menu button {
  min-height: 42px;
  padding: 9px 10px;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-ink-soft);
  font-size: 13px;
  font-weight: 590;
}

.route-app .profile-menu a:hover,
.route-app .profile-menu button:hover,
.seller-shell .profile-menu a:hover,
.seller-shell .profile-menu button:hover {
  background: var(--iderwell-blue-050);
  color: var(--iderwell-navy-900);
}

/* Modal families */

.modal-backdrop {
  padding: 24px;
  background: rgba(5, 36, 63, 0.58);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(100%, 600px);
  max-height: min(88vh, 820px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: 0 28px 80px rgba(5, 36, 63, 0.25);
}

.modal.modal-confirm { width: min(100%, 460px); }
.modal.modal-form-dialog { width: min(100%, 600px); }
.modal.modal-detail { width: min(100%, 760px); }
.modal.modal-operational,
.modal.modal-wide { width: min(100%, 920px); }

.modal > header {
  min-height: 66px;
  padding: 15px 20px;
  border-color: var(--ui-line);
  background: rgba(255, 255, 255, 0.96);
}

.modal > header h2 {
  color: var(--ui-ink);
  font-size: 20px;
  font-weight: 640;
  letter-spacing: -0.025em;
}

.modal > header button {
  width: 40px;
  height: 40px;
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
}

.modal-body {
  padding: 22px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

/* Public, authentication and seller surfaces share the platform identity. */

.iderwell-v2,
.iderwell-public,
.auth-page,
.seller-shell,
.captive-page {
  font-family: var(--ui-font);
}

.captive-logo.has-logo {
  padding: 4px;
  background: #fff;
  color: var(--iderwell-navy-900);
}

.captive-logo.has-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: contain;
}

.portal-preview-checkout {
  gap: 14px;
}

.portal-preview-phone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--portal, var(--iderwell-blue-600)) 22%, #d7e1e9);
  border-radius: 10px;
  background: #f7fafc;
}

.portal-preview-phone span,
.portal-preview-phone small {
  color: #5b6d7c;
  font-size: 10px;
}

.portal-preview-phone strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #18354d;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.portal-preview-safety {
  display: block;
  color: #5b6d7c;
  text-align: center;
}

.portal-preview-outcome {
  min-height: 390px;
}

.portal-preview-outcome > .icon {
  flex: 0 0 auto;
}

[data-portal-preview-root][data-preview-stage="loading"] .captive-direct > summary,
[data-portal-preview-root][data-preview-stage="failure"] .captive-direct > summary,
[data-portal-preview-root][data-preview-stage="success"] .captive-direct > summary {
  border-bottom: 1px solid rgba(18, 55, 82, 0.12);
}

.iderwell-public {
  background: var(--ui-canvas);
  color: var(--ui-ink);
}

.iderwell-public .button-primary,
.auth-page .button-primary {
  border-color: var(--iderwell-navy-900);
  background: var(--iderwell-navy-900);
}

.iderwell-public .button-primary:hover,
.auth-page .button-primary:hover {
  border-color: var(--iderwell-navy-800);
  background: var(--iderwell-navy-800);
}

.iderwell-public .product-kicker,
.iderwell-public .kicker,
.auth-page .kicker,
.seo-shell main > span {
  color: var(--iderwell-blue-600);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.11em;
}

.product-hero {
  background: var(--ui-canvas);
}

.product-hero::before {
  opacity: 0.24;
  background-image: linear-gradient(rgba(0, 59, 122, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 59, 122, 0.04) 1px, transparent 1px);
}

.product-trust {
  background: var(--iderwell-navy-900);
}

.product-trust .product-kicker { color: #a8d5ff; }
.product-trust p { color: #d8eaf8; }

.iderwell-public .public-footer,
.iderwell-public .billing-boundary {
  background: var(--iderwell-navy-950);
}

.iderwell-public .billing-boundary .product-kicker {
  color: #a8d5ff;
}

.iderwell-public .public-footer :is(p, a, .footer-base),
.iderwell-public .billing-boundary dd {
  color: #b9ccdc;
}

.product-showcase-dark,
.auth-story {
  background: var(--iderwell-navy-950);
}

.auth-page.iderwell-v2 .auth-story {
  background: var(--iderwell-navy-950);
}

.auth-page.iderwell-v2 :is(.kicker, .auth-card a, .label-line a) {
  color: var(--iderwell-blue-600);
}

.auth-page.iderwell-v2 .auth-story .kicker.light {
  color: #a8d5ff;
}

.auth-page.iderwell-v2 .auth-flow span {
  border-color: #315878;
  background: #0a3558;
  color: #e7f4ff;
}

.auth-page.iderwell-v2 .auth-flow span .icon {
  color: #a8d5ff;
}

.preview-workspace > aside {
  background: var(--iderwell-navy-950);
  color: #bbccdc;
}

.preview-workspace aside nav span.is-active {
  background: #124b79;
  box-shadow: inset 3px 0 var(--iderwell-blue-400);
  color: #fff;
}

.preview-settings {
  border-color: #31506b;
}

.auth-story .kicker.light,
.seller-welcome .eyebrow.light {
  color: #a8d5ff;
}

.auth-page .auth-card h1 {
  color: var(--ui-ink);
  font-weight: 640;
}

.seller-shell {
  color: var(--ui-ink);
}

.route-seller {
  --seller-accent: var(--iderwell-blue-600);
  --seller-accent-dark: var(--iderwell-navy-800);
  --seller-canvas: var(--ui-canvas);
}

.route-seller .eyebrow {
  color: var(--iderwell-blue-600);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.1em;
}

.auth-page small {
  font-size: 12px;
}

.auth-page :is(.check-field, .check-field span, .auth-form a, .label-line a, .auth-card > footer a) {
  font-size: 12px;
  line-height: 1.45;
}

.iderwell-public .product-proof {
  font-size: 12px;
  line-height: 1.45;
}

.seller-main,
.seller-footer {
  background: var(--ui-canvas);
}

.seller-main {
  width: min(100%, 1280px);
  padding-inline: clamp(20px, 3vw, 42px);
}

.seller-welcome {
  border-radius: var(--ui-radius-lg);
  background: var(--iderwell-navy-950);
}

.route-seller .seller-welcome p {
  font-size: 12px;
  line-height: 1.5;
}

.seller-page-heading h1,
.seller-welcome h1 {
  font-weight: 640;
  letter-spacing: -0.04em;
}

.seller-shell .profile-avatar {
  background: var(--iderwell-blue-100);
  color: var(--iderwell-navy-900);
}

.route-seller .seller-brand > span:last-child,
.route-seller .seller-stock-card-icon,
.route-seller .seller-step,
.route-seller .seller-package-terms li > .icon {
  background: var(--iderwell-blue-050);
  color: var(--iderwell-blue-600);
}

.route-seller .seller-bottom-nav a[aria-current="page"] {
  background: var(--iderwell-blue-050);
  color: var(--iderwell-navy-900);
}

body.theme-dark.route-seller {
  --seller-canvas: #101923;
  --seller-accent: #65b8f2;
  --seller-success: #5bd39b;
  --seller-warning: #f8cf89;
}

body.theme-dark.route-seller .seller-step,
body.theme-dark.route-seller .seller-stock-card-icon,
body.theme-dark.route-seller .seller-package-terms li > .icon,
body.theme-dark.route-seller .seller-bottom-nav a[aria-current="page"] {
  background: #173b59;
  color: #a8d5ff;
}

body.theme-dark.route-seller .seller-receipt > header {
  border-color: #315878;
  background: #0a3558;
}

/* Dark workspace theme keeps blue identity and readable neutral contrast. */

body.theme-dark.route-app {
  --ui-canvas: #101923;
  --ui-surface: #172331;
  --ui-surface-subtle: #1c2a39;
  --ui-ink: #f1f6fa;
  --ui-ink-soft: #d8e2eb;
  --ui-muted: #aab8c6;
  --ui-faint: #8797a7;
  --ui-line: #304052;
  --ui-line-strong: #46586a;
  --cream: #101923;
  --paper: #172331;
  --ink: #f1f6fa;
  --ink-2: #d8e2eb;
  --muted: #aab8c6;
  --soft: #8797a7;
  --line: #304052;
  --line-strong: #46586a;
  --green: #65b8f2;
  --green-dark: #8ccaf5;
  --green-bright: #8ccaf5;
  --mint: #173b59;
  --mint-2: #152e43;
  --v2-ink: var(--ui-ink);
  --v2-ink-2: var(--ui-ink-soft);
  --v2-canvas: var(--ui-canvas);
  --v2-paper: var(--ui-surface);
  --v2-line: var(--ui-line);
  --v2-muted: var(--ui-muted);
  --v2-accent: #65b8f2;
  --v2-accent-soft: #173b59;
}

body.theme-dark.route-app,
body.theme-dark.route-app .dashboard-shell,
body.theme-dark.route-app .app-main,
body.theme-dark.route-app .app-footer {
  background: var(--ui-canvas);
}

body.theme-dark.route-app .app-sidebar {
  background: #05243f;
}

body.theme-dark.route-app .workspace-card {
  border-color: #315878;
  background: #0a3558;
}

body.theme-dark.route-app :is(.icon-button, .profile-chip, .top-search, .mobile-menu) {
  border-color: var(--ui-line);
  background: var(--ui-surface);
}

body.theme-dark.route-app .app-header,
body.theme-dark.route-app .workspace-settings-shell .app-header {
  border-color: var(--ui-line);
  background: rgba(16, 25, 35, 0.94);
}

body.theme-dark.route-app :is(
  .surface,
  .table-surface,
  .iderwell-today-panel,
  .iderwell-today-stats,
  .settings-section,
  .settings-directory-group > div,
  .settings-stack .surface,
  .settings-team-page .surface,
  .payment-provider-page .surface,
  .top-popover-panel
) {
  border-color: var(--ui-line);
  background: var(--ui-surface);
}

body.theme-dark.route-app :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-color: var(--ui-line-strong);
  background: #111d29;
  color: var(--ui-ink);
}

body.theme-dark.route-app .button-secondary {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface);
  color: var(--ui-ink-soft);
}

body.theme-dark.route-app .overview-quick-actions button,
body.theme-dark.route-app .router-model-card,
body.theme-dark.route-app :is(
  .router-provisioning-section,
  .router-device-inspector,
  .router-install-device,
  .router-install-step,
  .router-install-help,
  .router-check-intro,
  .router-check-workflow,
  .router-check-result,
  .router-check-history
) {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
}

body.theme-dark.route-app :is(
  .router-model-image,
  .router-hardware-summary,
  .router-network-plan,
  .router-selected-device,
  .router-port-device,
  .router-port-picker.is-manual,
  .router-winbox-drop,
  .router-auto-check,
  .router-setup-file-empty,
  .router-help-boundary,
  .portal-brand-source
) {
  border-color: var(--ui-line);
  background: var(--ui-surface-subtle);
}

body.theme-dark.route-app :is(.activity-list, .activity-detail, .settings-document, .settings-disclosure) {
  border-color: var(--ui-line);
  background: var(--ui-surface);
}

body.theme-dark.route-app :is(.activity-filters, .router-provisioning-fields, .router-advanced-settings) :is(input, select, textarea) {
  border-color: var(--ui-line-strong);
  background: #111d29;
  color: var(--ui-ink);
}

body.theme-dark.route-app select {
  border-color: var(--ui-line-strong) !important;
  background: #111d29 !important;
  color: var(--ui-ink) !important;
}

body.theme-dark.route-app :is(.settings-save-bar, .router-port-key > span) {
  border-color: var(--ui-line);
  background: var(--ui-surface-subtle);
}

body.theme-dark.route-app .activity-filters > label,
body.theme-dark.route-app .settings-document :is(label, legend) {
  color: var(--ui-ink-soft);
}

body.theme-dark.route-app .settings-document label > span {
  color: var(--ui-muted);
}

body.theme-dark.route-app .portal-skin-option > strong {
  color: #172335;
}

body.theme-dark.route-app .portal-skin-option > small {
  color: #5e6d80;
}

body.theme-dark.route-app :is(
  .settings-save-bar > span,
  .router-model-copy em,
  .router-model-copy > span:last-child,
  .router-setup-assurance p,
  .settings-back
) {
  color: var(--ui-muted);
}

body.theme-dark.route-app :is(.iderwell-today-intro-actions > a, .router-provisioning-actions .button-ghost) {
  color: #65b8f2;
}

body.theme-dark.route-app .router-setup-progress li[aria-current="step"] > span {
  border-color: var(--iderwell-blue-600);
  background: var(--iderwell-blue-600);
  color: #fff;
}

/*
 * Final legacy quarantine
 *
 * Older route compositions still contribute layout, but their former purple
 * accents and microtype must not leak through the product-level cascade.
 * Tenant-owned captive/portal colours intentionally remain untouched.
 */

.route-app .customer-filter-tabs button[aria-pressed="true"] {
  border-color: #b9daf2;
  background: var(--iderwell-blue-050);
  color: var(--iderwell-navy-900);
}

.route-app .customer-filter-tabs button[aria-pressed="true"] small,
.route-app .overview-priority-lead > span,
.route-app .setup-banner > span,
.route-app .info-strip > .icon {
  background: var(--iderwell-blue-600);
  color: #fff;
}

.route-app .metric-card .metric-symbol,
.route-app :is(.metric-violet, .metric-blue) {
  background: var(--iderwell-blue-050);
  color: var(--iderwell-blue-600);
}

.route-app .overview-priority-lead,
.route-app .overview-priority-more a:hover {
  background: #f6faff;
}

.route-app :is(.setup-banner, .alert-info) {
  border-color: #b9daf2;
  background: var(--iderwell-blue-050);
  color: var(--iderwell-navy-900);
}

.route-app .readiness-ring {
  background: conic-gradient(
    var(--iderwell-blue-600) calc(var(--progress) * 1%),
    #e3eaf1 0
  );
}

.route-app :is(
  .settings-directory-icon,
  .overview-quick-actions button > span,
  .operator-explainer .subscriber-operation-notes article > .icon,
  .report-metrics .metric-symbol,
  .ussd-session-facts article > span:first-child,
  .ussd-setup-status > span,
  .router-network-plan > span
) {
  background: var(--iderwell-blue-050);
  color: var(--iderwell-blue-600);
}

.route-app .overview-quick-actions button:not(:disabled):hover {
  border-color: #9dcbed;
  background: #f3f9fe;
}

.route-app .router-model-option > input:focus-visible + .router-model-card {
  outline-color: rgba(0, 120, 212, 0.3);
}

.auth-page.iderwell-v2 .auth-story::after {
  border-color: rgba(80, 168, 232, 0.24);
  box-shadow: 0 0 0 90px rgba(0, 120, 212, 0.06),
    0 0 0 180px rgba(0, 59, 122, 0.05);
}

.auth-page.iderwell-v2 .auth-form input:focus {
  border-color: var(--iderwell-blue-600);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.14);
}

/* Operational text may be compact, but never microscopic. */

.route-app .operator-page-head p,
.route-app .operator-summary-strip small,
.route-app .operator-summary-strip p,
.route-app .customer-filter-tabs button,
.route-app .customer-filter-tabs button small,
.route-app .settings-filter-tabs button,
.route-app .settings-filter-tabs button small,
.route-app .settings-role-row > summary small,
.route-app .settings-permission-groups dt,
.route-app .settings-permission-groups dd span,
.route-app .settings-verification-form > div small,
.route-app .settings-billing-checkout label,
.route-app .payment-hubtel-request code {
  font-size: 12px;
  line-height: 1.45;
}

.route-app .customer-search-field input,
.route-app .subscriber-actions .button,
.route-app .settings-action-menu button {
  font-size: 13px;
}

.route-app .package-card li strong,
.route-app .package-card li small,
.route-app .package-card footer > span,
.route-app .package-seller-action {
  font-size: 12px;
  line-height: 1.42;
}

.route-app .package-card li strong {
  color: var(--ui-ink-soft);
  font-weight: 620;
}

.route-app .package-seller-action {
  min-height: 40px;
  padding-inline: 4px;
  color: var(--iderwell-blue-600);
  font-weight: 650;
}

.route-app .notification-matrix :is(th, td),
.route-app .notification-matrix tbody th small,
.route-app .notification-contact-identity small,
.route-app .notification-verification-form > div small,
.route-app .notification-event-options > p,
.route-app .notification-event-options label small {
  font-size: 12px;
  line-height: 1.45;
}

.route-app .notification-matrix tbody th strong,
.route-app .notification-contact-identity strong,
.route-app .notification-event-options legend,
.route-app .notification-event-options label strong,
.route-app .notification-event-options details summary {
  font-size: 13px;
  line-height: 1.4;
}

.route-app .activity-event-meta :is(time, strong),
.route-app .activity-pager :is(small, a, span),
.route-app .operator-explainer > summary strong,
.route-app .operator-explainer > summary small,
.route-app .operator-explainer > div > p {
  font-size: 12px;
  line-height: 1.45;
}

.route-app .support-center-card p,
.route-app .support-center-card a,
.route-app .support-center-note :is(strong, p),
.route-app .onboarding-help :is(strong, p, a) {
  font-size: 13px;
  line-height: 1.5;
}

.route-app .completion > span,
.route-app .launch-phase-rail a > span,
.route-app .launch-phase-rail small,
.route-app .launch-current :is(small, p, a),
.route-app .launch-phase-number,
.route-app .launch-phase > summary :is(small, em, b),
.route-app .launch-task :is(small, p),
.route-app .launch-inline-tip :is(strong, p, a),
.route-app .launch-readiness-head p,
.route-app .launch-readiness-list :is(strong, small, a),
.route-app .launch-review-actions p {
  font-size: 12px;
  line-height: 1.45;
}

.route-app .router-provisioning-header .settings-back,
.route-app .router-provisioning-section > header > span,
.route-app .router-model-copy > small,
.route-app .router-model-copy em,
.route-app .router-model-copy > span:last-child,
.route-app .router-model-selected,
.route-app .router-setup-progress li > span,
.route-app .router-setup-progress small,
.route-app .router-network-confirm,
.route-app .router-network-confirm span,
.route-app .router-network-confirm strong,
.route-app .router-port-key :is(strong, small),
.route-app .router-setup-assurance :is(strong, p) {
  font-size: 12px;
  line-height: 1.42;
}

.route-app .router-network-confirm {
  font-size: 12px !important;
}

.route-app .tenant-logo-field > span,
.route-app .portal-skin-field legend,
.route-app .portal-skin-field > p,
.route-app .portal-skin-option > strong,
.route-app .portal-skin-option > small,
.route-app .portal-brand-source :is(strong, small, a),
.route-app .settings-check-row :is(strong, small, time) {
  font-size: 12px;
  line-height: 1.42;
}

.route-app .portal-brand-source .workspace-avatar {
  font-size: 12px;
}

.route-app .settings-integration-mark {
  font-size: 12px;
  font-weight: 650;
}

.route-app .notification-empty strong {
  font-size: 13px;
}

.route-app .ussd-device-panel .device-label,
.route-app .premium-portal-preview .device-label,
.route-app .device-label :is(span, small) {
  font-size: 12px;
}

.route-app .settings-team-page .workspace-avatar {
  font-size: 12px;
}

.route-app .settings-team-page .you-label {
  font-size: 12px !important;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.route-app .subscriber-credential dt {
  font-size: 12px;
}

.route-app .check-field {
  font-size: 12px !important;
}

.route-app .check-field :is(strong, small) {
  font-size: 12px;
}

/* Seller and customer-access surfaces use the same readable metadata floor. */

body.route-seller .seller-brand > span:last-child,
body.route-seller .seller-desktop-nav a,
body.route-seller .seller-theme-button,
body.route-seller .seller-identity :is(strong, small),
body.route-seller .seller-sale-panel > header p,
body.route-seller .seller-form-section > label,
body.route-seller .seller-stock-picker > legend > span:last-child,
body.route-seller .seller-form-section label small,
body.route-seller .seller-step,
body.route-seller .seller-stock-card-copy :is(strong, small),
body.route-seller .seller-stock-card-meta :is(strong, small),
body.route-seller .seller-selected-package > div:first-child span,
body.route-seller .seller-package-terms :is(strong, small),
body.route-seller .seller-confirmation strong,
body.route-seller .seller-confirmation > span,
body.route-seller .seller-boundary-card :is(strong, p),
body.route-seller .seller-mini-history > div:first-child a,
body.route-seller .seller-mini-history > p,
body.route-seller .seller-page-heading p,
body.route-seller .seller-receipt > header p,
body.route-seller .seller-receipt-boundary span,
body.route-seller .seller-receipt-summary dl > div,
body.route-seller .seller-receipt-disclaimer,
body.route-seller .seller-receipt > footer a,
body.route-seller .seller-empty-history p,
body.route-seller .seller-footer {
  font-size: 12px;
  line-height: 1.45;
}

body.route-seller .seller-desktop-nav a,
body.route-seller .seller-form-section > label,
body.route-seller .seller-stock-picker > legend > span:last-child {
  font-size: 13px;
}

body.route-connect .captive-page small {
  font-size: 12px !important;
  line-height: 1.42;
}

body.route-connect .captive-page .check-field {
  font-size: 12px !important;
}

body.route-connect .captive-page .check-field strong,
body.route-connect .captive-intro > span,
body.route-connect .captive-package strong,
body.route-connect .captive-packages > div > span,
body.route-connect .captive-network legend,
body.route-connect .captive-network label span,
body.route-connect .captive-buy-view .captive-channel-kicker,
body.route-connect .captive-channel-note strong,
body.route-connect .captive-delivery-note,
body.route-connect .captive-access-unavailable,
body.route-connect .captive-footer {
  font-size: 12px;
  line-height: 1.42;
}

body.route-connect .captive-change-number,
body.route-connect .captive-result .text-button,
body.route-connect .captive-ussd-dial-action {
  font-size: 13px;
}

body.route-connect .captive-ussd-instructions :is(ol, p) {
  font-size: 12px;
  line-height: 1.5;
}

body.theme-dark.route-app .metric-card .metric-symbol,
body.theme-dark.route-app :is(.metric-violet, .metric-blue) {
  background: #173b59;
  color: #a8d5ff;
}

body.theme-dark.route-app :is(
  .settings-directory-icon,
  .overview-quick-actions button > span,
  .operator-explainer .subscriber-operation-notes article > .icon,
  .report-metrics .metric-symbol,
  .ussd-session-facts article > span:first-child,
  .ussd-setup-status > span,
  .router-network-plan > span
) {
  background: #173b59;
  color: #a8d5ff;
}

body.theme-dark.route-app .overview-quick-actions button:not(:disabled):hover,
body.theme-dark.route-app .customer-filter-tabs button[aria-pressed="true"] {
  border-color: #315878;
  background: #173b59;
  color: #d8eaf8;
}

body.theme-dark.route-app .ussd-activity-dot {
  border-color: #65b8f2;
  background: #172331;
  box-shadow: 0 0 0 3px #173b59;
}

body.theme-dark.route-app .router-model-option > input:checked + .router-model-card {
  border-color: #65b8f2;
}

body.theme-dark.route-app :is(
  .workspace-avatar,
  .header-profile,
  .sidebar-user > span,
  .identity-cell > i,
  .profile-avatar
) {
  background: #173b59;
  color: #a8d5ff;
}

body.theme-dark.route-app :is(.setup-banner, .alert-info) {
  border-color: #315878;
  background: #0a3558;
  color: #d8eaf8;
}

body.theme-dark.route-app .overview-priority-lead,
body.theme-dark.route-app .overview-priority-more a:hover {
  background: #152e43;
}

body.theme-dark.route-app .button-primary,
body.theme-dark.route-app .route-app .button-primary {
  border-color: #65b8f2;
  background: #65b8f2;
  color: #071622;
}

body.theme-dark.route-app .button-primary:not(:disabled):hover,
body.theme-dark.route-app .route-app .button-primary:not(:disabled):hover {
  border-color: #8ccaf5;
  background: #8ccaf5;
  color: #071622;
}

body.theme-dark.route-app tbody tr:hover,
body.theme-dark.route-app .settings-directory-row:hover {
  background: #1a2c3c;
}

/* Compact layouts */

@media (max-width: 1300px) {
  .route-app .profile-copy,
  .workspace-settings-shell .profile-copy,
  .route-app .profile-chip > .icon,
  .workspace-settings-shell .profile-chip > .icon {
    display: none;
  }

  .route-app .profile-chip,
  .workspace-settings-shell .profile-chip {
    width: 44px;
    min-width: 44px;
    padding: 4px;
    justify-content: center;
  }
}

@media (max-width: 1180px) {
  .route-app .app-content,
  .workspace-settings-shell .app-content,
  .route-app .app-header,
  .workspace-settings-shell .app-header,
  .route-app .app-footer {
    padding-inline: 24px;
  }

  .route-app .overview-insights-grid,
  .route-app .overview-operations-grid,
  .route-app .overview-utility-grid {
    grid-template-columns: 1fr;
  }

  .route-app .settings-directory-row {
    grid-template-columns: minmax(170px, 0.75fr) minmax(220px, 1fr) auto 18px;
  }

  .route-app .app-header-title,
  .workspace-settings-shell .app-header-title {
    flex: 1 1 150px;
    overflow: hidden;
  }

  .route-app .app-header h1,
  .workspace-settings-shell .app-header h1 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .route-app .top-search,
  .workspace-settings-shell .top-search {
    width: clamp(180px, 25vw, 260px);
    min-width: 150px;
    margin-left: 0;
    flex: 0 1 260px;
  }

  .route-app .profile-copy,
  .workspace-settings-shell .profile-copy,
  .route-app .profile-chip > .icon,
  .workspace-settings-shell .profile-chip > .icon {
    display: none;
  }

  .route-app .profile-chip,
  .workspace-settings-shell .profile-chip {
    width: 44px;
    min-width: 44px;
    padding: 4px;
    justify-content: center;
  }
}

@media (max-width: 1080px) and (min-width: 821px) {
  .route-app .settings-table-section table {
    width: 100%;
    min-width: 680px;
  }

  .route-app .settings-table-section :is(th, td) {
    padding-inline: 10px;
  }
}

@media (max-width: 980px) and (min-width: 821px) {
  .route-app .profile-copy,
  .workspace-settings-shell .profile-copy,
  .route-app .profile-chip > .icon,
  .workspace-settings-shell .profile-chip > .icon {
    display: none;
  }

  .route-app .profile-chip,
  .workspace-settings-shell .profile-chip {
    width: 44px;
    min-width: 44px;
    padding: 4px;
    justify-content: center;
  }

  .route-app .iderwell-today-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .route-app .dashboard-shell {
    display: block;
  }

  .route-app .app-sidebar {
    position: fixed;
    width: min(88vw, 304px);
    height: 100dvh;
    padding: 18px 14px 16px;
  }

  .route-app .app-header,
  .workspace-settings-shell .app-header {
    min-height: 64px;
    padding-inline: 16px;
  }

  .route-app .app-header h1 {
    font-size: 18px;
  }

  .route-app .app-breadcrumb {
    display: none;
  }

  .route-app .profile-copy,
  .workspace-settings-shell .profile-copy,
  .route-app .profile-chip > .icon,
  .workspace-settings-shell .profile-chip > .icon {
    display: none;
  }

  .route-app .profile-chip,
  .workspace-settings-shell .profile-chip,
  .route-app .icon-button,
  .route-app .mobile-menu,
  .workspace-settings-shell .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 4px;
    justify-content: center;
  }

  .route-app .header-actions > .icon-button:first-child {
    display: none;
  }

  .route-app .app-content,
  .workspace-settings-shell .app-content {
    padding: 22px 16px 48px;
  }

  .route-app .app-footer {
    padding-inline: 16px;
  }

  .route-app .settings-page-header {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .route-app .settings-page-header :is(h1, h2),
  .route-app .settings-directory-intro h1,
  .route-app .payment-provider-heading h2 {
    font-size: 28px;
  }

  .route-app .settings-page-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .route-app .settings-page-header-actions > .button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .route-app .settings-directory-row {
    grid-template-columns: minmax(0, 1fr) auto 18px;
    gap: 5px 10px;
    min-height: 72px;
    padding: 13px 14px;
  }

  .route-app .settings-directory-row > strong {
    grid-column: 1;
  }

  .route-app .settings-directory-row > small {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .route-app .settings-directory-state {
    grid-column: 2;
    grid-row: 1;
  }

  .route-app .settings-directory-row > .icon {
    grid-column: 3;
    grid-row: 1;
  }

  .route-app .settings-section,
  .route-app .settings-section-body,
  .route-app .settings-document,
  .route-app .settings-stack,
  .route-app .settings-billing-content,
  .route-app .operational-alerts,
  .route-app .notification-event-options,
  .route-app .notification-contact,
  .route-app .settings-table-section {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .route-app .settings-section-header,
  .route-app .settings-section-body,
  .route-app .settings-form,
  .route-app .settings-save-bar {
    padding-inline: 16px;
  }

  .route-app .settings-form-grid,
  .route-app .settings-layout,
  .route-app .settings-billing-checkout,
  .route-app .notification-event-options,
  .route-app .notification-contact-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-app .notification-matrix-wrap,
  .route-app .settings-invoice-section .table-wrap {
    overflow: visible;
  }

  .route-app .notification-matrix,
  .route-app .notification-matrix tbody,
  .route-app .settings-invoice-section table,
  .route-app .settings-invoice-section tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .route-app .notification-matrix thead,
  .route-app .settings-invoice-section thead {
    position: absolute;
    inset: 0 auto auto 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .route-app .notification-matrix tbody tr {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px 0;
    border-top: 1px solid var(--ui-line);
  }

  .route-app .notification-matrix tbody :is(th, td) {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }

  .route-app .notification-matrix tbody td {
    padding-top: 2px;
    text-align: right;
  }

  .route-app .settings-invoice-section tbody tr {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 16px 0;
    border-top: 1px solid var(--ui-line);
  }

  .route-app .settings-invoice-section tbody td {
    display: block;
    width: auto !important;
    padding: 0;
    border: 0 !important;
    text-align: left !important;
  }

  .route-app .settings-invoice-section tbody td:first-child,
  .route-app .settings-invoice-section tbody td:last-child {
    grid-column: 1 / -1;
  }

  .route-app .settings-invoice-section tbody td:nth-child(n + 2):nth-child(-n + 5)::before {
    display: block;
    margin-bottom: 5px;
    color: var(--ui-faint);
    font-size: 12px;
    font-weight: 650;
  }

  .route-app .settings-invoice-section tbody td:nth-child(2)::before { content: "Period"; }
  .route-app .settings-invoice-section tbody td:nth-child(3)::before { content: "Basis"; }
  .route-app .settings-invoice-section tbody td:nth-child(4)::before { content: "Amount"; }
  .route-app .settings-invoice-section tbody td:nth-child(5)::before { content: "Status"; }

  .route-app :is(td, dd, code, p, small, strong, a) {
    overflow-wrap: anywhere;
  }

  .route-app .iderwell-today-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .route-app .iderwell-today-intro-actions {
    justify-items: start;
  }

  .route-app .iderwell-today-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-app .iderwell-today-stats > div,
  .route-app .iderwell-today-stats > div:first-child {
    min-height: 112px;
    padding: 17px;
  }

  .route-app .iderwell-today-panel {
    padding: 18px 16px;
  }

  .route-app .top-popover-panel,
  .seller-shell .top-popover-panel {
    position: fixed;
    top: 74px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 88px);
    overflow: auto;
  }

  .button,
  .route-app .button,
  .route-app button:not(.flagship-device button):not(.premium-portal-preview button):not(.portal-preview-scroll button),
  .route-app summary:not(.flagship-device summary):not(.premium-portal-preview summary):not(.portal-preview-scroll summary),
  .route-app input:not([type="checkbox"]):not([type="radio"]),
  .route-app select {
    min-height: 44px;
  }

  .route-app .package-seller-action {
    min-height: 44px;
  }

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

  .modal,
  .modal.modal-confirm,
  .modal.modal-form-dialog,
  .modal.modal-detail,
  .modal.modal-operational,
  .modal.modal-wide {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--ui-radius-lg) var(--ui-radius-lg) 0 0;
  }

  .seller-main {
    padding-inline: 16px;
  }
}

@media (max-width: 520px) {
  .route-app .iderwell-today-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-app .iderwell-today-stats > div,
  .route-app .iderwell-today-stats > div:first-child {
    min-height: 98px;
    border-left: 0;
    border-top: 1px solid var(--ui-line);
  }

  .route-app .iderwell-today-stats > div:first-child {
    border-top: 0;
  }

  .route-app .tenant-logo-control {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .route-app .tenant-logo-preview {
    width: 72px;
    height: 56px;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions .button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Galaxy S25 Ultra preview hardware. Samsung's published 77.6 × 162.8 mm
   front ratio and flat 6.9-inch display are represented directly; the small
   centered circle is the front camera cut-out, not a generic phone notch. */
.flagship-device.galaxy-s25-ultra {
  width: 336px;
  height: 705px;
  overflow: visible;
  border: 6px solid #6f7276;
  border-radius: 38px;
  outline: 1px solid #202226;
  background: #0b0c0f;
  box-shadow: 0 28px 58px rgba(15, 23, 42, .24), inset 0 0 0 1px #a5a8ab;
}
.flagship-device.galaxy-s25-ultra::before,
.flagship-device.galaxy-s25-ultra::after { display: none; }
.galaxy-s25-ultra .flagship-screen {
  inset: 1px;
  border-radius: 31px;
  box-shadow: inset 0 0 0 1px #090a0c;
}
.galaxy-s25-ultra :is(.flagship-island, .device-island) {
  position: absolute;
  top: 15px;
  left: 50%;
  z-index: 15;
  width: 10px;
  height: 10px;
  border: 1px solid #050608;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #334761 0 18%, #11151d 43%, #030405 100%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .18);
  transform: translateX(-50%);
}
.galaxy-s25-ultra .flagship-speaker {
  top: 6px;
  width: 28px;
  height: 2px;
  background: #25272b;
}
.galaxy-s25-ultra .portal-preview-scroll {
  inset: 2px 2px 22px;
  padding: 34px 0 18px;
  border-radius: 31px 31px 26px 26px;
}
.galaxy-s25-ultra :is(.galaxy-volume-key, .galaxy-side-key) {
  position: absolute;
  right: -9px;
  z-index: 9;
  width: 3px;
  border: 1px solid #2d3034;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #777b7e, #a7aaac 55%, #55585c);
}
.galaxy-s25-ultra .galaxy-volume-key { top: 104px; height: 58px; }
.galaxy-s25-ultra .galaxy-side-key { top: 181px; height: 72px; }
.marketing-phone.galaxy-s25-ultra {
  border-color: #707377;
  border-radius: 38px;
  outline: 1px solid #202226;
  box-shadow: 0 26px 62px rgba(0, 0, 0, .28), inset 0 0 0 1px #a5a8ab;
}

.portal-preview-screen-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 420px);
  margin: 0 auto 10px;
  padding: 4px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface-subtle);
}
.portal-preview-screen-switch button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}
.portal-preview-screen-switch button[aria-pressed="true"] {
  background: var(--ui-surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .1);
  color: var(--ui-ink);
}
.portal-preview-readiness {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 0 auto 16px;
}
.portal-preview-readiness span {
  padding: 5px 8px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 680;
}
.portal-preview-readiness .is-ready {
  border-color: #9acbb8;
  background: #edf9f4;
  color: #156345;
}
.portal-preview-readiness .is-hidden {
  background: var(--ui-surface-subtle);
  color: var(--ui-muted);
}

/* 1920 × 1080 at 150% zoom exposes roughly a 1280 × 720 CSS viewport.
   Preserve comfortable type and targets; the primary rail may scroll while
   Settings stays independently pinned. */
@media (max-height: 760px) and (min-width: 821px) {
  .route-app .app-sidebar {
    overflow: hidden;
    padding: 14px 12px 12px;
  }
  .route-app .sidebar-brand {
    min-height: 32px;
    padding: 0 9px 12px;
  }
  .route-app .sidebar-brand .brand-lockup,
  .route-app .sidebar-brand .brand-lockup img { width: 132px; height: 27px; }
  .route-app .workspace-card {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 52px;
    margin-bottom: 11px;
    padding: 8px 9px;
  }
  .route-app .workspace-card .workspace-avatar { width: 40px; height: 34px; }
  .route-app .workspace-card strong { font-size: 13px; }
  .route-app .workspace-card small { margin-top: 2px; font-size: 11px; }
  .route-app .sidebar-groups {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .route-app .app-sidebar nav { gap: 11px; }
  .route-app .sidebar-group { gap: 3px; }
  .route-app .sidebar-group h2 { padding-inline: 10px; font-size: 11px; line-height: 1.25; }
  .route-app .sidebar-group-links { gap: 2px; }
  .route-app .app-sidebar nav a,
  .route-app .sidebar-secondary a { min-height: 38px; padding-inline: 10px; font-size: 13px; }
  .route-app .app-sidebar nav a .icon,
  .route-app .sidebar-secondary a .icon { width: 17px; }
  .route-app .sidebar-secondary { margin-top: 9px; padding-top: 9px; }
}

/* Dark mode uses one canvas/surface system across all operator pages. Nested
   document sections inherit their parent surface instead of flashing white. */
body.theme-dark.route-app :is(
  .app-content,
  .app-page,
  .operator-workspace,
  .router-workspace,
  .report-stack,
  .voucher-stack,
  .settings-directory,
  .settings-stack,
  .settings-team-page,
  .payment-provider-page
) { background-color: var(--ui-canvas); }
body.theme-dark.route-app :is(
  .settings-document,
  .settings-section-body,
  .settings-disclosure-body,
  .table-wrap,
  .surface-head,
  .table-toolbar
) { border-color: var(--ui-line); background-color: transparent; }
body.theme-dark.route-app .portal-preview-screen-switch {
  border-color: var(--ui-line);
  background: var(--ui-surface-subtle);
}
body.theme-dark.route-app .portal-preview-screen-switch button[aria-pressed="true"] {
  background: var(--ui-surface);
  color: var(--ui-ink);
}
body.theme-dark.route-app .portal-preview-readiness .is-ready {
  border-color: #315e50;
  background: #172c25;
  color: #8bd4b8;
}

@media (max-width: 430px) {
  .flagship-device.galaxy-s25-ultra {
    width: min(336px, 88vw);
    height: min(705px, calc(88vw * 2.101));
  }
  .portal-preview-screen-switch { width: min(100%, 336px); }
}

/* Uniform dark workspace contract
   Route-specific light treatments stop here. Customer portal/device previews
   retain their authored appearance because they simulate the customer view. */
body.theme-dark.route-app,
body.theme-dark.route-seller {
  --ui-canvas: #0f1822;
  --ui-surface: #172331;
  --ui-surface-subtle: #1d2b3a;
  --ui-ink: #f2f6fa;
  --ui-ink-soft: #d9e3ec;
  --ui-muted: #afbdca;
  --ui-faint: #93a4b4;
  --ui-line: #304254;
  --ui-line-strong: #465b6f;
  --ui-success: #8eddbb;
  --ui-success-bg: #153a30;
  --ui-warning: #f8cf89;
  --ui-warning-bg: #3a2d1c;
  --ui-danger: #ffaaa3;
  --ui-danger-bg: #402326;
  --cream: var(--ui-canvas);
  --paper: var(--ui-surface);
  --ink: var(--ui-ink);
  --ink-2: var(--ui-ink-soft);
  --muted: var(--ui-muted);
  --soft: var(--ui-faint);
  --line: var(--ui-line);
  --line-strong: var(--ui-line-strong);
  --mint: #173b59;
  --mint-2: #152e43;
  --green: #65b8f2;
  --green-dark: #8ccaf5;
  --green-bright: #8ccaf5;
  color: var(--ui-ink);
  background: var(--ui-canvas);
}

body.theme-dark.route-app :is(
  .app-content,
  .app-page,
  .operator-workspace,
  .report-stack,
  .voucher-stack,
  .settings-stack,
  .settings-team-page,
  .payment-provider-page
),
body.theme-dark.route-seller :is(.seller-shell, .seller-main, .seller-footer) {
  background-color: var(--ui-canvas);
}

body.theme-dark.route-app :is(
  .surface,
  .table-surface,
  .state-card,
  .settings-document,
  .settings-section,
  .settings-disclosure,
  .settings-table-section,
  .settings-role-list,
  .settings-search,
  .notification-empty,
  .onboarding-help,
  .location-stats > span,
  .portal-skin-option,
  .portal-skin-swatch
) {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
}

body.theme-dark.route-app :is(
  .launch-task-marker,
  .settings-integration-mark,
  .settings-inline-notice-icon,
  .settings-directory-icon,
  .location-symbol,
  .package-symbol,
  .state-icon,
  .metric-symbol,
  .router-large
) {
  border-color: var(--ui-line);
  background: #173b59;
  color: #a8d5ff;
}

body.theme-dark.route-app :is(
  .launch-phase.is-complete .launch-phase-number,
  .launch-phase.is-complete > summary b,
  .launch-task.is-complete .launch-task-marker
) {
  border-color: #315e50;
  background: #153a30;
  color: #8eddbb;
}

body.theme-dark.route-app :is(
  .launch-task.is-primary,
  .launch-inline-tip,
  .launch-current,
  .launch-readiness
) {
  border-color: #315878;
  background: #152e43;
}

body.theme-dark.route-app :is(
  .launch-phase-rail li.is-current a > span,
  .launch-current > span,
  .launch-phase.is-current .launch-phase-number
) {
  color: #071622;
}

body.theme-dark.route-app :is(.launch-review, .alert-warning, .settings-inline-notice.is-warning) {
  border-color: #70542d;
  background: var(--ui-warning-bg);
  color: var(--ui-warning);
}

body.theme-dark.route-app :is(.alert-danger, .settings-inline-notice.is-danger) {
  border-color: #704047;
  background: var(--ui-danger-bg);
  color: var(--ui-danger);
}

body.theme-dark.route-app .button-ghost {
  border-color: transparent;
  background: transparent;
  color: #b9dcf5;
}

body.theme-dark.route-app .button-ghost:not(:disabled):hover {
  border-color: var(--ui-line);
  background: var(--ui-surface-subtle);
  color: var(--ui-ink);
}

body.theme-dark.route-app .button-danger-outline {
  border-color: #704047;
  background: var(--ui-danger-bg);
  color: var(--ui-danger);
}

body.theme-dark.route-app .button-danger-outline:not(:disabled):hover {
  border-color: #98606a;
  background: #502a2e;
  color: #ffd2ce;
}

body.theme-dark.route-app .badge-success {
  background: var(--ui-success-bg);
  color: var(--ui-success);
}

body.theme-dark.route-app :is(.badge-neutral, .badge-info) {
  background: #1a3851;
  color: #b9dcf5;
}

body.theme-dark.route-app .badge-warning {
  background: var(--ui-warning-bg);
  color: var(--ui-warning);
}

body.theme-dark.route-app .badge-danger {
  background: var(--ui-danger-bg);
  color: var(--ui-danger);
}

body.theme-dark.route-app :is(.settings-status.is-warning, .settings-status.is-pending) {
  color: var(--ui-warning);
}

body.theme-dark.route-app :is(.settings-status.is-success, .settings-status.is-positive) {
  color: var(--ui-success);
}

body.theme-dark.route-app :is(.settings-status.is-danger, .settings-status.is-error) {
  color: var(--ui-danger);
}

body.theme-dark.route-app :is(
  .operator-summary-strip p,
  .operator-explainer > div > p,
  .onboarding-help p,
  .location-stats small,
  .notification-empty p,
  .settings-compact-empty,
  .settings-compact-empty span,
  .settings-inline-notice p
) {
  color: var(--ui-muted);
}

body.theme-dark.route-app :is(
  .operator-summary-strip strong,
  .operator-explainer strong,
  .onboarding-help strong,
  .location-stats strong,
  .notification-empty strong,
  .settings-compact-empty strong,
  .settings-inline-notice strong
) {
  color: var(--ui-ink);
}

body.theme-dark.route-app :is(
  .onboarding-help a,
  .operator-explainer a,
  .settings-inline-notice-action a
) {
  color: #8ccaf5;
}

body.theme-dark.route-app .settings-tabs button {
  color: var(--ui-muted);
}

body.theme-dark.route-app .settings-tabs button[aria-selected="true"] {
  border-color: #65b8f2;
  color: #b9dcf5;
}

body.theme-dark.route-app .settings-search .icon {
  color: var(--ui-muted);
}

body.theme-dark.route-app .settings-integration-mark {
  color: #b9dcf5;
}

body.theme-dark.route-app .settings-inline-notice.is-warning .settings-inline-notice-icon {
  background: #49351e;
  color: var(--ui-warning);
}

body.theme-dark.route-app .portal-skin-option > strong {
  color: var(--ui-ink);
}

body.theme-dark.route-app .portal-skin-option > small {
  color: var(--ui-muted);
}

body.theme-dark.route-app #modal-root .modal,
body.theme-dark.route-app #modal-root .modal > header,
body.theme-dark.route-app #modal-root .modal > header button,
body.theme-dark.route-seller .top-popover-panel {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
}

body.theme-dark.route-seller {
  --seller-canvas: var(--ui-canvas);
  --seller-accent: #82c9f7;
  --seller-accent-dark: #a8d5ff;
  --seller-success: #8eddbb;
  --seller-warning: #f8cf89;
}

body.theme-dark.route-seller :is(
  .seller-header,
  .seller-theme-button,
  .profile-chip,
  .top-popover-panel,
  .seller-stock-card,
  .seller-receipt,
  .seller-empty-history,
  .seller-sale-panel,
  .seller-bottom-nav,
  input,
  select,
  textarea,
  .button-secondary
) {
  border-color: var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
}

body.theme-dark.route-seller :is(.profile-avatar, .seller-brand > span:last-child) {
  background: #173b59;
  color: #a8d5ff;
}

body.theme-dark.route-seller :is(
  h1,
  h2,
  h3,
  strong,
  label,
  legend,
  dt,
  dd
) {
  color: var(--ui-ink);
}

body.theme-dark.route-seller :is(
  .seller-page-heading p,
  .seller-sale-panel > header p,
  .seller-form-section label small,
  .seller-stock-card-copy small,
  .seller-stock-card-meta small,
  .seller-selected-package > div:first-child span,
  .seller-package-terms small,
  .seller-mini-history > p,
  .seller-empty-history p,
  .seller-footer,
  .profile-summary small
) {
  color: var(--ui-muted);
}

body.theme-dark.route-seller :is(.seller-history-search input, .seller-form-section input) {
  border-color: var(--ui-line-strong);
  background: #111d29;
  color: var(--ui-ink);
}

body.theme-dark.route-seller .skip-link {
  background: #65b8f2;
  color: #071622;
}
