/* ============================================================
   STAGES — shared engine look for case study demos
   Every color, size, radius, shadow, duration, and easing below
   already exists in styles.css. Values marked DRAFT are first
   passes Parker asked for and still needs to approve.
   ============================================================ */

/* ── STAGE ────────────────────────────────────────────────── */

.stage {
    /* approved cursor: 1.25rem dot in --label ink at 25% */
    --cursor-size: 1.25rem;
    --cursor-color: var(--label);
    --cursor-opacity: 0.25;
    /* DRAFT: Parker approved monospace labels; system stack, no font file */
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    position: relative;
    /* in a grid (option B's pair) a scaled stage would otherwise grow to its content's width */
    min-width: 0;
    background: var(--surface);
    border-radius: 1.5rem;
    /* every stage hugs its content with 44px on every side; on smaller screens it narrows
       like the Work Highlights mat, clamp(16rem, 36vw, 30rem) * 180 / 1920, down to its
       1.5rem (Parker) */
    padding: clamp(1.5rem, 3.375vw, 2.75rem);
}

/* the cursor moves in the content's own pixels, so it scales with it */
.stage__content {
    position: relative;
}

/* on phones the content keeps its desktop layout and is scaled down to fit (Stage.tsx);
   it still takes its full layout width, so the stage clips sideways only, which leaves
   menus free to hang past the bottom */
.stage[data-scaled="true"] {
    overflow-x: clip;
}

.stage[data-scaled="true"] .stage__content {
    transform-origin: 0 0;
}

.stage__content > .heading {
    margin-bottom: 1.25rem;
    font-family: var(--font-mono);
}

/* diagram and blueprint labels */
.ui-mono {
    font-family: var(--font-mono);
}

/* ── SIMULATED CURSOR ─────────────────────────────────────── */
/* drawn inside the stage only; the visitor's real pointer is
   never changed. outer span travels, inner dot presses. */

.stage__cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition:
        transform 800ms var(--ease-out),
        opacity 180ms var(--ease-out);
}

.stage__cursor[data-visible="true"] {
    opacity: 1;
}

.stage__cursor-dot {
    display: block;
    width: var(--cursor-size);
    height: var(--cursor-size);
    margin: calc(var(--cursor-size) / -2) 0 0 calc(var(--cursor-size) / -2);
    border-radius: 50%;
    background: var(--cursor-color);
    opacity: var(--cursor-opacity);
    transition: transform 120ms ease-out;
}

/* DRAFT press: shrinks like the iPadOS pointer on tap */
.stage__cursor[data-pressed="true"] .stage__cursor-dot {
    transform: scale(0.8);
}

/* ── SHARED UI PIECES ─────────────────────────────────────── */

.ui-window {
    position: relative;
    background: var(--bg);
    border-radius: 0.9rem;
    box-shadow: 0 1px 3px var(--shadow);
    overflow: hidden;
}

.ui-window__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.ui-title {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--label);
}

.ui-text {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--label);
}

.ui-meta {
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    color: var(--label-3);
}

.ui-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--dot);
    transition: background 120ms ease-out;
}

.ui-row[data-selected="true"] {
    background: var(--surface);
}

.ui-avatar {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--surface);
}

.ui-bar {
    height: 0.5rem;
    border-radius: 999px;
    background: var(--dot);
}

.ui-button {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--bg);
    background: var(--label);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    transition: opacity 120ms ease-out;
}

.ui-chip {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--label-2);
    background: var(--surface);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

.ui-field {
    flex: 1;
    min-height: 2rem;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--dot);
    border-radius: 0.5rem;
}

.ui-field[data-focused="true"] {
    outline: 2px solid #60A5FA;
    outline-offset: 3px;
}

/* ── SHEET: simplified spreadsheet table ─────────────────── */

/* menus may hang below the table, so the window doesn't clip.
   Tables stay light in dark mode: the light theme's values, scoped
   to the table and its dropdown. */
.ui-window.sheet {
    overflow: visible;
    --bg: #FCFCFC;
    --label: #16161D;
    --label-2: rgba(22, 22, 29, 0.62);
    --label-3: rgba(22, 22, 29, 0.42);
    --surface: #F6F6F6;
    --dot: rgba(22, 22, 29, 0.1);
    --shadow: rgba(22, 22, 29, 0.18);
}

.sheet__tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* inactive tabs keep the chip's box so switching doesn't shift */
.sheet__tab[data-active="false"] {
    background: none;
    color: var(--label-3);
}

/* status pill colors, from Parker's pill sheet */
.ui-chip[data-tone="blue"] {
    background: #CCE6FE;
    color: #00427C;
}

.ui-chip[data-tone="green"] {
    background: #CFF3E2;
    color: #086237;
}

.ui-chip[data-tone="yellow"] {
    background: #FFF7CE;
    color: #806B05;
}

.ui-chip[data-tone="orange"] {
    background: #FAE8D6;
    color: #74461A;
}

.ui-chip[data-tone="red"] {
    background: #FAD6D7;
    color: #972224;
}

.ui-chip[data-tone="grey"] {
    background: #EEF0F2;
    color: #545454;
}

/* inset ring instead of a border so the pill stays the same size */
.ui-chip[data-tone="outline"] {
    background: #FFFFFF;
    color: #1E3A70;
    box-shadow: inset 0 0 0 1px #DADEE7;
}

/* rows of cells divided by lines, like a spreadsheet */
.ui-row.sheet__row {
    display: grid;
    gap: 0;
    padding: 0;
}

.sheet__row > * {
    min-width: 0;
    padding: 0.75rem 0.5rem;
    border-left: 1px solid var(--dot);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sheet__row > :first-child {
    border-left: none;
    text-align: center;
}

/* row number, then each table's columns */
.sheet__row--customers {
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) 7rem 7rem 7rem;
}

.sheet__row--buildings {
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1fr) 7rem 7rem 9.5rem;
}

.sheet__row--sales {
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) 7rem 5rem 7rem;
}
/* each cell's content fills in on its own; the cell itself stays */
/* the ellipsis takes the text's own color (and fades with it), not the cell's inherited page color */
.sheet__row :is(.ui-text, .ui-meta) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* M03's stalled customer: Parker's light blue fades in fast and clears slowly */
.ui-row.sheet__row[data-highlight] {
    transition: background-color 800ms var(--ease-out);
}

