/* Site panel "Option A: Tabs" (owner-approved mockup, 2026-11-07; premium pass 2026-11-09), shared by the logged-out
   demo (templates/studio_demo.html: body.sd-body, frame in studio-demo.css) and the logged-in Site Studio
   (templates/site_studio.html: .ss-pa on the panel and on the "Screening for" menu, frame in studio-a.css).
   Acrelume Option A "Precision neutral" (2026-11-18): drawn as the right panel of static/mockups/acrelume/a/studio.html:
   white surface, 1 px hairlines, sections split by full-width hairlines, a verdict box with a Good / Look at / Red flag
   tally, a key-metrics grid, the checks as one bordered list with group bands, 32 px controls. Status colours appear only
   as dots or tinted pills; the accent only on primary buttons (send, sign-up).
   Load after studio-tokens.css and studio-demo.css / studio-a.css. The --sd-* names below are scoped aliases of the
   shared tokens (static/css/studio-tokens.css), so nothing outside the panel changes. */
body.sd-body, .ss-pa {
    --sd-panel: var(--ac-surface); --sd-surface: var(--ac-surface); --sd-subtle: var(--ac-hover); --sd-subtle2: var(--ac-pressed); --sd-well: var(--ac-surface-2);
    --sd-line: var(--ac-border); --sd-line2: var(--ac-border-strong);
    --sd-text: var(--ac-text); --sd-text2: var(--ac-text-2); --sd-text3: var(--ac-text-3);
    --sd-accent: var(--ac-accent); --sd-accent-soft: var(--ac-accent-tint); --sd-accent-ink: var(--ac-accent-ink);
    --sd-good: var(--ac-good); --sd-good-soft: var(--ac-good-tint); --sd-good-line: var(--ac-good-line); --sd-good-ink: var(--ac-good);
    --sd-warn: var(--ac-warn); --sd-warn-soft: var(--ac-warn-tint); --sd-warn-line: var(--ac-warn-line); --sd-warn-ink: var(--ac-warn);
    --sd-bad: var(--ac-bad); --sd-bad-soft: var(--ac-bad-tint); --sd-bad-line: var(--ac-bad-line); --sd-bad-ink: var(--ac-bad);
    --sd-shadow: var(--ac-menu-shadow); --sd-shadow-sm: none;
    --sd-pad: var(--ac-sp-4);  /* panel side padding (16 px, as the mockup's .psec) */
}
/* dark values come from studio-tokens.css (the aliases above follow them); only panel-specific tweaks here */
body.sd-body.dark-mode, .dark-mode body.sd-body, .dark-mode .ss-pa {
    --sd-kpi-hover: rgba(255, 255, 255, .04);
}

