.nexus-app {
  --nexus-accent: #1d4ed8;
  --nexus-accent-text: #1e40af;
  --nexus-text: #172c4b;
  --nexus-muted: #526681;
  --nexus-surface: #fff;
  --nexus-soft: #edf4ff;
  --nexus-border: #cbdcf2;
  --nexus-success: #166534;
  --nexus-danger: #b91c1c;
  max-width: 1180px;
  color: var(--nexus-text);
  color-scheme: light;
}

[data-bs-theme="dark"] .nexus-app {
  --nexus-accent: #8bb9ff;
  --nexus-accent-text: #a5ccff;
  --nexus-text: #e6efff;
  --nexus-muted: #b2c3de;
  --nexus-surface: #101f36;
  --nexus-soft: #162b48;
  --nexus-border: #314d70;
  --nexus-success: #86efac;
  --nexus-danger: #fca5a5;
  color-scheme: dark;
}

.nexus-app .nexus-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
  padding: 2.5rem;
  border: 1px solid #315eab;
  border-radius: 1.5rem;
  background: radial-gradient(ellipse at 95% 5%, #1556a0 0%, transparent 55%),
    linear-gradient(120deg, #091a35, #102e62);
  color: #fff;
  box-shadow: 0 16px 40px rgb(15 46 98 / 14%);
}

.nexus-app .nexus-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(#adcfff0a 1px, transparent 1px),
    linear-gradient(90deg, #adcfff0a 1px, transparent 1px);
  background-size: 28px 28px;
}

.nexus-app .nexus-hero > * { position: relative; z-index: 1; }
.nexus-app .nexus-hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.055em;
  margin: .5rem 0;
  color: #fff;
}
.nexus-app .nexus-hero h1 span { color: #8ddaff; }
.nexus-app .nexus-hero-description { color: #d2e4ff; margin: 0; max-width: 36rem; }
.nexus-app .nexus-hero .nexus-eyebrow { color: #b8dcff; }
.nexus-app .nexus-hero-badge {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-shrink: 0;
  padding: 1rem 1.2rem;
  border: 1px solid #729cce;
  border-radius: 1rem;
  background: #112f57;
  color: #d2e4ff;
  font-size: .85rem;
}
.nexus-app .nexus-hero-badge i { font-size: 1.6rem; color: #8ddaff; }
.nexus-app .nexus-hero-badge strong { color: #fff; }

.nexus-app h2, .nexus-app h3 { color: var(--nexus-text); font-weight: 750; }
.nexus-app h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.035em; margin: .35rem 0 1rem; }
.nexus-app h3 { font-size: 1.1rem; line-height: 1.5; }
.nexus-app p { line-height: 1.7; }
.nexus-app a { color: var(--nexus-accent-text); text-underline-offset: .2em; }
.nexus-app .nexus-eyebrow {
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--nexus-accent-text);
  margin: 0 0 .4rem;
}

.nexus-app .nexus-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem 0;
  margin-bottom: .75rem;
}
.nexus-app .nexus-nav a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .75rem;
  color: var(--nexus-muted);
}
.nexus-app .nexus-nav a:hover,
.nexus-app .nexus-nav a[aria-current="page"] {
  background: var(--nexus-soft);
  border-color: var(--nexus-border);
  color: var(--nexus-accent-text);
}
.nexus-app .nexus-nav .nexus-nav-legacy { margin-left: auto; font-size: .8rem; }
.nexus-app .nexus-notice {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--nexus-border);
  border-radius: .85rem;
  background: var(--nexus-soft);
  color: var(--nexus-muted);
  font-size: .85rem;
  margin: 0 0 2rem;
}
.nexus-app .nexus-notice i { color: var(--nexus-accent); flex-shrink: 0; margin-top: .15rem; }
.nexus-app .nexus-content { min-width: 0; }
.nexus-app .nexus-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}
.nexus-app .nexus-section-heading h2,
.nexus-app .nexus-section-heading h3 { margin-bottom: 0; }
.nexus-app .nexus-tag {
  display: inline-flex;
  width: fit-content;
  padding: .3rem .75rem;
  border: 1px solid var(--nexus-border);
  border-radius: 2rem;
  background: var(--nexus-soft);
  color: var(--nexus-accent-text);
  font-size: .75rem;
  font-weight: 700;
}
.nexus-app .nexus-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}
.nexus-app .nexus-chip-list li {
  padding: .7rem 1rem;
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border);
  border-radius: .8rem;
  font-size: .9rem;
}
.nexus-app .nexus-chip-list small { display: block; max-width: 20rem; color: var(--nexus-muted); }
.nexus-app .nexus-details {
  border: 1px solid var(--nexus-border);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  background: var(--nexus-surface);
  overflow-wrap: anywhere;
}
.nexus-app .nexus-details summary { color: var(--nexus-accent-text); font-weight: 650; cursor: pointer; }
.nexus-app .nexus-details[open] summary { margin-bottom: 1rem; }
.nexus-app .nexus-details p { font-size: .9rem; color: var(--nexus-muted); }

