:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ee;
  --panel: #ffffff;
  --page: #f6f3ef;
  --sidebar: #080d13;
  --sidebar-soft: #1a2633;
  --accent: #f36b21;
  --accent-dark: #bd4d12;
  --green: #0e7c66;
  --red: #b42318;
  --blue: #244f9e;
  --shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 18px 12px;
  overflow-y: auto;
  background: radial-gradient(circle at 0 0, rgba(243, 107, 33, 0.13), transparent 36%), var(--sidebar);
  border-right: 1px solid #263443;
  color: #d8e3ef;
}

.sidebar-brand {
  display: grid;
  gap: 10px;
  padding: 8px 8px 22px;
  color: #aab8c7;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-brand strong {
  color: #ffffff;
  font-size: 16px;
}

.sidebar-brand span {
  color: #aab8c7;
  font-size: 12px;
}

.logo {
  width: 188px;
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  background: transparent;
}

.dashboard-nav {
  display: grid;
  gap: 6px;
}

.nav-section {
  margin: 14px 10px 2px;
  color: #7f8b99;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dashboard-nav a {
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 11px 12px;
  color: #d8e3ef;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
  border-left-color: var(--accent);
  background: var(--sidebar-soft);
  color: #ffffff;
}

.shell {
  width: calc(100vw - 260px);
  max-width: calc(100vw - 260px);
  min-height: 100vh;
  margin-left: 260px;
  padding: 24px clamp(16px, 2vw, 28px) 44px;
  overflow-x: hidden;
}

.topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0 0 18px;
  background: linear-gradient(180deg, var(--page) 78%, rgba(246, 243, 239, 0));
}

.header-actions,
.report-links,
.sort-controls,
.chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-actions {
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: stretch;
  padding: clamp(24px, 4vw, 48px);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(15, 23, 33, 0.98), rgba(25, 38, 51, 0.96)),
    radial-gradient(circle at 15% 5%, rgba(243, 107, 33, 0.28), transparent 32%);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  max-width: 820px;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1;
}

.hero-panel p:not(.eyebrow) {
  max-width: 900px;
  margin: 18px 0 0;
  color: #d4dce7;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.45;
}

