/*
 * Talk to Quote, the prototype, wave 4b. Only what the rest of the app needs and
 * app.css does not have: Settings rows, value fields with units, the switch, the
 * before-and-after of a change, the compact question sheet, the price book's
 * hero and rate rows, and import. Tokens from ../tokens.css; nothing new there.
 */

/* Words and marks */
.tint-text { color: var(--tint); }
.row-title.danger { color: var(--red); }
.mine-text { color: var(--mine); font-weight: 600; }
.inline-i { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; --icon-stroke: 2.2; }
.screen-lead { margin: 6px 20px 0; }
.page-sub { margin-top: 2px; }
.priv-foot { display: flex; align-items: center; gap: 6px; }
.priv-foot .i { width: 15px; height: 15px; --icon-stroke: 2.2; }

/* His business at the top of Settings */
.row.profile { --inset: 88px; padding-top: 12px; padding-bottom: 12px; }
.avatar-lg { width: 60px; height: 60px; border-radius: 30px; flex: none; display: grid; place-items: center; color: var(--on-mono); font-size: var(--text-title3); font-weight: 600;
  background-color: var(--mono-a); background-image: linear-gradient(180deg, var(--mono-a), var(--mono-b)); letter-spacing: 0.02em; }

/* Yours: green, with its badge. An estimate keeps its amber * (app.css .star). */
.yours-tag { display: inline-flex; align-items: center; gap: 3px; flex: none; color: var(--mine); font-size: var(--text-sub); font-weight: 600; }
.yours-tag .i { width: 17px; height: 17px; --icon-stroke: 2.2; }
.yours-dot { display: inline-grid; place-items: center; color: var(--mine); margin-left: 4px; vertical-align: -3px; }
.yours-dot .i { width: 17px; height: 17px; --icon-stroke: 2.2; }
.est-word { flex: none; min-width: 17px; text-align: center; }
.lead-icon.mine-bg { color: var(--mine); }