/* What are you screening for? (top bar): a quiet select button, as the mockup's top-bar control */
.sd-uc { position: relative; display: flex; align-items: center; gap: var(--st-sp-2); margin-left: 0; padding-left: var(--st-sp-4); min-width: 0; }
.sd-uc::before { content: ""; position: absolute; left: 0; top: 50%; height: 20px; margin-top: -10px; width: 1px; background: var(--sd-line); }
.sd-uc-k { font-size: 13px; color: var(--sd-text2); font-weight: 400; white-space: nowrap; }
.sd-uc-btn {
    display: flex; align-items: center; gap: var(--st-sp-2); height: var(--ac-h-ctl); padding: 0 8px 0 10px; border-radius: var(--ac-r);
    border: 1px solid var(--sd-line); cursor: pointer; background: var(--sd-surface); color: var(--sd-text); font: inherit;
    font-weight: 500; font-size: 13px; white-space: nowrap; min-width: 0;
    transition: background-color var(--st-dur) var(--st-ease), border-color var(--st-dur) var(--st-ease);
}
.sd-uc-btn:hover, .sd-uc-btn.on { background: var(--sd-subtle); }
.sd-uc-btn.on { border-color: var(--sd-line2); }
.sd-uc-btn:focus-visible, .sd-uc-it:focus-visible, .sd-tabs button:focus-visible, .sd-ib:focus-visible, .sd-btn:focus-visible, .sd-more:focus-visible,
.sd-kpi:focus-visible, .sd-hl-r:focus-visible, .sd-ck-row:focus-visible, .sd-aip-cta:focus-visible, .sd-qchips .ss-chip:focus-visible {
    outline: none; box-shadow: var(--ac-focus-ring);
}
.sd-uc-ic { display: flex; color: var(--sd-text2); }
.sd-uci { width: var(--st-ic); height: var(--st-ic); flex: none; display: block; }
.sd-uc-name { overflow: hidden; text-overflow: ellipsis; }
.sd-uc-chev { width: var(--st-ic-sm); height: var(--st-ic-sm); color: var(--sd-text3); flex: none; }
.sd-uc-menu {
    position: absolute; top: 44px; left: var(--st-sp-4); width: 280px; z-index: 1600; padding: 4px; border-radius: var(--ac-r-lg);
    background: var(--sd-surface); border: 1px solid var(--sd-line); box-shadow: var(--ac-menu-shadow);
}
.sd-uc-mh { font-size: 12px; line-height: 1.45; color: var(--sd-text2); padding: 6px 8px 8px; }
.sd-uc-it {
    display: flex; align-items: center; gap: var(--st-sp-2); width: 100%; min-height: var(--ac-h-ctl); padding: 0 8px; border: 0;
    border-radius: var(--ac-r-xs); cursor: pointer; background: none; color: var(--sd-text); font: inherit; font-size: 13px;
    font-weight: 400; text-align: left;
}
.sd-uc-it .sd-uci { color: var(--sd-text2); }
.sd-uc-it:hover { background: var(--sd-subtle); }
.sd-uc-it.on { color: var(--sd-text); font-weight: 500; }
.sd-uc-it.on .sd-uci { color: var(--sd-text); }
.sd-uc-it.on::after {
    content: ""; margin-left: auto; width: 16px; height: 16px; flex: none; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- panel frame: a white surface with one hairline toward the map ---------- */
.ss-studio-v2.sd-page #chatCard, .ss-studio-v2 #chatCard.ss-pa {
    display: flex; flex-direction: column; background: var(--sd-panel); border-left: 1px solid var(--sd-line); color: var(--sd-text);
    font-family: var(--ac-font); font-size: 13px; line-height: var(--ac-lh); font-feature-settings: "cv11", "ss01";
}
.sd-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--sd-pad) var(--sd-pad) var(--st-sp-6); scrollbar-width: thin; scrollbar-color: var(--sd-line2) transparent; }
.sd-pane[hidden] { display: none !important; }

