:root {
  --bg: #eef5fb;
  --ink: #0e2545;
  --muted: #4d6483;
  --primary: #1c4c9d;
  --accent: #f58a2c;
  --good: #1e8b49;
  --chip: #ffffff;
  --sheet: #ffffff;
  --line: #d0def0;
  --app-mode-bg: transparent;
  --map-stage-bg: transparent;
  --ui-surface-strong: rgba(255, 255, 255, 0.94);
  --ui-surface: rgba(255, 255, 255, 0.92);
  --ui-surface-soft: rgba(255, 255, 255, 0.86);
  --ui-surface-solid: #f7fbff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #d9ecff 0%, transparent 35%),
    radial-gradient(circle at 90% 10%, #ffe2c7 0%, transparent 30%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--app-mode-bg);
  transition: background 220ms ease;
}

.app.is-mode-learn {
  --app-mode-bg:
    radial-gradient(circle at 12% -5%, rgba(122, 185, 255, 0.24) 0%, transparent 46%),
    radial-gradient(circle at 88% 8%, rgba(94, 165, 243, 0.18) 0%, transparent 40%);
  --ui-surface-strong: rgba(239, 247, 255, 0.95);
  --ui-surface: rgba(248, 252, 255, 0.93);
  --ui-surface-soft: rgba(229, 241, 255, 0.9);
  --ui-surface-solid: #ecf5ff;
  --sheet: #f4f9ff;
  --map-stage-bg: rgba(255, 255, 255, 0.84);
}

.app.is-mode-exam {
  --app-mode-bg:
    radial-gradient(circle at 14% 0%, rgba(255, 214, 123, 0.28) 0%, transparent 46%),
    radial-gradient(circle at 88% 8%, rgba(255, 195, 76, 0.2) 0%, transparent 38%);
  --ui-surface-strong: rgba(255, 248, 223, 0.95);
  --ui-surface: rgba(255, 252, 238, 0.93);
  --ui-surface-soft: rgba(255, 245, 208, 0.9);
  --ui-surface-solid: #fff7de;
  --sheet: #fffaf0;
  --map-stage-bg: rgba(255, 255, 255, 0.84);
}

.map-stage {
  position: relative;
  overflow: hidden;
  line-height: 0;
  z-index: 1;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  background: var(--map-stage-bg);
  transition: background 220ms ease;
}

#indiaMap {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  user-select: none;
  object-fit: contain;
}

.marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.region-overlay-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.marker-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #f58a2c;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
  opacity: 0.9;
  display: grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
  color: #0e2f5f;
  font-weight: 700;
  transition: transform 140ms ease, font-size 140ms ease, color 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.marker-dot.is-icon {
  width: 16px;
  height: 16px;
  font-size: 11px;
  border: 1px solid var(--icon-border, #c9daf0);
  background: var(--icon-bg, rgba(255, 255, 255, 0.96));
  box-shadow: 0 3px 9px rgba(13, 33, 60, 0.2);
  color: var(--icon-fg, #16407c);
  opacity: 1;
  text-shadow:
    0 0 1.2px rgba(255, 255, 255, 0.92),
    0 1px 1.2px rgba(0, 0, 0, 0.35);
}

.marker-dot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 999px;
  border: 2px solid rgba(245, 138, 44, 0.45);
}

.marker-dot.is-active {
  background: #1c4c9d;
  transform: translate(-50%, -50%) scale(1.08);
}

.marker-dot.is-icon::after {
  display: none;
}

.marker-dot.is-icon.is-active {
  background: var(--icon-bg, rgba(255, 255, 255, 1));
  border-color: var(--icon-border, #88aee4);
  box-shadow: 0 6px 14px rgba(10, 27, 53, 0.25);
  color: var(--icon-fg, #0f3d84);
  transform: translate(-50%, -50%) scale(1.55);
  font-size: 17px;
}

.marker-dot.is-icon.is-hovered:not(.is-active),
.marker-dot.is-icon:hover:not(.is-active) {
  transform: translate(-50%, -50%) scale(1.3);
  font-size: 14px;
}

.marker-dot.is-unvisited {
  opacity: 0.52;
  filter: saturate(0.75);
}

.marker-dot.is-icon.is-unvisited {
  opacity: 0.74;
  filter: saturate(0.72) brightness(1.03);
}

.marker-dot.is-visited {
  opacity: 1;
  filter: saturate(1);
}

.marker-dot.is-visited::before {
  content: "✓";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 8px;
  height: 8px;
  background-color: var(--good, #1e8b49);
  color: #fff;
  border-radius: 50%;
  border: 1.5px solid #fff;
  z-index: 10;
  display: grid;
  place-items: center;
  font-size: 8.5px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.marker-dot.is-icon.is-visited {
  border-color: var(--icon-border, #86a9df);
  box-shadow: 0 5px 12px rgba(10, 27, 53, 0.22);
}

.marker-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 10px));
  max-width: min(44vw, 210px);
  padding: 5px 9px;
  border-radius: 10px;
  border: 1px solid rgba(227, 140, 43, 0.45);
  background: rgba(255, 250, 236, 0.96);
  color: #6a3f00;
  font-size: 0.74rem;
  line-height: 1.25;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(69, 42, 4, 0.2);
  pointer-events: none;
  z-index: 5;
  animation: markerLabelPop 220ms ease-out;
}

@keyframes markerLabelPop {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 4px)) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 10px)) scale(1);
  }
}

.map-share-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #c7d9f2;
  background: rgba(255, 255, 255, 0.94);
  color: #1a446f;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(12, 33, 61, 0.15);
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.map-share-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(12, 33, 61, 0.2);
}

.map-share-btn:active {
  transform: translateY(0);
}

.marker-dot.is-suggested {
  opacity: 1;
}

.marker-dot.is-suggested::after {
  inset: -9px;
  border-color: rgba(27, 109, 227, 0.9);
  animation: markerSuggestPulse 1.05s ease-in-out infinite;
}

.marker-dot.is-icon.is-suggested::after {
  display: block;
  border-width: 2px;
}

@keyframes markerSuggestPulse {

  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

#tapLayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  z-index: 3;
  pointer-events: auto;
}

.top-strip {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  z-index: 22;
  background: var(--ui-surface-strong);
  border-bottom: 1px solid #d6e4f4;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.top-strip>* {
  flex: 0 0 auto;
}

