        /* ---- interactive design document (the SD view) --------------------
           The same document the PNG renderer draws, as real DOM: the section
           containers collapse, and the architecture diagram's flow badges
           toggle. Built at the image's own 2000px geometry and scaled to the
           viewport, so nothing is re-proportioned — every px below comes from
           design.py through interactive_design.css_tokens().

           .saved-design is what scrolls and what the fixed top bar clears; .saved-design-doc is
           the scaled 2000px canvas. The host's height is set in JS, because a
           transform does not change layout size. */
        .saved-design {
            display: none;
            position: relative;
            overflow: hidden;
            /* Both paddings are rewritten by sdChrome() from the MEASURED top
               bar and stream window — the two viewers have different bar
               geometry and the stream is only sometimes on screen. These are
               the pre-measurement fallbacks: enough to clear a ~43px bar. */
            padding-top: calc(51px + env(safe-area-inset-top));
            padding-bottom: 0;
            /* The page fill lives HERE, not on .saved-design-doc: that element is
               `transform: scale()`d to fit the viewport, so a gradient on it
               would scale with the content and land differently on every
               screen. --canvas-grad is optional (a coding document ships one,
               a design document does not) and falls back to the flat base. */
            background: var(--canvas-grad, var(--canvas-bg, #0a0807));
        }
        .saved-design-doc {
            position: relative;
            box-sizing: border-box;
            width: var(--document-width, 2000px);
            transform-origin: top left;
            transform: scale(var(--fit, 1));
            /* Transparent so the host's fill shows through — see above. */
            background: transparent;
            /* No synthetic weights or slants: PIL never fakes them, and the
               server measured every wrap against the real face. */
            font-synthesis: none;
            text-rendering: geometricPrecision;
            -webkit-font-smoothing: antialiased;
        }
        /* Every text run is placed absolutely at the y the PNG renderer
           computed, with the line already wrapped server-side — `pre` so the
           browser cannot introduce a break of its own. line-height is the
           font's ascent+descent (NOT the +4 leading), which zeroes the
           half-leading and puts the baseline exactly where PIL's draw.text
           puts it. */
        .sdl {
            position: absolute;
            white-space: pre;
        }
        .sdl.w, .sdw { text-shadow: 1px 0 0 currentColor; }
        .sdbox { position: absolute; box-sizing: border-box; }
        .sddot { position: absolute; border-radius: 50%; }
        /* Goal and Guarantees keep their measured stacked geometry, but the
           outer problem-framing card is now their only visible container. */
        .sdguar, .sdgoal {
            position: absolute;
            box-sizing: border-box;
            background: none;
            border: 0;
        }
        .sdframinghead {
            display: flex;
            align-items: center;
            gap: calc(10 * var(--sd-bw, 1px));
        }
        .sdframinghead::after {
            content: "";
            flex: 1;
            height: calc(0.5 * var(--sd-bw, 1px));
            background: currentColor;
        }
        /* Pro/con row marker. A square, not the PNG's +/- glyph — this view
           deliberately diverges there. */
        .sdsq { position: absolute; border-radius: 1px; }
        /* Section container. Collapsing swaps its height for the header's and
           hides the body; nothing inside is re-laid-out. The border width is
           --sd-bw, set by fitDesign(): the doc is a scaled 2000px canvas, so a
           plain 1px border renders sub-pixel after the transform and vanishes
           on phone/iPad — the var compensates by the scale.
           Its surface, border color and radius deliberately match arceus's
           analysis `.card`, so every system-design section shares that one
           container grammar. */
        .sdcard {
            position: absolute;
            box-sizing: border-box;
            background: var(--surface-1);
            border: var(--sd-bw, 1px) solid var(--border-subtle);
            border-radius: var(--section-radius, 16px);
            overflow: hidden;
            /* `top` travels too: a tab switch inside SYSTEM ARCHITECTURE moves
               that card's height by ~550px, and without this the cards below
               teleport to their final y while it is still growing. (A collapse
               has always had the same seam at ~90px.) It cannot fire on first
               paint — cards are positioned inside a DocumentFragment, so there
               is no prior computed style to transition from. */
            transition: height 0.16s ease, top 0.16s ease;
        }
        /* No per-section surface overrides: goal, tradeoff, architecture and
           detail cards all use arceus's analysis-container surface above. */
        .sdcard.goalcard, .sdcard.archcard { background: var(--surface-1); }
        /* No text-shadow: this used to carry the browser twin of the PNG's 2px
           overdraw, which faked ~600 weight out of Poppins-Regular. The gold
           headers render in real Poppins-Bold now (design._load_sect_title_font
           + interactive_design's "sect" -> SolverTitle role), and a bold face
           under a smear reads as a blur. */
        .sdhead {
            position: absolute;
            left: var(--section-pad, 30px);
            color: var(--accent-gold);
            white-space: pre;
        }
        /* Problem framing and architecture headings share arceus's type. At the document's
           normal 0.5-ish fit, 33 document px is arceus's 17 CSS px; use its
           Poppins-Regular face, normal weight and tracking without changing
           the server-owned header geometry. */
        .sdhead.arceushead {
            font-family: "SolverSect", system-ui, sans-serif;
            font-weight: 400;
            letter-spacing: 0.08em;
        }
        .sd-flow-select-hint { position:absolute; right:30px; z-index:2; display:flex;
            align-items:center; gap:10px; color:#888; cursor:default;
            font:400 22px/1.2 "SolverSans",sans-serif; }
        .sd-flow-select-hint .sd-key-chord { display:inline-flex; gap:5px; }
        .sd-flow-select-hint kbd { padding:3px 6px; border:2px solid #363636;
            border-radius:5px; background:#202020; color:#a8a8a8;
            font:400 20px/1 "SolverSans",sans-serif; }
        .sdscenario { position:absolute; box-sizing:border-box; border-radius:12px;
            background:#141719; border:var(--sd-bw,1px) solid #30363a; }
        .sdscenario-rule { position:absolute; height:0; border-top:var(--sd-bw,1px) solid #30363a; }
        .sdscenario.sdrelprose { background:#101214; border-color:#292e32; }
        /* The problem-framing card has no header row in the image; it gets one
           only while collapsed, so there is something to read and hit. */
        .sdcard.goalcard .sdhead { display: none; }
        .sdcard.goalcard.closed .sdhead { display: block; }
        .sdcard.closed .sdbody { display: none; }
        .sdbody { position: absolute; left: 0; top: 0; right: 0; }
        /* Invisible whole-header hit band: clicking anywhere in a card's top
           portion toggles it, like the DOC view's .gsechead. Sized to the
           card's head_h by JS; header controls at z-index 2 win on top. */
        .sdhit {
            position: absolute;
            z-index: 1;
            left: 0;
            top: 0;
            right: 0;
            cursor: pointer;
        }
        /* The SYSTEM ARCHITECTURE card's tab rail, in its BODY under the
           diagram — `.on` marks the open tab and sdCard swaps the panel below
           it. Absolute px like every other control: the doc is a scaled 2000px
           canvas, so vw units would be wrong here. Width and each pill's own
           width arrive inline from the JS packer; flex-wrap is the escape hatch
           for a label wider than the packer's estimate, because .sdcard clips
           (overflow:hidden) and a clipped tab is an unreachable tab. */
        .sdtabs {
            position: absolute;
            z-index: 2;
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            row-gap: 12px;
        }
        .sdtab {
            position: relative;
            box-sizing: border-box;
            height: 46px;
            padding: 0 21px;
            background: rgba(255, 255, 255, 0.05);
            border: none;
            border-radius: 9px;
            color: #9aa1ac;
            font: 19px "JetBrains Mono", "SolverMono", ui-monospace, monospace;
            line-height: 46px;
            letter-spacing: 0.04em;
            white-space: nowrap;
            /* A mis-estimated label clips inside its own pill rather than
               spilling over the neighbour. */
            overflow: hidden;
            text-align: center;
            cursor: pointer;
            touch-action: manipulation;
            transition: color 0.15s, background 0.15s;
        }
        /* Selection reads as the same surface, lifted: slightly brighter
           fill and brighter text — no accent color, no border. */
        .sdtab.on {
            color: #e0e4e8;
            background: rgba(255, 255, 255, 0.12);
        }
        @media (hover: hover) and (pointer: fine) {
            .sdtab:not(.on):hover {
                color: #d7dbde;
                background: rgba(255, 255, 255, 0.10);
            }
        }
        /* The open tab's content, hosted inside .sdbody. left/top:0 so sdItems
           can paint at the card's own coordinates with no offset arithmetic —
           .sdbody is itself left/top:0, and neither it nor .sdcard creates a
           stacking context.
           height:0 IS LOAD-BEARING. A transparent full-height overlay in that
           position hit-tests ABOVE the diagram, which kills every [data-node]
           hover (#sdtip) and every .sdbadge click. At height:0 the absolutely
           placed children still render and the panel's own hit box is a
           zero-area strip at the card's top edge. pointer-events:none is NOT
           the fix — it would also kill text selection in the panel. */
        .sdpanel {
            position: absolute;
            left: 0;
            top: 0;
            right: 0;
            height: 0;
        }
        /* Keep the top accent stronger than the matching fine side frame. */
        .sdopt {
            position: absolute;
            box-sizing: border-box;
            border: calc(0.5 * var(--sd-bw, 1px)) solid var(--opt-bar);
            border-radius: var(--card-radius, 14px);
            background:
                linear-gradient(to bottom, var(--opt-bar) 0,
                                var(--opt-bar) var(--opt-bar-h, 3px),
                                transparent var(--opt-bar-h, 3px)) padding-box,
                linear-gradient(var(--surface-option-top),
                                var(--surface-option-bot)) padding-box;
        }
        .sdopt.chosen {
            border-color: var(--opt-bar-chosen);
            background:
                linear-gradient(to bottom, var(--opt-bar-chosen) 0,
                                var(--opt-bar-chosen) var(--opt-bar-h, 3px),
                                transparent var(--opt-bar-h, 3px)) padding-box,
                linear-gradient(var(--surface-option-top),
                                var(--surface-option-bot)) padding-box;
        }
        .sdletter {
            position: absolute;
            border-radius: 50%;
            background: var(--letter-bg);
            /* Dimmed 5% (was #fff). Unthemed, so it must be kept in step with
               the PNG's own letter glyph at design.py's _draw option block —
               they are twins, and SD desyncs from its image if only one moves. */
            color: #f2f2f2;
            text-align: center;
        }
        .sdopt.chosen .sdletter { background: var(--letter-bg-chosen); }
        /* Borderless mode-badge treatment, retaining each verdict's palette. */
        .sdpill {
            position: absolute;
            box-sizing: border-box;
            background: var(--pill-bg);
            border: 0;
            border-radius: var(--pill-radius, 14px);
            color: var(--pill-fg);
            font-family: "SolverSans", system-ui, sans-serif;
            font-weight: 400;
            text-align: center;
        }
        .sdopt.chosen .sdpill {
            background: var(--pill-bg-chosen);
            color: var(--pill-fg-chosen);
        }
        /* arceus analysis coverage table, placed directly below the choice
           cards. Its rows remain explicit document-pixel geometry so adding
           the table does not introduce browser-dependent wrapping. */
        .sdcov {
            position: absolute;
            box-sizing: border-box;
        }
        .sdcovtitle {
            height: 40px;
            color: var(--accent-gold);
            font: 600 25px/40px "SolverMono", ui-monospace, monospace;
            letter-spacing: 0.07em;
            text-transform: uppercase;
        }
        .sdcovtable { margin-top: 14px; }
        .sdcovrow {
            box-sizing: border-box;
            display: grid;
            grid-template-columns: 38px 220px minmax(0, 1fr);
            align-items: start;
            border-bottom: var(--sd-bw, 1px) solid
                color-mix(in srgb, var(--border-subtle) 55%, transparent);
        }
        .sdcovrow.head {
            height: 50px;
            color: color-mix(in srgb, var(--text-goal) 78%, transparent);
            font: 600 23px/50px "SolverMono", ui-monospace, monospace;
            letter-spacing: 0.06em;
        }
        .sdcovcell {
            box-sizing: border-box;
            min-width: 0;
            padding: 14px 18px;
            color: var(--text-primary);
            font: 25px/34px "SolverSans", system-ui, sans-serif;
        }
        .sdcovrow.head .sdcovcell { padding-top: 0; padding-bottom: 0; }
        .sdcovstatus {
            padding-left: 6px;
            padding-right: 6px;
            color: var(--positive);
            font-family: "SolverMono", ui-monospace, monospace;
            font-weight: 700;
            text-align: center;
        }
        .sdcovcheck {
            display: block;
            box-sizing: border-box;
            width: 26px;
            height: 26px;
            margin-top: 4px;
            border: 2px solid currentColor;
            border-radius: 50%;
            font-size: 18px;
            line-height: 22px;
        }
        .sdcovkind {
            font-family: "SolverMono", ui-monospace, monospace;
        }
        /* Coverage has its own server-measured lines at this lane's width;
           row.h includes every line, without browser-dependent reflow. */
        .sdcovkind, .sdcovitem > div { white-space: pre; }
        .sdcovrow.keyed { grid-template-columns: var(--cov-key-w, 74px) minmax(0, 1fr); }
        .sdcovkey { text-align: center; font-family: "SolverMono", ui-monospace, monospace; }
        .sdcovkey .sdcovcheck { margin-left: auto; margin-right: auto; }
        .sdcovrequirement { color: color-mix(in srgb, var(--text-primary) 86%, white); }
        .sdcovmechanism { text-shadow: .85px 0 0 currentColor; }
        .sdkeybadge {
            box-sizing: border-box; display: inline-grid; place-items: center;
            width: 44px; height: 44px; border: 1.5px solid color-mix(in srgb, currentColor 65%, transparent);
            border-radius: 8px; background: color-mix(in srgb, currentColor 12%, transparent);
            font: 600 25px/1 "SolverSans", system-ui, sans-serif;
        }
        .sdcovgroup { overflow: hidden; border-radius: 8px; background: #ffffff02; }
        .sdcovgroup + .sdcovgroup { margin-top: 12px; }
        .sdcovgrouphead {
            box-sizing: border-box; height: 52px; padding: 0 18px;
            border-left: 5px solid currentColor; border-radius: 8px;
            background: color-mix(in srgb, currentColor 10%, transparent);
            font: 600 25px/52px "SolverSans", system-ui, sans-serif;
        }
        .sdcovgroup .sdcovrow { grid-template-columns: var(--cov-key-w, 80px) minmax(0, 1fr); }
        .sdcovgroup .sdcovrow:last-child { border-bottom: 0; }
        .sdcovgroup .sdcovrequirement { color: color-mix(in srgb, var(--text-primary) 78%, transparent); }
        .sdcovgroup .sdcovmechanism { color: var(--text-primary); }
        .sdrec {
            background: var(--rec-bg);
            border: 2px solid var(--rec-border);
            border-radius: var(--rec-radius, 14px);
        }
        .sdcode {
            background: var(--surface-code);
            border: 1px solid var(--border-code);
            border-radius: var(--code-radius, 11px);
        }
        /* DATA MODEL table sub-containers use arceus's lighter schema-card
           surface, separating each table from the outer analysis-card fill. */
        .sdcode.sdschema { background: var(--surface-code); }
        /* The APIS `[Component]` header, as its own diagram box. Only the
           border WIDTH and style live here — the border color, the gradient
           fill and the radius all ride on the payload (the node's accent ramp),
           because a hex in a .sd* rule body is what the no-hex scan forbids.
           border-box: the overlay is positioned at an explicit width/height. */
        .sdapibox {
            box-sizing: border-box;
            border: 2px solid transparent;
        }
        /* A CRITICAL FLOWS subsection header, styled as the flow badge it
           names — enlarged. Same 9px radius and 2px ring as .sdbadge; the ring
           COLOR is set from JS (the flow's own badge color, or --flowhead-bd
           when the head resolves no flow), never here, so the .sd* no-hex scan
           stays satisfied. border-box because the strip is absolutely
           positioned at an explicit width/height. */
        .sdflowhead {
            box-sizing: border-box;
            /* Its bottom edge overlaps the body by a few document pixels. Keep
               the complete flow-colored ring in front of that neutral box. */
            z-index: 2;
            background: var(--flowhead-bg);
            border: 2px solid transparent;
            border-radius: var(--flowhead-radius, 9px);
            cursor: pointer;
        }
        .sdflowlabel { z-index: 3; cursor: pointer; }
        /* Flow color belongs to the top bar. The detail body completes the
           shape with only a quiet neutral frame on the remaining sides. */
        .sdcode.sdflowbody {
            border-top: 0;
            border-right-width: var(--sd-bw, 1px);
            border-bottom-width: var(--sd-bw, 1px);
            border-left-width: var(--sd-bw, 1px);
            border-radius: 0 0 var(--code-radius, 11px)
                              var(--code-radius, 11px);
        }
        /* One CRITICAL FLOWS container — flowhead strip plus its fences —
           grouped so a flow badge can dim it as a unit. Static and zero-height
           (every child is absolutely positioned against .sdpanel), so it adds
           no geometry. Much lighter than the diagram's 0.14: this is prose that
           should stay legible while unselected, not a line to push into the
           background. */
        .sdflowgrp { transition: opacity 0.18s ease; }
        .sdflowgrp.dim { opacity: 0.42; }
        .sddiagcard {
            background: var(--surface-1);
            border: 1px solid var(--border-code);
            border-radius: var(--code-radius, 11px);
        }
        .sdbadgebox {
            position: absolute;
            border-radius: 4px;
            background: var(--schema-badge-bg);
            color: var(--schema-badge-fg);
            text-align: center;
        }
        /* The transport-verb badge left of an APIS method name (GET, POST,
           WSS, ...): the schema badge's colors on an inline pill. The verb
           text leaves the row, so the pill stands in for its measured width. */
        .sdmethod {
            display: inline-block;
            box-sizing: border-box;
            /* One width for every verb up to five letters (EVENT, PATCH), so
               the method names below one component line up in a column. */
            min-width: 3.9em;
            margin: 0 0.45em 0 0.3em;
            padding: 0 0.4em;
            border-radius: 5px;
            text-align: center;
            background: var(--schema-badge-bg);
            color: var(--schema-badge-fg);
            font-size: 0.72em;
            font-weight: 600;
            line-height: 1.5;
            letter-spacing: 0.02em;
            vertical-align: 0.1em;
        }
        /* Per-verb tints, named by the method segment's `tone`
           (design.API_METHOD_TONES): GET and any unmapped verb keep the mint
           above; POST blue, DEL red, WSS orange, EVENT and RPC violet. */
        .sdmethod-post  { background: var(--method-post-bg);  color: var(--method-post-fg); }
        .sdmethod-del   { background: var(--method-del-bg);   color: var(--method-del-fg); }
        .sdmethod-wss   { background: var(--method-wss-bg);   color: var(--method-wss-fg); }
        .sdmethod-event { background: var(--method-event-bg); color: var(--method-event-fg); }
        /* Additive, so the goal card's letter badges — which share
           .sdbadgebox and center on line-height — are untouched. Only the
           icon badges (the Notes pen) need to center an <svg>. */
        .sdbadgeicon {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .sdchip {
            padding: 0;
            border-radius: var(--chip-radius, 5px);
            background: var(--chip-bg);
            box-shadow: 0 0 0 1px var(--chip-border);
            color: var(--chip-fg);
        }
        /* A component named in the MAIN or RELIABILITY & SCALING tab, boxed
           like its APIS header: that node's border and gradient. The box
           reaches 9px past the name and the margin keeps 2px of air beyond
           it — the 22px the server wrap reserved per box
           (design._COMP_BADGE_EXTRA), measured at full size so the smaller
           name only frees room. The -2px vertical inset gives back the height
           0.9em takes off the span, so the box stays line-tall. A
           pseudo-element, so the line's baseline and height never move. */
        .sdcomp {
            position: relative;
            z-index: 0;
            margin: 0 11px;
            font-size: 0.9em;
        }
        .sdcomp::before {
            content: "";
            position: absolute;
            z-index: -1;
            inset: -2px -9px;
            border: 2px solid var(--comp-bd);
            border-radius: 8px;
            background: linear-gradient(180deg, var(--comp-top), var(--comp-bot));
        }
        /* ---- diagram + flow badges ---- */
        .sddiagram { position: absolute; }
        .sddiagram svg { display: block; }
        /* One predicate drives containers, nodes and edges alike: an element
           stays lit while any flow it belongs to is enabled, and all-enabled
           means everything is lit. */
        .archsvg [data-flows] { transition: opacity 0.18s ease; }
        .archsvg [data-flows].dim { opacity: 0.14; }
        .sdbadge {
            position: absolute;
            box-sizing: border-box;
            /* Above the whole-header .sdhit band (z-index 1), so a badge can
               never lose a tap to it. */
            z-index: 2;
            padding: 0;
            border-radius: 9px;
            border: 2px solid currentColor;
            font-family: "JetBrains Mono", "SolverMono", ui-monospace, monospace;
            line-height: 1;
            white-space: nowrap;
            cursor: pointer;
            /* The badges sit inside a scaled document; the tap target is
               enlarged with a transparent outset instead of by growing the
               badge, which would move it off the strip the PNG draws. */
            touch-action: manipulation;
            outline: 6px solid transparent;
            transition: opacity 0.18s ease, border-color 0.18s ease,
                background 0.15s;
        }
        /* Off dims the RING, not the label: the text holds just under the
           old hover brightness so the strip stays readable while unlit. */
        .sdbadge .sdlbl { transition: opacity 0.18s ease; }
        .sdbadge.off {
            border-color: color-mix(in srgb, currentColor 30%, transparent);
        }
        .sdbadge.off .sdlbl { opacity: 0.5; }
        .sdbadge:active { filter: brightness(1.35); }
        /* The all-flows pill leads the row in cream rather than a flow color,
           so it reads as a control over the badges and not as one of them.
           That is also why its CHECKED state sits dimmed: every flow being on
           is the default, and a fully lit pill there would read as the loudest
           thing in the strip while saying nothing. */
        .sdall { font-weight: 700; letter-spacing: 0.06em; }
        .sdall:not(.off) { opacity: 0.62; }
        /* Hover lifts any dimmed pill so it reads as reachable. Gated on a
           real pointer: iOS Safari leaves :hover stuck on the last tapped
           element, which would strand one badge brighter than the rest. */
        @media (hover: hover) and (pointer: fine) {
            .sdbadge.off:hover {
                border-color: color-mix(in srgb, currentColor 55%, transparent);
            }
            .sdbadge.off:hover .sdlbl { opacity: 0.65; }
            .sdall:not(.off):hover { opacity: 0.85; }
        }


.saved-design { display:block; width:100%; padding:0; margin-top:18px; position:relative; overflow:hidden; border-radius:14px; }
/* The measured document keeps its 44px page margin; the view crops all but a sliver of it
   by scaling and shifting the already-laid-out page (fitDesign), so nothing re-wraps. */
.saved-design .saved-design-doc { transform:translate(var(--crop-x, 0px), var(--crop-y, 0px)) scale(var(--fit, 1)); }
.saved-design-doc { position:relative; width:2000px; transform-origin:top left; font-synthesis:none; }
.saved-design svg { stroke:none; stroke-width:initial; fill:initial; vertical-align:initial; }
.saved-design .sddiagram > svg, .saved-design .sdbox > svg { width:100%; height:100%; max-width:none; max-height:none; }
.sd-saved-nav { position:absolute; right:0; top:0; height:46px; display:flex; align-items:center; gap:22px; }
.sd-saved-nav { color:#888; font:400 25px/1.2 'SolverSans',sans-serif; }
.sd-saved-nav > span { display:inline-flex; align-items:center; gap:10px; }
.sd-saved-nav .sd-key-chord { display:inline-flex; gap:5px; }
.sd-saved-nav kbd { display:inline-block; padding:3px 6px; border:2px solid #363636; border-radius:5px; background:#202020; color:#a8a8a8; font:400 24px/1 'SolverSans',sans-serif; }
.saved-design .sd-flow-number { position:absolute; left:-9px; top:-12px; display:grid; place-items:center; width:22px; height:22px; border:2px solid currentColor; border-radius:5px; background:#111613; font:500 16px/1 'SolverSans',sans-serif; }
.sv-detail.sv-design.sv-laptop { min-width:0; }
/* MAIN keeps its historical saved size; reliability now owns measured 25px roles. */
.saved-design .sdpanel[data-tab="MAIN"] .sdl { font-size:25px!important; font-weight:400; }
.saved-design .sdpanel[data-tab="MAIN"] .sdl span { text-shadow:none!important; }

#sddoc:has(> .craft-doc){width:100%;height:auto!important;transform:none!important}
#sdhost:has(> #sddoc > .craft-doc){height:auto!important;padding-top:0!important;padding-bottom:0!important}
.craft-doc{font:15px/1.55 var(--ds-sans,system-ui);color:var(--ds-ink,#e9e9ef);padding:20px 24px;max-width:1100px;margin:auto;box-sizing:border-box}
.craft-doc h1{font-size:22px;line-height:1.25;margin:0 0 8px}.craft-doc h2{font-size:16px;margin:20px 0 8px}
.craft-goal{opacity:.8;margin:0 0 18px}.craft-panel{border:1px solid #8884;border-radius:12px;overflow:hidden}
.craft-tabs{display:flex;flex-wrap:wrap;gap:8px;padding:10px;border-bottom:1px solid #8884}.craft-doc button{font:inherit;color:inherit;background:#8881;border:1px solid #8884;border-radius:7px;padding:5px 10px;cursor:pointer}
.craft-doc button[aria-selected=true]{background:#8883}.craft-doc button:focus-visible{outline:2px solid #a5b4fc;outline-offset:2px}
.craft-doc kbd{font:inherit;margin-left:8px;color:#969ba2}.craft-doc kbd b{color:inherit}.craft-content{padding:16px}
.craft-prompt{overflow-wrap:anywhere;font:15px/1.55 var(--ds-sans,system-ui);margin:12px 0 0;user-select:text}
.craft-prompt-line{white-space:pre-wrap;min-height:1.55em}.craft-prompt-list{display:grid;grid-template-columns:max-content minmax(0,1fr)}.craft-prompt-marker{white-space:pre}.craft-prompt-heading{display:block;font-weight:700;color:#f7c762}
.craft-doc .craft-review-heading{text-transform:uppercase;color:var(--craft-accent)}
.craft-doc .craft-fixes{--craft-accent:#d88989}.craft-doc .craft-improvements{--craft-accent:#d3ac66}.craft-doc .craft-ideas{--craft-accent:#80a9d2}
.craft-doc table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px;line-height:1.5}.craft-doc th,.craft-doc td{text-align:left;vertical-align:top;padding:12px;border-bottom:1px solid #8883;overflow-wrap:anywhere}.craft-doc th{font-weight:600;color:inherit;background:#8881}.craft-doc th:first-child{width:38%}.craft-doc blockquote{margin:6px 0 0;white-space:pre-wrap}.craft-doc .craft-evidence{font-size:13px;color:#c9cbd2;margin-top:6px}.craft-doc .craft-review-prompt{font-size:14px;margin-top:0}.craft-doc table[class^=craft-]{border-left:3px solid var(--craft-accent)}.craft-empty,.craft-preview{opacity:.65;font-size:12px}.craft-doc [hidden]{display:none!important}

.sv-detail { --sv-text:#e4e8e6; --sv-muted:#9aa29e; --sv-line:#2a2d2f; --sv-card:#141516; --sv-card-border:#24282b;
  --sv-accent:#6ee0ae; --sv-bug:#f08a8a; --sv-edge:#e6b566; color:var(--sv-text); font-size:14px; line-height:1.55; }
.sv-detail * { box-sizing:border-box; }
.sv-detail.sv-laptop { min-width:820px; }
.sv-detail.sv-craft { min-width:0; }
.sv-craft .craft-doc { padding:0; max-width:none; color:var(--sv-text); }
.sv-craft .craft-content { padding:20px; }
.sv-craft .craft-panel { background:#141516; border-color:var(--sv-line); }
@media (max-width:600px) {
  .sv-craft .craft-content { padding:12px; }
  .sv-craft .craft-doc th,.sv-craft .craft-doc td { padding:8px; }
}
.sv-scroll { overflow-x:auto; }
.sv-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.sv-head h1 { margin:8px 0 4px; color:var(--sv-text); font-size:24px; line-height:1.25; font-weight:650; letter-spacing:-.01em; }
.sv-meta { margin:0; color:var(--sv-muted); font-size:13px; }
.sv-badges { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.sv-badge { display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border:1px solid var(--sv-card-border); border-radius:999px; background:#1b1f1e; color:#c9d3ce; font-size:11px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; }
.sv-badge-session { color:#9fd8ff; border-color:#27435a; background:#14212b; }
.sv-badge-snapshot { color:#e6c78c; border-color:#4a3c22; background:#211b12; }
.sv-badge-question { color:#a8e8c9; border-color:#28493a; background:#132219; }
.sv-badge-company { padding:0; color:#b8bfbc; border-color:transparent; background:transparent; text-transform:none; letter-spacing:0; }
.sv-layout-toggle { flex:none; display:inline-flex; align-items:center; gap:7px; padding:7px 11px; border:1px solid var(--sv-card-border); border-radius:8px; background:#1b1f1e; color:var(--sv-text); font:inherit; font-size:12px; cursor:pointer; }
.sv-layout-toggle svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.sv-navigation { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.sv-navigation .ws-back, #desktop-solutions .sv-navigation .ds-solutions-back { margin:0; }
.sv-tabs { display:inline-flex; gap:4px; padding:4px; border:1px solid var(--sv-card-border); border-radius:9px; background:#101313; }
.sv-tabs button { padding:7px 20px; border:0; border-radius:6px; background:transparent; color:var(--sv-muted); font-family:inherit; font-size:13px; font-weight:600; line-height:1.5; cursor:pointer; }
.sv-tabs button[aria-selected="true"] { background:#2a3430; color:#e3eee7; box-shadow:0 1px 3px #0004; }
.sv-tabs button:disabled { opacity:.45; cursor:default; }
.sv-detail button:focus-visible { outline:2px solid var(--sv-accent); outline-offset:3px; }
.sv-detail [hidden] { display:none!important; }
.sv-section { margin-top:30px; }
.sv-label { display:flex; align-items:center; gap:12px; margin:0 0 22px; color:var(--sv-muted); font:600 11px/1.5 'JetBrains Mono',ui-monospace,monospace; letter-spacing:.14em; text-transform:uppercase; }
.sv-label::after { content:""; flex:1; height:1px; background:var(--sv-line); }
.sv-problem-part + .sv-problem-part { margin-top:30px; }
.sv-problem-card { padding:16px 18px; border:1px solid #2a2d2f; border-radius:10px; background:#181a1b;
  color:var(--sv-text); font:400 14px/1.7 'JetBrains Mono',ui-monospace,monospace; }
.sv-problem-card p { margin:0 0 12px; color:inherit; white-space:pre-wrap; overflow-wrap:anywhere; }
.sv-problem-card p:last-child { margin-bottom:0; }
.sv-summary { margin:0 0 16px; color:#bdc4c0; }
.sv-insight { margin:0 0 16px; font-size:15px; }
.sv-split { display:grid; grid-template-columns:48fr 52fr; gap:16px; align-items:start; }
.sv-mobile .sv-split, .sv-split.sv-single { grid-template-columns:minmax(0,1fr); }
.sv-why, .sv-steps { margin:0; padding:0; list-style:none; }
.sv-why { padding:6px 16px; border:1px solid var(--sv-card-border); border-radius:10px; background:var(--sv-card); }
.sv-why li { display:flex; gap:10px; padding:10px 0; }
.sv-why li + li { border-top:1px solid #ffffff09; }
.sv-why .sv-why-heading { align-items:center; gap:12px; padding:18px 0 6px; border:0; }
.sv-why-alternative { color:#c9b8ff; }
.sv-why-edge { color:#e6b566; }
.sv-why-bug { color:#bb668c; }
.sv-why-heading h3 { flex:none; margin:0; font:600 11px/1.5 'JetBrains Mono',ui-monospace,monospace; letter-spacing:.08em; text-transform:uppercase; }
.sv-why-heading::after { content:""; flex:1; height:1px; background:currentColor; opacity:.5; }
.sv-why .sv-why-heading + li { border-top:0; }
.sv-mark { flex:none; display:inline-flex; width:17px; height:17px; margin-top:3px; color:#5f9e74; }
.sv-mark svg { width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.sv-mark-bug { color:#bb668c; }
.sv-mark-edge { color:#e6b566; }
.sv-mark-alternative { color:#c9b8ff; }
.sv-steps { display:grid; gap:10px; counter-reset:sv-step; }
.sv-steps > li { padding:12px 16px; border:1px solid var(--sv-card-border); border-radius:10px; background:var(--sv-card); }
.sv-step-label { display:flex; align-items:center; gap:10px; margin-bottom:6px; color:#c7e9a6; font-weight:600; }
.sv-num { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:6px; background:#22332c; color:var(--sv-accent); font-size:12px; font-weight:700; }
.sv-row { margin:4px 0 0 32px; font:13px/1.55 'JetBrains Mono',ui-monospace,monospace; color:#d6dbd8; }
.sv-row.sv-bullet::before { content:"• "; color:var(--sv-accent); }
.sv-chip { padding:1px 5px; border-radius:5px; background:#212121; color:#de8481; box-shadow:0 0 0 1px #373737; box-decoration-break:clone; -webkit-box-decoration-break:clone; font-family:'JetBrains Mono',ui-monospace,monospace; font-size:.92em; }
.sv-files { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px; }
.sv-files button { display:inline-flex; align-items:center; gap:7px; padding:6px 11px; border:1px solid #626969; border-radius:7px; background:transparent; color:var(--sv-muted); font:inherit; font-size:12px; cursor:pointer; }
.sv-file-count { flex:none; display:inline-grid; place-items:center; width:18px; height:18px; border:1px solid #e0e3e2; border-radius:50%; background:#e0e3e2; color:#303635; font-size:10px; font-weight:600; line-height:1; font-variant-numeric:tabular-nums; }
.sv-files button[aria-pressed="true"] { background:#22332c; color:var(--sv-accent); border-color:#2f4a3b; }
.sv-implementation { border:1px solid #252729; border-radius:10px; overflow:hidden; background:#121212; }
.sv-implementation > .sv-label { padding:12px 16px; margin:0; background:linear-gradient(180deg,#131415,#0f1011); border-bottom:1px solid #252729; color:#c9cfd8; font-family:inherit; font-size:14px; font-weight:650; line-height:1.5; letter-spacing:0; }
.sv-implementation > .sv-label::after { display:none; }
.sv-implementation .sv-files { margin:12px 16px; }
.sv-code { margin:0; padding:12px 0; overflow:auto; background:#121212; color:#bababf; font:500 13px/1.65 'SolverMono','JetBrains Mono',ui-monospace,monospace; tab-size:4; }
.sv-code > .sv-code-row { display:flex; min-width:max-content; white-space:pre; }
.sv-code-row::before { content:attr(data-n); flex:none; width:44px; margin-right:14px; padding-right:10px; text-align:right; color:#6e7781; border-right:1px solid #222726; user-select:none; }
.sv-new-file .sv-code-row::before { border-right:3px solid #5f9e74; padding-right:8px; }
.sv-code-source { display:block; position:relative; padding-right:16px; }
.sv-indent { position:absolute; top:0; bottom:0; width:1px; background:#2e3339; pointer-events:none; }
.sv-comment { display:inline-block; transform:skewX(-11.86deg); }
.sv-mobile .sv-code > .sv-code-row { min-width:0; }
.sv-mobile .sv-code-source { white-space:pre-wrap; overflow-wrap:anywhere; min-width:0; }
.sv-complexities { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.sv-complexities.sv-single { grid-template-columns:minmax(0,1fr); }
.sv-complexity { min-width:0; padding:16px; border:1px solid #252729; border-radius:10px; background:linear-gradient(180deg,#131415,#0f1011); }
.sv-complexity h2 { margin:0 0 12px; color:#c9cfd8; font-size:14px; text-transform:uppercase; }
.sv-runtime { margin:0; font-size:18px; color:#d3d6d4; overflow-wrap:anywhere; white-space:pre-wrap; }
.sv-complexity ul { margin:8px 0 0; padding-left:17px; color:var(--sv-muted); }
.sv-complexity li { overflow-wrap:anywhere; }
.sv-tests { display:grid; gap:24px; }
.sv-test { min-width:0; }
.sv-test + .sv-test { padding-top:24px; border-top:1px solid #343a3f; }
.sv-test h3 { display:flex; align-items:baseline; gap:10px; margin:0 0 14px; color:#d8dedb; font-size:16px; font-weight:600; }
.sv-test-number { flex:none; color:#9ba6ad; font-size:11px; font-weight:650; letter-spacing:.05em; }
.sv-test-code-label { margin:0 0 6px; color:#969da3; font-size:11px; font-weight:650; letter-spacing:.04em; text-transform:uppercase; }
.sv-test > .sv-code { padding:12px 14px; border:1px solid #282d31; border-radius:8px; background:#101215; }
.sv-test .sv-code-row::before { display:none; }
.sv-test-io { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:10px 0 0; }
.sv-test-cell { min-width:0; padding:12px 14px; border:1px solid #282d31; border-radius:8px; background:#101215; }
.sv-test-cell.sv-input { border-left:4px solid #92999e; }
.sv-test-cell.sv-expected { border-left:4px solid #4b7d33; }
.sv-test dt { margin:0 0 6px; color:#969da3; font-size:11px; font-weight:650; letter-spacing:.04em; text-transform:uppercase; }
.sv-test dd { margin:0; color:#d6dbd8; font:13px/1.6 'SolverMono','JetBrains Mono',ui-monospace,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.sv-tests-section > .sv-label { padding:12px 16px; margin:0 0 18px; border:1px solid #252729; border-radius:9px; background:linear-gradient(180deg,#131415,#0f1011); color:#c9cfd8; letter-spacing:0; font-family:inherit; font-size:14px; font-weight:650; line-height:1.5; }
.sv-tests-section > .sv-label::after { display:none; }
/* Saved answers use the live session's hierarchy inside the Mac shell. */
#desktop-solutions .sv-detail.sv-laptop { min-width:0; }
#desktop-solutions .sv-detail h1 { color:#d0d2d2; font:650 20px/1.3 var(--ds-sans); }
#desktop-solutions .sv-section { margin-top:18px; }
#desktop-solutions .sv-approach > .sv-label { display:none; }
#desktop-solutions .sv-split { border:1px solid #252729; border-radius:10px; padding:16px; background:linear-gradient(180deg,#131415,#0f1011); }
#desktop-solutions .sv-split > *, #desktop-solutions .sv-why > li > span:last-child, #desktop-solutions .sv-step-label > span:last-child { min-width:0; }
#desktop-solutions .sv-why > .sv-insight { display:block; }
#desktop-solutions .sv-why { border:0; border-radius:0; padding:0 16px 0 0; background:none; }
#desktop-solutions .sv-steps { border-left:1px solid #343a3f; padding-left:16px; }
#desktop-solutions .sv-laptop .sv-steps { align-self:stretch; }
#desktop-solutions .sv-laptop .sv-split:not(.sv-single) .sv-why-heading::after { margin-right:12px; }
#desktop-solutions .sv-steps > li { padding:0 0 12px; border:0; border-bottom:1px solid #343a3f; border-radius:0; background:none; }
#desktop-solutions .sv-steps > li:last-child { border-bottom:0; padding-bottom:0; }
#desktop-solutions .sv-step-label { color:#dfb774; font-size:12px; font-weight:500; letter-spacing:.07em; text-transform:uppercase; }
#desktop-solutions .sv-num { background:#dfb774; color:#29251d; border-radius:4px; min-width:18px; height:18px; padding:0 4px; }
#desktop-solutions .sv-chip { display:inline; white-space:normal; overflow-wrap:anywhere; background:#212121; color:#de8481; }
/* Override the shell's page-heading margin inside saved-answer cards. */
#desktop-solutions .sv-implementation > .sv-label { margin:0; font:650 14px/1.5 var(--ds-sans); letter-spacing:0; }
#desktop-solutions .sv-complexity { padding:0 16px 16px; overflow:hidden; }
#desktop-solutions .sv-complexity > h2 { margin:0 -16px 16px; padding:12px 16px; background:#181818; border-bottom:1px solid #252729; font:650 14px/1.5 var(--ds-sans); letter-spacing:0; }
#desktop-solutions .sv-tests-section { border:1px solid #252729; border-radius:10px; padding:0 16px 16px; }
#desktop-solutions .sv-tests-section > .sv-label { margin:0 -16px 16px; border:0; border-bottom:1px solid #252729; border-radius:9px 9px 0 0; }
.sv-plain p { margin:0 0 10px; white-space:pre-wrap; }
.sv-empty { color:var(--sv-muted); }
.sv-list { display:grid; gap:10px; }
.sv-item { display:flex; align-items:center; gap:14px; width:100%; padding:14px 16px; border:1px solid #24282b; border-radius:10px; background:#141516; color:#e4e8e6; text-align:left; text-decoration:none; font:inherit; cursor:pointer; }
.sv-item:hover { background:#191b1d; }
.sv-item-copy { flex:1; min-width:0; }
.sv-item-copy strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:600; }
.sv-item-copy small { display:block; margin-top:3px; color:#9aa29e; font-size:12px; }
.sv-item .sv-badges { flex:none; align-self:stretch; justify-content:space-between; min-height:42px; }
.sv-badge-dot { flex:none; width:3px; height:3px; border-radius:50%; background:currentColor; opacity:.75; }
.sv-version { color:#b8bfbc; font-size:12px; }
.sv-heading-copy { display:flex; align-items:center; gap:14px; min-width:0; }
.sv-type-icon { display:inline-flex; align-items:center; justify-content:center; flex:none; width:40px; height:40px; border-radius:10px; color:#a5d8c1; background:#203c30; }
.sv-type-icon.sv-type-design { color:#aac9ed; background:#233747; }
.sv-type-icon.sv-type-ai_craft { color:#f0c972; background:#332d1d; }
.sv-type-icon.sv-type-code_review { color:#e7a5b9; background:#3a2630; }
.sv-type-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
@media (max-width:600px) { .sv-item { flex-wrap:wrap; } .sv-item .sv-badges { margin-left:auto; } .sv-head { flex-wrap:wrap; } }