.hero-status {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-status span {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 800;
}

.hero-status strong {
  font-size: 30px;
}

.panel,
.mini-metric,
.recommendation,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel {
  min-width: 0;
  padding: 16px;
  box-shadow: var(--shadow);
}

.executive {
  border-top: 3px solid var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

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

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

.kpi-grid,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.kpi-card,
.mini-metric,
.recommendation {
  min-width: 0;
  padding: 12px;
}

.kpi-card span,
.mini-metric span,
.recommendation span,
label,
dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi-card strong,
.mini-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.mode-notice,
.reason,
.recommendation p {
  color: var(--muted);
  line-height: 1.45;
}

.mode-notice {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.recommendations {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compact-list {
  min-height: 260px;
  max-height: clamp(320px, calc(100vh - 380px), 760px);
  overflow: auto;
}

.recommendation {
  display: grid;
  gap: 7px;
}

.recommendation p {
  margin: 0;
}

.recommendation button {
  justify-self: start;
  margin-right: 6px;
}

.bulk-route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.bulk-route-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.bulk-route-grid b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gateway-test-grid {
  margin-top: 18px;
}

.gateway-code,
.gateway-secret {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gateway-secret {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080d13;
  color: #fff;
}

.policy-builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.form-row {
  display: grid;
  gap: 6px;
}

textarea,
select,
input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 112px;
  padding: 10px;
  resize: vertical;
}

select,
input {
  min-height: 42px;
  padding: 0 10px;
}

.search-field {
  max-width: 320px;
}

button {
  width: auto;
  max-width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  background: #095b4b;
}

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

.admin-button {
  min-height: 34px;
  border: 1px solid #cbd9ff;
  background: #eef3ff;
  color: var(--blue);
}

.compact-action {
  min-width: 0;
  width: auto;
  white-space: nowrap;
}

.admin-button:hover {
  background: #dfe8ff;
}

.status-pill,
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chip.rejected {
  border-color: #f4c7b3;
  background: #fff7ed;
  color: #b54708;
}

.empty-state {
  border-style: dashed;
  background: #fbfcfe;
  color: var(--muted);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 6px 1px 0;
  border-radius: 999px;
  background: var(--green);
}

.status-dot.degraded {
  background: #d97706;
}

.status-dot.unavailable {
  background: var(--red);
}

.highlight {
  display: inline-block;
  margin-right: 5px;
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff3eb;
  color: var(--accent-dark);
  font-size: 11px;
  text-transform: capitalize;
}

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

dl div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}

dd {
  margin: 4px 0 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

pre {
  min-height: 142px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 7px;
  background: #101828;
  color: #e6f6f2;
  white-space: pre-wrap;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.bars {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.bar-row div {
  height: 10px;
  border-radius: 999px;
  background: #e8eef5;
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.status-ok {
  color: var(--green);
  font-weight: 900;
}

.status-fail {
  color: var(--red);
  font-weight: 900;
}

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

[data-admin-only].hidden,
.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
}

@media (max-width: 1280px) {
  .grid,
  .grid.two,
  .grid.three,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-links {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    padding: 18px 14px 36px;
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .policy-builder,
  .kpi-grid,
  .mini-grid,
  dl {
    grid-template-columns: 1fr;
  }
}

/* CloudLens-inspired enterprise finish */
:root {
  --ink: #0b1118;
  --muted: #7b817d;
  --line: rgba(10, 17, 24, 0.12);
  --panel: rgba(255, 255, 255, 0.88);
  --page: #f7f3ed;
  --sidebar: #080c12;
  --sidebar-soft: rgba(255, 255, 255, 0.08);
  --accent: #ff6a00;
  --accent-dark: #d84d00;
  --green: #0f8b72;
  --blue: #143a72;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

body {
  background:
    radial-gradient(circle at 72% 14%, rgba(255, 106, 0, 0.10), transparent 26rem),
    linear-gradient(115deg, #faf7f2 0%, #f4efe8 52%, #fbfaf8 100%);
}

.sidebar {
  width: 310px;
  padding: 32px 28px 24px;
  background:
    radial-gradient(circle at 0 8%, rgba(255, 106, 0, 0.18), transparent 17rem),
    linear-gradient(180deg, #070b10 0%, #111821 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  gap: 8px;
  padding: 0 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-brand .logo {
  width: min(235px, 100%);
  margin-bottom: 10px;
  border-radius: 0;
}

.sidebar-brand strong {
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.sidebar-brand span {
  color: #8d98a6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  padding: 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-user span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff7a18, #ff5a00);
  color: #111821;
  font-size: 13px;
  font-weight: 950;
}

.sidebar-user strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-nav {
  gap: 10px;
  padding-top: 28px;
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-left: 0;
  border-radius: 14px;
  padding: 0 18px;
  color: #b8c0c9;
  font-size: 15px;
  font-weight: 850;
}

.dashboard-nav a::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 16px;
  border: 1px solid #6d7784;
  border-radius: 999px;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
  background: linear-gradient(120deg, rgba(255, 106, 0, 0.20), rgba(255, 255, 255, 0.08));
  color: #ffffff;
}

.dashboard-nav a.active::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(255, 106, 0, 0.12);
}

.shell {
  width: auto;
  max-width: none;
  margin-left: 310px;
  padding: 26px clamp(24px, 3vw, 58px) 56px;
}

.topbar {
  margin: -26px calc(clamp(24px, 3vw, 58px) * -1) 0;
  padding: 26px clamp(24px, 3vw, 58px) 24px;
  border-bottom: 1px solid rgba(10, 17, 24, 0.08);
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: blur(18px);
}

h1 {
  font-size: clamp(34px, 4.2vw, 76px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(19px, 1.4vw, 28px);
  font-weight: 850;
}

.header-actions {
  align-items: center;
}

.demo-toggle,
.status-pill {
  border: 1px solid rgba(10, 17, 24, 0.10);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.hero-panel {
  min-height: clamp(360px, 44vh, 560px);
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: end;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: clamp(34px, 6vw, 82px);
  background:
    radial-gradient(circle at 6% 16%, rgba(255, 106, 0, 0.34), transparent 22rem),
    radial-gradient(circle at 95% 12%, rgba(255, 106, 0, 0.12), transparent 18rem),
    linear-gradient(130deg, #0b0f14 0%, #161b21 55%, #2a1711 100%);
  box-shadow: 0 36px 90px rgba(8, 12, 18, 0.20);
}

.hero-panel::after {
  content: "";
  position: absolute;
}

.hero-panel h2 {
  max-width: 930px;
  font-size: clamp(48px, 7vw, 110px);
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: 0.94;
}

.hero-panel h2::after {
  content: ".";
  color: var(--accent);
}

.hero-panel p:not(.eyebrow) {
  max-width: 860px;
  color: rgba(255, 255, 255, 0.74);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.22em;
}

.hero-status {
  align-self: center;
  min-height: 130px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.panel,
.mini-metric,
.recommendation,
.kpi-card {
  border-color: rgba(10, 17, 24, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 22px 54px rgba(18, 24, 30, 0.08);
}

.panel {
  padding: clamp(18px, 2vw, 30px);
}

.executive {
  border-top: 0;
}

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

.mini-metric,
.kpi-card {
  min-height: 112px;
  display: grid;
  align-content: space-between;
}

.mini-metric strong,
.kpi-card strong {
  color: #0b1118;
  font-size: clamp(22px, 2vw, 34px);
  letter-spacing: -0.03em;
}

.recommendation {
  border-radius: 18px;
  padding: 18px;
}

.recommendation strong {
  font-size: 16px;
}

.policy-builder {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

textarea,
select,
input {
  min-height: 48px;
  border-color: rgba(10, 17, 24, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

textarea:focus,
select:focus,
input:focus {
  outline: 2px solid rgba(255, 106, 0, 0.35);
  border-color: var(--accent);
}

button {
  min-height: 46px;
  border-radius: 14px;
  padding: 0 20px;
  background: #0b0f14;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.10);
}

button:hover {
  background: #171d24;
}

.admin-button {
  min-height: 42px;
  border: 1px solid rgba(255, 106, 0, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: #0d1721;
}

.admin-button:hover {
  background: #fff3ea;
  color: var(--accent-dark);
}

#calculateComparisonButton,
#sendButton,
#loginButton,
#updatePricingButton,
#savePolicyButton {
  background: linear-gradient(135deg, #ff7a18, #ff5a00);
  color: #ffffff;
}

#calculateComparisonButton:hover,
#sendButton:hover,
#loginButton:hover,
#updatePricingButton:hover,
#savePolicyButton:hover {
  background: linear-gradient(135deg, #ff8a2a, #e94f00);
}

.chip,
.status-pill {
  border-color: rgba(10, 17, 24, 0.10);
  background: rgba(255, 255, 255, 0.76);
}

.table-wrap {
  border: 1px solid rgba(10, 17, 24, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

table {
  min-width: 760px;
}

th {
  background: rgba(8, 12, 18, 0.03);
  color: #7b817d;
  letter-spacing: 0.08em;
}

td,
th {
  padding: 14px 12px;
}

pre {
  border-radius: 18px;
  background: #090d13;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 0 24%, rgba(255, 106, 0, 0.38), transparent 22rem),
    radial-gradient(circle at 100% 62%, rgba(255, 106, 0, 0.26), transparent 24rem),
    linear-gradient(120deg, #05070a 0%, #11161d 55%, #27130b 100%);
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 72%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 32px));
  display: grid;
  gap: 20px;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(255, 106, 0, 0.32);
  border-radius: 28px;
  background: rgba(10, 15, 21, 0.82);
  color: #ffffff;
  box-shadow: 0 48px 120px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
}

.login-brand {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
}

.login-logo {
  width: min(620px, 100%);
  max-width: 100%;
  border-radius: 24px;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.35);
}

.login-brand span {
  border-left: 0;
  padding-left: 0;
  color: #ff6a00;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 {
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.96;
}

.login-card .reason,
.login-card .mode-notice {
  color: rgba(255, 255, 255, 0.74);
}

.login-card label {
  color: #ffffff;
}

.login-card input {
  border-color: rgba(255, 106, 0, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.ai-orb {
  position: fixed;
  right: clamp(18px, 3vw, 42px);
  bottom: clamp(18px, 3vw, 42px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 20%, #ff9a3d, #ff5f00 62%, #9f3000);
  color: #ffffff;
  font-weight: 950;
  box-shadow: 0 24px 60px rgba(255, 106, 0, 0.32);
}

@media (max-width: 1400px) {
  .sidebar {
    width: 280px;
    padding-inline: 22px;
  }

  .shell {
    margin-left: 280px;
  }

  .dashboard-nav a {
    min-height: 50px;
  }
}

@media (max-width: 1100px) {
  .hero-panel,
  .grid,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 18px;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  .sidebar-brand .logo {
    width: 180px;
    margin-bottom: 0;
  }

  .dashboard-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding-top: 16px;
  }

  .dashboard-nav a {
    min-height: 44px;
  }

  .shell {
    margin-left: 0;
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 0;
    padding: 18px;
  }

  .hero-panel {
    min-height: auto;
    padding: 30px;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 560px) {
  .report-links,
  .sort-controls,
  .header-actions {
    width: 100%;
  }

  .report-links button,
  .sort-controls button,
  .header-actions > * {
    flex: 1 1 160px;
  }

  .login-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-brand span {
    border-left: 0;
    padding-left: 0;
  }
}

.sidebar-ready {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-ready strong {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  font-size: 0;
}

.sidebar-ready strong::before {
  content: "\2713";
  font-size: 15px;
}

.sidebar-ready span {
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.sidebar-ready em {
  color: #9aa6b2;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.scenario-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.scenario-actions .admin-button {
  flex: 0 1 auto;
}

.comparison-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.comparison-steps span {
  border: 1px solid rgba(255, 111, 0, 0.24);
  border-radius: 999px;
  background: rgba(255, 111, 0, 0.08);
  color: #5c6470;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
}

.comparison-steps strong {
  color: #ff6f00;
  margin-right: 6px;
}

.route-explanation {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.route-section,
.route-metrics {
  border: 1px solid rgba(10, 17, 24, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.70);
  padding: 16px;
}

.route-section h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.route-section strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
}

.route-section p {
  margin: 8px 0 0;
  color: var(--muted);
}

.route-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.route-section li {
  color: #2f3741;
  line-height: 1.45;
}

.route-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.route-metrics div {
  border-radius: 14px;
  padding: 12px;
  background: rgba(8, 12, 18, 0.04);
}

.route-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.route-metrics strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
}

.route-denied {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff7f5;
}

.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.settings-card {
  border: 1px solid rgba(10, 17, 24, 0.11);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  padding: clamp(18px, 2vw, 28px);
  box-shadow: var(--shadow);
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.settings-card h3 {
  margin: 0;
  font-size: clamp(22px, 2vw, 32px);
}

.settings-card-head span {
  border-radius: 999px;
  padding: 8px 12px;
  background: #dcfce7;
  color: #047857;
  font-size: 12px;
  font-weight: 950;
}

.settings-fields {
  display: grid;
  gap: 12px;
}

.settings-fields div {
  border: 1px solid rgba(10, 17, 24, 0.09);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.settings-fields small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-fields strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.cloud-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 42px;
  padding: 26px 6px 0;
  border-top: 1px solid rgba(10, 17, 24, 0.12);
  color: #7b817d;
  font-size: 12px;
  font-weight: 850;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-brand img {
  width: 140px;
  border-radius: 10px;
  background: #080c12;
}

.footer-brand span {
  color: #747a78;
  letter-spacing: 0.02em;
}

.app-ai-orb {
  border: 0;
}

.assistant-panel {
  position: fixed;
  right: clamp(18px, 3vw, 48px);
  bottom: clamp(100px, 9vw, 132px);
  z-index: 30;
  width: min(660px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 140px));
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 106, 0, 0.26);
  border-radius: 32px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 106, 0, 0.16), transparent 16rem),
    rgba(12, 16, 22, 0.96);
  color: #ffffff;
  box-shadow: 0 42px 110px rgba(0, 0, 0, 0.38);
}

.assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.assistant-header h2 {
  color: #ffffff;
}

.assistant-close {
  width: 48px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 28px;
}

.assistant-messages {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 24px 28px;
}

.assistant-message {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.assistant-message span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(255, 106, 0, 0.24);
  color: #ffb47a;
  font-weight: 950;
}

.assistant-message p {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.assistant-message.user span {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.assistant-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 28px 20px;
}

.assistant-prompts button {
  min-height: 38px;
  border: 1px solid rgba(255, 106, 0, 0.35);
  background: rgba(255, 106, 0, 0.10);
  color: #ffffff;
}

.assistant-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.assistant-input input {
  border-color: rgba(255, 106, 0, 0.50);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.assistant-input input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.assistant-input button {
  background: linear-gradient(135deg, #ff7a18, #ff5a00);
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .cloud-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .assistant-panel {
    right: 12px;
    bottom: 92px;
    width: calc(100vw - 24px);
  }

  .assistant-input {
    grid-template-columns: 1fr;
  }
}

/* Final visual tuning: logo fit, header alignment, buttons, empty cards, spacing */
:root {
  --cloudwrxs-orange: #ff6a00;
  --cloudwrxs-amber: #ffb05c;
  --warm-panel: rgba(255, 252, 247, 0.92);
  --warm-line: rgba(88, 55, 31, 0.14);
}

body {
  background:
    radial-gradient(circle at 83% 3%, rgba(255, 106, 0, 0.18), transparent 26rem),
    radial-gradient(circle at 14% 12%, rgba(9, 14, 21, 0.08), transparent 23rem),
    linear-gradient(135deg, #fbf8f3 0%, #f2ebe1 44%, #fffaf4 100%);
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  justify-items: start;
}

.sidebar-brand .logo {
  display: block;
  width: min(252px, 100%);
  max-height: 132px;
  padding: 0;
  border-radius: 18px;
  background: #080c12;
  object-fit: contain;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.sidebar-brand span {
  display: block;
  margin-top: 12px;
  padding-left: 2px;
  color: #b4bdc8;
  max-width: 240px;
  font-size: 11px;
  line-height: 1.35;
}

.topbar {
  min-height: 96px;
  align-items: center;
  background:
    radial-gradient(circle at 84% 10%, rgba(255, 106, 0, 0.13), transparent 18rem),
    linear-gradient(90deg, rgba(255, 252, 247, 0.94), rgba(247, 239, 229, 0.86));
}

.topbar h1 {
  max-width: min(980px, 100%);
  font-size: clamp(34px, 3.35vw, 58px);
  line-height: 0.98;
}

.topbar > div:first-child {
  min-width: 0;
}

.page-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  max-width: min(980px, calc(100vw - 430px));
}

.page-subnav.hidden {
  display: none;
}

.page-subnav button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 106, 0, 0.24);
  border-radius: 999px;
  color: #3b4655;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 106, 0, 0.12), transparent 58%),
    rgba(255, 250, 244, 0.92);
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.page-subnav button:hover,
.page-subnav button:focus-visible {
  border-color: rgba(255, 106, 0, 0.58);
  color: #111827;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 106, 0, 0.22), transparent 58%),
    rgba(255, 245, 235, 0.98);
}

.page [id] {
  scroll-margin-top: 132px;
}

.header-actions {
  flex: 0 0 auto;
  align-self: center;
}

.dashboard-nav {
  gap: 12px;
  flex: 1 0 auto;
}

.dashboard-nav a {
  gap: 14px;
  min-height: 60px;
  padding: 0 16px;
  border: 1px solid transparent;
}

.dashboard-nav a::before {
  display: none;
}

.dashboard-nav a > span:last-child {
  min-width: 0;
}

.nav-svg {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid rgba(255, 106, 0, 0.30);
  border-radius: 13px;
  color: var(--cloudwrxs-amber);
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 106, 0, 0.22), transparent 58%),
    linear-gradient(145deg, rgba(255, 106, 0, 0.13), rgba(255, 255, 255, 0.02));
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
  border-color: rgba(255, 106, 0, 0.18);
  box-shadow: inset 3px 0 0 var(--cloudwrxs-orange), 0 14px 34px rgba(0, 0, 0, 0.12);
}

.dashboard-nav a:hover .nav-svg,
.dashboard-nav a.active .nav-svg {
  transform: translateY(-1px);
}

.dashboard-nav a.active .nav-svg {
  color: #ffffff;
  background: linear-gradient(135deg, #ff7a18, #ff5a00);
  box-shadow: 0 0 0 8px rgba(255, 106, 0, 0.13);
}

.sidebar-section-nav {
  position: relative;
  display: grid;
  gap: 4px;
  margin: -4px 0 8px 34px;
  padding: 4px 0 8px 22px;
}

.sidebar-section-nav::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 10px;
  left: 6px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 106, 0, 0.55), rgba(255, 255, 255, 0.08));
}

.sidebar-section-nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  width: 100%;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 10px;
  color: rgba(229, 234, 242, 0.72);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.sidebar-section-nav button span {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 106, 0, 0.62);
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.05);
}

.sidebar-section-nav button:hover,
.sidebar-section-nav button:focus-visible {
  color: #ffffff;
  background: rgba(255, 106, 0, 0.08);
  transform: none;
}

.sidebar-section-nav button:hover span,
.sidebar-section-nav button:focus-visible span {
  background: var(--cloudwrxs-orange);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.13);
}

.hero-panel {
  position: relative;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 52% 34%, black, transparent 76%);
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.panel,
.mini-metric,
.recommendation,
.kpi-card,
.scenario-card,
.metric-card {
  border-color: var(--warm-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), var(--warm-panel));
}

.panel {
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--cloudwrxs-orange), rgba(255, 176, 92, 0.22), transparent);
}

.panel > * {
  position: relative;
}

.section-heading h2,
.panel h2 {
  letter-spacing: -0.02em;
}

.kpi-card,
.mini-metric {
  border-top: 3px solid rgba(255, 106, 0, 0.45);
}

.status-pill,
.demo-toggle,
.chip {
  background: rgba(255, 250, 244, 0.86);
  border-color: rgba(255, 106, 0, 0.18);
}

.gateway-live-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 106, 0, 0.24);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 106, 0, 0.08), rgba(255, 255, 255, 0.82));
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.gateway-live-toggle input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: #ff6a00;
}

.gateway-live-toggle strong,
.gateway-live-toggle small {
  display: block;
}

.gateway-live-toggle small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.gateway-result-card {
  gap: 10px;
}

.gateway-result-card.error {
  border-left-color: #ef4444;
}

.gateway-selection-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.gateway-prompt-detail {
  margin-top: 4px;
}

.gateway-prompt-detail summary {
  cursor: pointer;
  color: #d95500;
  font-weight: 800;
}

.gateway-prompt-detail pre,
.gateway-output-text {
  width: 100%;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  padding: 14px;
  border-radius: 14px;
  background: #080d13;
  color: #f7fafc;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.gateway-prompt-detail pre {
  max-height: 160px;
  background: rgba(8, 13, 19, 0.92);
}

.sidebar-user {
  margin-top: auto;
}

.sidebar-user > div {
  min-width: 0;
}

.sidebar-logout {
  min-height: 32px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 106, 0, 0.32);
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.10);
  color: #ffb05c;
  box-shadow: none;
}

.sidebar-logout:hover {
  background: rgba(255, 106, 0, 0.18);
  color: #ffffff;
}

.kpi-card:nth-child(4n + 1),
.mini-metric:nth-child(4n + 1) {
  background: linear-gradient(145deg, rgba(255, 106, 0, 0.15), rgba(255, 255, 255, 0.94));
}

.kpi-card:nth-child(4n + 2),
.mini-metric:nth-child(4n + 2) {
  background: linear-gradient(145deg, rgba(15, 139, 114, 0.14), rgba(255, 255, 255, 0.94));
  border-top-color: rgba(15, 139, 114, 0.50);
}

.kpi-card:nth-child(4n + 3),
.mini-metric:nth-child(4n + 3) {
  background: linear-gradient(145deg, rgba(20, 58, 114, 0.12), rgba(255, 255, 255, 0.94));
  border-top-color: rgba(20, 58, 114, 0.40);
}

.kpi-card:nth-child(4n),
.mini-metric:nth-child(4n) {
  background: linear-gradient(145deg, rgba(180, 35, 24, 0.09), rgba(255, 255, 255, 0.94));
  border-top-color: rgba(180, 35, 24, 0.36);
}

.recommendation {
  border-left: 4px solid rgba(255, 106, 0, 0.45);
}

.recommendation:nth-child(3n + 2) {
  border-left-color: rgba(15, 139, 114, 0.55);
}

.recommendation:nth-child(3n) {
  border-left-color: rgba(20, 58, 114, 0.46);
}

.decision-narrative {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin-top: 18px;
}

.decision-card {
  min-height: 168px;
  padding: 18px;
  border: 1px solid rgba(88, 55, 31, 0.12);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 106, 0, 0.15), rgba(255, 255, 255, 0.94));
  box-shadow: 0 18px 42px rgba(18, 24, 30, 0.08);
}

.decision-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--cloudwrxs-orange);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.decision-card strong {
  display: block;
  color: #0b1118;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.12;
}

.decision-card p {
  margin: 12px 0 0;
  color: #687078;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.mix-explanation {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 106, 0, 0.16);
  border-left: 4px solid var(--cloudwrxs-orange);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 106, 0, 0.12), transparent 12rem),
    rgba(255, 255, 255, 0.74);
}

.mix-explanation strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.mix-explanation p {
  margin: 8px 0 0;
  color: #687078;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.decision-green {
  background: linear-gradient(145deg, rgba(15, 139, 114, 0.15), rgba(255, 255, 255, 0.94));
}

.decision-green span {
  color: #0f8b72;
}

.decision-blue {
  background: linear-gradient(145deg, rgba(20, 58, 114, 0.13), rgba(255, 255, 255, 0.94));
}

.decision-blue span {
  color: #143a72;
}

.decision-empty {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, rgba(255, 106, 0, 0.10), rgba(255, 255, 255, 0.94));
}

.chip:nth-child(4n + 1) {
  background: rgba(255, 106, 0, 0.10);
  border-color: rgba(255, 106, 0, 0.28);
  color: #9a3a00;
}

.chip:nth-child(4n + 2) {
  background: rgba(15, 139, 114, 0.10);
  border-color: rgba(15, 139, 114, 0.24);
  color: #075f50;
}

.chip:nth-child(4n + 3) {
  background: rgba(20, 58, 114, 0.09);
  border-color: rgba(20, 58, 114, 0.20);
  color: #143a72;
}

.chip.rejected,
.notice.error,
.status-pill:has(+ .request-denied) {
  background: rgba(180, 35, 24, 0.10);
  border-color: rgba(180, 35, 24, 0.25);
  color: #8a1f17;
}

.notification-card,
.alert-card {
  border-left: 5px solid var(--cloudwrxs-orange);
  background: linear-gradient(145deg, rgba(255, 106, 0, 0.10), rgba(255, 255, 255, 0.92));
}

pre {
  border: 1px solid rgba(255, 106, 0, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-ready strong {
  font-size: 0;
}

button,
.admin-button {
  width: auto;
  min-width: max-content;
  min-height: 42px;
  max-width: 100%;
  padding: 0 18px;
  white-space: nowrap;
}

.report-links button,
.sort-controls button,
.scenario-actions button,
.assistant-prompts button {
  flex: 0 1 auto;
}

.scenario-actions {
  align-items: center;
}

.panel:not([data-keep-visible]):has(.empty-state:only-child),
.panel:not([data-keep-visible]):has(> .recommendations:empty) {
  display: none;
}

.panel:not([data-keep-visible]):has(.empty-state:only-child) + .panel:not([data-keep-visible]):has(.empty-state:only-child) {
  display: none;
}

.compact-list {
  max-height: clamp(300px, 48vh, 680px);
}

.page.active {
  gap: clamp(14px, 1.6vw, 24px);
}

.grid,
.grid.two,
.grid.three {
  gap: clamp(14px, 1.6vw, 24px);
}

.panel {
  padding: clamp(18px, 1.75vw, 28px);
}

@media (max-width: 1280px) {
  .topbar {
    min-height: 82px;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    align-self: flex-start;
  }

  .report-links,
  .sort-controls,
  .scenario-actions {
    width: 100%;
  }

  .report-links button,
  .sort-controls button,
  .scenario-actions button {
    flex: 1 1 150px;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .page-subnav {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .page-subnav button {
    flex: 0 0 auto;
  }

  .topbar h1 {
    font-size: clamp(30px, 8vw, 46px);
  }

  .sidebar-brand {
    align-items: center;
  }

  .sidebar-brand span {
    width: 100%;
  }

  .compact-list {
    max-height: 55vh;
  }
}

@media (max-width: 560px) {
  button,
  .admin-button {
    min-width: 0;
  }
}

/* ModelCompass brand system */
.product-brand-lockup {
  --mark-size: 82px;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  color: #ffffff;
  background: transparent;
}

.login-brand.product-brand-lockup {
  flex-direction: row;
  align-items: center;
  gap: 22px;
}

.sidebar-product-lockup {
  --mark-size: 78px;
  gap: 14px;
}

.login-product-lockup {
  --mark-size: 128px;
}

.brand-compass-mark {
  flex: 0 0 var(--mark-size);
  width: var(--mark-size);
  height: var(--mark-size);
  border-radius: 22px;
  background:
    radial-gradient(circle at 68% 24%, rgba(255, 106, 0, 0.30), transparent 28%),
    radial-gradient(circle at 36% 68%, rgba(255, 255, 255, 0.10), transparent 34%),
    linear-gradient(145deg, rgba(14, 22, 30, 0.88), rgba(4, 8, 13, 0.72));
  box-shadow:
    inset 0 0 0 1px rgba(255, 106, 0, 0.48),
    0 20px 58px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(255, 106, 0, 0.14);
}

.brand-compass-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(235, 241, 246, 0.82);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-compass-mark rect {
  stroke: rgba(255, 106, 0, 0.88);
}

.brand-compass-mark circle {
  stroke: rgba(235, 241, 246, 0.72);
}

.brand-compass-mark .brand-needle {
  fill: rgba(255, 106, 0, 0.32);
  stroke: #ff6a00;
  stroke-width: 2.4;
}

.brand-compass-mark .brand-node {
  fill: rgba(8, 14, 20, 0.82);
  stroke: #ff8a2a;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.brand-copy strong {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-size: clamp(26px, 4.2vw, 46px);
  font-weight: 950;
  letter-spacing: 0.07em;
  line-height: 0.95;
}

.sidebar-product-lockup .brand-copy strong {
  font-size: 20px;
}

.brand-copy strong span,
.login-brand.product-brand-lockup .brand-copy strong span,
.sidebar-brand .brand-copy strong span {
  margin: 0;
  padding: 0;
  color: #f6f7f8;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.brand-copy strong b {
  color: #ff6a00;
  font: inherit;
}

.brand-copy em,
.login-brand.product-brand-lockup .brand-copy em,
.sidebar-brand .brand-copy em {
  color: #ff6a00;
  font-style: normal;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.42em;
  line-height: 1.2;
  text-transform: uppercase;
}

.sidebar-product-lockup .brand-copy em {
  font-size: 8px;
  letter-spacing: 0.22em;
}

.brand-copy small,
.login-brand.product-brand-lockup .brand-copy small,
.sidebar-brand .brand-copy small {
  color: rgba(239, 243, 246, 0.84);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.sidebar-product-lockup .brand-copy small {
  font-size: 10px;
}

.cloudwrxs-word {
  display: inline;
  margin: 0;
  padding: 0;
  border-left: 0;
  color: #f5f7fa;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: inherit;
  text-transform: none;
}

.login-brand.product-brand-lockup .brand-copy span,
.sidebar-brand .brand-copy span {
  display: inline;
  max-width: none;
  margin: 0;
  padding: 0;
  border-left: 0;
}

.login-brand.product-brand-lockup > span {
  display: none;
}

.sidebar-brand > span {
  margin-top: 18px;
  max-width: 250px;
  color: #c6cdd5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cloud-footer {
  align-items: center;
}

.cloudwrxs-footer-logo {
  display: block;
  width: 230px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.footer-brand > span {
  color: #6c747c;
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 900px) {
  .login-brand.product-brand-lockup,
  .product-brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-product-lockup {
    --mark-size: 104px;
  }

  .brand-copy strong {
    font-size: clamp(28px, 10vw, 42px);
  }
}

/* Restore premium generated ModelCompass artwork while keeping the page-matched background. */
.login-brand:not(.product-brand-lockup) {
  display: block;
}

.login-product-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
}

.sidebar-brand .modelcompass-logo {
  width: min(230px, 100%);
  max-height: none;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

/* Blend the existing ModelCompass artwork into the dark product surface. */
.login-card {
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 106, 0, 0.12), transparent 24rem),
    radial-gradient(circle at 100% 38%, rgba(255, 106, 0, 0.08), transparent 22rem),
    linear-gradient(145deg, #070d13 0%, #060b11 58%, #090d13 100%);
}

.login-brand,
.sidebar-brand {
  isolation: isolate;
}

.login-product-logo,
.sidebar-brand .modelcompass-logo {
  mix-blend-mode: normal;
  opacity: 1;
}

/* Post-login sidebar brand: use the transparent artwork larger, without a pasted image box. */
.sidebar {
  overflow-x: hidden;
}

.sidebar-brand {
  min-height: 304px;
  overflow: visible;
  padding: 0 0 24px;
}

.sidebar-brand .modelcompass-logo {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 280px;
  height: auto;
  margin: 0 auto;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  object-fit: contain;
}

/* ModelCompass responsive fit pass - 2026-08-18 */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

.shell,
.page,
.panel,
.hero-panel,
.topbar,
.section-heading,
.gateway-code,
.gateway-output-text {
  min-width: 0;
}

.topbar {
  flex-wrap: wrap;
  gap: 16px;
}

.topbar h1 {
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.page-subnav {
  max-width: 100%;
  flex-wrap: wrap;
}

.hero-panel {
  min-height: clamp(260px, 34vh, 430px);
  padding: clamp(28px, 4vw, 58px);
  grid-template-columns: minmax(0, 1fr) minmax(200px, 320px);
  gap: clamp(18px, 3vw, 44px);
}

.hero-panel h2 {
  max-width: 100%;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.hero-panel p:not(.eyebrow) {
  max-width: min(760px, 100%);
}

.hero-status {
  min-width: 0;
}

.grid.two,
.grid.three,
.settings-layout,
.gateway-test-grid,
.policy-builder {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.table-wrap,
.gateway-code,
.gateway-output-text,
.gateway-prompt-detail pre {
  max-width: 100%;
  overflow-x: auto;
}

.recommendation,
.mini-metric,
.form-row,
input,
select,
textarea,
button {
  max-width: 100%;
}

.cloud-footer {
  flex-wrap: wrap;
  gap: 16px;
}

.sidebar {
  overflow-x: hidden;
}

.sidebar-brand {
  min-height: auto;
  padding-bottom: clamp(14px, 2vh, 24px);
}

.sidebar-brand .modelcompass-logo {
  width: min(100%, 250px);
  max-height: min(26vh, 245px);
  object-fit: contain;
  object-position: center;
}

.dashboard-nav {
  gap: clamp(7px, 1.1vh, 12px);
  padding-top: clamp(14px, 2vh, 26px);
}

.dashboard-nav a {
  min-height: clamp(48px, 6vh, 56px);
  padding: clamp(10px, 1.4vh, 15px) 14px;
}

.sidebar-user,
.sidebar-ready {
  margin-block: clamp(10px, 1.4vh, 18px);
}

.login-shell {
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(14px, 2.2vh, 28px);
}

.login-card {
  width: min(92vw, 640px);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  gap: clamp(9px, 1.4vh, 14px);
  padding: clamp(22px, 4vh, 46px);
}

.login-product-logo {
  max-height: min(25vh, 230px);
  object-fit: contain;
}

.login-card h1 {
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.92;
}

.login-card .reason {
  margin: 0;
}

@media (max-height: 860px) {
  .login-card {
    max-height: calc(100vh - 20px);
    padding: 22px 34px;
  }

  .login-product-logo {
    max-height: 165px;
  }

  .login-card h1 {
    font-size: clamp(34px, 5vw, 58px);
  }

  .login-card .mode-notice:last-child {
    margin-top: 6px;
  }

  .sidebar {
    padding-top: 18px;
    padding-bottom: 16px;
  }

  .sidebar-brand .modelcompass-logo {
    max-height: 150px;
  }

  .dashboard-nav a {
    min-height: 46px;
    padding: 9px 12px;
  }

  .sidebar-ready {
    display: none;
  }

  .hero-panel {
    min-height: 250px;
    padding: 28px;
  }

  .hero-panel h2 {
    font-size: clamp(36px, 5vw, 64px);
  }
}

@media (max-width: 1100px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

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

@media (max-width: 640px) {
  .topbar,
  .page,
  .shell {
    padding-inline: 16px;
  }

  .panel,
  .hero-panel {
    border-radius: 14px;
  }

  .page-subnav {
    gap: 8px;
  }

  .login-card {
    width: min(94vw, 560px);
    padding: 20px;
  }
}

/* ModelCompass login single-screen final pass - 2026-08-18 */
.login-shell {
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(10px, 1.6vh, 18px) clamp(14px, 2vw, 28px);
  overflow: hidden;
}

.login-shell .ai-orb {
  display: none;
}

.login-card {
  width: min(92vw, 720px);
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  overflow: hidden;
  gap: clamp(7px, 1vh, 11px);
  padding: clamp(18px, 2.7vh, 34px) clamp(30px, 4vw, 54px);
}

.login-brand {
  display: block;
  width: min(100%, 520px);
  margin: 0 auto clamp(6px, 1vh, 12px);
}

.login-product-logo {
  display: block;
  width: 100%;
  max-height: clamp(118px, 21vh, 205px);
  object-fit: contain;
  object-position: center;
}

.login-card .eyebrow {
  margin: clamp(4px, 0.8vh, 10px) 0 0;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 0.9;
}

.login-card .reason {
  margin: clamp(4px, 0.8vh, 10px) 0 clamp(2px, 0.6vh, 8px);
  font-size: clamp(14px, 1.4vw, 18px);
}

.login-card .composer {
  gap: 5px;
}

.login-card label {
  line-height: 1.1;
}

.login-card input {
  min-height: 52px;
  padding-block: 10px;
}

.login-card #loginButton {
  min-height: 48px;
  padding-block: 10px;
}

.login-card .mode-notice:last-child {
  display: none;
}

@media (max-height: 820px) {
  .login-card {
    width: min(92vw, 660px);
    padding: 16px clamp(26px, 4vw, 44px);
    gap: 6px;
  }

  .login-product-logo {
    max-height: 145px;
  }

  .login-card h1 {
    font-size: clamp(34px, 5vw, 58px);
  }

  .login-card .reason {
    font-size: 14px;
  }

  .login-card input {
    min-height: 46px;
  }

  .login-card #loginButton {
    min-height: 44px;
  }
}

@media (max-height: 700px) {
  .login-product-logo {
    max-height: 112px;
  }

  .login-card h1 {
    font-size: clamp(30px, 4.6vw, 48px);
  }
}

/* ModelCompass final page layout and subnav polish - 2026-08-18 */
.page.active,
.page.active > *,
.page.active .grid,
.page.active .panel {
  min-width: 0;
}

.page.active .grid.two,
.page.active .grid.three,
.page.active .settings-layout,
.page.active .gateway-test-grid,
.page.active .policy-builder {
  align-items: stretch;
}

.sidebar-section-nav button.active,
.sidebar-section-nav button.active:hover,
.sidebar-section-nav button.active:focus-visible {
  color: #ffffff;
  background:
    linear-gradient(120deg, rgba(255, 106, 0, 0.22), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 106, 0, 0.36);
}

.sidebar-section-nav button.active span {
  background: var(--cloudwrxs-orange);
  box-shadow: 0 0 0 5px rgba(255, 106, 0, 0.16);
}

.page-subnav button.active {
  color: #111827;
  border-color: rgba(255, 106, 0, 0.72);
  background:
    linear-gradient(120deg, rgba(255, 106, 0, 0.17), rgba(255, 255, 255, 0.9));
  box-shadow: 0 10px 24px rgba(255, 106, 0, 0.14);
}

#comparison-model-selection {
  display: flex;
  flex-direction: column;
  min-height: clamp(720px, calc(100vh - 150px), 1080px);
}

#comparison-model-selection .policy-builder {
  flex: 0 0 auto;
}

#modelCatalogue.compact-list {
  flex: 1 1 auto;
  min-height: clamp(520px, calc(100vh - 360px), 880px);
  max-height: none;
  padding-right: 4px;
}

#comparison-workload-inputs,
#router-response-panel,
#developer-integrations-panel,
#admin-users-panel,
#admin-provider-availability-panel,
#admin-simulation-controls-panel,
#admin-model-controls-panel,
#provider-credential-references,
#provider-validation-gates {
  align-self: stretch;
  min-height: 0;
}

#provider-validation-gates .recommendations,
#admin-provider-availability-panel .recommendations,
#recentActivityPanel .recommendations,
#recentScenariosPanel .recommendations,
#cost-forecast-drivers-panel .recommendations {
  max-height: min(70vh, 760px);
  overflow: auto;
  padding-right: 4px;
}

#developer-integrations-panel .gateway-test-grid,
#decision-mix-panels,
#dashboard-provider-activity-row {
  align-items: start;
}

#comparison-selected-models,
#comparison-cost-eligibility,
#comparison-optimization,
#comparison-recommendations,
#comparison-market-catalogue,
#comparison-manual-demo,
#developer-integrations-panel,
#admin-provider-availability-panel,
#admin-model-controls-panel,
#provider-credential-references,
#provider-validation-gates,
#router-response-panel {
  scroll-margin-top: 112px;
}

@media (max-width: 1100px) {
  #comparison-model-selection {
    min-height: auto;
  }

  #modelCatalogue.compact-list {
    min-height: 420px;
    max-height: 68vh;
  }
}

