/* Search dialog, floating quote tab and exit popup. */

/* ---------- Search ---------- */
.sd-gs { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: center; align-items: flex-start; padding: min(12vh, 120px) 20px 20px; }
.sd-gs[hidden] { display: none; }
.sd-gs__backdrop { position: absolute; inset: 0; background: rgba(8, 10, 16, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s var(--ease-out); }
.sd-gs__panel { position: relative; display: flex; flex-direction: column; width: min(680px, 100%); max-height: min(640px, 100%); border-radius: 20px; background: var(--bg); color: var(--fg); box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px rgba(0, 0, 0, .45); overflow: hidden; opacity: 0; transform: translateY(-8px) scale(.985); transition: opacity .2s var(--ease-out), transform .25s var(--ease-out); }
.sd-gs.is-open .sd-gs__backdrop { opacity: 1; }
.sd-gs.is-open .sd-gs__panel { opacity: 1; transform: none; }
.sd-gs__form { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); }
.sd-gs__glass { --s: 20px; flex: none; color: var(--muted); }
.sd-gs.is-loading .sd-gs__glass { color: var(--accent); animation: sd-gs-pulse 1s ease-in-out infinite; }
@keyframes sd-gs-pulse { 50% { opacity: .35; } }
.sd-gs__input { flex: 1; min-width: 0; height: 64px; padding: 0; border: 0; outline: 0; background: none; color: var(--fg); font: 500 18px/1.2 var(--f-text, inherit); letter-spacing: -.01em; }
.sd-gs__input::placeholder { color: var(--muted); opacity: .8; }
.sd-gs__input::-webkit-search-cancel-button { display: none; }
.sd-gs kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font: 500 11px/1 var(--f-mono, monospace); }
.sd-gs__close { display: none; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--fg); cursor: pointer; }
.sd-gs__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 16px; }
.sd-gs__label, .sd-gs__group { margin: 8px 10px 10px; color: var(--muted); font: 500 11px/1.3 var(--f-mono, monospace); letter-spacing: .08em; text-transform: uppercase; }
.sd-gs__group { margin-top: 14px; }
.sd-gs__group:first-child { margin-top: 4px; }
.sd-gs__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 8px 14px; }
.sd-gs__chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 0; border-radius: var(--r-pill, 999px); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); font-size: 14px; line-height: 1.2; cursor: pointer; transition: box-shadow .2s, background-color .2s, color .2s; }
.sd-gs__chip .sd-icon { --s: 14px; color: var(--muted); }
.sd-gs__chip:hover, .sd-gs__chip:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-ink, var(--accent)); }
.sd-gs__quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 8px; }
.sd-gs__quick a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); font-size: 14px; font-weight: 500; text-decoration: none; transition: box-shadow .2s; }
.sd-gs__quick a .sd-icon { --s: 14px; color: var(--muted); }
.sd-gs__quick a:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.sd-gs__hit { position: relative; display: grid; gap: 3px; padding: 12px 44px 12px 14px; border-radius: 12px; color: var(--fg); text-decoration: none; transition: background-color .15s; }
.sd-gs__hit:hover, .sd-gs__hit.is-active { background: var(--accent-soft); }
.sd-gs__hit-t { font-size: 15.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.sd-gs__hit-e { color: var(--muted); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sd-gs__hit-go { position: absolute; top: 50%; right: 16px; color: var(--accent); opacity: 0; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s; }
.sd-gs__hit:hover .sd-gs__hit-go, .sd-gs__hit.is-active .sd-gs__hit-go { opacity: 1; transform: translate(0, -50%); }
.sd-gs mark { padding: 0 1px; border-radius: 3px; background: rgba(47, 91, 255, .16); color: inherit; }
.sd-gs__all { display: block; margin: 10px 8px 2px; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); color: var(--accent-ink, var(--accent)); font-size: 14px; font-weight: 600; text-align: center; text-decoration: none; }
.sd-gs__all:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.sd-gs__empty { padding: 12px 10px; color: var(--muted); font-size: 14.5px; }
.sd-gs__empty p { margin: 0 0 12px; }
.sd-gs__empty .sd-gs__chips { padding: 0 0 14px; }
.sd-gs__empty-t { color: var(--fg); font-size: 16px; }
.sd-gs__empty-ask a { color: var(--accent-ink, var(--accent)); font-weight: 600; }
.sd-gs__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sd-gs__foot { display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.sd-gs__foot span { display: inline-flex; align-items: center; gap: 4px; }
.sd-gs__foot-k { margin-left: auto; }

@media (max-width: 720px) {
	/* Phones: a sheet that drops from the top with a margin, not a full-screen takeover */
	.sd-gs { padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px; align-items: flex-start; }
	.sd-gs__panel { width: 100%; max-height: calc(100dvh - 20px); border-radius: 18px; transform: translateY(-14px); }
	.admin-bar .sd-gs__panel { max-height: calc(100dvh - 66px); }
	.sd-gs__form { padding: 0 8px 0 16px; }
	.sd-gs__input { height: 58px; font-size: 16px; }
	.sd-gs__body { padding: 10px 8px 14px; }
	.sd-gs__chip { padding: 8px 12px; font-size: 13.5px; }
	.sd-gs__quick a { padding: 11px 12px; font-size: 13.5px; }
	.sd-gs .sd-gs__kbd, .sd-gs__foot { display: none; }
	.sd-gs__close { display: grid; }
	.sd-gs__quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sd-gs__hit { padding-right: 14px; }
	.sd-gs__hit-go { display: none; }
}

/* ---------- Floating quote tab (right edge, middle) ---------- */
.sd-qtab { position: fixed; top: 50%; right: 0; z-index: 90; display: inline-flex; align-items: center; gap: 12px; padding: 18px 13px 20px; border: 0; border-radius: 0 12px 12px 0; background: var(--cobalt-600, #2F5BFF); color: #fff; font: 700 13px/1 var(--f-text, inherit); letter-spacing: .1em; text-transform: uppercase; writing-mode: vertical-rl; transform: translate(110%, -50%) rotate(180deg); box-shadow: -8px 10px 26px -10px rgba(30, 60, 200, .55); cursor: pointer; -webkit-font-smoothing: antialiased; transition: transform .45s var(--ease-out), padding .25s var(--ease-out), background-color .25s; }
.sd-qtab.is-in { transform: translate(0, -50%) rotate(180deg); }
.sd-qtab.is-away { transform: translate(110%, -50%) rotate(180deg); }
.sd-qtab:hover, .sd-qtab:focus-visible { padding-left: 17px; background: var(--cobalt-700, #1F3FCC); }
.sd-qtab__text { white-space: nowrap; }
.sd-qtab__dot { display: none !important; }
.sd-qtab:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
.sd-qtab__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.sd-qtab__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid rgba(74, 222, 128, .6); animation: sd-qtab-ping 2.4s ease-out infinite; }
@keyframes sd-qtab-ping { 0% { transform: scale(.6); opacity: 1; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
.sd-qtab__icon { order: 2; display: grid; place-items: center; transform: rotate(180deg); }
.sd-qtab__icon svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
	.sd-qtab { gap: 10px; padding: 14px 10px 16px; font-size: 11.5px; border-radius: 0 10px 10px 0; }
	.sd-qtab__icon svg { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) { .sd-qtab, .sd-qtab__dot::after { transition: none; animation: none; } }
@media print { .sd-qtab, .sd-gs, .sd-exit { display: none !important; } }

/* ---------- Exit popup ---------- */
.sd-exit { position: fixed; inset: 0; z-index: 1001; display: grid; place-items: center; padding: 24px; }
.sd-exit[hidden] { display: none; }
.sd-exit__backdrop { position: absolute; inset: 0; background: rgba(8, 10, 16, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s var(--ease-out); }
.sd-exit__card { position: relative; width: min(520px, 100%); padding: 40px 40px 30px; border-radius: 24px; background: var(--bg); color: var(--fg); box-shadow: 0 0 0 1px var(--line), 0 40px 90px -24px rgba(0, 0, 0, .5); overflow: hidden; opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .25s var(--ease-out), transform .35s var(--ease-out); }
.sd-exit__card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--cobalt-500, #3B6BFF), #7DD3FC); }
.sd-exit.is-open .sd-exit__backdrop { opacity: 1; }
.sd-exit.is-open .sd-exit__card { opacity: 1; transform: none; }
.sd-exit__x { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--fg); cursor: pointer; }
.sd-exit__x:hover { background: var(--accent-soft); }
.sd-exit__kicker { margin: 0 0 10px; color: var(--accent-ink, var(--accent)); font: 500 11px/1.3 var(--f-mono, monospace); letter-spacing: .1em; text-transform: uppercase; }
.sd-exit__title { margin: 0 0 12px; padding-right: 30px; font-size: clamp(24px, 3vw, 30px); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; }
.sd-exit__lead { margin: 0 0 22px; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.sd-exit__form { display: grid; gap: 12px; }
.sd-exit__form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.sd-exit__form input { width: 100%; height: 50px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); font: 400 16px/1 var(--f-text, inherit); transition: box-shadow .2s; }
.sd-exit__form input:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--accent); }
.sd-exit__hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }
.sd-exit__send { width: 100%; min-height: 52px; margin-top: 4px; justify-content: center; }
.sd-exit__msg { min-height: 1em; margin: 0; color: #DC2626; font-size: 13.5px; }
.sd-exit__msg:empty { display: none; }
.sd-exit__trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--muted); font-size: 12.5px; }
.sd-exit__trust li { display: inline-flex; align-items: center; gap: 6px; }
.sd-exit__trust li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22C55E; }
.sd-exit__done { display: grid; gap: 10px; justify-items: start; }
.sd-exit__done p { margin: 0; color: var(--muted); line-height: 1.6; }
.sd-exit__done-t { color: var(--fg) !important; font-size: 18px; font-weight: 600; }

/* Logged-in admin bar sits above everything: keep dialogs below it */
.admin-bar .sd-gs, .admin-bar .sd-exit { top: 32px; }
@media (max-width: 782px) { .admin-bar .sd-gs, .admin-bar .sd-exit { top: 46px; } }

/* ---------- Header search button ---------- */
.sd-gs-btn:hover { background: var(--nav-pill-2); }
