/* ===================================================
   miralo — Apple-native design system (iOS 26 style)
   =================================================== */

:root {
  --safe-top-fallback: 0px;
  --safe-bottom-fallback: 0px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-top-fallback));
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-bottom-fallback));
  --safe-left: env(safe-area-inset-left, 0px);

  --touch-min: 44px;

  /* Apple Semantic Colors — Light */
  --color-bg: #f2f2f7;
  --color-bg-secondary: #ffffff;
  --color-separator: rgba(60, 60, 67, 0.18);
  --color-fill: rgba(120, 120, 128, 0.12);
  --color-fill-secondary: rgba(120, 120, 128, 0.08);

  --color-text-primary: #000000;
  --color-text-secondary: rgba(60, 60, 67, 0.6);
  --color-text-tertiary: rgba(60, 60, 67, 0.3);

  --color-accent: #111111;
  --color-accent-active: #000000;
  --color-accent-bg: rgba(17, 17, 17, 0.12);

  /* Radii */
  --radius-card: 20px;
  --radius-button: 12px;
  --radius-option: 12px;
  --radius-pill: 999px;

  /* Panel glass — only for .panel containers */
  --glass-blur: 20px;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.08);

  --ring-focus: 0 0 0 4px rgba(0, 122, 255, 0.3);

  /* Motion — Apple spring approximation */
  --motion-fast: 100ms;
  --motion-base: 200ms;
  --motion-spring: 350ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* --- Reset --- */

* {
  box-sizing: border-box;
}

*:focus {
  outline: none;
}


/* --- Base --- */

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  width: 100%;
  overflow-x: clip;
  overscroll-behavior: none;
  font-family: -apple-system, "SF Pro Text", "SF Pro Display", "Hiragino Sans", "Yu Gothic", BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--color-bg);
  display: flex;
  justify-content: center;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  overscroll-behavior: none;
  padding:
    calc(var(--safe-top) + 10px)
    calc(var(--safe-right) + 16px)
    calc(var(--safe-bottom) + 12px)
    calc(var(--safe-left) + 16px);
}


/* --- App Shell --- */

.app-shell {
  position: relative;
  width: min(980px, 100%);
  height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 22px);
  min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 22px);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 22px);
  display: grid;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  scroll-padding-top: calc(var(--safe-top) + 8px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.app-shell::-webkit-scrollbar {
  display: none;
}


/* --- Scene glow (subtle bg tint) --- */

.scene-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 90% 5%, rgba(17, 17, 17, 0.05), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(17, 17, 17, 0.03), transparent 40%);
}


/* --- Z-index layers --- */

.masthead,
.panel,
.toast {
  position: relative;
  z-index: 1;
}


/* --- Masthead (transparent nav bar) --- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.masthead-brand {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
}

.masthead-mainline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo-chip {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
}


/* --- Header back button (Apple text-link style) --- */

.header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  color: var(--color-accent);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.header-back:hover {
  opacity: 0.7;
}

.header-back:active {
  opacity: 0.4;
  transition-duration: 60ms;
}


/* --- Header context (step indicator) --- */

.header-context {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  white-space: nowrap;
}


/* --- Panel (glass container — ONLY element with blur) --- */

.panel {
  border-radius: var(--radius-card);
  border: 1px solid var(--glass-border);
  padding: clamp(20px, 4vw, 28px);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: var(--shadow-panel);
  animation: panel-in var(--motion-spring) var(--ease-spring);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* --- Hero panel (welcome) --- */

.hero-panel {
  overflow: hidden;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.atmo-disc {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
}

.atmo-disc-a {
  width: 260px;
  height: 260px;
  right: -80px;
  top: -100px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.15), transparent 70%);
}

.atmo-disc-b {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: -100px;
  background: radial-gradient(circle, rgba(88, 86, 214, 0.1), transparent 70%);
}

.atmo-disc-c {
  width: 160px;
  height: 160px;
  right: 24%;
  top: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5), transparent 70%);
}


/* --- Typography --- */

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lead,
p {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.53;
}

.store-cta-note {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-tertiary);
}


/* --- Progress --- */

.progress {
  margin: 0;
  color: var(--color-text-tertiary);
  font-size: 13px;
  font-weight: 600;
}

.progress-track,
.mini-progress-track {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  margin: 8px 0 16px;
  background: var(--color-fill);
  border: none;
  overflow: hidden;
}

.progress-fill,
.mini-progress-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  transition: width var(--motion-base) var(--ease-standard);
}


/* --- Question panel transitions --- */

.question-panel {
  transform-origin: 50% 30%;
}

.question-panel.question-enter {
  animation: question-enter 380ms var(--ease-spring);
}

