/* Studio-first demo (templates/studio_demo.html, static/js/studio-demo.js).
   The site card, toolbar, search panel and drawer use the Site Studio classes from studio-v2.css; this file adds the
   page frame (Site Studio's own frame rules live inline in site_studio.html), the tour, the lock and the sign-up panel.
   Only the theme variables from custom.css are used, so light and dark mode follow the visitor's setting. */

:root { --sd-top-h: 52px; --ss-ai-w: 400px; --sd-orange: var(--ac-accent); }

html, body.sd-body { height: 100%; }
body.sd-body {
    margin: 0; overflow: hidden; background: var(--color-background) !important; background-image: none !important;
    color: var(--color-text); font-family: var(--font-family);
}
.sd-body *, .sd-body *::before, .sd-body *::after { box-sizing: border-box; }
.sd-body [hidden] { display: none !important; }

/* ---------- top bar ---------- */
.sd-top {
    position: relative; z-index: 1500; height: var(--sd-top-h); display: flex; align-items: center; gap: 12px;
    padding: 0 12px 0 14px; background: var(--color-card); border-bottom: 1px solid var(--color-border);
}
.sd-brand { display: flex; align-items: center; gap: 8px; color: var(--color-text); text-decoration: none; min-width: 0; }
.sd-brand img { width: 30px; height: 30px; object-fit: contain; }
.sd-brand-name { font-size: 1rem; white-space: nowrap; }
.sd-brand-tag {
    font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
    border: 1px solid var(--color-border); color: var(--color-text-secondary);
}
.sd-top-mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.sd-top-links { display: flex; align-items: center; gap: 4px; }
.sd-link { color: var(--color-text-secondary); text-decoration: none; font-size: 0.85rem; padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.sd-link:hover { color: var(--color-text); background: var(--color-hover-bg); }
.sd-theme { padding: 6px; }
.sd-cta {
    border: 0; border-radius: 8px; background: var(--sd-orange); color: #fff; font-weight: 600; font-size: 0.85rem;
    padding: 8px 14px; cursor: pointer; white-space: nowrap; margin-left: 4px;
}
.sd-cta:hover { filter: brightness(1.06); }

/* ---------- studio frame (Site Studio's inline frame rules, for this page) ---------- */
.sd-page.experimental-page { position: relative; width: 100%; height: calc(100vh - var(--sd-top-h)); height: calc(100dvh - var(--sd-top-h)); overflow: hidden; }
.sd-page .map-container { position: absolute; top: 0; bottom: 0; left: 0; z-index: 1; }
.sd-page #map { width: 100%; height: 100%; background: #dfe6e9; }
.dark-mode .sd-page #map { background: #20262b; }
.sd-page .feature-cards-container { position: absolute; z-index: 1000; pointer-events: none; }
.sd-page .feature-card {
    position: absolute; background: var(--color-card); color: var(--color-text); pointer-events: all;
    border: 1px solid var(--color-border); overflow: hidden; padding: 0; margin: 0; text-align: left; transform: none;
}
.sd-page .feature-card:hover { transform: none; }
.sd-page .card-header {
    display: flex; align-items: center; justify-content: space-between; height: 35px; padding: 0 8px 0 6px;
    background: rgba(0,0,0,.06); border-bottom: 1px solid var(--color-border);
}
.dark-mode .sd-page .card-header { background: rgba(0,0,0,.2); }
.sd-page .card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; }
.sd-page .card-title .icon { width: 14px; height: 14px; color: var(--color-accent); flex-shrink: 0; }
.sd-badge {
    font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
    background: var(--color-hover-bg); color: var(--color-text-secondary); border: 1px solid var(--color-border);
}
.sd-badge.sd-badge-own { background: var(--ac-good-tint); color: var(--ac-good); border-color: transparent; }

.sd-page .chat-input { flex: 0 0 auto; padding: 10px 12px 12px; border-top: 1px solid var(--color-border); background: var(--color-card); }
.sd-page .input-group { display: flex; gap: 6px; flex-wrap: nowrap; }
.sd-page .input-field {
    flex: 1; border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 10px; font-size: 13px; resize: none;
    height: 38px; background: var(--color-background); color: var(--color-text); min-width: 0; font-family: inherit;
}
.sd-page .input-field:focus { outline: none; border-color: var(--ac-text-2); }
.sd-page .send-button {
    background: var(--color-accent); color: #000; border: 0; border-radius: 8px; width: 40px; display: grid; place-items: center; cursor: pointer;
}
.sd-page .send-button svg { width: 15px; height: 15px; }

