/* Case study pages (case-studies/*.html). Builds on global, sections and intelligence:
   the visuals reuse .dash, .story-card, .mini-table, .chip and .bubble as they are. */

/* Hero --------------------------------------------------------------------- */

/* A photo hero, shorter than the homepage one. The <picture> replaces the background art. */
.cs-hero {
    display: flex;
    align-items: flex-end;
    min-height: min(86vh, 780px);
    background-image: none;
}

@media (min-width: 901px) {
    .cs-hero {
        background-image: none;
    }
}

.cs-hero-media,
.cs-hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.cs-hero-media img {
    object-fit: cover;
    object-position: 30% 40%;
}

/* Darken from the bottom-left, where the copy sits, so it reads on any crop. */
.cs-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(0deg, rgba(26, 25, 31, .96) 0%, rgba(26, 25, 31, .72) 45%, rgba(26, 25, 31, .25) 100%),
        linear-gradient(90deg, rgba(26, 25, 31, .55), transparent 70%);
}

.cs-hero-content {
    position: relative;
    z-index: 2;
    padding: clamp(144px, 10vw + 72px, 200px) 0 clamp(48px, 4vw + 16px, 80px);
}

.cs-hero .eyebrow {
    color: rgba(255, 255, 255, .7);
}

.cs-hero .eyebrow a {
    color: #fff;
}

.cs-hero .eyebrow a:hover {
    color: var(--color-accent);
}

.cs-hero h1 {
    max-width: 900px;
    margin: 0 0 var(--space-3);
    font-size: clamp(2.5rem, 4.4vw + 1rem, 5.25rem);
    font-weight: 700;
    line-height: 1.02;
}

.cs-hero h1 em,
.cs-section h2 em {
    color: var(--color-accent);
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -.01em;
}

.cs-lede {
    max-width: 580px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 18px;
    line-height: 28px;
}

/* Project facts sit under the starting-point story, on the light background. */
.cs-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin: var(--space-5) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-line);
}

.cs-facts dt {
    margin-bottom: 4px;
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.cs-facts dd {
    margin: 0;
    color: var(--color-ink);
    font-size: 15px;
    line-height: 22px;
}

.cs-muted {
    color: var(--color-muted);
}

/* Results band ------------------------------------------------------------- */

.cs-outcomes-band {
    padding: var(--space-5) 0;
    color: #fff;
    background: var(--color-night);
}

.cs-outcomes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-block: 0;
    padding: 0;
    list-style: none;
}

.cs-outcomes li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 var(--space-3);
}

.cs-outcomes li:first-child {
    padding-left: 0;
}

.cs-outcomes li + li {
    border-left: 1px solid var(--color-line-dark);
}

.cs-outcomes strong {
    color: var(--color-accent);
    font-family: var(--font-sans);
    font-size: clamp(32px, 2vw + 16px, 48px);
    font-weight: 500;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.cs-outcomes li > span {
    color: var(--color-muted-dark);
    font-size: 15px;
    line-height: 22px;
}

/* Section scaffolding ------------------------------------------------------ */

.cs-section h2 {
    font-size: clamp(36px, 2.6vw + 16px, 56px);
    line-height: 1.05;
}

.cs-section--dark {
    color: #fff;
    border-bottom: 0;
}

.cs-section--dark .eyebrow,
.cs-section--dark p {
    color: var(--color-muted-dark);
}

.cs-section--soft {
    background: var(--color-paper-soft);
}

/* Heading on the left, prose on the right, same proportions as the FAQ. */
.cs-split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(40px, 5vw, 96px);
}

.cs-prose > p {
    margin-bottom: var(--space-3);
    font-size: 18px;
    line-height: 28px;
}

/* Starting point ----------------------------------------------------------- */

.cs-story {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
    gap: clamp(40px, 5vw, 96px);
}

.cs-story-copy h2 {
    margin-bottom: var(--space-4);
}

.cs-story-copy > p:not([class]) {
    margin-bottom: var(--space-3);
    font-size: 18px;
    line-height: 28px;
}

.cs-before {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
}

.cs-before li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    font-size: 14px;
}

.cs-photo {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--color-night);
}

.cs-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-photo--tall {
    aspect-ratio: 4 / 5;
}

/* System map --------------------------------------------------------------- */

.cs-map-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: clamp(32px, 5vw, 96px);
    margin-bottom: clamp(40px, 4vw + 16px, 72px);
}

.cs-map-head > p {
    max-width: 520px;
    margin: 0;
    font-size: 18px;
    line-height: 28px;
}

.cs-map {
    margin: 0;
}

.map-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    font-family: var(--font-sans);
}

.map-svg--tall {
    display: none;
    max-width: 420px;
    margin: 0 auto;
}

.map-caption {
    fill: var(--color-muted-dark);
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: .06em;
}

.map-node > rect:first-child,
.map-pill > rect {
    fill: #24232a;
    stroke: rgba(255, 255, 255, .14);
    transition: stroke .3s ease, fill .3s ease;
}

.map-node--out > rect:first-child {
    stroke: rgba(124, 252, 0, .35);
}

.map-node--wa > rect:first-child {
    stroke: rgba(37, 211, 102, .5);
}

.map-node.is-hit > rect:first-child,
.map-pill.is-hit > rect {
    fill: #2c3324;
    stroke: var(--color-accent);
}

.map-icon-tile {
    fill: rgba(255, 255, 255, .05);
    stroke: rgba(255, 255, 255, .08);
}

