/* app-shell.css — the Dealer Connect pages wearing their APP face.
 *
 * Every rule here is scoped to `html.app`, which app-shell.js sets only
 * inside the Dealer Connect app (or on ?app=1 for a preview). The browser
 * page is untouched. Nothing here removes a control or changes what one
 * does: the same buttons, fields, tables and sheets, drawn the way an
 * installed app draws them — a top bar that stays put under the status bar,
 * 48 px targets, chips instead of boxed segments, cards without hairlines,
 * pop-ups as sheets from the bottom, type set in the phone's own face.
 * test/app-shell.js holds the scoping and the no-hiding rule.
 *
 * Tokens are the pages' own (--ground/--surface/--accent on the quoting and
 * plant pages, --bg/--card/--blue on login), with fallbacks to the house
 * colours, so a workspace theme (theme.css) still shows through.
 */

/* ── type and ground ─────────────────────────────────────────────────────── */
html.app body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, Roboto, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html.app h1, html.app h2, html.app h3 { letter-spacing: -0.02em; text-wrap: balance; }
html.app .num, html.app .totals, html.app .lines td.num, html.app .lines th.num, html.app .price, html.app .ext { font-variant-numeric: tabular-nums; }
html.app .hint, html.app .ac-sub, html.app .brand p { font-size: 14px; }
html.app .wrap { padding-top: 0; }