.ui-row.sheet__row[data-highlight="true"] {
    background-color: #E5F3FE;
    transition-duration: 180ms;
}

.sheet__fill {
    display: block;
    transition: opacity 180ms var(--ease-out);
}

.sheet__fill[data-filled="false"] {
    opacity: 0;
}

/* M03's assignment: the toggle knob's spring */
.sheet__fill--bounce {
    transform-origin: left center;
    transition:
        opacity 180ms var(--ease-out),
        transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sheet__fill--bounce[data-filled="false"] {
    transform: scale(0);
}

/* M03's "system is thinking" dots, pulsing one after another */
.sheet__row > .sheet__think-cell {
    position: relative;
}

.sheet__row .sheet__think {
    position: absolute;
    top: 50%;
    left: calc(0.5rem + 4px);
    display: flex;
    gap: 0.25rem;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 180ms var(--ease-out);
}

.sheet__row .sheet__think[data-on="true"] {
    opacity: 1;
}

.sheet__think > span {
    display: block;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: currentColor;
    animation: sheet-think 1.2s ease-in-out infinite;
}

.sheet__think > span:nth-child(2) {
    animation-delay: 0.2s;
}

.sheet__think > span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes sheet-think {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* status dropdown */
.sheet__row > .sheet__menu-cell {
    position: relative;
    overflow: visible;
}

/* opens downward; Parker is fine with it hanging past the stage */
.sheet__menu {
    position: absolute;
    top: calc(100% - 0.25rem);
    left: 0.25rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px var(--shadow);
    transition: opacity 180ms var(--ease-out);
}

.sheet__menu[data-open="false"] {
    opacity: 0;
    visibility: hidden;
}

/* each option is a row holding its colored pill; the hovered row
   gets the grey fill */
.sheet__option {
    align-self: stretch;
    padding: 0.25rem;
    border-radius: 0.5rem;
    transition: background 120ms ease-out;
}

.sheet__option[data-active="true"] {
    background: var(--surface);
}

/* ── MODE: PROCESS — wireframe UI ─────────────────────────── */
/* outlines and bars only: no shadow, no real text */

.stage--process .ui-window {
    box-shadow: none;
    border: 1px solid var(--dot);
}

.stage--process .ui-avatar {
    background: none;
    border: 1px solid var(--dot);
}

/* ── MODE: TECHNICAL — technical diagram ──────────────────── */

.diagram {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0 0.75rem;
}

.diagram__sources {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.diagram__links {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-self: stretch;
}

.diagram-node {
    background: var(--bg);
    border: 1px solid var(--dot);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.diagram-link {
    position: relative;
    height: 1px;
    background: var(--label-3);
}

/* arrowhead */
.diagram-link::after {
    content: "";
    position: absolute;
    right: 0;
    top: -0.25rem;
    border-top: 0.25rem solid transparent;
    border-bottom: 0.25rem solid transparent;
    border-left: 0.5rem solid var(--label-3);
}

/* one row per source so each arrow lines up with its node; the
   target node spans every row (set gridRow inline to the row count) */
.diagram--rows {
    gap: 0.75rem;
}

.diagram--rows .diagram__target {
    grid-column: 3;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

/* entity card → connector → Airtable base (M01) */
.flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem minmax(0, 1fr);
    align-items: stretch;
}

.flow__field,
.flow__record {
    justify-content: space-between;
}

.flow__field > .ui-text,
.flow__record > :last-child {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.flow__submit {
    justify-content: flex-end;
}

.flow__submit .ui-button {
    position: relative;
    background: #0084F8;
    transition:
        opacity 120ms ease-out,
        transform 120ms ease-out;
}

/* Parker's 20% until every field is filled */
.flow__submit .ui-button[data-ready="false"] {
    opacity: 0.2;
}

/* Parker's 5% press, with the site's instant 60ms press timing */
.flow__submit .ui-button[data-pressed="true"] {
    transform: scale(0.95);
    transition-duration: 60ms;
}

/* invisible points the cursor travels to: an edge of Submit, so it sits
   half on and half off and stays visible, or a resting spot off the button */
.flow__submit {
    position: relative;
}

.flow__anchor {
    position: absolute;
    top: 50%;
}

.flow__anchor[data-side="left"] {
    left: 0;
}

.flow__anchor[data-side="right"] {
    right: 0;
}

.flow__anchor:is([data-side="top"], [data-side="bottom"]) {
    left: 50%;
}

.flow__anchor[data-side="top"] {
    top: 0;
}

.flow__anchor[data-side="bottom"] {
    top: 100%;
}

.flow__anchor[data-spot="a"] {
    left: 25%;
}

.flow__anchor[data-spot="b"] {
    left: 50%;
}

.flow__link {
    position: relative;
    display: flex;
    align-items: center;
}

.flow__link > .diagram-link {
    flex: 1;
}

.flow__pill {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    border: 1px solid var(--dot);
}

.diagram-link--dashed {
    height: 0;
    background: none;
    border-top: 1px dashed var(--label-3);
}

/* M06: sources → one database ⇄ the apps, with the retired base under it.
   Each side is one grid so its nodes share a width and every arrow meets the database. */
.hub {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
}

.hub__side {
    display: grid;
    align-items: center;
    row-gap: 0.75rem;
}

.hub__side--in {
    grid-template-columns: auto minmax(1.5rem, 1fr);
}

.hub__side--out {
    grid-template-columns: minmax(1.5rem, 1fr) auto;
}

.hub__row {
    display: contents;
}

.hub .diagram-node {
    display: flex;
    flex-direction: column;
}

/* the database runs the full height of both sides, so every arrow lands on it */
.hub__db {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    align-items: center;
    justify-content: center;
}

.hub__side--in {
    grid-column: 1;
}

.hub__side--out {
    grid-column: 3;
}

.hub__side {
    grid-row: 1;
}

.hub__migrate {
    position: relative;
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hub__up {
    width: 0;
    height: 1.5rem;
    border-top: none;
    border-left: 1px dashed var(--label-3);
}

.hub__up::after {
    left: -0.25rem;
    right: auto;
    top: 0;
    border-top: none;
    border-left: 0.25rem solid transparent;
    border-right: 0.25rem solid transparent;
    border-bottom: 0.5rem solid var(--label-3);
}

.hub__migrate > .ui-meta {
    position: absolute;
    top: 0.25rem;
    left: calc(50% + 0.5rem);
    white-space: nowrap;
}

/* the retired base: the blueprint's dashed outline, in grey */
.hub__retired {
    border: 1px dashed var(--label-3);
    color: var(--label-3);
    white-space: nowrap;
}

/* reads and writes: an arrowhead on both ends */
.diagram-link--both::before {
    content: "";
    position: absolute;
    left: 0;
    top: -0.25rem;
    border-top: 0.25rem solid transparent;
    border-bottom: 0.25rem solid transparent;
    border-right: 0.5rem solid var(--label-3);
}

/* M06 option B: the isometric stack. Lines are the diagram grey at 1px, faces use the
   theme's bg and surfaces, and a landing layer lights up in Parker's blue over M03's light blue. */
.iso {
    position: relative;
    width: 100%;
}

.iso > svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.iso polygon,
.iso line,
.iso circle {
    stroke: var(--label-3);
    stroke-width: 1px;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.iso__top {
    fill: var(--bg);
}

.iso__left {
    fill: var(--surface);
}

.iso__right {
    fill: var(--surface-hover);
}

.iso__slab polygon {
    transition:
        fill 180ms var(--ease-out),
        stroke 180ms var(--ease-out);
}

/* dashed lines carry data; label leaders stay solid */
.iso__wire line {
    stroke-dasharray: 2 3;
}

.iso__wire circle {
    fill: var(--label-3);
}

/* a connection grows out of its starting point, like M01's connector */
.iso__wire {
    transform-box: view-box;
    transition: transform 800ms var(--ease-out);
}

.iso__wire[data-on="false"] {
    transform: scale(0);
}

/* data packets: utility data flows into Supabase; Supabase and AWS trade it back and forth.
   DRAFT: the packet size and its 1.2s trip (the loop pause) */
.iso__flow {
    transition: opacity 180ms var(--ease-out);
}

.iso__flow[data-on="false"] {
    opacity: 0;
}

.iso .iso__packet {
    fill: #0084F8;
    stroke: none;
    animation: iso-packet 1.2s linear infinite;
}

.iso .iso__packet--shuttle {
    animation: iso-shuttle 1.2s ease-in-out infinite alternate;
}

@keyframes iso-packet {
    0% { transform: translate(0, 0); opacity: 0; }
    15%, 85% { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

@keyframes iso-shuttle {
    from { transform: translate(0, 0); }
    to { transform: translate(var(--dx), var(--dy)); }
}

/* AWS appears once utility data is in Supabase */
.iso__aws polygon {
    transition: opacity 180ms var(--ease-out);
}

.iso__aws[data-on="false"] polygon {
    opacity: 0;
}

.iso__label--center {
    transform: translate(-50%, -50%);
}

@media (prefers-reduced-motion: reduce) {
    .iso .iso__packet {
        animation: none;
        opacity: 0;
    }

    .iso__aws polygon {
        transition: none;
    }
}

/* Airtable: the blueprint's dashed outline; it slides over, then sinks in and fades */
.iso__air polygon {
    stroke-dasharray: 3 3;
}

.iso__air {
    transition:
        transform 800ms var(--ease-out),
        opacity 180ms var(--ease-out);
}

.iso__air[data-at="gone"] {
    opacity: 0;
}

/* back to the side on loop, without sliding backwards */
.iso__air[data-at="side"] {
    transition: none;
}

/* each layer drops onto the stack with the toggle knob's spring */
.iso__plate {
    transition:
        transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 180ms var(--ease-out);
}

.iso__plate[data-built="false"] {
    opacity: 0;
    transform: translateY(-24px);
}

.iso__plate[data-lit="true"] polygon {
    stroke: #0084F8;
}

.iso__plate[data-lit="true"] .iso__top {
    fill: #E5F3FE;
}

.iso__label {
    position: absolute;
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    transform: translateY(-50%);
}

/* a title with a subtitle: the title, not the pair, sits on the leader */
.iso__label--sub {
    transform: translateY(-0.75rem);
}

.iso__label--source {
    align-items: flex-end;
    transform: translate(-100%, -50%);
}

.iso__label--air {
    transform: translate(-50%, -50%);
    transition: opacity 180ms var(--ease-out);
}

.iso__label--air:not([data-at="side"], [data-at="ready"]) {
    opacity: 0;
}

/* the migration arrow and its label show only just before Airtable moves */
.iso__migrate line {
    stroke-dasharray: 2 3;
}

.iso__migrate polygon {
    fill: var(--label-3);
    stroke: none;
}

.iso__migrate,
.iso__label--migrate {
    transition: opacity 180ms var(--ease-out);
}

.iso__migrate:not([data-at="ready"]),
.iso__label--migrate:not([data-at="ready"]) {
    opacity: 0;
}

.iso__label--migrate {
    transform: translate(-50%, -50%);
}

/* M06 option C: the tech stack as an architecture map. Existing diagram nodes and grey
   lines; the database gets M03's light blue with Parker's blue outline. */
.arch {
    position: relative;
    width: 100%;
}

.arch > svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* the Supabase boundary everything shared lives inside */
.arch__frame {
    position: absolute;
    border: 1px solid var(--dot);
    border-radius: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.arch__heading {
    position: absolute;
}

.arch__node {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 0.75rem;
    white-space: nowrap;
}

/* white boxes share M04's window shadow (Parker); dashed and blue nodes stay flat */
.arch__node:not(.arch__hub, .arch__airtable) {
    box-shadow: 0 1px 3px var(--shadow);
}

.arch__node .ui-meta + .ui-meta,
.arch__node .ui-text + .ui-meta {
    white-space: normal;
}

.arch__hub {
    align-items: center;
    background: #E5F3FE;
    border-color: #0084F8;
}

.arch__hub[data-lit="true"] {
    box-shadow: 0 0 0 0.25rem #E5F3FE;
}

.arch__hub {
    transition: box-shadow 180ms var(--ease-out);
}

/* Airtable: the blueprint's dashed outline; it moves into the database and fades */
.arch__airtable {
    border: 1px dashed var(--label-3);
    transition:
        left 800ms var(--ease-out),
        top 800ms var(--ease-out),
        transform 800ms var(--ease-out),
        opacity 800ms var(--ease-out);
}

.arch__airtable:is([data-at="over"], [data-at="gone"]) {
    opacity: 0;
    transform: scale(0.6);
}

.arch__airtable[data-at="before"] {
    transition: none;
}

/* connectors: dashed grey, drawn in along their route through a mask */
.arch__line {
    fill: none;
    stroke: var(--label-3);
    stroke-width: 1px;
    stroke-dasharray: 2 3;
    vector-effect: non-scaling-stroke;
}

.arch__draw {
    fill: none;
    stroke: #fff;
    stroke-width: 6;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 800ms var(--ease-out);
}

.arch__wire[data-on="true"] .arch__draw {
    stroke-dashoffset: 0;
}

.arch__head {
    fill: var(--label-3);
    opacity: 0;
    transition: opacity 180ms var(--ease-out);
}

.arch__wire[data-on="true"] .arch__head {
    opacity: 1;
    transition-delay: 600ms;
}

/* DRAFT: packet size, and a 1.2s trip (the loop pause) */
.arch__packet {
    fill: #0084F8;
}

@media (prefers-reduced-motion: reduce) {
    .arch__airtable,
    .arch__draw,
    .arch__head,
    .arch__hub {
        transition: none;
    }
}

/* M06 option D: option C's nodes and connectors with option B's slabs */
.iso .arch__packet {
    stroke: none;
}

/* the Airtable cube: dashed like the blueprint; Supabase slides over it and it fades */
.d__airtable polygon {
    stroke-dasharray: 3 3;
}

.d__airtable {
    transition: opacity 800ms var(--ease-out);
}

.d__airtable:is([data-at="arriving"], [data-at="done"]) {
    opacity: 0;
}

/* Supabase waits on the right while the data migrates, then slides in */
.d__supabase {
    transition:
        transform 800ms var(--ease-out),
        opacity 180ms var(--ease-out);
}

.d__supabase[data-at="before"] {
    opacity: 0;
}

.d__airtable[data-at="before"],
.d__supabase[data-at="before"] {
    transition: none;
}

/* Supabase lights like a dropped layer while "Migration Complete" shows */
.d__supabase polygon {
    transition:
        fill 180ms var(--ease-out),
        stroke 180ms var(--ease-out);
}

.d__supabase[data-lit="true"] polygon {
    stroke: #0084F8;
}

.d__supabase[data-lit="true"] .iso__top {
    fill: #E5F3FE;
}

/* Parker's size for the engine's subtitle (from the archived site styles) */
.ui-meta.d__sub {
    font-size: 0.6875rem;
}

/* while Supabase takes in data (the migration, then AWS), its edges and top breathe toward the lit colors */
.d__supabase[data-pulse="true"] polygon {
    animation: d-pulse-stroke 2.4s var(--ease-out) infinite alternate;
}

.d__supabase[data-pulse="true"] .iso__top {
    animation:
        d-pulse-stroke 2.4s var(--ease-out) infinite alternate,
        d-pulse-fill 2.4s var(--ease-out) infinite alternate;
}

@keyframes d-pulse-stroke {
    to {
        stroke: #0084F8;
    }
}

@keyframes d-pulse-fill {
    to {
        fill: #E5F3FE;
    }
}

@media (prefers-reduced-motion: reduce) {
    .d__supabase[data-pulse="true"] :is(polygon, .iso__top) {
        animation: none;
    }
}

.d__complete .ui-meta {
    color: #0084F8;
}

/* centered on its point; .iso__label's own transform comes later in this file */
.iso__label.d__center {
    transform: translate(-50%, -50%);
}

.d__fade {
    transition: opacity 180ms var(--ease-out);
}

.d__fade[data-on="false"] {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .d__airtable,
    .d__supabase,
    .d__fade {
        transition: none;
    }
}

/* a connection draws in from its source */
.diagram-link[data-built] {
    transform-origin: left center;
    transition: transform 800ms var(--ease-out);
}

.diagram-link[data-built="false"] {
    transform: scaleX(0);
}

/* a record lands once its connection exists */
.diagram-record {
    transition: opacity 180ms var(--ease-out);
}

.diagram-record[data-landed="false"] {
    opacity: 0;
}

/* ── MODE: THINKING — blueprint with notes ────────────────── */
/* 1rem grid and dashed outlines approved; Parker asked for grid lines
   halfway between --dot and --surface-hover */

.stage--thinking,
.stage--grid {
    --grid-size: 1rem;
    --grid-line: color-mix(in srgb, var(--dot), var(--surface-hover));
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
}

/* the case study swaps every line grid for a dot grid on the same 1rem spacing (Parker);
   the engine library keeps the lines. Dots are the link underline's dot, a touch smaller
   (Parker; DRAFT 0.9px, soft to 1.2px), in a color a quarter of the way from --dot to --dot-hover */
.grid--dots :is(.stage--thinking, .stage--grid, .zoom__frame, .zoom__film, .m09__frame) {
    background-image: radial-gradient(circle at center, color-mix(in srgb, var(--dot) 75%, var(--dot-hover)) 0.9px, transparent 1.2px);
}

.blueprint {
    position: relative;
    border: 1px dashed var(--label-3);
    border-radius: 0.9rem;
}

.blueprint .ui-row {
    border-top-style: dashed;
    border-top-color: var(--label-3);
}

.blueprint .ui-avatar {
    background: none;
    border: 1px dashed var(--label-3);
}

.blueprint-note {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blueprint-note__line {
    width: 2rem;
    height: 1px;
    background: var(--label-3);
}

.blueprint-note__card {
    background: var(--bg);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px var(--shadow);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

/* M04: the base as a blueprint, each limit with its note to the right */
.limits {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10rem;
    align-items: center;
    gap: 1.25rem 0;
}

.limits__note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.limits__note .blueprint-note__card {
    white-space: normal;
}

.sheet__row--limits {
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
}

.blueprint .sheet__row > :not(:first-child) {
    border-left: 1px dashed var(--label-3);
}

/* the customer's buildings hang off a spine under the row number */
.limits__tree {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-left: 1.25rem;
    border-left: 1px dashed var(--label-3);
}

.limits__branch,
.limits__chain,
.limits__step {
    display: flex;
    align-items: center;
}

.limits__stub {
    flex: 0 0 1rem;
    min-width: 1rem;
}

/* steps never squeeze their connectors; a step that doesn't fit wraps instead */
.limits__step {
    flex: none;
}

.limits__step .limits__stub {
    flex-basis: 2rem;
    min-width: 2rem;
}


.limits__parts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: 0.75rem;
}

.limits .diagram-node {
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: none;
    border: 1px dashed var(--label-3);
}

/* option B: boxes take the stage grey so the grid doesn't run through them */
.limits--filled .blueprint,
.limits--filled .diagram-node {
    background: var(--surface);
}

.limits .ui-chip:not([data-tone]) {
    background: none;
    border: 1px dashed var(--label-3);
}

.limits__chain {
    flex-wrap: wrap;
    row-gap: 0.75rem;
}

/* M04 option C: one customer zoomed into a gridded frame. The grid
   lives only inside the frame; captions hang off thin pointer lines. */
.stage--thinking.zoom {
    background-image: none;
}

.zoom__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: start;
    gap: 0 2rem;
}

.sheet__row--zoom {
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 1.2fr);
}

.zoom__row {
    position: relative;
}

/* dot on the selected row, line across the gap to the frame */
.sheet__row > .zoom__link {
    position: absolute;
    left: 100%;
    top: 50%;
    width: 2rem;
    padding: 0;
    border: none;
    overflow: visible;
}

.zoom__link::before {
    content: "";
    position: absolute;
    left: -0.25rem;
    top: -0.25rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--label-3);
}

.zoom__left {
    align-self: center;
}

.zoom__label {
    position: relative;
    width: fit-content;
    margin: 0 0 1.25rem;
}

.zoom__label::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 1px;
    height: 1.25rem;
    background: var(--label-3);
}

/* Parker's blue for the three limitation notes */
.zoom :is(.zoom__label, .zoom__caption) {
    color: #0084F8;
}

.zoom__frame,
.zoom__film {
    border: 1px dashed var(--label-3);
    border-radius: 0.9rem;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
}

.zoom__frame {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 14rem;
    overflow: hidden;
    padding: 1rem;
}

.zoom__card {
    flex: none;
}

/* white boxes share the diagram node's corner radius (Parker) */
.zoom .ui-window {
    border-radius: 0.5rem;
}

/* compact strips so the newest card's pills run past the frame's edge */
.zoom__card .ui-window__bar {
    padding: 0.5rem 0.75rem;
}

.zoom__parts {
    gap: 0.25rem;
}

.zoom__parts .ui-chip {
    flex: none;
    white-space: nowrap;
}

.zoom__film {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.5rem;
}

.zoom__run {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--dot);
    border-radius: 0.5rem;
}

/* the failed run is the selected frame, in ink */
.zoom__run[data-failed="true"] {
    border-color: var(--label);
}

.zoom__run[data-failed="true"]::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 1px;
    height: 1.75rem;
    background: var(--label-3);
}

.zoom__caption {
    position: relative;
    margin: 1.25rem 0 0;
    text-align: center;
}

.zoom__left .zoom__caption::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 1px;
    height: 1.25rem;
    background: var(--label-3);
}

.zoom__caption--end {
    text-align: right;
}

/* M05: a simplified Admin. The whole window moves and scales across the
   stage with the site's 800ms reveal slide, running off the stage's edges
   where it needs to (Parker's call); skeleton bars stand in for everything else. */
.stage.m05 {
    overflow: hidden;
}

/* holds the window's place at its fitted size; --fit is set from script */
.admin__canvas {
    --fit: 1;
    position: relative;
    height: calc(28rem * var(--fit));
}

.ui-window.admin {
    position: absolute;
    top: 0;
    left: 0;
    width: 48rem;
    height: 28rem;
    overflow: hidden;
    transform-origin: 0 0;
    transform: scale(var(--fit));
    transition: transform 800ms var(--ease-out);
}

/* DRAFT views: the window slides down and right and grows 1.4x on the
   navigation, then slides left and grows 1.3x centered on the customer */
.ui-window.admin[data-view="list"] {
    transform: translate(calc(var(--fit) * 2rem), calc(var(--fit) * 1.25rem)) scale(calc(var(--fit) * 1.4));
}

.ui-window.admin[data-view="detail"] {
    transform: translate(calc(var(--fit) * -20.85rem), calc(var(--fit) * -1.5rem)) scale(calc(var(--fit) * 1.3));
}

.admin__panes {
    position: relative;
    display: grid;
    grid-template-columns: 9rem 12rem minmax(0, 1fr);
    grid-template-rows: 100%;
    height: 100%;
}

.admin__nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0.75rem;
}

.admin__bar {
    display: block;
}

.admin__menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.admin__nav-item,
.admin__item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background 120ms ease-out;
}

.admin__nav-item[data-selected="true"],
.admin__item[data-selected="true"] {
    background: var(--surface);
}

.ui-row.admin__profile {
    margin-top: auto;
    padding: 0.5rem 0.25rem 0;
}

.admin__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    overflow: hidden;
    border-left: 1px solid var(--dot);
}

.admin__list .ui-field {
    flex: none;
    margin-bottom: 0.5rem;
}

.admin__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* sits where the name will be: after the avatar, centered on the row */
.admin__item > .admin__ghost {
    inset: 0 0.75rem 0 3rem;
    justify-content: center;
}

.admin__stack {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin__stack > :is(.ui-text, .ui-meta) {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin__detail,
.admin__drawer {
    min-width: 0;
    border-left: 1px solid var(--dot);
}

.admin__detail {
    position: relative;
}

/* skeleton customer until one is picked, then the real one fades over it */
.admin__ghost {
    position: absolute;
    inset: 0;
}

.admin__head {
    border-bottom: 1px solid var(--dot);
}

.admin__section {
    margin: 0;
    padding: 0.75rem 1rem 0.25rem;
}

.admin__field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
}

/* the building drawer slides over the customer from the right */
.admin__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 58%;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 800ms var(--ease-out);
}

.admin__drawer[data-open="true"] {
    transform: none;
}

/* M05 option B: the real Admin's layout at M02's type sizes, never scaled.
   The window is wider than the stage and runs off its right and bottom
   edges; it slides once, by exactly its overflow, to bring the customer in. */
.product__canvas {
    container-type: inline-size;
    position: relative;
    height: 26rem;
}

.ui-window.product {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    grid-template-columns: 12rem 14rem 36rem;
    grid-template-rows: 100%;
    width: 62rem;
    height: 38rem;
    overflow: hidden;
    transition: transform 800ms var(--ease-out);
}

.ui-window.product[data-view="detail"] {
    transform: translateX(calc(100cqw - 62rem));
}

.product__bar {
    display: block;
}

.product__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 2.75rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--dot);
}

