/* Selection tools share the catalogue's sage, cream and thread details. */
#compareTray[hidden], #recentPieces[hidden], #shareFallback[hidden] { display:none }
.companion-visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.compare-toggle, .companion-text, .companion-primary {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:44px; padding:0 12px; border-radius:5px; border:1px solid transparent;
  font:inherit; font-size:.8rem; font-weight:650; line-height:1.2; cursor:pointer;
}
.compare-toggle, .companion-text { background:transparent; color:#345540 }
.compare-toggle { padding-inline:0 8px; margin-top:2px }
.compare-toggle span { display:grid; place-items:center; border:1px solid #62775e; border-radius:3px; width:14px; height:14px }
.compare-toggle[aria-pressed=true] span { background:#345540; border-color:#345540; color:#fff }
.compare-toggle[aria-pressed=true] span::before { content:""; width:6px; height:3px; border-left:1.5px solid; border-bottom:1.5px solid; transform:translateY(-1px) rotate(-45deg) }
.companion-text { text-decoration:underline; text-underline-offset:3px }
.companion-primary { background:#345540; border-color:#345540; color:#fff }
.companion-primary:disabled { background:#e5e9dc; border-color:#c8d2c1; color:#4d6352; cursor:default }
.compare-toggle:focus-visible, .companion-text:focus-visible, .companion-primary:focus-visible,
#compareSelection button:focus-visible, .recent-piece:focus-visible, #shareUrl:focus-visible { outline:2px solid #345540; outline-offset:3px }
.compare-tray {
  position:sticky; top:84px; z-index:8;
  display:grid; grid-template-columns:minmax(155px,.8fr) minmax(0,1.5fr) auto; align-items:center; gap:12px;
  margin:0 0 22px; padding:12px 15px;
  color:#263e30; background:#f0f2e7; border:1px solid #a8b7a1; border-radius:12px 4px 12px 4px;
  box-shadow:0 6px 18px #263e3014;
}
.compare-tray h3, .compare-tray p, #compareSelection { margin:0 }
.compare-tray h3 { font-family:inherit; font-size:.88rem; font-weight:650; line-height:1.25 }
.compare-tray p { margin-top:4px; color:#485d4a; font-size:.75rem; line-height:1.35 }
#compareSelection { display:flex; flex-wrap:wrap; align-items:center; gap:0 6px; padding:0; list-style:none; min-width:0 }
#compareSelection li { min-width:0; max-width:100% }
#compareSelection button { display:inline-flex; align-items:center; gap:6px; min-height:44px; text-align:left; overflow-wrap:anywhere; padding:5px 6px; background:none; border:0; color:#304f3b; font:inherit; font-size:.75rem; line-height:1.2; cursor:pointer }
#compareSelection button span { flex:none; background:#e2e8d9; border-radius:50%; display:grid; place-items:center; width:18px; height:18px; font-size:.95rem; line-height:1 }
.compare-actions { display:flex; align-items:center; justify-content:flex-end; gap:4px; white-space:nowrap }
.compare-dialog { width:min(860px,calc(100vw - 26px)); max-height:calc(100dvh - 28px); padding:0; background:#f5f2e9; color:#283e30; border:1px solid #b3c0ac; border-radius:18px 5px 18px 5px }
.compare-dialog-body { padding:25px clamp(14px,4vw,35px) }
.compare-dialog h2 { margin:6px 46px 0 0; font-family:var(--serif); font-size:clamp(1.7rem,5vw,2.55rem); line-height:1.13; font-weight:400 }
.compare-intro { margin:8px 0 18px; color:#4b6351; font-size:.9rem }
.compare-details { display:grid; grid-template-columns:repeat(var(--compare-cols,2),minmax(0,1fr)); gap:10px }
.compare-piece { min-width:0; display:flex; flex-direction:column; overflow:hidden; border:1px solid #c6d0bf; border-radius:9px 3px 9px 3px; background:#edf0e5 }
.compare-piece>img { display:block; width:100%; height:clamp(95px,20vh,174px); object-fit:cover; object-position:50% 44% }
.compare-piece-content { display:flex; flex:1; flex-direction:column; align-items:flex-start; gap:8px; padding:12px; min-width:0; overflow-wrap:anywhere }
.compare-piece h3, .compare-piece p, .compare-piece dl { margin:0 }
.compare-piece h3 { font:400 1.18rem/1.17 var(--serif) }
.compare-price { color:#345540; font-weight:700; font-size:.88rem }
.compare-price small { display:block; color:#546759; font-size:.68rem; font-weight:500 }
.compare-piece dl { display:grid; gap:5px; width:100%; margin-bottom:3px; font-size:.78rem; line-height:1.35 }
.compare-piece dl div { border-top:1px solid #ccd5c5; padding-top:5px }
.compare-piece dt { color:#485d4a; font-weight:650 }
.compare-piece dd { margin:1px 0 0 }
.compare-piece .companion-primary { margin-top:auto; align-self:stretch }
.recent-pieces { border-top:1px solid #afbea7; margin-top:30px; padding-top:13px }
.recent-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:7px }
.recent-heading h3 { color:#314b39; font:400 clamp(1.25rem,3vw,1.7rem)/1.1 var(--serif); margin:0 }
.recent-heading button { text-align:right; padding-inline:4px }
.recent-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px }
.recent-piece { display:grid; grid-template-columns:44px minmax(0,1fr) auto; gap:8px; align-items:center; padding:5px; border:1px solid #c3cdbd; border-radius:7px 3px 7px 3px; background:#edf0e5; color:#314b39; text-align:left; font:inherit; cursor:pointer; min-width:0 }
.recent-piece img { display:block; width:44px; height:44px; object-fit:cover; border-radius:3px }
.recent-piece small, .recent-piece strong { display:block; line-height:1.25; overflow-wrap:anywhere }
.recent-piece small { color:#4c6250; font-size:.68rem }
.recent-piece strong { font-size:.78rem; margin-top:3px }
.recent-piece svg { width:13px; height:13px }
.detail-share { margin:0; color:#345540; min-width:0 }
.detail-share .companion-text { padding-inline:0 10px }
.detail-share p { margin:0; font-size:.8rem; line-height:1.35 }
#shareFallback { margin-top:8px; font-size:.8rem }
#shareUrl { display:block; max-width:100%; width:100%; min-height:44px; border:1px solid #a8b7a1; border-radius:5px; background:#f5f2e9; color:#283e30; font:inherit; padding-inline:8px; margin-top:5px }
@media (hover:hover) {
 .compare-toggle:hover, .companion-text:hover, #compareSelection button:hover { text-decoration:underline; text-underline-offset:3px }
 .companion-primary:hover:not(:disabled) { background:#264733 }
 .recent-piece:hover { background:#e3eadc }
}
@media (max-width:860px) {
 .compare-tray { grid-template-columns:minmax(0,1fr) auto; gap:0 8px; padding:8px 10px }
 #compareSelection { grid-area:2/1/3/-1 }
 .recent-list { grid-template-columns:repeat(2,minmax(0,1fr)) }
}
@media (max-width:580px) {
 .compare-tray { margin-bottom:13px }
 .compare-actions { justify-content:flex-end }
 .compare-details { grid-template-columns:1fr; gap:8px }
 .compare-piece { display:grid; grid-template-columns:clamp(70px,23vw,108px) minmax(0,1fr) }
 .compare-piece>img { height:auto; aspect-ratio:3/4; object-position:50% 48% }
 .compare-piece-content { gap:6px; padding:9px }
 .compare-piece dl { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 8px }
 .recent-piece { grid-template-columns:38px minmax(0,1fr); gap:6px }
 .recent-piece img { width:38px; height:42px }
 .recent-piece svg { display:none }
}
@media (max-width:580px) {
 .compare-tray { position:sticky; top:76px; grid-template-columns:minmax(0,1fr) auto; column-gap:4px; padding:4px 7px }
 .compare-tray h3 { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
 .compare-tray p { margin:0; font-size:.7rem }
 .compare-actions { gap:1px }
 .compare-actions button { padding-inline:5px; font-size:.7rem }
 #compareSelection { grid-area:2/1/3/-1; flex-wrap:nowrap; overflow-x:auto }
 #compareSelection li { flex:none }
 #compareSelection button { min-height:34px; white-space:nowrap; font-size:.7rem }
 #compareSelection button:focus-visible { outline-offset:-2px }
 .compare-toggle { scroll-margin-top:175px }
}
