/* Core reading and assessment surfaces. Loaded after the legacy theme. */
body.mobile-refined {
  background: #f3f0ea;
  color: #151922;
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.mobile-refined :is(.app-shell, .container, .auth-shell, .auth-form-card, .card, .question-card, .modal, .modal-content) { min-width: 0; }
.mobile-refined :is(.card, .frost-card, .question-card, .test-brief, .auth-form-card, .guest-primary-card) {
  background: #fffdf8;
  border-color: rgba(21,25,34,.12);
  box-shadow: none;
  backdrop-filter: none;
}
.mobile-refined :is(.btn, .choice-card, .back-btn, .header-action-btn, .nav-back-button, .question-grid-btn, .home-switch-btn, .type-overview-trigger) {
  min-height: 52px;
  touch-action: manipulation;
}
.mobile-refined :is(button, input, textarea, select) { font: inherit; }
.mobile-refined :is(p, .choice-text, .modal-copy, .statement-card span, .guest-primary-card small, .auth-subtitle, .auth-entry-login-hint) {
  font-size: 16px;
  line-height: 1.7;
}
.mobile-refined :is(button, a, input, textarea, select):focus-visible { outline: 3px solid #b83a4b; outline-offset: 3px; }
.mobile-refined :is(.btn-primary, .btn-accent) { background: #b83a4b; color: #fffdf8; box-shadow: none; }
.mobile-refined :is(.choice-card.selected, .likert-scale .option.selected, .response-skip.selected) {
  background: #faedf0;
  border-color: #b83a4b;
  color: #151922;
  box-shadow: none;
}
.mobile-refined :is(.choice-card.selected .choice-label, .likert-scale .option.selected .dot) { background: #b83a4b; color: #fff; box-shadow: none; }
.mobile-refined :is(.question-slide-in-right, .progress-pulse, .auth-dossier, .auth-archive-node, .auth-stage-signal, .profile-hero-card, .mbti-share-hero, .intimacy-portrait-hero) { animation: none !important; }
.mobile-refined :is(.auth-cinema-bg, .auth-brand-stage, .auth-card-reactor, .rank-measurement-glow) { display: none !important; }
.mobile-refined :is(.relationship-pair-hero, .intimacy-portrait-hero, .mbti-share-hero, .profile-hero-card) { background: #fffdf8; box-shadow: none; }
.mobile-refined :is(.relationship-pair-hero, .intimacy-portrait-hero, .mbti-share-hero, .profile-hero-card)::before,
.mobile-refined :is(.relationship-pair-hero, .intimacy-portrait-hero, .mbti-share-hero, .profile-hero-card)::after { content: none; }
.mobile-refined.auth-page { background: #f3f0ea; }
.mobile-refined .auth-shell { display: block; width: min(560px,100%); margin: 0 auto; padding: 24px 16px; }
.mobile-refined .auth-form-card { width: 100%; transform: none !important; opacity: 1 !important; padding: 24px; }
.mobile-refined .auth-cinema-page { padding: 0; }
.mobile-refined .auth-title, .mobile-refined .auth-product-positioning h1 { color: #151922; background: none; -webkit-text-fill-color: #151922; }
.mobile-refined .test-page { padding-bottom: calc(100px + env(safe-area-inset-bottom,0px)); }
.mobile-refined .test-page::after { display: none; }
.mobile-refined .test-page .question-card { min-height: 0; }
.mobile-refined .test-page .q-text { font-size: 22px; line-height: 1.6; font-weight: 600; }
.mobile-refined .test-page .choice-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
.mobile-refined .test-page .choice-card { min-height: 64px; padding: 16px; text-align: left; align-items: flex-start; }
.mobile-refined .test-page .choice-text { font-size: 16px; line-height: 1.7; }
.mobile-refined .test-status-summary { flex-wrap: wrap; gap: 8px 12px; }
.mobile-refined .progress-bar .fill { background: #b83a4b; }
.mobile-refined .test-sticky-actions {
  width: min(720px,100%);
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom,0px));
  grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr);
  background: #fffdf8;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.mobile-refined .test-sticky-actions .btn { padding: 10px 6px; font-size: 16px; white-space: normal; }
.behavior-other-responses { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(21,25,34,.12); }
.response-skip { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 52px; padding: 10px 6px; border: 1px solid rgba(21,25,34,.18); border-radius: 12px; background: transparent; color: #62666f; cursor: pointer; }
.coverage-note { margin-top: 16px; color: #8f2c3a; }
.scenario-portrait h2, .scenario-evidence h3 { margin-bottom: 12px; }
.scenario-portrait p + p { margin-top: 12px; }
.scenario-preference-row { display: grid; grid-template-columns: 126px minmax(0,1fr); gap: 12px; align-items: center; margin-top: 18px; }
.scenario-preference-track { background: #ebe7de; height: 8px; border-radius: 4px; overflow: hidden; }
.scenario-preference-track i { display: block; height: 100%; background: #b83a4b; }
.scenario-evidence { margin-top: 24px; }
.scenario-evidence h3 { font-size: 18px; }
.scenario-evidence h3 span { font-size: 14px; color: #62666f; font-weight: normal; }
.scenario-evidence blockquote { margin: 12px 0; padding-left: 16px; border-left: 2px solid #b83a4b; }
.scenario-evidence blockquote p + p { margin-top: 8px; }
@media (max-width: 600px) {
  .mobile-refined .app-shell { padding-left: 16px; padding-right: 16px; }
  .mobile-refined .test-page .question-card { padding: 20px 16px; margin-bottom: 12px; }
  .mobile-refined .assessment-topbar { gap: 8px; }
  .mobile-refined .assessment-topbar h1 { font-size: 16px; min-width: 0; }
  .mobile-refined .assessment-topbar .back-btn { padding: 8px; }
  .mobile-refined .test-status-overview-btn { display: none; }
  .mobile-refined .test-status-card { margin-bottom: 12px; padding: 12px 16px; }
  .mobile-refined .test-status-meta { margin-top: 4px; }
  .mobile-refined .auth-form-card { padding: 20px 16px; }
  .mobile-refined .likert-scale-row { gap: 3px; }
  .mobile-refined .likert-scale .option { min-height: 56px; padding: 8px 0; border-radius: 8px; }
  .mobile-refined .likert-scale .option .text { font-size: 12px; }
}
/* Auth originally supplied a separate dark token set. Keep reading contrast explicit. */
body.mobile-refined.auth-page {
  --primary: #151922;
  --primary-strong: #0f1218;
  --primary-light: #b83a4b;
  --accent: #b83a4b;
  --bg: #f3f0ea;
  --bg-elevated: #fffdf8;
  --bg-card: #fffdf8;
  --bg-input: #f7f4ee;
  --text: #151922;
  --text-secondary: #62666f;
  --text-muted: #62666f;
  --border: rgba(21,25,34,.12);
  color: #151922;
}
.mobile-refined .auth-form-card::before,
.mobile-refined .auth-form-card::after,
.mobile-refined .guest-primary-card::after { content: none; }
.mobile-refined .guest-primary-card:hover { transform: none; box-shadow: none; }
.mobile-refined .guest-primary-card-badge { color: #8f2c3a !important; border-color: rgba(184,58,75,.3); }
.mobile-refined .auth-product-positioning span { color: #b83a4b; }
.mobile-refined .auth-panel-collapsed { opacity: 1; }
.mobile-refined .auth-mode-switch { background: #ebe7de; }
.mobile-refined .auth-mode-switch .home-switch-btn.active { background: #151922; color: #fffdf8; box-shadow: none; }
.mobile-refined.auth-page .input-group input { min-height: 52px; border-color: rgba(21,25,34,.18); }
.mobile-refined.auth-page .input-group input::placeholder { color: #62666f; }
.mobile-refined :is(.ai-placeholder-icon, .ai-generating-icon, .rank-match-radar) { animation: none; }
.mobile-refined .auth-entry-actions { border-color: rgba(21,25,34,.12); }
/* Login keeps the black/red identity in a compact, still header. */
body.mobile-refined.auth-page .auth-product-positioning {
  padding: 20px;
  border-radius: 14px;
  background: #151922;
  gap: 10px;
}
body.mobile-refined.auth-page .auth-product-positioning span { color: #e18997; font-size: 16px; }
body.mobile-refined.auth-page .auth-product-positioning h1 {
  color: #fffdf8;
  -webkit-text-fill-color: #fffdf8;
  font-size: 24px;
  line-height: 1.45;
}
body.mobile-refined.auth-page .auth-entry-grid { grid-template-columns: minmax(0,1fr); }
body.mobile-refined.auth-page .guest-primary-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px 12px;
  align-items: start;
  min-height: 92px;
  padding: 16px;
  color: #151922;
  box-shadow: none;
}
body.mobile-refined.auth-page .guest-primary-card strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 20px;
  white-space: nowrap;
}
body.mobile-refined.auth-page .guest-primary-card small {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 16px;
  line-height: 1.65;
  color: #62666f;
}
body.mobile-refined.auth-page .guest-primary-card-badge { grid-column: 2; grid-row: 1; }
body.mobile-refined.auth-page .type-overview-trigger-auth {
  color: #8f2c3a;
  background: #faedf0;
  border: 1px solid rgba(184,58,75,.3);
  font-size: 16px;
  box-shadow: none;
  backdrop-filter: none;
}
body.mobile-refined.auth-page .auth-entry-login-hint { color: #62666f; font-size: 16px; text-shadow: none; }
.mobile-refined .test-page .choice-card { box-shadow: none; }
@media (max-width: 600px) {
  .mobile-refined .test-page { padding-top: 8px; }
  .mobile-refined .test-page .assessment-topbar { padding: 0; margin-bottom: 8px; }
  .mobile-refined .test-page .test-status-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 6px 12px; }
  .mobile-refined .test-page:not(.mbti-test-page) .test-status-card:not(.has-coverage-error) .test-status-summary > span { display: none; }
  .mobile-refined .test-page .test-status-meta { margin-top: 0; }
  .mobile-refined .test-page .test-status-meta span { padding: 0; border: 0; background: transparent; font-size: 13px; }
  .mobile-refined .test-page .test-status-meta span + span { display: none; }
  .mobile-refined .test-page .test-status-card.has-coverage-error { flex-wrap: wrap; }
  .mobile-refined .test-page .progress-bar { height: 4px; margin: 8px 0 12px; }
  .mobile-refined .test-page .question-card { padding: 16px; }
  .mobile-refined .test-page .question-card .q-number { display: none; }
  .mobile-refined .test-page .q-text { font-size: 20px; }
  .mobile-refined .test-page .choice-grid { gap: 10px; margin-top: 16px; }
  .mobile-refined .test-page .choice-card { padding: 12px; }
  .mobile-refined .behavior-other-responses { margin-top: 16px; padding-top: 12px; gap: 10px; }
}

/* Keep the three primary destinations legible on a narrow phone. */
.mobile-refined #homeSwitch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.mobile-refined #homeSwitch .home-switch-btn { min-width: 0; padding: 12px 4px; white-space: nowrap; font-size: 14px; }
.scenario-preference-row { grid-template-columns: 112px minmax(0, 1fr) 58px; gap: 8px; }
.scenario-preference-value { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.scenario-preference-track { position: relative; }
.scenario-preference-track.has-baseline::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: #8a8d94; }
.scenario-preference-value small { display: block; margin-top: 2px; color: var(--text-muted, #777); font-size: 10px; font-weight: 400; }
.scenario-preference-row.is-limited .scenario-preference-track i { opacity: .45; }
.mobile-refined .scenario-scale-note { color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.mobile-refined .test-submit-rule { font-size: 12px; color: var(--text-secondary); margin: 8px 0 0; line-height: 1.5; }
.question-grid-btn.skipped { color: #8f2c3a; background: #faedf0; border: 1px dashed #b83a4b; }
.question-grid-btn.skipped small { display: block; font-size: 10px; line-height: 1.2; }
.overview-legend .skipped i { background: #faedf0; border: 1px dashed #b83a4b; }
@media (max-width: 600px) {
  .mobile-refined .mbti-test-page .test-status-card { display: block; }
  .mobile-refined .mbti-test-page .test-status-row { width: 100%; }
  .mobile-refined .mbti-test-page .test-status-card .test-status-summary { display: flex; flex-wrap: wrap; gap: 4px 10px; }
  .mobile-refined .mbti-test-page .test-status-card .test-status-summary > span { display: inline; font-size: 12px; padding: 0; border: 0; background: transparent; }
  .mobile-refined .mbti-test-page .test-status-meta { display: none; }
  .mobile-refined .mbti-test-page .test-status-meta.has-supplement { display: flex; }
  .mobile-refined .mbti-test-page .test-status-overview-btn { display: none; }
}
.scenario-scale-details { margin-top: 8px; }
.scenario-scale-details summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; font-size: 13px; color: #62666f; }
.scenario-scale-details summary:focus-visible { outline: 3px solid #b83a4b; outline-offset: 3px; }
@media (max-width: 600px) {
  /* Keep the question grid usable instead of spending three rows on actions. */
  .mobile-refined .test-overview-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mobile-refined .test-overview-actions .btn { min-width: 0; min-height: 44px; padding: 10px 6px; font-size: 12px; }
}

.response-skip-label { white-space: nowrap; }
.response-skip-badge { flex-shrink: 0; font-size: 10px; line-height: 1.5; padding: 0 3px; border-radius: 3px; background: #ebe7de; color: #62666f; }
@media (max-width: 360px) {
  .mobile-refined .mbti-test-page .q-text { font-size: 18px; line-height: 1.55; }
  .mobile-refined .response-skip { flex-direction: column; gap: 0; padding: 6px; }
}

/* Assessment reading: quiet contrast and a clear tap target without extra decoration. */
.mobile-refined .mbti-test-page .choice-card .choice-text {
  color: #34363d;
}
.mobile-refined .mbti-test-page .choice-card .choice-label {
  color: #813441;
  background: #f6edef;
}
.mobile-refined .mbti-test-page .choice-card.selected .choice-label {
  color: #fff;
  background: #a63143;
}
.mobile-refined .mbti-test-page .test-status-summary > span {
  color: #5d6068;
}
.mobile-refined .mbti-test-page .response-skip {
  color: #555860;
}
@media (prefers-reduced-motion: reduce) {
  .mobile-refined .mbti-test-page .choice-card,
  .mobile-refined .mbti-test-page .choice-card .choice-label,
  .mobile-refined .mbti-test-page .choice-card .choice-text {
    transition: none;
  }
}

/* Qualify the type while keeping the headline easy to scan on a phone. */
.mobile-refined .scenario-portrait .type-variant-label {
  max-width: 100%;
  white-space: normal;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.mobile-refined .scenario-type-explanation {
  color: var(--text-secondary);
  line-height: 1.8;
}
.mobile-refined .scenario-type-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin: 20px 0 12px;
  color: var(--primary);
  font-size: clamp(24px, 7vw, 34px);
  letter-spacing: .02em;
}
.mobile-refined .scenario-type-pair > span {
  color: var(--text-muted);
  font-size: .65em;
}