.brand-mark {
  border: 1px solid var(--line);
  background: var(--ui-surface);
  border-radius: 999px;
  padding: 4px 8px 4px 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 158px;
  text-decoration: none;
  color: #134072;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.brand-mark__logo {
  width: 23px;
  height: 23px;
  border-radius: 999px;
  border: 1px solid #b6cae8;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand-mark__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pill {
  background: var(--ui-surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #20436f;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-btn {
  border: 1px solid var(--line);
  background: var(--ui-surface-solid);
  color: #244673;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.73rem;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.profile-btn.is-chapter-cta {
  border-color: #f5b64f;
  color: #7a4d00;
  background: linear-gradient(135deg, #fff8e2, #fff0c8);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 0 0 rgba(245, 182, 79, 0.34), 0 6px 14px rgba(130, 82, 11, 0.16);
  animation: chapterCtaPulse 1.12s ease-in-out infinite;
}

@keyframes chapterCtaPulse {
  0%,
  100% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 0 0 rgba(245, 182, 79, 0.3), 0 6px 14px rgba(130, 82, 11, 0.15);
  }

  50% {
    transform: translateY(-1px) scale(1.09);
    box-shadow: 0 0 0 9px rgba(245, 182, 79, 0), 0 9px 20px rgba(130, 82, 11, 0.2);
  }
}

.mode-switch {
  display: flex;
  gap: 6px;
  background: var(--ui-surface-soft);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 999px;
}

.mode {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  touch-action: manipulation;
}

.mode.active {
  background: var(--primary);
  color: #fff;
}

.auth-menu {
  margin-left: auto;
  position: relative;
  z-index: 30;
}

.auth-menu-btn {
  border: 1px solid #bfd3ee;
  background: var(--ui-surface-solid);
  color: #194271;
  border-radius: 999px;
  padding: 4px 8px 4px 5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 800;
  min-height: 34px;
}

.auth-avatar,
.auth-avatar-fallback {
  width: 23px;
  height: 23px;
  border-radius: 999px;
  border: 1px solid #b6cae8;
}

.auth-avatar {
  object-fit: cover;
}

.auth-avatar-fallback {
  display: grid;
  place-items: center;
  background: #e9f1ff;
  color: #123c76;
  font-size: 0.72rem;
  font-weight: 800;
}

.auth-label {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu-panel {
  position: fixed;
  left: 0;
  top: 0;
  min-width: 188px;
  max-width: min(86vw, 260px);
  border: 1px solid #c7d9f2;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(9, 28, 57, 0.2);
  padding: 6px;
  display: grid;
  gap: 5px;
  overflow: auto;
  z-index: 160;
}

.auth-menu-panel[hidden] {
  display: none !important;
}

.auth-menu-item {
  border: 1px solid #d7e4f6;
  border-radius: 9px;
  background: #f7fbff;
  color: #1a446f;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
}

.auth-menu-item--danger {
  border-color: #f0d2d2;
  background: #fff4f4;
  color: #9e2525;
}

.toast {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(14, 37, 69, 0.93);
  color: #fff;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.35;
  max-width: min(84vw, 360px);
  width: max-content;
  text-align: center;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(8, 24, 47, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 9;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.map-chapter-panel {
  position: absolute;
  right: 16%;
  top: 74%;
  width: min(46vw, 235px);
  z-index: 8;
  border: 1px solid #d5e3f5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(9, 28, 57, 0.16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 8px 9px;
  pointer-events: none;
}

.map-topic-heading {
  position: absolute;
  right: 8px;
  top: 10px;
  z-index: 8;
  margin: 0;
  max-width: min(48vw, 230px);
  border: 1px solid #d5e3f5;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 10px;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #0b5d32;
  font-weight: 800;
  text-align: right;
  box-shadow: 0 6px 14px rgba(9, 28, 57, 0.13);
  pointer-events: none;
}

.map-hint {
  margin: 0;
  max-width: min(40vw, 220px);
  border: 1px solid #d8d6c1;
  border-radius: 10px;
  background: rgba(255, 249, 232, 0.96);
  padding: 6px 9px;
  font-size: 0.72rem;
  line-height: 1.34;
  color: #5f430e;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(78, 58, 15, 0.12);
}

.map-hint .hint-direction-copy {
  font-weight: 700;
}

.map-hint .hint-arrow {
  display: inline-block;
  margin-left: 2px;
  font-size: 1.22em;
  line-height: 1;
  transform-origin: left center;
  color: #b6610f;
  filter: drop-shadow(0 1px 1px rgba(113, 69, 10, 0.24));
  animation:
    hintArrowZoom 560ms cubic-bezier(0.18, 0.7, 0.2, 1) both,
    hintArrowColorFlow 1.2s ease-in-out infinite;
}

@keyframes hintArrowZoom {
  0% {
    opacity: 0.2;
    transform: translateX(-2px) scale(0.55);
  }

  45% {
    opacity: 1;
    transform: translateX(1px) scale(1.46);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1.06);
  }
}

@keyframes hintArrowColorFlow {
  0% {
    color: #b6610f;
    filter: drop-shadow(0 1px 1px rgba(113, 69, 10, 0.24));
  }

  40% {
    color: #f58a2c;
    filter: drop-shadow(0 1px 2px rgba(162, 88, 10, 0.32));
  }

  75% {
    color: #f2b13f;
    filter: drop-shadow(0 1px 3px rgba(145, 90, 9, 0.3));
  }

  100% {
    color: #b6610f;
    filter: drop-shadow(0 1px 1px rgba(113, 69, 10, 0.24));
  }
}

.map-hint-row {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 46px;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  max-width: min(68vw, 360px);
  pointer-events: none;
}

.map-hint-controls {
  pointer-events: auto;
  margin-left: 0;
}

.map-hint-controls .chip {
  border-color: #d9d4bc;
  background: rgba(255, 251, 236, 0.9);
  color: #7a6331;
}

.map-hint-controls .chip.active {
  border-color: #f5bf4d;
  background: #fff2c2;
  color: #6a4a00;
  box-shadow: 0 0 0 2px rgba(245, 191, 77, 0.28), 0 6px 14px rgba(245, 191, 77, 0.24);
}

.map-hint-controls .chip.is-attention {
  animation: hintToggleBlink 0.85s ease-in-out infinite;
}

.map-hint-controls .chip.brush-chip {
  border-color: #c6dbf7;
  background: rgba(236, 244, 255, 0.92);
  color: #21508a;
}

.map-hint-controls .chip.brush-chip.active {
  border-color: #79a8e6;
  background: #d8eafe;
  color: #123f76;
  box-shadow: 0 0 0 2px rgba(121, 168, 230, 0.26), 0 6px 14px rgba(49, 104, 179, 0.2);
}

@keyframes hintToggleBlink {

  0%,
  100% {
    border-color: #d8d6c1;
    box-shadow: 0 0 0 rgba(245, 158, 11, 0);
    color: #5f430e;
  }

  50% {
    border-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28);
    color: #7a4a00;
  }
}

.map-chapter-panel__spot {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.36;
  color: #1f446f;
  font-weight: 600;
}

.map-chapter-panel__spot strong {
  color: #123a72;
}

.map-chapter-panel__list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.map-chapter-panel__list li {
  margin: 3px 0;
  color: #1a406d;
  font-weight: 600;
}

.map-chapter-panel__item.is-found {
  color: #1d7a43;
  font-weight: 800;
}

.map-chapter-panel__item.is-active-target {
  color: #f58a2c;
  font-weight: 900;
  text-shadow: 0 0 0.01px currentColor;
}

.map-chapter-panel__hint-icon {
  display: inline-block;
  margin-left: 4px;
}

.map-chapter-panel__exam-hint {
  margin: 7px 0 0;
  padding-top: 6px;
  border-top: 1px dashed #f2cc8a;
  color: #7a4a00;
  font-size: 0.72rem;
  line-height: 1.34;
  font-weight: 700;
}

.map-progress-donut {
  --progress: 0;
  position: absolute;
  left: 8px;
  top: 10px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: conic-gradient(#1c4c9d calc(var(--progress) * 1%), #d9e6f8 0);
  box-shadow: 0 7px 16px rgba(12, 32, 61, 0.18);
  z-index: 8;
  pointer-events: none;
}

.map-progress-donut::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d9e6f6;
}

.map-progress-donut__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #19458d;
}

.reward-dock {
  position: absolute;
  right: 8px;
  top: 10%;
  z-index: 8;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.reward-badge {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #d6e4f8;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 12px rgba(12, 33, 61, 0.2);
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.reward-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 9px);
  top: 50%;
  transform: translateY(-50%) scale(0.96);
  transform-origin: right center;
  max-width: min(42vw, 280px);
  min-width: 170px;
  border-radius: 10px;
  border: 1px solid #d8e6f9;
  background: rgba(255, 255, 255, 0.98);
  color: #173d6b;
  font-size: 0.66rem;
  line-height: 1.34;
  font-weight: 600;
  text-align: left;
  padding: 7px 9px;
  box-shadow: 0 9px 20px rgba(10, 31, 60, 0.2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 12;
}

.reward-badge::before {
  content: "";
  position: absolute;
  right: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%) scale(0.88);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.98);
  filter: drop-shadow(0 1px 0 rgba(176, 202, 233, 0.82));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 12;
}