.sd-caret::after { content: ''; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--ac-text-3); animation: sd-blink .9s step-end infinite; }
@keyframes sd-blink { 50% { opacity: 0; } }
.sd-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.sd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-secondary); opacity: .4; animation: sd-dot 1.2s infinite; }
.sd-dots i:nth-child(2) { animation-delay: .15s; } .sd-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sd-dot { 30% { opacity: 1; transform: translateY(-2px); } }
.sd-ai-src { margin-top: 8px; font-size: 0.72rem; color: var(--color-text-secondary); }

/* Locked AI analysis: first sentence readable, the rest shown as blurred bars (the text itself is never sent) */
.sd-locked { position: relative; margin-top: 8px; min-height: 118px; }
.sd-locked-bars { filter: blur(3px); opacity: .7; user-select: none; pointer-events: none; }
.sd-locked-bars span { display: block; height: 10px; margin: 7px 0; border-radius: 4px; background: var(--color-text-secondary); opacity: .35; }
.sd-locked-cta {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
    font-size: 0.8rem; font-weight: 600; color: var(--color-text);
}
.sd-locked-cta svg { width: 18px; height: 18px; color: var(--ac-text-2); }
.sd-locked-cta button { border: 0; border-radius: 8px; background: var(--sd-orange); color: #fff; font-weight: 600; font-size: 0.8rem; padding: 7px 12px; cursor: pointer; }

.sd-act {
    display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--color-border); background: transparent; color: var(--color-text-secondary);
    border-radius: 8px; padding: 4px 9px; font-size: 0.74rem; cursor: pointer;
}
.sd-act:hover { color: var(--color-text); border-color: var(--ac-border-strong); }
.sd-act svg { width: 13px; height: 13px; }

/* Site card skeleton (first paint, before the showcase answers) */
.sd-skel-line, .sd-skel-grid div { background: var(--color-hover-bg); border-radius: 6px; animation: sd-pulse 1.2s ease-in-out infinite; }
.sd-skel-line { height: 12px; margin: 6px 0; }
.sd-skel-line.w60 { width: 60%; height: 14px; } .sd-skel-line.w40 { width: 40%; } .sd-skel-line.w80 { width: 80%; height: 26px; margin-top: 10px; }
.sd-skel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.sd-skel-grid div { height: 58px; }
@keyframes sd-pulse { 50% { opacity: .45; } }

/* Fill-in animation for the card's facts and check rows */
.sd-in { animation: sd-in .35s ease-out both; }
@keyframes sd-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sd-meta { margin-top: 8px; font-size: 0.7rem; color: var(--color-text-secondary); }
.sd-meta a { color: inherit; }
.sd-card-msg { margin-top: 10px; font-size: 0.8rem; line-height: 1.45; }
.sd-card-msg button { margin-top: 8px; }

/* ---------- search panel ---------- */
.sd-page #locationCard { padding: 8px; }
.sd-search .ss-search-wrap { position: relative; margin: 0; }
.sd-search #locationInput { width: 100%; height: 40px; padding: 8px 40px 8px 34px; font-size: 14px; border-radius: 8px; }
.sd-search-hint { display: flex; align-items: center; gap: 6px; margin: 6px 2px 0; font-size: 0.74rem; color: var(--color-text-secondary); }
.sd-search-hint svg { width: 12px; height: 12px; }
.sd-search-hint.sd-err { color: #e5534b; }
.sd-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; font-size: 0.72rem; color: var(--color-text-secondary); }
.sd-ex {
    border: 1px solid var(--color-border); background: transparent; color: var(--color-text-secondary); border-radius: 999px;
    padding: 2px 9px; font-size: 0.72rem; cursor: pointer;
}
.sd-ex:hover, .sd-ex.on { color: var(--color-text); border-color: var(--ac-border-strong); }

/* ---------- layers drawer ---------- */
.sd-layers { display: flex; flex-direction: column; }
.sd-layers .card-header { padding-right: 40px; }
.sd-layers-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 10px; }
.sd-ly { border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.sd-ly-top { display: flex; align-items: center; gap: 8px; }
.sd-ly-name { font-weight: 600; font-size: 0.82rem; flex: 1; }
.sd-ly-src { font-size: 0.7rem; color: var(--color-text-secondary); margin-top: 2px; }
.sd-ly-st { font-size: 0.7rem; color: var(--color-text-secondary); margin-top: 3px; }
.sd-ly-leg { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 0.68rem; color: var(--color-text-secondary); }
.sd-ly-leg span { display: inline-flex; align-items: center; gap: 4px; }
.sd-ly-leg i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.sd-ly-leg i.f { height: 10px; width: 10px; opacity: .8; }
.sd-ly-leg i.d { width: 9px; height: 9px; border-radius: 50%; }
/* layer switch: the shared A switch (.st-switch in studio-tokens.css: 26 x 16, dark track when on) */
.sd-sw { flex: none; }
.sd-layers-more { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding: 10px 12px 14px; font-size: 0.74rem; color: var(--color-text-secondary); border-top: 1px solid var(--color-border); }
.sd-layers-more svg { width: 13px; height: 13px; }
.sd-layers-more span { flex: 1 1 200px; }
.sd-linkbtn { border: 0; background: none; padding: 0; color: var(--ac-text); font-weight: 500; font-size: 12px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--ac-border-strong); text-underline-offset: 2px; }