/* site header (mockup .panel-h): eyebrow, name, coordinates, actions */
.sd-sh { position: relative; padding: var(--sd-pad) var(--sd-pad) 12px; flex: none; border-bottom: 1px solid var(--sd-line); }
.sd-sh-eb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sd-text2); min-height: 20px; min-width: 0; }
.sd-sh-eb > span:not(.sd-badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sd-badge, :is(.sd-page, .ss-pa) .sd-badge {
    display: inline-flex; align-items: center; gap: var(--st-sp-1); height: 20px; font-size: 11px; font-weight: 500;
    letter-spacing: 0; color: var(--sd-text2); background: var(--sd-subtle); padding: 0 6px; border-radius: var(--ac-r-xs);
    border: 0; white-space: nowrap; flex: none;
}
.sd-badge.sd-badge-own, :is(.sd-page, .ss-pa) .sd-badge.sd-badge-own { background: var(--sd-good-soft); color: var(--sd-good); }
.sd-sh-row { display: flex; align-items: center; justify-content: space-between; gap: var(--st-sp-2); margin-top: 4px; }
.sd-sh-name {
    margin: 4px 0 2px; font-size: 16px; font-weight: 600; letter-spacing: var(--ac-tracking-tight); line-height: 1.35;
    color: var(--sd-text); min-width: 0; overflow-wrap: anywhere;
}
.sd-sh-name .sd-skel-line { display: block; height: 16px; }
.sd-sh-acts { display: flex; gap: 2px; margin: 0 -6px 0 0; flex: none; }
.sd-ib {
    width: var(--ac-h-ctl); height: var(--ac-h-ctl); display: grid; place-items: center; border-radius: var(--ac-r); border: 0; background: none;
    color: var(--sd-text2); cursor: pointer; padding: 0; transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
.sd-ib:hover { background: var(--sd-subtle); color: var(--sd-text); }
.sd-ib:active { background: var(--sd-subtle2); }
.sd-ib svg { width: var(--ac-ic); height: var(--ac-ic); stroke-width: var(--ac-ic-stroke); }
.sd-ib-sm { width: 24px; height: 24px; border-radius: var(--ac-r-xs); }
.sd-ib-sm svg { width: 13px; height: 13px; }
.sd-ib.copied { color: var(--sd-good); }
.sd-sh-co { display: flex; align-items: center; gap: var(--st-sp-1); font-size: 12px; color: var(--sd-text2); min-height: 24px; }
.sd-sh-co:empty { min-height: 0; }
.sd-sh-co .sd-mono { margin-right: var(--st-sp-1); }
.sd-mono { font-family: var(--ac-mono); font-feature-settings: normal; font-size: 11.5px; letter-spacing: 0; }
/* actions row (mockup .panel-actions): labelled buttons, icon buttons at the end */
.sd-acts { display: flex; align-items: center; gap: var(--st-sp-2); margin-top: 12px; }
.sd-acts.is-empty { display: none; }
.sd-acts .sd-ib { border: 1px solid var(--sd-line2); background: var(--sd-surface); color: var(--sd-text); }
.sd-acts .sd-ib:hover { background: var(--sd-subtle); }
.sd-acts .sd-ib svg { color: var(--sd-text2); }
.sd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ac-h-ctl); padding: 0 12px; border-radius: var(--ac-r);
    border: 1px solid var(--sd-line2); background: var(--sd-surface); color: var(--sd-text); font: 500 13px/1 var(--ac-font); white-space: nowrap; cursor: pointer;
    transition: background-color var(--st-dur) var(--st-ease);
}
.sd-btn:hover { background: var(--sd-subtle); }
.sd-btn svg { width: var(--ac-ic); height: var(--ac-ic); stroke-width: var(--ac-ic-stroke); color: var(--sd-text2); }

/* tabs (mockup .tabs): neutral, the active one underlined in the text colour */
.sd-tabs { display: flex; gap: var(--st-sp-4); padding: 0 var(--sd-pad); margin: 0; border-bottom: 1px solid var(--sd-line); flex: none; background: var(--sd-panel); overflow-x: auto; scrollbar-width: none; }
.sd-tabs button {
    position: relative; height: 36px; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer;
    font: inherit; font-weight: 500; font-size: 13px; color: var(--sd-text2); white-space: nowrap; border-radius: 0;
    transition: color var(--st-dur) var(--st-ease);
}
.sd-tabs button:hover { color: var(--sd-text); }
.sd-tabs button.on { color: var(--sd-text); }
.sd-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--sd-text); }
.sd-tab-n { font-size: 11px; font-weight: 500; color: var(--sd-text3); background: none; padding: 0; min-width: 0; height: auto; font-variant-numeric: tabular-nums; }
.sd-spark { width: var(--st-ic-sm); height: var(--st-ic-sm); flex: none; fill: none; stroke: currentColor; stroke-width: var(--ac-ic-stroke); stroke-linecap: round; stroke-linejoin: round; }
.sd-tabs .sd-spark { color: inherit; }