.reward-badge:hover::after,
.reward-badge:hover::before,
.reward-badge:focus-visible::after,
.reward-badge:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.reward-badge:hover::after,
.reward-badge:focus-visible::after {
  transform: translateY(-50%) scale(1);
}

.reward-badge.is-highlight {
  border-color: #73a6ef;
  box-shadow: 0 0 0 3px rgba(65, 132, 226, 0.24), 0 7px 16px rgba(12, 33, 61, 0.24);
  animation: rewardBounce 0.9s ease-in-out 2;
}

.reward-dock.is-burst .reward-badge:first-child {
  animation: rewardSparkleBurst 1.1s ease-out;
}

@keyframes rewardBounce {

  0%,
  100% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.22);
  }

  70% {
    transform: scale(1.08);
  }
}

@keyframes rewardSparkleBurst {
  0% {
    box-shadow: 0 0 0 0 rgba(252, 210, 73, 0.66), 0 6px 12px rgba(12, 33, 61, 0.2);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(252, 210, 73, 0), 0 7px 16px rgba(12, 33, 61, 0.24);
  }

  100% {
    box-shadow: 0 6px 12px rgba(12, 33, 61, 0.2);
  }
}

.sheet {
  position: sticky;
  bottom: 0;
  background: var(--sheet);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 -10px 24px rgba(16, 34, 62, 0.12);
  z-index: 30;
  pointer-events: auto;
}

.sheet-handle {
  width: 44px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: #c5d7ef;
  margin: 10px auto 6px;
  display: block;
}