.map-svg .map-icon > * {
    fill: none;
    stroke: #e4e4e7;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-node--out .map-icon > *,
.map-core .map-icon > * {
    stroke: var(--color-accent);
}

.map-svg .map-icon--wa > * {
    stroke: none;
}

.map-svg .map-icon--wa .map-wa-bubble {
    fill: #25d366;
}

.map-svg .map-icon--wa .map-wa-phone {
    fill: #fff;
}

.map-title {
    fill: #fff;
    font-weight: 500;
}

.map-sub {
    fill: var(--color-muted-dark);
    font-family: var(--font-sans);
}

.map-link {
    fill: none;
    stroke: rgba(255, 255, 255, .16);
    stroke-width: 1.5;
}

/* Faint motion along every link; the transaction chips carry the real story. */
.map-flow {
    fill: none;
    stroke: var(--color-accent);
    stroke-opacity: .45;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 2 16;
    animation: map-flow 1.4s linear infinite;
}

@keyframes map-flow {
    to {
        stroke-dashoffset: -18;
    }
}

.map-label rect {
    fill: var(--color-night);
    stroke: rgba(255, 255, 255, .12);
}

.map-label text {
    fill: var(--color-muted-dark);
    font-family: var(--font-sans);
}

.map-core > rect {
    fill: #222d1b;
    stroke: var(--color-accent);
    stroke-width: 1.5;
}

.map-core-title {
    fill: var(--color-accent);
    font-weight: 600;
}

.map-module rect {
    fill: rgba(255, 255, 255, .04);
    stroke: rgba(255, 255, 255, .12);
    transition: fill .3s ease, stroke .3s ease;
}

.map-module-dot {
    fill: rgba(255, 255, 255, .25);
    transition: fill .3s ease;
}

.map-module.is-hit rect {
    fill: rgba(124, 252, 0, .2);
    stroke: var(--color-accent);
}

.map-module.is-hit .map-module-dot {
    fill: var(--color-accent);
}

.map-module text,
.map-pill text {
    fill: #fff;
}

/* Transaction chips (scripts/system-map.js). */
.map-token {
    pointer-events: none;
}

.map-token rect {
    fill: var(--color-night);
    stroke: var(--color-accent);
}

.map-token circle {
    fill: var(--color-accent);
}

.map-token text {
    fill: #fff;
    font-family: var(--font-sans);
}

.map-token--out rect {
    fill: var(--color-accent);
}

.map-token--out circle {
    fill: var(--color-night);
}

.map-token--out text {
    fill: var(--color-night);
    font-weight: 500;
}

.map-token--wa rect {
    fill: #0b3d22;
    stroke: #25d366;
}

.map-token--wa circle {
    fill: #25d366;
}

/* Live feed under the map ------------------------------------------------- */

.cs-feed {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: var(--space-5);
}

.cs-feed-log,
.cs-feed-counts {
    padding: var(--space-3);
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .03);
}

.cs-section--dark .cs-feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
    color: var(--color-muted-dark);
    font-family: var(--font-sans);
    font-size: 11px;
    text-transform: uppercase;
}

.cs-feed-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-sans);
    font-size: 13px;
}

.cs-feed-list li {
    display: grid;
    grid-template-columns: 76px 150px minmax(0, 1fr);
    gap: var(--space-2);
    padding: 9px 0;
    border-top: 1px solid var(--color-line-dark);
    color: #e4e4e7;
    white-space: nowrap;
}

.cs-feed-list li > * {
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-feed-list time,
.cs-feed-src {
    color: var(--color-muted-dark);
}

.cs-feed-list li.is-new {
    animation: feed-in .6s var(--ease-out);
}

@keyframes feed-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
        color: var(--color-accent);
    }
}

.cs-feed-counts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: var(--space-3) var(--space-2);
    margin: 0;
}

.cs-feed-counts dt {
    margin-bottom: 4px;
    color: var(--color-muted-dark);
    font-size: 13px;
}

.cs-feed-counts dd {
    margin: 0;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* Phases ------------------------------------------------------------------- */

.cs-phases {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 clamp(64px, 5vw + 32px, 120px);
    padding: 0;
    border-top: 1px solid var(--color-line);
    list-style: none;
}

.cs-phases li + li {
    border-left: 1px solid var(--color-line);
}

.cs-phases a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: var(--space-3) var(--space-3) 0;
}

.cs-phases li:first-child a {
    padding-left: 0;
}

.cs-phases a:hover strong {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cs-phase-index,
.cs-phase-kicker span {
    color: var(--color-accent-deep);
    font-family: var(--font-sans);
    font-size: 13px;
}

.cs-phases strong {
    font-size: 20px;
    font-weight: 500;
}

.cs-phases a > span:last-child {
    color: var(--color-muted);
    font-size: 15px;
}

.cs-phase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(40px, 5vw, 96px);
}

.cs-phase + .cs-phase {
    margin-top: clamp(64px, 5vw + 32px, 120px);
}

.cs-phase--flip .cs-phase-copy {
    order: 2;
}

