/* Mouse finder. The page is one scroller: the thread grows down the document and the composer sticks
   to the bottom of the viewport, so a card and its buttons can never hide under the input. Loaded only
   on /recommend/ (and, for .pcard, on /quiz/), so the .document-page and footer overrides below are
   page-local. The star component lives in community.css; only its size is adjusted here. */

.document-page{margin-top:24px;line-height:1.55}
.document-page>.site-footer{padding-top:34px}

.finder{
 --column:960px;--card:color-mix(in srgb,var(--surface-2) 60%,var(--surface));
 width:100%;max-width:var(--column);margin:0 auto;display:flex;flex-direction:column
}
/* Filled buttons use the darker accent so white text passes AA; the design track's token wins once it lands. */
.finder .button.primary,.send{background:var(--accent-fill,#c93d1a)}
.finder .button.primary:hover,.send:hover:not(:disabled){background:color-mix(in srgb,var(--accent-fill,#c93d1a) 86%,black)}

/* ---------- Empty state: heading, one plain line, starters. The hero collapses once a thread starts. */
.finder-hero{text-align:center;padding:28px 0 18px;transition:opacity .22s var(--ease-out)}
:root.is-thread .finder-hero{display:none}
.document-page .finder-title{font-family:var(--display);font-weight:700;letter-spacing:-.01em;line-height:1.06;font-size:clamp(30px,5vw,50px);margin:0 0 12px}
.document-page .finder-lead{margin:0 auto;max-width:60ch;color:var(--muted);font-size:15px}

/* ---------- Thread ---------- */
.finder-thread{display:flex;flex-direction:column;gap:24px;min-width:0;padding:0 4px}
.finder-thread:empty{display:none}
:root.is-thread .finder-thread{padding:8px 4px 24px}
.msg{min-width:0;flex-shrink:0;scroll-margin-top:8px;animation:finder-rise .3s var(--ease-out) both}
.msg-you{display:flex;justify-content:flex-end}
.msg-you .bubble{background:var(--surface-2);border-radius:18px;padding:11px 17px;max-width:min(560px,86%);font-size:15.5px;line-height:1.55;overflow-wrap:anywhere}
.reply-text{font-size:16.5px;line-height:1.65;overflow-wrap:anywhere}
.reply-text+.reply-text{margin-top:10px}
.reply-heading{display:flex;align-items:flex-start;gap:10px;min-height:36px}
.reply-heading>span:last-child{min-width:0;padding-top:4px}
.finder p,.finder li{max-width:none}
.reply-mark{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px}
.reply-mark img{display:block;width:100%;height:100%;object-fit:contain}
@keyframes finder-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* Waiting: the seal breathes, three dots bounce and a short line says which stage it is on. */
.is-waiting .reply-mark{animation:finder-breathe 1.6s ease-in-out infinite}
@keyframes finder-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}
.is-waiting>span:last-child{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap}
.waiting-text{font-size:14px;color:var(--muted)}
.typing{display:inline-flex;gap:5px;align-items:center;vertical-align:middle;height:23px}
.typing span{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:finder-dot 1.15s var(--ease-out) infinite}
.typing span:nth-child(2){animation-delay:.15s}
.typing span:nth-child(3){animation-delay:.3s}
@keyframes finder-dot{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* ---------- Product carousel ---------- */
.carousel{position:relative;margin:18px 0 0}
.finder .carousel-track{display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 30px) / 4);gap:10px;list-style:none;margin:0;padding:4px 0 10px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:2px;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
.carousel-track::-webkit-scrollbar{height:6px}
.carousel-track::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:99px}
.carousel-nav{position:absolute;top:50px;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--surface);color:var(--ink);box-shadow:0 3px 12px rgba(20,22,26,.18),inset 0 0 0 1px var(--line-strong);opacity:0;transition:opacity .15s,background .15s;z-index:2}
.carousel-nav svg{width:17px;height:17px}
.carousel-nav.prev{left:5px}
.carousel-nav.prev svg{transform:rotate(180deg)}
.carousel-nav.next{right:5px}
.carousel-nav:hover{background:var(--surface-2)}
.carousel:hover .carousel-nav,.carousel-nav:focus-visible{opacity:1}
@media (hover:none){.carousel-nav{display:none}}

.pcard{min-width:0;width:auto;scroll-snap-align:start;display:flex;flex-direction:column;background:var(--card);border:1px solid var(--line);border-radius:14px;overflow:hidden;transition:border-color .15s,box-shadow .15s,transform .15s var(--ease-out)}
.pcard:hover{border-color:var(--line-strong);box-shadow:0 6px 18px rgba(20,22,26,.09);transform:translateY(-2px)}
/* The image cap must be a length: a percentage height does not resolve against a centred grid item,
   so the photo would spill out of the plate and over the card text. */
.pcard-plate{--plate:126px;--plate-pad:14px;height:var(--plate);background:var(--photo);display:grid;place-items:center;padding:var(--plate-pad);overflow:hidden}
.pcard-plate img{width:100%;max-height:calc(var(--plate) - var(--plate-pad) * 2);object-fit:contain}
.pcard-plate .monogram{font-size:24px}
.pcard-body{flex:1 1 auto;min-width:0;padding:12px 14px 0;display:flex;flex-direction:column;gap:6px}
.pcard-brand{font-size:12px;color:var(--muted);line-height:1.2}
.pcard-name{font-family:var(--display);font-size:21px;font-weight:700;line-height:1.1;margin:0;overflow-wrap:anywhere;color:var(--ink)}
.pcard-rating{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.pcard-rating .star{width:14px;height:14px;flex-basis:14px}
.pcard-reason{font-size:13px;line-height:1.5;color:var(--ink);margin:1px 0 0}
.finder .pcard-specs{display:flex;flex-wrap:wrap;gap:6px;list-style:none;margin:auto 0 0;padding:12px 0 0}
.pcard-specs li{font-size:11.5px;line-height:1;padding:5px 9px;border-radius:999px;background:var(--surface);color:var(--muted);box-shadow:inset 0 0 0 1px var(--line);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.pcard-snapshot{font-size:11.5px;color:var(--muted);margin:2px 0 0}
.finder-seal-badge{display:inline-flex;align-items:center;gap:5px;width:max-content;max-width:100%;font-size:11.5px;font-weight:600;line-height:1.2;padding:3px 8px 3px 4px;border-radius:999px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));color:var(--ink);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
.finder-seal-badge img{width:16px;height:16px;border-radius:50%}
.pcard-actions{display:flex;gap:8px;padding:12px 14px 0}
.pcard-actions .button{flex:1 1 0;min-height:34px;padding:0 10px;font-size:13px;text-decoration:none;min-width:0}
.pcard-actions .button.primary{gap:5px;flex-grow:1.25}
.pcard-actions .button.primary span,.pcard-actions .button.primary{overflow:hidden;text-overflow:ellipsis}
.pcard-actions .button svg{width:14px;height:14px;flex-shrink:0}
.pcard-actions [data-shop] svg:last-child{transform:rotate(90deg)}
.pcard-links{display:flex;flex-wrap:wrap;gap:4px 14px;padding:8px 14px 12px}
.pcard-links a{display:inline-flex;align-items:center;gap:5px;font-size:12.5px;font-weight:500;color:var(--muted);text-decoration:none;min-height:24px}
.pcard-links a:hover{color:var(--ink)}
.pcard-links .ui-icon{width:14px;height:14px}
.pcard-links a[href^="https://www.youtube"] .ui-icon{fill:currentColor}
.document-page .finder-disclosure{margin:8px 0 0;font-size:12px;color:var(--muted)}

/* ---------- Reply extras ---------- */
.reply-gate{margin-top:16px}
.reply-gate .button{text-decoration:none}
.reply-actions{display:flex;flex-wrap:wrap;gap:2px;margin:16px 0 0 -9px}
.reply-action{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:var(--muted);padding:6px 9px;border-radius:8px;transition:background .15s,color .15s}
.reply-action:hover{background:var(--surface-2);color:var(--ink)}
.reply-action[aria-expanded="true"]{background:var(--surface-2);color:var(--ink)}
.reply-action svg{width:15px;height:15px;flex-shrink:0}
.reply-filters{margin-top:10px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:12.5px;line-height:1.6;color:var(--muted);display:grid;gap:8px}
.finder-retry{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.finder-retry .button{text-decoration:none;gap:6px}
.finder-retry .button svg{width:15px;height:15px}
.reply-compare{margin:14px 0 0}
.reply-compare .button{text-decoration:none;gap:6px}
.reply-compare .button svg{width:15px;height:15px}
.reply-follow-up{margin:18px 0 8px}
.follow-up-choices{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.reply-references{display:flex;flex-wrap:wrap;gap:8px 18px;margin:12px 0;font-size:13px}.reply-references a{display:inline-flex;align-items:center;gap:5px}
.reply-video{margin-top:14px}

/* ---------- Composer: sticks to the bottom once a thread exists ---------- */
.composer{width:100%;max-width:720px;margin:0 auto;flex-shrink:0}
:root.is-thread .composer{position:sticky;bottom:0;z-index:5;max-width:var(--column);padding:10px 0 max(8px,env(safe-area-inset-bottom,0px));background:linear-gradient(to top,var(--ground) 78%,transparent)}
.composer-form{display:flex;align-items:flex-end;gap:8px;background:var(--surface);border:1px solid var(--line-strong);border-radius:24px;padding:5px 5px 5px 18px;transition:border-color .16s,box-shadow .2s}
.composer-form:focus-within{border-color:var(--ink);box-shadow:0 6px 24px rgba(20,22,26,.10)}
:root.is-thread .composer-form{box-shadow:0 -6px 24px rgba(20,22,26,.06)}
.composer-form textarea{flex:1 1 auto;min-width:0;box-sizing:border-box;height:43px;min-height:43px;max-height:88px;border:0;background:none;resize:none;padding:10px 0;font-size:15.5px;line-height:1.5;overflow-y:auto;scrollbar-width:thin}
.composer-form textarea:focus{outline:none}
.composer-form textarea::placeholder{color:var(--muted)}
.send{flex:0 0 38px;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;color:var(--on-accent);transition:background .18s,color .18s,transform .12s var(--ease-out)}
.send svg{width:18px;height:18px}
.send:active:not(:disabled){transform:scale(.93)}
.send:disabled{background:var(--surface-2);color:var(--muted);opacity:1}

/* The quiz handoff waits above the input until it is sent or edited. */
.finder-handoff{margin:0 0 12px;padding:14px 16px;border-radius:14px;background:var(--surface);box-shadow:inset 0 0 0 1px var(--line);animation:finder-rise .3s var(--ease-out) both}
.document-page .finder-handoff-title{display:flex;align-items:center;gap:6px;margin:0 0 6px;font-size:12px;font-weight:600;color:var(--muted)}
.finder-handoff-title .ui-icon{width:14px;height:14px}
.document-page .finder-handoff-text{margin:0 0 12px;font-size:15px;line-height:1.5}
.finder-handoff-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.finder-handoff-actions .button{gap:6px}
.finder-handoff-actions .button svg{width:15px;height:15px}

/* Starters: example questions as tappable chips, wrapped so every one is readable in full. */
.starters{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;padding:14px 0 0}
:root.is-thread .starters{display:none}
.finder-chip{display:inline-flex;align-items:center;gap:6px;font-size:13.5px;font-weight:500;line-height:1.25;padding:8px 15px;border-radius:999px;background:var(--surface);color:var(--ink);box-shadow:inset 0 0 0 1px var(--line-strong);transition:background var(--fast),box-shadow var(--fast),transform .12s var(--ease-out);text-align:left;text-decoration:none;min-height:40px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.finder-chip:hover{background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--ink);transform:translateY(-1px)}
.finder-chip:active{transform:scale(.97)}
.finder-chip .ui-icon{width:14px;height:14px}
.finder-chip-link{color:var(--muted)}
.composer-meta{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 16px;min-height:32px;padding-top:8px}
.composer-meta p{margin:0;font-size:12px;line-height:1.5;color:var(--muted)}
.composer-meta a{color:inherit;text-underline-offset:3px}
.document-page .finder-gate{display:flex;align-items:center;gap:8px}
.finder-gate .brand-icon{width:16px;height:16px;flex-shrink:0;color:#5865f2}
:root.is-thread .composer-meta{justify-content:space-between}
.composer-foot{display:flex;align-items:center}
.composer-foot .text-button{padding:4px 0;font-size:12px}
.finder-mode-status{flex-basis:100%;order:3}

/* ---------- Seal row on the empty page ---------- */
.finder-seal{margin:34px 0 0;padding-top:22px;border-top:1px solid var(--line)}
:root.is-thread .finder-seal{display:none}
.document-page .finder-seal-title{display:flex;align-items:center;gap:8px;font-size:20px;margin:0 0 12px}
.finder-seal-title img{width:22px;height:22px;border-radius:50%}
.finder-seal-list{list-style:none;padding:0!important;margin:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.finder-seal-list li{max-width:none}
.finder-seal-list a{display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;padding:12px 10px 14px;border-radius:14px;background:var(--surface);box-shadow:inset 0 0 0 1px var(--line);text-decoration:none;transition:box-shadow .15s,transform .15s var(--ease-out)}
.finder-seal-list a:hover{box-shadow:inset 0 0 0 1px var(--line-strong),0 6px 18px rgba(20,22,26,.09);transform:translateY(-2px)}
.finder-seal-list img{width:72px;height:72px;object-fit:contain;background:var(--photo);border-radius:10px;margin-bottom:6px}
.finder-seal-brand{font-size:12px;color:var(--muted)}
.finder-seal-name{font-family:var(--display);font-size:19px;font-weight:700;line-height:1.1}
.finder-seal-meta{font-size:12px;color:var(--muted)}

/* ---------- Shop menu ---------- */
.shop-menu{position:fixed;z-index:70;min-width:190px;max-width:min(280px,calc(100vw - 24px));padding:6px;background:var(--surface);border:1px solid var(--line-strong);border-radius:12px;box-shadow:var(--shadow);display:grid;gap:2px}
.shop-menu a{display:flex;align-items:center;gap:9px;padding:9px 11px;border-radius:8px;font-size:13.5px;font-weight:500;text-decoration:none;color:var(--ink)}
.shop-menu a:hover{background:var(--surface-2)}
.shop-menu svg{width:15px;height:15px;flex-shrink:0;color:var(--muted)}

/* ---------- Details drawer ---------- */
#finder-detail{max-width:min(720px,calc(100vw - 32px));padding:0}
#finder-detail .close-dialog{z-index:2;background:color-mix(in srgb,var(--surface) 78%,transparent);backdrop-filter:blur(4px)}
#finder-detail .rating-summary{margin:0 0 14px}
#finder-detail .no-ratings{margin:0 0 14px;font-size:14px}
#finder-detail .finder-seal-badge{margin:4px 0 10px}
.drawer-reviews{margin:20px 0 4px}
.drawer-reviews h3{margin-bottom:10px}
.drawer-reviews .review-card{background:var(--surface-2)}
.drawer-more{display:block;margin-top:10px;font-size:13px;color:var(--muted)}
.drawer-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.drawer-links .button{text-decoration:none}

.reply-action[aria-pressed="true"]{background:var(--surface-2);color:var(--accent)}
.vote-status{align-self:center;color:var(--muted);font-size:12px;margin-left:6px}
.document-page .finder-history-note{font-size:12px;color:var(--muted);margin:14px auto 0;text-align:center}
:root.is-thread .finder-history-note{display:none}

@media (max-width:800px){
 .finder .carousel-track{grid-auto-columns:calc((100% - 20px) / 3)}
 .finder-seal-list{grid-template-columns:repeat(2,minmax(0,1fr))}
 #finder-detail{
  position:fixed;top:auto;left:0;right:0;bottom:0;width:auto;max-width:none;margin:0;
  max-height:92vh;max-height:92dvh;overflow:hidden;
  border-radius:16px 16px 0 0;padding:0 0 env(safe-area-inset-bottom,0px)
 }
 #finder-detail[open]{display:flex;flex-direction:column}
 #finder-detail .close-dialog{top:22px}
 #finder-detail-content{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
 #finder-detail .detail-body{padding:20px}
}
@media (max-width:640px){
 .finder-hero{padding-top:12px}
 .finder-title{font-size:clamp(26px,7.6vw,36px)}
 .msg-you .bubble{font-size:15px}
 .reply-text{font-size:16px}
 .carousel{margin:16px 0 0}
 .finder .carousel-track{grid-auto-columns:min(260px,84%);scroll-padding-inline:0}
 .composer-form textarea{font-size:16px}
 .reply-heading{gap:8px}
 .reply-mark{flex-basis:32px;width:32px;height:32px}
 .starters{gap:8px}
 .starters .finder-chip{min-height:44px;padding:8px 14px}
 .finder-seal-list a{padding:10px 8px 12px}
 .finder-seal-list img{width:60px;height:60px}
}
@media (prefers-reduced-motion:reduce){
 .typing span{animation:none;opacity:.5}
 .msg,.finder-handoff,.is-waiting .reply-mark{animation:none}
 .pcard:hover,.finder-chip:hover,.finder-chip:active,.finder-seal-list a:hover{transform:none}
 .finder-hero,.composer{transition:none}
 .carousel-track{scroll-behavior:auto}
}
