:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app-bg: #071528;
  --panel-bg: #ffffff;
  --panel-bg-soft: #f8fbff;
  --panel-border: #dfe6ef;
  --control-border: #d5dde8;
  --ink: #172033;
  --muted: #536277;
  --muted-strong: #7a8798;
  --brand: #1f6fdb;
  --brand-strong: #155bb8;
  --brand-soft: #eaf2ff;
  --brand-soft-border: #b7cff8;
  --success: #16703b;
  --success-bg: #ecfdf3;
  --success-border: #b7e4c7;
  --danger: #b42318;
  --map-ocean: #173f63;
  --panel-bg-hover: #fdfefe;
  --disabled-bg: #f2f5f8;
  --control-bg: #eef4fb;
  --radius-control: 12px;
  --radius-panel: 22px;
  --shadow-float: 0 18px 44px rgba(9, 22, 42, 0.2);
  --atlas-space-background: linear-gradient(145deg, #0b1f38 0%, #123558 54%, #294967 100%);
  background: var(--atlas-space-background);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(145deg, #0b1f38 0%, #123558 54%, #294967 100%);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

body.study-mode {
  overflow: hidden;
}

body.launch-mode,
body.app-shell-mode {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.launch-screen,
.app-shell-screen,
.poc-header,
.poc-main,
.answer-panel,
.region-panel,
.journey-completion-overlay,
.activity-retry-overlay,
.memory-trail-overlay,
.info-popover {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

.launch-screen {
  align-items: center;
  background: var(--atlas-space-background);
  color: #ffffff;
  display: grid;
  inset: 0;
  justify-items: center;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(22px, 3.4vw, 46px);
  position: fixed;
  text-align: center;
  z-index: 100;
}

.launch-screen[hidden] {
  display: none;
}

.launch-screen::before,
.launch-screen::after {
  content: none;
  display: none;
  pointer-events: none;
}

.launch-content {
  align-self: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: clamp(18px, 3vh, 30px);
  justify-items: center;
  max-width: min(820px, 100%);
  padding: clamp(18px, 3vw, 34px);
  position: relative;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.54);
  width: 100%;
  z-index: 2;
}

.launch-title-lockup {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.launch-kicker {
  border: 1px solid rgba(152, 201, 255, 0.5);
  border-radius: 999px;
  color: #8dc7ff;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  padding: 7px 16px;
  text-transform: uppercase;
}

.launch-title-lockup h1 {
  color: #fff4d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.2rem, 9.4vw, 7.8rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.95;
  margin: 0;
  text-shadow: 0 3px 0 rgba(4, 15, 31, 0.95), 0 14px 26px rgba(0, 0, 0, 0.5);
}

.launch-subtitle {
  color: #f0c987;
  font-size: clamp(1.2rem, 2.4vw, 1.72rem);
  font-weight: 650;
  margin: 0;
  max-width: 760px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.72);
}

.launch-actions {
  display: grid;
  gap: clamp(16px, 2.8vh, 26px);
  justify-items: center;
  width: 100%;
}

.launch-button {
  align-items: center;
  border: 0;
  border-radius: 22px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 1000;
  justify-content: center;
  letter-spacing: 0;
  min-height: 72px;
  padding: 18px 24px;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.38);
  touch-action: manipulation;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.launch-button:hover,
.launch-button:focus-visible {
  filter: brightness(1.08);
  outline: none;
  transform: translateY(-2px);
}

.launch-button-primary {
  background: linear-gradient(180deg, #2c83c8 0%, #155a9e 52%, #0b356f 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.26),
    inset 0 -4px 0 rgba(0, 0, 0, 0.22),
    0 16px 32px rgba(0, 0, 0, 0.36);
  border: 2px solid rgba(151, 211, 255, 0.78);
  font-size: clamp(2rem, 4vw, 2.85rem);
  gap: 16px;
  min-height: clamp(74px, 8vw, 92px);
  width: min(470px, 90vw);
}

.launch-button-icon {
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  display: inline-block;
  height: 52px;
  position: relative;
  width: 52px;
}

.launch-button-icon::before {
  border-bottom: 13px solid transparent;
  border-left: 22px solid rgba(255, 255, 255, 0.95);
  border-top: 13px solid transparent;
  content: "";
  left: 18px;
  position: absolute;
  top: 10px;
}

.launch-gear-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(180, 215, 255, 0.46);
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  height: 64px;
  justify-content: center;
  position: absolute;
  right: clamp(16px, 3vw, 44px);
  top: clamp(16px, 3vw, 34px);
  width: 64px;
  z-index: 3;
}

.launch-gear-button::before {
  content: "\2699";
  font-size: 2rem;
  line-height: 1;
}

.launch-gear-button:hover,
.launch-gear-button:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.launch-compass {
  aspect-ratio: 1;
  filter: drop-shadow(0 0 22px rgba(238, 201, 138, 0.18));
  opacity: 0.95;
  width: clamp(150px, 18vw, 230px);
}

.app-shell-screen {
  align-items: center;
  background: var(--atlas-space-background);
  display: grid;
  inset: 0;
  justify-items: center;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(20px, 4vw, 44px);
  position: fixed;
  text-align: center;
  z-index: 95;
}

.app-shell-screen[hidden] {
  display: none;
}

.app-shell-screen::before {
  content: none;
  display: none;
  pointer-events: none;
}

.app-shell-screen::after {
  content: none;
  display: none;
  pointer-events: none;
}

.app-shell-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(188, 211, 237, 0.78);
  border-radius: 24px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
  display: grid;
  gap: 18px;
  justify-items: center;
  margin: auto 0;
  max-width: min(900px, 100%);
  padding: clamp(24px, 5vw, 42px);
  position: relative;
  width: 100%;
  z-index: 2;
}

.app-shell-panel .launch-kicker {
  background: rgba(234, 242, 255, 0.88);
  color: var(--brand-strong);
  text-shadow: none;
}

.app-shell-panel h1 {
  color: var(--ink);
  font-size: 3.2rem;
  line-height: 1;
  margin: 0;
}

.app-shell-panel p {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.quick-start-row {
  display: block;
  position: relative;
  width: min(688px, 100%);
}

.quick-start-row[hidden] {
  display: none;
}

.quick-start-card {
  align-items: start;
  background:
    linear-gradient(135deg, rgba(20, 101, 217, 0.98), rgba(8, 46, 121, 0.98)),
    radial-gradient(circle at 92% 16%, rgba(255, 255, 255, 0.24), transparent 34%);
  border: 1px solid rgba(161, 202, 255, 0.72);
  border-radius: 22px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 18px 34px rgba(21, 63, 122, 0.28);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: start;
  min-height: 166px;
  padding: 22px 58px 20px 24px;
  position: relative;
  text-align: left;
  touch-action: manipulation;
  width: 100%;
}

.quick-start-card[hidden] {
  display: none;
}

.quick-start-card:hover,
.quick-start-card:focus-visible {
  filter: brightness(1.05);
  outline: none;
  transform: translateY(-1px);
}

.quick-start-kicker {
  color: rgba(226, 241, 255, 0.9);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-start-title {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  font-weight: 950;
  line-height: 1.02;
}

.quick-start-detail,
.quick-start-meta {
  color: rgba(244, 249, 255, 0.92);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.quick-start-action {
  align-self: end;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(3, 16, 45, 0.24);
  color: #0b4aa0;
  font-size: 0.96rem;
  font-weight: 950;
  margin-top: 8px;
  min-height: 44px;
  padding: 11px 22px;
}

.app-shell-corner-button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(188, 211, 237, 0.84);
  border-radius: var(--radius-control);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  left: clamp(16px, 3vw, 44px);
  min-height: 48px;
  padding: 10px 16px;
  position: absolute;
  top: clamp(16px, 3vw, 34px);
  z-index: 3;
}

.app-shell-corner-button:hover,
.app-shell-corner-button:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 10px 24px rgba(0, 0, 0, 0.24);
  outline: none;
}

.main-menu-actions {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 4px;
  width: min(560px, 100%);
}

.main-menu-action-row {
  display: block;
  position: relative;
}

.main-menu-button {
  border: 0;
  border-radius: 16px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.18), inset 0 -4px 0 rgba(0, 0, 0, 0.16), 0 10px 22px rgba(24, 38, 64, 0.16);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 950;
  min-height: 76px;
  padding: 14px 44px 14px 16px;
  position: relative;
  text-transform: uppercase;
  touch-action: manipulation;
  width: 100%;
}

#main-menu-launch-button {
  grid-column: 1 / -1;
}

.info-button {
  align-items: center;
  align-self: start;
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  color: rgba(49, 81, 127, 0.64);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 950;
  height: 34px;
  justify-content: center;
  line-height: 1;
  min-width: 34px;
  padding: 0;
  position: relative;
  text-transform: none;
  touch-action: manipulation;
}

.quick-start-row > .info-button,
.main-menu-action-row > .info-button,
.journey-path-card .info-button,
.journey-section-heading-row .info-button {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
}

.quick-start-row > .info-button {
  color: rgba(255, 255, 255, 0.72);
  right: 12px;
  top: 12px;
}

.main-menu-action-row > .info-button {
  color: rgba(255, 255, 255, 0.68);
}

.journey-path-card .info-button,
.journey-section-heading-row .info-button {
  color: rgba(49, 81, 127, 0.58);
}

.info-button:hover,
.info-button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.96);
  outline: none;
}