/* the sidebar sits a step darker than the window, like a desktop app */
.product__nav {
    display: flex;
    flex-direction: column;
    padding: 0 0.75rem 0.75rem;
    background: var(--surface);
    border-right: 1px solid var(--dot);
}

/* window controls fill a row exactly as tall as the column headers */
.product__controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
    height: 2.75rem;
    padding: 0 0.25rem;
}

/* Parker's pick: the standard macOS close, minimize, and zoom colors */
.product__control {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.product__control[data-control="close"] {
    background: #FF5F57;
}

.product__control[data-control="minimize"] {
    background: #FEBC2E;
}

.product__control[data-control="zoom"] {
    background: #28C840;
}

.product__nav-item,
.product__item {
    transition: background 120ms ease-out;
}

/* the sidebar keeps 2.25rem rows; list, detail, and drawer rows get 2px more */
.product__nav-item {
    display: flex;
    align-items: center;
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
}

/* on the grey sidebar the picked item goes a shade darker */
.product__nav-item[data-selected="true"] {
    background: var(--dot);
}

.product__item[data-selected="true"] {
    background: var(--surface);
}

.product__list {
    min-width: 0;
    border-right: 1px solid var(--dot);
}

/* one line per customer, the same height as a detail row */
.product__item {
    position: relative;
    display: flex;
    align-items: center;
    height: calc(2.25rem + 2px);
    padding: 0 1rem;
}

.product__line {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.product__line > .ui-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product__item > .product__ghost {
    inset: 0 1rem;
}

.product__detail {
    position: relative;
    min-width: 0;
}

/* skeletons sit under the real content until it lands */
.product__ghost {
    position: absolute;
    inset: 0;
}

/* rows are the sidebar's 2.25rem plus Parker's 2px; the gap under a section
   rule is his 1rem, so detail rows sit off the list's rows on purpose */
.product__section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 3.25rem;
    padding: 1.25rem 1rem 0;
    border-bottom: 1px solid var(--dot);
}

.product__rows {
    padding-top: 1rem;
}

.product__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: calc(2.25rem + 2px);
    padding: 0 1rem;
}

