/* Electrical quote tool, generic demo. The business colour drives --brand and --accent (set from app.js). Plus Jakarta Sans, no italics. */
:root {
  --brand: #16191E;
  --brand-2: #2C323B;
  --brand-3: #1F232A;
  --glow: #2A3039;
  --accent: #F4C430;
  --on-accent: #16191E;
  --mist: #E6E8EC;
  --line-2: #CDD2D9;
  --paper: #F6F7F9;
  --white: #FFFFFF;
  --rule: rgba(22, 25, 30, .12);
  --muted: rgba(22, 25, 30, .58);
  --faint: rgba(22, 25, 30, .36);
  --spring: cubic-bezier(.32, .72, 0, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(120% 60% at 50% -10%, var(--glow) 0%, var(--brand) 55%) fixed, var(--brand);
  color: var(--brand);
  font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'tnum' 1;
  font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease;
}
body.locked { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* ---------- frame ---------- */
.frame { max-width: 780px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px 160px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 10px; }
.app-id { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--white); }
.app-id b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bolt { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.bolt svg { width: 18px; height: 18px; fill: var(--on-accent); }
.top-r { display: flex; align-items: center; gap: 8px; flex: none; }
.gear { width: 38px; height: 38px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .09); display: grid; place-items: center; transition: transform .12s ease, background-color .2s ease; }
.gear:active { transform: scale(.94); }
.gear svg { width: 19px; height: 19px; fill: none; stroke: var(--mist); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sample { margin: 0 2px 14px; font-size: 12.5px; font-weight: 600; color: var(--mist); opacity: .6; }

/* segmented controls, iOS style */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; }
.seg button { border: 0; background: transparent; font-weight: 700; font-size: 13px; padding: 7px 13px; border-radius: 8px; transition: background-color .2s var(--spring), color .2s var(--spring), transform .12s ease; }
.seg button:active { transform: scale(.96); }
.seg.dark { background: rgba(255, 255, 255, .09); }
.seg.dark button { color: rgba(230, 232, 236, .72); }
.seg.dark button.on { background: var(--mist); color: var(--brand); }
.seg.dark #savedCount:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; line-height: 18px; }
.seg.light { background: rgba(255, 255, 255, .1); width: 100%; }
.seg.light button { flex: 1; color: rgba(230, 232, 236, .75); }
.seg.light button.on { background: var(--mist); color: var(--brand); }
@media (max-width: 400px) { .seg button { padding: 7px 10px; } .app-id b { font-size: 15px; } }

/* ---------- the sheet ---------- */
.sheet { background: var(--white); border-radius: 22px; padding: 26px 22px 30px; position: relative;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 30px 70px rgba(0, 0, 0, .35); }
@media (min-width: 640px) { .sheet { padding: 40px 42px 44px; border-radius: 26px; } }

.doc-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; padding-bottom: 20px; border-bottom: 2px solid var(--brand); }
.logo-slot { display: block; border: 0; padding: 0; background: none; text-align: left; max-width: 220px; }
.logo-slot:disabled { cursor: default; }
.logo-slot img { display: block; max-width: 200px; max-height: 76px; width: auto; height: auto; }
.logo-slot .ph { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 184px; height: 72px; border: 1.5px dashed var(--line-2); border-radius: 14px;
  background: repeating-linear-gradient(-45deg, transparent 0 9px, rgba(22, 25, 30, .025) 9px 18px); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  transition: border-color .2s ease, background-color .2s ease, transform .12s ease; }
.logo-slot .ph small { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--faint); margin-top: 3px; }
.logo-slot:not(:disabled):hover .ph { border-color: var(--brand); }
.logo-slot:not(:disabled):active .ph { transform: scale(.98); }
.wordmark { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--brand); }
.brand .co { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.brand .co b { color: var(--brand); font-size: 13px; }
.brand .co .faint { color: var(--faint); }
.doc-kind { text-align: right; }
.doc-kind b { display: block; font-size: 22px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1; }
.doc-kind span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 7px; }