.cs-phase-kicker {
    display: flex;
    gap: 12px;
    margin-bottom: var(--space-2);
    color: var(--color-muted);
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cs-phase-copy h2,
.cs-phase-copy h3 {
    margin-bottom: var(--space-3);
    color: var(--color-ink);
    font-weight: 500;
    letter-spacing: -.03em;
}

.cs-phase-copy h3 {
    font-size: clamp(28px, 1.6vw + 16px, 40px);
    line-height: 1.1;
}

.cs-phase-copy > p:not([class]) {
    margin-bottom: var(--space-2);
    font-size: 17px;
    line-height: 26px;
}

/* Visuals ------------------------------------------------------------------ */

.cs-visual {
    display: grid;
    place-items: center;
    padding: clamp(24px, 3vw, 48px);
    border-radius: var(--radius-xl);
    background: var(--color-paper-soft);
}

.cs-visual > * {
    width: 100%;
    max-width: 520px;
}

.cs-visual h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.cs-visual [lang="si"] {
    font-family: "Noto Sans Sinhala", var(--font-sans);
}

/* Video fills the frame; the UI card floats over its lower corner. */
.cs-visual--media {
    position: relative;
    min-height: 520px;
    padding: 0;
    overflow: hidden;
    background: var(--color-night);
}

.cs-visual--media > * {
    max-width: none;
}

.cs-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-overlay-card,
.cs-visual--media .cs-chat {
    position: absolute;
    right: var(--space-3);
    bottom: var(--space-3);
    width: min(340px, calc(100% - 48px));
}

.cs-overlay-card {
    display: grid;
    gap: 12px;
    padding: var(--space-3);
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-lg);
    color: #fff;
    background: rgba(26, 25, 31, .88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.cs-overlay-kicker {
    margin: 0;
    color: var(--color-muted-dark);
    font-family: var(--font-sans);
    font-size: 11px;
    text-transform: uppercase;
}

.cs-overlay-card ul {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.cs-overlay-card li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--color-line-dark);
}

.cs-overlay-card li > span:nth-child(2) {
    color: var(--color-muted-dark);
    font-family: var(--font-sans);
}

.cs-overlay-foot {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: #1a191f;
    background: var(--color-accent);
    font-size: 14px;
}

.cs-overlay-foot strong {
    font-weight: 600;
}

.cs-lang-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-pill);
    font-size: 12px;
}

.cs-lang-toggle > * {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    color: var(--color-muted-dark);
    font-weight: 500;
}

.cs-lang-toggle b {
    color: #1a191f;
    background: #fff;
}

.cs-pos .dash-table td:not(:first-child),
.cs-pos .dash-table th:not(:first-child),
.cs-owner .dash-table td:not(:first-child),
.cs-owner .dash-table th:not(:first-child) {
    text-align: right;
}

.cs-pos-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-line-dark);
    color: var(--color-muted-dark);
}

.cs-pos-total strong {
    color: #fff;
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 500;
}

.cs-pos-pay {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 8px;
}

.cs-pos-pay span {
    padding: 12px;
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-align: center;
}

.cs-pos-pay .is-primary {
    border-color: var(--color-accent);
    color: #1a191f;
    background: var(--color-accent);
}

.cs-count {
    box-shadow: var(--shadow);
}

.cs-count .mini-table .chip {
    margin-left: 6px;
    vertical-align: 1px;
}

/* Status colours are tuned for dark surfaces; darken them on light cards. */
.cs-visual .story-card .chip--green {
    color: #047857;
    background: rgba(52, 211, 153, .16);
}

.cs-pending {
    color: #b45309;
}

.cs-count-foot {
    margin: var(--space-2) 0 0;
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 12px;
}

.cs-owner .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cs-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-chat .bubble {
    max-width: 88%;
    font-size: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}

.cs-chat .bubble--volt {
    align-self: flex-start;
    font-style: normal;
}

/* Forecasting -------------------------------------------------------------- */

.cs-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: var(--space-5) 0 0;
    padding: 0;
    list-style: none;
}

.cs-stats li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: var(--space-2);
    border-top: 2px solid var(--color-ink);
}

.cs-stats strong {
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: clamp(28px, 1.4vw + 16px, 40px);
    font-weight: 500;
    letter-spacing: -.03em;
}

.cs-stats span {
    color: var(--color-muted);
    font-size: 15px;
}

/* Results ------------------------------------------------------------------ */

.cs-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-results .card {
    display: flex;
    flex-direction: column;
    padding: var(--space-4) var(--space-3);
}

.cs-result-figure {
    margin-bottom: var(--space-5);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: clamp(32px, 2vw + 16px, 48px);
    font-weight: 500;
    letter-spacing: -.03em;
    white-space: nowrap;
}

.cs-results h3 {
    color: var(--color-ink);
}

.cs-results p {
    margin: 0;
}

/* Closing band ------------------------------------------------------------- */

/* The homepage band is two columns (intro + audit form); this one has no form. */
.cs-cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 760px;
    text-align: center;
}

.cs-cta-content p {
    margin: 0 auto;
}

/* Retail intelligence page ------------------------------------------------- */

/* Hero with the CCTV loop behind the headline. */
/* The CCTV-themed hero reads as a security feed: black and white. */
.cs-hero--video .cs-hero-media img {
    filter: grayscale(1);
}

.cs-hero-media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
}

.cs-hero--video::after {
    background:
        linear-gradient(0deg, rgba(26, 25, 31, .97) 0%, rgba(26, 25, 31, .78) 50%, rgba(26, 25, 31, .45) 100%),
        linear-gradient(90deg, rgba(26, 25, 31, .6), transparent 75%);
}

.cs-wide {
    margin: 0;
}

/* The shared .cs-video is absolutely positioned for framed visuals; here it sits in flow. */
.cs-wide .cs-video {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-xl);
    background: var(--color-night);
}

/* A framed video that keeps the footage's 16:9 instead of cropping to a tall frame. */
.cs-visual--wide {
    min-height: 0;
    aspect-ratio: 16 / 9;
}

.cs-section--dark .cs-wide figcaption {
    margin-top: var(--space-2);
    color: var(--color-muted-dark);
    font-size: 14px;
}

.cs-rd {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
}

.cs-rd li {
    padding: var(--space-3);
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .03);
}

.cs-rd-index {
    display: block;
    margin-bottom: var(--space-3);
    color: var(--color-accent);
    font-family: var(--font-sans);
    font-size: 13px;
}

.cs-rd h3 {
    color: #fff;
}

.cs-section--dark .cs-rd p {
    margin: 0;
    font-size: 15px;
    line-height: 23px;
}

.cs-rd-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 20px;
    list-style: none;
}