/* ModelCompass comparison equal panel sizing - 2026-08-18 */
#comparison-model-selection,
#comparison-workload-inputs {
  align-self: stretch;
  min-height: 0;
  height: 100%;
}

#comparison-model-selection {
  display: flex;
  flex-direction: column;
  max-height: none;
}

#comparison-model-selection .policy-builder {
  flex: 0 0 auto;
}

#modelCatalogue.compact-list {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

@media (min-width: 1101px) {
  #model-comparison > .grid.two {
    align-items: stretch;
  }

  #comparison-model-selection,
  #comparison-workload-inputs {
    min-height: auto;
  }
}

@media (max-width: 1100px) {
  #comparison-model-selection,
  #comparison-workload-inputs {
    height: auto;
  }

  #modelCatalogue.compact-list {
    min-height: 360px;
    max-height: 58vh;
  }
}


/* ModelCompass readiness responsive panel fix - 2026-08-18 */
#live-readiness #readiness-summary.grid.two {
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

#live-readiness #readiness-summary > .panel {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#live-readiness #readiness-summary .recommendations,
#live-readiness #readiness-summary .mode-notice,
#live-readiness #readiness-summary .form-row,
#live-readiness #readiness-summary .policy-builder,
#live-readiness #readiness-summary .compact-checks {
  min-width: 0;
  max-width: 100%;
}

