/* Review the specification (#review) and Demo review request (#request).
   Scoped under .v-review / .v-request. The review reads like an assembly sheet:
   hairline-ruled sections on paper, a drawing title block, balloons that match the
   parts list. Only the 3D stage is rounded elsewhere; here controls keep 6 px. */

/* the print sheet lives at the end of <body>; print.css shows it */
@media screen{ #sr-print{display:none} }

/* ---------------------------------------------------------------- review */
.v-review{
  & .rv{max-width:1340px;margin:0 auto;padding:18px 24px 56px}

  /* head: back, title, drawing title block */
  /* the money action sits in the title-block row, so it is on screen at load (1440×900) */
  & .rv-head{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"back back back" "h tb go";align-items:end;gap:6px 20px;margin-bottom:18px}
  & .back{grid-area:back;justify-self:start;margin-left:-10px;gap:6px;color:var(--ink-2)}
  & .rv-head h1{grid-area:h;margin:0;display:flex;flex-direction:column;gap:6px;min-width:0}
  & .eyebrow{font:600 15px/1 var(--ui);letter-spacing:.06em;font-variant-caps:all-small-caps;color:var(--muted)}
  & .rv-head h1 .nm{font:700 36px/1.05 var(--display);letter-spacing:-.015em;overflow-wrap:anywhere}
  & .titleblock{grid-area:tb;justify-self:end;display:grid;grid-template-columns:repeat(5,auto);border:1px solid var(--ink-2);background:var(--paper-2)}
  & .titleblock .c{display:flex;flex-direction:column;gap:4px;padding:7px 12px 8px;border-left:1px solid var(--hair);min-width:0}
  & .titleblock .c:first-child{border-left:0}
  & .titleblock .k{font:600 13.5px/1 var(--ui);letter-spacing:.06em;font-variant-caps:all-small-caps;color:var(--muted)}
  & .titleblock .v{font-size:13.5px;font-weight:500;white-space:nowrap}
  & .titleblock .v.mono{font-size:14px}
  & .titleblock .v.status{font-size:13px}
  & .titleblock a{font-weight:600}
  & .rv-head .go{grid-area:go;align-self:stretch;min-height:50px;font-size:15px;gap:14px;padding:0 18px;justify-content:space-between}

  /* grid */
  & .rv-grid{display:grid;grid-template-columns:minmax(0,1fr) 460px;grid-template-areas:"fig side" "run side" "nc side";grid-template-rows:auto auto 1fr;gap:20px;align-items:start}
  & .rv-grid > *{min-width:0}
  & .sheet.fig{grid-area:fig}
  & .rv-side{grid-area:side;display:flex;flex-direction:column;gap:20px}
  & .sheet.runs{grid-area:run}
  & .sheet.unchecked{grid-area:nc}

  /* a sheet: paper with a hairline frame, no card radius */
  & .sheet{background:var(--paper);border:1px solid var(--line);padding:16px 20px 18px}
  & .sh{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding-bottom:10px;margin-bottom:12px;border-bottom:1px solid var(--ink-2)}
  & .sh h2{margin:0;font:700 21px/1.1 var(--display);letter-spacing:-.01em}
  & .sh .tag{margin-left:auto;display:inline-flex;align-items:center;gap:6px;font:500 12px var(--mono);color:var(--muted)}
  & .sh .tag svg{width:14px;height:14px}
  & .sh .status{margin-left:auto}
  & h3{margin:0 0 6px;font:600 15px/1.2 var(--ui);letter-spacing:.05em;font-variant-caps:all-small-caps;color:var(--muted)}

  /* elevation + measurement notes, side by side like a drawing and its notes */
  & .fig-body{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:20px;align-items:start}
  & .elev{margin:0;display:flex;flex-direction:column;gap:8px;min-width:0}
  & .elev svg{display:block;width:100%;height:auto;max-height:560px}
  & .elev figcaption{font-size:12px;color:var(--muted)}
  & .meas{display:flex;flex-direction:column;gap:6px;border-left:1px solid var(--line);padding-left:18px}
  & .mlist{margin:0 0 12px;display:flex;flex-direction:column}
  & .mlist .m{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:7px 0;border-bottom:1px solid var(--line);align-items:baseline}
  & .mlist dt{font-size:13px;color:var(--ink-2);display:flex;align-items:center;gap:8px}
  & .mlist dd{margin:0;text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:1px}
  & .mlist dd .mono{font-size:13.5px;white-space:nowrap}
  & .mlist dd .h{font:400 11px var(--mono);color:var(--muted);white-space:nowrap}
  & .key{width:20px;height:20px;flex:none;display:inline-grid;place-items:center;border:1.3px solid var(--ink-2);font:500 11px var(--mono);color:var(--ink)}
  & .spans{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
  & .spans li{display:flex;gap:10px;align-items:flex-start;font-size:13px}
  & .spans li > span:last-child{display:flex;flex-direction:column}
  & .spans .mono{font-size:12px;color:var(--muted);font-weight:400}
  & .spans .sw{width:18px;height:18px;flex:none;margin-top:1px;border:1.3px dashed var(--ink-2);background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--muted) 45%,transparent) 0 2px,transparent 2px 6px)}

  /* tables */
  & .tw{overflow-x:auto}
  & .tbl{width:100%;border-collapse:collapse;font-size:13.5px}
  & .tbl thead th{font:600 14px/1.2 var(--ui);letter-spacing:.05em;font-variant-caps:all-small-caps;color:var(--muted);text-align:left;padding:0 8px 8px 0;border-bottom:1px solid var(--line)}
  & .tbl th.x,& .tbl td.x,& .tbl th.r,& .tbl td.r{text-align:right}
  & .tbl td,& .tbl tbody th{padding:9px 8px 9px 0;border-bottom:1px solid var(--line);vertical-align:middle;text-align:left}
  & .tbl tbody th{font-weight:600}
  & .tbl td:last-child,& .tbl th:last-child{padding-right:0}
  & .tbl .d{display:block;font:400 11.5px var(--mono);color:var(--muted);margin-top:2px}
  & .tbl td.b{width:40px;padding-right:4px}
  & .run td.pos{font:500 13px var(--mono);color:var(--muted);width:44px}
  & .run td.x{font:500 13.5px var(--mono);white-space:nowrap}
  & .run tbody th{font-weight:500}
  & #rv-run-sum{margin-top:10px}

  & .bom .nm{display:block}
  & .bom td.q,& .bom td.t{font:500 13px var(--mono);text-align:right;white-space:nowrap}
  & .bom td.t{font-size:13.5px}
  & .bom td.t .u{display:block;font:400 11.5px var(--mono);color:var(--muted);margin-top:2px}
  & .bom tr.colour th .nm{font-weight:500}
  & .bom tr.colour td.t .u{font-family:var(--ui);font-size:12px}
  & .bom .d{white-space:normal}
  & .bom .qm{display:none;font:500 13px var(--mono);color:var(--ink-2);white-space:nowrap}
  & .tbl .money th{font:400 13px var(--ui);color:var(--ink-2);text-align:right;padding:6px 12px 6px 0;border:0}
  & .tbl .money td.t{font:500 13.5px var(--mono);text-align:right;padding:6px 0;border:0}
  & .tbl .money tr:first-child > *{padding-top:12px}
  & .tbl .money tr.sub > *{border-top:1px solid var(--line)}
  & .tbl .money tr.grand th{font:600 13.5px var(--ui);color:var(--ink);vertical-align:bottom;padding-top:10px;border-top:1px solid var(--ink-2)}
  & .tbl .money tr.grand td.t{font:700 28px/1 var(--display);letter-spacing:-.01em;font-variant-numeric:tabular-nums;padding-top:10px;border-top:1px solid var(--ink-2)}
  & .box{margin:12px 0 0;font-size:12.5px;color:var(--ink-2)}
  & .box .lab{font:600 14px var(--ui);letter-spacing:.06em;font-variant-caps:all-small-caps;color:var(--muted);margin-right:4px}
  & .legal{margin:8px 0 0;font-size:12px;color:var(--muted);line-height:1.45}

  /* next: request state + actions */
  & .next{display:flex;flex-direction:column;gap:12px}
  & #rv-req:empty{display:none}
  & #rv-req{display:flex;flex-direction:column;gap:10px}
  & .rq{display:flex;gap:12px;align-items:center}
  & .rq p{margin:0;display:flex;flex-direction:column;gap:2px;font-size:12.5px;color:var(--ink-2)}
  & .rq b{font-size:14px;color:var(--ink)}
  & .rq.old b{color:var(--ink-2)}
  & .ref{width:44px;height:44px;font-size:13px}
  & .ref.out-ref{border-style:dashed;border-color:var(--hair);color:var(--muted);background:var(--paper)}
  & .acts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  & .acts .btn{gap:7px}
  & .acts .quiet{grid-column:1 / -1;justify-self:start;margin-left:-6px}
  & .msg{margin:0}

  /* not checked: an empty tick box per item, the opposite of a pass */
  & .lead{margin:0 0 12px;font-size:13.5px;color:var(--ink-2);max-width:68ch}
  & .nc{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
  & .nc li{display:flex;gap:10px;padding:9px 0;border-top:1px solid var(--line);font-size:13px;color:var(--ink-2);line-height:1.4}
  & .nc li b{display:block;color:var(--ink);font-weight:600;margin-bottom:1px}
  & .ck{width:16px;height:16px;flex:none;margin-top:2px;border:1.5px dashed var(--ink-2);border-radius:3px}
  & .scope{list-style:none;margin:12px 0 0;padding:10px 0 0;border-top:1px solid var(--ink-2);display:flex;flex-direction:column;gap:6px}
  & .scope li{display:flex;gap:8px;font-size:13px;color:var(--ink)}
  & .scope svg{width:14px;height:14px;margin-top:3px;color:var(--teal-ink)}
}