.cs-rd-stats li {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cs-rd-stats strong {
    color: var(--color-accent);
    font-family: var(--font-sans);
    font-size: clamp(28px, 1.4vw + 16px, 40px);
    font-weight: 500;
    letter-spacing: -.02em;
}

.cs-rd-stats span {
    color: var(--color-muted-dark);
    font-size: 14px;
}

.cs-findings {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-findings li {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-line);
}

.cs-findings strong {
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.cs-findings span {
    color: var(--color-muted);
    font-size: 16px;
    line-height: 24px;
}

/* Before/after floor plans. */
.cs-plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.cs-plan {
    margin: 0;
    padding: var(--space-3);
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .03);
}

.cs-plan figcaption {
    margin-bottom: var(--space-2);
    color: var(--color-muted-dark);
    font-size: 14px;
}

.cs-plan figcaption span {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    color: #1a191f;
    background: #fff;
    font-family: var(--font-sans);
    font-size: 11px;
    text-transform: uppercase;
}

.cs-plan + .cs-plan figcaption span {
    background: var(--color-accent);
}

.plan-svg {
    display: block;
    width: 100%;
    height: auto;
}

.plan-floor {
    fill: #222129;
    stroke: rgba(255, 255, 255, .14);
}

.plan-heat {
    fill: var(--color-accent);
    opacity: .45;
}

.plan-heat--hot {
    fill: #f5ff6b;
    opacity: .6;
}

.plan-other {
    fill: rgba(255, 255, 255, .14);
}

.plan-essential {
    fill: #e9e9ee;
}

.plan-margin {
    fill: var(--color-accent);
}

.plan-slow {
    fill: var(--color-status-amber);
}

.plan-door {
    stroke: var(--color-accent);
    stroke-width: 4;
    stroke-linecap: round;
}

.plan-path {
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-dasharray: 6 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: map-flow 1.4s linear infinite;
}

.plan-label,
.plan-caption,
.plan-on {
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: .06em;
}

.plan-caption {
    fill: var(--color-muted-dark);
}

.plan-on {
    fill: #1a191f;
    font-weight: 500;
}

.cs-plan-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-muted-dark);
    font-size: 14px;
}

.cs-plan-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cs-plan-legend i {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.cs-plan-legend .is-essential {
    background: #e9e9ee;
}

.cs-plan-legend .is-margin {
    background: var(--color-accent);
}

.cs-plan-legend .is-slow {
    background: var(--color-status-amber);
}

.cs-plan-legend .is-path {
    height: 0;
    border-top: 2px dashed #fff;
    border-radius: 0;
}

.cs-moves {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3) clamp(32px, 4vw, 64px);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
    counter-reset: cs-move;
}

.cs-section--dark .cs-moves li {
    position: relative;
    padding-left: 48px;
    color: var(--color-muted-dark);
    font-size: 16px;
    line-height: 25px;
    counter-increment: cs-move;
}

.cs-moves li::before {
    content: counter(cs-move, decimal-leading-zero);
    position: absolute;
    top: 2px;
    left: 0;
    color: var(--color-accent);
    font-family: var(--font-sans);
    font-size: 13px;
}

.cs-moves strong {
    color: #fff;
    font-weight: 500;
}

.cs-results-note {
    max-width: 720px;
    margin: var(--space-5) 0 0;
    font-size: 18px;
    line-height: 28px;
}

@media (max-width: 1100px) {
    .cs-rd,
    .cs-rd-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .cs-plans,
    .cs-moves {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .cs-rd {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-findings li {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .cs-plan {
        padding: var(--space-2);
    }

    .cs-visual--media.cs-visual--wide {
        min-height: 0;
    }
}

/* Citations ---------------------------------------------------------------- */

/* Numbered markers after a claim (docs/case-study-guidelines.md). */
.cs-cite {
    margin-left: 1px;
    font-family: var(--font-sans);
    font-size: .62em;
    font-weight: 500;
    line-height: 0;
    vertical-align: super;
}

.cs-cite a {
    padding: 0 1px;
    color: var(--color-accent-deep);
}

.cs-section--dark .cs-cite a,
.cs-hero .cs-cite a {
    color: var(--color-accent);
}

.cs-cite a:hover {
    text-decoration: underline;
}

.cs-refs {
    padding: clamp(56px, 4vw + 32px, 96px) 0;
    border-top: 1px solid var(--color-line);
    background: var(--color-paper-soft);
}

.cs-refs-layout {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(32px, 5vw, 96px);
}

.cs-refs h2 {
    font-size: clamp(28px, 1.6vw + 16px, 40px);
    line-height: 1.1;
}

.cs-refs-intro {
    margin-top: var(--space-2);
    font-size: 15px;
    line-height: 23px;
}

.cs-refs ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: cs-ref;
}

.cs-refs li {
    position: relative;
    padding: 12px 0 12px 44px;
    border-top: 1px solid var(--color-line);
    color: var(--color-muted);
    font-size: 14px;
    line-height: 21px;
    counter-increment: cs-ref;
    scroll-margin-top: 110px;
}

.cs-refs li::before {
    content: counter(cs-ref);
    position: absolute;
    top: 12px;
    left: 0;
    color: var(--color-accent-deep);
    font-family: var(--font-sans);
    font-weight: 500;
}

.cs-refs li:target {
    background: rgba(124, 252, 0, .12);
}

.cs-refs cite {
    color: var(--color-ink);
    font-style: normal;
    font-weight: 500;
}

.cs-refs a {
    color: var(--color-ink);
    text-decoration: underline;
    text-decoration-color: var(--color-line);
    text-underline-offset: 3px;
    word-break: break-word;
}

.cs-refs a:hover {
    text-decoration-color: var(--color-ink);
}

/* AI visibility article ---------------------------------------------------- */

.cs-hero--plain {
    min-height: 0;
}

.cs-hero--plain::after {
    display: none;
}

.cs-hero--plain .cs-hero-content {
    padding-bottom: clamp(64px, 5vw + 32px, 112px);
}

.cs-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: var(--space-4) 0 0;
    color: var(--color-muted-dark);
    font-family: var(--font-sans);
    font-size: 12px;
    text-transform: uppercase;
}

.cs-byline span:first-child {
    color: var(--color-accent);
}

.cs-takeaways {
    align-self: start;
    padding: var(--space-4);
    border-radius: var(--radius-xl);
    color: #fff;
    background: var(--color-night);
}

.cs-takeaways .eyebrow {
    color: var(--color-accent);
}

.cs-takeaways ul {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-takeaways li {
    position: relative;
    padding-left: 22px;
    color: #e4e4e7;
    font-size: 16px;
    line-height: 24px;
}

.cs-takeaways li::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
}

.cs-left {
    margin-left: 0;
}

.cs-vs-wrap {
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-xl);
}