/* ── the top bar: stays put, sits under the status bar, blurs what scrolls under it ── */
html.app header.top {
  position: sticky; top: 0; z-index: 40;
  margin: 0 calc(-1 * max(clamp(14px, 3vw, 32px), env(safe-area-inset-left, 0px))) 14px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  gap: 12px;
  background: color-mix(in srgb, var(--ground, #f3f0e9) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line, #e1dbcc) 70%, transparent);
}
html.app header.top .logo { height: 34px; }
html.app header.top .brand { border-left: 0; padding-left: 0; }
html.app header.top .brand h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
html.app header.top .brand p { display: none; }                 /* the tagline; the contact line below keeps its own id and shows when set */
html.app header.top .brand p#acctContact { display: block; font-size: 12.5px; }
/* The actions become one row of chips that scrolls sideways: every button stays, none wraps the bar taller. */
html.app header.top .top-right {
  flex: 1 0 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
  gap: 8px; padding: 2px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
html.app header.top .top-right::-webkit-scrollbar { display: none; }
html.app header.top .top-right > * { flex: none; scroll-snap-align: start; }
html.app header.top .btn.small, html.app header.top .badge {
  min-height: 36px; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center;
}
html.app header.top .btn.small.ghost { background: var(--surface, #fff); border-color: var(--line, #e1dbcc); color: var(--ink, #1c1608); }
html.app header.top .badge { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* ── the signed-in row above the header: one line of chips under the status bar ── */
html.app #sessionCtl {
  flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 6px max(14px, env(safe-area-inset-left, 0px));
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
html.app #sessionCtl::-webkit-scrollbar { display: none; }
html.app #sessionCtl > * { flex: none; }
html.app #sessionCtl .btn.small, html.app #sessionCtl .badge, html.app #sessionCtl button { min-height: 36px; border-radius: 999px; font-size: 14px; }
html.app #sessionCtl #whoAmI { text-transform: none; letter-spacing: 0; font-size: 13px; }
/* Inside the installed app, an "Install app" button is the one control that has no meaning. */
html.app #btnInstall, html.app #installWrap { display: none; }
/* With the signed-in row already carrying the status bar's inset, the sticky header only needs it once it is stuck. */
html.app #sessionCtl + .wrap header.top { padding-top: 10px; }

/* ── cards: a surface, not a boxed form ─────────────────────────────────── */
html.app .card {
  border: 0; border-radius: 18px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink, #1c1608) 5%, transparent), 0 12px 32px -18px color-mix(in srgb, var(--ink, #1c1608) 30%, transparent);
}
html.app .card-h { padding: 18px 18px 8px; border-bottom: 0; }
html.app .card-h h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
html.app .step { font-size: 11px; opacity: .8; }
html.app .card-b { padding: 8px 18px 18px; }
html.app .cols { gap: 16px; }

/* ── fields: tall, soft, 16 px so Safari never zooms ────────────────────── */
html.app label.lbl { font-size: 12px; letter-spacing: .04em; margin-bottom: 8px; }
html.app input[type=text], html.app input[type=number], html.app input[type=email], html.app input[type=tel], html.app input[type=password], html.app select, html.app textarea {
  min-height: 48px; padding: 12px 14px; border-radius: 12px; font-size: 16px;
  border: 1px solid transparent; background: var(--surface-2, #eae4d6);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
html.app input:focus-visible, html.app select:focus-visible, html.app textarea:focus-visible {
  outline: none; border-color: var(--accent, #8a5d00); background: var(--surface, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #8a5d00) 22%, transparent);
}
html.app .field { margin-bottom: 18px; }

/* ── choices as chips, pressed on the way down ──────────────────────────── */
html.app .seg { gap: 8px; }
html.app .seg button {
  min-height: 44px; padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 600;
  background: var(--surface-2, #eae4d6); border-color: transparent; color: var(--ink, #1c1608);
}
html.app .seg button.on { background: var(--accent, #8a5d00); color: var(--accent-ink, #fff); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent, #8a5d00) 70%, transparent); }
html.app .seg button:active:not(:disabled) { transform: scale(.96); }
html.app .hand-opt { border-radius: 12px; }

/* ── buttons ────────────────────────────────────────────────────────────── */
html.app .btn { min-height: 48px; border-radius: 14px; font-size: 16px; font-weight: 600; padding: 12px 18px; border-color: transparent; }
html.app .btn.primary { box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent, #8a5d00) 80%, transparent); }
html.app .btn.small { min-height: 40px; border-radius: 12px; font-size: 15px; padding: 8px 14px; }
html.app .btn.ghost { background: transparent; border-color: var(--line, #e1dbcc); }
html.app .btn:active:not(:disabled) { transform: scale(.97); }
/* "Add to quote" stays within reach while the builder scrolls. */
html.app #btnAdd { margin-top: 18px; box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--accent, #8a5d00) 85%, transparent); }
html.app #btnAdd:disabled { opacity: 1; background: var(--surface-2, #eae4d6); color: var(--ink-3, #9a9080); box-shadow: none; }

/* ── the quote lines ────────────────────────────────────────────────────── */
html.app .lines td, html.app .lines th { padding: 12px 10px; }
html.app .lines th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2, #6d6454); }
html.app .empty { padding: 36px 16px; text-align: center; border-radius: 14px; background: var(--surface-2, #eae4d6); color: var(--ink-2, #6d6454); font-size: 15px; }
html.app .totals { font-size: 16px; }

/* ── photos and the visualizer ──────────────────────────────────────────── */
html.app .photo { border-radius: 14px; overflow: hidden; }
html.app #vizOverlay .btn.small { min-height: 44px; font-size: 15px; }
html.app #vizOverlay input[type=range] { height: 44px; }
html.app #arOverlay button, html.app #vizOverlay .seg button { min-height: 44px; }

/* ── pop-ups become sheets from the bottom ──────────────────────────────── */
html.app #emailOverlay, html.app #newCustOverlay, html.app #repOverlay, html.app #submitOverlay,
html.app #termsOverlay, html.app #discountOverlay, html.app #notifyOverlay, html.app #gcOverlay {
  align-items: flex-end; padding: 0; background: rgba(12, 20, 26, .5);
}
html.app #emailOverlay > :first-child, html.app #newCustOverlay > :first-child, html.app #repOverlay > :first-child,
html.app #submitOverlay > :first-child, html.app #termsOverlay > :first-child, html.app #discountOverlay > :first-child,
html.app #notifyOverlay > :first-child, html.app #gcOverlay > :first-child {
  /* !important: these panels carry their own inline max-width and radius. */
  width: 100% !important; max-width: none !important; margin: 0 !important;
  border-radius: 22px 22px 0 0 !important; border: 0 !important;
  max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, .5);
  animation: app-sheet-in .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes app-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html.app * { animation: none !important; } }

/* ── the sign-in page (its own tokens) ──────────────────────────────────── */
html.app body:has(> main.card #loginForm) {
  padding: 0; align-items: end;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, #f2b01e 28%, var(--bg, #f3f0e9)) 0%, var(--bg, #f3f0e9) 60%);
}
html.app main.card:has(#loginForm) {
  max-width: none; width: 100%; border: 0; border-radius: 26px 26px 0 0;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -16px 48px -20px rgba(0, 0, 0, .35);
}
html.app main.card:has(#loginForm) input { min-height: 50px; font-size: 16px; border-radius: 12px; }
html.app main.card:has(#loginForm) button { min-height: 50px; border-radius: 14px; font-size: 16px; font-weight: 600; }
html.app main.card:has(#loginForm) .wordmark { font-size: 34px; }

/* ── small screens get the room the phone has ───────────────────────────── */
@media (max-width: 720px) {
  html.app .wrap { padding-left: 12px; padding-right: 12px; }
  html.app header.top { margin-left: -12px; margin-right: -12px; }
  html.app .card-h, html.app .card-b { padding-left: 16px; padding-right: 16px; }
}

/* ══ THE FLOW: three tabs and a More sheet (app-shell.js builds them) ═════════ */

/* One view at a time: the attribute the script sets names the tab that shows. */
html.app[data-tab="build"] .cols > section:not(#builderCard), html.app[data-tab="build"] #savedCard,
html.app[data-tab="quote"] .cols > section#builderCard, html.app[data-tab="quote"] #savedCard,
html.app[data-tab="saved"] .cols > section { display: none; }
html.app[data-tab="saved"] #savedCard { display: block; }
html.app[data-tab] .cols { display: block; }
html.app .app-tab-in { animation: app-tab-in .22s ease-out; }
@keyframes app-tab-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* The header's actions live in the More sheet now; the header keeps the badges. The
   signed-in row is emptied into the sheet as well (whoAmI + the buttons), so it folds. */
html.app #sessionCtl { display: none; }
html.app header.top .top-right:empty { display: none; }
html.app header.top .top-right { flex: 1 1 auto; padding-top: 0; }
html.app .app-hidden-by-tab { display: none !important; }   /* beats the header's own .btn.small rule */           /* the header's "Saved quotes" button: the Saved tab is that button */

/* Room for the bar. */
html.app .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
html.app #btnAdd { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

/* The tab bar. */
html.app .app-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface, #fff) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid color-mix(in srgb, var(--line, #e1dbcc) 80%, transparent);
}
html.app .app-tab {
  position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 52px; padding: 6px 4px 4px; border: 0; background: none; color: var(--ink-3, #9a9080);
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .01em; border-radius: 12px;
  transition: color .15s ease, transform .1s ease-out;
}
html.app .app-tab svg { width: 24px; height: 24px; }
html.app .app-tab.on { color: var(--accent, #8a5d00); }
html.app .app-tab:active { transform: scale(.94); }
html.app .app-tab-badge {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent, #8a5d00); color: var(--accent-ink, #fff);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}

/* The More sheet. */
html.app .app-more { position: fixed; inset: 0; z-index: 95; background: rgba(12, 20, 26, .5); display: flex; align-items: flex-end; }
html.app .app-more[hidden] { display: none; }
html.app .app-more-sheet {
  width: 100%; max-height: 88dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface, #fff); color: var(--ink, #1c1608);
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(84px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, .5); animation: app-sheet-in .28s cubic-bezier(.2, .8, .2, 1);
}
html.app .app-more-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line, #e1dbcc); margin: 4px auto 14px; }
/* Who you are, where prices come from, how access works. They are flex items in
   a row that wraps: without flex:none the long one is squeezed into a circle of
   wrapped words. */
html.app .app-more-who { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 4px; }
html.app .app-more-who > * {
  flex: none !important; white-space: nowrap; text-transform: none; letter-spacing: 0;
  font-size: 12.5px !important; font-weight: 600; border-radius: 999px !important;
  padding: 5px 12px !important; min-height: 30px !important;
}
html.app .app-more-group { margin: 14px 0 0; }
html.app .app-more-group h3 { margin: 0 0 8px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3, #9a9080); }
html.app .app-more-list { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2, #eae4d6); border-radius: 14px; padding: 4px; }
html.app .app-more-list > *, html.app .app-more-list button {
  width: 100%; text-align: left; justify-content: flex-start; min-height: 50px; border-radius: 11px !important; border: 0 !important;
  background: var(--surface, #fff) !important; color: var(--ink, #1c1608) !important; font-size: 16px !important; font-weight: 500 !important; padding: 12px 14px !important;
  box-shadow: none !important;
}
html.app .app-more-list > span { display: block; padding: 0 !important; background: none !important; }
html.app .app-more-list button:active { background: var(--surface-2, #eae4d6) !important; }
html.app .app-more-list #btnLogout { color: var(--danger, #b3261e) !important; }
html.app.app-more-open { overflow: hidden; }

/* The toast: a line landed from Build. */
html.app .app-toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 92;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 12px 14px 12px 18px; border-radius: 16px; background: var(--ink, #1c1608); color: var(--ground, #f3f0e9);
  font-size: 15px; font-weight: 500; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .55);
}
html.app .app-toast[hidden] { display: none; }
html.app .app-toast-in { animation: app-toast-in .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes app-toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
html.app .app-toast-go { border: 0; background: none; color: #f2b01e; font: inherit; font-weight: 700; padding: 6px 4px; min-height: 36px; }

/* ══ TABLES BECOME CARDS ════════════════════════════════════════════════════
 * A table is a desktop idea: eight columns on a 390 px screen is a sideways
 * scroll with the number cut off, which is what the quote lines and the saved
 * list were. The same <table> markup is laid out as cards instead — no column
 * is dropped, each is labelled where it needs one, and the row's own buttons
 * sit along the bottom. Print puts the tables back (below).
 */
html.app .lines-scroll { overflow: visible; }
html.app table.lines, html.app table.lines tbody, html.app table.lines tr, html.app table.lines td { display: block; }
html.app table.lines thead { display: none; }
html.app table.lines { border-collapse: separate; border-spacing: 0; width: 100%; }
html.app table.lines tr {
  position: relative; margin: 0 0 10px; padding: 14px 14px 10px; border-radius: 16px;
  background: var(--surface-2, #eae4d6); border: 0;
}
html.app table.lines tr:last-child { margin-bottom: 0; }
html.app table.lines td { padding: 0; border: 0; text-align: left; }
html.app table.lines td:empty { display: none; }
html.app table.lines .row-acts { position: static; background: none; box-shadow: none; }

/* The quote's lines: index, item, size, qty, price, extension, buttons. */
html.app #linesTable tr { padding-top: 34px; }
html.app #linesTable td:nth-child(1) {                    /* the line number, as a chip in the corner */
  position: absolute; top: 12px; left: 14px; min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--surface, #fff); color: var(--ink-2, #6d6454);
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
html.app #linesTable td:nth-child(2) { margin-bottom: 10px; }
html.app #linesTable td:nth-child(3), html.app #linesTable td:nth-child(4),
html.app #linesTable td:nth-child(5), html.app #linesTable td:nth-child(6) {
  /* Two to a row. inline-block at a flat 50% is over 100% once the whitespace
     between the cells is counted, and they stack one per line. */
  display: inline-block; vertical-align: top; width: calc(50% - 6px); margin-right: 4px;
  padding: 4px 0; font-variant-numeric: tabular-nums; font-size: 15px;
}
html.app #linesTable td:nth-child(3)::before { content: "Made size"; }
html.app #linesTable td:nth-child(4)::before { content: "Qty"; }
html.app #linesTable td:nth-child(5)::before { content: "Price"; }
html.app #linesTable td:nth-child(6)::before { content: "Extension"; }
html.app #linesTable td:nth-child(6) { font-weight: 700; }
html.app #linesTable td:nth-child(n+3):nth-child(-n+6)::before {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3, #9a9080); margin-bottom: 1px;
}
html.app #linesTable .row-acts {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--ink, #1c1608) 8%, transparent);
}
html.app #linesTable .row-acts button, html.app #linesTable .row-acts .del {
  flex: 1 1 auto; min-height: 42px; min-width: 42px; border-radius: 11px;
  background: var(--surface, #fff); border: 0; font-size: 16px;
}

/* Saved quotes: number, customer, reference, lines, total, saved, OJ #, buttons. */
html.app #savedTable tr { padding-top: 14px; }
html.app #savedTable td:nth-child(1) { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
html.app #savedTable td:nth-child(2) { color: var(--ink, #1c1608); font-size: 15px; margin-top: 2px; }
html.app #savedTable td:nth-child(3) { color: var(--ink-2, #6d6454); font-size: 14px; }
html.app #savedTable td:nth-child(4), html.app #savedTable td:nth-child(5),
html.app #savedTable td:nth-child(6), html.app #savedTable td:nth-child(7) {
  display: inline-block; vertical-align: top; width: calc(50% - 6px); margin-right: 4px;
  padding: 8px 0 0; font-size: 14px; font-variant-numeric: tabular-nums;
}
html.app #savedTable td:nth-child(4)::before { content: "Windows"; }
html.app #savedTable td:nth-child(5)::before { content: "Customer total"; }
html.app #savedTable td:nth-child(6)::before { content: "Saved"; }
html.app #savedTable td:nth-child(7)::before { content: "Order #"; }
html.app #savedTable td:nth-child(5) { font-weight: 700; font-size: 15px; }
html.app #savedTable td:nth-child(n+4):nth-child(-n+7)::before {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3, #9a9080);
}
html.app #savedTable .row-acts {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; white-space: normal !important;
  border-top: 1px solid color-mix(in srgb, var(--ink, #1c1608) 8%, transparent);
}
html.app #savedTable .row-acts > * { flex: 1 1 auto; min-height: 42px; border-radius: 11px !important; background: var(--surface, #fff) !important; border: 0 !important; font-size: 15px !important; }
/* The saved list's sort control: app-shell.js moves this <th> out of the hidden
   header and beside the search box, so the cards cost no control. */
html.app .app-saved-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
html.app .app-saved-tools #savedSearch { flex: 1 1 auto; margin-bottom: 0 !important; }
html.app .app-sort-chip {
  flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px;
  border-radius: 12px; background: var(--surface-2, #eae4d6); color: var(--ink-2, #6d6454);
  font-size: 14px; font-weight: 600; white-space: nowrap; border: 0;
}
html.app .app-sort-chip:active { transform: scale(.97); }

/* ══ THE SAVE ROW, WITHIN REACH ════════════════════════════════════════════ */
html.app .save-row {
  position: sticky; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 6;
  display: flex; gap: 8px; margin: 14px -4px 0; padding: 10px 4px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 16px;
}
/* Three buttons sharing one line is four lines of wrapped words on a phone
   ("Save quote & get number"). The primary takes its own line; the other two
   share the one below. */
html.app .save-row { flex-wrap: wrap; }
html.app .save-row .btn { margin-top: 0; min-height: 50px; font-size: 15px; padding: 12px 14px; white-space: nowrap; }
html.app .save-row .btn.primary { flex: 1 0 100%; }
html.app .save-row .btn:not(.primary) { flex: 1 1 0; min-width: 0; font-size: 14px; }

/* ══ SMALLER THINGS THAT READ AS CARE ══════════════════════════════════════ */
html.app .foot { font-size: 13px; line-height: 1.5; color: var(--ink-2, #6d6454); background: var(--surface-2, #eae4d6); border-radius: 14px; padding: 14px; margin-top: 18px; }
html.app .hint { color: var(--ink-2, #6d6454); }
html.app .photo-grid { gap: 10px; }
html.app .totals .row { padding: 5px 0; font-size: 15px; }
html.app .totals .row.big { font-size: 22px; letter-spacing: -0.02em; padding-top: 10px; margin-top: 4px; border-top: 1px solid color-mix(in srgb, var(--ink, #1c1608) 8%, transparent); }
html.app .cust-chip { min-height: 36px; border-radius: 999px; font-size: 14px; }
html.app .win-thumb svg { border-radius: 8px; }
html.app .item-name { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
html.app .item-sub { font-size: 13.5px; line-height: 1.45; color: var(--ink-2, #6d6454); }
html.app .money-panel { gap: 14px; }
html.app .card + .card { margin-top: 16px; }

/* Printing from the app puts the tables back: a quote is paper, not a phone. */
@media print {
  html.app table.lines, html.app table.lines tbody, html.app table.lines tr, html.app table.lines td, html.app table.lines thead { display: revert; }
  html.app #linesTable td::before, html.app #savedTable td::before { content: none; }
  html.app .app-tabs, html.app .app-more, html.app .app-toast { display: none; }
  html.app .cols > section, html.app #savedCard { display: revert !important; }
  html.app .save-row { position: static; }
}

/* ══ THE BUILD FORM IN FOUR STEPS ═══════════════════════════════════════════
 * app-shell.js moves the page's own fields into four steps and puts the
 * window's drawing on a bar at the top. Nothing is removed; a step not on
 * screen is put away with [hidden], which the page's own show/hide inside it
 * is unaffected by.
 */
html.app .app-step[hidden] { display: none; }
html.app .app-steps {
  position: sticky; top: 0; z-index: 8;
  display: flex; gap: 6px; margin: 0 -16px 2px; padding: 10px 16px 8px;
  background: var(--surface, #fff);
  overflow-x: auto; scrollbar-width: none;
}
html.app .app-steps::-webkit-scrollbar { display: none; }
html.app .app-step-chip {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 6px 13px 6px 7px; border: 0; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2, #eae4d6); color: var(--ink-2, #6d6454);
  font: inherit; font-size: 13px; font-weight: 600;
  transition: background .15s ease, color .15s ease, transform .1s ease-out;
}
html.app .app-step-chip:active { transform: scale(.96); }
html.app .app-step-chip .app-step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--ink, #1c1608) 10%, transparent); color: var(--ink-2, #6d6454);
}
html.app .app-step-chip.done { color: var(--accent, #8a5d00); }
html.app .app-step-chip.done .app-step-n { background: color-mix(in srgb, var(--accent, #8a5d00) 18%, transparent); color: var(--accent, #8a5d00); }
html.app .app-step-chip.on { background: var(--accent, #8a5d00); color: var(--accent-ink, #fff); }
html.app .app-step-chip.on .app-step-n { background: color-mix(in srgb, #000 22%, transparent); color: var(--accent-ink, #fff); }

/* The window being built, always on screen from the Window step on. */
html.app .app-preview-bar {
  position: sticky; top: 56px; z-index: 7;
  display: flex; align-items: center; justify-content: center;
  margin: 0 -16px 8px; padding: 6px 16px 10px; min-height: 76px;
  background: linear-gradient(var(--surface, #fff) 70%, transparent);
}
html.app .app-preview-bar[hidden] { display: none; }
html.app .app-preview-bar .win-preview { margin: 0; }
html.app .app-preview-bar .win-preview svg { max-height: 68px; width: auto; }

/* Back / Next at the foot of each step. */
html.app .app-step-nav { display: flex; gap: 8px; margin-top: 20px; }
html.app .app-step-nav .btn { margin-top: 0; min-height: 50px; }
html.app .app-step-nav .app-step-next { flex: 1 1 auto; }
html.app .app-step-nav .app-step-back { flex: 0 0 auto; padding-left: 20px; padding-right: 20px; }

/* A notice about something this portal does not offer is not a section. */
html.app .app-unavailable { display: none; }

/* ══ LABELS IN WORDS, NOT CAPITALS ══════════════════════════════════════════
 * JOB REFERENCE & PO, SERIES, LITES, MODEL — twelve shouted labels down one
 * form reads dense and dated. Sentence case, a little heavier, a little
 * quieter. (The print copy keeps the page's own styling: see @media print.)
 */
html.app label.lbl, html.app span.lbl {
  text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600;
  color: var(--ink-2, #6d6454); margin-bottom: 7px;
}
html.app .step { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
html.app #linesTable td::before, html.app #savedTable td::before,
html.app #linesTable th, html.app #savedTable th { text-transform: none !important; letter-spacing: .01em !important; }

/* The chips row scrolls; app-shell.js keeps the one you are on in view, and the
   right edge fades so it reads as more-to-the-side rather than cut off. */
html.app .app-steps { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
html.app .app-step-chip:last-child { margin-right: 14px; }

/* ══ THE CAMERA, WHERE IT CANNOT BE MISSED ══════════════════════════════════
 * This app exists to quote a window from a photo of it, and once the form was
 * split into steps that door sat at the foot of the last step. It is now two
 * presses of ONE element (#btnCameraStart, the page's own): the raised button
 * in the middle of the tab bar, and the lead of the build form.
 */
html.app .app-tab[data-tab="camera"] { position: relative; }
html.app .app-tab[data-tab="camera"] svg {
  width: 54px; height: 54px; margin-top: -22px; padding: 14px; border-radius: 999px;
  background: var(--accent, #8a5d00); color: var(--accent-ink, #fff);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent, #8a5d00) 90%, transparent),
              0 0 0 5px var(--surface, #fff);
  transition: transform .1s ease-out;
}
html.app .app-tab[data-tab="camera"].on svg, html.app .app-tab[data-tab="camera"] { color: var(--ink-3, #9a9080); }
html.app .app-tab[data-tab="camera"] svg { color: var(--accent-ink, #fff); }
html.app .app-tab[data-tab="camera"]:active svg { transform: scale(.94); }

html.app .app-camera-first { margin: 2px 0 14px; }
html.app .app-camera-first #btnCameraStart {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 18px; border: 0; border-radius: 16px;
  background: var(--accent, #8a5d00); color: var(--accent-ink, #fff);
  font-size: 16px; font-weight: 650; letter-spacing: -0.01em;
  box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--accent, #8a5d00) 90%, transparent);
}
html.app .app-camera-first #btnCameraStart:active { transform: scale(.98); }
html.app .app-camera-sub { margin: 8px 2px 0; font-size: 13px; line-height: 1.4; color: var(--ink-2, #6d6454); text-align: center; }

/* The ways to a size, in the Size step, as a group rather than loose chips. */
html.app .app-measure-head { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2, #6d6454); }
html.app .app-measure-row { flex-direction: column; gap: 8px !important; margin-top: 0 !important; }
html.app .app-measure-row .btn.small {
  width: 100%; justify-content: flex-start; text-align: left; min-height: 50px;
  border-radius: 13px; font-size: 15px; background: var(--surface-2, #eae4d6); border: 0;
}