.sheet-content {
  padding: 0 14px calc(12px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 31;
  pointer-events: auto;
}

.meta {
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: none;
}

.prompt {
  margin: 6px 0 8px;
  font-size: 1.04rem;
  line-height: 1.3;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.prompt-content {
  position: relative;
  z-index: 1;
  display: block;
}

.sheet.is-learn-context .prompt,
.sheet.is-exam-context .prompt {
  border: 1px solid #d5e3f5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 16px rgba(9, 28, 57, 0.1);
  padding: 10px 12px;
}

.sheet.is-learn-context .prompt::after,
.sheet.is-exam-context .prompt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, #f7d6b1, #f7efcf, #d8ebff, #d9f2e6);
  background-size: 200% 200%;
  background-position: 0% 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: normal;
  filter: saturate(1.02);
}

.sheet.is-learn-context .prompt.is-transitioning::after,
.sheet.is-exam-context .prompt.is-transitioning::after {
  animation: promptSoftSweep 560ms ease-out both;
}

.sheet.is-learn-context .prompt {
  margin: 6px 0 2px;
  font-size: 0.98rem;
  line-height: 1.48;
  color: #1a406d;
}

.sheet.is-learn-context .prompt strong {
  color: #123a72;
}

.sheet.is-exam-context .prompt {
  margin: 6px 0 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #23476f;
}

.sheet.is-exam-context .prompt strong {
  color: #0f3b74;
}

.sheet.is-exam-context .prompt .exam-find-now {
  color: #f58a2c;
  font-weight: 900;
  text-shadow: 0 0 2px rgba(245, 138, 44, 0.18);
  display: inline-block;
  animation: examFindNowPulse 1.05s ease-in-out infinite;
}

.sheet.is-exam-context .prompt .exam-find-now strong {
  color: #f58a2c;
}

@keyframes examFindNowPulse {
  0%,
  100% {
    color: #f58a2c;
    text-shadow: 0 0 2px rgba(245, 138, 44, 0.18);
  }

  50% {
    color: #ffac5b;
    text-shadow: 0 0 8px rgba(245, 138, 44, 0.36);
  }
}

.sheet.is-exam-context .prompt .exam-find-target {
  color: #f58a2c;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  position: relative;
  padding-bottom: 2px;
  text-shadow: 0 0 2px rgba(245, 138, 44, 0.14);
}

.sheet.is-exam-context .prompt .exam-find-target::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  width: 0;
  background: linear-gradient(90deg, #f4a654, #f9c478);
  box-shadow: 0 0 3px rgba(244, 166, 84, 0.26);
  animation: examTargetUnderlineGrow calc((var(--target-steps, 8) * 42ms) + 200ms) steps(var(--target-steps, 8), end) forwards;
}

.sheet.is-exam-context .prompt .exam-find-target .exam-find-letter {
  display: inline-block;
  opacity: 0.64;
  transform: translateY(0.5px);
  animation: examTargetLetterReveal 220ms ease-out forwards;
  animation-delay: calc(var(--letter-index, 0) * 26ms);
}

.sheet.is-exam-context .prompt .exam-find-target .exam-find-space {
  display: inline-block;
  width: 0.42ch;
}

.sheet.is-exam-context .prompt .exam-guidance {
  display: block;
  margin-top: 8px;
  font-weight: 500;
}

@keyframes examTargetUnderlineGrow {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes promptSoftSweep {
  0% {
    opacity: 0.06;
    background-position: 0% 50%;
  }

  35% {
    opacity: 0.22;
  }

  80% {
    opacity: 0.1;
    background-position: 100% 50%;
  }

  100% {
    opacity: 0;
    background-position: 100% 50%;
  }
}

@keyframes examTargetLetterReveal {
  from {
    opacity: 0.34;
    transform: translateY(1px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.coach,
.hint {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.hint {
  color: #8a4f17;
  font-weight: 600;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--chip);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  touch-action: manipulation;
}

.chip.active {
  border-color: #8db4ec;
  background: #eaf2ff;
  color: #19458d;
}

.is-hidden {
  display: none !important;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary,
.ghost {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  touch-action: manipulation;
}

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

.primary.is-ready-animate {
  animation: nextQuestionReadyPulse 0.88s ease-in-out infinite;
  background: #f58a2c;
  border-color: #f58a2c;
  color: #132947;
  text-shadow: none;
}

@keyframes nextQuestionReadyPulse {

  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(245, 138, 44, 0.5);
  }

  50% {
    transform: translateY(-1px) scale(1.08);
    box-shadow: 0 0 0 10px rgba(245, 138, 44, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary.is-ready-animate {
    animation: none;
  }

  .sheet.is-exam-context .prompt .exam-find-now {
    animation: none;
  }

  .sheet.is-exam-context .prompt .exam-find-target {
    animation: none;
  }

  .sheet.is-exam-context .prompt .exam-find-target::after {
    animation: none;
    width: 100%;
  }

  .sheet.is-learn-context .prompt.is-transitioning::after,
  .sheet.is-exam-context .prompt.is-transitioning::after {
    animation: none;
    opacity: 0;
  }

  .sheet.is-exam-context .prompt .exam-find-target .exam-find-letter {
    animation: none;
    opacity: 1;
    transform: translateY(0);
  }

  .map-hint .hint-arrow {
    animation: none;
    transform: none;
  }

  .profile-btn.is-chapter-cta {
    animation: none;
    transform: none;
    box-shadow: 0 6px 14px rgba(130, 82, 11, 0.12);
  }
}

.ghost {
  background: #f7fbff;
  color: var(--ink);
}

.sheet.is-collapsed .sheet-content {
  display: none;
}

.sheet.is-collapsed {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 72px;
  height: 24px;
  overflow: hidden;
  box-shadow: none;
  border-radius: 999px;
  border: 1px solid #c9d8ee;
  background: rgba(255, 255, 255, 0.96);
  z-index: 40;
}

.sheet.is-collapsed .sheet-handle {
  width: 32px;
  margin: 9px auto 0;
}

.profile-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12, 28, 52, 0.62);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

/* ---- chapter-load preloader ---- */
.content-preloader {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(8, 20, 40, 0.78);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  pointer-events: all;
}

.content-preloader[hidden] {
  display: none !important;
}

.content-preloader__spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  border-radius: 50%;
  animation: preloader-spin 0.75s linear infinite;
}

.content-preloader__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

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

.profile-gate[hidden] {
  display: none !important;
}

.turnstile-widget {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-card {
  width: min(420px, 100%);
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #d7e4f6;
  box-shadow: 0 18px 40px rgba(8, 24, 47, 0.3);
  padding: 14px;
}

/* ============================================================
   HERO LANDING PAGE
   ============================================================ */

.welcome-hero {
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(ellipse at 0% 0%, #c8e0ff 0%, transparent 45%),
    radial-gradient(ellipse at 100% 10%, #ffe2c7 0%, transparent 38%),
    radial-gradient(ellipse at 60% 100%, #d4eeff 0%, transparent 40%),
    #eef5fb;
}

.welcome-hero[hidden] {
  display: none !important;
}

.welcome-hero__inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ---- nav ---- */
.welcome-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(190, 215, 245, 0.6);
  margin-bottom: 0;
  gap: 12px;
  position: sticky;
  top: 0;
  background: rgba(238, 245, 251, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
}

.welcome-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #0e2545;
  font-weight: 800;
  font-size: 0.9rem;
}

.welcome-nav__brand img {
  border-radius: 999px;
  border: 1px solid #b6cae8;
}

.welcome-nav__cta {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.welcome-nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(28, 76, 157, 0.35);
}

/* ---- hero body ---- */
.welcome-hero__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 52px 0 40px;
}

.welcome-hero__eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b5d32;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.welcome-hero__eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 2px;
  background: #0b5d32;
  border-radius: 2px;
}

.welcome-hero__headline {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.12;
  font-weight: 900;
  color: #0e2545;
  letter-spacing: -0.02em;
}

.welcome-hero__headline em {
  font-style: normal;
  background: linear-gradient(135deg, #1c4c9d 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-hero__sub {
  margin: 0 0 22px;
  font-size: 1rem;
  line-height: 1.6;
  color: #3a5272;
  max-width: 400px;
}

.welcome-hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.welcome-pill {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #c8daf0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a426e;
  white-space: nowrap;
}

.welcome-hero__cta-main {
  display: inline-block;
  background: linear-gradient(135deg, #1c4c9d 0%, #2d6bdb 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 28px;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 8px 22px rgba(28, 76, 157, 0.34);
  letter-spacing: -0.01em;
}

.welcome-hero__cta-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(28, 76, 157, 0.42);
}

.welcome-hero__fine {
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: #5d7a9a;
  font-weight: 600;
}

.welcome-hero__privacy {
  margin-top: 6px;
  font-size: 0.65rem;
  font-weight: 500;
  color: #8099b8;
}

.welcome-hero__privacy a {
  color: #8099b8;
  text-decoration: underline;
}

.auth-privacy-link {
  color: #5d7a9a;
  font-weight: 600;
  text-decoration: underline;
}

/* ---- map preview card ---- */
.welcome-hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.welcome-map-card {
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #ccdcf5;
  box-shadow: 0 24px 54px rgba(9, 28, 65, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transform: rotate(1.5deg);
  transition: transform 300ms ease;
}

.welcome-map-card:hover {
  transform: rotate(0deg) scale(1.01);
}

.welcome-map-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #e8f0fb;
  background: #f7fbff;
}

.welcome-map-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.welcome-map-card__dot.is-orange {
  background: #f58a2c;
}

.welcome-map-card__label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #1a3f72;
}

.welcome-map-card__img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- map wrap + animated markers ---- */
.welcome-map-wrap {
  position: relative;
  display: block;
  line-height: 0;
}

/* Pulse marker base */
.map-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: default;
}

/* Ripple ring */
.map-marker::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  opacity: 0;
  animation: map-pulse 2.4s ease-out infinite;
}

/* Tooltip on hover */
.map-marker::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(14, 37, 69, 0.88);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 10;
}

.map-marker:hover::after {
  opacity: 1;
}

/* Iron Ore — sienna triangle */
.m-iron {
  background: #a0522d;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-radius: 0;
  width: 9px;
  height: 9px;
}

.m-iron::before {
  border: 2px solid #c0703a;
  animation-delay: 0s;
}

/* Cotton — amber */
.m-cotton {
  background: #c8960a;
}

.m-cotton::before {
  border: 2px solid #e0ac12;
  animation-delay: 0.8s;
}

/* Port — navy square */
.m-port {
  background: #1c4c9d;
  border-radius: 3px;
}

.m-port::before {
  border: 2px solid #3b82f6;
  animation-delay: 1.6s;
}

/* Stagger delays */
.map-marker:nth-child(2)::before {
  animation-delay: 0.3s;
}

.map-marker:nth-child(3)::before {
  animation-delay: 0.6s;
}

.map-marker:nth-child(4)::before {
  animation-delay: 0.8s;
}

.map-marker:nth-child(5)::before {
  animation-delay: 1.2s;
}

.map-marker:nth-child(6)::before {
  animation-delay: 1.6s;
}

.map-marker:nth-child(7)::before {
  animation-delay: 2.0s;
}

.map-marker:nth-child(8)::before {
  animation-delay: 2.4s;
}

@keyframes map-pulse {
  0% {
    transform: scale(1);
    opacity: 0.75;
  }

  80% {
    transform: scale(3.4);
    opacity: 0;
  }

  100% {
    transform: scale(3.4);
    opacity: 0;
  }
}

/* ---- map legend ---- */
.welcome-map-legend {
  display: flex;
  gap: 12px;
  padding: 8px 14px;
  background: #f7fbff;
  border-top: 1px solid #e8f0fb;
  justify-content: center;
}

.map-legend-item {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.map-legend-item.m-iron {
  color: #a0522d;
}

.map-legend-item.m-cotton {
  color: #c8960a;
}

.map-legend-item.m-port {
  color: #1c4c9d;
}

/* ---- CTA button animations ---- */
.welcome-hero__cta-main.is-animated {
  background-size: 200% auto;
  background-image: linear-gradient(135deg,
      #1c4c9d 0%, #2d6bdb 40%, #5b9ef8 50%, #2d6bdb 60%, #1c4c9d 100%);
  animation: cta-shimmer 2.6s linear infinite;
}

@keyframes cta-shimmer {
  0% {
    background-position: 200% center;
  }

  100% {
    background-position: -200% center;
  }
}

.welcome-nav__cta.is-animated {
  animation: cta-pulse 2s ease-in-out infinite;
}

@keyframes cta-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 14px rgba(28, 76, 157, 0.25);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(28, 76, 157, 0.45);
  }
}

.welcome-nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-floating-share {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid #c7d9f2;
  background: rgba(255, 255, 255, 0.94);
  color: #1a446f;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(12, 33, 61, 0.15);
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.welcome-floating-share:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(12, 33, 61, 0.2);
}

.welcome-floating-share:active {
  transform: translateY(0);
}

/* ---- Share Sheet Overlay ---- */
.share-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14, 37, 69, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.share-sheet-overlay[hidden] {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.share-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(9, 28, 57, 0.15);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-sheet.is-closing {
  transform: translateY(100%);
}

.share-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.share-sheet__title {
  margin: 0;
  font-size: 1.15rem;
  color: #0e2545;
  font-weight: 800;
}

.share-sheet__close {
  background: #f0f4fa;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  color: #4d6483;
  cursor: pointer;
}

.share-sheet__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 16px 14px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  width: 64px;
}

.share-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}

.share-option:hover .share-icon-wrap {
  transform: scale(1.08);
}

.share-option span {
  font-size: 0.72rem;
  color: #1a446f;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {

  .map-marker::before,
  .welcome-hero__cta-main.is-animated,
  .welcome-nav__cta.is-animated {
    animation: none;
  }
}

/* ---- subject catalog ---- */
.welcome-catalog {
  border-top: 1px solid rgba(190, 215, 245, 0.7);
  padding-top: 28px;
}

.welcome-catalog__label {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #4d6483;
}

.welcome-catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.welcome-catalog-item {
  border: 1px solid #ccddf4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  color: #153d76;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.welcome-catalog-item.is-active {
  cursor: pointer;
  border-color: #7ea9e8;
  background: linear-gradient(135deg, #eaf2ff, #f5f9ff);
  box-shadow: 0 4px 14px rgba(28, 76, 157, 0.12);
}

.welcome-catalog-item.is-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(28, 76, 157, 0.18);
}

.welcome-catalog-item.is-soon {
  border-style: dashed;
  background: rgba(247, 248, 251, 0.7);
  color: #5c6780;
  cursor: default;
}

.welcome-catalog-item__icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 2px;
}

.welcome-catalog-item__title {
  font-size: 0.88rem;
  font-weight: 800;
}

.welcome-catalog-item__badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0b5d32;
  background: rgba(11, 93, 50, 0.09);
  border-radius: 999px;
  padding: 2px 8px;
  width: fit-content;
}

