/* Apple-inspired refinement of help and recommendations. Business rules stay in their modules. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ui-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Completed choices become a summary; editing restores the original controls. */
.query-panel.is-submitted { display: none; }
.result-section { padding-top: 8px; scroll-margin-top: 80px; }
.result-bridge {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0 0 28px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.result-bridge-copy strong { font-size: 15px; line-height: 1.5; }
#result-choice-summary { font-size: 16px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.result-edit-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.result-edit-button:focus-visible, .alternative-summary:focus-visible {
  outline: 3px solid var(--rose-deep);
  outline-offset: 4px;
}
.result-heading { gap: 16px; align-items: start; }
.result-heading h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.25; letter-spacing: -0.02em; text-wrap: balance; }
.result-context { display: none; } /* The editable selection summary holds the same facts. */
.result-count { padding: 7px 12px; font-size: 15px; white-space: nowrap; }
.result-summary { margin: 12px 0 28px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1.75; max-width: 65ch; }
.recommendation-card {
  padding: clamp(20px, 3vw, 32px);
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgb(104 68 81 / 7%);
}
.recommendation-card::before { display: none; }
.recommendation-card .card-topline { align-items: center; flex-wrap: wrap; gap: 10px; }
.recommendation-card .status-chip { font-size: 15px; }
.recommendation-card .card-note { font-size: 15px; font-weight: 500; }
.recommendation-card .product-row { grid-template-columns: 118px minmax(0, 1fr); gap: 22px; margin: 26px 0; }
.recommendation-card .product-copy h3 { font-size: clamp(25px, 3vw, 32px); line-height: 1.35; }
.recommendation-card .product-copy p { font-size: 16px; line-height: 1.65; }
.reason-block-primary { padding: 0; border: 0; border-radius: 0; background: transparent; }
.reason-block-primary .reason-label { font-size: 15px; font-weight: 600; }
.reason-block-primary .plain-explain { margin-top: 10px; font-size: 18px; line-height: 1.75; }
.result-facts { margin-top: 24px; }
.result-facts .fact-grid-core { gap: 12px; }
.result-facts .fact-tile-core {
  min-height: 88px;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
}
.result-facts .fact-tile-core .fact-label { font-size: 14px; line-height: 1.5; }
.result-facts .fact-tile-core .fact-value { margin-top: 6px; font-size: 17px; line-height: 1.55; }
.result-facts .fact-more { margin-top: 18px; }
.result-facts .fact-more > summary { min-height: 44px; font-size: 16px; }
.price-row { margin-top: 24px; gap: 16px; }
.price-row > div > span { font-size: 14px; }
.price-row > div > strong { font-size: 20px; }
.price-row .text-button { min-height: 44px; font-size: 16px; }
.alternative-card {
  margin-top: 24px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.alternative-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; list-style: none; cursor: pointer; }