#live-readiness #readiness-summary .form-row {
  width: 100%;
}

#live-readiness #readiness-summary .form-row select {
  width: 100%;
  max-width: 100%;
}

#live-readiness #readiness-summary .compact-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(12px, 1.4vw, 18px);
}

#live-readiness #readiness-summary .compact-checks label {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 111, 15, 0.18);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.64);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#live-readiness #readiness-summary .compact-checks input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
}

#live-readiness #readiness-summary #saveLiveCallStateButton {
  align-self: flex-start;
  margin-top: auto;
}

@media (max-width: 1240px) {
  #live-readiness #readiness-summary.grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #live-readiness #readiness-summary .compact-checks {
    grid-template-columns: 1fr;
  }
}

/* ModelCompass model selection matches workload height - 2026-08-18 */
#model-comparison > .grid.two {
  align-items: start !important;
}

#comparison-workload-inputs {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  align-self: start !important;
}

#comparison-model-selection {
  min-height: 0 !important;
  align-self: start !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#comparison-model-selection .policy-builder {
  flex: 0 0 auto;
}

#modelCatalogue.compact-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding-right: 4px;
}

@media (max-width: 900px) {
  #comparison-model-selection {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #modelCatalogue.compact-list {
    max-height: 420px !important;
  }
}