.question-panel.question-exit {
  animation: question-exit 200ms ease-in forwards;
  pointer-events: none;
}

@keyframes question-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes question-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.question-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.question-footer {
  margin-top: 8px;
}

.question-footer.actions.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.question-footer .btn:first-child {
  justify-self: start;
}

.question-footer .btn:last-child {
  justify-self: end;
}


/* --- Layout helpers --- */

.stack {
  display: grid;
  gap: 8px;
}

.actions {
  margin-top: 14px;
}

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


/* --- Interactive base transition --- */

.btn,
.option,
.tag {
  font: inherit;
  border: none;
  cursor: pointer;
  transition: opacity var(--motion-fast) var(--ease-standard),
              background var(--motion-fast) var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
}

.foot-links a,
.header-back {
  -webkit-tap-highlight-color: transparent;
}


/* --- Buttons (Apple native style) --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: var(--radius-button);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  border: none;
  background: var(--color-fill);
  color: var(--color-text-primary);
  backdrop-filter: none;
  box-shadow: none;
}

.btn:hover {
  opacity: 0.85;
}

.btn:active {
  opacity: 0.6;
  transition-duration: 60ms;
}

.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
  opacity: 0.35;
  pointer-events: none;
}

.btn.compact {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 600;
}


/* Primary button — solid accent */

.btn.primary {
  color: #ffffff;
  background: var(--color-accent);
  box-shadow: none;
}

.btn.primary:hover {
  opacity: 0.88;
}

.btn.primary:active {
  background: var(--color-accent-active);
  opacity: 0.8;
}


/* Secondary button — tinted */

.btn.secondary,
.question-skip-btn {
  color: var(--color-accent);
  background: var(--color-accent-bg);
}


/* Ghost button — text only */

.btn.ghost,
.question-back-btn {
  color: var(--color-accent);
  background: transparent;
}

.btn.ghost:hover,
.question-back-btn:hover {
  background: var(--color-fill-secondary);
}

.btn.danger {
  color: #d70015;
}

.btn.ghost.danger:hover {
  background: rgba(215, 0, 21, 0.1);
}


/* --- Question transition state --- */

.app-shell.is-transitioning .question-panel {
  opacity: 0.6;
  transition: opacity 150ms ease-out;
}


/* --- Options (list-row style) --- */

.option {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-option);
  border: none;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: none;
  box-shadow: none;
}

.option:hover {
  background: rgba(255, 255, 255, 1);
}

.option:active {
  opacity: 0.6;
  transition-duration: 60ms;
}

.option.selected {
  background: var(--color-accent-bg);
}

.option-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-accent-bg);
  border: none;
}

.option.selected .option-mark {
  color: #ffffff;
  background: var(--color-accent);
}

.option-text {
  font-size: 15px;
  line-height: 1.4;
}


/* --- Form fields --- */

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span {
  font-size: 15px;
  color: var(--color-text-secondary);
}

.hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-separator);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 15px;
  background: var(--color-bg-secondary);
  backdrop-filter: none;
  box-shadow: none;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-separator);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 15px;
  background: var(--color-bg-secondary);
  box-shadow: none;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
  color: var(--color-text-tertiary);
}

textarea::placeholder {
  color: var(--color-text-tertiary);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--color-accent);
  box-shadow: var(--ring-focus);
}

small {
  justify-self: end;
  font-size: 13px;
  color: var(--color-text-tertiary);
}


/* --- Tags (flat pill) --- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  border: none;
  color: var(--color-text-secondary);
  background: var(--color-fill);
  backdrop-filter: none;
  box-shadow: none;
}

.tag:hover {
  opacity: 0.8;
}

.tag:active {
  opacity: 0.5;
  transition-duration: 60ms;
}

.tag.active {
  color: var(--color-accent);
  background: var(--color-accent-bg);
}


/* --- Foot links --- */

.foot-links {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.foot-links a {
  color: var(--color-accent);
  text-decoration: none;
}


/* --- Legal reader (in-app, no external roaming) --- */

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.legal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.legal-sheet {
  position: absolute;
  left: 50%;
  top: max(env(safe-area-inset-top, 0px), 14px);
  transform: translateX(-50%);
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: auto;
  border-radius: 18px;
  padding: 14px 16px 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--color-separator);
}

.legal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.legal-source {
  margin: 2px 0 10px;
  font-size: 12px;
  color: var(--color-text-tertiary);
  word-break: break-all;
}

.legal-loading,
.legal-error {
  margin: 0;
  color: var(--color-text-secondary);
}

.legal-error {
  color: #d70015;
}

.legal-content {
  display: grid;
  gap: 10px;
}

