/* Compact entry actions share the existing charcoal/red visual language. */
.convenience-test-card { flex-wrap: wrap; }
.convenience-test-card .convenience-test-copy { min-width: 0; }
.convenience-test-card .convenience-test-actions { display: flex; width: 100%; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 8px; }
.convenience-test-card .convenience-test-actions .btn,
.guest-resume-entry .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.convenience-test-card .convenience-progress { color: var(--text-secondary, #696660); font-size: 13px; }
.guest-resume-entry:not([hidden]) { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; margin-bottom: 8px; border-bottom: 1px solid rgba(110, 101, 90, .18); }
.guest-resume-entry > span { min-width: 0; font-size: 12px; color: var(--text-secondary, #696660); line-height: 1.5; }
.guest-resume-entry > a { flex-shrink: 0; }
@media (max-width: 420px) {
  .convenience-test-card { flex-wrap: wrap; gap: 10px; }
  .convenience-test-card .convenience-test-actions { width: 100%; justify-content: flex-end; }
}

/* Assessment overview keeps filters and actions visible around a scrolling grid. */
.test-overview-modal { position: relative; display: flex; flex-direction: column; max-height: calc(100dvh - 32px); overflow: hidden; }
.test-overview-modal h2,
.test-overview-modal h3 { padding-right: 48px; }
.test-overview-modal .overview-close { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--bg-secondary, #eee9e1); color: var(--text-primary, #282522); font-size: 28px; cursor: pointer; }
.test-overview-modal .overview-filters { display: flex; flex-shrink: 0; gap: 8px; margin: 12px 0; }
.test-overview-modal .overview-filter { flex: 1; min-height: 44px; border: 1px solid var(--border, #d5cdc1); border-radius: 12px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.test-overview-modal .overview-filter[aria-pressed="true"] { background: var(--text-primary, #282522); color: var(--bg-primary, #fffaf3); }
.test-overview-modal .overview-filter span { font-size: 12px; opacity: .8; }
.test-overview-modal .test-overview-grid-wrap { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.test-overview-modal .question-grid-btn { min-width: 44px; min-height: 44px; }
.test-overview-modal .question-grid-btn[hidden] { display: none; }
.test-overview-modal .question-grid-btn.current { color: var(--text, #151922); border-color: var(--primary, #b83a4b); }
.test-overview-modal .test-overview-actions { flex-shrink: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
.test-overview-modal .test-overview-actions .btn { min-width: 0; width: 100%; min-height: 44px; padding: 10px 6px; font-size: 12px; }
.test-overview-modal button:focus-visible { outline: 3px solid var(--accent, #a34737); outline-offset: 2px; }
@media (max-width: 420px) {
  .test-overview-modal { padding: 20px 16px; }
  .test-overview-modal .question-grid { grid-template-columns: repeat(5, minmax(44px, 1fr)); }
}

/* One compact row stays available while reading either report format. */
.report-section-nav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 20; min-width: 0; max-width: 100%; margin-bottom: 12px; padding: 3px 22px 3px 4px; border: 1px solid var(--border, #d5cdc1); border-radius: 12px; background: var(--bg-primary, #fffaf3); box-shadow: 0 2px 8px rgba(40, 37, 34, .08); }
.report-section-nav::after { content: '›'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--text-secondary, #696660); font-size: 20px; pointer-events: none; }
.report-section-links { display: flex; gap: 4px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.report-section-links a { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 8px 12px; border-radius: 8px; color: var(--text-primary, #282522); font-size: 13px; line-height: 1.4; text-decoration: none; white-space: nowrap; }
.report-section-links a[aria-current="location"] { color: var(--accent, #a34737); background: rgba(163, 71, 55, .09); font-weight: 600; }
.report-section-links a:focus-visible { outline: 2px solid var(--accent, #a34737); outline-offset: -2px; }
[data-report-section-target] { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 84px); }
@media (prefers-reduced-motion: reduce) {
  html:has(.report-section-nav) { scroll-behavior: auto; }
}
@media print {
  .report-section-nav { display: none; }
}

/* Hidden x overflow creates an unused y scroll container and traps sticky children. */
@supports (overflow-x: clip) {
  html.report-reading-page,
  body.report-reading-page { overflow-x: clip; overflow-y: visible; }
}

/* Profile sheets retain their slide animation while inert removes closed controls. */
.profile-convenience-page .profile-sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-convenience-page .profile-sheet-heading h3 { margin: 0; }
.profile-convenience-page .profile-sheet-close,
.profile-convenience-page .recharge-quantity-sheet-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 50%; background: var(--bg-secondary, #f4f3f1); color: var(--text-primary, #181818); font-size: 24px; cursor: pointer; }
.profile-convenience-page .profile-sheet-close:focus-visible,
.profile-convenience-page .sheet-panel :focus-visible { outline: 2px solid var(--accent, #a34737); outline-offset: 3px; }

.more-test-options { margin-top: 14px; }
.more-test-options > summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; color: #555860; font-size: 14px; list-style: none; }
.more-test-options > summary::-webkit-details-marker { display: none; }
.more-test-options > summary::after { content: '展开'; color: #8f2c3a; }
.more-test-options[open] > summary::after { content: '收起'; }
.more-test-options .test-status-grid { margin-top: 6px; }
.more-test-options > summary:focus-visible { outline: 3px solid #b83a4b; outline-offset: 3px; }

.scenario-first-example { margin-top: 16px; padding: 12px 14px; border-left: 2px solid #b83a4b; background: #f8f5f0; border-radius: 0 8px 8px 0; }
.scenario-first-example p + p { margin-top: 4px; }

/* Short, restrained feedback keeps the reading surface calm on a phone. */
.mobile-refined #testsStatusPanel .convenience-test-card {
  border-color: rgba(21, 25, 34, .09);
  box-shadow: 0 3px 12px rgba(21, 25, 34, .035);
}
@media (prefers-reduced-motion: no-preference) {
  .mobile-refined #questionArea.question-arrival {
    animation: assessment-question-arrival 160ms ease-out both;
  }
  .mobile-refined :is(#homeSwitch .home-switch-btn, .test-page .choice-card, .test-page .response-skip,
    .test-sticky-actions .btn, .report-section-links a) {
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
  }
  .mobile-refined :is(#homeSwitch .home-switch-btn, .test-page .choice-card, .test-page .response-skip,
    .test-sticky-actions .btn, .report-section-links a):active:not(:disabled) {
    transform: scale(.99);
  }
  @keyframes assessment-question-arrival {
    from { opacity: .94; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-refined #questionArea.question-arrival,
  .mobile-refined .tab-fade-in { animation: none; }
  .mobile-refined :is(#homeSwitch .home-switch-btn, .test-page .choice-card, .test-page .response-skip,
    .test-sticky-actions .btn, .report-section-links a, .test-page .progress-bar .fill) {
    transition: none;
  }
}

/* Quiet depth and tactile feedback for the two most-used mobile surfaces. */
body.mobile-refined.auth-page .auth-form-card,
.mobile-refined .mbti-test-page .question-card {
  border-color: rgba(21, 25, 34, .09);
  box-shadow: 0 8px 24px rgba(31, 27, 24, .045);
}
body.mobile-refined.auth-page .guest-primary-card {
  border-color: rgba(21, 25, 34, .1);
  border-radius: 16px;
}
.mobile-refined .mbti-test-page .choice-card {
  border-color: rgba(21, 25, 34, .11);
  border-radius: 14px;
  background: #fff;
}
.mobile-refined .mbti-test-page .choice-card.selected {
  border-color: #ad394b;
  background: #faedf0;
  box-shadow: inset 0 0 0 1px rgba(173, 57, 75, .14);
}
.mobile-refined .mbti-test-page .choice-label {
  flex-shrink: 0;
}
.mobile-refined .test-sticky-actions {
  border-top: 1px solid rgba(21, 25, 34, .08);
  box-shadow: 0 -6px 20px rgba(31, 27, 24, .035);
}
@media (prefers-reduced-motion: no-preference) {
  body.mobile-refined.auth-page .guest-primary-card {
    transition: border-color 180ms ease, background-color 180ms ease, transform 120ms ease;
  }
  body.mobile-refined.auth-page .guest-primary-card:active {
    transform: scale(.99);
    background: #faf5f3;
  }
  .mobile-refined .mbti-test-page .choice-card,
  .mobile-refined .mbti-test-page .response-skip {
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
  }
  .mobile-refined .mbti-test-page .choice-label {
    transition: background-color 160ms ease, color 160ms ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.mobile-refined.auth-page .guest-primary-card,
  .mobile-refined .mbti-test-page .choice-card,
  .mobile-refined .mbti-test-page .response-skip,
  .mobile-refined .mbti-test-page .choice-label {
    transition: none;
  }
}

/* Re-rendered answers need an explicit cue: the selected node is newly created. */
@media (prefers-reduced-motion: no-preference) {
  .mobile-refined .mbti-test-page .answer-confirmed {
    animation: answer-confirmation 180ms cubic-bezier(.2, .7, .25, 1) both;
  }
  @keyframes answer-confirmation {
    from { transform: scale(.992); }
    to { transform: scale(1); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-refined .mbti-test-page .answer-confirmed { animation: none; }
}

/* Consistent, restrained surfaces for the main mobile journey. */
body.mobile-refined.auth-page .auth-product-positioning {
  box-shadow: inset 3px 0 0 #b83a4b;
}
body.mobile-refined.auth-page .guest-primary-card::after {
  content: '›';
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: #9b5b65;
  font-size: 24px;
  line-height: 1;
}
.mobile-refined #testsStatusPanel .convenience-test-card {
  align-items: center;
  gap: 10px 12px;
  border-radius: 16px;
  background: #fffefb;
}
.mobile-refined #testsStatusPanel .convenience-test-copy { flex: 1 1 180px; }
.mobile-refined #testsStatusPanel .convenience-test-actions { width: auto; flex: 0 0 auto; margin-left: auto; }
.mobile-refined #testsStatusPanel .convenience-test-card[data-status="completed"] .convenience-test-actions {
  width: 100%;
}
.mobile-refined #testsStatusPanel .test-status-pill {
  color: #873244;
  background: #f7e9ec;
}
.mobile-refined .profile-archive-summary-item {
  border-radius: 12px;
  border-color: rgba(21, 25, 34, .09);
  background: #fffefb;
}
.mobile-refined .profile-archive-summary-item strong { color: #20222b; }
.mobile-refined.report-reading-page .section-stack > .card {
  border-color: rgba(21, 25, 34, .09);
  box-shadow: 0 6px 20px rgba(31, 27, 24, .035);
}
.mobile-refined.report-reading-page .scenario-first-example {
  border-left-color: #a93143;
  background: #f7f3ef;
}
.mobile-refined.report-reading-page .report-section-nav {
  border-radius: 14px;
  background: #fffdf8;
}
.mobile-refined.report-reading-page .report-section-links a[aria-current="location"] {
  color: #873244;
  background: #f7e9ec;
}
@media (max-width: 600px) {
  .mobile-refined #testsStatusPanel .test-status-grid { gap: 10px; }
  .mobile-refined #testsStatusPanel .convenience-test-card { padding: 14px; }
  .mobile-refined .profile-archive-summary-item { min-height: 88px; padding: 11px 12px; }
  .mobile-refined .profile-archive-summary-item strong,
  .mobile-refined .profile-archive-summary-item small { margin-top: 5px; }
}
@media (prefers-reduced-motion: no-preference) {
  .mobile-refined .profile-archive-summary-item {
    transition: border-color 160ms ease, background-color 160ms ease, transform 120ms ease;
  }
  .mobile-refined .profile-archive-summary-item:active {
    transform: scale(.99);
    background: #faf5f3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-refined .profile-archive-summary-item { transition: none; }
}
@media (max-width: 360px) {
  .mobile-refined #testsStatusPanel .convenience-test-actions {
    width: 100%;
    flex-basis: 100%;
    justify-content: flex-end;
  }
}