/* shared atoms */
.sd-lbl { font-size: 11px; font-weight: 600; letter-spacing: var(--ac-tracking-caps); text-transform: uppercase; color: var(--sd-text3); line-height: 1.3; }
.sd-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; display: inline-block; background: var(--sd-good); }
.sd-dot.good { background: var(--sd-good); } .sd-dot.warn { background: var(--sd-warn); } .sd-dot.bad { background: var(--sd-bad); }
.sd-dot.na { background: transparent; box-shadow: inset 0 0 0 1.25px var(--sd-text3); }
.sd-dot.wait { background: var(--sd-text3); opacity: .5; animation: ss-ck-pulse 1.2s ease-in-out infinite; }
@keyframes ss-ck-pulse { 50% { opacity: .2; } }
.sd-more {
    display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 2px 4px; margin: -2px -4px; cursor: pointer; font: inherit;
    color: var(--sd-text2); font-weight: 500; font-size: 12px; border-radius: var(--ac-r-xs);
    transition: color var(--st-dur) var(--st-ease), background-color var(--st-dur) var(--st-ease);
}
.sd-more svg { width: 14px; height: 14px; }
.sd-more:hover { color: var(--sd-text); background: var(--sd-subtle); }
.sd-flex { flex: 1; }
.sd-fine { font-size: 12px; color: var(--sd-text2); line-height: 1.55; margin: var(--st-sp-3) 0 0; }
.sd-fine a { color: var(--sd-text); text-decoration: underline; text-decoration-color: var(--sd-line2); text-underline-offset: 2px; }
.sd-off { opacity: .55; }

/* ---------- Overview ---------- */
.sd-ov.ss-site-card { padding: 0; border: 0; background: none; margin: 0; }

/* verdict (mockup .verdict): a bordered box; icon tile tinted by the status; Good / Look at / Red flag tally under a hairline */
.sd-vcard {
    --sd-v: var(--sd-good); --sd-v-soft: var(--sd-good-soft);
    position: relative; border-radius: var(--ac-r-lg); padding: 10px 12px; background: var(--sd-surface); border: 1px solid var(--sd-line); box-shadow: none;
}
.sd-vcard.sd-v-warn { --sd-v: var(--sd-warn); --sd-v-soft: var(--sd-warn-soft); }
.sd-vcard.sd-v-bad { --sd-v: var(--sd-bad); --sd-v-soft: var(--sd-bad-soft); }
.sd-vcard.sd-v-busy { --sd-v: var(--sd-text2); --sd-v-soft: var(--sd-subtle); }
.sd-verdict { display: flex; gap: 10px; align-items: center; }
.sd-vi { width: 28px; height: 28px; border-radius: var(--ac-r); background: var(--sd-v-soft); color: var(--sd-v); display: grid; place-items: center; flex: none; }
.sd-vi svg { width: 16px; height: 16px; stroke-width: 2; }
.sd-spin { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--sd-line2); border-top-color: var(--sd-text2); animation: sd-spin .8s linear infinite; }
@keyframes sd-spin { to { transform: rotate(360deg); } }
.sd-verdict > div:last-child { min-width: 0; }
.sd-verdict b { display: block; font-size: 14px; line-height: 1.35; font-weight: 600; letter-spacing: 0; color: var(--sd-text); }
.sd-verdict span { display: block; margin-top: 1px; font-size: 12px; line-height: 1.4; color: var(--sd-text2); }
.sd-tally { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sd-line); font-size: 12px; color: var(--sd-text2); }
.sd-tally-i { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sd-tally-i b { font-weight: 600; color: var(--sd-text); font-variant-numeric: tabular-nums; margin-right: -2px; }
.sd-blurb { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--sd-text2); text-wrap: pretty; }
.sd-nc { display: flex; align-items: center; gap: var(--st-sp-2); margin-top: 8px; font-size: 12px; color: var(--sd-text3); }
.sd-nc-i { width: 10px; height: 10px; border-radius: 50%; border: 1.25px dashed var(--sd-text3); flex: none; }
.sd-steps { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--sd-line); }
.sd-steps .ss-step { display: flex; align-items: center; gap: var(--st-sp-2); padding: 3px 0; font-size: 12px; color: var(--sd-text2); }
.sd-steps .ss-step svg { width: 14px; height: 14px; flex: none; }
.sd-steps .ss-step-done svg { color: var(--sd-good); } .sd-steps .ss-step-fail svg { color: var(--sd-bad); }
.sd-steps .ss-step-pending svg, .sd-steps .ss-step-wait svg { color: var(--sd-text3); }
.sd-steps .ss-step-pending svg { animation: sd-spin 1.4s linear infinite; }
.sd-steps .ss-step-detail { margin-left: auto; color: var(--sd-text3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* key metrics (mockup .metrics): one bordered grid, hairlines between the cells; the number leads */
.sd-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 12px; border: 1px solid var(--sd-line); border-radius: var(--ac-r-lg); overflow: hidden; background: var(--sd-surface); }
.sd-kpi {
    padding: 10px 12px; border: 0; border-right: 1px solid var(--sd-line); border-radius: 0; background: var(--sd-surface); box-shadow: none;
    text-align: left; font: inherit; color: var(--sd-text); min-width: 0; display: flex; flex-direction: column;
    transition: background-color var(--st-dur) var(--st-ease);
}
.sd-kpi:last-child { border-right: 0; }
button.sd-kpi { cursor: pointer; }
button.sd-kpi:hover { background: var(--sd-well); }
.sd-kpi-h { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sd-text2); font-weight: 400; line-height: 1.3; }
.sd-kpi-h svg { width: 13px; height: 13px; stroke-width: var(--ac-ic-stroke); flex: none; color: var(--sd-text3); }
/* Values and units never get cut: in a narrow tile (1024 px wide panel, phone) the unit drops under the value and the
   status line wraps, instead of an ellipsis ("kWh/m²…"). */
