/* HSTB discovery follows the MDAS introduction, persistent chat and browse layout. */
.sps-discovery { margin-top:18px; }
.sps-discovery .sps-browse-top { border-color:#e0e5dc; border-bottom:0; border-radius:24px 24px 0 0; }
.sps-discovery .sps-browse-header { flex-direction:row; justify-content:space-between; gap:16px; padding:18px 26px; border-bottom-color:#e7ebe2; }
.sps-discovery .sps-browse-brand { font-size:32px!important; white-space:nowrap; }
.sps-discovery .sps-browse-squad { min-height:44px; padding:7px 13px; gap:7px; font-size:12px; box-shadow:none; }
.sps-discovery .sps-browse-squad-heart { width:22px; height:22px; font-size:16px; }
.sps-discovery .sps-browse-intro { padding:22px 20px 17px; }
.sps-discovery .sps-browse-intro h1 { font-size:32px!important; line-height:1.18!important; letter-spacing:-1px!important; margin-bottom:7px!important; }
.sps-discovery .sps-browse-shelter { font-size:18px; line-height:1.35; letter-spacing:-.3px!important; margin:0 auto 9px; color:#52675e; }
.sps-discovery .sps-browse-modes a { min-height:44px; padding:7px 12px; font-size:12px; background:transparent; border:0; color:#174d43!important; text-decoration:underline!important; text-underline-offset:3px; }
.sps-discovery:not(:has(>.sps-match-persistent)) .sps-browse-top { border-bottom:1px solid #e0e5dc; border-radius:24px; margin-bottom:28px; }
.sps-discovery #sps-pet-match { margin:0 0 28px; max-width:none; padding:0 26px 21px; border:1px solid #e0e5dc; border-top:0; border-radius:0 0 24px 24px; background:#fbfaf7; box-shadow:none; scroll-margin-top:16px; }
.sps-discovery #sps-pet-match .sps-match-heading { gap:16px; margin:0 0 14px; padding-top:20px; border-top:1px solid #e2e8dd; }
.sps-discovery #sps-pet-match .sps-match-heading h2 { font-size:25px; line-height:1.2; margin:0 0 6px; max-width:none; }
.sps-discovery #sps-pet-match .sps-match-heading p { font-size:14px; line-height:1.5; margin:0; color:#617469; }
.sps-discovery #sps-pet-match .sps-match-chat { gap:10px; padding:9px; border-color:#c1d0c3; border-radius:16px; align-items:center; box-shadow:0 2px 9px #174d4304; }
.sps-discovery #sps-pet-match .sps-match-chat textarea { min-height:54px; padding:8px 9px; line-height:1.5; resize:vertical; }
.sps-discovery #sps-pet-match .sps-match-chat textarea::placeholder { color:#77887d; opacity:1; }
.sps-discovery #sps-pet-match .sps-match-chat button { min-height:46px; min-width:148px; border-radius:12px; padding:12px 17px; font-size:13px; white-space:nowrap; }
.sps-discovery #sps-pet-match .sps-match-examples { display:flex; align-items:center; gap:6px 9px; flex-wrap:wrap; margin:12px 0 8px; }
.sps-discovery #sps-pet-match .sps-match-examples>span { width:100%; font-size:11px; color:#748477; line-height:1.5; }
.sps-discovery #sps-pet-match .sps-match-examples button { min-height:44px; width:auto; padding:8px 12px; border:1px solid #dfe6db; border-radius:99px; background:#fffdf9; color:#496757; font-size:12px; line-height:1.4; }
.sps-discovery #sps-pet-match .sps-match-examples button:hover { background:#edf3e9; border-color:#cbdacb; }
.sps-discovery #sps-pet-match .sps-match-actions { margin:0; }
.sps-discovery #sps-pet-match .sps-match-actions button { min-height:44px; font-size:12px; color:#667e6c; text-decoration:none; padding:6px 0; }
.sps-discovery #sps-pet-match:not(:has(.sps-match-message)) .sps-match-actions { display:none; }
.sps-discovery #sps-pet-match .sps-match-conversation { margin:0 0 14px; max-height:260px; }
.sps-discovery #sps-pet-match .sps-match-message { font-size:13px; line-height:1.6; border-radius:13px; padding:10px 13px; margin:7px 0; background:#eef3e9; }
.sps-discovery #sps-pet-match .sps-match-message.visitor { background:#174d43; color:#fff; }
.sps-discovery #sps-pet-match .sps-match-status { margin:12px 0 0; font-size:13px; color:#526d60; }
.sps-discovery #sps-pet-match .sps-match-grid { gap:15px; }
.sps-discovery #sps-pet-match .sps-match-grid article { border-radius:17px; padding:10px; box-shadow:none; border-color:#dde6da; }
.sps-discovery #sps-pet-match .sps-match-photo { border-radius:12px; }
.sps-discovery #sps-pet-match .sps-match-highlights { border-radius:10px; padding:12px; margin-top:12px; background:#f4f7f0; }
.sps-discovery-browse-heading { display:flex; align-items:center; gap:12px; margin:0 0 14px; padding:0 2px; }
.sps-discovery-browse-heading h2 { font:700 25px/1.25 Helvetica,Arial,sans-serif; margin:0; color:#174d43; }
.sps-discovery .sps-browse-tools { position:relative; top:auto!important; background:#fff; border:1px solid #e0e7dd; border-radius:18px; padding:18px 20px 14px; box-shadow:none; backdrop-filter:none; scroll-margin-top:16px; margin-bottom:18px; }
.sps-discovery .sps-browse-switches { justify-content:flex-start; margin:0 0 12px; gap:9px; }
.sps-discovery .sps-browse-species,.sps-discovery .sps-browse-campus { padding:3px; background:#f1f5ed; border-color:#e5eade; }
.sps-discovery .sps-browse-species button,.sps-discovery .sps-browse-campus button { min-height:44px; padding:9px 15px; font-size:13px; }
.sps-discovery .sps-browse-search { padding:12px 14px; min-height:46px; border-radius:11px; border-color:#dce5d9; background:#fcfdfb; font-size:15px; }
.sps-discovery .sps-browse-filter-details>summary { padding:12px 0; font-size:13px; min-height:44px; }
.sps-discovery .sps-browse-filter-details>summary span { font-size:11px; color:#7a887c; }
.sps-discovery .sps-browse-meta { margin-top:3px; padding-top:10px; border-top:1px solid #edf0e9; gap:10px; }
.sps-discovery .sps-browse-count { font-size:12px; color:#627969; }
.sps-discovery .sps-browse-clear { min-height:44px; font-size:12px; color:#627969; text-underline-offset:3px; }
.sps-discovery .sps-browse-view-switch { background:#f3f6ef; border-color:#e0e7dd; box-shadow:none; border-radius:11px; }
.sps-discovery .sps-browse-view-switch button { min-height:40px; padding:8px 11px; font-size:11px; }
.sps-discovery .sps-browse-mobile-view-switch { border:0; background:#f1f5ed; box-shadow:none; border-radius:11px; padding:3px; }
.sps-discovery .sps-browse-mobile-view-switch button { min-height:44px; padding:8px 13px; font-size:11px; }

/* The existing wheel engine runs in a focused dialog with its own scroll area. */
.sps-hstb-wheel-dialog .sps-wheel-dialog-header { position:sticky; top:0; z-index:13; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 18px; background:#fbfaf7; border-bottom:1px solid #e0e7dd; }
.sps-hstb-wheel-dialog .sps-wheel-dialog-header h2 { margin:0; font:700 22px/1.25 Helvetica,Arial,sans-serif; color:#174d43; }
.sps-hstb-wheel-dialog .sps-wheel-dialog-header [data-wheel-close] { position:static; float:none; flex:0 0 44px; margin:0; }
.sps-hstb-wheel-dialog .sss-app { width:100%; max-width:none; margin:0; border:0; border-radius:0; box-shadow:none; overflow:visible; }
.sps-hstb-wheel-dialog .sss-app>.sss-head,
.sps-hstb-wheel-dialog .sss-app>.sss-foot,
.sps-hstb-wheel-dialog .sps-wheel-browse-invite,
.sps-hstb-wheel-dialog .sps-profile-browse-all,
.sps-hstb-wheel-dialog .sps-profile-wheel-invite { display:none!important; }
.sps-hstb-wheel-dialog .sss-app .sss-stage-wheel:not([hidden]) { display:flex!important; flex-direction:column!important; padding:12px 18px 20px!important; }
.sps-hstb-wheel-dialog .sss-stage-wheel>h2 { display:none; }
.sps-hstb-wheel-dialog .sps-wheel-shelter-name { margin:0 0 10px!important; font-size:16px!important; line-height:1.4!important; }
.sps-hstb-wheel-dialog .sps-wheel-filters { order:0!important; margin:0 0 12px!important; }
.sps-hstb-wheel-dialog .sss-app .sss-stage-wheel .sps-wheel-main { order:1!important; }
.sps-hstb-wheel-dialog .sss-app .sss-stage-wheel .sps-wheel-main .sss-wheel-wrap { width:min(100%,340px,43svh)!important; margin:0 auto 10px!important; }
.sps-hstb-wheel-dialog .sss-stage-wheel .sps-discovery-progress { order:2!important; width:100%!important; max-width:380px!important; margin:12px auto 0!important; }
.sps-hstb-wheel-dialog .sss-stage-result { padding:18px!important; }
.sps-hstb-wheel-dialog .sss-stage-result>h2 { font-size:32px!important; }
.sps-hstb-wheel-dialog .sss-result-photo { max-width:440px; margin-inline:auto; }
.sps-hstb-wheel-dialog .sss-app .sps-account-modal { position:fixed; inset:0; }
@media(max-width:767px) {
 .sps-discovery { margin-top:10px; }
 .sps-discovery .sps-browse-header { padding:13px 14px; gap:8px; }
 .sps-discovery .sps-browse-brand { font-size:clamp(21px,6.1vw,29px)!important; }
 .sps-discovery .sps-browse-squad { gap:6px; padding:7px 9px; font-size:11px; }
 .sps-discovery .sps-browse-intro { padding:18px 12px 12px; }
 .sps-discovery .sps-browse-intro h1 { font-size:26px!important; line-height:1.2!important; margin-bottom:6px!important; }
 .sps-discovery .sps-browse-shelter { font-size:15px; margin-bottom:5px; letter-spacing:-.2px!important; }
 .sps-discovery .sps-browse-modes a { font-size:11px; padding:6px 10px; }
 .sps-discovery #sps-pet-match { padding:0 15px 17px; margin-bottom:24px; border-radius:0 0 22px 22px; }
 .sps-discovery #sps-pet-match .sps-match-heading { padding-top:17px; margin-bottom:13px; }
 .sps-discovery #sps-pet-match .sps-match-heading h2 { font-size:23px; margin-bottom:5px; }
 .sps-discovery #sps-pet-match .sps-match-heading p { font-size:13px; line-height:1.5; }
 .sps-discovery #sps-pet-match .sps-match-chat { padding:8px; gap:6px; border-radius:14px; }
 .sps-discovery #sps-pet-match .sps-match-chat textarea { min-height:58px; font-size:16px; padding:7px; }
 .sps-discovery #sps-pet-match .sps-match-chat button { min-height:44px; min-width:0; width:100%; border-radius:10px; font-size:13px; }
 .sps-discovery #sps-pet-match .sps-match-examples { gap:4px 6px; margin:10px 0 8px; }
 .sps-discovery #sps-pet-match .sps-match-examples>span { font-size:11px; flex-basis:100%; margin-bottom:1px; }
 .sps-discovery #sps-pet-match .sps-match-examples button { max-width:100%; padding:8px 11px; font-size:12px; }
 .sps-discovery #sps-pet-match .sps-match-grid { grid-template-columns:minmax(0,1fr); gap:14px; }
 .sps-discovery-browse-heading { gap:10px; margin-bottom:12px; padding:0 2px; }
 .sps-discovery-browse-heading h2 { font-size:22px; }
 .sps-discovery .sps-browse-tools { padding:13px 12px 12px; border-radius:15px; }
 .sps-discovery .sps-browse-switches { justify-content:center; margin-bottom:11px; }
 .sps-discovery .sps-browse-species button,.sps-discovery .sps-browse-campus button { padding:8px 11px; font-size:12px; }
 .sps-discovery .sps-browse-search { min-height:44px; font-size:16px; padding:11px 12px; }
 .sps-discovery .sps-browse-meta { row-gap:6px; padding-top:7px; }
 .sps-hstb-wheel-dialog .sss-app .sss-stage-wheel { padding:8px 10px 16px!important; }
 .sps-hstb-wheel-dialog .sss-stage-result { padding:14px!important; }
}
@media(max-width:360px) {
 .sps-discovery .sps-browse-squad>span:not(.sps-browse-squad-heart) { display:none; }
 .sps-discovery .sps-browse-squad { width:44px; padding:7px; }
 .sps-discovery .sps-browse-intro h1 { font-size:24px!important; }
 .sps-discovery .sps-browse-species button { padding-inline:9px; }
}

/* Existing mobile wheel layout rules use !important; hidden stages still win. */
.sps-hstb-wheel-dialog .sss-app .sss-stage[hidden] { display:none!important; }