/* Map pin + pulse when a site is picked */
.sd-pin { position: relative; }
.sd-pin-dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--sd-orange); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.sd-pin-ring { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--sd-orange); animation: sd-ring 1.8s ease-out infinite; }
@keyframes sd-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(4.5); opacity: 0; } }
.sd-scan { pointer-events: none; }
.sd-tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9); }

/* ---------- tour (Option A: a popover, white surface, hairline, the menu shadow) ---------- */
.sd-tour {
    position: fixed; z-index: 2500; width: 300px; max-width: calc(100vw - 24px); background: var(--ac-surface); color: var(--ac-text);
    border: 1px solid var(--ac-border); border-radius: var(--ac-r-lg); padding: 12px 14px 0; box-shadow: var(--ac-menu-shadow); font: 400 13px/1.45 var(--ac-font);
    animation: sd-in .2s ease-out;
}
.sd-tour-arrow { position: absolute; width: 10px; height: 10px; background: var(--ac-surface); border: 1px solid var(--ac-border); transform: rotate(45deg); }
.sd-tour-step { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--ac-tracking-caps); color: var(--ac-text-3); }
.sd-tour-title { font-weight: 600; font-size: 14px; margin: 2px 0 4px; }
.sd-tour-text { line-height: 1.5; color: var(--ac-text-2); }
.sd-tour-foot { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.sd-tour-dots { display: flex; gap: 4px; flex: 1; }
.sd-tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ac-border-strong); }
.sd-tour-dots i.on { background: var(--ac-text); }
.sd-tour-skip { border: 0; background: none; color: var(--ac-text-2); font: 500 12px var(--ac-font); cursor: pointer; padding: 0 6px; height: 28px; border-radius: var(--ac-r); }
.sd-tour-skip:hover { background: var(--ac-hover); color: var(--ac-text); }
.sd-tour-next { border: 1px solid var(--ac-accent); border-radius: var(--ac-r); background: var(--ac-accent); color: var(--ac-text-on-accent); font: 500 12px/1 var(--ac-font); height: 28px; padding: 0 12px; cursor: pointer; }
.sd-tour-next:hover { background: var(--ac-accent-hover); border-color: var(--ac-accent-hover); }
.sd-scroll .sd-tour-target { box-shadow: inset 0 0 0 2px var(--ac-accent) !important; }
.sd-tour-bar { height: 2px; margin: 0 -14px; background: var(--ac-hover); }
.sd-tour-bar span { display: block; height: 100%; width: 0; background: var(--ac-text-2); }
.sd-tour-target { position: relative; z-index: 5; box-shadow: 0 0 0 2px var(--ac-accent), 0 0 0 6px var(--ac-accent-tint) !important; border-radius: 8px; transition: box-shadow .2s; }