.nexus-app .card,
.nexus-app .nexus-question,
.nexus-app .nexus-progress-panel,
.nexus-app .nexus-empty {
  background: var(--nexus-surface);
  color: var(--nexus-text);
  border: 1px solid var(--nexus-border);
  border-radius: 1.1rem;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 6px 24px rgb(15 46 98 / 5%);
  min-width: 0;
  overflow-wrap: anywhere;
}
.nexus-app .nexus-catalog-grid,
.nexus-app .nexus-dimensions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.nexus-app .nexus-catalog-grid .card,
.nexus-app .nexus-dimensions-grid .card { margin: 0; }
.nexus-app .nexus-evaluation { display: flex; align-items: flex-start; border-top: 3px solid #397aea; }
.nexus-app .nexus-card-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; width: 100%; color: var(--nexus-muted); font-size: .8rem; }
.nexus-app .nexus-evaluation-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: .85rem;
  background: var(--nexus-soft);
  color: var(--nexus-accent);
  font-size: 1.4rem;
  margin: 1.25rem 0 1rem;
}
.nexus-app .nexus-evaluation h3 { font-size: 1.2rem; }
.nexus-app .nexus-evaluation h3 a { text-decoration: none; }
.nexus-app .nexus-evaluation h3 a:hover { text-decoration: underline; }
.nexus-app .nexus-evaluation > p:not(.nexus-eyebrow) { font-size: .9rem; color: var(--nexus-muted); }
.nexus-app .nexus-evaluation .nexus-access { margin-top: auto; padding-top: .5rem; }
.nexus-app .nexus-evaluation .nexus-access-available { color: var(--nexus-success) !important; }
.nexus-app .nexus-evaluation > .btn { width: 100%; display: flex; justify-content: space-between; gap: .5rem; }
.nexus-app .nexus-mode-options { width: 100%; list-style: none; padding: 0; margin: .25rem 0 0; display: grid; gap: .65rem; }
.nexus-app .nexus-mode-option { display: block; text-decoration: none; border: 1px solid var(--nexus-border); border-radius: .8rem; padding: .85rem 1rem; background: var(--nexus-surface); }
.nexus-app .nexus-mode-option:hover { background: var(--nexus-soft); border-color: var(--nexus-accent); }
.nexus-app .nexus-mode-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.nexus-app .nexus-mode-heading > span { font-size: .75rem; color: var(--nexus-muted); }
.nexus-app .nexus-mode-option .nexus-access { display: block; font-size: .75rem; color: var(--nexus-muted); padding-top: .4rem; }
.nexus-app .nexus-empty { grid-column: 1 / -1; }
.nexus-app .nexus-back { display: inline-block; margin-bottom: 1.25rem; font-size: .9rem; }
.nexus-app .nexus-page-heading { margin-bottom: 1.5rem; }
.nexus-app .nexus-page-heading h2 { margin-top: .75rem; }
.nexus-app .nexus-page-heading > p:last-child { color: var(--nexus-muted); max-width: 52rem; }
.nexus-app .nexus-info-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.nexus-app .nexus-start-panel { border-top: 3px solid #397aea; }
.nexus-app .nexus-start-panel .btn { width: 100%; }
.nexus-app .nexus-start-panel p { font-size: .9rem; }

.nexus-app .btn { border-radius: .7rem; padding: .7rem 1rem; font-weight: 650; white-space: normal; }
.nexus-app .btn-primary { color: #fff; border-color: #1d4ed8; background: linear-gradient(120deg, #1d4ed8, #1e40af); }
.nexus-app .btn-primary:hover { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.nexus-app .btn-outline-primary,
.nexus-app .btn-outline-secondary { color: var(--nexus-accent-text); border-color: var(--nexus-border); background: var(--nexus-surface); }
.nexus-app .btn-outline-primary:hover,
.nexus-app .btn-outline-secondary:hover { background: var(--nexus-soft); border-color: var(--nexus-accent); }
.nexus-app .btn:disabled { opacity: .65; }
.nexus-app .nexus-delete-link { color: var(--nexus-danger); font-size: .9rem; }
.nexus-app .btn-outline-danger { color: var(--nexus-danger); border-color: var(--nexus-danger); background: var(--nexus-surface); }
.nexus-app .btn-outline-danger:hover { color: #fff; background: #b91c1c; border-color: #b91c1c; }
.nexus-app :focus-visible { outline: 3px solid var(--nexus-accent); outline-offset: 3px; }
.nexus-app input[type="date"], .nexus-app select {
  color: var(--nexus-text);
  background: var(--nexus-surface);
  border: 1px solid var(--nexus-border);
  padding: .6rem .8rem;
  border-radius: .6rem;
  max-width: 100%;
}
.nexus-app .nexus-progress-panel { background: var(--nexus-soft); }
.nexus-app .nexus-progress-panel .nexus-section-heading { margin-top: 0; }
.nexus-app #progress-text { color: var(--nexus-muted); font-size: .9rem; }
.nexus-app #save-state { color: var(--nexus-text); font-size: .85rem; margin: .7rem 0 0; }
.nexus-app progress {
  display: block;
  width: 100%;
  height: .65rem;
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  accent-color: var(--nexus-accent);
  background: var(--nexus-border);
}
.nexus-app progress::-webkit-progress-bar { background: var(--nexus-border); border-radius: 1rem; }
.nexus-app progress::-webkit-progress-value { background: linear-gradient(90deg, #2563eb, #0891b2); border-radius: 1rem; }
.nexus-app progress::-moz-progress-bar { background: #2563eb; border-radius: 1rem; }
.nexus-app .nexus-question { border-top: 3px solid #397aea; padding: 2rem; }
.nexus-app .nexus-question legend { float: none; width: auto; font-size: 1.2rem; font-weight: 650; line-height: 1.65; padding: 0 .25rem; }
.nexus-app .nexus-question-context { padding: 1rem; border-left: 3px solid var(--nexus-accent); border-radius: 0 .75rem .75rem 0; background: var(--nexus-soft); color: var(--nexus-muted); }
.nexus-app .nexus-question label { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.1rem; margin: .65rem 0; border: 1px solid var(--nexus-border); border-radius: .8rem; cursor: pointer; }
.nexus-app .nexus-question label:hover { background: var(--nexus-soft); border-color: var(--nexus-accent); }
.nexus-app .nexus-question label:has(input:checked) { border-color: var(--nexus-accent); background: var(--nexus-soft); box-shadow: inset 3px 0 0 var(--nexus-accent); }
.nexus-app .nexus-question input[type="radio"] { flex-shrink: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--nexus-accent); }
.nexus-app .errorlist { color: var(--nexus-danger); padding: 1rem 1rem 1rem 2rem; border-left: 3px solid currentColor; }
.nexus-app [hidden] { display: none !important; }
.nexus-app .nexus-question-navigation,
.nexus-app .nexus-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.25rem 0; }
.nexus-app #question-position { color: var(--nexus-muted); font-size: .9rem; }
.nexus-app .nexus-submit-note { font-size: .85rem; color: var(--nexus-muted); padding-top: 1rem; border-top: 1px solid var(--nexus-border); }
.nexus-app .nexus-report-intro { color: var(--nexus-muted); font-size: .9rem; overflow-wrap: anywhere; }
.nexus-app .nexus-summary { background: var(--nexus-soft); border-left: 4px solid var(--nexus-accent); padding: 2rem; }
.nexus-app .nexus-summary strong { color: var(--nexus-accent-text); }
.nexus-app .nexus-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.nexus-app .nexus-metrics > div { min-width: 0; padding: 1.2rem; border: 1px solid var(--nexus-border); border-radius: .9rem; background: var(--nexus-surface); }
.nexus-app .nexus-metrics dt { color: var(--nexus-muted); font-size: .8rem; overflow-wrap: anywhere; }
.nexus-app .nexus-metrics dd { color: var(--nexus-accent-text); font-size: 1.5rem; font-weight: 750; margin: .4rem 0 0; }
.nexus-app .nexus-dimensions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nexus-app .nexus-dimension { border-top: 3px solid #397aea; }
.nexus-app .nexus-dimension p { font-size: .9rem; }
.nexus-app .nexus-dimension form { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--nexus-border); }
.nexus-app .nexus-dimension form label { width: 100%; font-size: .85rem; color: var(--nexus-muted); }
.nexus-app .nexus-dimension form .btn { font-size: .85rem; }
.nexus-app .nexus-report-footer p { color: var(--nexus-muted); font-size: .9rem; }
.nexus-app .list-group-item { background: var(--nexus-surface); border-color: var(--nexus-border); color: var(--nexus-text); padding: 1.25rem; }
.nexus-app .table-responsive { overflow-x: auto; }
.nexus-app .table { --bs-table-color: var(--nexus-text); --bs-table-bg: var(--nexus-surface); --bs-table-border-color: var(--nexus-border); }

@media (max-width: 991px) {
  .nexus-app .nexus-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nexus-app .nexus-hero-badge { display: none; }
  .nexus-app .nexus-nav .nexus-nav-legacy { margin-left: 0; }
}
@media (max-width: 767px) {
  .nexus-app .nexus-info-layout, .nexus-app .nexus-dimensions-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575px) {
  .nexus-app .nexus-hero { padding: 1.5rem; border-radius: 1rem; }
  .nexus-app .nexus-hero .nexus-eyebrow { font-size: .65rem; }
  .nexus-app .nexus-catalog-grid { grid-template-columns: minmax(0, 1fr); }
  .nexus-app .nexus-nav { gap: .25rem; }
  .nexus-app .nexus-nav a { padding: .55rem .65rem; font-size: .8rem; }
  .nexus-app .card, .nexus-app .nexus-question, .nexus-app .nexus-progress-panel { padding: 1.1rem; }
  .nexus-app .nexus-actions .btn { width: 100%; }
  .nexus-app .nexus-question legend { font-size: 1.05rem; }
  .nexus-app .nexus-question label { padding: .85rem; }
}
@media print {
  .nexus-app .nexus-hero, .nexus-app .nexus-nav, .nexus-app .btn, .nexus-app .nexus-dimension form { display: none; }
  .nexus-app .nexus-dimensions-grid { display: block; }
  .nexus-app .card { break-inside: avoid; box-shadow: none; }
}