.alternative-summary::-webkit-details-marker { display: none; }
.alternative-summary strong { display: block; font-size: 19px; font-weight: 600; }
.alternative-summary small { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.alternative-summary [data-icon] { flex-shrink: 0; transition: transform 180ms var(--ui-ease); }
.alternative-card[open] > summary [data-icon] { transform: rotate(180deg); }
.alternative-body { padding: 0 0 24px; }
.alternative-body .card-topline { display: none; }
.alternative-body .plain-explain { font-size: 17px; line-height: 1.75; }
.trust-strip { margin-top: 20px; font-size: 14px; line-height: 1.75; }

/* A long, white barrel and tapered white nib, rather than a short graphite pencil icon. */
.result-section .product-thumb { width: 118px; height: 64px; border: 0; border-radius: 12px; background: var(--canvas); }
.result-section .product-thumb span {
  width: 9px;
  height: 102px;
  border: 1px solid #b9aeac;
  border-radius: 5px 5px 2px 2px;
  transform: rotate(72deg);
  background: linear-gradient(90deg, #ffffff 0%, #ffffff 65%, #eee9e7 100%);
  box-shadow: 2px 3px 5px rgb(104 68 81 / 12%);
}
.result-section .product-thumb span::before { top: 7px; left: -1px; width: 9px; height: 1px; border: 0; border-radius: 0; background: #c7bfbc; }
.result-section .product-thumb span::after { left: 0; bottom: -9px; width: 7px; height: 10px; border: 0; border-radius: 0 0 3px 3px; background: #dcd6d2; clip-path: polygon(0 0, 100% 0, 65% 100%, 35% 100%); }
.result-section .product-thumb-gen1 span::before { top: 14px; height: 3px; background: #b9b9b9; }
.result-section .product-thumb-gen2 span::before, .result-section .product-thumb-pro span::before { display: none; }
.result-section .product-thumb-usbc span { height: 90px; }

.selection-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.selection-summary p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.selection-panel.has-selection-result { max-width: 760px; margin-inline: auto; border: 0; background: transparent; padding-right: 0; padding-left: 0; }
.selection-panel.has-selection-result > h2, .selection-panel.has-selection-result > #selection-intro { display: none; }
.selection-result { border: 0; margin-top: 28px; padding-top: 0; scroll-margin-top: 80px; }
.selection-result > h2 { font-size: clamp(28px, 4vw, 36px); line-height: 1.35; letter-spacing: -0.02em; }
.selection-primary { padding: clamp(20px, 3vw, 32px); border: 0; border-radius: 16px; background: var(--surface); box-shadow: 0 12px 36px rgb(104 68 81 / 7%); }
.selection-card-body h3 { margin-top: 0; }
.selection-reasons { line-height: 1.85; }
.selection-detail { padding: 18px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.selection-alternative { padding: 22px 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; }
.selection-alternative > summary { min-height: 44px; font-size: 18px; }
.selection-alternative[open] .selection-card-body { margin-top: 22px; }

/* Help reads like a support page: one readable column, clear dividers, answer first. */
.page[data-page="faq"] { max-width: 820px; margin-inline: auto; }
.page[data-page="faq"] .page-header { margin: 24px 0 36px; }
.page[data-page="faq"] .page-header h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.page[data-page="faq"] .page-header p { margin-top: 18px; font-size: 18px; line-height: 1.75; max-width: 60ch; }
.page[data-page="faq"] .search-field { min-height: 58px; padding: 14px 18px; border-radius: 14px; background: var(--surface); box-shadow: none; }
.page[data-page="faq"] .search-field input { font-size: 18px; }
.help-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; margin: 14px 0 26px; }
.help-shortcuts > span { color: var(--muted); font-size: 14px; }
.help-shortcuts button { min-height: 44px; padding: 8px 0; border: 0; color: var(--rose-deep); background: transparent; font: 16px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 5px; }
.help-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 5px; margin: 0; border-radius: 14px; background: var(--rose-soft); }
.help-filters button { min-width: 0; min-height: 48px; padding: 10px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 16px; }
.help-filters [aria-pressed="true"] { border: 0; background: var(--surface); color: var(--rose-deep); box-shadow: 0 2px 5px rgb(104 68 81 / 9%); }
.help-result-count { margin: 22px 0 12px; color: var(--muted); font-size: 15px; }
.faq-list { display: block; margin-top: 0; }
.faq-list > .help-issue { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; scroll-margin-top: 80px; }
.faq-list > .help-issue:first-child { border-top: 1px solid var(--line); }
.faq-list .help-issue > summary { padding: 24px 8px; gap: 22px; font-size: 20px; font-weight: 600; line-height: 1.6; }
.help-chevron { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: var(--rose-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms var(--ui-ease); }
.help-issue[open] > summary .help-chevron { transform: rotate(180deg); }
.faq-list .help-issue[open] { border-radius: 12px; background: var(--surface); }
.faq-list .help-issue[open] > summary { padding-inline: 24px; color: var(--rose-deep); background: var(--surface-soft); border-radius: 12px 12px 0 0; }
.faq-list .help-answer { padding: 10px 24px 28px; }
.faq-list .help-answer .help-conclusion { margin: 16px 0 26px; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.8; }
.help-steps-title { margin: 28px 0 12px; font-size: 19px; font-weight: 600; }
.help-steps { margin-top: 0; padding-left: 27px; font-size: 18px; line-height: 1.85; }
.help-steps li { margin-bottom: 16px; padding-left: 4px; }
.help-steps li::marker { color: var(--rose-deep); font-weight: 600; }
.help-checks { padding: 0; border-radius: 0; background: transparent; margin: 28px 0; }
.help-checks h3 { font-size: 19px; font-weight: 600; }
.help-check-row { gap: 20px; font-size: 18px; }
.faq-list .help-answer .help-notice { padding: 16px; border-radius: 12px; background: var(--surface-soft); font-size: 17px; }
.faq-list .help-answer .help-next { margin-top: 24px; font-size: 16px; line-height: 1.8; }
.help-source { margin-bottom: 0; font-size: 14px; }
.guide-dialog { border: 0; box-shadow: 0 20px 60px rgb(47 39 42 / 25%); }

/* Routine feedback has one timing language. Result motion is owned by the JS helper. */
main { overflow-x: clip; }
.nav-motion-track { position: absolute; top: 0; left: 0; pointer-events: none; border-radius: 10px; background: var(--gradient-selected); }
.bottom-nav.has-motion-track > .nav-item { position: relative; z-index: 1; }
.bottom-nav.has-motion-track > .nav-item.is-active { background: transparent; }
.bottom-nav.has-motion-track > .nav-item [data-icon] { transition: transform 280ms var(--ui-ease); }
.bottom-nav.has-motion-track > .nav-item.is-active [data-icon] { transform: translateY(-2px); }
.compare-pen-shape { transform-box: fill-box; transform-origin: center; }
.compare-pencil { overflow: hidden; }
.decision-stroke { display: block; width: min(100%, 360px); height: 12px; margin-top: 10px; color: var(--rose); }
.decision-stroke path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (min-width: 700px) { .bottom-nav.has-motion-track { position: relative; } }
.result-section.is-revealing, .result-section.is-revealing .recommendation-card,
.result-section.is-revealing .alternative-card, .result-section.is-revealing .empty-result,
.result-section.is-revealing .trust-strip { animation: none; }
.help-filters button, .result-edit-button, .help-shortcuts button, .guide-dialog-top button { transition: background-color 120ms ease, color 120ms ease, transform 120ms ease; }
.help-filters button:active, .result-edit-button:active, .guide-dialog-top button:active { transform: scale(0.97); }
.help-shortcuts button:focus-visible, .help-filters button:focus-visible, .help-issue > summary:focus-visible { outline: 3px solid var(--rose-deep); outline-offset: 3px; }
@media (hover: hover) {
  .help-issue > summary:hover { background-color: var(--surface-soft); }
  .help-shortcuts button:hover { color: var(--ink); }
}
@media (max-width: 599px) {
  .result-heading { flex-wrap: wrap; }
  .result-bridge { gap: 9px; margin-bottom: 24px; }
  .result-bridge-icon { display: none; }
  .result-bridge { grid-template-columns: minmax(0, 1fr) auto; }
  .recommendation-card .product-row { grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 22px 0; }
  .result-facts .fact-grid-core { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .result-facts .fact-tile-core { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; min-height: 54px; padding: 14px 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
  .result-facts .fact-tile-core .fact-label { flex-shrink: 0; }
  .result-facts .fact-tile-core .fact-value { margin: 0; text-align: right; }
  .selection-summary { gap: 12px; }
  .selection-summary p { font-size: 16px; }
  .page[data-page="faq"] .page-header { margin-top: 18px; margin-bottom: 28px; }
  .help-shortcuts { gap: 0 16px; margin-bottom: 22px; }
  .help-shortcuts > span { flex-basis: 100%; }
  .help-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq-list .help-issue > summary { padding: 20px 4px; font-size: 19px; }
  .faq-list .help-issue[open] > summary { padding-inline: 16px; }
  .faq-list .help-answer { padding-inline: 16px; }
  .help-check-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .help-chevron, .alternative-summary [data-icon], .help-filters button,
  .result-edit-button, .help-shortcuts button, .guide-dialog-top button { transition: none; }
}
[hidden] { display: none !important; }