/* ---------- sign-up panel (Option A: a modal card on the overlay; 8 px radius, hairlines, one primary button) ---------- */
.sd-gate {
    position: fixed; inset: 0; z-index: 3000; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--ac-overlay); animation: sd-fade .2s ease-out;
}
@keyframes sd-fade { from { opacity: 0; } }
.sd-gate-inner {
    position: relative; max-width: 1040px; margin: 32px auto; background: var(--ac-surface); color: var(--ac-text); font-family: var(--ac-font);
    border-radius: var(--ac-r-lg); border: 1px solid var(--ac-border); box-shadow: var(--ac-menu-shadow);
    padding: 32px 32px 28px; animation: sd-rise .25s ease-out;
}
@keyframes sd-rise { from { transform: translateY(8px); opacity: 0; } }
.sd-gate-close {
    position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; height: var(--ac-h-ctl); border: 1px solid var(--ac-border-strong);
    background: var(--ac-surface); color: var(--ac-text); border-radius: var(--ac-r); padding: 0 10px; font: 500 13px/1 var(--ac-font); cursor: pointer;
}
.sd-gate-close:hover { background: var(--ac-hover); }
.sd-gate-close svg { width: 16px; height: 16px; color: var(--ac-text-2); }
.sd-gate-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; }
.sd-gate-side { padding-top: 34px; }
.sd-gate-kicker { margin: 0 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--ac-tracking-caps); color: var(--ac-text-3); }
.sd-gate-main h2 { font-size: 22px; line-height: 1.25; font-weight: 600; margin: 0 0 8px; letter-spacing: -.02em; }
.sd-gate-reason { font-size: 14px; line-height: 1.5; margin: 0 0 16px; color: var(--ac-text-2); }
.sd-gate-points { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.45; }
.sd-gate-points li { display: flex; gap: 8px; }
.sd-gate-points svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ac-text-2); margin-top: 1px; }
.sd-form { display: flex; flex-direction: column; gap: 12px; }
.sd-form-row { display: flex; flex-direction: column; gap: 4px; }
.sd-form-row label { font-size: 12px; font-weight: 500; margin: 0; }
.sd-opt { font-weight: 400; color: var(--ac-text-2); }
.sd-form input, .sd-form select {
    height: 36px; border-radius: var(--ac-r); border: 1px solid var(--ac-border); background: var(--ac-surface); color: var(--ac-text);
    padding: 0 10px; font-size: 14px; font-family: inherit; width: 100%;
}
.sd-form input:hover, .sd-form select:hover { border-color: var(--ac-border-strong); }
.sd-form input:focus, .sd-form select:focus { outline: none; border-color: var(--ac-text-2); box-shadow: none; }
.sd-form-btn {
    height: 40px; border: 1px solid var(--ac-accent); border-radius: var(--ac-r); background: var(--ac-accent); color: var(--ac-text-on-accent); font: 500 14px/1 var(--ac-font); cursor: pointer; margin-top: 4px;
}
.sd-form-btn:hover { background: var(--ac-accent-hover); border-color: var(--ac-accent-hover); }
.sd-form-btn:focus-visible { outline: none; box-shadow: var(--ac-focus-ring); }
.sd-form-btn[disabled] { opacity: .7; cursor: wait; }
.sd-form-err { font-size: 13px; color: var(--ac-bad); background: var(--ac-bad-tint); border: 1px solid var(--ac-bad-line); border-radius: var(--ac-r); padding: 8px 10px; }
.sd-form-err a { color: inherit; font-weight: 600; }
.sd-form-fine { margin: 0; font-size: 12px; color: var(--ac-text-2); }
.sd-form-fine b { color: var(--ac-text); font-weight: 600; }
.sd-form-fine a { color: var(--ac-text); text-decoration: underline; text-decoration-color: var(--ac-border-strong); text-underline-offset: 2px; }
.sd-form-terms { font-size: 11px; }