.journey-path-card .info-button:hover,
.journey-path-card .info-button:focus-visible,
.journey-section-heading-row .info-button:hover,
.journey-section-heading-row .info-button:focus-visible {
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-strong);
}

.info-popover {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(153, 178, 210, 0.88);
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(18, 39, 72, 0.24);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  max-width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  position: fixed;
  z-index: 120;
}

.info-popover[hidden] {
  display: none;
}

.main-menu-button:hover,
.main-menu-button:focus-visible {
  filter: brightness(1.06);
  outline: none;
  transform: translateY(-1px);
}

.main-menu-button-blue {
  background: linear-gradient(180deg, #2389da, #064b9f);
}

.main-menu-button-purple {
  background: linear-gradient(180deg, #9c4bdc, #54229b);
}

.main-menu-button-orange {
  background: linear-gradient(180deg, #f28b14, #b64600);
}

.main-menu-button-teal {
  background: linear-gradient(180deg, #10b6c8, #036f7b);
}

.main-menu-button-green {
  background: linear-gradient(180deg, #74d82f, #279012);
}

.journey-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.main-menu-button-quiet {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.9);
  box-shadow: 0 8px 18px rgba(24, 38, 64, 0.12);
  color: var(--ink);
  grid-column: 1 / -1;
}

.app-shell-placeholder-card {
  background: var(--panel-bg-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: 16px;
  color: var(--ink);
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding: 16px 18px;
  width: min(560px, 100%);
}

.app-shell-placeholder-card[hidden] {
  display: none;
}

.app-shell-placeholder-card strong {
  color: var(--brand-strong);
}

.journey-preset-list {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
  margin-top: 10px;
  text-align: left;
  width: 100%;
}

.journey-preset-list[hidden] {
  display: none;
}

.journey-shell-content {
  display: grid;
  gap: 18px;
  text-align: left;
  width: 100%;
}

.journey-shell-content[hidden] {
  display: none;
}

.journey-preset-section {
  display: grid;
  gap: 12px;
  width: 100%;
}

.journey-preset-section-title {
  color: var(--brand-strong);
  font-size: 0.94rem;
  font-weight: 950;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.journey-preset-section-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.journey-preset-card {
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(24, 38, 64, 0.12);
  display: grid;
  gap: 12px;
  min-height: 218px;
  padding: 16px;
}

.journey-preset-card-coming-soon {
  background: linear-gradient(180deg, #ffffff, #f7f7fb);
  border-color: rgba(203, 213, 225, 0.9);
  opacity: 0.82;
}

.journey-preset-card-header {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.journey-preset-card h3 {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.15;
  margin: 0;
}

.journey-preset-card p {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  margin: 0;
}

.journey-preset-meta {
  color: var(--brand-strong) !important;
  font-size: 0.84rem !important;
  font-weight: 850 !important;
}

.journey-card-actions {
  align-self: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 4px;
}

.journey-card-actions button:only-child {
  grid-column: 1 / -1;
}

.journey-status {
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 4px 8px;
  text-transform: uppercase;
}

.journey-status-available {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.journey-status-coming-soon {
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  color: var(--brand-strong);
}

.journey-status-locked {
  background: #fff7e6;
  border: 1px solid #f0d39b;
  color: #8a5a0a;
}

.journey-card-actions button {
  background: linear-gradient(180deg, #37a8f2, #1260b5);
  border: 0;
  border-radius: var(--radius-control);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 8px 16px rgba(24, 38, 64, 0.14);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  min-height: 48px;
  padding: 10px 12px;
  touch-action: manipulation;
}

.journey-card-actions button:nth-child(2) {
  background: linear-gradient(180deg, #74d82f, #279012);
}

.journey-card-actions button:hover:not(:disabled),
.journey-card-actions button:focus-visible:not(:disabled) {
  filter: brightness(1.06);
  outline: none;
  transform: translateY(-1px);
}

.journey-card-actions button:disabled {
  background: var(--disabled-bg);
  border: 1px solid var(--panel-border);
  box-shadow: none;
  color: var(--muted);
  cursor: not-allowed;
}

.journey-detail-summary,
.journey-mode-panel,
.journey-difficulty-panel,
.settings-panel {
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(24, 38, 64, 0.12);
  display: grid;
  gap: 12px;
  padding: 18px;
}

.onboarding-panel {
  display: grid;
  gap: 18px;
  width: min(680px, 100%);
}

.onboarding-copy {
  margin: 0 auto;
  max-width: 540px;
  text-align: center;
}

.onboarding-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.onboarding-card {
  background: rgba(245, 250, 255, 0.94);
  border: 1px solid rgba(188, 211, 237, 0.92);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(23, 47, 84, 0.1);
  display: grid;
  gap: 7px;
  padding: 15px;
  text-align: left;
}

.onboarding-step-number {
  align-items: center;
  background: rgba(37, 99, 235, 0.11);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  color: var(--brand);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.onboarding-card h3 {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.15;
  margin: 0;
}

.onboarding-card p {
  font-size: 0.94rem;
  line-height: 1.35;
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
}

.onboarding-actions button {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
  min-height: 50px;
  padding: 12px 18px;
  touch-action: manipulation;
}

.onboarding-actions .onboarding-primary-button {
  background: linear-gradient(180deg, #2389da, #064b9f);
  border-color: rgba(161, 202, 255, 0.72);
  color: #ffffff;
}

.onboarding-actions .onboarding-skip-button {
  background: transparent;
  box-shadow: none;
}

.onboarding-actions button:hover,
.onboarding-actions button:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}

.journey-section-heading-row,
.journey-path-card-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.journey-section-heading-row {
  justify-content: center;
  min-height: 34px;
}

.journey-section-heading-row h2,
.journey-path-card-header h3 {
  margin: 0;
}

.journey-detail-summary h2,
.journey-path-card h3,
.journey-difficulty-panel h2,
.settings-panel h2 {
  color: var(--ink);
  margin: 0;
}

.journey-detail-summary h2,
.journey-difficulty-panel h2,
.settings-panel h2 {
  font-size: 1.45rem;
}

.journey-detail-summary p,
.journey-path-card p,
.journey-mode-message,
.settings-panel-copy {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0;
}

.settings-layer-toggle {
  align-items: center;
  background: rgba(239, 248, 255, 0.86);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 14px;
  touch-action: manipulation;
}

.settings-preset-control {
  align-items: end;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  padding: 14px;
}

.settings-preset-label {
  color: var(--ink);
  display: grid;
  font-size: 0.86rem;
  font-weight: 900;
  gap: 6px;
}

.settings-preset-label select {
  background: #ffffff;
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-control);
  color: var(--ink);
  font: inherit;
  min-height: 46px;
  padding: 8px 10px;
}

.settings-reset-button {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  min-height: 46px;
  padding: 8px 12px;
  touch-action: manipulation;
}

.settings-feedback-link {
  align-items: center;
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-control);
  color: var(--ink);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 46px;
  padding: 8px 12px;
  text-decoration: none;
  touch-action: manipulation;
  width: fit-content;
}

.settings-reset-button:hover,
.settings-reset-button:focus-visible,
.settings-feedback-link:hover,
.settings-feedback-link:focus-visible,
.settings-preset-label select:focus-visible {
  border-color: var(--brand);
  outline: none;
}

.settings-layer-group {
  display: grid;
  gap: 10px;
}

.settings-layer-group h3 {
  color: var(--ink);
  font-size: 1rem;
  margin: 2px 0 0;
}

.settings-layer-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-menu-section,
.settings-target-region,
.settings-target-subregion {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  overflow: hidden;
}

.settings-menu-section > summary,
.settings-target-region > summary,
.settings-target-subregion > summary {
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-weight: 950;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  list-style: none;
  min-height: 58px;
  padding: 14px;
  touch-action: manipulation;
}

.settings-menu-section > summary::-webkit-details-marker,
.settings-target-region > summary::-webkit-details-marker,
.settings-target-subregion > summary::-webkit-details-marker {
  display: none;
}

.settings-menu-section > summary::before,
.settings-target-region > summary::before,
.settings-target-subregion > summary::before {
  color: var(--brand-strong);
  content: "+";
  font-weight: 950;
}

.settings-menu-section[open] > summary::before,
.settings-target-region[open] > summary::before,
.settings-target-subregion[open] > summary::before {
  content: "-";
}

.settings-menu-content,
.settings-target-hierarchy {
  display: grid;
  gap: 12px;
}

.settings-menu-content {
  padding: 0 14px 14px;
}

.settings-target-region {
  background: rgba(239, 248, 255, 0.72);
}

.settings-target-subregion {
  background: rgba(255, 255, 255, 0.7);
}

.settings-target-subregion > summary {
  min-height: 52px;
  padding: 12px 14px;
}

.settings-defaults-control {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.settings-target-group {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  overflow: hidden;
}

.settings-target-group summary {
  align-items: center;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  list-style: none;
  min-height: 58px;
  padding: 14px;
  touch-action: manipulation;
}

.settings-target-group summary::-webkit-details-marker {
  display: none;
}

.settings-target-group summary::before {
  color: var(--brand-strong);
  content: "+";
  font-weight: 950;
}

.settings-target-group[open] summary::before {
  content: "-";
}

.settings-target-group-title {
  font-size: 1rem;
  font-weight: 950;
}

.settings-target-group-count {
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 4px 8px;
  white-space: nowrap;
}

.settings-target-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
}

.settings-target-group-actions button {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  min-height: 40px;
  padding: 7px 10px;
  touch-action: manipulation;
}

.settings-target-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 320px;
  overflow-y: auto;
  padding: 0 14px 14px;
}

.settings-layer-toggle input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.settings-layer-copy {
  display: grid;
  gap: 4px;
}

.settings-layer-copy strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.settings-layer-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.3;
}

.settings-switch {
  background: #b8c7d8;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(24, 38, 64, 0.22);
  height: 34px;
  position: relative;
  width: 62px;
}

.settings-switch::after {
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(24, 38, 64, 0.28);
  content: "";
  height: 26px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 160ms ease;
  width: 26px;
}

.settings-layer-toggle input:checked + .settings-switch {
  background: var(--success);
}

.settings-layer-toggle input:checked + .settings-switch::after {
  transform: translateX(28px);
}

.settings-layer-toggle:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.journey-detail-progress {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-control);
  color: var(--success) !important;
  font-weight: 900 !important;
  padding: 10px 12px;
}

.journey-step-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  max-height: 170px;
  overflow-y: auto;
  padding-left: 22px;
}

.journey-step-list li {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.25;
}

.journey-path-actions {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.journey-path-card {
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(24, 38, 64, 0.12);
  display: grid;
  gap: 12px;
  padding: 18px;
  position: relative;
}

.journey-path-card-study {
  background: linear-gradient(180deg, #eff8ff, #dbeeff);
  border: 1px solid rgba(55, 168, 242, 0.35);
}

.journey-path-card-play {
  background: linear-gradient(180deg, #f1ffe9, #dcf8cf);
  border: 1px solid rgba(70, 172, 38, 0.32);
}

.journey-path-card-locked {
  background: linear-gradient(180deg, #fffaf0, #fff3d7);
  border: 1px solid #f0d39b;
}

.journey-path-card button:not(.info-button),
.journey-begin-button {
  border: 0;
  border-radius: var(--radius-control);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 8px 16px rgba(24, 38, 64, 0.14);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  min-height: 52px;
  padding: 12px 14px;
  touch-action: manipulation;
}

.journey-path-card-study button:not(.info-button) {
  background: linear-gradient(180deg, #37a8f2, #1260b5);
}

.journey-begin-button {
  background: linear-gradient(180deg, #74d82f, #279012);
}

.journey-path-card-play button:not(.info-button) {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.95);
  color: var(--ink);
}

.journey-path-card .journey-path-secondary-button,
.journey-path-card .journey-path-tertiary-button,
.journey-begin-secondary-button {
  background: linear-gradient(180deg, #f8fbff, #e9f1f8);
  border: 1px solid rgba(188, 211, 237, 0.95);
  box-shadow: none;
  color: var(--ink);
}

.journey-path-card .journey-path-tertiary-button {
  min-height: 44px;
  padding-block: 10px;
}

.journey-difficulty-actions {
  display: grid;
  gap: 12px;
}

.journey-path-card-locked button:not(.info-button):disabled {
  background: var(--disabled-bg);
  border: 1px solid var(--panel-border);
  box-shadow: none;
  color: var(--muted);
  cursor: not-allowed;
}

.journey-path-card button:not(.info-button):hover,
.journey-path-card button:not(.info-button):focus-visible,
.journey-begin-button:hover,
.journey-begin-button:focus-visible,
.journey-restart-button:hover,
.journey-restart-button:focus-visible {
  filter: brightness(1.06);
  outline: none;
  transform: translateY(-1px);
}

.journey-restart-button {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.9);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  justify-self: center;
  min-height: 48px;
  padding: 10px 14px;
  touch-action: manipulation;
}

.journey-difficulty-options {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.journey-difficulty-card {
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  border: 2px solid rgba(188, 211, 237, 0.9);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(24, 38, 64, 0.1);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 210px;
  padding: 14px;
  text-align: left;
  touch-action: manipulation;
}

.journey-difficulty-card:hover,
.journey-difficulty-card:focus-visible {
  border-color: var(--brand);
  outline: none;
  transform: translateY(-1px);
}

.journey-difficulty-card:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.journey-difficulty-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 10px 22px rgba(24, 38, 64, 0.14);
}

.journey-difficulty-selected-marker {
  align-self: start;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 0.75rem;
  font-weight: 950;
  justify-self: start;
  padding: 4px 9px;
  text-transform: uppercase;
}

.journey-difficulty-card.selected .journey-difficulty-selected-marker {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.journey-difficulty-card strong {
  font-size: 1.2rem;
}

.journey-difficulty-mode {
  color: var(--brand-strong);
  font-size: 0.92rem;
  font-weight: 900;
}

.journey-difficulty-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.journey-difficulty-card li {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.25;
}

.journey-placeholder-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.journey-placeholder-options button {
  background: var(--disabled-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-control);
  color: var(--muted);
  cursor: not-allowed;
  font-weight: 850;
  min-height: 50px;
  padding: 10px 12px;
}

.study-selection-panel {
  max-width: 760px;
  width: 100%;
}

.study-step-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.study-step-card {
  background: linear-gradient(180deg, #ffffff, #eef6ff);
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 66px;
  padding: 12px 14px;
  text-align: left;
}

.study-step-card strong {
  font-size: 1rem;
}

.study-step-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.study-step-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-row: span 2;
  justify-content: flex-end;
}

.study-step-actions button {
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-control);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  min-height: 42px;
  padding: 8px 13px;
  touch-action: manipulation;
}

.study-step-actions button:first-child {
  background: linear-gradient(180deg, #2c83c8, #155a9e);
}

.study-step-actions button:disabled {
  background: var(--disabled-bg);
  color: var(--muted);
  cursor: not-allowed;
}

body.study-explore-mode .answer-panel {
  max-height: 235px;
}

.study-explore-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.study-explore-controls button {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  min-height: 42px;
  padding: 8px 11px;
  touch-action: manipulation;
}

.study-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  max-width: 100%;
}

.study-target-list-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 1 auto;
  font-weight: 850;
  gap: 8px;
  justify-content: flex-start;
  min-height: 40px;
  padding: 8px 12px;
  text-align: left;
  touch-action: manipulation;
  width: auto;
  max-width: 100%;
}

.study-target-list-item.revealed {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.study-target-list-item .chip-speaker-button {
  margin: -4px -6px -4px 0;
}

.memory-trail-panel {
  display: grid;
  gap: 10px;
  width: 100%;
}

.memory-trail-status {
  background: #ffffff;
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-card);
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.memory-trail-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.memory-trail-status strong {
  font-size: 1rem;
}

.memory-trail-status p {
  margin: 0;
}

.memory-trail-prompt {
  background: #fff7cf;
  border: 1px solid rgba(215, 157, 36, 0.4);
  border-radius: var(--radius-control);
  color: #694000;
  font-weight: 950;
  padding: 8px 10px;
}

.memory-trail-controls {
  margin-bottom: 0;
}

.memory-trail-overlay {
  align-items: center;
  background: rgba(2, 6, 17, 0.46);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 112;
}

.memory-trail-overlay[hidden] {
  display: none;
}

.memory-trail-card {
  background: #ffffff;
  border: 1px solid rgba(188, 211, 237, 0.95);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 62px rgba(15, 23, 42, 0.24);
  color: var(--ink);
  display: grid;
  gap: 10px;
  max-width: 420px;
  padding: 18px;
  width: min(100%, 420px);
}

.memory-trail-card-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.memory-trail-card h2,
.memory-trail-card p {
  margin: 0;
}

.memory-trail-info-button {
  align-items: center;
  background: rgba(44, 131, 200, 0.08);
  border: 1px solid rgba(44, 131, 200, 0.22);
  border-radius: 999px;
  color: #155a9e;
  cursor: pointer;
  display: inline-grid;
  font-size: 0.85rem;
  font-weight: 950;
  height: 34px;
  justify-items: center;
  min-width: 34px;
  padding: 0;
}

.memory-trail-info-button:hover,
.memory-trail-info-button:focus-visible {
  background: rgba(44, 131, 200, 0.15);
  outline: 2px solid rgba(44, 131, 200, 0.28);
  outline-offset: 2px;
}

.memory-trail-info-copy {
  background: #eef6ff;
  border: 1px solid rgba(44, 131, 200, 0.22);
  border-radius: var(--radius-control);
  color: #25415f;
  padding: 10px 12px;
}

.memory-trail-info-copy[hidden] {
  display: none;
}

.memory-trail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.memory-trail-actions button {
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
  flex: 1 1 150px;
  font-weight: 950;
  min-height: 44px;
  padding: 10px 14px;
}

.memory-trail-actions button:first-child {
  background: linear-gradient(180deg, #2c83c8, #155a9e);
  color: #ffffff;
}

.memory-trail-actions button:last-child {
  background: #eef4fb;
  border: 1px solid rgba(188, 211, 237, 0.95);
  color: var(--ink);
}

.journey-completion-overlay {
  align-items: center;
  background: rgba(2, 6, 17, 0.62);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 110;
}

.journey-completion-overlay[hidden] {
  display: none;
}

.journey-completion-overlay.journey-celebration-overlay {
  background: rgba(9, 24, 48, 0.34);
  backdrop-filter: blur(3px) saturate(1.18);
  overflow: hidden;
}

.journey-completion-overlay.journey-celebration-overlay::before {
  background:
    radial-gradient(circle at center, rgba(255, 229, 92, 0.92) 0 6%, rgba(255, 229, 92, 0.38) 15%, transparent 42%),
    conic-gradient(from 8deg, transparent 0 6%, rgba(255, 255, 255, 0.34) 7% 9%, transparent 10% 18%, rgba(255, 217, 74, 0.32) 19% 21%, transparent 22% 100%);
  content: "";
  filter: blur(0.2px);
  height: min(92vw, 920px);
  left: 50%;
  opacity: 0.9;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 920px);
}

.journey-completion-overlay.journey-celebration-overlay::after {
  background:
    radial-gradient(circle, #fff6a8 0 28%, transparent 32%) 8% 18% / 18px 18px,
    radial-gradient(circle, #38d7ff 0 26%, transparent 30%) 18% 42% / 14px 14px,
    radial-gradient(circle, #ff8a33 0 25%, transparent 30%) 82% 22% / 16px 16px,
    radial-gradient(circle, #7ee24a 0 26%, transparent 30%) 78% 56% / 14px 14px,
    radial-gradient(circle, #ff5aba 0 25%, transparent 30%) 28% 68% / 12px 12px,
    radial-gradient(circle, #ffd21f 0 28%, transparent 32%) 92% 72% / 18px 18px;
  background-repeat: no-repeat;
  content: "";
  inset: 0;
  opacity: 0.92;
  pointer-events: none;
  position: absolute;
}

.journey-completion-card {
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid rgba(188, 211, 237, 0.92);
  border-radius: 18px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
  display: grid;
  gap: 12px;
  max-width: min(520px, 100%);
  padding: 24px;
  text-align: center;
  width: 100%;
}

.journey-completion-card.journey-celebration-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: clamp(12px, 2vw, 20px);
  max-width: min(980px, 96vw);
  padding: clamp(18px, 4vw, 42px);
  position: relative;
  z-index: 1;
}

.journey-completion-kicker {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 999px;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 950;
  justify-self: center;
  margin: 0;
  padding: 5px 12px;
  text-transform: uppercase;
}

.journey-celebration-card .journey-completion-kicker {
  background: linear-gradient(180deg, rgba(30, 58, 105, 0.96), rgba(11, 35, 72, 0.96));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 24px rgba(2, 6, 17, 0.24);
  color: #ffffff;
  font-size: clamp(0.95rem, 2.1vw, 1.45rem);
  letter-spacing: 0;
  padding: 10px 24px;
  text-transform: none;
}

.journey-completion-card h2 {
  color: var(--ink);
  font-size: 2.2rem;
  line-height: 1;
  margin: 0;
}

.journey-celebration-card h2 {
  -webkit-text-stroke: clamp(2px, 0.55vw, 5px) #fff7dc;
  background: linear-gradient(180deg, #fff65a 0%, #ffc928 36%, #f39012 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 0 #b94a08) drop-shadow(0 18px 18px rgba(2, 6, 17, 0.32));
  font-size: clamp(4.2rem, 13vw, 10rem);
  line-height: 0.84;
  text-transform: uppercase;
}

.journey-completion-card p {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 750;
  margin: 0;
}

.journey-celebration-card p {
  color: #ffffff;
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  text-shadow: 0 2px 8px rgba(2, 6, 17, 0.62);
}

.journey-completion-next {
  color: var(--brand-strong) !important;
  font-weight: 900 !important;
}

.journey-celebration-card .journey-completion-next {
  align-items: center;
  background: linear-gradient(180deg, rgba(30, 58, 105, 0.94), rgba(10, 31, 66, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 18px 34px rgba(2, 6, 17, 0.28);
  color: #ffffff !important;
  display: inline-flex;
  font-size: clamp(1.15rem, 3vw, 2rem);
  justify-self: center;
  max-width: min(760px, 92vw);
  min-height: 68px;
  padding: 14px 28px;
}

.journey-completion-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 6px;
}

.journey-completion-actions button {
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-weight: 900;
  min-height: 52px;
  padding: 12px 14px;
  touch-action: manipulation;
}

#journey-completion-primary {
  background: linear-gradient(180deg, #74d82f, #279012);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 8px 16px rgba(24, 38, 64, 0.14);
  color: #ffffff;
}

#journey-completion-secondary {
  background: linear-gradient(180deg, #eef4fb, #d7e3f0);
  border: 1px solid rgba(188, 211, 237, 0.9);
  color: var(--ink);
}

.journey-completion-actions button:hover,
.journey-completion-actions button:focus-visible {
  filter: brightness(1.06);
  outline: none;
  transform: translateY(-1px);
}

.journey-completion-actions button:disabled {
  cursor: wait;
  filter: saturate(0.8);
  opacity: 0.72;
  transform: none;
}

.activity-retry-overlay {
  align-items: center;
  background: rgba(2, 6, 17, 0.42);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 108;
}

.activity-retry-overlay[hidden] {
  display: none;
}

.activity-retry-card {
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid rgba(188, 211, 237, 0.92);
  border-radius: 18px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 10px;
  max-width: min(520px, 100%);
  padding: 24px;
  text-align: center;
  width: 100%;
}

.activity-retry-kicker {
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: 999px;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 950;
  justify-self: center;
  margin: 0;
  padding: 5px 12px;
  text-transform: uppercase;
}

.activity-retry-card h2 {
  color: var(--ink);
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1;
  margin: 0;
}

.activity-retry-card p {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 750;
  margin: 0;
}

.activity-retry-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.activity-retry-actions button {
  min-height: 48px;
}

.activity-retry-actions button:first-child {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  border-color: transparent;
  color: #ffffff;
}

.activity-retry-actions button:last-child {
  background: #ffffff;
  border-color: rgba(188, 211, 237, 0.95);
  color: var(--brand-strong);
}

.poc-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(213, 221, 232, 0.85);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 12px 36px rgba(9, 22, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 78px;
  padding: 14px 20px;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.top-bar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
}

.top-bar-side {
  align-items: center;
  display: flex;
  gap: 10px;
}

.top-bar-left {
  justify-content: flex-start;
}

.top-bar-right {
  justify-content: flex-end;
}

.top-bar-button {
  background: var(--panel-bg);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 760;
  min-height: 44px;
  padding: 9px 15px;
  box-shadow: 0 5px 14px rgba(24, 38, 64, 0.08);
}

.settings-button {
  font-size: 0;
  width: 44px;
}

.settings-button::before {
  content: "\2699";
  font-size: 1rem;
}

.audio-mute-button {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.audio-mute-button.muted {
  background: #f1f5f9;
  color: #64748b;
}

.audio-mute-icon {
  display: inline-block;
  height: 18px;
  position: relative;
  width: 20px;
}

.audio-mute-icon::before {
  background: currentColor;
  clip-path: polygon(0 35%, 35% 35%, 78% 4%, 78% 96%, 35% 65%, 0 65%);
  content: "";
  height: 16px;
  left: 1px;
  position: absolute;
  top: 1px;
  width: 15px;
}

.audio-mute-icon::after {
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  content: "";
  height: 10px;
  left: 13px;
  position: absolute;
  top: 4px;
  width: 6px;
}

.audio-mute-button.muted .audio-mute-icon::after {
  background: currentColor;
  border: 0;
  border-radius: 999px;
  height: 22px;
  left: 10px;
  top: -2px;
  transform: rotate(-38deg);
  width: 3px;
}

.reset-button {
  border-color: rgba(239, 68, 68, 0.34);
  color: #9f1239;
}

.reset-button:hover,
.reset-button:focus-visible {
  border-color: rgba(220, 38, 38, 0.72);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14), 0 5px 14px rgba(24, 38, 64, 0.08);
}

.reset-button[hidden] {
  display: none;
}

.top-bar-button:hover,
.top-bar-button:focus-visible,
.top-bar-button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.top-bar-button:disabled {
  cursor: default;
  opacity: 0.54;
}

.header-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.poc-header h1 {
  color: var(--ink);
  font-size: clamp(1.45rem, 2vw, 2.05rem);
  letter-spacing: 0;
  margin: 0;
}

.poc-header p {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
}

.poc-nav {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.poc-nav-dev {
  display: none;
}

.activity-nav-controls {
  align-items: center;
  display: none;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  min-height: 44px;
}

.activity-nav-controls[hidden] {
  display: none;
}

.poc-header .activity-nav-controls {
  display: none !important;
}

.poc-nav a,
.poc-nav button,
.header-map-set-tabs button,
.activity-nav-controls button,
.activity-card,
.progress-actions button {
  background: var(--panel-bg);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 12px;
  text-decoration: none;
}

.poc-nav a:hover,
.poc-nav button:hover,
.region-list button:hover,
.progress-actions button:hover,
.header-map-set-tabs button:hover,
.header-map-set-tabs button:focus-visible,
.study-mode-toggle button:hover,
.study-mode-toggle button:focus-visible,
.difficulty-toggle button:hover,
.difficulty-toggle button:focus-visible,
.label-chip:hover,
.label-chip:focus-visible,
.zoom-panel button:hover,
.zoom-panel button:focus-visible,
.activity-nav-controls button:hover,
.activity-nav-controls button:focus-visible,
.progress-actions button:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.poc-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.poc-main {
  min-height: 100vh;
  position: relative;
}

.map-shell {
  background: var(--map-ocean);
  height: calc(100vh - 136px);
  min-height: 520px;
  position: relative;
  padding-top: 78px;
}

body.overview-mode .map-shell {
  height: calc(100vh - 136px);
  min-height: 520px;
}

body.study-mode .map-shell {
  height: calc(100vh - 154px);
  min-height: 500px;
}

#map {
  height: 100%;
  width: 100%;
}

#map canvas {
  outline: none;
}

.audio-instruction-banner {
  background: rgba(248, 251, 255, 0.94);
  border: 1px solid rgba(183, 207, 248, 0.84);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(9, 22, 42, 0.16);
  color: #12345f;
  font-size: 0.95rem;
  font-weight: 850;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: 96px;
  transform: translateX(-50%);
  z-index: 16;
}

.audio-instruction-banner[hidden] {
  display: none;
}

.map-overlay-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(24, 38, 64, 0.12);
  display: grid;
  gap: 2px;
  left: 16px;
  padding: 10px 12px;
  position: absolute;
  top: 94px;
  z-index: 2;
}

.map-overlay-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.map-overlay-card[hidden] {
  display: none;
}

.zoom-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.zoom-panel button {
  background: var(--panel-bg);
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 800;
  height: 44px;
  min-height: 44px;
  padding: 0;
  width: 44px;
}

.zoom-panel button:last-child {
  font-size: 0.68rem;
  line-height: 1;
}

.region-panel {
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid var(--panel-border);
  border-top: 0;
  bottom: 16px;
  box-shadow: -18px 0 34px rgba(24, 38, 64, 0.16);
  gap: 18px;
  max-width: min(430px, calc(100vw - 28px));
  overflow-y: auto;
  padding: 20px 24px 28px;
  position: fixed;
  right: 16px;
  top: 96px;
  transform: translateX(104%);
  transition: transform 180ms ease;
  width: 430px;
  z-index: 12;
  border-radius: var(--radius-panel);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.browse-drawer-open .region-panel {
  transform: translateX(0);
}

.drawer-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.region-panel-intro h2,
.region-panel-intro p {
  margin: 0;
}

.region-panel-intro p {
  color: var(--muted);
  margin-top: 4px;
}

.activity-count {
  color: var(--brand-strong);
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 10px;
}

.library-panel {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.header-map-set-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.header-map-set-tab {
  background: var(--panel-bg-soft);
}

.header-map-set-tab.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  color: var(--brand-strong);
}

.activity-groups {
  display: grid;
  gap: 18px;
}

.activity-group {
  display: grid;
  gap: 12px;
}

.activity-group-heading {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.activity-group-heading h3,
.activity-group-heading span {
  margin: 0;
}

.activity-group-heading span {
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.activity-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.activity-group-stack,
.activity-subgroup-stack {
  display: grid;
  gap: 16px;
}

.activity-subgroup {
  display: grid;
  gap: 12px;
}

.activity-subgroup-heading {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.activity-subgroup-heading h4 {
  color: var(--ink);
  font-size: 0.98rem;
  margin: 0;
}

.activity-card {
  background: var(--panel-bg-soft);
  border-radius: var(--radius-control);
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 18px 24px 22px;
  text-align: left;
}

.activity-card strong {
  font-size: 1rem;
}

.activity-card p {
  color: var(--muted);
  margin: 0;
}

.activity-card.active,
.activity-card:hover,
.activity-card:focus-visible {
  background: var(--panel-bg-hover);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 10px 24px rgba(24, 38, 64, 0.08);
  outline: none;
}

.activity-card.activity-card-disabled,
.activity-card.activity-card-disabled:hover,
.activity-card.activity-card-disabled:focus-visible {
  background: var(--disabled-bg);
  border-color: var(--panel-border);
  box-shadow: none;
  color: var(--muted-strong);
  cursor: not-allowed;
}

.activity-card-topline,
.activity-card-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.84rem;
  gap: 8px;
}

.activity-card-category {
  color: var(--brand-strong);
  font-weight: 800;
}

.activity-card-count,
.activity-card-meta span {
  font-weight: 700;
}

.activity-card-progress {
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: 999px;
  color: var(--brand-strong);
  font-weight: 800;
  padding: 2px 8px;
}

.activity-card-progress.complete {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.activity-card-resume {
  color: var(--brand-strong);
  font-size: 0.88rem;
  font-weight: 800;
}

@media (min-width: 980px) {
  body.overview-mode {
    overflow: hidden;
  }

  body.overview-mode .poc-main {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body.overview-mode .map-shell {
    height: calc(100vh - 136px);
    min-height: 0;
  }
}

body.study-mode .region-panel {
  top: 96px;
}

.answer-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(213, 221, 232, 0.82);
  border-radius: 22px 22px 0 0;
  bottom: 0;
  box-shadow: 0 -14px 42px rgba(9, 22, 42, 0.2);
  display: none;
  left: 0;
  max-height: 154px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 28px 18px;
  position: fixed;
  right: 0;
  overscroll-behavior: contain;
  z-index: 10;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body.study-mode .answer-panel {
  display: block;
}

body.browse-mode .answer-panel {
  display: block;
  max-height: 136px;
}

body.browse-mode .status-row {
  align-items: center;
  margin-bottom: 8px;
}

body.browse-mode .answer-panel-title {
  min-width: 0;
}

.status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 8px;
  min-width: 0;
}

.status-row h2,
.status-row p {
  margin: 0;
}

.status-row h2 {
  font-size: 1.05rem;
  line-height: 1.1;
}

.answer-panel-title {
  min-width: 150px;
}

.control-group {
  display: grid;
  gap: 6px;
}

.control-group[hidden] {
  display: none;
}

.control-label {
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress-control-group {
  margin-left: auto;
}

.progress-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.progress-actions strong {
  color: var(--muted);
  line-height: 1.2;
}

.progress-actions button {
  background: var(--panel-bg-soft);
  color: var(--muted);
}

.feedback {
  color: var(--danger);
  font-weight: 800;
  min-height: 22px;
}

.feedback.success {
  color: var(--success);
}

.study-mode-toggle,
.difficulty-toggle {
  background: var(--control-bg);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.difficulty-toggle[hidden] {
  display: none;
}

.study-mode-toggle button,
.difficulty-toggle button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 10px;
}

.study-mode-toggle button.active,
.difficulty-toggle button.active {
  background: var(--panel-bg);
  border-color: var(--control-border);
  box-shadow: 0 4px 10px rgba(24, 38, 64, 0.08);
  color: var(--brand-strong);
}

.answer-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  max-width: 100%;
}

.label-chip {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--control-border);
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(24, 38, 64, 0.06);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  font-weight: 700;
  justify-content: center;
  line-height: 1.1;
  max-width: min(280px, 100%);
  min-height: 44px;
  min-width: 92px;
  padding: 11px 18px;
  text-align: center;
  touch-action: manipulation;
  user-select: none;
}

.chip-label-text {
  overflow-wrap: anywhere;
}

.chip-speaker-button {
  align-items: center;
  border-radius: 999px;
  color: rgba(37, 51, 78, 0.68);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  margin: -6px -9px -6px 0;
  touch-action: manipulation;
  width: 30px;
}

.chip-speaker-button:hover,
.chip-speaker-button:focus-visible {
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-strong);
  outline: none;
}

.chip-speaker-button svg {
  height: 17px;
  width: 17px;
}

.chip-speaker-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.label-chip.selected {
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16), 0 6px 14px rgba(24, 38, 64, 0.08);
  color: var(--brand-strong);
}

.navigation-chip {
  min-width: 150px;
}

.mobile-browse-chip {
  display: none;
}

.free-play-selected-card {
  align-items: center;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(24, 38, 64, 0.08);
  display: flex;
  flex: 1 1 360px;
  gap: 14px;
  justify-content: space-between;
  max-width: min(620px, 100%);
  min-height: 58px;
  padding: 10px 12px 10px 14px;
}

.free-play-country-card {
  align-items: flex-start;
}

.free-play-country-flag {
  flex: 0 0 auto;
  font-size: 2.15rem;
  line-height: 1;
  margin-top: 3px;
}

.free-play-selected-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.free-play-country-copy {
  flex: 1 1 auto;
  gap: 4px;
}

.free-play-selected-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.free-play-selected-name {
  color: var(--brand-strong);
  font-size: 1rem;
  line-height: 1.1;
}

.free-play-selected-name-row {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.free-play-selected-speaker {
  height: 28px;
  margin: -4px 0;
  width: 28px;
}

.free-play-selected-path {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.free-play-country-audio-row,
.free-play-country-facts {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.free-play-country-facts {
  font-weight: 600;
}

.free-play-selected-clear {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--control-border);
  border-radius: 999px;
  color: var(--brand-strong);
  cursor: pointer;
  flex: 0 0 auto;
  font-weight: 800;
  min-height: 38px;
  padding: 8px 12px;
}

.floating-label-chip {
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-radius: var(--radius-control);
  box-shadow: 0 14px 28px rgba(24, 38, 64, 0.22);
  color: var(--brand-strong);
  font-weight: 800;
  left: 0;
  max-width: min(260px, calc(100vw - 32px));
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  top: 0;
  white-space: nowrap;
  z-index: 30;
}

.floating-label-chip[hidden] {
  display: none;
}

.label-chip.used {
  opacity: 0.36;
}

.maplibregl-popup-content {
  border-radius: var(--radius-control);
  color: var(--ink);
  font-weight: 700;
}

.maplibregl-ctrl-top-right {
  display: none;
}

@media (max-width: 760px), (max-width: 900px) and (max-height: 520px) {
  body {
    overflow: hidden;
    --mobile-header-height: 50px;
    --mobile-sheet-height: 112px;
    --mobile-safe-bottom: max(env(safe-area-inset-bottom), 12px);
    --mobile-browser-chrome-clearance: 18px;
    --mobile-chip-tray-bottom: calc(var(--mobile-safe-bottom) + var(--mobile-browser-chrome-clearance));
    --mobile-chip-tray-map-clearance: 36px;
    --mobile-chip-tray-max-height: 96px;
  }

  body.study-explore-mode {
    --mobile-chip-tray-map-clearance: 20px;
    --mobile-chip-tray-max-height: min(25svh, 212px);
  }

  body.launch-mode {
    overflow: hidden;
  }

  body.app-shell-mode {
    overflow: hidden;
  }

  .launch-screen {
    align-content: center;
    padding: 16px;
  }

  .app-shell-screen {
    padding: 16px;
  }

  .app-shell-screen:has(.onboarding-panel) {
    align-items: start;
    height: 100dvh;
    min-height: 100svh;
    padding: 16px 16px calc(132px + max(env(safe-area-inset-bottom), 16px));
    scroll-padding-bottom: calc(132px + max(env(safe-area-inset-bottom), 16px));
  }

  .app-shell-panel {
    border-radius: 20px;
    gap: 14px;
    padding: 22px 16px;
  }

  .app-shell-screen:has(.onboarding-panel) .app-shell-panel {
    margin: 0 auto;
  }

  .app-shell-panel h1 {
    font-size: 2.15rem;
  }

  .app-shell-panel p {
    font-size: 0.95rem;
  }

  .quick-start-card {
    border-radius: 18px;
    gap: 6px;
    max-width: 360px;
    min-height: 138px;
    padding: 18px 52px 18px 18px;
  }

  .quick-start-row {
    max-width: 408px;
  }

  .quick-start-title {
    font-size: 1.55rem;
  }

  .quick-start-detail,
  .quick-start-meta {
    font-size: 0.92rem;
  }

  .quick-start-action {
    font-size: 0.9rem;
    min-height: 42px;
    padding: 10px 18px;
  }

  .app-shell-corner-button {
    left: 14px;
    min-height: 44px;
    padding: 9px 12px;
    top: 14px;
  }

  .main-menu-actions {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .info-button {
    height: 40px;
    min-width: 40px;
  }

  .onboarding-card-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-card {
    padding: 14px;
  }

  .onboarding-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: calc(24px + env(safe-area-inset-bottom));
    position: sticky;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 2;
  }

  .onboarding-actions button {
    min-height: 48px;
  }

  .journey-preset-list {
    max-width: 420px;
  }

  .journey-preset-section-grid {
    grid-template-columns: 1fr;
  }

  .journey-preset-card {
    min-height: auto;
  }

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

  .journey-path-actions,
  .journey-difficulty-options,
  .journey-placeholder-options,
  .settings-preset-control,
  .settings-layer-grid,
  .settings-target-grid,
  .settings-defaults-control {
    grid-template-columns: 1fr;
  }

  .study-step-card {
    grid-template-columns: 1fr;
  }

  .study-step-actions {
    justify-content: stretch;
  }

  .study-step-actions button {
    flex: 1 1 120px;
  }

  .journey-difficulty-card {
    min-height: auto;
  }

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

  .main-menu-button {
    font-size: 0.95rem;
    min-height: 62px;
    padding: 12px 14px;
  }

  .launch-content {
    gap: 16px;
    max-width: 420px;
    padding: 12px 8px;
  }

  .launch-kicker {
    font-size: 0.72rem;
    padding: 6px 12px;
  }

  .launch-compass {
    width: clamp(118px, 34vw, 154px);
  }

  .launch-title-lockup h1 {
    font-size: clamp(3.25rem, 14vw, 4.35rem);
  }

  .launch-subtitle {
    font-size: 1rem;
    max-width: 340px;
  }

  .launch-button-primary {
    border-radius: 18px;
    font-size: 1.75rem;
    min-height: 74px;
    width: min(360px, 94vw);
  }

  .launch-button-icon {
    height: 38px;
    width: 38px;
  }

  .launch-button-icon::before {
    border-bottom-width: 9px;
    border-left-width: 16px;
    border-top-width: 9px;
    left: 13px;
    top: 8px;
  }

  .launch-gear-button {
    height: 48px;
    right: 14px;
    top: 14px;
    width: 48px;
  }

  .launch-gear-button::before {
    font-size: 1.5rem;
  }

  .poc-header {
    background: rgba(248, 251, 255, 0.46);
    display: grid;
    border-radius: 0 0 12px 12px;
    border-color: rgba(255, 255, 255, 0.58);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      0 10px 28px rgba(8, 20, 38, 0.14);
    min-height: auto;
    padding: calc(4px + env(safe-area-inset-top)) 10px 4px;
    -webkit-backdrop-filter: blur(16px) saturate(1.18);
    backdrop-filter: blur(16px) saturate(1.18);
  }

  .top-bar {
    gap: 8px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 42px;
  }

  .top-bar-side {
    gap: 0;
    min-width: 0;
  }

  .top-bar-left {
    align-items: center;
    flex-direction: row;
  }

  .top-bar-right {
    gap: 6px;
    justify-content: flex-end;
  }

  #home-button,
  #browse-button {
    display: none;
  }

  .top-bar-button {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(240, 247, 255, 0.34));
    border-color: rgba(255, 255, 255, 0.46);
    border-radius: 999px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 7px 18px rgba(8, 20, 38, 0.14);
    color: rgba(15, 23, 42, 0.96);
    min-height: 40px;
    min-width: 40px;
    padding-inline: 10px;
    -webkit-backdrop-filter: blur(12px) saturate(1.16);
    backdrop-filter: blur(12px) saturate(1.16);
  }

  #back-button {
    font-size: 0;
    padding: 0;
    width: 40px;
  }

  #back-button::before {
    content: "<";
    font-size: 1.2rem;
    font-weight: 950;
  }

  .settings-button {
    width: 40px;
  }

  .audio-mute-button {
    gap: 0;
    padding-inline: 0;
    width: 40px;
  }

  .audio-mute-label {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .reset-button {
    font-size: 0.78rem;
    font-weight: 900;
    min-width: 58px;
    padding-inline: 10px;
  }

  .header-copy {
    gap: 0;
    overflow: hidden;
    place-items: center;
  }

  .poc-header p {
    display: none;
  }

  .poc-header h1 {
    font-size: 0.95rem;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .poc-nav {
    overflow-x: auto;
  }

  .activity-nav-controls {
    flex-wrap: wrap;
  }

  .map-shell,
  body.study-mode .map-shell {
    height: 100dvh;
    min-height: 0;
    padding-bottom: calc(var(--mobile-chip-tray-bottom) + var(--mobile-chip-tray-map-clearance));
    padding-top: var(--mobile-header-height);
  }

  body.overview-mode .map-shell {
    height: 100dvh;
    min-height: 0;
  }

  .audio-instruction-banner {
    font-size: 0.86rem;
    left: 10px;
    max-width: calc(100vw - 20px);
    padding: 8px 12px;
    right: 10px;
    top: calc(var(--mobile-header-height) + 8px);
    transform: none;
  }

  .region-panel {
    border-left: 0;
    border-radius: 18px 18px 0 0;
    bottom: 0;
    box-shadow: 0 -18px 34px rgba(24, 38, 64, 0.18);
    max-height: min(78svh, 620px);
    max-width: 100vw;
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
    top: auto;
    transform: translateY(104%);
    width: 100vw;
    z-index: 24;
  }

  body.browse-drawer-open .region-panel {
    transform: translateY(0);
  }

  body.browse-drawer-open .answer-panel {
    visibility: hidden;
  }

  body.study-mode .region-panel {
    display: none;
  }

  .activity-card-grid {
    grid-template-columns: 1fr;
  }

  .map-overlay-card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(236, 246, 255, 0.26));
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 16px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      inset 0 -1px 0 rgba(255, 255, 255, 0.34),
      0 14px 30px rgba(5, 17, 36, 0.18);
    color: rgba(15, 23, 42, 0.98);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
    backdrop-filter: blur(18px) saturate(1.18);
  }

  .map-overlay-card span {
    color: rgba(51, 65, 85, 0.95);
  }

  .zoom-panel {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(238, 246, 255, 0.28));
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: 999px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.78),
      0 14px 30px rgba(8, 20, 38, 0.2);
    bottom: calc(var(--mobile-chip-tray-max-height) + var(--mobile-chip-tray-bottom) + 8px);
    flex-direction: row;
    right: 10px;
    top: auto;
    transform: none;
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
    backdrop-filter: blur(18px) saturate(1.18);
  }

  .zoom-panel button {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(240, 247, 255, 0.36));
    border-color: rgba(255, 255, 255, 0.48);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      0 4px 10px rgba(8, 20, 38, 0.1);
    color: rgba(15, 23, 42, 0.96);
  }

  .answer-panel {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(236, 246, 255, 0.26));
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: 22px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      inset 0 -1px 0 rgba(255, 255, 255, 0.36),
      0 18px 42px rgba(5, 17, 36, 0.24);
    bottom: var(--mobile-chip-tray-bottom);
    height: auto;
    left: 10px;
    max-height: var(--mobile-chip-tray-max-height);
    padding: 8px 10px 10px;
    right: 10px;
    z-index: 18;
    -webkit-backdrop-filter: blur(22px) saturate(1.24);
    backdrop-filter: blur(22px) saturate(1.24);
  }

  body.study-mode .answer-panel {
    overflow: hidden;
  }

  body.study-explore-mode .answer-panel {
    max-height: var(--mobile-chip-tray-max-height);
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .answer-bank {
    flex-wrap: nowrap;
    min-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-padding: 14px;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  body.study-explore-mode .answer-bank {
    display: grid;
    gap: 8px;
    max-height: calc(var(--mobile-chip-tray-max-height) - 20px);
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
    scroll-snap-type: none;
    touch-action: auto;
  }

  body.study-explore-mode .study-explore-controls {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    margin-bottom: 0;
  }

  body.study-explore-mode .study-explore-controls button {
    border-radius: 14px;
    font-size: 0;
    min-height: 52px;
    padding: 8px 10px;
  }

  body.study-explore-mode .study-explore-controls button::after {
    content: attr(data-mobile-label);
    font-size: 0.95rem;
    font-weight: 950;
  }

  body.study-explore-mode .study-target-list {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: calc(var(--mobile-chip-tray-max-height) - 76px);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 2px 2px;
    -webkit-overflow-scrolling: touch;
  }

  body.study-explore-mode .study-target-list-item {
    border-radius: 14px;
    font-size: 0.82rem;
    gap: 6px;
    justify-content: space-between;
    line-height: 1.1;
    max-width: none;
    min-height: 48px;
    min-width: 0;
    padding: 6px 8px 6px 10px;
    width: 100%;
  }

  body.study-explore-mode .study-target-list-item .chip-speaker-button {
    height: 40px;
    margin: -6px -6px -6px 0;
    min-height: 40px;
    min-width: 40px;
    width: 40px;
  }

  .label-chip {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(245, 249, 255, 0.3));
    border-color: rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      0 6px 16px rgba(6, 20, 44, 0.12);
    color: rgba(15, 23, 42, 0.97);
    flex: 0 0 auto;
    max-width: min(68vw, 260px);
    min-height: 44px;
    min-width: 120px;
    padding: 8px 12px;
    scroll-snap-align: start;
    -webkit-backdrop-filter: blur(12px) saturate(1.12);
    backdrop-filter: blur(12px) saturate(1.12);
  }

  .chip-speaker-button {
    height: 42px;
    margin: -8px -10px -8px 0;
    min-height: 42px;
    min-width: 42px;
    width: 42px;
  }

  .chip-speaker-button svg {
    height: 17px;
    width: 17px;
  }

  .label-chip.selected {
    background:
      linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(219, 234, 254, 0.5));
    border-color: rgba(37, 99, 235, 0.78);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      0 0 0 3px rgba(37, 99, 235, 0.18),
      0 8px 20px rgba(30, 64, 175, 0.18);
    color: var(--brand-strong);
  }

  .label-chip.selected::after {
    color: var(--brand-strong);
    content: "Tap map";
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 900;
    margin-left: 2px;
    text-transform: uppercase;
  }

  .mobile-browse-chip {
    background: var(--brand-soft);
    border-color: var(--brand-soft-border);
    color: var(--brand-strong);
    display: inline-flex;
    min-width: 112px;
  }

  body.study-mode .mobile-browse-chip {
    display: none;
  }

  .status-row {
    align-items: center;
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 4px;
  }

  .answer-panel-title {
    min-width: 0;
    overflow: hidden;
  }

  .answer-panel-title h2,
  .feedback,
  .progress-actions strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .answer-panel-title h2 {
    font-size: 0.9rem;
  }

  body.study-mode .answer-panel-title h2 {
    display: none;
  }

  .feedback {
    font-size: 0.76rem;
    min-height: 0;
  }

  .control-label {
    display: none;
  }

  .progress-actions {
    gap: 6px;
  }

  .progress-actions strong {
    background: rgba(239, 246, 255, 0.48);
    border: 1px solid rgba(147, 197, 253, 0.58);
    border-radius: 999px;
    color: var(--brand-strong);
    font-size: 0.78rem;
    font-weight: 900;
    padding: 4px 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  }

  .progress-actions button {
    background: rgba(255, 255, 255, 0.34);
    border-color: rgba(148, 163, 184, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: rgba(71, 85, 105, 0.88);
    font-size: 0.78rem;
    min-height: 28px;
    padding: 4px 8px;
  }

  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .poc-header {
      background: rgba(248, 251, 255, 0.94);
    }

    .answer-panel,
    .zoom-panel,
    .map-overlay-card {
      background: rgba(248, 251, 255, 0.86);
    }

    .label-chip,
    .top-bar-button,
    .zoom-panel button {
      background: rgba(255, 255, 255, 0.88);
    }
  }

  .study-mode-toggle,
  .difficulty-toggle {
    max-width: 100%;
    overflow-x: auto;
  }

  .progress-control-group {
    margin-left: 0;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .chip-speaker-button {
    height: 42px;
    margin: -8px -10px -8px 0;
    min-height: 42px;
    min-width: 42px;
    width: 42px;
  }

  .chip-speaker-button svg {
    height: 17px;
    width: 17px;
  }
}

@media (max-width: 900px) and (max-height: 520px) {
  body {
    --mobile-header-height: 44px;
    --mobile-sheet-height: 82px;
    --mobile-chip-tray-map-clearance: 24px;
    --mobile-chip-tray-max-height: 82px;
  }

  .poc-header {
    padding: calc(2px + env(safe-area-inset-top)) 10px 2px;
  }

  .top-bar {
    min-height: 38px;
  }

  .top-bar-button {
    min-height: 36px;
    min-width: 36px;
  }

  .settings-button,
  .audio-mute-button,
  #back-button {
    width: 36px;
  }

  .answer-panel {
    padding: 6px 8px 8px;
  }

  .status-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin-bottom: 4px;
  }

  .label-chip {
    min-height: 44px;
    min-width: 112px;
    padding-block: 8px;
  }

  .chip-speaker-button {
    height: 40px;
    margin-block: -6px;
    min-height: 40px;
    min-width: 40px;
    width: 40px;
  }

  .region-panel {
    max-height: calc(100svh - var(--mobile-header-height));
  }
}