@media (max-width:1180px){
  .v-review{
    & .rv-head{grid-template-columns:1fr;grid-template-areas:"back" "h" "tb" "go";row-gap:12px}
    & .rv-head .go{justify-self:start;align-self:auto}
    & .titleblock{justify-self:stretch;grid-template-columns:repeat(5,minmax(0,1fr))}
    & .rv-grid{grid-template-columns:minmax(0,1fr) 400px}
    & .fig-body{grid-template-columns:1fr}
    & .meas{border-left:0;padding-left:0;border-top:1px solid var(--line);padding-top:12px}
    & .mlist{display:grid;grid-template-columns:1fr 1fr;column-gap:20px}
    & .nc{grid-template-columns:1fr}
  }
}
@media (max-width:899px){
  .v-review{
    & .rv{padding:12px 16px 28px}
    & .rv-head{margin-bottom:14px}
    & .back{min-height:44px}
    & .rv-head h1 .nm{font-size:28px}
    & .rv-head .go{justify-self:stretch}
    & .titleblock{grid-template-columns:1fr 1fr}
    & .titleblock .c{border-left:0;border-top:1px solid var(--hair)}
    & .titleblock .c:nth-child(even){border-left:1px solid var(--hair)}
    & .titleblock .c:nth-child(-n+2){border-top:0}
    & .titleblock .c:last-child{grid-column:1 / -1;border-left:0}
    & .titleblock .v{white-space:normal}
    & .rv-grid{display:flex;flex-direction:column;gap:14px}
    & .rv-side{gap:14px}
    & .sheet{padding:14px 14px 16px}
    & .mlist{grid-template-columns:1fr}
    & .sh h2{font-size:19px}
    & .sh .status{margin-left:0;white-space:normal}
    & .rv-side,& .rv-side > *{max-width:100%;min-width:0}
    & .acts{grid-template-columns:1fr}
    & .acts .btn{min-height:46px}
    & .tbl{font-size:13px}
    & .bom thead th:nth-child(3),& .bom td.q{width:0;padding:0;font-size:0;color:transparent}
    & .bom .qm{display:inline}
    & .money th{text-align:left}
    & .money tr th{padding-left:44px}
  }
}
@media (max-width:420px){
  .v-review{
    & .run thead th:nth-child(5),& .run td:nth-child(5){display:none}
    & .run td.pos{width:30px}
    & .tbl td.b{width:34px}
    & .sh .tag{margin-left:0}
    & .money tr th{padding-left:0}
    & .tbl .money tr.grand td.t{font-size:24px}
    & .tbl .money tr.grand th{font-size:13px}
    & .bom td.t .u{white-space:normal}
  }
}

