body {
  font-family: "Inter", sans-serif;
}

.glass-card {
  position: relative;
  isolation: isolate;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0.52) 45%,
    rgba(239, 244, 255, 0.62) 100%
  );
  backdrop-filter: blur(40px) saturate(1.65);
  -webkit-backdrop-filter: blur(40px) saturate(1.65);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 16px 48px rgba(19, 27, 46, 0.1),
    0 4px 16px rgba(0, 102, 134, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 42%);
}

.glass-card > * {
  position: relative;
  z-index: 1;
}

.glass-card-mobile {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.58) 100%);
  backdrop-filter: blur(36px) saturate(1.5);
  -webkit-backdrop-filter: blur(36px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 -12px 40px rgba(19, 27, 46, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.option-tile {
  transition: all 0.2s ease-in-out;
}

.option-tile:hover:not(.tile-selected):not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Shared clinical card rhythm (welcome + questions) */
.clinical-card {
  padding: 20px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .clinical-card {
    padding: 32px;
  }
}

.clinical-card-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.clinical-card-stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clinical-question-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.clinical-question-header .clinical-card-stack-sm {
  gap: 8px;
}

.clinical-question-header h1 {
  margin: 0;
}

.clinical-card-prose {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clinical-card-cta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clinical-card-actions {
  display: flex;
  flex-direction: column;
}

.clinical-card-divider {
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  border: none;
  background: rgba(198, 198, 205, 0.35);
}

.clinical-card-nav {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-top: 24px;
}

.clinical-card-mobile-inner {
  padding: 20px 20px 24px;
  box-sizing: border-box;
}

.clinical-main-col {
  padding: 20px;
  padding-top: 0;
  padding-bottom: 80px;
}

.options-grid {
  padding: 4px;
  box-sizing: border-box;
}

.option-tile.tile-selected {
  background: rgba(126, 212, 253, 0.42) !important;
  border: 2px solid #7ed4fd !important;
  color: #005b78 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 4px 14px rgba(126, 212, 253, 0.35);
  transform: none;
}

/* Desktop option tile: has key column — size + radius via CSS (not Tailwind) */
.option-tile:has(.tile-key) {
  min-height: 52px;
  border-radius: 10px;
}

/* Mobile option tile: no key column */
.option-tile:not(:has(.tile-key)) {
  min-height: 56px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.35;
}

/* Keyboard shortcut hint column inside option tiles */
.tile-key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  align-self: stretch;
  font-size: 12px;
  font-weight: 400;
  color: rgba(69, 70, 77, 0.4);
  border-right: 0.5px solid rgba(198, 198, 205, 0.4);
  flex-shrink: 0;
}

.tile-lbl {
  padding: 0 10px 0 8px;
  font-size: 16px;
  line-height: 1.3;
  text-align: left;
}

.option-tile.tile-selected .tile-key {
  color: rgba(0, 91, 120, 0.5);
  border-right-color: rgba(0, 91, 120, 0.18);
}

/* On touch devices: hide key hint (safety net for touch-on-desktop-template) */
@media (pointer: coarse) {
  .tile-key {
    display: none;
  }
  .tile-lbl {
    padding: 0;
    font-size: inherit;
    text-align: center;
  }
}

.clinical-mobile-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

.clinical-question-header > .clinical-mobile-step {
  margin-bottom: 0;
}

.progress-bar-fill {
  transition: width 0.35s ease;
}

.progress-segment-track {
  background: #d3e4fe;
}

.progress-segment-fill {
  min-width: 0;
  transition:
    width 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.35s ease;
}

.progress-segment-fill--complete {
  background: #006686;
}

.progress-segment-fill--partial {
  background: linear-gradient(
    90deg,
    #006686 0%,
    #006686 55%,
    #7ed4fd 88%,
    rgba(126, 212, 253, 0.35) 100%
  );
}

.question-card-shell {
  transition: min-height 0.36s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-slide-viewport {
  overflow: hidden;
  box-sizing: border-box;
  transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-anim-item {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: var(--stagger-delay, 0ms);
}

/* Shared slide stagger enter/exit (PASI + NAPSI + EASI) */
.pasi-question-slide.is-exiting .slide-anim-item,
.pasi-welcome-slide.is-exiting .slide-anim-item,
.easi-question-slide.is-exiting .slide-anim-item,
.easi-welcome-slide.is-exiting .slide-anim-item,
.question-slide.is-exiting .slide-anim-item,
.napsi-digit-slide.is-exiting .slide-anim-item,
.napsi-welcome-slide.is-exiting .slide-anim-item {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

.pasi-question-slide.is-entering .slide-anim-item,
.pasi-welcome-slide.is-entering .slide-anim-item,
.easi-question-slide.is-entering .slide-anim-item,
.easi-welcome-slide.is-entering .slide-anim-item,
.question-slide.is-entering .slide-anim-item,
.napsi-digit-slide.is-entering .slide-anim-item,
.napsi-welcome-slide.is-entering .slide-anim-item {
  opacity: 0;
  transform: translateY(18px);
}

.anatomy-stage {
  box-sizing: border-box;
  min-height: min(72vh, calc(100vh - 7rem));
  margin-right: auto;
}

.anatomy-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding-right: 9.5rem;
  box-sizing: border-box;
}

.anatomy-img-wrap .anatomy-img {
  height: min(72vh, calc(100vh - 7rem));
  width: auto;
  max-width: none;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

.anatomy-chips-rail {
  position: absolute;
  right: 0;
  top: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 11rem;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.anatomy-chips-rail > * {
  pointer-events: auto;
  width: 100%;
  justify-content: flex-start;
}

.anatomy-region-chip {
  position: relative;
  isolation: isolate;
  border-radius: 9999px;
  color: #0b1c30;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(239, 244, 255, 0.55) 100%
  );
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 4px 16px rgba(19, 27, 46, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.anatomy-region-chip--complete {
  color: #005b78;
  background: linear-gradient(
    145deg,
    rgba(126, 212, 253, 0.55) 0%,
    rgba(126, 212, 253, 0.28) 55%,
    rgba(255, 255, 255, 0.5) 100%
  );
  border-color: rgba(126, 212, 253, 0.75);
}

.anatomy-region-chip--current:not(.anatomy-region-chip--complete) {
  border-color: rgba(0, 102, 134, 0.35);
  box-shadow:
    0 4px 18px rgba(0, 102, 134, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.anatomy-img {
  transition:
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.anatomy-img.is-exiting {
  opacity: 0;
  transform: translateY(10px) scale(0.99);
}

.anatomy-img.is-entering {
  opacity: 0;
  transform: translateY(-10px) scale(0.99);
}

.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* Floating glass top chrome (PASI + NAPSI) */
.top-chrome-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  pointer-events: none;
  padding: 10px 14px 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

#napsi-top-chrome {
  /* inherit .top-chrome-shell when class is present */
}

#easi-top-chrome {
  /* inherit .top-chrome-shell when class is present */
}

.top-chrome-float {
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  border-radius: 1.125rem;
  overflow: hidden;
}

.top-chrome-float.glass-card {
  border-radius: 1.125rem;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.52) 0%,
    rgba(255, 255, 255, 0.34) 48%,
    rgba(239, 248, 255, 0.42) 100%
  );
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 2px rgba(19, 27, 46, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.top-chrome-float.glass-card::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22) 0%,
    transparent 55%
  );
}

.top-chrome-progress {
  padding: 10px 14px 6px;
  background: linear-gradient(
    180deg,
    rgba(126, 212, 253, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.top-chrome-body {
  padding: 8px 14px 10px;
}

.clinical-top-header {
  margin: 0;
  min-height: 0;
  border: none;
}

.app-version-footer {
  display: flex;
  justify-content: center;
  padding: 12px 0 16px;
  pointer-events: none;
}

.app-version-slot {
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.app-version-badge {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(69, 70, 77, 0.5);
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: none;
}

#napsi-top-spacer {
  flex-shrink: 0;
  height: 6.5rem;
}

#easi-top-spacer {
  flex-shrink: 0;
  height: 6.5rem;
}

@media (min-width: 768px) {
  .top-chrome-shell {
    padding: 14px 24px 0;
  }

  .top-chrome-progress {
    padding: 8px 16px 5px;
  }

  .top-chrome-body {
    padding: 6px 16px 8px;
  }

  .top-chrome-float {
    border-radius: 1.25rem;
  }

  .clinical-top-header .napsi-wizard-header-desktop-meta {
    padding-right: 3.25rem;
  }

  .clinical-top-header .easi-wizard-header-desktop-meta {
    padding-right: 3.25rem;
  }

  #napsi-top-spacer {
    height: 5.25rem;
  }

  #easi-top-spacer {
    height: 5.25rem;
  }
}

/* ------------------------------------------------------------------ */
/* Hub page (index.html) — stable layout; add modules as grid cards   */
/* ------------------------------------------------------------------ */

.hub-root {
  position: relative;
  overflow-x: hidden;
}

.hub-backdrop {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hub-backdrop__orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.45;
}

.hub-backdrop__orb--a {
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  top: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(126, 212, 253, 0.55) 0%, transparent 70%);
}

.hub-backdrop__orb--b {
  width: min(420px, 60vw);
  height: min(420px, 60vw);
  bottom: -10%;
  left: -6%;
  background: radial-gradient(circle, rgba(19, 27, 46, 0.12) 0%, transparent 70%);
}

.hub-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 100vh;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .hub-shell {
    padding: 48px 48px 56px;
    gap: 40px;
    justify-content: center;
  }
}

.hub-header {
  border-radius: 1.5rem;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

@media (min-width: 768px) {
  .hub-header {
    padding: 32px 36px;
    gap: 18px;
  }
}

.hub-header__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hub-header__icon {
  font-size: 40px;
  color: #006686;
  background: linear-gradient(135deg, rgba(126, 212, 253, 0.35), rgba(255, 255, 255, 0.5));
  border: 1px solid rgba(126, 212, 253, 0.45);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 102, 134, 0.1);
}

.hub-header__eyebrow {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #45464d;
}

.hub-header__title {
  margin: 4px 0 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #131b2e;
}

.hub-header__lead {
  margin: 0;
  max-width: 52ch;
  font-size: 16px;
  line-height: 26px;
  color: #45464d;
}

.hub-header__version {
  position: absolute;
  top: 16px;
  right: 16px;
}

@media (min-width: 768px) {
  .hub-header__version {
    top: 20px;
    right: 24px;
  }
}

.hub-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hub-section__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub-section__title {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #131b2e;
}

.hub-section__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: #45464d;
}

.hub-module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .hub-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .hub-module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hub-module-card {
  border-radius: 1.25rem;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.hub-module-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 56px rgba(19, 27, 46, 0.14),
    0 6px 20px rgba(0, 102, 134, 0.08);
}

.hub-module-card:focus-visible {
  outline: 2px solid #006686;
  outline-offset: 3px;
}

.hub-module-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hub-module-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 26px;
}

.hub-module-card--pasi .hub-module-card__icon {
  color: #131b2e;
  background: rgba(19, 27, 46, 0.08);
  border: 1px solid rgba(19, 27, 46, 0.12);
}

.hub-module-card--napsi .hub-module-card__icon {
  color: #006686;
  background: rgba(0, 102, 134, 0.1);
  border: 1px solid rgba(0, 102, 134, 0.18);
}

.hub-module-card--easi .hub-module-card__icon {
  color: #0d5c52;
  background: rgba(13, 92, 82, 0.1);
  border: 1px solid rgba(13, 92, 82, 0.16);
}

.hub-module-card__tag {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(198, 198, 205, 0.45);
  color: #45464d;
  white-space: nowrap;
}

.hub-module-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.hub-module-card__name {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  color: #0b1c30;
}

.hub-module-card__desc {
  margin: 0;
  font-size: 15px;
  line-height: 24px;
  color: #45464d;
}

.hub-module-card__meta {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.hub-module-card__meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: #45464d;
}

.hub-module-card__meta .material-symbols-outlined {
  font-size: 16px;
  color: #76777d;
}

.hub-module-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.hub-module-card--pasi .hub-module-card__cta {
  background: #131b2e;
  color: #ffffff;
}

.hub-module-card--pasi:hover .hub-module-card__cta {
  background: rgba(19, 27, 46, 0.9);
}

.hub-module-card--napsi .hub-module-card__cta {
  background: #006686;
  color: #ffffff;
}

.hub-module-card--napsi:hover .hub-module-card__cta {
  background: rgba(0, 102, 134, 0.9);
}

.hub-module-card--easi .hub-module-card__cta {
  background: #0d5c52;
  color: #ffffff;
}

.hub-module-card--easi:hover .hub-module-card__cta {
  background: rgba(13, 92, 82, 0.9);
}

.hub-module-card__cta .material-symbols-outlined {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.hub-module-card:hover .hub-module-card__cta .material-symbols-outlined {
  transform: translateX(3px);
}

.hub-footer {
  text-align: center;
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hub-footer p {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: #76777d;
}

/* ── Nav Overlay ─────────────────────────────────── */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  justify-content: flex-end;
}
.nav-overlay[hidden] { display: none; }

.nav-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nav-overlay__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  height: 100%;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 0 !important;
}

@media (max-width: 767px) {
  .nav-overlay__panel { max-width: 100%; }
}

.nav-overlay__index-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-overlay__index-item:hover { background: rgba(0, 102, 134, 0.06); }
.nav-overlay__index-item--active {
  background: rgba(0, 102, 134, 0.08);
  pointer-events: none;
  opacity: 0.7;
}

/* ── Confirm Dialog ──────────────────────────────── */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.confirm-dialog[hidden] { display: none; }
.confirm-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}
.confirm-dialog__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
  border-radius: 1.25rem;
}