.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin: 4px 0 6px; }
.meta label { display: block; border-bottom: 1px solid var(--rule); padding: 12px 0 8px; }
.meta label > span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.meta input { border: 0; background: transparent; padding: 3px 0 0; width: 100%; font-size: 16px; font-weight: 600; outline: none; }
.meta input::placeholder { color: var(--faint); font-weight: 500; }
.meta input.need::placeholder { color: #B3261E; }
.meta .static { padding-top: 3px; font-size: 16px; font-weight: 600; }
.issued .meta input { pointer-events: none; }

/* ---------- section heads ---------- */
.sec { margin-top: 30px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--brand); }
.sec-head h2 { margin: 0; font-size: 12.5px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sec-head h2 i { font-style: normal; color: var(--line-2); margin-right: 9px; }
.sec-head .sub { font-size: 15px; font-weight: 800; }
.sec-head .note { font-size: 12px; color: var(--muted); }

/* ---------- walkthrough ---------- */
.walk { background: var(--paper); border-radius: 16px; padding: 4px 16px 12px; margin-left: -6px; margin-right: -6px; }
.walk .sec-head { padding-top: 14px; border-bottom-color: var(--rule); }
.walk .row { display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.walk .row:last-of-type { border-bottom: 0; }
.walk .row > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.walk .row.sub { animation: enter .42s var(--spring) both; }
.walk .row.sub > span { color: var(--brand); }
@media (max-width: 559px) {
  .walk .row { grid-template-columns: 1fr; gap: 8px; padding: 12px 0; }
  .walk .row > span { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .meta { grid-template-columns: 1fr; }
  .logo-slot .ph { width: 150px; height: 64px; font-size: 11.5px; }
  .doc-kind b { font-size: 18px; }
}
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts button { border: 1.5px solid var(--rule); background: var(--white); padding: 8px 13px; border-radius: 10px; font-size: 14px; font-weight: 700;
  transition: background-color .2s var(--spring), color .2s var(--spring), border-color .2s var(--spring), transform .12s ease; }
.opts button:active { transform: scale(.96); }
.opts button.on { background: var(--brand); border-color: var(--brand); color: var(--white); }
.opts.multi button.on::before { content: ''; display: inline-block; width: 4px; height: 8px; margin: 0 8px 2px 1px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.steps { display: flex; flex-wrap: wrap; gap: 8px; }
.stp { background: var(--white); border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--rule); padding: 7px 8px 8px; min-width: 116px; }
.stp small { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 0 4px 5px; }
.ctl { display: flex; align-items: center; gap: 2px; }
.ctl button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--paper); font-size: 19px; font-weight: 700; line-height: 1; color: var(--brand); transition: transform .12s ease, background-color .2s ease; }
.ctl button:active { transform: scale(.92); background: var(--line-2); }
.ctl input { width: 46px; border: 0; background: transparent; text-align: center; font-size: 17px; font-weight: 800; outline: none; -moz-appearance: textfield; }
.ctl input::-webkit-outer-spin-button, .ctl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.derived { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; font-weight: 600; }

/* ---------- lines ---------- */
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--rule); transition: opacity .2s ease; }
.issued .line { grid-template-columns: 1fr auto; }
.issued .line.noamt { grid-template-columns: 1fr; }
.line.off { opacity: .42; }
.tick { width: 21px; height: 21px; margin-top: 1px; border: 1.5px solid var(--line-2); border-radius: 7px; padding: 0; background: var(--white); position: relative; transition: background-color .2s var(--spring), border-color .2s var(--spring); }
.line:not(.off) .tick { background: var(--brand); border-color: var(--brand); }
.line:not(.off) .tick::after { content: ''; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.line .name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.issued .line.noamt .name { font-weight: 600; color: var(--brand-2); }
.line .calc { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.line .calc input, .line .calc select { width: 58px; border: 0; border-radius: 7px; background: var(--paper); font-size: 13px; font-weight: 700; padding: 4px 4px; text-align: center; outline: none; color: var(--brand); }
.line .calc input.rate { width: 72px; }
.line .calc select { width: auto; padding: 4px 6px; -webkit-appearance: none; appearance: none; }
.line .calc input:focus, .line .calc select:focus { box-shadow: inset 0 0 0 1.5px var(--brand); }
.line .amt { font-size: 15px; font-weight: 800; text-align: right; white-space: nowrap; padding-top: 1px; }
.line.off .amt { font-weight: 600; font-size: 13px; }
.xname { width: 100%; border: 0; border-bottom: 1.5px dashed var(--line-2); background: transparent; font-size: 15px; font-weight: 700; padding: 2px 0 4px; outline: none; }
.xname:focus { border-bottom-color: var(--brand); }
.link { border: 0; background: none; padding: 2px 4px; color: var(--brand-2); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: #B3261E; margin-left: 4px; }
.addrow { padding: 10px 0 0; }
.add { border: 1.5px dashed var(--line-2); background: transparent; border-radius: 12px; width: 100%; padding: 12px; font-weight: 800; font-size: 14px; color: var(--brand-2); transition: background-color .2s ease; }
.add:hover { background: var(--paper); }

/* a figure that just changed draws a short underline */
.amt, .sub { background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 100% 100%; background-size: 0 3px; }
.inked { animation: ink .9s var(--spring); }
@keyframes ink { 0% { background-size: 0 3px; } 35% { background-size: 100% 3px; } 100% { background-size: 100% 0; } }
.line.enter { animation: enter .42s var(--spring) both; }
@keyframes enter { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- totals ---------- */
.totals { margin-top: 30px; border-top: 2px solid var(--brand); }
.totals .t { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.totals .t span { color: var(--muted); font-weight: 600; }
.totals .t b { font-weight: 700; }
.totals .t.grand { border-bottom: 0; padding-top: 14px; font-size: 22px; }
.totals .t.grand span { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.totals .t.grand b { font-weight: 800; letter-spacing: -.01em; }
.totals .t.dep { border-top: 1px solid var(--rule); border-bottom: 0; font-size: 14px; }

/* ---------- dock ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; z-index: 10; }
.dock-in { max-width: 780px; margin: 0 auto; display: flex; gap: 8px; pointer-events: auto; }
.plate { flex: 1; border-radius: 18px; padding: 11px 18px; min-height: 64px; display: flex; flex-direction: column; justify-content: center;
  background: color-mix(in srgb, var(--brand-3) 84%, transparent); color: var(--mist); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 0 0 1px rgba(230, 232, 236, .14), 0 12px 30px rgba(0, 0, 0, .3); }
.plate small { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.plate strong { font-size: 25px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; color: var(--white); }
.act { border: 0; border-radius: 18px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 15px; padding: 0 22px; min-height: 64px; max-width: 52vw;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3); transition: transform .12s ease, background-color .2s ease; }
.act:active { transform: scale(.97); }

/* ---------- issued ---------- */
.stamp { position: absolute; width: 128px; transform: rotate(-8deg); color: var(--brand-2); opacity: 0; pointer-events: none; }
.issued .stamp { animation: stamp .5s var(--spring) .1s forwards; }
@keyframes stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.25); } to { opacity: .88; transform: rotate(-8deg) scale(1); } }
.terms { margin-top: 26px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.terms p { margin: 0 0 8px; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 64px; }
.sign .seal { position: relative; }
.sign .seal .stamp { bottom: 16px; right: -4px; }
.sign div { border-top: 1px solid var(--brand); padding-top: 6px; font-size: 12px; color: var(--muted); }

.share { margin-top: 16px; padding: 16px; border-radius: 20px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(230, 232, 236, .1); }
.share-label { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(230, 232, 236, .65); }
.send { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.send button, .send a { border: 0; border-radius: 14px; background: var(--mist); color: var(--brand); text-decoration: none; text-align: center; font-weight: 800; font-size: 15px; padding: 15px 10px; transition: transform .12s ease; }
.send button:active, .send a:active { transform: scale(.97); }
.send .wide { grid-column: 1 / -1; background: var(--accent); color: var(--on-accent); }
.hint { color: var(--mist); opacity: .75; font-size: 13px; text-align: center; margin: 14px 0 0; word-break: break-all; }

/* ---------- your business sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s ease both; }
.biz { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 22px 22px 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom));
  animation: rise .45s var(--spring) both; }
@media (min-width: 640px) { .scrim { align-items: center; } .biz { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.biz::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 10px; }
.biz-head { display: flex; align-items: center; justify-content: space-between; }
.biz h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.done { border: 0; border-radius: 11px; background: var(--brand); color: var(--white); font-weight: 800; padding: 9px 16px; }
.biz-note { margin: 4px 0 16px; font-size: 13px; color: var(--muted); }
.biz-logo { display: flex; align-items: center; gap: 14px; background: var(--white); border-radius: 14px; padding: 12px; }
.biz-prev { width: 120px; height: 60px; border-radius: 10px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.biz-prev span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.biz-prev img { max-width: 108px; max-height: 50px; }
.biz-logo-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pick { display: inline-block; border-radius: 11px; background: var(--brand); color: var(--white); font-weight: 800; font-size: 14px; padding: 10px 14px; cursor: pointer; }
.group { margin-top: 12px; background: var(--white); border-radius: 14px; padding: 0 14px; }
.group label { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.group label:last-child { border-bottom: 0; }
.group label span { font-size: 14px; font-weight: 700; }
.group input { border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 600; min-width: 0; text-align: right; }
.group input::placeholder { color: var(--faint); font-weight: 500; }
.biz-label { margin: 18px 4px 8px; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sw { border: 0; background: var(--white); border-radius: 14px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s ease, transform .12s ease; }
.sw:active { transform: scale(.95); }
.sw.on { box-shadow: inset 0 0 0 2px var(--brand); }
.sw i { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 55%, var(--b) 55%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.sw span { font-size: 11px; font-weight: 700; color: var(--muted); }
@media (max-width: 400px) { .group label { grid-template-columns: 1fr; gap: 2px; } .group input { text-align: left; } }

/* ---------- saved quotes ---------- */
.saved { color: var(--mist); }
.saved-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 16px; }
.saved h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--white); }
.new { border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 800; padding: 10px 14px; }
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qlist button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; border: 0; border-radius: 16px; padding: 15px 16px;
  background: rgba(255, 255, 255, .07); color: var(--mist); transition: background-color .2s ease, transform .12s ease; }
.qlist button:active { transform: scale(.985); }
.qlist b { display: block; color: var(--white); font-size: 16px; }
.qlist small { display: block; font-size: 12.5px; opacity: .65; margin-top: 2px; }
.qlist strong { font-size: 17px; color: var(--white); white-space: nowrap; }
.empty { opacity: .7; }
.fine { font-size: 12px; opacity: .5; margin-top: 18px; }

.credit { text-align: center; font-size: 12px; color: var(--mist); opacity: .5; margin-top: 26px; }
.credit a { color: inherit; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .issued .stamp { opacity: .88; }
}
@media (prefers-reduced-transparency: reduce) { .plate { background: var(--brand-3); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---------- print: the quote as a PDF ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .topbar, .sample, .dock, .share, .hint, .credit, .no-print, .saved, .scrim { display: none !important; }
  .frame { padding: 0; max-width: none; }
  .sheet { box-shadow: none; padding: 0; border-radius: 0; }
  .stamp { opacity: .88 !important; animation: none !important; }
  .line, .sec { break-inside: avoid; }
}
