/* Welcome (#start), Measure your wall (#measure) and Choose a starter (#starter).
   All three views carry .v-start. No WebGL here: the welcome shows a static exploded
   drawing of the Workshop kit with the parts list's balloons. One job per screen. */
.v-start{
  --xp-foot:#2B2E33; --xp-rod:#5A6069;
  & .wrap{max-width:1320px;margin:0 auto;padding:0 40px 56px}
  & h1:focus{outline:none}
  & .btn.big{min-height:48px;padding:0 20px;font-size:15.5px;gap:10px}
  & .u-lbl{font-weight:400;color:var(--muted)}
  & .boxline{margin:0;font-size:13px;color:var(--muted)}
  & .boxline .mono{color:var(--ink);font-size:13px}

  /* ---------- welcome: the kit, three steps, one action ---------- */
  & .hero{display:grid;grid-template-columns:minmax(0,440px) minmax(0,1fr);column-gap:64px;align-items:center;min-height:calc(100vh - var(--top-h) - 56px);padding:28px 0 0}
  & .hero h1{margin:0;font:700 50px/1.02 var(--display);letter-spacing:-.025em;max-width:12ch}
  & .lede{margin:16px 0 0;font-size:17px;line-height:1.5;color:var(--ink-2);max-width:40ch}
  /* the three steps hang on one leader, balloon to balloon */
  & .trail{list-style:none;margin:28px 0 0;padding:0;display:flex;flex-direction:column}
  & .trail li{position:relative;display:grid;grid-template-columns:40px 1fr;column-gap:14px;padding-bottom:14px}
  & .trail li:last-child{padding-bottom:0}
  & .trail li:not(:last-child)::before{content:"";position:absolute;left:19.25px;top:44px;bottom:2px;width:1.5px;background:var(--teal)}
  & .trail li > div{padding-top:1px}
  & .trail b{display:block;font:600 16px/1.25 var(--display)}
  & .trail span:not(.balloon){display:block;margin-top:2px;font-size:13.5px;color:var(--muted)}
  & .cta{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:30px}
  & .saved-slot:not(:empty){margin-top:18px}
  /* one quiet row: Resume saved plan · name · saved · total */
  & .resume{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;width:100%;min-height:48px;padding:8px 14px;border:1px solid var(--line);border-radius:6px;background:transparent;color:var(--ink-2);font-size:13.5px;text-align:left}
  & .resume:hover{border-color:var(--teal);background:var(--paper-2)}
  & .resume-k{font-weight:600;color:var(--teal-ink)}
  & .resume-v{flex:1;min-width:0;overflow-wrap:anywhere}
  & .resume-v b{font-weight:600;color:var(--ink)}
  & .resume-v .mono{font-size:13px;color:var(--ink)}
  & .resume svg{width:15px;height:15px;color:var(--teal-ink)}
  & .saved-note{margin:0;display:flex;gap:10px;align-items:flex-start;font-size:12.5px;line-height:1.45;color:var(--ink-2)}
  & .saved-note b{color:var(--ink);font-weight:600}
  & .saved-note svg{width:14px;height:14px;margin-top:2px;flex:none}
  & .saved-note .balloon{margin-top:-1px}
  & .hero-fig{margin:0;display:flex;flex-direction:column;gap:10px;min-width:0}
  & .hero-fig figcaption{padding:0 4px}

  /* the drawing sheet: the only rounded surface, like the studio stage */
  & .xp-wrap{border-radius:16px;border:1px solid var(--line);background:radial-gradient(120% 90% at 50% 0%,var(--paper-2),var(--studio) 72%);padding:18px 18px 8px;overflow:hidden}
  & .xp{display:block;width:100%;height:auto;aspect-ratio:3480/2930;max-height:calc(100vh - 250px);min-height:220px}
  & .xp .floor{stroke:var(--ink-2);stroke-width:5}
  & .xp .fp{fill:var(--xp-foot)}
  & .xp .fr{fill:var(--xp-rod)}
  & .xp .plane{fill:var(--ink);opacity:.045}
  & .xp .shadow{fill:var(--ink);opacity:.07}
  & .xp .part{transition:opacity .16s}
  & .xp.hl .part:not(.lit){opacity:.25}
  & .xp .bl line{stroke:var(--ink-2);stroke-width:5}
  & .xp .anch{fill:var(--ink)}
  & .xp .bl circle:not(.anch){fill:var(--paper-2);stroke:var(--teal);stroke-width:10}
  & .xp .bl.lit circle:not(.anch){fill:var(--glow)}
  & .xp .bl text{font:500 84px var(--mono);fill:var(--teal-ink);text-anchor:middle}
  & .xp .dim line{stroke:var(--ink-2);stroke-width:5}
  & .xp .dim text{font:500 66px var(--mono);fill:var(--ink-2)}
  & .xp.intro .part{animation:xp-explode .6s var(--settle) .35s both}
  & .xp.intro .bl,& .xp.intro .dim{animation:xp-fade .3s ease .85s both}

  /* ---------- measure + starter: a step page ---------- */
  & .step-wrap{max-width:1120px;padding-top:28px}
  & .step-head{display:flex;gap:14px;align-items:flex-start;margin:0 0 22px}
  & .step-head > .balloon{margin-top:2px}
  & .step-head h1{margin:0;font:700 34px/1.1 var(--display);letter-spacing:-.015em}
  & .step-head .nw{white-space:nowrap;font-family:var(--display);font-weight:700;font-variant-numeric:tabular-nums}
  & .tip{margin:8px 0 0;display:flex;gap:7px;align-items:flex-start;font-size:14px;color:var(--ink-2)}
  & .tip svg{width:15px;height:15px;margin-top:3px;color:var(--teal-ink);flex:none}
  & .tip b{font-weight:600;color:var(--ink)}
  & .step-head .lead{margin:8px 0 0;font-size:14.5px;color:var(--ink-2);max-width:86ch}
  & .step-head .lead .mono{font-size:13.5px}
  & .back{margin:0 0 10px -10px;gap:6px;color:var(--ink-2)}
  & #s-redirect:not(:empty){margin:-8px 0 16px}

  & .measure-grid{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:48px;align-items:start}
  & .measure{min-width:0}
  /* disclosures: hairline rows, the summary names what is inside */
  & .disc{margin-top:18px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
  & .disc + .disc{margin-top:0;border-top:0}
  & .disc > summary{display:flex;align-items:center;gap:6px 8px;flex-wrap:wrap;min-height:52px;padding:10px 32px 10px 0;cursor:pointer;list-style:none;position:relative;font-size:14.5px;font-weight:600;color:var(--ink)}
  & .disc > summary::-webkit-details-marker{display:none}
  & .disc > summary::after{content:"";position:absolute;right:8px;top:50%;width:8px;height:8px;border-right:1.5px solid var(--ink-2);border-bottom:1.5px solid var(--ink-2);transform:translateY(-70%) rotate(45deg);transition:transform .16s var(--settle)}
  & .disc[open] > summary::after{transform:translateY(-30%) rotate(-135deg)}
  & .disc > summary:hover .disc-t{text-decoration:underline;text-underline-offset:3px}
  & .disc-v{font-weight:400;color:var(--muted);font-size:13.5px}
  & .disc-v{font-family:var(--ui)}
  & #s-adv-v{font-family:var(--mono);font-size:13px}
  & .disc-body{padding:4px 0 18px}
  & .step-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:28px}

  & .errsum{margin:0 0 18px}
  & .errsum li{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr);gap:2px 10px}
  & .errsum li span{color:var(--ink)}
  & .eslot:empty{display:none}
  & .eslot .ferr{margin-top:2px}
  & .u-lbl{font-weight:400;color:var(--muted)}
  & .f-name{max-width:440px;margin-bottom:16px}
  & .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 16px}
  & .grid .f-runOffsetMm{grid-column:1 / -1;max-width:calc(50% - 8px)}
  & .field .hint{line-height:1.4}
  & .res-note{display:flex;gap:10px;align-items:flex-start;margin:16px 0 0;padding:10px 12px;border-left:3px solid var(--teal);background:var(--glow-2);font-size:13px;color:var(--ink-2);line-height:1.45}
  & .res-note b{color:var(--ink);font-weight:600}
  & .res-note .balloon{margin-top:1px}

  & .spans{border:0;margin:0;padding:0;min-width:0}
  & .spans > .note{margin-bottom:12px}
  & .span-row{display:grid;grid-template-columns:22px minmax(0,1.5fr) minmax(0,1fr) minmax(0,.8fr) auto;gap:10px;align-items:start;padding:10px 0;border-bottom:1px solid var(--line)}
  & .span-row:first-child{border-top:1px solid var(--line)}
  & .span-row > .balloon{margin-top:32px}
  & .span-row .rm{margin-top:23px;min-height:40px}
  & .span-row .rm svg{width:15px;height:15px}
  & .span-add{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px}
  & .span-add .btn svg{width:14px;height:14px}
  & #s-span-max{margin-top:10px}

  /* your wall, live: the dimension band */
  & .wallview{padding:16px 18px 18px;border:1px solid var(--line);border-radius:6px;background:var(--paper);position:sticky;top:calc(var(--top-h) + 20px)}
  & .avail{display:flex;flex-direction:column;gap:2px;margin-bottom:16px}
  & .avail .k{font-size:12.5px;color:var(--muted);font-weight:500}
  & .avail .big{font-size:34px;line-height:1.1;color:var(--teal-ink);font-weight:500}
  & .avail.is-stale .big{color:var(--muted)}
  & .avail .sum{font-size:12.5px;color:var(--muted);font-weight:400}
  & .avail .stale{display:flex;gap:6px;align-items:flex-start;margin-top:6px;font-size:12.5px;color:var(--ink-2)}
  & .avail .stale svg{width:14px;height:14px;margin-top:2px}
  & .strip{position:relative;padding:0 2px}
  & .strip .wall{position:relative;height:54px;background:var(--paper-2);border:1px solid var(--hair);border-bottom:2px solid var(--ink-2);overflow:hidden}
  & .strip i{position:absolute;top:0;bottom:0;display:block}
  & .strip .res{background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--muted) 45%,transparent) 0 1.5px,transparent 1.5px 6px)}
  & .strip .off{background:var(--glow-2);border-right:1px dashed var(--teal)}
  & .strip .sp{border:1.5px dashed var(--ink-2);background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--muted) 35%,transparent) 0 1.5px,transparent 1.5px 6px);min-width:3px}
  & .strip .sp span{position:absolute;left:4px;right:2px;top:4px;font:500 11px/1.2 var(--ui);color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  & .strip .run0{width:2px;background:var(--teal);top:-1px;bottom:-1px}
  & .dimrow{position:relative;height:22px;margin-top:8px;border-top:1px solid var(--ink-2)}
  & .dimrow::before,& .dimrow::after{content:"";position:absolute;top:-6px;width:1px;height:11px;background:var(--ink-2)}
  & .dimrow::before{left:0}& .dimrow::after{right:0}
  & .dimrow span{position:absolute;left:50%;top:-9px;transform:translateX(-50%);padding:0 6px;background:var(--paper);font:500 12px/1.2 var(--mono);color:var(--ink-2);white-space:nowrap}
  & .dimrow.av{border-top-color:var(--teal-ink)}
  & .dimrow.av::before,& .dimrow.av::after{background:var(--teal-ink)}
  & .dimrow.av span{color:var(--teal-ink)}
  & .ends{display:flex;justify-content:space-between;font:400 11.5px var(--mono);color:var(--muted);margin-top:-2px}


  /* ---------- starter cards ---------- */
  & .cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
  & .card{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:6px;background:var(--paper-2);min-width:0}
  & .card.cur{border-color:var(--teal-solid);box-shadow:inset 0 0 0 1px var(--teal-solid)}
  & .card-fig{padding:14px 14px 6px;background:var(--paper);border-bottom:1px solid var(--line);border-radius:6px 6px 0 0}
  & .card-fig svg{width:100%;height:auto;max-height:min(300px,calc(100vh - 520px));min-height:180px;display:block}
  & .card-body{display:flex;flex-direction:column;gap:8px;padding:14px 18px 18px;flex:1}
  & .card-h{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
  & .card h2{margin:0;font:700 22px/1.1 var(--display)}
  & .card .boxline{color:var(--ink-2)}
  & .tag{font-size:12.5px;font-weight:600;color:var(--teal-ink);border:1px solid var(--teal);border-radius:999px;padding:2px 8px;background:var(--glow-2)}
  & .card .status{margin:0;align-items:flex-start;font-size:13px;line-height:1.4}
  & .card .status svg{margin-top:3px}
  & .card .status.bad{font-weight:400}
  & .card .status.bad b{font-weight:600}
  & .card .btn{margin-top:auto;min-height:48px;gap:14px;justify-content:space-between;padding:0 18px;font-size:15px}
  & .card .status + .btn{margin-top:8px}
  & .starter-foot{display:flex;align-items:center;justify-content:space-between;gap:8px 20px;flex-wrap:wrap;margin-top:16px}
  & .starter-foot .btn{margin-left:-10px}
  & .starter-foot .note{max-width:60ch}
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .v-start{--xp-foot:#7D8590;--xp-rod:#AEB6BF}
}
:root[data-theme="dark"] .v-start{--xp-foot:#7D8590;--xp-rod:#AEB6BF}

@keyframes xp-explode{from{transform:translateY(var(--lift))}}
@keyframes xp-fade{from{opacity:0}}

@media (max-width:1180px){
  .v-start{
    & .wrap{padding:0 28px 48px}
    & .hero{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:36px}
    & .hero h1{font-size:42px}
    & .measure-grid{grid-template-columns:minmax(0,1fr) 340px;gap:32px}
  }
}
@media (max-width:899px){
  .v-start{
    & .wrap{padding:0 16px 32px}
    & .hero{grid-template-columns:minmax(0,1fr);min-height:0;padding:20px 0 0;row-gap:18px}
    & .hero h1{font-size:34px;max-width:none}
    & .lede{font-size:15.5px;margin-top:10px}
    & .hero-fig{order:-1}
    & .hero-txt{display:contents}
    & .hero h1{order:-3}& .lede{order:-2;margin-top:-8px}
    & .xp-wrap{padding:10px 8px 4px;border-radius:12px}
    & .xp{max-height:none;min-height:0}
    & .xp .dim text{font-size:100px}
    & .xp .bl text{font-size:100px}
    & .trail{margin-top:0}
    & .cta{margin-top:4px}
    & .cta .btn.big{flex:1}
    & .saved-slot:not(:empty){margin-top:0}
    & .step-wrap{padding-top:16px}
    & .step-head{gap:12px;margin-bottom:16px}
    & .step-head > .balloon{width:32px;height:32px;font-size:14px}
    & .step-head h1{font-size:27px}
    & .measure-grid{grid-template-columns:minmax(0,1fr);gap:20px}
    & .wallview{position:static;order:2}
    & .measure{display:contents}
    & .measure > *{order:1}
    & .measure > .step-foot{order:3}
    & .f-name{max-width:none}
    & .errsum li{grid-template-columns:minmax(0,1fr)}
    & .grid{gap:14px 12px}
    & .grid .f-widthMm,& .grid .f-availableHeightMm{grid-column:1 / -1}
    & .grid .f-runOffsetMm{max-width:none}
    & .disc{margin-top:0}
    & .step-foot{margin-top:4px}
    & .step-foot .btn.big{flex:1}
    & .span-row{grid-template-columns:22px minmax(0,1fr) minmax(0,1fr);grid-template-areas:"b l l" "b x w" "b rm rm";row-gap:8px}
    & .span-row > .balloon{grid-area:b;margin-top:30px}
    & .span-row > .field:nth-of-type(1){grid-area:l}
    & .span-row > .field:nth-of-type(2){grid-area:x}
    & .span-row > .field:nth-of-type(3){grid-area:w}
    & .span-row .rm{grid-area:rm;margin-top:0;justify-self:start;min-height:44px}
    & .span-add .btn{min-height:44px}
    & .wallview{padding:14px}
    & .avail .big{font-size:30px}
    & .cards{grid-template-columns:minmax(0,1fr);gap:16px}
    & .card-fig{padding:10px 8px 4px}
    & .card-fig svg{max-height:none;min-height:0}
    & .card .btn{white-space:normal;text-align:left}
  }
}
@media (prefers-reduced-motion: reduce){
  .v-start .xp.intro .part,.v-start .xp.intro .bl,.v-start .xp.intro .dim{animation:none}
  .v-start .disc > summary::after{transition:none}
}
@media print{
  .v-start .xp.intro *{animation:none!important}
}