.sd-kpi-v {
    font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin-top: 4px; display: flex; flex-wrap: wrap;
    align-items: baseline; column-gap: 3px; row-gap: 0; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; line-height: 1.25;
}
.sd-kpi-v small { font-size: 12px; font-weight: 400; color: var(--sd-text2); letter-spacing: 0; }
.sd-kpi-s { font-size: 12px; line-height: 1.35; color: var(--sd-text2); margin-top: auto; padding-top: 2px; display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.sd-kpi-s .sd-dot { margin-top: calc((1.35em - 6px) / 2); }
.sd-kpi-s span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sd-kpi.sd-off .sd-kpi-s span:last-child { font-style: italic; }
.sd-kpi-na .sd-kpi-v { color: var(--sd-text2); }

/* sections (mockup .psec): full-width hairline above each, a small caps title */
.sd-sec { margin: var(--sd-pad) calc(-1 * var(--sd-pad)) 0; padding: var(--sd-pad) var(--sd-pad) 0; border-top: 1px solid var(--sd-line); }
.sd-sec[hidden] { display: none; }
.sd-hd { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; min-height: 20px; }

/* key checks: a bordered list of rows, value on the right */
.sd-hl { border-radius: var(--ac-r-lg); background: var(--sd-surface); border: 1px solid var(--sd-line); box-shadow: none; overflow: hidden; }
.sd-hl-r {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: none;
    font: inherit; text-align: left; color: var(--sd-text); cursor: pointer; position: relative; transition: background-color var(--st-dur) var(--st-ease);
}
.sd-hl-r + .sd-hl-r { border-top: 1px solid var(--sd-line); }
.sd-hl-r:hover { background: var(--sd-well); }
.sd-hl-l { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; font-weight: 500; }
.sd-hl-m { font-size: 12px; font-weight: 400; color: var(--sd-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-hl-v { font-weight: 600; font-size: 13px; white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sd-hl-r.sd-off { opacity: .55; }

/* AI analyst preview (mockup "AI analyst" section): a quiet bordered box, the first lines of the read, a way in */
.sd-aip { position: relative; padding: 12px; border-radius: var(--ac-r-lg); border: 1px solid var(--sd-line); box-shadow: none; background: var(--sd-surface); }
.sd-aip-t { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--sd-text); min-height: 20px; }
.sd-aip-t .sd-spark, .sd-ai-t .sd-spark { width: 14px; height: 14px; padding: 0; border-radius: 0; background: none; color: var(--sd-text2); }
.sd-aip-note { font-weight: 400; font-size: 12px; color: var(--sd-text2); margin-left: 2px; }
.sd-aip p { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--sd-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sd-aip p.sd-aip-wait { display: flex; align-items: center; gap: var(--st-sp-2); color: var(--sd-text2); }
.sd-aip-lock { display: flex; align-items: center; gap: 6px; margin-top: var(--st-sp-2); font-size: 12px; color: var(--sd-text2); }
.sd-aip-lock svg { width: 13px; height: 13px; color: var(--sd-text2); }
.sd-aip-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ac-h-ctl-sm); padding: 0 8px; margin-top: 10px;
    border: 1px solid var(--sd-line2); border-radius: var(--ac-r); background: var(--sd-surface); color: var(--sd-text); cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 500; box-shadow: none;
    transition: background-color var(--st-dur) var(--st-ease);
}
.sd-aip-cta:hover { background: var(--sd-subtle); }
.sd-aip-cta svg { width: 14px; height: 14px; color: var(--sd-text2); }
.sd-ai-uc { color: var(--sd-warn) !important; }

/* site details (mockup .kv) */
.sd-kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); row-gap: 6px; column-gap: 12px; margin: 0; font-size: 12px; line-height: 1.45; }
.sd-kv dt { color: var(--sd-text2); font-weight: 400; }
.sd-kv dd { margin: 0; color: var(--sd-text); overflow-wrap: anywhere; }
.sd-kv .sd-mono { font-size: 11.5px; }