.sd-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sd-tier { border: 1px solid var(--ac-border); border-radius: var(--ac-r-lg); padding: 12px; display: flex; flex-direction: column; min-width: 0; background: var(--ac-surface); }
.sd-tier-trial { border-color: var(--ac-text-2); }
.sd-tier-name { font-weight: 600; font-size: 13px; }
.sd-tier-price { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.sd-tier-price small { font-size: 12px; font-weight: 400; color: var(--ac-text-2); letter-spacing: 0; }
.sd-tier-tag { font-size: 12px; color: var(--ac-text-2); line-height: 1.4; }
.sd-tier ul { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--ac-text-2); }
.sd-tier li { padding: 3px 0 3px 16px; position: relative; }
.sd-tier li::before { content: '✓'; position: absolute; left: 0; color: var(--ac-good); font-weight: 600; }
.sd-tiers-fine { font-size: 12px; color: var(--ac-text-2); margin: 8px 0 0; }
.sd-tiers-fine a { color: var(--ac-text); text-decoration: underline; text-decoration-color: var(--ac-border-strong); text-underline-offset: 2px; }
.sd-quotes { margin-top: 16px; display: grid; gap: 8px; }
.sd-quote { margin: 0; padding: 12px; border-radius: var(--ac-r-lg); background: var(--ac-surface-2); border: 1px solid var(--ac-border); }
.sd-quote blockquote { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.sd-quote figcaption { font-size: 12px; color: var(--ac-text-2); }
.sd-quotes-note { font-size: 11px; color: var(--ac-text-3); margin: 0; }
.sd-trust { margin-top: 16px; }
.sd-trust-featured { font-size: 12px; margin: 0 0 10px; color: var(--ac-text-2); }
.sd-trust-featured b { color: var(--ac-text); font-weight: 600; }
.sd-trust-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--ac-tracking-caps); color: var(--ac-text-3); margin: 0 0 6px; }
.sd-trust-logos { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-trust-logos span { font-size: 11px; font-weight: 500; height: 20px; display: inline-flex; align-items: center; padding: 0 6px; border-radius: var(--ac-r-xs); border: 1px solid var(--ac-border); color: var(--ac-text-2); }
.sd-noscript { position: fixed; inset: auto 0 0 0; z-index: 4000; padding: 12px; text-align: center; background: var(--ac-surface); color: var(--ac-text); border-top: 1px solid var(--ac-border); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
    :root { --ss-ai-w: 360px; }
    .sd-page #locationCard { width: 340px !important; }
}
@media (max-width: 900px) {
    .sd-hide-sm { display: none !important; }
    .sd-gate-grid { grid-template-columns: 1fr; gap: 24px; }
}
/* Phone: map on top, the panel as a sheet below it; the toolbar keeps icons only */
@media (max-width: 768px) {
    :root { --sd-top-h: 50px; }
    .sd-brand-name, .sd-brand-tag { display: none; }
    .sd-top-mid { justify-content: flex-start; }
    .sd-ex { white-space: nowrap; flex: none; }
    .sd-top { gap: 6px; padding: 0 8px; }
    .sd-link { padding: 6px 6px; font-size: 0.8rem; }
    .sd-cta { padding: 7px 10px; font-size: 0.8rem; }
    .sd-theme { display: none; }
    .sd-page.experimental-page { height: auto; min-height: calc(100dvh - var(--sd-top-h)); overflow: visible; }
    body.sd-body { overflow: auto; }
    .sd-page .map-container { position: relative; height: 46vh; height: 46dvh; right: 0 !important; }
    .sd-page .feature-cards-container { position: static; pointer-events: auto; }
    .ss-studio-v2.sd-page #chatCard {
        position: relative !important; width: 100% !important; top: auto !important; bottom: auto !important; right: auto !important;
        border-left: 0 !important; border-top: 1px solid var(--color-border) !important; min-height: 54vh;
    }
    .sd-page #chatCard .card-content { height: auto !important; }
    .sd-scroll { overflow: visible; }
    .sd-page .chat-input { position: sticky; bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .ss-studio-v2.sd-page #locationCard { position: absolute; top: 8px !important; left: 8px !important; right: 8px !important; width: auto !important; z-index: 1001; }
    .sd-search-hint { display: none; }
    .sd-examples { flex-wrap: nowrap; overflow-x: auto; }
    .ss-studio-v2 .sd-toolbar { top: calc(46vh - 64px); top: calc(46dvh - 64px); right: 8px !important; }
    .sd-toolbar .ss-tool-btn span { display: none; }
    .sd-page .leaflet-control-attribution { font-size: 9px; max-width: 62vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sd-toolbar .ss-tool-btn { padding: 8px; }
    .ss-studio-v2.sd-page #dataLayersCard { position: fixed; top: var(--sd-top-h) !important; width: 86vw !important; z-index: 2000 !important; }
    .sd-gate-inner { margin: 0; border-radius: 0; min-height: 100%; padding: 56px 18px 28px; border: 0; }
    .sd-gate-main h2 { font-size: 1.45rem; }
    .sd-gate-side { padding-top: 0; }
    .sd-tiers { grid-template-columns: 1fr; }
    .sd-tier ul { display: none; }
    .sd-tier { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 12px; }
    .sd-tier-tag { flex-basis: 100%; }
    .sd-tour-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sd-in, .sd-tour, .sd-gate, .sd-gate-inner, .sd-pin-ring, .sd-skel-line, .sd-skel-grid div, .sd-caret::after { animation: none !important; }
}

/* Pay now: billing toggle (an A segmented control) and plan buttons (2026-11-07) */
.sd-cycle { display: inline-flex; border: 1px solid var(--ac-border); border-radius: var(--ac-r); padding: 0; margin: 0 0 10px; gap: 0; overflow: hidden; height: var(--ac-h-ctl); background: var(--ac-surface); }
.sd-cycle-btn { border: 0; background: transparent; color: var(--ac-text-2); font: 500 13px var(--ac-font); padding: 0 12px; border-radius: 0; cursor: pointer; }
.sd-cycle-btn + .sd-cycle-btn { border-left: 1px solid var(--ac-border); }
.sd-cycle-btn small { font-weight: 400; color: var(--ac-good); margin-left: 4px; }
.sd-cycle-btn.on { background: var(--ac-hover); color: var(--ac-text); }
.sd-tier-btn { margin-top: auto; height: var(--ac-h-ctl); border: 1px solid var(--ac-border-strong); background: var(--ac-surface); color: var(--ac-text); font: 500 13px/1 var(--ac-font); padding: 0 10px; border-radius: var(--ac-r); cursor: pointer; }
.sd-tier ul { margin-bottom: 10px; }
.sd-tier-btn:hover { background: var(--ac-hover); }
.sd-tier-top .sd-tier-btn { background: var(--ac-accent); border-color: var(--ac-accent); color: var(--ac-text-on-accent); }
.sd-tier-top .sd-tier-btn:hover { background: var(--ac-accent-hover); border-color: var(--ac-accent-hover); }
.sd-tier-btn[disabled] { opacity: 0.6; cursor: wait; }

/* Tour waits for the visitor (2026-11-07): Next pulses softly so the way forward is obvious */
.sd-tour-arrow { z-index: -1; }
.sd-tour-next { animation: sd-next-pulse 1.8s ease-out infinite; }
.sd-tour-next:hover, .sd-tour-next:focus-visible { animation: none; }
@keyframes sd-next-pulse {
    0% { box-shadow: 0 0 0 0 var(--ac-accent-line); }
    70% { box-shadow: 0 0 0 6px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .sd-tour-next { animation: none; } }

/* ==========================================================================================================
   Right panel "Option A: Tabs" (owner-approved mockup, 2026-11-07). The panel itself (tokens, "Screening for" menu,
   slim site header, tabs, Overview / Checks / AI analyst, ask box) is in studio-panel.css, shared with the logged-in
   Site Studio and loaded after this file. Here: the demo page frame, top bar, layers drawer, search card and tour.
   ========================================================================================================== */
body.sd-body {
    --sd-top-h: 56px; --ss-ai-w: 420px;
    --color-border: var(--st-border); --color-background: var(--st-canvas); --sd-orange: var(--st-accent);
    font-family: var(--st-font); font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}
body.sd-body.dark-mode, .dark-mode body.sd-body {
    --color-card: var(--st-surface); --color-background: var(--st-canvas); --color-border: var(--st-border); --color-text: var(--st-text); --color-text-secondary: var(--st-text-2);
}

/* ---------- top bar in the Acrelume shell look (Option A, 2026-11-18; as .ac-site-header in acrelume-shell.css):
   white surface, one hairline, the logo partial, quiet nav links, 32 px controls, "Try it free" as the one primary button ---------- */
.sd-top { height: var(--sd-top-h); gap: var(--st-sp-3); padding: 0 var(--st-sp-4) 0 var(--st-sp-5); background: var(--ac-surface); border-bottom: 1px solid var(--ac-border); font-family: var(--ac-font); }
.sd-brand { gap: var(--st-sp-2); color: var(--ac-text); flex: none; }
.sd-brand:hover { color: var(--ac-text); }
.sd-brand .sd-brand-mark { display: none; }
.sd-brand-tag { display: inline-flex; align-items: center; height: 20px; font-size: 11px; font-weight: 500; color: var(--ac-text-2); background: var(--ac-hover); border: 0; border-radius: var(--ac-r-xs); padding: 0 6px; margin-left: 2px; }
.sd-top-mid { flex: 1; }
.sd-counter { display: inline-flex; align-items: center; gap: var(--st-sp-2); font-size: 12px; font-weight: 500; color: var(--ac-text-2); white-space: nowrap; margin-right: var(--st-sp-2); font-variant-numeric: tabular-nums; }
.sd-quota-bar { display: flex; gap: 3px; }
.sd-quota-bar i { width: 12px; height: 4px; border-radius: 2px; background: var(--ac-border-strong); }
.sd-quota-bar i.on { background: var(--ac-text-2); }
.sd-counter.sd-full { color: var(--ac-warn); }
.sd-top-links { display: flex; align-items: center; gap: 4px; }
.sd-link { display: inline-flex; align-items: center; height: var(--ac-h-ctl); color: var(--ac-text-2); font-weight: 500; font-size: 14px; padding: 0 10px; border-radius: var(--ac-r); text-decoration: none; transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease); }
.sd-link:hover { background: var(--ac-hover); color: var(--ac-text); }
.sd-theme { width: var(--ac-h-ctl); height: var(--ac-h-ctl); padding: 0; border: 0; border-radius: var(--ac-r); background: transparent; color: var(--ac-text-2); opacity: 1; display: inline-grid; place-items: center; }
.sd-theme:hover { background: var(--ac-hover); color: var(--ac-text); }
.sd-theme:hover svg { transform: none; }
.sd-theme svg { width: 16px; height: 16px; stroke-width: 1.75; }
.sd-link:focus-visible, .sd-theme:focus-visible, .sd-cta:focus-visible, .sd-brand:focus-visible { outline: none; box-shadow: var(--ac-focus-ring); }
.sd-cta { display: inline-flex; align-items: center; border: 1px solid var(--ac-accent); background: var(--ac-accent); color: var(--ac-text-on-accent); font: 500 13px/1 var(--ac-font); height: var(--ac-h-ctl); padding: 0 12px; border-radius: var(--ac-r); box-shadow: none; margin-left: var(--st-sp-1); }
.sd-cta:hover { filter: none; background: var(--ac-accent-hover); border-color: var(--ac-accent-hover); }


/* tour highlight inside the panel follows the element's own shape (calmer ring: accent line + soft halo) */
.sd-tabs .sd-tour-target { border-radius: 6px; }
.sd-scroll .sd-vcard.sd-tour-target { box-shadow: 0 0 0 2px var(--ac-accent), 0 0 0 6px var(--ac-accent-tint) !important; border-radius: 8px; }
.sd-ask.sd-tour-target { border-radius: 8px; }

/* map toolbar + search card: the A map chrome from studio-map.css (32 px, hairlines, no shadows) */

@media (max-width: 1100px) {
    body.sd-body { --ss-ai-w: 360px; }
    .sd-brand-tag, .sd-counter .sd-quota-bar { display: none; }
    .sd-link { font-size: 13px; padding: 0 8px; }
}
@media (max-width: 900px) {
    .sd-counter .sd-quota-bar { display: none; }
}
/* Phone: tabs stay; the top-bar menu becomes a compact icon control and the menu drops down full width (studio-panel.css) */
@media (max-width: 768px) {
    body.sd-body { --sd-top-h: 52px; }
    .sd-top { gap: 6px; padding: 0 8px; }
    .sd-top { padding: 0 8px 0 12px; }
    .sd-counter { font-size: 11.5px; }
    .sd-link { padding: 0 6px; font-size: 13px; }
    .sd-cta { height: var(--ac-h-ctl); padding: 0 10px; font-size: 13px; }
    .ss-studio-v2.sd-page #chatCard { overflow: visible; min-height: 54vh; border-left: 0 !important; }
    .sd-page .chat-input.sd-ft { position: sticky; bottom: 0; z-index: 3; }
    .sd-tour { left: 12px !important; right: 12px; width: auto; }
}


/* Layers drawer and search card in the mockup's style (desktop; Option A 2026-11-18) */
@media (min-width: 769px) {
    .ss-studio-v2.sd-page #dataLayersCard { width: 272px !important; box-shadow: none; border-right: 1px solid var(--ac-border); background: var(--ac-surface); }
    .ss-studio-v2.sd-page .feature-cards-container:has(#dataLayersCard.ss-open) #locationCard { left: 284px !important; width: 352px !important; }
    .ss-studio-v2.sd-page #locationCard { top: 12px !important; left: 12px !important; width: 392px !important; padding: 0; }
    .sd-layers .card-header { height: 48px; padding: 0 44px 0 16px; background: none !important; border-bottom: 1px solid var(--ac-border); }
    .sd-layers .card-title { font-size: 13px; font-weight: 600; }
    .sd-layers .card-title .icon { color: var(--ac-text-2); width: 16px; height: 16px; }
    .sd-layers .ss-drawer-close { top: 8px; right: 8px; width: 32px; height: 32px; border-radius: var(--ac-r); }
    .sd-layers-body { padding: 8px 8px 0; }
    .sd-ly { border: 0; border-radius: var(--ac-r); padding: 10px 8px; margin: 0; }
    .sd-ly + .sd-ly { border-top: 1px solid var(--ac-border); border-radius: 0; }
    .sd-ly-name { font-size: 13px; font-weight: 500; }
    .sd-ly-src, .sd-ly-st { font-size: 11px; color: var(--ac-text-3); line-height: 1.45; }
    .sd-ly-st { color: var(--ac-text-2); font-size: 12px; }
    .sd-ly-leg { font-size: 12px; color: var(--ac-text-2); }
    .sd-layers-more { display: grid; grid-template-columns: 16px 1fr; gap: 4px 8px; margin: 8px 16px 16px; padding: 12px; border: 1px solid var(--ac-border); border-radius: var(--ac-r-lg); background: var(--ac-surface-2); font-size: 12px; color: var(--ac-text-2); align-items: start; }
    .sd-layers-more svg { margin-top: 1px; width: 14px; height: 14px; }
    .sd-layers-more .sd-linkbtn { grid-column: 2; justify-self: start; font-size: 12px; }
    .sd-layers-more .sd-linkbtn::after { content: " \2192"; }
    .sd-search #locationInput { border: 0; background: transparent; height: 36px; font-size: 13px; padding-left: 34px; }
    .sd-search #locationInput:focus { box-shadow: none; }
    .sd-search-hint { font-size: 12px; color: var(--ac-text-3); margin: 0 12px 8px; }
    .sd-examples { margin: 0; padding: 8px 12px; border-top: 1px solid var(--ac-border); gap: 6px; font-size: 12px; color: var(--ac-text-3); }
    .sd-toolbar.ss-studio-toolbar { top: 12px; right: calc(var(--ss-ai-w) + 12px); }
}
}
@media (min-width: 769px) and (max-width: 1100px) {
    .ss-studio-v2.sd-page #locationCard { width: 340px !important; }
    .ss-studio-v2.sd-page .feature-cards-container:has(#dataLayersCard.ss-open) #locationCard { width: 300px !important; }
}

/* ===================================================================================================================
   SEO text (2026-11-08): H1 + intro in the search card, "About Acrelume" (templates/partials/studio_about.html) at
   the end of the Overview tab. Kept in this separate block; visible text, same for everyone (no cloaking).
   =================================================================================================================== */
.sd-hero { padding: 12px 12px 10px; }
.sd-h1 { margin: 0; font-size: 14px; line-height: 1.3; font-weight: 600; color: var(--sd-text, var(--color-text)); }
.sd-intro { margin: 2px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--sd-text2, var(--color-text-secondary)); }
.sd-search .sd-hero + .ss-search-wrap { border-top: 1px solid var(--sd-line, var(--color-border)); }

.sd-about { margin: 16px calc(-1 * var(--sd-pad, 16px)) 0; border-top: 1px solid var(--sd-line, var(--color-border)); padding: 4px var(--sd-pad, 16px) 0; scroll-margin-top: 8px; }
.sd-about-sum {
    list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; padding: 10px 0;
    font-size: 13px; font-weight: 600; color: var(--sd-text, var(--color-text));
}
.sd-about-sum::-webkit-details-marker { display: none; }
.sd-about-sum::before { content: "\203A"; display: inline-block; width: 10px; transition: transform .15s; color: var(--sd-text3, var(--color-text-secondary)); }
.sd-about[open] > .sd-about-sum::before { transform: rotate(90deg); }
.sd-about-sum small { font-size: 12px; font-weight: 400; color: var(--sd-text3, var(--color-text-secondary)); }
.sd-about-sum:hover span { color: var(--sd-text, var(--color-text)); }
.sd-about-sum:focus-visible { outline: none; box-shadow: var(--ac-focus-ring); border-radius: 4px; }
.sd-about-body { padding: 2px 0 8px 18px; font-size: 13px; line-height: 1.55; color: var(--sd-text2, var(--color-text-secondary)); }
.sd-about-body p { margin: 0 0 10px; }
.sd-about-h { margin: 16px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: var(--ac-tracking-caps); text-transform: uppercase; color: var(--sd-text3, var(--color-text-secondary)); }
.sd-about-list { margin: 0 0 10px; padding-left: 16px; }
.sd-about-list li { margin: 2px 0; }
.sd-about-body b, .sd-about-faq dt { color: var(--sd-text, var(--color-text)); font-weight: 600; }
.sd-about-faq { margin: 0 0 10px; }
.sd-about-faq dt { margin-top: 8px; }
.sd-about-faq dd { margin: 2px 0 0; }
.sd-about-body a { color: var(--sd-text, var(--color-text)); text-decoration: underline; text-decoration-color: var(--sd-line2, var(--color-border)); text-underline-offset: 2px; }
.sd-about-body a:hover { text-decoration-color: currentColor; }
.sd-about-more { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .sd-about-sum::before { transition: none; } }
@media (min-width: 769px) {
    .ss-studio-v2.sd-page #locationCard .sd-hero { padding: 12px 12px 10px; }
}
@media (max-width: 768px) {
    .sd-hero { padding: 6px 8px 4px; }
    .sd-h1 { font-size: 13px; }
    .sd-intro { font-size: 11px; }
}

/* Logo (partials/acrelume_logo.html): the lockup; on phones the bar is too narrow for it, so only the grid-and-bolt mark shows */
@media (max-width: 768px) {
    .sd-brand .sd-brand-full { display: none; }
    .sd-brand .sd-brand-mark { display: inline-block; }
}