.product__values {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
/* before Customers is picked, the list and detail read as one empty area */
.product__empty {
    position: absolute;
    inset: 0 0 0 12rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: calc(2.75rem + 1rem) 1rem 0;
    background: var(--bg);
    pointer-events: none;
}

.product__block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* the window dims behind the drawer, in the window's own shadow color */
.product__scrim {
    position: absolute;
    inset: 0;
    background: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms var(--ease-out);
}

.product__scrim[data-open="true"] {
    opacity: 1;
}

.product__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    background: var(--bg);
    border-left: 1px solid var(--dot);
    transform: translateX(100%);
    transition: transform 800ms var(--ease-out);
}

.product__drawer[data-open="true"] {
    transform: none;
}

/* M07 and M08: M05's drawer and customer record with working tabs. Each tab's view sits
   in the space under the header, and they cross-fade like the records. */
.m07__pane {
    position: absolute;
    top: 2.75rem;
    left: 0;
    right: 0;
    transition: opacity 180ms var(--ease-out);
}

.m07__pane[data-active="false"] {
    opacity: 0;
    visibility: hidden;
}

/* a section's aside, centered between the line above the section and the line under it;
   pulling it up by the section's top padding moves its center by half that */
.m07__aside {
    margin-top: -1.25rem;
}