.welcome-catalog-item__badge.is-soon-badge {
  color: #5c6780;
  background: rgba(92, 103, 128, 0.09);
}

/* ---- responsive ---- */
@media (max-width: 680px) {
  .welcome-hero__body {
    grid-template-columns: 1fr;
    padding: 32px 0 28px;
    gap: 28px;
  }

  .welcome-hero__visual {
    order: -1;
  }

  .welcome-map-card {
    transform: rotate(0deg);
    max-width: 100%;
  }

  .welcome-hero__headline {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .welcome-catalog__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 400px) {
  .welcome-catalog__grid {
    grid-template-columns: 1fr;
  }
}

.auth-card {
  width: min(440px, 100%);
}

.auth-actions {
  grid-template-columns: 1fr 1fr;
}

.google-official-wrap {
  margin-top: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.google-official-btn {
  min-height: 44px;
  width: 100%;
  max-width: 340px;
  display: grid;
  place-items: center;
}

.auth-gate-error {
  margin: 10px 0 0;
  border: 1px solid #efc5c5;
  background: #fff3f3;
  color: #9b2323;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.3;
}

.profile-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.profile-card__copy {
  margin: 6px 0 4px;
  font-size: 0.86rem;
  color: #35557b;
}

.profile-card__note {
  margin: 0 0 10px;
  font-size: 0.76rem;
  color: #5d7190;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 9px;
}

.profile-field span {
  font-size: 0.73rem;
  font-weight: 700;
  color: #496381;
  text-transform: uppercase;
}

.profile-field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cfe0f4;
  background: #fbfdff;
  padding: 9px 10px;
  font-size: 0.86rem;
  color: #133966;
  font-weight: 700;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.profile-actions .ghost,
.profile-actions .primary {
  padding: 9px 8px;
  font-size: 0.8rem;
}

.chapter-gate-card {
  width: min(980px, 96vw);
  max-height: min(86vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.chapter-gate-card .profile-actions {
  grid-template-columns: 1fr;
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: auto;
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #d9e6f8;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.94) 30%, #ffffff 60%);
}

.chapter-gate-layout {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 12px;
  min-height: min(56vh, 470px);
}

.chapter-gate-layout.is-single-chapter {
  grid-template-columns: minmax(0, 1fr);
}

.chapter-pane {
  border: 1px solid #d3e3f8;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f3f8ff);
  padding: 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.chapter-pane--chapters {
  border-color: #c7dcf7;
  background: linear-gradient(180deg, #f4f9ff, #e8f1ff);
}

.chapter-pane--topics {
  border-color: #efd7ad;
  background: linear-gradient(180deg, #fffaf0, #fff2dd);
}

.chapter-pane--chapters.is-hidden {
  display: none;
}

.chapter-pane.is-active-pane {
  transform: translateY(-1px);
}

.chapter-pane--chapters.is-active-pane {
  border-color: #8eb4e8;
  box-shadow: 0 0 0 2px rgba(112, 161, 228, 0.22), 0 12px 24px rgba(18, 58, 115, 0.14);
}

.chapter-pane--topics.is-active-pane {
  border-color: #efbc73;
  box-shadow: 0 0 0 2px rgba(243, 181, 92, 0.23), 0 12px 24px rgba(135, 84, 17, 0.14);
}

.chapter-pane__title {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 900;
  color: #173c73;
}

.chapter-pane__sub {
  margin: 4px 0 10px;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #5d7392;
}

.chapter-pane--chapters .chapter-pane__title {
  color: #184986;
}

.chapter-pane--chapters .chapter-pane__sub {
  color: #5b79a6;
}

.chapter-pane--topics .chapter-pane__title {
  color: #8e5a10;
}

.chapter-pane--topics .chapter-pane__sub {
  color: #9a6e2e;
}

.chapter-choice-row {
  margin: 0;
  min-height: 0;
}

.chapter-choice-row.is-hidden {
  display: none;
}

.chapter-choice-row--chapters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #7ea7dd rgba(221, 233, 248, 0.85);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chapter-choice-row--topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 9px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #e0ad61 rgba(247, 230, 197, 0.85);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chapter-choice-row--chapters::-webkit-scrollbar,
.chapter-choice-row--topics::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.chapter-choice-row--chapters::-webkit-scrollbar-track {
  background: rgba(218, 232, 249, 0.86);
  border-radius: 999px;
}

.chapter-choice-row--topics::-webkit-scrollbar-track {
  background: rgba(247, 230, 197, 0.85);
  border-radius: 999px;
}

.chapter-choice-row--chapters::-webkit-scrollbar-thumb,
.chapter-choice-row--topics::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.chapter-choice-row--chapters::-webkit-scrollbar-thumb {
  background: #7ea7dd;
}

.chapter-choice-row--topics::-webkit-scrollbar-thumb {
  background: #e0ad61;
}

.chapter-choice-card {
  border: 1px solid #d1e0f3;
  background: #f9fcff;
  color: #20436f;
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 84px;
  justify-content: flex-start;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.chapter-choice-card:hover {
  transform: translateY(-1px);
  border-color: #9dbde8;
  box-shadow: 0 6px 14px rgba(16, 46, 88, 0.12);
}

.chapter-pane--topics .chapter-choice-card {
  border-color: #ead7b7;
  background: #fffaf1;
}

.chapter-pane--topics .chapter-choice-card:hover {
  border-color: #e7bd7f;
  box-shadow: 0 6px 14px rgba(140, 93, 28, 0.12);
}

.chapter-chip {
  border: 1px solid #cfdef1;
  background: #f7fbff;
  color: #22446f;
  border-radius: 12px;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.chapter-chip:hover {
  transform: translateY(-1px);
  border-color: #9dbde8;
  box-shadow: 0 5px 12px rgba(15, 44, 84, 0.12);
}

.chapter-chip__title {
  font-size: 0.79rem;
  font-weight: 900;
  line-height: 1.25;
  color: #173f78;
}

.chapter-chip__meta {
  font-size: 0.69rem;
  line-height: 1.25;
  color: #597294;
  font-weight: 700;
}

.chapter-chip.is-active {
  border-color: #7ea9e8;
  background: #eaf2ff;
  box-shadow: 0 0 0 2px rgba(126, 169, 232, 0.26), 0 7px 15px rgba(23, 63, 120, 0.18);
}

.chapter-chip.is-active .chapter-chip__title {
  color: #123c79;
}

.chapter-choice-card.is-active {
  border-color: #7ea9e8;
  background: #eaf2ff;
  box-shadow: 0 0 0 2px rgba(126, 169, 232, 0.22), 0 7px 15px rgba(23, 63, 120, 0.15);
}

.chapter-pane--topics .chapter-choice-card.is-active {
  border-color: #efbc73;
  background: #fff0d6;
  box-shadow: 0 0 0 2px rgba(243, 181, 92, 0.23), 0 7px 15px rgba(140, 93, 28, 0.14);
}

.chapter-choice-card.is-complete {
  border-color: #85c8a1;
  background: #eefcf3;
}

.chapter-choice-card.is-locked {
  border-style: dashed;
  border-color: #d4d9e3;
  background: #f7f8fb;
  color: #5c6780;
}

.chapter-choice-card.is-locked .chapter-choice-sub,
.chapter-choice-card.is-locked .chapter-choice-state {
  color: #5c6780;
}

.chapter-choice-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
}

.chapter-choice-sub {
  margin: 0;
  font-size: 0.74rem;
  color: #496681;
  line-height: 1.3;
}

.chapter-choice-state {
  margin: 0;
  font-size: 0.68rem;
  color: #2b5f98;
  line-height: 1.2;
  font-weight: 700;
}

@media (max-width: 860px) {
  .profile-gate {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(14px + env(safe-area-inset-bottom));
  }

  .chapter-gate-card {
    width: min(96vw, 640px);
    max-height: none;
    min-height: min(88vh, 860px);
    overflow: auto;
    padding: 14px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .chapter-gate-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    flex: 1 1 auto;
  }

  .chapter-pane--chapters {
    max-height: 220px;
  }

  .chapter-choice-row--topics {
    grid-template-columns: 1fr;
  }

  .chapter-gate-card .profile-actions {
    margin-top: 8px;
  }
}

.onboard-focus {
  position: relative;
  z-index: 141 !important;
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(28, 76, 157, 0.35), 0 0 24px rgba(28, 76, 157, 0.35);
  animation: onboardAuraPulse 1.2s ease-in-out infinite;
}

.map-stage.onboard-focus {
  border-radius: 14px;
}

@keyframes onboardAuraPulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(28, 76, 157, 0.35), 0 0 16px rgba(28, 76, 157, 0.28);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(28, 76, 157, 0.24), 0 0 30px rgba(28, 76, 157, 0.34);
  }
}

.onboard-card {
  position: fixed;
  z-index: 165;
  width: min(320px, calc(100vw - 16px));
  border-radius: 14px;
  border: 1px solid #c7dcf8;
  background: linear-gradient(160deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 14px 30px rgba(8, 29, 59, 0.24);
  padding: 11px 12px;
}

.onboard-card.is-hidden {
  display: none;
}

.onboard-card__step {
  margin: 0 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  color: #2a5ea7;
}

.onboard-card__title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  line-height: 1.25;
  color: #0f3568;
}

.onboard-card__body {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #2f4f7a;
}

.onboard-card__actions {
  margin-top: 9px;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.onboard-card__actions .ghost,
.onboard-card__actions .primary {
  font-size: 0.76rem;
  padding: 7px 10px;
  border-radius: 9px;
}

.onboard-card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #f3f7ff;
  border-left: 1px solid #c7dcf8;
  border-top: 1px solid #c7dcf8;
  transform: rotate(45deg);
}

.onboard-card.placement-top::after {
  left: calc(50% - 6px);
  bottom: -7px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid #c7dcf8;
  border-bottom: 1px solid #c7dcf8;
}

.onboard-card.placement-bottom::after {
  left: calc(50% - 6px);
  top: -7px;
}

.onboard-card.placement-left::after {
  top: calc(50% - 6px);
  right: -7px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid #c7dcf8;
  border-bottom: 1px solid #c7dcf8;
}

.onboard-card.placement-right::after {
  top: calc(50% - 6px);
  left: -7px;
}

/* Tablet + mobile baseline responsiveness. */
@media (max-width: 1023px) {
  body {
    overflow-x: hidden;
  }

  .app {
    max-width: 100vw;
  }

  .top-strip {
    gap: 6px;
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .top-strip::-webkit-scrollbar {
    height: 5px;
  }

  .top-strip::-webkit-scrollbar-thumb {
    background: #c8d9f1;
    border-radius: 999px;
  }

  .brand-mark {
    max-width: 150px;
    font-size: 0.7rem;
  }

  .profile-pill {
    max-width: 165px;
    font-size: 0.7rem;
  }

  .mode {
    padding: 6px 9px;
    font-size: 0.8rem;
  }

  .profile-btn {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  .auth-menu-btn {
    min-height: 32px;
    padding: 4px 7px 4px 5px;
    font-size: 0.72rem;
  }

  .auth-label {
    max-width: 82px;
  }

  .map-stage {
    min-height: clamp(380px, 62dvh, 760px);
    max-height: calc(100dvh - 166px);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #indiaMap {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin-inline: auto;
  }

  .sheet {
    max-height: min(38dvh, 340px);
    overflow: auto;
  }

  .sheet-content {
    padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  }
}

/* Mid-size phones and foldables. */
@media (max-width: 640px) {
  .brand-mark {
    min-width: 34px;
    max-width: 34px;
    padding: 4px;
    justify-content: center;
  }

  .brand-mark__logo {
    width: 22px;
    height: 22px;
  }

  .brand-mark__text {
    display: none;
  }

  .profile-pill {
    max-width: 142px;
    font-size: 0.68rem;
  }
}

/* Very narrow phones only. */
@media (max-width: 480px) {
  .profile-pill {
    display: none;
  }
}

/* Tablet-specific tuning (portrait + landscape). */
@media (min-width: 768px) and (max-width: 1023px) {
  .top-strip {
    gap: 7px;
  }

  .profile-pill {
    max-width: 210px;
    font-size: 0.74rem;
  }

  .map-stage {
    min-height: clamp(440px, 64dvh, 820px);
    max-height: calc(100dvh - 188px);
  }

  .sheet {
    max-height: min(34dvh, 320px);
  }

  .sheet-content {
    padding: 0 14px calc(12px + env(safe-area-inset-bottom));
  }

  .map-topic-heading {
    max-width: min(44vw, 260px);
  }
}

/* Very short landscape phones. */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1023px) {
  .top-strip {
    padding: calc(4px + env(safe-area-inset-top)) 8px 4px;
  }

  .map-stage {
    min-height: 260px;
    max-height: calc(100dvh - 120px);
  }

  .sheet {
    max-height: min(52dvh, 250px);
  }
}

/* Desktop layout tuned for 1366x768 class laptop screens. */
@media (min-width: 1024px) and (min-height: 640px) and (hover: hover) and (pointer: fine) {
  body {
    overflow: hidden;
  }

  .app {
    height: 100dvh;
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 0 10px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 340px);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "top top"
      "map sheet";
    gap: 10px;
    background: var(--app-mode-bg);
    border: 0;
  }

  .top-strip {
    grid-area: top;
    margin-top: 8px;
    border: 1px solid #d6e4f4;
    border-radius: 16px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  }

  .profile-pill {
    max-width: 280px;
    font-size: 0.78rem;
  }

  .brand-mark {
    max-width: 188px;
    font-size: 0.76rem;
  }

  .map-stage {
    grid-area: map;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5e3f5;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 30px rgba(9, 28, 57, 0.14);
  }

  #indiaMap {
    width: 100%;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
  }

  .sheet {
    grid-area: sheet;
    position: relative;
    top: auto;
    bottom: auto;
    align-self: stretch;
    border-radius: 18px;
    border: 1px solid #d5e3f5;
    box-shadow: 0 12px 28px rgba(16, 34, 62, 0.15);
    max-height: none;
    height: 100%;
    overflow: auto;
  }

  .sheet-handle {
    display: none;
  }

  .sheet-content {
    padding: 14px 16px 16px;
  }

  .meta {
    font-size: 0.78rem;
  }

  .prompt {
    margin: 8px 0 12px;
    font-size: 1.18rem;
  }

  .sheet.is-learn-context .prompt {
    font-size: 1.02rem;
  }

  .sheet.is-exam-context .prompt {
    font-size: 0.94rem;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .map-topic-heading {
    right: 12px;
    top: 12px;
    max-width: min(44%, 360px);
    font-size: 0.93rem;
    padding: 8px 12px;
  }

  .map-hint-row {
    left: 46%;
    top: 46px;
    max-width: min(46%, 420px);
  }

  .map-hint {
    max-width: min(30vw, 320px);
    font-size: 0.79rem;
  }

  .map-chapter-panel {
    right: 14%;
    top: 72%;
    width: min(32vw, 300px);
    padding: 10px 11px;
  }

  .map-chapter-panel__spot {
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .map-chapter-panel__list li {
    font-size: 0.8rem;
    margin: 4px 0;
  }

  .map-progress-donut {
    left: 12px;
    top: 12px;
    width: 64px;
    height: 64px;
  }

  .map-progress-donut__value {
    font-size: 0.76rem;
  }

  .reward-dock {
    right: 12px;
    top: 10%;
  }
}

@media (max-width: 430px) {
  .brand-mark {
    min-width: 34px;
    max-width: 34px;
    padding: 4px;
    justify-content: center;
  }

  .brand-mark__logo {
    width: 22px;
    height: 22px;
  }

  .brand-mark__text {
    display: none;
  }

  .profile-pill {
    display: none;
  }

  .auth-label {
    max-width: 68px;
  }

  .profile-btn {
    padding: 6px 8px;
  }

  .map-chapter-panel {
    width: min(52vw, 188px);
    right: 10%;
    top: 72%;
    padding: 7px 8px;
  }

  .map-topic-heading {
    right: 6px;
    top: 8px;
    max-width: min(52vw, 180px);
    font-size: 0.78rem;
    padding: 6px 8px;
  }

  .map-hint {
    max-width: min(40vw, 145px);
    font-size: 0.7rem;
    padding: 6px 8px;
  }

  .map-hint-row {
    left: 50%;
    top: 40px;
    max-width: min(78vw, 264px);
  }

  .map-hint-row.is-exam-hint-portrait {
    left: 8px;
    top: 72px;
    transform: none;
    justify-content: flex-start;
    max-width: min(46vw, 210px);
  }

  .map-hint-row.is-exam-hint-portrait .map-hint {
    max-width: min(42vw, 186px);
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .map-progress-donut {
    left: 6px;
    top: 8px;
    width: 52px;
    height: 52px;
  }

  .reward-dock {
    right: 6px;
    top: 10%;
    gap: 5px;
  }

  .reward-badge {
    width: 27px;
    height: 27px;
    font-size: 14px;
  }
}

@media (orientation: portrait) {
  .map-hint-row.is-exam-hint-portrait {
    left: 10px;
    top: 78px;
    transform: none;
    justify-content: flex-start;
    max-width: min(42vw, 250px);
  }

  .map-hint-row.is-exam-hint-portrait .map-hint {
    max-width: min(38vw, 220px);
  }
}