.legal-content p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-primary);
}


/* --- Dots (onboarding) --- */

.dots {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-fill);
  transition: all var(--motion-base) var(--ease-standard);
}

.dot.active {
  width: 24px;
  background: var(--color-accent);
}


/* --- Insight --- */

.insight-title {
  margin-top: 2px;
  color: var(--color-text-primary);
  font-size: clamp(20px, 3.2vw, 28px);
  line-height: 1.28;
  font-weight: 700;
}


/* --- Home screen --- */

.home-panel h2 {
  margin-bottom: 8px;
}

.home-metrics {
  margin-bottom: 16px;
  color: var(--color-text-secondary);
  font-size: 15px;
}

.home-main-cta {
  width: 100%;
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.home-main-col,
.home-side-col {
  display: grid;
  gap: 14px;
  align-content: start;
}

.home-profile,
.home-history,
.home-account {
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  padding: 16px;
}

.home-profile h3 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.3;
}

.home-profile p {
  margin: 0;
  color: var(--color-text-secondary);
}

.home-category-map {
  margin-top: 0;
}

.home-category {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: var(--radius-option);
  padding: 12px 14px;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: none;
  box-shadow: none;
}

.home-category:hover {
  background: rgba(255, 255, 255, 1);
}

.home-category:active {
  opacity: 0.6;
}

.home-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.home-category-head p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.home-category-head span {
  color: var(--color-text-tertiary);
  font-size: 13px;
  font-weight: 600;
}


/* --- Home insight card --- */

.home-insight {
  margin-top: 0;
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: none;
  box-shadow: none;
  padding: 16px;
}

.home-insight h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-text-primary);
}

.home-insight p {
  margin: 0;
  font-size: 15px;
}

.home-history ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-history-empty {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.home-history-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.home-history-meta {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.home-history-question {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.home-history-answer {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--color-text-primary);
  font-weight: 600;
}

.home-account-note {
  margin: 0 0 8px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.home-store-cta {
  width: 100%;
  margin: 6px 0 10px;
}


/* --- Summary --- */

.summary-list {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.8;
}


/* --- Toast --- */

.toast {
  border-radius: 12px;
  border: none;
  padding: 12px 16px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(150%);
  color: var(--color-text-secondary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.toast.error {
  color: #d70015;
  background: rgba(255, 235, 235, 0.92);
}


/* --- Focus visible --- */

.btn:focus-visible,
.option:focus-visible,
.tag:focus-visible,
.foot-links a:focus-visible,
.header-back:focus-visible {
  box-shadow: var(--ring-focus);
}

textarea:focus-visible {
  box-shadow: var(--ring-focus);
}


/* --- Splash screen --- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--color-bg);
  animation: splash-dismiss 0.4s ease 1.8s forwards;
}

/* --- First-launch immersive sequence --- */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(var(--safe-top) + 16px)
    calc(var(--safe-right) + 16px)
    calc(var(--safe-bottom) + 16px)
    calc(var(--safe-left) + 16px);
}

/* --- backdrop: white base + drifting blurred blobs --- */
.intro-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f9fbff 0%, #f0f4fb 100%);
  overflow: hidden;
}

.intro-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
}

.intro-blob-1 {
  width: 420px;
  height: 420px;
  top: -10%;
  left: -8%;
  background: radial-gradient(circle, rgba(180, 210, 255, 0.55), transparent 70%);
  animation: intro-drift-1 24s ease-in-out infinite alternate;
}

.intro-blob-2 {
  width: 340px;
  height: 340px;
  bottom: -5%;
  right: -6%;
  background: radial-gradient(circle, rgba(200, 190, 255, 0.45), transparent 70%);
  animation: intro-drift-2 28s ease-in-out infinite alternate;
}

.intro-blob-3 {
  width: 260px;
  height: 260px;
  top: 40%;
  left: 50%;
  background: radial-gradient(circle, rgba(170, 225, 255, 0.4), transparent 70%);
  animation: intro-drift-3 22s ease-in-out infinite alternate;
}

@keyframes intro-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30%, 35%) scale(1.15); }
}

@keyframes intro-drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-25%, -30%) scale(1.1); }
}

@keyframes intro-drift-3 {
  0%   { transform: translate(-50%, 0) scale(1); }
  100% { transform: translate(-20%, -40%) scale(1.2); }
}