.cs-vs {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 24px;
}

.cs-vs th,
.cs-vs td {
    padding: 18px var(--space-3);
    border-top: 1px solid var(--color-line);
    text-align: left;
    vertical-align: top;
}

.cs-vs thead th {
    border-top: 0;
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.cs-vs thead th:last-child {
    color: var(--color-accent-deep);
}

.cs-vs tbody th {
    width: 24%;
    color: var(--color-ink);
    font-weight: 500;
}

.cs-vs td {
    color: var(--color-muted);
}

.cs-vs td:last-child {
    color: var(--color-ink);
    background: rgba(124, 252, 0, .06);
}

.cs-vs-notes {
    margin-top: var(--space-6);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cs-vs-notes p {
    margin: 0;
    font-size: 17px;
    line-height: 27px;
}

.cs-mistakes {
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-mistake {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-xl);
    background: var(--color-paper);
}

.cs-mistake-index {
    color: var(--color-accent-deep);
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
}

.cs-mistake-case {
    margin-bottom: var(--space-1);
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.cs-mistake h3 {
    margin-bottom: var(--space-2);
    color: var(--color-ink);
    font-size: clamp(22px, 1vw + 14px, 28px);
    line-height: 1.2;
    letter-spacing: -.02em;
}

.cs-mistake p:not([class]) {
    max-width: 820px;
    margin-bottom: var(--space-2);
    font-size: 16px;
    line-height: 25px;
}

.cs-fix {
    max-width: 820px;
    margin: 0;
    padding: 14px 18px;
    border-left: 3px solid var(--color-accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--color-ink);
    background: rgba(124, 252, 0, .1);
    font-size: 15px;
    line-height: 23px;
}

.cs-fix strong {
    font-weight: 600;
}

/* Dot-grid comparison (scripts/answer-sim.js). */
.cs-sim {
    padding: var(--space-4);
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, .03);
}

.cs-sim-toggle {
    display: inline-flex;
    gap: 4px;
    margin-bottom: var(--space-4);
    padding: 4px;
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-pill);
}

.cs-sim-toggle button {
    min-height: 40px;
    padding: 8px 18px;
    border: 0;
    border-radius: var(--radius-pill);
    color: var(--color-muted-dark);
    background: transparent;
    font: 500 15px var(--font-sans);
    cursor: pointer;
    transition: color .25s ease, background .25s ease;
}

.cs-sim-toggle button[aria-pressed="true"] {
    color: #1a191f;
    background: var(--color-accent);
}

.cs-sim-rows {
    display: grid;
    gap: var(--space-2);
}

.cs-sim-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 64px;
    align-items: center;
    gap: var(--space-2);
}

.cs-sim-name {
    color: #fff;
    font-weight: 500;
}

.cs-sim-dots {
    display: grid;
    grid-template-columns: repeat(25, minmax(0, 1fr));
    gap: 6px;
}

.cs-sim-dots i {
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    transition: background .3s ease, box-shadow .3s ease;
}

.cs-sim-dots i.is-on {
    background: var(--color-accent);
    box-shadow: 0 0 10px rgba(124, 252, 0, .45);
}

.cs-sim-rate {
    color: var(--color-accent);
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 500;
    text-align: right;
}

.cs-section--dark .cs-sim-note {
    margin: var(--space-4) 0 0;
    color: #e4e4e7;
    font-size: 16px;
}

.cs-sim-note strong {
    color: var(--color-accent);
}

.cs-rd--light li {
    border-color: var(--color-line);
    background: var(--color-paper-soft);
}

.cs-rd--light h3 {
    color: var(--color-ink);
}

.cs-rd--light p {
    margin: 0;
    font-size: 15px;
    line-height: 23px;
}

.cs-rd--light .cs-rd-index {
    color: var(--color-accent-deep);
}

.cs-vault {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(24px, 4vw, 64px);
    margin-top: 20px;
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-xl);
    color: #fff;
    background: var(--color-night);
}

.cs-vault .eyebrow {
    color: var(--color-accent);
}

.cs-vault h3 {
    margin: 0;
    font-size: clamp(24px, 1vw + 16px, 32px);
    line-height: 1.15;
}

.cs-vault > p {
    margin: 0;
    color: var(--color-muted-dark);
    font-size: 17px;
    line-height: 27px;
}

.cs-faq h3 {
    margin: var(--space-4) 0 var(--space-1);
    color: var(--color-ink);
    font-size: 20px;
}

.cs-faq h3:first-child {
    margin-top: 0;
}

.cs-faq p {
    margin: 0;
    font-size: 16px;
    line-height: 25px;
}