/* ModelCompass readiness side-by-side correction - 2026-08-18 */
#live-readiness #readiness-summary.grid.two {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: start !important;
  gap: clamp(18px, 2vw, 30px) !important;
}

#live-readiness #readiness-summary > .panel {
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  align-self: start !important;
  overflow: hidden;
}

#live-readiness #readiness-summary .recommendations {
  max-height: min(42vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

#live-readiness #readiness-summary .compact-checks {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1vw, 14px) !important;
}

#live-readiness #readiness-summary .compact-checks label {
  min-width: 0 !important;
  overflow-wrap: anywhere;
}

#live-readiness #readiness-summary .form-row,
#live-readiness #readiness-summary .form-row select,
#live-readiness #readiness-summary .mode-notice,
#live-readiness #readiness-summary button {
  max-width: 100%;
}

@media (max-width: 900px) {
  #live-readiness #readiness-summary.grid.two {
    grid-template-columns: 1fr !important;
  }

  #live-readiness #readiness-summary .recommendations {
    max-height: 420px;
  }
}

@media (max-width: 640px) {
  #live-readiness #readiness-summary .compact-checks {
    grid-template-columns: 1fr !important;
  }
}

/* ModelCompass cost and admin go-live polish - 2026-08-19 */
#cost-intelligence #costKpiGrid:empty::before {
  content: "Cost intelligence will populate after live routing records include token usage and estimated cost.";
  display: block;
  padding: 18px;
  border: 1px solid rgba(255, 111, 15, 0.22);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.72);
  color: var(--muted);
  font-weight: 800;
}

#admin > .grid.two {
  align-items: start !important;
}

#admin-simulation-controls-panel {
  align-self: start !important;
  min-height: 0 !important;
  height: auto !important;
}

#admin-simulation-controls-panel .sort-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
}

#admin-simulation-controls-panel .sort-controls .admin-button {
  width: 100%;
  min-height: 44px;
}

#admin-model-controls-panel {
  align-self: start !important;
  min-height: 0 !important;
}

#admin-model-controls-panel .recommendations {
  max-height: min(64vh, 720px);
  overflow: auto;
  padding-right: 4px;
}