/* Fields that carry a unit: $ before, /lin ft or % after, never inside the number. */
.money-in, .pct-in { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.money-in { flex: 1 1 8em; min-width: min(8em, 100%); }
.money-in .field-v { flex: 1 1 auto; min-width: 4em; }
/* A percent keeps a thumb's width and, at a large text size, drops under its words rather than squeeze (lane 9R). */
.pct-in { flex: 0 1 auto; min-width: 5.5em; justify-content: flex-end; }
.pct-in .field-v { text-align: right; flex: none; width: auto; min-width: 3em; }
.pre, .post { color: var(--label-2); font-size: var(--text-body); flex: none; }
/* A text field with a vertical axis (lane 9R): one row that grows to a second when the words need it, as a SwiftUI
   TextField(axis: .vertical) and the Messages composer do, so a long name or address is never clipped. */
textarea.field-v.grow { height: auto; min-height: var(--target); padding: 11px 0; line-height: 1.3; resize: none; overflow: hidden; overflow-wrap: anywhere; }
.row.field.two { cursor: text; flex-wrap: wrap; }
.row.field.two .row-main { flex: 1 1 10em; min-width: min(10em, 100%); padding: 7px 0; }
.row.field.invalid { box-shadow: inset 3px 0 0 var(--red); }
.field-err { color: var(--red); }

/* The switch, as lane M1 built it in the app */
input.switch { font-size: var(--text-body); appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: var(--fill-2); position: relative; cursor: pointer; transition: background var(--dur-fast) var(--ease); }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform var(--dur-fast) var(--ease); }
input.switch:checked { background: var(--mine); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:disabled { opacity: 0.45; cursor: default; }
label.row { cursor: pointer; }

/* A change, before and after. The * stays on whatever is still an estimate. */
.row.diff { align-items: flex-start; }
.diff-move { overflow-wrap: anywhere; min-width: 0; display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; flex: none; max-width: 58%; text-align: right; font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.diff-move .was { color: var(--label-2); }
.diff-move .now { font-weight: 600; }
.diff-move .diff-arrow { width: 14px; height: 14px; color: var(--label-3); --icon-stroke: 2.6; }
.diff-yours { display: inline-flex; align-items: center; gap: 3px; flex-basis: 100%; justify-content: flex-end; color: var(--mine); font-size: var(--text-sub); font-weight: 600; }
.diff-yours .i { width: 15px; height: 15px; --icon-stroke: 2.2; }
.diff-move.stack { flex-direction: column; align-items: flex-end; gap: 1px; }

/* Sheets: the full ones share the send sheet's head; the question sits at the bottom. */
.sheet-top { padding-top: 0; min-height: 52px; }
.sheet-scroll { padding-bottom: 40px; }
.sheet-go { margin: 22px 16px 0; }
.sheet.ask { top: auto; max-height: calc(100% - 40px); }
.ask-body { padding: 18px 20px var(--bottom-gap, 28px); text-align: center; display: grid; gap: 10px; }
.ask-title { font-size: var(--text-title3); line-height: 1.25; font-weight: 700; }
.ask-msg { margin: 0 0 8px; }
.pill.danger { background: var(--cell); color: var(--red); box-shadow: inset 0 0 0 0.5px var(--bar-edge); }
/* Not yet: grey, still legible (4.5:1), never a faded tint. */
.pill.primary[aria-disabled="true"] { background: var(--fill); color: var(--label-2); }
/* A tight bar keeps the chevron and lets the title shrink, rather than run off (rest.js fitNav). */
.nav-btn.back.chev-only .back-t { display: none; }

/* Settings pages */
.set-seg { margin: 0 16px; }
.topic { align-items: flex-start; }
.topic .link { flex: none; margin: -10px -4px -10px 0; padding: 0 4px; }
.need-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; margin-left: 4px; border-radius: 11px; background: var(--fill); color: var(--label); font-size: var(--text-foot); font-weight: 600; vertical-align: 2px; }
.col-row { --inset: 58px; padding-top: 6px; padding-bottom: 6px; }
.col-minus { width: 44px; height: 44px; margin: 0 -8px 0 -11px; display: grid; place-items: center; flex: none; }
.col-minus span { width: 22px; height: 22px; border-radius: 11px; background: var(--red); position: relative; }
.col-minus span::after { content: ""; position: absolute; left: 5px; right: 5px; top: 10px; height: 2px; border-radius: 1px; background: #fff; }
.col-lock { width: 44px; height: 44px; margin: 0 -8px 0 -11px; display: grid; place-items: center; flex: none; color: var(--label-2); }
.col-lock .i { width: 18px; height: 18px; --icon-stroke: 2; }
.col-in { display: block; width: 100%; height: var(--target); margin: -4px 0 -6px; font-weight: 400; }
/* A text view grows to its words, as Notes does: no inner scroll, the page scrolls (lane 9R). field-sizing where the
   browser has it; app.js's fitTextViews sets the height from scrollHeight everywhere else. */
.note-area { display: block; width: 100%; min-height: 104px; border: 0; outline: 0; resize: none; padding: 12px 16px; background: none; color: var(--label); font: inherit; font-size: var(--text-body); line-height: 1.35; field-sizing: content; overflow: hidden; }
.note-area::placeholder { color: var(--label-2); }
.rowish.paste { position: relative; }

/* The price book */
.pb-hero { display: flex; align-items: center; gap: 16px; padding: 16px; }
.pb-ring { width: 64px; height: 64px; flex: none; }
.pb-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.pb-ring .track { stroke: var(--fill-2); }
.pb-ring .est { stroke: var(--amber-bar); }
.pb-ring .mine { stroke: var(--mine); }
.pb-stat { display: block; font-size: var(--text-title2); line-height: 1.25; font-weight: 600; }
.row.bucket { --inset: 58px; }
/* A rate's amount keeps to its side; at a large text size it drops under the title rather than run over the chevron
   (seen at 320, 200%: "$1.84/ft*" past its box). A figure with no space in it may break at the slash. */
.row.rate { align-items: center; flex-wrap: wrap; }
.row.rate .row-main { flex: 1 1 10em; min-width: min(10em, 100%); }
.row.rate .amt { text-align: right; overflow-wrap: anywhere; }
.row.rate .amt .num { overflow-wrap: anywhere; }
.amt.unset, .sub-amt { color: var(--label-2); }

/* Import */
.imp { --inset: 58px; }
.imp .circle { margin-top: -8px; }
.imp-flag { margin-top: 4px; font-size: var(--text-sub); line-height: 1.33; color: var(--amber); }
.imp-move { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 4px; font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.imp-move .was { color: var(--label-2); }
.imp-move .now { font-weight: 600; }
.imp-move .diff-arrow { width: 14px; height: 14px; color: var(--label-3); --icon-stroke: 2.6; }

/* ── Stop light (DEC-060): one meaning per colour, a word always beside it ── */
.light { display: inline-block; width: 10px; height: 10px; border-radius: 5px; flex: none; margin-right: 1px; vertical-align: 1px; }
.light.red { background: var(--red); }
.light.yellow { background: var(--amber-bar); }
.light.green { background: var(--mine); }
.row-title .light { margin-right: 8px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; font-size: var(--text-foot); font-weight: 600; letter-spacing: 0.01em; flex: none; white-space: nowrap; vertical-align: 1px; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.yellow { background: var(--amber-soft); color: var(--amber); }
.chip.green { background: var(--mine-soft); color: var(--mine); }
.var.red { color: var(--red); }
.var.yellow { color: var(--amber); }
.var.green { color: var(--mine); }
.cost-row { align-items: flex-start; --inset: 38px; }
.cost-row > .light { margin-top: 6px; }
.cost-row .amt { text-align: right; max-width: 42%; font-weight: 600; }
.cost-card .fig-big { font-size: var(--fig-2); }
.cost-card .chip { margin-left: 4px; }
.imp-flag.red { color: var(--red); }
.imp-flag.yellow { color: var(--amber); }
.rb-seg { margin: 0 16px 12px; }

/* ── Swipe actions, as in Mail (lane 9R: the commit, the pop, the gap closing) ── */
.swipe { position: relative; overflow: hidden; }
.swipe > .row { position: relative; z-index: 1; background: var(--cell); touch-action: pan-y; transition: transform var(--dur) var(--ease); -webkit-user-select: none; user-select: none; }
.swipe + .swipe > .row::before, .swipe + .row::before, .row + .swipe > .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset, 16px); height: 1px; transform: scaleY(0.5); transform-origin: top; background: var(--sep); }
.sw-lead, .sw-trail { position: absolute; top: 0; bottom: 0; display: flex; visibility: hidden; overflow: hidden; }
.sw-lead { left: 0; }
.sw-trail { right: 0; }
.swipe[data-side="lead"] .sw-lead, .swipe[data-side="trail"] .sw-trail { visibility: visible; }
/* Mail's width: 74 pt an action. */
.sw-act { flex: 1 0 74px; min-width: 74px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 6px;
  color: var(--on-fill); font-size: var(--text-foot); font-weight: 600; transition: flex-basis var(--dur-fast) var(--ease), min-width var(--dur-fast) var(--ease); }
.sw-act .i { width: 22px; height: 22px; --icon-stroke: 2; }
.sw-act.red { background: var(--red-fill); }
.sw-act.amber { background: var(--amber-fill); }
.sw-act.green { background: var(--mine-fill); }
.sw-act.gray { background: var(--gray-fill); }
.sw-act.tint { background: var(--tint-fill); color: var(--tint-ink); }
/* A full swipe: the edge action takes the whole width, the way Mail shows it will run; its icon pops once at the line. */
.swipe.full-trail .sw-trail .sw-act:not(:last-child), .swipe.full-lead .sw-lead .sw-act:not(:first-child) { flex: 0 0 0; min-width: 0; padding: 0; overflow: hidden; }
.sw-act.pop .i { animation: sw-pop 220ms var(--ease); }
@keyframes sw-pop { 0% { transform: scale(1); } 45% { transform: scale(1.25); } 100% { transform: scale(1); } }
/* Letting go past the line: the row leaves off the edge (190 ms), then the gap closes (170 ms), then the action runs. */
.swipe.leaving > .row { transition: transform 190ms var(--ease); }
.swipe.leaving .sw-lead, .swipe.leaving .sw-trail { transition: width 190ms var(--ease); }
.swipe.closing { transition: height 170ms var(--ease); }
@media (prefers-reduced-motion: reduce) { .swipe > .row, .sw-act, .swipe.leaving > .row, .swipe.leaving .sw-lead, .swipe.leaving .sw-trail, .swipe.closing { transition: none; } .sw-act.pop .i { animation: none; } }
.sw-sheet { margin: 4px 0 6px; text-align: left; }
.sw-pick.tone-red .row-title, .sw-pick.tone-red .lead-icon { color: var(--red); }
.sw-pick.tone-green .lead-icon { color: var(--mine); }
.sw-pick.tone-amber .lead-icon { color: var(--amber); }
.sw-pick.tone-tint .lead-icon { color: var(--tint); }

/* Toasts that can be undone */
.toast.on.has-act { pointer-events: auto; }
.toast-act { color: var(--on-toast); font-weight: 600; margin-left: 10px; min-height: 44px; padding: 0 4px; text-decoration: underline; text-underline-offset: 3px; }

/* ── Store logos (DEC-059 draft): on a white well in both themes, as a brand is printed ── */
.logo-well { width: 64px; height: 40px; flex: none; border-radius: 8px; background: #ffffff; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.14); display: grid; place-items: center; padding: 4px 6px; overflow: hidden; }
.logo-well img { max-width: 100%; max-height: 100%; display: block; }
.logo-well.sm { width: 44px; height: 30px; padding: 3px 4px; border-radius: 7px; }
.logo-well.lg { width: 132px; height: 80px; padding: 10px 14px; border-radius: 16px; margin: 0 auto; }
.logo-mono { font-size: var(--text-sub); font-weight: 700; color: #3a3a3c; letter-spacing: 0.04em; }
.logo-well.lg .logo-mono { font-size: var(--text-title2); }
.row.store-row { --inset: 92px; }
.row.store-row .logo-well.sm { margin: -2px 0; }
.group > .row.store-row:has(.logo-well.sm), .row.store-row:has(.logo-well.sm) { --inset: 72px; }
.store-hero { text-align: center; padding: 8px 20px 0; }
.store-hero h1 { font-size: var(--text-title1); line-height: 1.2; font-weight: 700; margin: 14px 0 2px; letter-spacing: 0.01em; }
/* The rule builder's number fields: at a large text size the field drops under its label rather than shrink. */
.rb .row.field .money-in { flex: 1 1 120px; min-width: 120px; }
.rb .row.field > input.field-v { flex: 1 1 140px; min-width: 140px; }
.part-row .logo-well.sm { margin: -4px 0; }

/* ── Quick inputs (lane 9R) ── */
/* A stepper, as Apple's: two segments beside the value it changes (the value is a field, so a big change is typed). */
.stepper { display: inline-flex; align-items: center; gap: 0; background: var(--fill); border-radius: 10px; padding: 0; flex: none; }
.stepper button { flex: none; width: var(--target); height: var(--target); font-size: var(--text-title2); font-weight: 400; color: var(--tint); border-radius: 10px; }
.stepper button:active { background: var(--fill-2); }
.stepper button[aria-disabled="true"] { color: var(--label-3); }
.stepper .div { width: 1px; height: 22px; background: var(--sep); flex: none; }
.stepper span { font-size: var(--text-body); padding: 0 4px; }
.step-val { display: inline-flex; align-items: baseline; gap: 4px; flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.step-val .field-v { width: 3em; min-width: 3em; flex: none; text-align: right; }
.step-val .post { white-space: nowrap; }
.row.step { flex-wrap: wrap; gap: 8px 12px; }
.row.step .row-main { flex: 1 1 4em; min-width: 4em; }
/* A picker row: the choice with a chevron; the choices open as a sheet with a checkmark on the current one. */
.pick-row .row-val { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--label-2); }
.pick-row .field-k { flex: 1 0 auto; }
.pick .ok-mark { visibility: hidden; }
.pick[aria-checked="true"] .ok-mark { visibility: visible; }
.pick[aria-checked="true"] .row-title { font-weight: 600; }
/* The takes: a card per take; tap it to read every word, swipe it to discard (Undo on the toast). */
.take { --inset: 58px; align-items: flex-start; }
.take .lead-icon { margin-top: 1px; }
.take .take-words { font-size: var(--text-body); line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.take.open .take-words { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.take .take-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: var(--text-foot); color: var(--label-2); }
.take .chev { margin-top: 4px; transition: transform var(--dur-fast) var(--ease); }
.take.open .chev { transform: rotate(90deg); }
.take-edit { margin-top: 6px; }
.take-edit .note-area { padding: 0; min-height: 44px; }
/* A discarded take stays readable: its words go grey (label-2, 6.4:1 on a card), never faded below AA. */
.take-gone .take-words { color: var(--label-2); }
.take-gone .lead-icon { color: var(--label-3); }
@media (prefers-reduced-motion: reduce) { .take .chev { transition: none; } }