/* a pill with an icon; the icon is sized to the text so the pill
   stays as tall as every other pill */
.ui-chip.m07__icon-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.m07__icon-pill .kit__icon {
    width: 1em;
    height: 1em;
}

/* M01's blue with light text */
.ui-chip.m07__blue {
    background: #0084F8;
    color: var(--bg);
}

/* "New Meter Data" and "Synced with ESPM" share one spot and cross-fade */
.m07__swap {
    display: grid;
    justify-items: end;
}

.m07__swap > * {
    grid-area: 1 / 1;
}

/* the 2027 pill sits in its menu's anchor; as a flex item it sizes like the 2026 pill */
.product__values > .kit__menu-anchor {
    display: flex;
}

/* new readings carry M03's light blue until they're synced, then clear slowly */
.product__row.m07__reading {
    transition:
        opacity 180ms var(--ease-out),
        background-color 800ms var(--ease-out);
}

.product__row.m07__reading[data-highlight="true"] {
    background-color: #E5F3FE;
    transition-duration: 180ms;
}

.m07__new {
    color: #0084F8;
}

@media (prefers-reduced-motion: reduce) {
    .m07__pane,
    .product__row.m07__reading {
        transition: none;
    }
}

/* M08: each subscription is an outlined card on the record, holding G00's toggles */
.m08__cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem;
}

