/* Brand, sampled straight out of the MFT Windows artwork: yellow #F2C716 on
   near-black. The blue-greys that used to surround the navy are now plain
   neutrals, so the yellow is the only colour in the interface - and the one
   thing that lands on black every time is the yellow. */
:root {
  --bg: #f2f2f0;
  --panel: #ffffff;
  --ink: #131313;
  --muted: #6d7075;
  --line: #e0e1e2;
  --accent: #131313;          /* was the navy; every accent surface */
  --accent-ink: #f2c716;      /* what sits ON an accent surface */
  --brand: #f2c716;
  --brand-deep: #7a6100;      /* the same yellow, darkened for use on white */
}

* { box-sizing: border-box; }

/* an author display rule beats the UA [hidden] rule, and selects are display:
   block here, so the controls we drive indirectly were still showing */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 22px;
  background: var(--accent);
  color: var(--accent-ink);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.tag { font-size: 12px; opacity: .75; }

/*
 * Cost visibility switch. Deliberately quiet: a small pill at the far right of
 * the bar that only lifts when you go near it, because for a customer demo it
 * should be findable but not part of the picture.
 */
.cost-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 11px;
  font: inherit;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(242, 199, 22, .70);
  background: rgba(242, 199, 22, .08);
  border: 1px solid rgba(242, 199, 22, .24);
  border-radius: 999px;
  cursor: pointer;
  opacity: .6;
  transition: opacity .12s, background .12s, color .12s;
}
.cost-toggle:hover,
.cost-toggle:focus-visible {
  opacity: 1;
  color: var(--accent-ink);
  background: rgba(242, 199, 22, .16);
  outline: none;
}
.cost-toggle .ct-switch {
  position: relative;
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .26);
  transition: background .15s;
}
.cost-toggle .ct-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
/* pressed = costs on show */
.cost-toggle[aria-pressed="true"] .ct-switch { background: #63b76f; }
.cost-toggle[aria-pressed="true"] .ct-switch::after { transform: translateX(12px); }

/* customer view: the door price on its own, then no cost column, no itemised
   breakdown, no cost/margin lines, no markup field and no cost asides */
body.hide-costs .is-cost { display: none; }
body.hide-costs #lines { display: none; }
body.hide-costs #totals { display: none; }
body.hide-costs .totals .is-cost { display: none; }
body.hide-costs .markup-field { display: none; }
/* the selling price is the STAFF control, not a cost field: it is what they use
   instead of a markup, so it stays put even in customer view */
body.hide-costs .is-staff-price .markup-field { display: block; }

/* the logo preview on the account page */
.logo-preview { margin: 0 0 10px; }
.logo-preview img {
  max-width: 260px;
  max-height: 90px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(260px, 1fr) 340px;
  gap: 16px;
  padding: 16px;
  align-items: start;
}

/* everything on the right of the bar: who is signed in, the cost switch, the
   way out. One flex row so the bar keeps a single right-hand edge. */
.topright {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topright .cost-toggle { margin-left: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px 16px;
}
.panel h2 {
  margin: 15px 0 8px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  font-weight: 600;
}
.panel h2:first-child { margin-top: 0; }

label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  color: var(--muted);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

select, input[type=number], input[type=text], input[type=search],
input[type=email], input[type=password] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
select:focus, input:focus { outline: 2px solid #f2c716; border-color: var(--accent); }

.hint { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
/* the chosen size is outside what this design is made in */
.hint.is-bad { color: #b3261e; font-weight: 600; }

/* ---------------------------- frame extensions --------------------------- */
/* Four independent sides, because they are ordered separately and a side can
   carry more than one section. */
.sides { display: grid; gap: 3px; }
.srow {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.srow.is-off { opacity: .45; }

/*
 * The same four rows, moved onto the elevation. Each side of the door carries
 * its own control, sitting just outside the frame it adds to, so the extension
 * is chosen where it applies instead of two hundred pixels down a list. They
 * are pills over the drawing rather than panel furniture: small, always the
 * same size, and only the side that has something on it is emphasised.
 */
.ext-ctl {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.ext-ctl .srow {
  position: absolute;
  pointer-events: auto;
  gap: 4px;
  padding: 3px 6px;
  font-size: 10.5px;
  background: rgba(255, 255, 255, .93);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(20, 30, 45, .18);
  white-space: nowrap;
}
.ext-ctl .srow.has-ext {
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(19, 19, 19, .28);
}
/* the little stack of 15/45 bars is unreadable at this size - the number is not */
.ext-ctl .schips,
.ext-ctl .sbtn.clr { display: none; }
.ext-ctl .srow.has-ext .sbtn.clr { display: inline-block; }
.ext-ctl .sname { flex: 0 0 auto; font-size: 10px; color: var(--muted); }
.ext-ctl .stotal {
  flex: 0 0 auto;
  min-width: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ext-ctl .sbtn { padding: 1px 5px; font-size: 10px; }
.ext-ctl .srow[data-side="head"]  { top: 4px;    left: 50%; transform: translateX(-50%); }
.ext-ctl .srow[data-side="cill"]  { bottom: 4px; left: 50%; transform: translateX(-50%); }
.ext-ctl .srow[data-side="left"]  { left: 4px;   top: 50%;  transform: translateY(-50%);
                                    flex-direction: column; }
.ext-ctl .srow[data-side="right"] { right: 4px;  top: 50%;  transform: translateY(-50%);
                                    flex-direction: column; }

/*
 * Dimension lines. A hairline rule along the edge being measured, with a small
 * tick at each end and a value button that opens a number field on click.
 * Positioned from the live geometry, so they follow the door as it is resized.
 */
.dims { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.dim-rule { position: absolute; background: rgba(19, 19, 19, .62); }
.dim-rule::before,
.dim-rule::after { content: ''; position: absolute; background: inherit; }
.dim-w { height: 1px; }
.dim-w::before,
.dim-w::after { top: -4px; height: 9px; width: 1px; }
.dim-w::before { left: 0; }
.dim-w::after { right: 0; }
.dim-rule[hidden] { display: none; }
.dim-h { width: 1px; }
.dim-h::before,
.dim-h::after { left: -4px; width: 9px; height: 1px; }
.dim-h::before { top: 0; }
.dim-h::after { bottom: 0; }

.dim {
  position: absolute;
  pointer-events: auto;
  padding: 3px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--accent);
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(19, 19, 19, .45);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(20, 30, 45, .14);
  cursor: pointer;
  white-space: nowrap;
}
.dim:hover { border-color: var(--accent); background: #faf8ee; }
.dim[hidden] { display: none; }
.dim.is-editing { padding: 1px 2px; border-color: var(--accent); }
.dim input {
  width: 46px;
  font: inherit;
  font-size: 10.5px;
  padding: 0 1px;
  border: 0;
  outline: 0;
  color: var(--ink);
}
.sname { flex: 0 0 44px; color: var(--muted); }
.schips { flex: 1 1 auto; display: flex; gap: 2px; min-height: 12px; }
.schip {
  width: 13px;
  height: 12px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
}
.stotal { flex: 0 0 44px; text-align: right; font-variant-numeric: tabular-nums; }
.sbtn {
  font: inherit;
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.sbtn:hover:not(:disabled) { border-color: #c8c8c4; background: #f8f8f6; }
.sbtn:disabled { opacity: .4; cursor: not-allowed; }
.sbtn.clr { padding: 3px 7px; }

/* ------------------------------ range switch ---------------------------- */
.seg { display: flex; margin-bottom: 2px; }
.segbtn {
  flex: 1;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: #f6f8fa;
  border: 1px solid var(--line);
  cursor: pointer;
}
.segbtn:first-child { border-radius: 5px 0 0 5px; }
.segbtn:last-child { border-radius: 0 5px 5px 0; }
.segbtn + .segbtn { border-left: none; }
.segbtn.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ------------------------------ collections ----------------------------- */
.cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}
.cat {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
}
/* the badge: a cropped detail of a real door in that collection, sized so the
   four tiles read at a glance. They collapse away once a collection is picked. */
.cat .catthumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 200px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}
.cat .catmeta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 9px 8px;
}
.cat.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(19, 19, 19, .18); }
.cat:hover { border-color: #c8c8c4; background: #f8f8f6; }
.cat.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(19, 19, 19, .16); }
.cat .catname { font-size: 12.5px; color: var(--ink); }
.cat .catcount { font-size: 10.5px; color: var(--muted); }
.cat.is-on .catname { color: var(--accent); font-weight: 600; }

/* ------------------------------- picker row ----------------------------- */
.picker {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 7px;
  padding: 7px 9px;
  font: inherit;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.picker:hover { border-color: #c8c8c4; background: #f8f8f6; }

.picker .chip {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, .28);
}
.picker .pmeta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.picker .plabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.picker .pvalue { font-size: 13px; color: var(--ink); line-height: 1.25; overflow-wrap: anywhere; }
.picker .pchange { font-size: 11.5px; color: var(--accent); }

/* ------------------------------- elevation ------------------------------ */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* the top and bottom margins are for the head and sill extension controls,
     which sit outside the frame rather than over it */
  padding: 34px 44px 14px;
  background: linear-gradient(180deg, #e4e8ec 0%, #d5dbe0 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.assembly { display: flex; flex-direction: column; align-items: center; }

/* the coupled assembly: light, coupler, door, coupler, light */
.elevation { transform-origin: top center; }

/* Room under the drawing for the ruled width and its value. This sits OUTSIDE the
   scaled elevation on purpose: the drawing is scaled down to fit the panel, and a
   padding on it would shrink with it, letting the cill bar ride up over the
   dimension. */
/* room for both ruled tiers under the drawing: the leaf widths and the overall
   width below them */
.dimspace { height: 66px; }
.elev-row { display: flex; align-items: flex-start; justify-content: center; }

/*
 * A side or top light. Built the same way as the door frame - the same four
 * profiled bars, mitred and welded, driven by the same --ff-* / --fw-* / --ex-*
 * variables - because it is the same 62mm PVC face and has to read as one
 * product. Only the infill differs: glass or a composite panel.
 */
.light-frame {
  position: relative;
  box-sizing: border-box;
  padding: var(--fw-top, 0px) var(--fw-right, 0px) var(--fw-bottom, 0px) var(--fw-left, 0px);
  background: var(--frame, #cccccc);
  border: 1px solid rgba(0, 0, 0, .30);
  box-shadow: 0 8px 20px rgba(20, 30, 45, .18);
}
.light-frame .lf-inner {
  position: relative;
  z-index: 1;
  display: block;          /* a span is inline, and width/height would be ignored */
  width: 100%;
  height: 100%;
  background: #e9eef1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35),
              inset 0 0 14px rgba(0, 0, 0, .16);
  overflow: hidden;
}
/* a glazed light: cool, slightly reflective */
.light-frame .lf-inner.is-glazed {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(160deg, #cfdde3 0%, #b7c9d1 55%, #c8d7dd 100%);
}
.light-frame .lf-inner.is-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(0, 0, 0, .06) 100%),
    #dfe3e5;
}
/* the slab artwork, and its glass layer - the glass render is a white-background
   image, so multiply blending leaves the panel untouched outside the aperture,
   exactly as the door does it */
.light-frame .lf-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.light-frame .lf-glass { mix-blend-mode: multiply; }
.light-frame .lf-caption {
  position: absolute;
  z-index: 3;
  inset: auto 0 6px 0;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(30, 40, 48, .62);
  pointer-events: none;
}

/* the coupling bar is painted by the light frame itself, on the side it butts
   against the door - see renderLight() */

/*
 * "Add light" - a thin framed plus, greyed back until it is wanted. It sits
 * over the stage rather than beside the door, so a single door stays the whole
 * picture.
 */
.addlight {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 7px;
  font: inherit;
  font-size: 11px;
  letter-spacing: .04em;
  color: #4c5a66;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(90, 105, 120, .42);
  border-radius: 4px;
  cursor: pointer;
  opacity: .55;
  transition: opacity .12s, background .12s, color .12s;
}
.addlight:hover,
.addlight:focus-visible,
.addlight[aria-expanded="true"] {
  opacity: 1;
  background: #fff;
  color: #1f2a33;
  outline: none;
}
.addlight-plus {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.addlight-plus::before,
.addlight-plus::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.addlight-plus::before { left: 2px; right: 2px; top: 50%; height: 1px; margin-top: -.5px; }
.addlight-plus::after { top: 2px; bottom: 2px; left: 50%; width: 1px; margin-left: -.5px; }
.addlight.has-light { opacity: .95; background: #fff; }

.addlight-panel,
.light-panel {
  position: absolute;
  top: 40px;
  right: 10px;
  z-index: 6;
  width: 232px;
  padding: 10px 12px 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(20, 30, 45, .24);
}
.light-panel .lp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.light-panel .lp-x {
  border: 0;
  background: none;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.light-panel .lp-pos { margin-bottom: 8px; }
.light-panel .lp-pos .segbtn { padding: 5px 4px; font-size: 11.5px; }
.light-panel .lp-field {
  display: block;
  margin: 7px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.light-panel .lp-field input,
.light-panel .lp-field select {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 5px 6px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.light-panel .hint { margin: 8px 0 0; }

/*
 * The Inox cassettes are supplied stainless steel or black and we hold no
 * picture of either finish, so the elevation cannot show the choice. This
 * states it instead - deliberately large, because it is the only confirmation
 * the customer gets before ordering.
 */
.cassette-banner {
  align-self: stretch;
  margin: 0 14px 14px;
  padding: 10px 14px 12px;
  border-radius: 6px;
  text-align: center;
  color: #fff;
  background: #262626;
  border: 2px solid #0d0d0d;
  box-shadow: 0 3px 10px rgba(20, 30, 45, .25);
  line-height: 1.1;
}
.cassette-banner .cb-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .78;
}
.cassette-banner .cb-value {
  display: block;
  margin: 2px 0 3px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.cassette-banner .cb-note {
  display: block;
  font-size: 11.5px;
  opacity: .82;
}
/* black cassettes: an unmistakably dark plate */
.cassette-banner.is-black {
  background: #101317;
  border-color: #000;
  color: #f2f4f6;
}
/* stainless steel: brushed metal, dark type so it still reads as light metal */
.cassette-banner.is-steel {
  background: linear-gradient(180deg, #e7ebee 0%, #c2cad0 45%, #aab4bb 55%, #d6dce0 100%);
  border-color: #8d979e;
  color: #131313;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}
.cassette-banner.is-steel .cb-label { opacity: .62; }

/*
 * Frame drawn as padding around the slab using the real proportion
 * (227px * 46 / slab width). Colour comes from the chosen frame profile.
 */
.door-frame {
  position: relative;
  padding: var(--fw-top, 0px) var(--fw-right, 0px) var(--fw-bottom, 0px) var(--fw-left, 0px);
  background: var(--frame, #cccccc);
  border: 1px solid rgba(0, 0, 0, .30);
  box-shadow: 0 8px 20px rgba(20, 30, 45, .22);
}

/*
 * Rehau Agila 62mm outer frame, drawn as four profiled bars.
 *
 * The customer sees the 62mm external face: it is FLAT for the first 42mm from
 * the outer perimeter, then chamfers back over the last 20mm to the slab. So
 * the only two things the profile has to say are a crisp outer arris and a
 * single chamfer break at 42/62 = 67.7%. --flat marks that break.
 *
 * Corners are 45 degree mitred and thermally welded: the verticals are clipped
 * on the diagonal so the two shading directions meet on the mitre line, and a
 * dressed weld seam is drawn over each joint.
 */
.fr {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background-color: var(--frame, #cccccc);
  --stops: rgba(0, 0, 0, .30) 0%,
           rgba(255, 255, 255, .14) 2.2%,
           rgba(255, 255, 255, .03) 7%,
           rgba(0, 0, 0, 0) 15%,
           rgba(0, 0, 0, 0) calc(var(--flat, 67.7%) - 3%),
           rgba(255, 255, 255, .10) var(--flat, 67.7%),
           rgba(0, 0, 0, .16) calc(var(--flat, 67.7%) + 14%),
           rgba(0, 0, 0, .38) 93%,
           rgba(0, 0, 0, .58) 100%;
  background-image: linear-gradient(var(--dir, 180deg), var(--stops));
}
/* the bars are the 62mm face, so they run a little way over the slab edge.
   --ex-* shifts them inward by whatever extension is clamped to that side. */
.fr-t { left: var(--ex-left, 0px); right: var(--ex-right, 0px); top: var(--ex-top, 0px);
        height: var(--ff-top, 0px); --dir: 180deg; }
.fr-b { left: var(--ex-left, 0px); right: var(--ex-right, 0px); bottom: var(--ex-bottom, 0px);
        height: var(--ff-bottom, 0px); --dir: 0deg; }
/* verticals must START AND END at the frame, not at the outer edge of the
   assembly. They used to run the full height, which was invisible until an
   extension was clamped on: the head band pushes the top rail down, so the
   jamb's 45 degree cut stayed up at the perimeter and the real joint became a
   blunt butt - two different joint lines in the same corner. */
.fr-l {
  top: var(--ex-top, 0px); bottom: var(--ex-bottom, 0px);
  left: var(--ex-left, 0px); width: var(--ff-side, 0px); --dir: 90deg;
  clip-path: polygon(0 0,
                     100% var(--ff-top, 0px),
                     100% calc(100% - var(--ff-bottom, 0px)),
                     0 100%);
}
.fr-r {
  top: var(--ex-top, 0px); bottom: var(--ex-bottom, 0px);
  right: var(--ex-right, 0px); width: var(--ff-side, 0px); --dir: 270deg;
  clip-path: polygon(100% 0,
                     0 var(--ff-top, 0px),
                     0 calc(100% - var(--ff-bottom, 0px)),
                     100% 100%);
}

/* the 42mm face, seen edge-on from whichever side the door opens towards: flat
   all the way, darkening only as it turns in to meet the 4mm shadow gap */
.door-frame.is-narrow .fr {
  --stops: rgba(0, 0, 0, .34) 0%,
           rgba(255, 255, 255, .16) 3%,
           rgba(255, 255, 255, .04) 9%,
           rgba(0, 0, 0, 0) 18%,
           rgba(0, 0, 0, 0) 78%,
           rgba(0, 0, 0, .16) 92%,
           rgba(0, 0, 0, .46) 100%;
}

/*
 * Welded mitre: the weld is dressed flush, so all that is left is a faint
 * witness line with a polished edge on one side. Drawn on the diagonal of a
 * frame-face square; the bottom pair collapse when there is no bottom rail
 * (goal post / low aluminium threshold).
 */
.weld {
  position: absolute;
  z-index: 3;
  width: var(--ff-side, 0px);
  height: var(--ff-top, 0px);
  pointer-events: none;
  --seam: transparent calc(50% - 1.1px),
          rgba(0, 0, 0, .22) calc(50% - 0.2px),
          rgba(255, 255, 255, .24) calc(50% + 0.7px),
          transparent calc(50% + 1.7px);
}
.weld-tl { left: var(--ex-left, 0px); top: var(--ex-top, 0px); background-image: linear-gradient(45deg, var(--seam)); }
.weld-tr { right: var(--ex-right, 0px); top: var(--ex-top, 0px); background-image: linear-gradient(135deg, var(--seam)); }
.weld-bl { left: var(--ex-left, 0px); bottom: var(--ex-bottom, 0px); height: var(--ff-bottom, 0px); background-image: linear-gradient(135deg, var(--seam)); }
.weld-br { right: var(--ex-right, 0px); bottom: var(--ex-bottom, 0px); height: var(--ff-bottom, 0px); background-image: linear-gradient(45deg, var(--seam)); }

/*
 * Frame extensions, drawn OUTSIDE the frame in the same contrasting colours the
 * Evolution elevation uses - 45mm yellow, 15mm red - so it is obvious what is
 * being clamped on and where. One span per section, so a 60 reads as a 45 and a
 * 15 stacked.
 */
.addon-bands { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.addon-bands .band {
  position: absolute;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
}

.door-stack {
  position: relative;
  z-index: 1;
  flex: 0 0 292px;
  width: 292px;
  height: 644px;
  background: #dfe4e8;
  overflow: hidden;
  /* the rebate, so a white frame on a white slab still reads as separate.
     --gap is the clearance left showing on an outward door (46mm deduction less
     the 42mm internal face); it paints the 4mm shadow gap between frame and slab.
     It lives at z-index 1, so the frame bars cover it whenever they lap over. */
  box-shadow: 0 0 0 var(--gap, 0px) rgba(0, 0, 0, .55),
              inset 0 0 0 1px rgba(0, 0, 0, .32),
              inset 0 2px 7px rgba(0, 0, 0, .20);
}
.door-stack img { position: absolute; inset: 0; width: 100%; height: 100%; }

/*
 * The Glass layer is a white-background render, not a transparent overlay:
 * multiply blending leaves the slab untouched outside the glazed aperture.
 */
.glass { display: none; mix-blend-mode: multiply; }

/* Letterbox sits inside the slab stack so it mirrors with the handing. */
.letterbox {
  position: absolute;
  height: auto;
  object-fit: fill;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
}
/* a cut-out plate keeps its own proportions inside the registration box */
.letterbox.is-cut { object-fit: contain; }

/* Handle and hinges also live inside the stack, so mirroring is automatic.
   NOTE: this class must not be called `.handle` - that name is used as a tile
   chip modifier and the absolute positioning would blow the chip out. */
.door-handle {
  position: absolute;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .40));
}

/* Drip rail: sits just above the bottom of the slab, coloured to the door. */
.driprail {
  position: absolute;
  border-radius: 2px;
  border: 1px solid #8a8a8a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.hinges { position: absolute; inset: 0; pointer-events: none; }

/* Knockers and spyholes: drawn as symbols where they are actually fitted. */
.hw-extras { position: absolute; inset: 0; pointer-events: none; }
.hw-extras .hw-knocker,
.hw-extras .hw-spyhole {
  position: absolute;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}
/* A photograph dropped into static/hw is fitted inside the same box the drawn
   placeholder occupies, so cropping rules are the only thing to get right. */
.hw-extras .hw-photo {
  object-fit: contain;
  object-position: center;
}
/*
 * A hinge knuckle, drawn so the finish can actually be judged: the colour comes
 * in as --hinge, and the shading is built from it with overlays so one rule
 * works for white, satin silver, chrome, gold and anthracite alike. Flat colour
 * at this size read as a smudge - a white hinge on a white door disappeared.
 */
.hinge {
  position: absolute;
  border-radius: 2px;
  background:
    /* the seam between the two knuckle halves */
    linear-gradient(180deg,
      rgba(255, 255, 255, 0) 49%,
      rgba(0, 0, 0, .45) 49.5%,
      rgba(0, 0, 0, .45) 50.5%,
      rgba(255, 255, 255, .30) 51%,
      rgba(255, 255, 255, 0) 52%),
    /* rolled metal: highlight along the left, shadow down the right */
    linear-gradient(90deg,
      rgba(255, 255, 255, .55) 0%,
      rgba(255, 255, 255, .18) 22%,
      rgba(255, 255, 255, 0) 45%,
      rgba(0, 0, 0, .18) 78%,
      rgba(0, 0, 0, .42) 100%),
    /* cap highlights top and bottom */
    linear-gradient(180deg,
      rgba(255, 255, 255, .45) 0%,
      rgba(255, 255, 255, 0) 14%,
      rgba(0, 0, 0, .10) 86%,
      rgba(0, 0, 0, .34) 100%),
    var(--hinge, #cccccc);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .55),
    0 1px 3px rgba(0, 0, 0, .40);
}

/*
 * Pignose bolts: what a pull bar is clamped with, seen from inside. Two round
 * heads in the bar's own finish, so they read as polished domes rather than
 * flat dots.
 */
.pignose { position: absolute; inset: 0; pointer-events: none; }
.pignose span {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .55),
              inset 0 -1px 2px rgba(0, 0, 0, .45),
              0 0 0 1px rgba(0, 0, 0, .55),
              0 1px 2px rgba(0, 0, 0, .35);
}

.noart {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, #e9edf0, #e9edf0 8px, #dfe4e8 8px, #dfe4e8 16px);
}

.threshold {
  display: none;
  height: 13px;
  background: linear-gradient(180deg, #d8dde1 0%, #a8b0b6 45%, #7d868d 100%);
  border: 1px solid rgba(0, 0, 0, .25);
  border-top: none;
}

/* --------------------------------- quote -------------------------------- */
.total { font-size: 28px; font-weight: 600; letter-spacing: -.5px; margin: 4px 0 4px; }

/* the net figure is the headline; the VAT that sits on top of it is said
   quietly underneath so the number on screen is never read as the gross one */
.total-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }

table.lines { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.lines td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.lines td.num { text-align: right; white-space: nowrap; padding-left: 10px; }
table.lines .note { font-size: 11px; color: var(--muted); margin-top: 2px; }
table.lines tr td:nth-child(2) { color: var(--muted); }

.totals { margin-top: 12px; font-size: 13px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
  .totals div.vat-line { color: var(--muted); }
  .totals div.grand { font-size: 15px; font-weight: 600; }
.totals div:last-child { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 7px; }

/* --------------------------------- modal -------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 26, 36, .48);
}
.modal[hidden] { display: none; }

.modal-card {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(80vh, 720px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(10, 20, 30, .35);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.modal-x {
  font: inherit;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
}
.modal-x:hover { color: var(--ink); }

.modal-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-tools[hidden] { display: none; }
.modal-tools input { margin-top: 0; flex: 1; min-width: 0; }

.btn-reset {
  font: inherit;
  font-size: 12px;
  padding: 6px 11px;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-reset:hover { background: #faf8ee; border-color: #c8c8c4; }
/* the design and glass pickers have nothing to reset to, so the button is
   removed from them rather than sitting there doing nothing */
.btn-reset[hidden] { display: none; }

.modal-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  padding: 14px 16px 18px;
  overflow-y: auto;
}

.modal-ral { padding: 4px 16px 18px; }
.modal-ral[hidden] { display: none; }
.btn-primary {
  font: inherit;
  font-size: 13px;
  margin-top: 4px;
  padding: 8px 16px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }

/* ---------------------------------- tile -------------------------------- */
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 5px 6px;
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
}
.tile:hover { border-color: #c8c8c4; background: #f8f8f6; }
.tile.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(19, 19, 19, .18); }

.tile .chip { width: 100%; height: 34px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .22); }
.tile .chip.is-light { border-color: rgba(0, 0, 0, .38); }
.tile .chip.plate {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: #f4f5f7;
  height: 26px;
}
.tile .chip.handle {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: #f4f5f7;
  height: 44px;
}

/* a drawn stand-in for a finish we hold no photograph for */
.tile .chip.drawn {
  display: block;
  padding: 3px;
  box-sizing: border-box;
}
.tile .chip.drawn svg { width: 100%; height: 100%; display: block; }
/* finishes we hold no artwork for are shown as a plain colour swatch */
.tile .chip.swatch {
  background-image: none !important;
  height: 30px;
}
.tlabel {
  font-size: 10.5px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* ------------------------------ design picking --------------------------- */
/* The design picker shows the real white artwork, because the silhouette and
   the glazing apertures are what tell the designs apart - the names do not. */
.dchip {
  flex: 0 0 26px;
  width: 26px;
  height: 40px;
  border-radius: 3px;
  background: #c3cbd1 no-repeat center/contain;
  border: 1px solid var(--line);
  overflow: hidden;
}
.dchip img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dchip-none { display: block; text-align: center; line-height: 38px; color: var(--muted); }

.modal-tiles.is-design {
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 7px;
}
/*
 * Knocker and spyhole tiles. The drawing is shown large enough to tell the
 * shapes apart - a text list of 27 knockers was unreadable - and the finish is
 * narrowed with the strip above the grid rather than by scrolling the list.
 */
.modal-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-filter[hidden] { display: none; }
.hwf {
  font: inherit;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.hwf:hover { border-color: #c8c8c4; background: #f8f8f6; }
.hwf.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.modal-tiles.is-hw {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 7px;
}
.tile.hwtile { padding: 6px 6px 7px; }
.tile .hwart {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: contain;
}
.tile .hwart-none {
  height: 74px;
  line-height: 74px;
  color: var(--muted);
  font-size: 18px;
}
.dtile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 4px 6px;
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.dtile:hover { border-color: #c8c8c4; background: #f8f8f6; }
.dtile.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(19, 19, 19, .18); }
.dthumb {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: contain;
  /* a white door needs something to sit against or the outline disappears */
  background: #c3cbd1;
  border-radius: 3px;
}
.dthumb.none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  color: var(--muted);
  text-align: center;
}
.dname {
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  /*
   * minmax(0, 1fr) rather than 1fr: a plain 1fr track refuses to shrink below
   * its content's min-width, so the column stayed 392px wide and the page
   * scrolled sideways on a phone instead of reflowing.
   */
  .layout { grid-template-columns: minmax(0, 1fr); }
}

/*
 * Phone / small tablet. One column, nothing allowed to set a min-width, and the
 * price pinned to the foot of the screen so the total stays visible while the
 * options are scrolled - the elevation and the price used to sit below two
 * screens of form.
 */
@media (max-width: 760px) {
  .layout { padding: 10px; gap: 10px; }
  .layout > * { min-width: 0; }
  .panel { padding: 10px 10px 12px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .stage { padding: 16px 34px 8px; }

  /* the bar keeps its switch on the right, the tag drops if there is no room */
  .topbar { padding: 9px 12px; gap: 8px; align-items: center; }
  .topbar h1 { font-size: 14px; min-width: 0; }
  .topbar .tag { display: none; }
  .cost-toggle { margin-left: auto; flex: 0 0 auto; }

  .panel.quote {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -10px -10px;
    border-radius: 0;
    box-shadow: 0 -6px 16px rgba(20, 30, 45, .16);
  }
  .panel.quote h2 { display: none; }
  .panel.quote .total { font-size: 22px; }
}

/*
 * Below about 520px the door fills the stage, so there is no margin left to
 * hang a control on each edge without it sitting on the drawing. The four
 * controls fall back to a row directly under the elevation - still tied to the
 * picture, just no longer overlapping it.
 */
@media (max-width: 560px) {
  .ext-ctl {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 0 2px 2px;
  }
  .ext-ctl .srow,
  .ext-ctl .srow[data-side="head"],
  .ext-ctl .srow[data-side="cill"],
  .ext-ctl .srow[data-side="left"],
  .ext-ctl .srow[data-side="right"] {
    position: static;
    transform: none;
    flex-direction: row;
  }
  /* the rules have nowhere to sit either, so the values become a plain row */
  .dimspace { display: none; }
  .dims {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 0 2px 4px;
  }
  .dim-rule { display: none; }
  .dim { position: static; }
  .stage { padding: 30px 40px 12px; }
}
/* ---------------------------- extentions target -------------------------- */
/* The extender rows and the cill edit whichever frame is selected - the door
   or the coupled light - because an extension usually goes on the light, and a
   cill can sit under one without the other. */
.ext-target {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.ext-target[hidden] { display: none; }
.ext-target .etlabel {
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ext-target .segbtn { flex: 0 0 auto; padding: 4px 12px; }

/* The cill bar: one picker per frame, on its own line under the drawing so it is
   never squeezed against the frame or covered by it. */
.cillbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 4px 2px 2px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .93);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.cillpick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
}
.cillpick .clabel {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.cillpick .cillsel {
  min-width: 150px;
  padding: 5px 7px;
  font: inherit;
  font-size: 12.5px;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .28);
  border-radius: 5px;
}
.cillpick .cillsel:disabled { opacity: .5; }
.cillpick .cnote {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cillbar[hidden] { display: none; }
.schip.is-cill { background: #b9c3ca; }

/* the cill drawn under the frame: a profile in its own right, not an extender */
.addon-bands .band.is-cill {
  background: #b9c3ca;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5);
}

/* The cill: a profile on the floor under the frame, drawn below the threshold
   so a gold or silver threshold and a cill can both be seen at once. */
.cill-band {
  height: 10px;
  background: linear-gradient(180deg, #cfd6da 0%, #aab3b9 40%, #8b949a 100%);
  border: 1px solid rgba(0, 0, 0, .28);
  border-top: none;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 2px 4px rgba(20, 30, 45, .18);
}
.cill-band[hidden] { display: none; }

@media (max-width: 760px) {
  /* the stacked layout is narrow: let each cill picker take its own line rather
     than spilling past the panel */
  .cillbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .cillpick { min-width: 0; flex-wrap: wrap; }
  .cillpick .cillsel { flex: 1 1 auto; min-width: 0; }
  .cillpick .cnote { white-space: normal; }
}

/* --------------------------------------------------- which face is shown -- */
/* Handing is read from outside, so the page says so next to the control and
   again on the drawing itself. */
.viewnote {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.viewtag-inline {
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  white-space: nowrap;
}
.viewtag {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 5;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(19, 19, 19, .92);
  border-radius: 999px;
 box-shadow: 0 1px 3px rgba(20, 30, 45, .25);
  pointer-events: none;
}
.viewtag.is-inside { background: rgba(90, 100, 110, .92); }

/* ------------------------------------------------------------- sign in -- */
/* The one page that is allowed to be loud, and it is a single centred column:
   the trade artwork, the name, then the form. The artwork carries the branding,
   so there is no second colour story around it. */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 36px 20px;
  background: #0d0d0d;
  color: #f2f2ef;
}
.login-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 470px;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: center;
}
.login-brand-art {
  display: block;
  width: 100%;
  border-radius: 6px;
  /* the banner is 820px wide, so it stays sharp at this size */
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.login-brand-title {
  margin: 0;
  font-size: 36px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
}
.login-brand-line {
  margin: 0;
  max-width: 44ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: #b6b6b0;
}

.login-card {
  width: 100%;
  padding: 24px 26px 26px;
  background: #151515;
  border: 1px solid #2b2b2b;
  border-top: 3px solid var(--brand);
  border-radius: 10px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .55);
}
.login-card h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
}
.login-lead {
  margin: 0 0 18px;
  font-size: 13px;
  color: #b6b6b0;
  line-height: 1.5;
}
/* the shared form styling is built for white panels, so it is turned round here */
.login-card label { color: #d9d9d3; }
.login-card input[type=email],
.login-card input[type=password],
.login-card input[type=text] {
  padding: 8px 10px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 5px;
  color: #f4f4f1;
}
.login-card input:focus {
  outline: 2px solid rgba(242, 199, 22, .40);
  border-color: var(--brand);
}
.login-card .hint { color: #94948e; }
.login-card .btn-primary { width: 100%; margin-top: 6px; }
.login-error {
  margin: 0 0 14px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #ffb8ab;
  background: #3a1a15;
  border: 1px solid #6d2c22;
  border-radius: 6px;
}
@media (max-width: 620px) {
  .login-brand-title { font-size: 32px; letter-spacing: .12em; }
  .login-brand-line { font-size: 12.5px; }
  .login-card { padding: 20px 18px 22px; }
}
.login-legal { margin: 0; font-size: 11.5px; }
.login-legal a { color: #8f8f89; text-decoration: none; }
.login-legal a:hover { color: var(--brand); text-decoration: underline; }
/* who is signed in, in the top bar */
.whoami { font-size: 12px; opacity: .8; }
.whoami .org { opacity: .65; }
.logout {
  margin-left: 4px;
  padding: 3px 9px;
  font: inherit;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(242, 199, 22, .82);
  background: rgba(242, 199, 22, .08);
  border: 1px solid rgba(242, 199, 22, .26);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.logout:hover { color: var(--accent-ink); background: rgba(242, 199, 22, .18); }

/* ---------------------------------------------- account and people pages -- */
/* Same bar at the top, one card below it: these pages are about identity, not
   about pricing, so they get no side panels and no elevation. */
.page-wrap {
  max-width: 520px;
  margin: 26px auto 40px;
  padding: 0 16px;
}
.page-wrap.wide { max-width: 860px; }
/* a document rather than a form: the privacy notice needs to read like paper */
.prose { font-size: 13.5px; line-height: 1.62; color: var(--ink); }
.prose h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.prose h3 {
  margin: 22px 0 6px;
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--brand-deep);
}
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.prose-lead { font-size: 14px; }
.prose-meta {
  margin: 0 0 4px;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.prose-address {
  padding: 10px 12px;
  background: #f8f8f6;
  border-left: 3px solid var(--brand);
  border-radius: 4px;
}
.prose code {
  padding: 1px 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  background: #f2f2ee;
  border-radius: 3px;
}
.prose a { color: var(--accent); text-decoration: underline; }
/* a short inserted statement in a document that otherwise quotes existing wording */
.prose-note {
  padding: 10px 12px;
  background: #f8f8f6;
  border-left: 3px solid var(--brand);
  border-radius: 4px;
  font-size: 13px;
}
.prose-back { margin-top: 22px; }
.page-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px 20px;
}
.page-card h2 {
  margin: 0 0 10px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  font-weight: 600;
}
.page-card h3 {
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.facts {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 12px;
  margin: 0 0 6px;
  font-size: 12.5px;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.flash {
  margin: 12px 0;
  padding: 9px 11px;
  font-size: 12.5px;
  border-radius: 6px;
  line-height: 1.45;
}
.flash-ok { color: #14532d; background: #e9f7ee; border: 1px solid #bfe6cd; }
.flash-bad { color: #8c1d18; background: #fdecea; border: 1px solid #f5c6c0; }
.flash-warn { color: #7a4b00; background: #fff5e0; border: 1px solid #f0d9a8; }
.flash p { margin: 4px 0; }
/* importing: the form, then the same page showing what the file would do */
.importform label { display: block; margin: 10px 0; font-size: 12px; color: var(--muted); }
.importform select,
.importform input[type=file],
.importform textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
}
.importform textarea { font-family: Consolas, "Courier New", monospace; }
.importhint { margin: 4px 0 12px; }
.importexample {
  margin: 6px 0 0;
  padding: 8px 10px;
  font-size: 11.5px;
  background: #f8f8f6;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow-x: auto;
}
.import-actions { display: flex; gap: 10px; align-items: center; margin: 14px 0 6px; }
.warn { color: #8c2f26; }

/* rates: one small form per figure, so a single number can be changed
   without posting the whole page back */
.rateform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rainput {
  width: 96px;
  font: inherit;
  font-size: 12.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 4px 6px;
}
.rateunit { font-size: 11.5px; color: var(--muted); min-width: 56px; }
.ratehint { font-size: 11px; color: var(--muted); margin-left: auto; }

/* adding a customer: a fold-out so the list stays the main thing on the page */
.addnew {
  margin: 0 0 16px;
  padding: 0 12px 12px;
  background: #f8f8f6;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.addnew > summary {
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.addnew-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 14px;
  align-items: end;
}
.addnew-form label { font-size: 12px; color: var(--muted); }
.addnew-form input,
.addnew-form select { width: 100%; }
.addnew-form .hint { grid-column: 1 / -1; margin: 2px 0 0; }
.addnew-form .btn-primary { grid-column: 1 / -1; justify-self: start; }
.flash-bad {
  background: #fdf1f0;
  border-color: #e7b9b4;
  color: #8c2f26;
}

.temp-password {
  margin: 6px 0;
  padding: 8px 10px;
  font: 600 17px/1.2 ui-monospace, Consolas, monospace;
  letter-spacing: .12em;
  background: #fff;
  border: 1px dashed #9db4c8;
  border-radius: 6px;
  text-align: center;
  user-select: all;
}

.org-block { margin: 18px 0 6px; }
.org-block h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
}
.org-uplift {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.ptable th {
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}
.ptable td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f4f7;
  vertical-align: middle;
}
.ptable tr.is-off td { color: var(--muted); }
.ptable .actions { white-space: nowrap; text-align: right; }
.ptable .actions form { display: inline-block; margin-left: 6px; }
.btn-small {
  padding: 4px 9px;
  font: inherit;
  font-size: 11.5px;
  color: var(--ink);
  background: #f6f9fc;
  border: 1px solid #cbd6e0;
  border-radius: 5px;
  cursor: pointer;
}
.btn-small:hover { background: #f2f2ee; border-color: #c8c8c4; }

/* ---------------------------------------------------------------- ordering -- */
/* the quotes / orders tabs sit above the list like a pair of folders */
.jobtabs { display: flex; gap: 6px; margin: 0 0 10px; }
.jobtab {
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-decoration: none;
}
.jobtab:hover { border-color: #c8c8c4; color: var(--ink); }
.jobtab.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.jobtab .jobcount { opacity: .75; margin-left: 4px; font-size: 11px; }

.orderblock { margin-top: 14px; }
/* which saved quote is being edited, when the page was opened from one */
.savedstrip {
  margin: 0 0 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--accent);
  background: #faf8ee;
  border: 1px solid #e3d8ae;
  border-radius: 5px;
}
.btn-quote { width: 100%; padding: 7px 10px; }
.orderblock > .btn-primary { width: 100%; }
.orderform {
  margin-top: 4px;
  padding: 10px;
  background: #f8f8f6;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.orderform label { margin-bottom: 8px; }
.orderactions { display: flex; gap: 8px; align-items: center; }
.orderactions .btn-primary { flex: 1 1 auto; }
.hint-inline {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .65;
  margin-left: 4px;
}
textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  resize: vertical;
}
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

/* While the elevation is being captured for the order sheet, everything that is
   a control rather than a part of the drawing is left out of the picture. The
   dimension rules stay: they are part of what the customer is ordering. */
body.is-capturing .lf-caption,
body.is-capturing .viewtag,
body.is-capturing .cassette-banner,
body.is-capturing .addlight,
body.is-capturing .light-panel,
body.is-capturing .ext-ctl,
body.is-capturing .cillbar { display: none !important; }
/* the sheet is white paper, not a screen: the panel's grey would print as a box */
body.is-capturing .stage { background: #fff !important; }