@media (max-width: 900px) {
    .cs-vs-notes,
    .cs-vault {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .cs-mistake {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-1);
        padding: var(--space-3) var(--space-2);
    }

    .cs-sim {
        padding: var(--space-2);
    }

    .cs-sim-toggle {
        display: flex;
    }

    .cs-sim-toggle button {
        flex: 1;
        padding: 8px 10px;
        font-size: 13px;
    }

    .cs-sim-row {
        grid-template-columns: minmax(0, 1fr) 52px;
        row-gap: 6px;
    }

    .cs-sim-dots {
        grid-column: 1 / -1;
        grid-row: 2;
        gap: 4px;
    }

    .cs-sim-rate {
        font-size: 18px;
    }

    .cs-takeaways,
    .cs-vault {
        padding: var(--space-3) var(--space-2);
    }
}

/* Mockups for the web, voice and cosmetics case studies --------------------- */

/* Browser frame. */
.cs-browser {
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
}

.cs-browser-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-line);
    background: var(--color-paper-soft);
}

.cs-browser-bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d9d9de;
}

.cs-browser-url {
    flex: 1;
    margin-left: 10px;
    padding: 4px 12px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    color: var(--color-muted);
    background: #fff;
    font-family: var(--font-sans);
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cs-browser-body {
    padding: var(--space-3);
}

/* Website: language demo. */
.cs-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-3);
}

.cs-langs button {
    min-height: 32px;
    padding: 4px 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    background: #fff;
    font: 500 13px var(--font-sans);
    cursor: pointer;
}

.cs-langs button[aria-pressed="true"] {
    border-color: var(--color-ink);
    color: #fff;
    background: var(--color-ink);
}

.cs-site-hero {
    padding: var(--space-4) var(--space-3);
    border-radius: var(--radius-md);
    color: #fff;
    background: linear-gradient(135deg, #1f3b26, #2f5a33 60%, #557a2e);
}

.cs-site-hero[dir="rtl"] {
    text-align: right;
}

.cs-site-kicker {
    margin: 0 0 8px;
    color: rgba(255, 255, 255, .7);
    font-family: var(--font-sans);
    font-size: 11px;
    text-transform: uppercase;
}

.cs-site-title {
    margin: 0 0 var(--space-2);
    color: #fff;
    font-size: clamp(20px, 1.4vw + 10px, 28px);
    font-weight: 600;
    line-height: 1.25;
}

.cs-site-button {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: #1a191f;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
}

.cs-site-grades {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: var(--space-2);
}

.cs-site-grades span {
    padding: 10px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    font-size: 13px;
    font-weight: 500;
}

.cs-site-grades small {
    display: block;
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 11px;
}

/* Before/after meters (Core Web Vitals, abandonment). */
.cs-meters {
    display: grid;
    gap: var(--space-3);
}

.cs-meter-label {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: 8px;
    color: #fff;
    font-weight: 500;
}

.cs-meter-label small {
    color: var(--color-muted-dark);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
}

.cs-meter-track {
    position: relative;
    height: 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .1);
}

.cs-meter-track b,
.cs-meter-track em {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: var(--radius-pill);
}

.cs-meter-track b {
    width: var(--before);
    background: var(--color-status-red);
    opacity: .7;
}

.cs-meter-track em {
    width: var(--after);
    background: var(--color-accent);
}

.cs-meter-track i {
    position: absolute;
    top: -5px;
    left: var(--limit);
    width: 2px;
    height: 20px;
    background: #fff;
}

.cs-meter-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
}

.cs-meter-values span:first-child {
    color: var(--color-status-red);
}

.cs-meter-values span:last-child {
    color: var(--color-accent);
}

/* Web store: checkout. */
.cs-checkout {
    display: grid;
    gap: var(--space-2);
}

.cs-steps-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    font-size: 12px;
}

.cs-steps-bar span {
    padding: 6px 8px;
    border-bottom: 3px solid var(--color-line);
    color: var(--color-muted);
}

.cs-steps-bar .is-done {
    border-color: var(--color-ink);
    color: var(--color-ink);
}

.cs-steps-bar .is-current {
    border-color: var(--color-accent);
    color: var(--color-ink);
    font-weight: 600;
}

.cs-order-line {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--color-paper-soft);
    font-size: 14px;
}

.cs-order-line strong {
    font-family: var(--font-sans);
    font-weight: 500;
}

.cs-pay {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-pay li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    font-size: 14px;
}

.cs-pay li::before {
    content: "";
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 2px solid #c9c9cf;
    border-radius: 50%;
}

.cs-pay li.is-selected {
    border-color: var(--color-ink);
}

.cs-pay li.is-selected::before {
    border: 4px solid var(--color-ink);
}

.cs-pay small {
    margin-left: auto;
    color: var(--color-muted);
    font-size: 12px;
}

.cs-pay-button {
    padding: 12px;
    border-radius: var(--radius-sm);
    color: #1a191f;
    background: var(--color-accent);
    font-weight: 600;
    text-align: center;
}

.cs-wa {
    max-width: 320px;
    margin-left: auto;
    padding: 10px 12px;
    border-radius: 12px 12px 4px 12px;
    color: #11331f;
    background: #d9fdd3;
    font-size: 13px;
    line-height: 19px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}

.cs-wa small {
    display: block;
    margin-top: 4px;
    color: #4a6b55;
    font-size: 11px;
    text-align: right;
}

/* A phase whose mockup needs more room than the copy (web app board). */
.cs-phase--wide {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
}

.cs-phase--wide .cs-visual > * {
    max-width: none;
}