.m08__card {
    border: 1px solid var(--dot);
    border-radius: 0.5rem;
}

/* new history lines open down from the top with the reveal slide, in M03's light blue,
   which clears slowly */
.m08__entry {
    height: calc(2.25rem + 2px);
    overflow: hidden;
    transition:
        height 800ms var(--ease-out),
        opacity 180ms var(--ease-out),
        background-color 800ms var(--ease-out);
}

.m08__entry[data-landed="false"] {
    height: 0;
    opacity: 0;
}

.m08__entry[data-highlight="true"] {
    background-color: #E5F3FE;
}

@media (prefers-reduced-motion: reduce) {
    .m08__entry {
        transition: none;
    }
}

/* M09: the Intelligence tab inside M04's dashed, gridded frame (real UI zoomed into
   as a process), with the run's five steps underneath. Everything the engine reads
   or writes is a skeleton bar. */
.m09__layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.m09__frame {
    --grid-size: 1rem;
    --grid-line: color-mix(in srgb, var(--dot), var(--surface-hover));
    padding: 1.25rem;
    border: 1px dashed var(--label-3);
    border-radius: 0.9rem;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
}

.ui-window.m09__window {
    border-radius: 0.5rem;
}

.m09__head {
    justify-content: space-between;
}

.m09__count {
    color: var(--label-3);
}