/* ---------------------------------------------------------------- request */
.v-request{
  & .rq{max-width:1180px;margin:0 auto;padding:18px 24px 56px}
  & .rq-head{display:flex;flex-direction:column;gap:8px;margin-bottom:20px;max-width:760px}
  & .back{align-self:flex-start;margin-left:-10px;gap:6px;color:var(--ink-2)}
  & h1{margin:0;font:700 34px/1.08 var(--display);letter-spacing:-.015em;display:flex;flex-direction:column;gap:8px}
  & .eyebrow{font:600 15px/1 var(--ui);letter-spacing:.06em;font-variant-caps:all-small-caps;color:var(--muted)}
  & .lead{margin:0;font-size:15px;color:var(--ink-2);max-width:62ch}
  & .lead b{color:var(--ink);font-weight:600}

  & .rq-grid{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:28px;align-items:start}
  & .rq-main{display:flex;flex-direction:column;gap:16px;min-width:0;max-width:640px}
  & form{display:flex;flex-direction:column;gap:20px}

  /* contact: read-only, shown as a printed label, not as inputs */
  & .contact{margin:0;padding:14px 16px 14px;border:1px dashed var(--hair);background:var(--paper)}
  & .contact legend{padding:0 6px;margin-left:-6px;font:600 13px var(--ui);color:var(--ink)}
  & .contact legend span{font-weight:400;color:var(--muted);margin-left:4px}
  & .contact dl{margin:0;display:grid;grid-template-columns:1fr 1fr;gap:10px 18px}
  & .contact dt{font:600 13.5px/1 var(--ui);letter-spacing:.06em;font-variant-caps:all-small-caps;color:var(--muted);margin-bottom:5px}
  & .contact dd{margin:0;font-size:15px;font-weight:500}
  & .contact dd.mono{font-size:14px}
  & .pii{margin:12px 0 0;display:flex;gap:8px;font-size:12.5px;color:var(--ink-2)}
  & .pii svg{width:14px;height:14px;margin-top:2px;color:var(--teal-ink)}

  & .note-field label{display:block;font-size:13.5px;font-weight:600;color:var(--ink)}
  /* "optional" is an inline muted word after the label, never a box */
  & .note-field .optl{display:inline;font-size:12.5px;font-weight:400;color:var(--muted);margin-left:6px;padding:0;border:0;background:none;box-shadow:none}
  & textarea{width:100%;min-height:112px;resize:vertical;border:1px solid var(--edge, #767F89);border-radius:6px;background:var(--paper-2);padding:10px 12px;font:400 15px/1.45 var(--ui)}
  & textarea:focus{outline:2px solid var(--focus, #0B5F69);outline-offset:2px;border-color:var(--focus, #0B5F69);box-shadow:none}
  & .note-meta{display:flex;gap:16px;align-items:flex-start}
  & .note-meta .hint{flex:1}
  & .count{margin:0;font-size:12px;color:var(--muted);white-space:nowrap}
  & .count.near{color:var(--ink)}

  /* acknowledgement: a 44 px row; the box draws its own tick */
  & .ack{display:flex;flex-direction:column;gap:6px}
  & .ackl{display:flex;gap:12px;align-items:flex-start;min-height:44px;padding:11px 14px;border:1px solid var(--hair);border-radius:6px;background:var(--paper-2);cursor:pointer;font-size:14px;line-height:1.4}
  & .ackl:hover{border-color:var(--ink-2)}
  & .ackl input{position:absolute;opacity:0;width:22px;height:22px;margin:0}
  & .ackl .box{width:22px;height:22px;flex:none;border:1.5px solid var(--edge, #767F89);border-radius:4px;display:grid;place-items:center;background:var(--paper-2);color:var(--on-teal)}
  & .ackl .box svg{width:13px;height:13px;opacity:0}
  & .ackl input:checked + .box{background:var(--teal-solid);border-color:var(--teal-solid)}
  & .ackl input:checked + .box svg{opacity:1}
  & .ackl input:focus-visible + .box{outline:2px solid var(--focus, #0B5F69);outline-offset:2px}
  & .ack.err .ackl{border-color:var(--red);box-shadow:inset 3px 0 0 var(--red)}

  & .submit-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
  & .submit{min-height:50px;padding:0 22px;font-size:15px}
  /* busy: an empty balloon that fills over MIN_BUSY_MS (600 ms, request.js), so it is
     solid exactly when the ticket appears. No spinner. */
  & .submit .spin{display:none;width:16px;height:16px;flex:none;border-radius:50%;border:1.5px dashed currentColor;background:transparent;transition:none}
  & .submit.busy .spin{display:block;animation:rq-fill 600ms var(--settle) forwards}
  & .submit.busy{cursor:progress}
  & .submit-row .note{font-size:12.5px}

  & .earlier{display:flex;gap:12px;align-items:center;padding:10px 12px;border:1px dashed var(--hair);background:var(--paper)}
  & .earlier p{margin:0;display:flex;flex-direction:column;gap:2px;font-size:12.5px;color:var(--ink-2)}
  & .earlier b{font-size:13.5px;color:var(--ink)}
  & .out-ref{width:40px;height:40px;font-size:12.5px;border-style:dashed;border-color:var(--hair);color:var(--muted);background:var(--paper)}

  & .fail{padding:14px 16px;border-left:3px solid var(--red);background:var(--red-tint);display:flex;flex-direction:column;gap:8px}
  & .fail:focus{outline:2px solid var(--red);outline-offset:2px}
  & .fh{margin:0;display:flex;gap:8px;align-items:center;font:700 17px var(--display);color:var(--red-ink)}
  & .fh svg{width:16px;height:16px}
  & .fb{margin:0;font-size:13.5px;color:var(--ink)}
  & .fail .facts{display:flex;gap:8px;flex-wrap:wrap}
  & .fail .msg{margin:0}

  /* snapshot recap (also used on the confirmation) */
  & .snap{background:var(--paper);border:1px solid var(--line);padding:16px 18px 18px;display:flex;flex-direction:column;gap:12px}
  & .snap h2{margin:0;padding-bottom:10px;border-bottom:1px solid var(--ink-2);font:700 19px/1.1 var(--display)}
  & .snap .note{font-size:12px}
  & .thumb{background:var(--paper-2);border:1px solid var(--line);padding:8px}
  & .thumb svg{display:block;width:100%;height:auto;max-height:220px}
  & .rc{margin:0;display:flex;flex-direction:column}
  & .rc > div{display:grid;grid-template-columns:120px 1fr;gap:10px;padding:8px 0;border-bottom:1px solid var(--line);align-items:baseline}
  & .rc dt{font-size:12.5px;color:var(--muted)}
  & .rc dd{margin:0;font-size:13.5px;min-width:0}
  & .rc dd.mono{font-size:13px}
  & .rc .exact{font:400 11.5px var(--ui);color:var(--teal-ink);margin-left:6px}
  & .runb{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 10px}
  & .runb li{display:inline-flex;align-items:center;gap:5px;font-size:13px}
  & .rc .totrow{border-bottom:0;align-items:end}
  & .rc .tot{font:700 26px/1 var(--display);letter-spacing:-.01em;font-variant-numeric:tabular-nums}

  /* confirmation: the reference hangs in a balloon on a leader to the snapshot */
  & .rq-done{padding-top:12px}
  & .done-fig{display:grid;grid-template-columns:168px 72px minmax(0,760px);align-items:start;justify-content:center}
  & .refb{width:168px;height:168px;border-radius:50%;border:2px solid var(--teal);background:var(--paper-2);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;box-shadow:0 0 0 8px var(--glow-2);margin-top:22px}
  & .refb .k{font:500 13px/1 var(--mono);letter-spacing:.2em;color:var(--muted);padding-left:.2em}
  & .refb .n{font:500 54px/1 var(--mono);color:var(--teal-ink);letter-spacing:-.02em}
  & .leader{position:relative;height:2px;margin-top:105px;background:var(--teal)}
  & .leader i{position:absolute;right:-5px;top:-4px;width:10px;height:10px;border-radius:50%;background:var(--ink)}
  & .done-card{background:var(--paper);border:1px solid var(--line);padding:22px 24px 22px;display:flex;flex-direction:column;gap:12px;min-width:0}
  & .done-card h1{font-size:30px}
  & .honest{margin:0;display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-left:3px solid var(--teal);background:var(--glow-2);font-size:15px;font-weight:600;color:var(--ink)}
  & .honest svg{width:16px;height:16px;margin-top:3px;color:var(--teal-ink)}
  & .sub{margin:0;font-size:13.5px;color:var(--ink-2)}
  & .sub.small{font-size:12px;color:var(--muted)}
  & .recap{display:grid;grid-template-columns:260px minmax(0,1fr);gap:16px;align-items:start;padding-top:4px}
  & .recap .rnote{grid-column:1 / -1;border-top:1px solid var(--line);padding-top:8px}
  & .recap .rnote .k{font-size:12.5px;color:var(--muted)}
  & .recap .rnote p{margin:2px 0 0;font-size:13.5px;white-space:pre-wrap;overflow-wrap:anywhere}
  & .done-card .acts{display:flex;gap:10px;flex-wrap:wrap;padding-top:4px}
  & .done-card .acts .btn{min-height:46px;padding:0 18px}
}
@keyframes rq-fill{
  0%{background:transparent;box-shadow:inset 0 0 0 0 currentColor}
  99%{border-style:dashed}
  100%{border-style:solid;background:currentColor;box-shadow:inset 0 0 0 8px currentColor}
}

@media (max-width:1180px){
  .v-request{
    & .rq-grid{grid-template-columns:minmax(0,1fr) 360px}
    & .done-fig{grid-template-columns:120px 40px minmax(0,1fr)}
    & .refb{width:120px;height:120px}
    & .refb .n{font-size:38px}
    & .leader{margin-top:81px}
    & .recap{grid-template-columns:1fr}
    & .thumb svg{max-height:200px}
  }
}
@media (max-width:899px){
  .v-request{
    & .rq{padding:12px 16px 32px}
    & h1{font-size:27px}
    & .back{min-height:44px}
    & .rq-grid{grid-template-columns:1fr;gap:18px}
    & .contact dl{grid-template-columns:1fr}
    & .note-meta{flex-direction:column;gap:4px}
    & .submit{width:100%}
    & .fail .facts .btn{flex:1 1 auto;min-height:46px}
    & .done-fig{grid-template-columns:1fr;justify-items:center}
    & .refb{margin-top:0;width:120px;height:120px}
    & .leader{width:2px;height:28px;margin:8px 0 0}
    & .leader i{right:-4px;top:auto;bottom:-5px}
    & .done-card{justify-self:stretch;padding:18px 16px}
    & .done-card h1{font-size:25px}
    & .rc > div{grid-template-columns:1fr;gap:2px}
    & .done-card .acts .btn{flex:1 1 auto}
  }
}
@media (prefers-reduced-motion: reduce){
  /* a static dashed balloon: no fill animation */
  .v-request .submit.busy .spin{animation:none}
}