@media (max-width: 1100px) {
    .cs-phase--wide .cs-app {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-phase--wide .cs-app-nav {
        display: none;
    }
}

@media (max-width: 900px) {
    .cs-phase--wide {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Web app: maintenance board. */
.cs-app {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 360px;
}

.cs-app-nav {
    display: grid;
    align-content: start;
    gap: 4px;
    padding: var(--space-2);
    border-right: 1px solid var(--color-line);
    background: var(--color-paper-soft);
    font-size: 13px;
}

.cs-app-nav span {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
}

.cs-app-nav .is-active {
    color: var(--color-ink);
    background: #fff;
    font-weight: 600;
}

.cs-app-main {
    padding: var(--space-2);
}

.cs-app-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: var(--space-2);
}

.cs-app-head strong {
    font-size: 16px;
}

.cs-app-head small {
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 12px;
}

.cs-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.cs-board-col {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--color-paper-soft);
}

.cs-board-col > p {
    margin: 0 0 2px;
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-size: 11px;
    text-transform: uppercase;
}

.cs-ticket {
    padding: 8px;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    line-height: 17px;
}

.cs-ticket strong {
    display: block;
    color: var(--color-ink);
    font-weight: 600;
}

.cs-ticket span {
    color: var(--color-muted);
}

.cs-ticket .chip {
    margin-top: 6px;
}

.cs-visual .cs-ticket .chip--red {
    color: #b91c1c;
    background: rgba(248, 113, 113, .14);
}

.cs-visual .cs-ticket .chip--amber {
    color: #b45309;
    background: rgba(251, 191, 36, .18);
}

.cs-visual .cs-ticket .chip--green {
    color: #047857;
    background: rgba(52, 211, 153, .16);
}

.cs-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px var(--space-4);
    margin: var(--space-5) 0 0;
    padding: 0;
    list-style: none;
}

.cs-checks li {
    position: relative;
    padding-left: 30px;
    color: var(--color-muted-dark);
    font-size: 15px;
    line-height: 23px;
}

.cs-checks li::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m5 9 3 3 5-6' fill='none' stroke='%231a191f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.cs-checks strong {
    color: #fff;
    font-weight: 500;
}

/* The checklist on a light section (voice agent's limits). */
.cs-checks--light {
    grid-template-columns: minmax(0, 1fr);
    margin-top: var(--space-3);
}

.cs-checks--light li {
    color: var(--color-muted);
}

.cs-checks--light strong {
    color: var(--color-ink);
}

/* Voice agent: call transcript. */
.cs-call {
    display: grid;
    gap: 10px;
    padding: var(--space-3);
    border-radius: var(--radius-xl);
    background: var(--color-night);
    box-shadow: var(--shadow);
}

.cs-call-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-line-dark);
    color: #fff;
    font-weight: 500;
}

.cs-call-head small {
    margin-left: auto;
    color: var(--color-status-green);
    font-family: var(--font-sans);
    font-size: 12px;
}

.cs-call .bubble {
    max-width: 88%;
    font-size: 14px;
}

.cs-call .bubble--volt {
    align-self: flex-start;
    font-style: normal;
}

.cs-call .bubble--user {
    justify-self: end;
}

.cs-tool {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px dashed rgba(124, 252, 0, .4);
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-family: var(--font-sans);
    font-size: 12px;
}

.cs-tool::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.cs-latency {
    display: grid;
    grid-template-columns: var(--hear) var(--think) var(--speak);
    gap: 3px;
    margin-top: var(--space-2);
}

.cs-latency span {
    padding: 10px 8px;
    border-radius: 6px;
    color: #1a191f;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-latency span:nth-child(1) {
    background: #c9f7a4;
}

.cs-latency span:nth-child(2) {
    background: var(--color-accent);
}

.cs-latency span:nth-child(3) {
    background: #9be26b;
}

.cs-latency-note {
    margin-top: 10px;
    color: var(--color-muted-dark);
    font-size: 14px;
}

/* Cosmetics: shelf heatmap and product funnel. */
.cs-shelf-wrap {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: var(--space-3);
    align-items: start;
}

.cs-shelf {
    display: grid;
    gap: 10px;
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    background: #2a2930;
}

.cs-shelf-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 4px solid #4a4952;
}

.cs-shelf-row button {
    display: grid;
    place-items: end start;
    min-height: 74px;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #1a191f;
    background: rgba(124, 252, 0, var(--heat));
    font: 500 11px/1.25 var(--font-sans);
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
}

.cs-shelf-row button[aria-pressed="true"] {
    border-color: #fff;
    transform: translateY(-2px);
}

.cs-shelf-row button.is-cold {
    color: #e4e4e7;
}

.cs-shelf-row button.is-out {
    color: var(--color-status-amber);
    background: repeating-linear-gradient(45deg, rgba(251, 191, 36, .14) 0 6px, transparent 6px 12px);
    border-color: rgba(251, 191, 36, .5);
}

.cs-shelf-caption {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--color-muted-dark);
    font-family: var(--font-sans);
    font-size: 11px;
}

.cs-funnel {
    padding: var(--space-3);
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .03);
}

.cs-funnel h3 {
    margin-bottom: 4px;
    color: #fff;
}

.cs-funnel > p {
    margin-bottom: var(--space-2);
    font-size: 14px;
}