.m09__body {
    position: relative;
    height: 15rem;
    overflow: hidden;
}

.m09__pane {
    position: absolute;
    inset: 0;
    padding: 1rem;
    transition: opacity 180ms var(--ease-out);
}

.m09__pane[data-active="false"] {
    opacity: 0;
    visibility: hidden;
}

.m09__stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.m09__card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--dot);
    border-radius: 0.5rem;
    animation: m09-in 180ms var(--ease-out);
}

.m09__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.m09__name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* a tool call's arguments and result, as a dark code block in light text */
.ui-meta.m09__code {
    margin: 0;
    padding: 0.75rem;
    overflow: hidden;
    white-space: pre;
    color: var(--bg);
    background: var(--label);
    border-radius: 0.5rem;
}

.m09__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.m09__chip-bar {
    background: currentColor;
    opacity: 0.2;
}

.m09__in {
    animation: m09-in 180ms var(--ease-out);
}

@keyframes m09-in {
    from {
        opacity: 0;
    }
}

/* the five steps: hollow dots on a line, the current one filled in Parker's blue */
.m09__process {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.m09__process::before {
    content: "";
    position: absolute;
    top: 0.375rem;
    left: 10%;
    right: 10%;
    height: 1px;
    background: var(--label-3);
}

.m09__step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.m09__dot {
    width: 0.75rem;
    height: 0.75rem;
    border: 1px solid var(--label-3);
    border-radius: 50%;
    background: var(--surface);
    transition:
        background 180ms var(--ease-out),
        border-color 180ms var(--ease-out);
}

.m09__step[data-current="true"] .m09__dot {
    background: #0084F8;
    border-color: #0084F8;
}

.m09__step[data-current="true"] .ui-meta {
    color: var(--label);
}

@media (prefers-reduced-motion: reduce) {
    .m09__pane,
    .m09__dot {
        transition: none;
    }

    .m09__card,
    .m09__in {
        animation: none;
    }
}

/* ── MODE: FINAL OUTPUT — simple, not exact, UI ───────────── */

.final-kit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.final-segmented {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg);
    border-radius: 999px;
    box-shadow: 0 1px 3px var(--shadow);
}

.final-segmented span {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.final-segmented [data-active="true"] {
    background: var(--surface);
}

.final-switch {
    position: relative;
    width: 3.5rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--label);
}

.final-switch::after {
    content: "";
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: 0 1px 3px var(--shadow);
}

.final-card {
    background: var(--bg);
    border-radius: 0.9rem;
    box-shadow: 0 1px 3px var(--shadow);
    padding: 1rem 1.25rem;
}

/* ── G00: component reel on the blueprint grid ───────────── */
/* chart card on the left, a stack of small component cards on the right */

.kit__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1rem;
}

/* option B's second box mirrors the first: small cards left, the large card right */
.kit__grid--flip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
}

/* the large card: panes that cross-fade like M09's; it clips its
   highlighted rows to its rounded corners */
.ui-window.kit__table {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kit__panes {
    position: relative;
    flex: 1;
}

/* the readings run edge to edge, a little below the card's top (Parker) */
.m09__pane.kit__flush {
    padding: calc(0.25rem + 2px) 0 0;
}

/* the gap above the first reading carries the rows' highlight and clears with them */
.m09__pane.kit__flush::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(0.25rem + 2px);
    transition: background-color 800ms var(--ease-out);
}

.m09__pane.kit__flush[data-highlight="true"]::before {
    background-color: #E5F3FE;
    transition-duration: 180ms;
}

/* option B's savings chart, from the customer dashboard: Parker's background and bar
   colors; G00's Year bars; the site's H1 medium style for the total */
.m09__pane.kit__savings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #F2F9FF;
}

