/* 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: #FF6B4A; }

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: rgba(255,107,74,.12); color: var(--color-text); border-color: rgba(255,107,74,.4); }

.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(--sd-orange); }
.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(--sd-orange); 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(--sd-orange); }
.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(--sd-orange); }
.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(--sd-orange); }

/* ---------- 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%; }
.sd-sw { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: var(--color-border); }
.sd-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.sd-sw[aria-checked="true"] { background: var(--sd-orange); }
.sd-sw[aria-checked="true"]::after { transform: translateX(14px); }
.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(--sd-orange); font-weight: 600; font-size: 0.74rem; cursor: pointer; text-decoration: underline; }

/* 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 ---------- */
.sd-tour {
    position: fixed; z-index: 2500; width: 290px; max-width: calc(100vw - 24px); background: #1f2328; color: #f0f3f6;
    border-radius: 12px; padding: 12px 14px 0; box-shadow: 0 12px 32px rgba(0,0,0,.35); font-size: 0.82rem;
    animation: sd-in .25s ease-out;
}
.dark-mode .sd-tour { background: #f6f8fa; color: #1f2328; }
.sd-tour-arrow { position: absolute; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); }
.sd-tour-step { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em; opacity: .65; }
.sd-tour-title { font-weight: 700; font-size: 0.92rem; margin: 2px 0 4px; }
.sd-tour-text { line-height: 1.45; opacity: .9; }
.sd-tour-foot { display: flex; align-items: center; gap: 8px; margin: 10px 0 10px; }
.sd-tour-dots { display: flex; gap: 4px; flex: 1; }
.sd-tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .25; }
.sd-tour-dots i.on { opacity: 1; background: var(--sd-orange); }
.sd-tour-skip { border: 0; background: none; color: inherit; opacity: .7; font-size: 0.76rem; cursor: pointer; padding: 4px; }
.sd-tour-next { border: 0; border-radius: 6px; background: var(--sd-orange); color: #fff; font-weight: 600; font-size: 0.76rem; padding: 5px 12px; cursor: pointer; }
.sd-scroll .sd-tour-target { box-shadow: inset 0 0 0 3px var(--sd-orange) !important; }
.sd-tour-bar { height: 3px; margin: 0 -14px; background: rgba(127,127,127,.25); }
.sd-tour-bar span { display: block; height: 100%; width: 0; background: var(--sd-orange); }
.sd-tour-target { position: relative; z-index: 5; box-shadow: 0 0 0 3px var(--sd-orange), 0 0 0 7px rgba(255,107,74,.25) !important; border-radius: 8px; transition: box-shadow .2s; }

/* ---------- sign-up panel ---------- */
.sd-gate {
    position: fixed; inset: 0; z-index: 3000; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: rgba(10,12,16,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: sd-fade .25s ease-out;
}
@keyframes sd-fade { from { opacity: 0; } }
.sd-gate-inner {
    position: relative; max-width: 1080px; margin: 32px auto; background: var(--color-card); color: var(--color-text);
    border-radius: 18px; border: 1px solid var(--color-border); box-shadow: 0 24px 64px rgba(0,0,0,.35);
    padding: 40px 40px 32px; animation: sd-rise .3s ease-out;
}
@keyframes sd-rise { from { transform: translateY(16px); opacity: 0; } }
.sd-gate-close {
    position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--color-border);
    background: var(--color-card); color: var(--color-text-secondary); border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; cursor: pointer;
}
.sd-gate-close:hover { color: var(--color-text); border-color: var(--sd-orange); }
.sd-gate-close svg { width: 15px; height: 15px; }
.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: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sd-orange); }
.sd-gate-main h2 { font-size: 1.85rem; line-height: 1.2; font-weight: 800; margin: 0 0 10px; letter-spacing: -.01em; }
.sd-gate-reason { font-size: 1rem; line-height: 1.5; margin: 0 0 14px; color: var(--color-text-secondary); }
.sd-gate-points { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; line-height: 1.4; }
.sd-gate-points li { display: flex; gap: 8px; }
.sd-gate-points svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--sd-orange); margin-top: 1px; }
.sd-form { display: flex; flex-direction: column; gap: 10px; }
.sd-form-row { display: flex; flex-direction: column; gap: 4px; }
.sd-form-row label { font-size: 0.8rem; font-weight: 600; margin: 0; }
.sd-opt { font-weight: 400; color: var(--color-text-secondary); }
.sd-form input, .sd-form select {
    height: 44px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-background); color: var(--color-text);
    padding: 0 12px; font-size: 16px; font-family: inherit; width: 100%;
}
.sd-form input:focus, .sd-form select:focus { outline: none; border-color: var(--sd-orange); box-shadow: 0 0 0 3px rgba(255,107,74,.18); }
.sd-form-btn {
    height: 48px; border: 0; border-radius: 10px; background: var(--sd-orange); color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer; margin-top: 4px;
}
.sd-form-btn:hover { filter: brightness(1.06); }
.sd-form-btn[disabled] { opacity: .7; cursor: wait; }
.sd-form-err { font-size: 0.85rem; color: #e5534b; background: rgba(229,83,75,.1); border-radius: 8px; padding: 8px 10px; }
.sd-form-err a { color: inherit; font-weight: 600; }
.sd-form-fine { margin: 0; font-size: 0.8rem; color: var(--color-text-secondary); }
.sd-form-fine b { color: var(--color-text); }
.sd-form-fine a { color: var(--sd-orange); }
.sd-form-terms { font-size: 0.72rem; }

.sd-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sd-tier { border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 12px; display: flex; flex-direction: column; min-width: 0; }
.sd-tier-trial { border: 2px solid var(--sd-orange); }
.sd-tier-name { font-weight: 700; font-size: 0.95rem; }
.sd-tier-price { font-size: 1.5rem; font-weight: 800; margin: 4px 0 2px; }
.sd-tier-price small { font-size: 0.75rem; font-weight: 500; color: var(--color-text-secondary); }
.sd-tier-tag { font-size: 0.74rem; color: var(--color-text-secondary); line-height: 1.35; }
.sd-tier ul { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.76rem; line-height: 1.35; }
.sd-tier li { padding: 3px 0 3px 16px; position: relative; }
.sd-tier li::before { content: '✓'; position: absolute; left: 0; color: #2da44e; font-weight: 700; }
.sd-tiers-fine { font-size: 0.74rem; color: var(--color-text-secondary); margin: 8px 0 0; }
.sd-tiers-fine a { color: var(--sd-orange); }
.sd-quotes { margin-top: 18px; display: grid; gap: 10px; }
.sd-quote { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--color-background); border: 1px solid var(--color-border); }
.sd-quote blockquote { margin: 0 0 6px; font-size: 0.85rem; line-height: 1.45; }
.sd-quote figcaption { font-size: 0.75rem; color: var(--color-text-secondary); }
.sd-quotes-note { font-size: 0.7rem; color: var(--color-text-secondary); margin: 0; }
.sd-trust { margin-top: 18px; }
.sd-trust-featured { font-size: 0.8rem; margin: 0 0 10px; color: var(--color-text-secondary); }
.sd-trust-featured b { color: var(--color-text); }
.sd-trust-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-secondary); margin: 0 0 6px; }
.sd-trust-logos { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-trust-logos span { font-size: 0.74rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--color-border); color: var(--color-text-secondary); }
.sd-noscript { position: fixed; inset: auto 0 0 0; z-index: 4000; padding: 12px; text-align: center; background: #FFBD59; color: #000; }

/* ---------- 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 and plan buttons (2026-11-07) */
.sd-cycle { display: inline-flex; border: 1px solid var(--color-border); border-radius: 999px; padding: 3px; margin: 0 0 10px; gap: 2px; }
.sd-cycle-btn { border: 0; background: transparent; color: var(--color-text-secondary); font: inherit; font-size: 0.8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.sd-cycle-btn small { font-weight: 500; opacity: 0.85; }
.sd-cycle-btn.on { background: var(--sd-orange); color: #fff; }
.sd-tier-btn { margin-top: auto; border: 1px solid var(--sd-orange); background: transparent; color: var(--sd-orange); font: inherit; font-weight: 700; font-size: 0.82rem; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.sd-tier ul { margin-bottom: 10px; }
.sd-tier-top .sd-tier-btn, .sd-tier-btn:hover { background: var(--sd-orange); color: #fff; }
.sd-tier-btn[disabled] { opacity: 0.6; cursor: wait; }

/* Tour waits for the visitor (2026-11-07): Next pulses so the way forward is obvious */
.sd-tour { width: 300px; }
.sd-tour-arrow { z-index: -1; }
.sd-tour-next { padding: 7px 16px; font-size: 0.8rem; animation: sd-next-pulse 1.6s ease-out infinite; }
.sd-tour-next:hover, .sd-tour-next:focus-visible { animation: none; filter: brightness(1.08); }
@keyframes sd-next-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,107,74,.65); }
    70% { box-shadow: 0 0 0 10px rgba(255,107,74,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,107,74,0); }
}
@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: #ECEBE8; --color-background: #F6F6F4;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}
body.sd-body.dark-mode, .dark-mode body.sd-body {
    --color-card: #17181C; --color-background: #111215; --color-border: #26282D; --color-text: #ECEDEF; --color-text-secondary: #A7ACB6;
}

/* ---------- top bar (mockup: brand · Screening for · spacer · quota · links · theme · CTA) ---------- */
.sd-top { gap: 16px; padding: 0 16px 0 20px; background: var(--sd-surface); border-bottom-color: var(--sd-line); }
.sd-brand { gap: 10px; }
.sd-brand img { width: 26px; height: 26px; }
.sd-brand-name { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.sd-brand-tag { font-size: 11px; font-weight: 500; color: var(--sd-text2); background: var(--sd-subtle); border: 0; padding: 3px 9px; }
.sd-top-mid { flex: 1; }
.sd-counter { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--sd-text2); white-space: nowrap; }
.sd-quota-bar { display: flex; gap: 3px; }
.sd-quota-bar i { width: 14px; height: 4px; border-radius: 2px; background: var(--sd-line2); }
.sd-quota-bar i.on { background: var(--sd-accent); }
.sd-counter.sd-full { color: var(--sd-accent-ink); }
.sd-link { color: var(--sd-text2); font-weight: 500; font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.sd-link:hover { background: var(--sd-subtle); color: var(--sd-text); }
.sd-theme { border-radius: 8px; color: var(--sd-text2); }
.sd-cta { background: var(--sd-accent); font-size: 13px; height: 36px; padding: 0 16px; border-radius: 10px; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 1px 2px rgba(217,71,42,.3); }


/* tour highlight inside the panel follows the element's own shape */
.sd-tabs .sd-tour-target { border-radius: 6px; }
.sd-scroll .sd-vcard.sd-tour-target { box-shadow: 0 0 0 3px var(--sd-orange), 0 0 0 7px rgba(255,107,74,.25) !important; border-radius: 12px; }
.sd-ask.sd-tour-target { border-radius: 12px; }

/* map toolbar + search card closer to the mockup (same buttons, softer frame) */
.sd-toolbar .ss-tool-btn { border-radius: 10px; box-shadow: var(--sd-shadow-sm), 0 0 0 1px var(--sd-line); border-color: transparent; }
.sd-page #locationCard { border-radius: 12px; box-shadow: var(--sd-shadow); border-color: transparent; }

@media (max-width: 1100px) {
    body.sd-body { --ss-ai-w: 360px; }
    .sd-brand-tag, .sd-counter .sd-quota-bar { display: none; }
}
@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-brand img { width: 24px; height: 24px; }
    .sd-counter { font-size: 11.5px; }
    .sd-link { padding: 6px; font-size: 12.5px; }
    .sd-cta { height: 34px; padding: 0 10px; font-size: 12.5px; }
    .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) */
@media (min-width: 769px) {
    .ss-studio-v2.sd-page #dataLayersCard { width: 272px !important; box-shadow: none; border-right: 1px solid var(--sd-line); background: var(--sd-surface); }
    .ss-studio-v2.sd-page .feature-cards-container:has(#dataLayersCard.ss-open) #locationCard { left: 288px !important; width: 352px !important; }
    .ss-studio-v2.sd-page #locationCard { top: 16px !important; width: 392px !important; padding: 6px; }
    .sd-layers .card-header { height: auto; padding: 16px 40px 8px 20px; background: none !important; border-bottom: 0; }
    .sd-layers .card-title { font-size: 13px; }
    .sd-layers .card-title .icon { color: var(--sd-text); width: 16px; height: 16px; }
    .sd-layers .ss-drawer-close { top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; }
    .sd-layers-body { padding: 0 8px; }
    .sd-ly { border: 0; border-radius: 0; padding: 12px; margin: 0; }
    .sd-ly + .sd-ly { border-top: 1px solid var(--sd-line); }
    .sd-ly-name { font-size: 13px; }
    .sd-ly-src, .sd-ly-st { font-size: 11.5px; color: var(--sd-text3); line-height: 1.5; }
    .sd-ly-leg { font-size: 11px; color: var(--sd-text2); }
    .sd-sw { width: 30px; height: 18px; }
    .sd-sw::after { width: 14px; height: 14px; }
    .sd-sw[aria-checked="true"]::after { transform: translateX(12px); }
    .sd-layers-more { display: grid; grid-template-columns: 15px 1fr; gap: 4px 10px; margin: 8px 16px 16px; padding: 12px; border: 0; border-radius: 10px; background: var(--sd-subtle); font-size: 11.5px; color: var(--sd-text2); align-items: start; }
    .sd-layers-more svg { margin-top: 1px; }
    .sd-layers-more .sd-linkbtn { grid-column: 2; justify-self: start; color: var(--sd-accent-ink); text-decoration: none; font-size: 11.5px; }
    .sd-layers-more .sd-linkbtn::after { content: " \2192"; }
    .sd-search #locationInput { border: 0; background: transparent; height: 40px; font-size: 13.5px; padding-left: 36px; }
    .sd-search #locationInput:focus { box-shadow: none; }
    .sd-search-hint { font-size: 11.5px; color: var(--sd-text3); margin: 0 10px 8px; }
    .sd-examples { margin: 0; padding: 8px 8px 6px; border-top: 1px solid var(--sd-line); gap: 6px; font-size: 11.5px; color: var(--sd-text3); }
    .sd-ex { border: 0; background: var(--sd-subtle); color: var(--sd-text2); font-size: 11.5px; font-weight: 500; padding: 4px 10px; white-space: nowrap; }
    .sd-ex:hover { color: var(--sd-text); background: var(--sd-subtle2); }
    .sd-ex.on { background: var(--sd-accent-soft); color: var(--sd-accent-ink); }
    .sd-toolbar.ss-studio-toolbar { top: 16px; right: calc(var(--ss-ai-w) + 16px); }
    .sd-toolbar .ss-tool-btn { height: 36px; font-size: 12.5px; background: var(--sd-surface); }
    .sd-toolbar .ss-tool-btn.active { color: var(--sd-accent-ink); }
    .sd-toolbar .ss-tool-primary { background: #FFBD59; color: #2A1A00; box-shadow: none; }
}
@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 SolarScope" (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: 8px 10px 6px; }
.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: 20px 0 4px; border-top: 1px solid var(--sd-line, var(--color-border)); padding-top: 4px; scroll-margin-top: 8px; }
.sd-about-sum {
    list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; padding: 10px 0;
    font-size: 12.5px; font-weight: 600; color: var(--sd-text2, var(--color-text-secondary));
}
.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: 11.5px; 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: 2px solid var(--sd-accent, #FF6B4A); outline-offset: 2px; border-radius: 4px; }
.sd-about-body { padding: 2px 0 8px 18px; font-size: 12.5px; line-height: 1.55; color: var(--sd-text2, var(--color-text-secondary)); }
.sd-about-body p { margin: 0 0 10px; }
.sd-about-h { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; 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-accent-ink, var(--color-accent)); text-decoration: none; }
.sd-about-body a:hover { text-decoration: underline; }
.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: 8px 10px 8px; }
}
@media (max-width: 768px) {
    .sd-hero { padding: 6px 8px 4px; }
    .sd-h1 { font-size: 13px; }
    .sd-intro { font-size: 11px; }
}