.cs-funnel ol {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-funnel li {
    display: grid;
    gap: 4px;
}

.cs-funnel li > span {
    display: flex;
    justify-content: space-between;
    color: #e4e4e7;
    font-size: 14px;
}

.cs-funnel li > span strong {
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 500;
}

.cs-funnel li > i {
    display: block;
    height: 8px;
    width: var(--w);
    border-radius: var(--radius-pill);
    background: var(--color-accent);
    transition: width .4s var(--ease-out);
}

.cs-funnel li.is-back > i {
    background: var(--color-status-amber);
}

.cs-funnel-note {
    margin-top: var(--space-2);
    color: var(--color-accent);
    font-size: 14px;
    line-height: 21px;
}

@media (max-width: 900px) {
    .cs-shelf-wrap,
    .cs-checks {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .cs-app {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-app-nav {
        display: none;
    }

    .cs-board {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-site-grades {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-shelf-row button {
        min-height: 60px;
        font-size: 10px;
    }

    .cs-latency span {
        font-size: 10px;
        padding: 8px 4px;
    }
}

/* Real-footage additions: colour video heroes, a clip beside a heading, a full-width band. */
.cs-hero--color .cs-hero-media video {
    filter: none;
}

.cs-media-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    align-items: end;
    gap: clamp(24px, 4vw, 64px);
    margin-bottom: clamp(32px, 3.2vw + 18px, 64px);
}

.cs-media-head .section-heading {
    margin-bottom: 0;
}

.cs-clip {
    position: relative;
    margin: 0;
    aspect-ratio: 9 / 14;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--color-night);
}

.cs-wide--photo img {
    display: block;
    width: 100%;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.cs-wide--photo {
    margin-bottom: var(--space-5);
}

.cs-band {
    position: relative;
    height: clamp(280px, 38vw, 520px);
    overflow: hidden;
    background: var(--color-night);
}

.cs-band::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(26, 25, 31, .85), transparent 55%);
}

.cs-band-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--space-4);
    z-index: 1;
    margin: 0 auto;
    color: #e4e4e7;
    font-family: var(--font-sans);
    font-size: 13px;
}

.cs-band-caption strong {
    color: var(--color-accent);
    font-weight: 500;
}

@media (max-width: 700px) {
    .cs-media-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-clip {
        aspect-ratio: 4 / 5;
    }

    .cs-wide--photo img {
        aspect-ratio: 16 / 10;
    }
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1100px) {
    .cs-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cs-outcomes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: var(--space-4);
    }

    .cs-outcomes li:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .cs-result-figure {
        font-size: 36px;
    }
}

@media (max-width: 900px) {
    .cs-split,
    .cs-phase,
    .cs-story,
    .cs-map-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-phase--flip .cs-phase-copy {
        order: 0;
    }

    .cs-photo--tall {
        aspect-ratio: 4 / 3;
    }

    .map-svg--wide {
        display: none;
    }

    .map-svg--tall {
        display: block;
    }

    .cs-feed {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-phases {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cs-phases li:nth-child(3) {
        border-left: 0;
    }

    .cs-phases li:nth-child(odd) a {
        padding-left: 0;
    }

    .cs-phases a {
        padding-bottom: var(--space-3);
    }

    .cs-phases li:nth-child(n + 3) {
        border-top: 1px solid var(--color-line);
    }
}

@media (max-width: 600px) {
    /* Phone hero: headline and two lines over the photo, nothing else. */
    .cs-hero {
        min-height: 560px;
    }

    .cs-hero-content {
        padding: 120px 0 var(--space-5);
    }

    .cs-hero h1 {
        font-size: 2.6rem;
        letter-spacing: -.04em;
    }

    .cs-hero .eyebrow {
        margin-bottom: var(--space-2);
    }

    .cs-outcomes-band {
        padding: var(--space-4) 0;
    }

    .cs-outcomes {
        row-gap: var(--space-3);
    }

    .cs-outcomes strong {
        font-size: 30px;
    }

    .cs-outcomes li > span {
        font-size: 14px;
        line-height: 20px;
    }

    .cs-results,
    .cs-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-lede {
        font-size: 16px;
        line-height: 24px;
    }

    .cs-prose > p,
    .cs-story-copy > p:not([class]),
    .cs-map-head > p {
        font-size: 17px;
        line-height: 26px;
    }

    .cs-outcomes li {
        padding: 0 var(--space-2);
    }

    .cs-outcomes li:nth-child(odd) {
        padding-left: 0;
    }

    /* The mock-ups carry their own padding; a second frame squeezes the tables. */
    .cs-visual {
        padding: 0;
        background: none;
    }

    .cs-visual--media {
        min-height: 560px;
        background: var(--color-night);
    }

    .cs-overlay-card,
    .cs-visual--media .cs-chat {
        right: var(--space-2);
        bottom: var(--space-2);
        width: calc(100% - 32px);
    }
}

@media (max-width: 600px) {
    .cs-feed-list li {
        grid-template-columns: 64px minmax(0, 1fr);
        row-gap: 2px;
    }

    .cs-feed-list li > :last-child {
        grid-column: 2;
        white-space: normal;
    }
}

/* After the base rules above so it wins: references and the SEO/AEO table stack on small screens. */
@media (max-width: 900px) {
    .cs-refs-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Below 720px the table becomes one card per row: no sideways scrolling on any phone. */
@media (max-width: 720px) {
    .cs-vs-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .cs-vs,
    .cs-vs tbody,
    .cs-vs tr,
    .cs-vs th,
    .cs-vs td {
        display: block;
        min-width: 0;
        width: auto;
    }

    .cs-vs thead {
        display: none;
    }

    .cs-vs tr {
        margin-bottom: 12px;
        overflow: hidden;
        border: 1px solid var(--color-line);
        border-radius: var(--radius-lg);
    }

    .cs-vs tbody th {
        width: auto;
        padding: 14px 16px 6px;
        border-top: 0;
    }

    .cs-vs td {
        padding: 10px 16px;
        border-top: 1px solid var(--color-line);
    }

    .cs-vs td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: var(--color-muted);
        font-family: var(--font-sans);
        font-size: 11px;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .cs-vs td:last-child::before {
        color: var(--color-accent-deep);
    }
}

@media (prefers-reduced-motion: reduce) {
    .plan-path,
    .map-flow,
    .cs-feed-list li.is-new {
        animation: none;
    }
}