.kit__savings-head {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kit__savings-head > * {
    margin: 0;
}

.kit__savings-head .medium,
.kit__savings-head .ui-text {
    color: #0084F8;
}

/* Parker: the note sits 2px closer to the total */
.kit__savings-head .ui-text {
    margin-top: -2px;
}

.kit__savings-bars,
.kit__savings-axis {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.5rem;
}

.kit__savings-bars {
    flex: 1;
    align-items: end;
}

.kit__savings-bars .kit__bar {
    border-radius: 0.5rem 0.5rem 0 0;
}

.kit__bar[data-level="past"] {
    background: #A6D4FD;
}

.kit__bar[data-level="current"] {
    background: #0084F8;
}

.kit__bar[data-level="future"] {
    background: #E5F3FE;
}

.kit__savings-axis {
    text-align: center;
    text-transform: uppercase;
}

/* option B's two boxes, apart by the case study's block gap */
.kit__pair {
    display: grid;
    gap: 2rem;
}

.kit__stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kit__card {
    padding: 0.75rem 1rem;
}

.kit__row,
.kit__head,
.kit__notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kit__row,
.kit__head {
    justify-content: space-between;
}

.kit__row {
    min-height: 2.75rem;
}

/* on narrow cards the tabs drop under the title instead of squeezing it */
.kit__head {
    flex-wrap: wrap;
}

.kit__heading {
    white-space: nowrap;
}

.kit .sheet__tab {
    transition:
        background 120ms ease-out,
        color 120ms ease-out;
}

.kit__chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* one view per range, stacked; the active one fades in and its bars grow
   from the baseline with the 800ms reveal slide */
.kit__plot {
    position: relative;
    flex: 1;
    min-height: 8rem;
}

.kit__view {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 180ms var(--ease-out);
}

.kit__view[data-active="true"] {
    opacity: 1;
}

/* option B's empty states: the top chart holds the Utilities pill until the gas line loads;
   the bottom card holds the New Utility Data pill until the report runs */
.kit__pending {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity 180ms var(--ease-out);
}

.kit__pending[data-shown="true"] {
    opacity: 1;
}

/* the day line draws left to right with the 800ms reveal slide */
.kit__area {
    overflow: visible;
    clip-path: inset(-0.25rem 100% -0.25rem 0);
    transition:
        opacity 180ms var(--ease-out),
        clip-path 800ms var(--ease-out);
}

.kit__area[data-drawn="true"] {
    clip-path: inset(-0.25rem 0 -0.25rem 0);
}

/* Parker's green, fading down to the card's white */
.kit__fade-top {
    stop-color: #0FC46D;
    stop-opacity: 0.25;
}

.kit__fade-bottom {
    stop-color: #0FC46D;
    stop-opacity: 0;
}

.kit__area-line {
    fill: none;
    stroke: #0FC46D;
    stroke-width: 2px;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.kit__bars {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
}

.kit__bars--year {
    gap: 0.5rem;
}

.kit__bars--year .kit__bar {
    border-radius: 0.5rem 0.5rem 0 0;
}

/* flat bottoms on the baseline, rounded tops */
.kit__bar {
    flex: 1;
    border-radius: 999px 999px 0 0;
    transition: height 800ms var(--ease-out);
}

/* Parker's chart colors: normal, elevated, high */
.kit__bar[data-level="normal"] {
    background: #0FC46D;
}

.kit__bar[data-level="elevated"] {
    background: #FFD60A;
}

.kit__bar[data-level="high"] {
    background: #E83437;
}

.kit__axis {
    display: flex;
    justify-content: space-between;
}

/* the notice takes M02's green and red pill colors */
.kit__notice {
    min-height: 2.75rem;
    transition: background 180ms var(--ease-out);
}

.kit__notice .ui-text {
    color: inherit;
}

.kit__notice[data-tone="green"] {
    background: #CFF3E2;
    color: #086237;
}

.kit__notice[data-tone="red"] {
    background: #FAD6D7;
    color: #972224;
}

/* option B's savings card: quiet while it waits */
.kit__notice[data-tone="pending"] {
    color: var(--label-2);
}

/* option B's leak: Parker's chart red, solid, with light text */
.kit__notice[data-tone="alert"] {
    background: #E83437;
    color: var(--bg);
}

/* the phone slides in at the row's far right with the 800ms reveal slide, then buzzes on
   the dot's 2.4s cycle (DRAFT: the 1rem slide, the 12deg buzz, and its first fifth of the cycle) */
.kit__phone {
    margin-left: auto;
    animation:
        kit-phone-in 800ms var(--ease-out),
        kit-buzz 2.4s 800ms infinite;
}

@keyframes kit-phone-in {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }
}

@keyframes kit-buzz {
    0%, 20%, 100% { transform: rotate(0); }
    4%, 12% { transform: rotate(-12deg); }
    8%, 16% { transform: rotate(12deg); }
}

/* option B's savings found: M03's light blue with the blue text (Parker) */
.kit__notice[data-tone="blue"] {
    background: #E5F3FE;
    color: #0084F8;
}

/* option B's and M07's readings share one set of columns, so New (then Synced) lines up like
   a table column; Parker's 12px between it and the usage */
.m09__pane.kit__flush,
.m07__table {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-content: start;
    column-gap: 0.75rem;
}

:is(.kit__flush, .m07__table) > .product__row {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
}

.kit__usage {
    justify-self: end;
}

.kit__dot {
    position: relative;
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

/* a radar ping: grows out of the dot, fades away, rests, then pings again.
   Its 2.4s cycle is the archive chip's pulse */
.kit__dot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
    animation: kit-ping 2.4s var(--ease-out) infinite;
}

@keyframes kit-ping {
    0% { opacity: 0.4; transform: scale(1); }
    70%, 100% { opacity: 0; transform: scale(2.5); }
}

/* the utility pill's icon, drawn in its pill's text color */
.kit__status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.kit__icon {
    flex: none;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kit__icon[data-status="Pending"] { color: #74461A; }
.kit__icon[data-status="Syncing"] { color: #806B05; }
.kit__icon[data-status="Connected"] { color: #00427C; }

/* Parker asked for half the first spin speed; the check draws in 800ms like the chart line */
.kit__spin {
    transform-origin: 12px 12px;
    animation: kit-spin 2.4s linear infinite;
}

@keyframes kit-spin {
    to { transform: rotate(360deg); }
}

.kit__check {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: kit-check 800ms var(--ease-out) forwards;
}

@keyframes kit-check {
    to { stroke-dashoffset: 0; }
}

/* the home page's theme toggle, value for value, but on in Parker's #0084F8 */
.kit__switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: none;
    width: 3.5rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--surface);
}

.kit__switch::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #0084F8;
    opacity: 0;
    transition: opacity 200ms ease-out;
}

.kit__switch::after {
    content: "";
    position: relative;
    z-index: 1;
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.25rem;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: 0 1px 3px var(--shadow);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kit__switch[data-on="true"]::before {
    opacity: 1;
}

.kit__switch[data-on="true"]::after {
    transform: translateX(1.5rem);
}

/* M02's status menu, anchored under the pill */
.kit__menu-anchor {
    position: relative;
}

.kit__menu-anchor .sheet__menu {
    top: calc(100% + 0.25rem);
    left: auto;
    right: -0.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .kit .sheet__tab,
    .kit__view,
    .kit__bar,
    .kit__notice,
    .kit__switch::before,
    .kit__switch::after {
        transition: none;
    }

    .kit__dot::before,
    .kit__spin,
    .kit__phone {
        animation: none;
    }

    .kit__check {
        animation: none;
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stage__cursor,
    .stage__cursor-dot,
    .ui-row,
    .ui-row.sheet__row[data-highlight],
    .iso__slab polygon,
    .iso__wire,
    .iso__flow,
    .iso__air,
    .iso__plate,
    .iso__label--air,
    .iso__migrate,
    .iso__label--migrate,
    .sheet__fill,
    .sheet__row .sheet__think,
    .sheet__menu,
    .diagram-link,
    .diagram-record,
    .ui-window.admin,
    .admin__drawer,
    .admin__nav-item,
    .admin__item,
    .ui-window.product,
    .product__drawer,
    .product__scrim,
    .product__nav-item,
    .product__item {
        transition: none;
    }
}