/* --- glass panel: stronger frosted glass --- */
.intro-panel {
  position: relative;
  z-index: 1;
  width: min(700px, 100%);
  min-height: min(58dvh, 520px);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 8px 32px rgba(17, 17, 17, 0.06),
    0 1.5px 0 rgba(255, 255, 255, 0.7) inset;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 22px 24px 22px;
  animation: intro-panel-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes intro-panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.intro-skip {
  justify-self: end;
  border: none;
  background: transparent;
  color: rgba(20, 24, 32, 0.4);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  min-height: 36px;
  padding: 6px 10px;
  transition: color 0.2s;
}

.intro-skip:hover {
  color: rgba(20, 24, 32, 0.6);
}

.intro-lines {
  align-self: center;
  display: grid;
  gap: 10px;
  text-align: center;
}

/* --- text: soft dark, fade-up stagger per line --- */
.intro-line {
  margin: 0;
  color: rgba(20, 24, 32, 0.78);
  font-size: clamp(19px, 3.2vw, 28px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.45;
  opacity: 0;
  animation: intro-line-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  /* animation-delay set inline per line for stagger */
}

@keyframes intro-line-in {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.intro-line-strong {
  font-size: clamp(22px, 3.8vw, 34px);
  font-weight: 700;
  color: rgba(20, 24, 32, 0.88);
}

.intro-actions {
  display: flex;
  justify-content: center;
}

/* --- CTA: subtle glow --- */
.intro-next-btn {
  width: min(340px, 100%);
  position: relative;
}

.intro-next-btn.primary {
  box-shadow:
    0 0 20px rgba(0, 122, 255, 0.2),
    0 0 60px rgba(0, 122, 255, 0.08);
}

.intro-next-btn.ghost {
  color: rgba(20, 24, 32, 0.55);
  border-color: rgba(20, 24, 32, 0.12);
}

html[data-miralog-platform="web"] .intro-panel {
  animation: none;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 14px 48px rgba(17, 17, 17, 0.1),
    0 1.5px 0 rgba(255, 255, 255, 0.75) inset;
}

html[data-miralog-platform="web"] .intro-line {
  opacity: 1;
  animation: none;
  filter: none;
}

html[data-miralog-platform="web"] .intro-skip {
  color: rgba(20, 24, 32, 0.58);
}

.splash-glass {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
  animation: splash-glass-enter 0.7s var(--ease-spring) both;
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.splash-logo {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
  animation: splash-text-enter 0.5s ease 0.25s both;
}

.splash-tagline {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  animation: splash-text-enter 0.5s ease 0.4s both;
}

/* Expanding rings — futuristic / advanced feel */
.splash-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 122, 255, 0.12);
  pointer-events: none;
  animation: splash-ring-expand 2s ease-out forwards;
}

.splash-ring-1 {
  width: 100px;
  height: 100px;
  animation-delay: 0.3s;
}

.splash-ring-2 {
  width: 200px;
  height: 200px;
  animation-delay: 0.6s;
}

.splash-ring-3 {
  width: 320px;
  height: 320px;
  animation-delay: 0.9s;
}

/* Subtle shimmer line */
.splash-shimmer {
  position: absolute;
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 122, 255, 0.25), transparent);
  animation: splash-shimmer-move 1.4s ease 0.5s both;
}

@keyframes splash-glass-enter {
  from {
    transform: scale(0.5) rotate(-6deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes splash-text-enter {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes splash-ring-expand {
  from {
    transform: scale(0.4);
    opacity: 0.6;
  }
  to {
    transform: scale(3);
    opacity: 0;
  }
}

@keyframes splash-shimmer-move {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  to {
    transform: translateY(-40px);
    opacity: 0;
  }
}

@keyframes splash-dismiss {
  to {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }
}


/* ===================================================
   Responsive
   =================================================== */

@media (max-width: 820px) {
  body {
    padding:
      calc(var(--safe-top) + 10px)
      calc(var(--safe-right) + 12px)
      calc(var(--safe-bottom) + 10px)
      calc(var(--safe-left) + 12px);
  }

  .app-shell {
    width: 100%;
    min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 12px);
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 12px);
    height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 12px);
    gap: 6px;
  }

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

  h2 {
    font-size: clamp(22px, 6.5vw, 30px);
  }

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

  .question-footer.actions.split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-panel {
    min-height: min(64dvh, 520px);
    padding: 16px 14px 14px;
    border-radius: 22px;
  }
}

@media (min-width: 981px) {
  .home-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 18px;
  }
}


/* ===================================================
   Touch device — no hover lift
   =================================================== */

@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .option:hover,
  .tag:hover,
  .header-back:hover {
    opacity: 1;
    background: initial;
  }
}


/* ===================================================
   Accessibility
   =================================================== */

@supports not (backdrop-filter: blur(1px)) {
  .panel,
  .toast,
  .splash-glass {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.95);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .panel,
  .toast,
  .splash-glass {
    backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.97) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