/* ---------- Checks (mockup .chk-list): one bordered list, a band per group, name and value left, result and source right ---------- */
.sd-ck-box { border: 1px solid var(--sd-line); border-radius: var(--ac-r-lg); overflow: hidden; background: var(--sd-surface); }
.sd-grp { margin: 0; }
.sd-grp-h {
    display: flex; justify-content: space-between; align-items: baseline; gap: var(--st-sp-2); margin: 0; padding: 6px 12px;
    background: var(--sd-well); border-bottom: 1px solid var(--sd-line);
}
.sd-grp + .sd-grp .sd-grp-h { border-top: 1px solid var(--sd-line); }
.sd-grp-n { font-size: 11px; color: var(--sd-text3); text-align: right; font-variant-numeric: tabular-nums; }
.sd-ck-list { list-style: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.sd-ck { position: relative; }
.sd-ck + .sd-ck { border-top: 1px solid var(--sd-line); }
.sd-ck-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; gap: 2px 12px; align-items: center; width: 100%;
    padding: 8px 12px; border: 0; background: none; font: inherit; color: var(--sd-text); text-align: left; cursor: pointer;
    transition: background-color var(--st-dur) var(--st-ease);
}
.sd-ck-row:hover:not([disabled]) { background: var(--sd-well); }
.sd-ck.is-open .sd-ck-row { background: var(--sd-well); }
.sd-ck-row[disabled] { cursor: default; }
.sd-ck-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sd-ck-l { color: var(--sd-text); font-weight: 500; }
.sd-ck-d { font-size: 12px; color: var(--sd-text2); line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sd-ck-side { display: flex; align-items: center; justify-content: flex-end; align-self: start; padding-top: 1px; }
.sd-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--sd-text2); }
.sd-st .sd-dot { box-shadow: none; }
.sd-st-good { color: var(--sd-good); } .sd-st-warn { color: var(--sd-warn); } .sd-st-bad { color: var(--sd-bad); }
.sd-st-good .sd-dot, .sd-st-warn .sd-dot, .sd-st-bad .sd-dot { background: currentColor; }
.sd-st-na, .sd-st-off, .sd-st-wait { color: var(--sd-text3); font-weight: 400; }
.sd-ck-s { font-size: 11px; color: var(--sd-text3); line-height: 1.35; margin-top: 1px; }
.sd-ck-wait .sd-ck-d { color: var(--sd-text3); }
.sd-ck-i { grid-column: 3; grid-row: 1; align-self: start; margin-top: 2px; color: var(--sd-text3); opacity: 0; text-align: center; transition: opacity var(--st-dur), color var(--st-dur); }
.sd-ck-row:hover .sd-ck-i, .sd-ck.is-open .sd-ck-i, .sd-ck-row:focus-visible .sd-ck-i { opacity: 1; color: var(--sd-text2); }
/* the row's text glyph becomes a stroke chevron in the same style as the rest of the icons */
.sd-ck-i { font-size: 0; line-height: 0; }
.sd-ck-i::before {
    content: ""; display: inline-block; width: 14px; height: 14px; background: currentColor; transition: transform var(--st-dur) var(--st-ease);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sd-ck.is-open .sd-ck-i::before { transform: rotate(180deg); }
.sd-ck.sd-off .sd-ck-d { font-style: italic; }
.sd-ck-x { padding: 4px 12px 12px; font-size: 12px; line-height: 1.55; color: var(--sd-text); background: var(--sd-well); }
.sd-ck-x a { color: var(--sd-text); text-decoration: underline; text-decoration-color: var(--sd-line2); text-underline-offset: 2px; }
.sd-ck-why { display: block; margin-bottom: var(--st-sp-1); }
.sd-ck-src { display: block; margin-top: var(--st-sp-2); color: var(--sd-text2); font-size: 12px; }

/* ---------- AI analyst ---------- */
.sd-ai-h { display: flex; align-items: center; justify-content: space-between; gap: var(--st-sp-2); }
.sd-ai-t { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; letter-spacing: 0; }
.sd-ai-msg { margin-top: 12px; font-size: 13px; line-height: 1.55; color: var(--sd-text); }
.sd-ai-msg p { margin: 0; }
.sd-ai-msg p + p, .sd-ai-read p + p, .sd-ai-lead + .sd-ai-read { margin-top: 8px; }
.sd-ai-read .sd-act { margin-top: var(--st-sp-2); }
.sd-ai-msg .sd-locked { margin-top: var(--st-sp-3); }
.sd-q-lbl { margin: var(--st-sp-5) 0 var(--st-sp-2); }
/* suggested questions (mockup .suggest): small hairline buttons */
.sd-qchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sd-qchips .ss-chip {
    font: inherit; font-size: 12px; line-height: 1.35; color: var(--sd-text2); border-radius: var(--ac-r-xs); padding: 3px 8px; min-height: 24px; background: var(--sd-surface);
    border: 1px solid var(--sd-line); box-shadow: none; cursor: pointer; text-align: left; transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
.sd-qchips .ss-chip:hover { background: var(--sd-subtle); color: var(--sd-text); border-color: var(--sd-line); box-shadow: none; }

/* locked read (demo): calm bars and one clear button */
:is(.sd-page, .ss-pa) .sd-locked-bars span { background: var(--sd-text3); opacity: .3; }
:is(.sd-page, .ss-pa) .sd-locked-cta { font-size: 13px; font-weight: 500; color: var(--sd-text); gap: var(--st-sp-2); }
:is(.sd-page, .ss-pa) .sd-locked-cta svg { color: var(--sd-text2); width: 16px; height: 16px; }
:is(.sd-page, .ss-pa) .sd-locked-cta button {
    height: var(--ac-h-ctl); padding: 0 12px; border-radius: var(--ac-r); background: var(--sd-accent); color: var(--ac-text-on-accent);
    font-size: 13px; font-weight: 500; box-shadow: none;
}
:is(.sd-page, .ss-pa) .sd-locked-cta button:hover { background: var(--ac-accent-hover); }
:is(.sd-page, .ss-pa) .sd-act {
    height: 28px; padding: 0 8px; border-radius: var(--ac-r); border: 1px solid var(--sd-line2); color: var(--sd-text); background: var(--sd-surface); font-size: 12px; font-weight: 500;
}
:is(.sd-page, .ss-pa) .sd-act:hover { color: var(--sd-text); border-color: var(--sd-line2); background: var(--sd-subtle); }

/* ask box (mockup .ask): an input with the primary send button, pinned under every tab */
:is(.sd-page, .ss-pa) .chat-input.sd-ft { flex: none; padding: 12px var(--sd-pad); border-top: 1px solid var(--sd-line); background: var(--sd-panel); }
.sd-ask.input-group {
    display: flex; gap: var(--st-sp-2); align-items: center; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
}
.sd-ask .input-field, :is(.sd-page, .ss-pa) .sd-ask .input-field {
    flex: 1; min-width: 0; height: var(--ac-h-ctl); min-height: var(--ac-h-ctl); padding: 6px 10px; border: 1px solid var(--sd-line); border-radius: var(--ac-r);
    background: var(--sd-surface); font-size: 13px; line-height: 1.45; color: var(--sd-text); cursor: text; box-shadow: none; outline: none; resize: none;
    transition: border-color var(--st-dur) var(--st-ease);
}
.sd-ask .input-field:hover { border-color: var(--sd-line2); }
.sd-ask .input-field:focus { outline: none; box-shadow: none; border-color: var(--sd-text2); }
.sd-ask .input-field::placeholder { color: var(--sd-text3); }
:is(.sd-page, .ss-pa) .sd-ask .send-button {
    width: var(--ac-h-ctl); height: var(--ac-h-ctl); border-radius: var(--ac-r); background: var(--sd-accent); color: var(--ac-text-on-accent); flex: none; border: 0;
    display: grid; place-items: center; transition: background-color var(--st-dur) var(--st-ease), color var(--st-dur) var(--st-ease);
}
:is(.sd-page, .ss-pa) .sd-ask .send-button:hover { background: var(--ac-accent-hover); }
/* nothing typed yet: the send button waits quietly */
:is(.sd-page, .ss-pa) .sd-ask:has(.input-field:placeholder-shown) .send-button { background: var(--sd-subtle); color: var(--sd-text3); }
:is(.sd-page, .ss-pa) .sd-ask .send-button svg { width: 16px; height: 16px; }
:is(.sd-page, .ss-pa) .sd-ask .send-button:focus-visible { outline: none; box-shadow: var(--ac-focus-ring); }


@media (max-width: 1100px) {
    .sd-uc-k { display: none; }
    .sd-kpi { padding: 8px 10px; } .sd-kpi-v { font-size: 15px; }
    .sd-kv { grid-template-columns: 112px minmax(0, 1fr); }
    .sd-acts .sd-btn { padding: 0 10px; }
}
@media (max-width: 768px) {
    .sd-uc { padding-left: 0; position: static; }
    .sd-uc::before { display: none; }
    .sd-uc-name { display: none; }
    .sd-uc-btn { height: var(--ac-h-ctl); padding: 0 6px 0 8px; gap: 4px; }
    .sd-uc-menu { position: fixed; top: calc(var(--sd-top-h) - 4px); left: 8px; right: 8px; width: auto; }
    .sd-scroll { padding: var(--sd-pad) var(--sd-pad) var(--sd-pad); overflow: visible; }
    :is(.sd-page, .ss-pa) .chat-input.sd-ft { padding: 10px var(--sd-pad) calc(10px + env(safe-area-inset-bottom)); }
    :is(.sd-page, .ss-pa) .sd-ask .input-field { font-size: 16px; } /* no iOS zoom on focus */
}
@media (prefers-reduced-motion: reduce) {
    .sd-spin, .sd-steps .ss-step-pending svg, .sd-dot.wait { animation: none !important; }
    .sd-uc-btn, .sd-ib, .sd-btn, .sd-tabs button, .sd-more, .sd-kpi, .sd-hl-r, .sd-ck-row, .sd-ck-i, .sd-aip-cta, .sd-qchips .ss-chip, .sd-ask .input-field, :is(.sd-page, .ss-pa) .sd-ask .send-button { transition: none; }
}
