/* QQCalc (01Shared/QQCalc.aspx): phone first, 390px wide with a 16px gutter, light and dark (html.dark, JS/Dark.js).
   From the owner-approved mockup; colors follow CS/Calculator.css. */
.qqc {
  --brand: #0a5bd6; --brand-dark: #07439f; --brand-soft: #e8f0fd;
  --ink: #13233a; --muted: #5b6b82; --line: #dce3ee; --field-line: #8492a6;
  --bg: #e4e9f1; --card: #f0f3f8; --field: #ffffff;
  --good: #1f7a4d; --good-soft: #e3f4ea; --warn: #9a5b00; --warn-soft: #fdf1dc;
  --on-brand: #ffffff; --shadow: rgba(19, 35, 58, .10);
  color: var(--ink); display: grid; gap: 12px; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0 auto; max-width: 480px; padding: 12px 16px 24px;
}
html.dark .qqc {
  --brand: #4d8dff; --brand-dark: #9cc0ff; --brand-soft: #1b2d4d;
  --ink: #e4ebf5; --muted: #97a6bc; --line: #2b3a52; --field-line: #51647f;
  --bg: #0d1420; --card: #162032; --field: #0f1828;
  --good: #6fd3a0; --good-soft: #15352a; --warn: #f2bd6b; --warn-soft: #3a2c14;
  --on-brand: #ffffff; --shadow: rgba(0, 0, 0, .35);
}
body:has(.qqc) { background: var(--qqc-page, #e4e9f1); }
html.dark body:has(.qqc) { --qqc-page: #0d1420; }
.qqc *, .qqc *::before, .qqc *::after { box-sizing: border-box; }
.qqc button, .qqc input { color: inherit; font: inherit; }
.qqc button { cursor: pointer; }
.qqc :focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.qqc [hidden] { display: none !important; }

.qqc-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px var(--shadow); min-width: 0; padding: 14px; }
.qqc-eyebrow { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; margin: 0 0 10px; text-transform: uppercase; }
.qqc-gap { margin-top: 16px; }

/* The loan officer */
.qqc-lo { align-items: center; display: grid; gap: 4px 12px; grid-template-columns: 52px minmax(0, 1fr); }
.qqc-avatar { background: var(--brand-soft); border-radius: 50%; color: var(--brand-dark); display: grid; font-size: 1.1rem; font-weight: 700; height: 52px; object-fit: cover; place-items: center; width: 52px; }
.qqc-lo-name { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.qqc-lo-line { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.qqc-lo-btns { display: grid; gap: 8px; grid-auto-flow: column; grid-column: 1 / -1; margin-top: 10px; }
.qqc-lo-btn { align-items: center; background: var(--field); border: 1px solid var(--line); border-radius: 10px; color: var(--brand-dark); display: flex; font-weight: 600; justify-content: center; min-height: 44px; text-decoration: none; }
.qqc-lo-btns:empty { display: none; }

/* What's typed */
.qqc-chips { display: grid; gap: 6px; grid-auto-flow: column; grid-auto-columns: 1fr; margin-bottom: 12px; }
.qqc-chips button { background: var(--field); border: 1px solid var(--field-line); border-radius: 999px; font-size: .9rem; font-weight: 600; min-height: 44px; padding: 0 4px; }
.qqc-chips button[aria-pressed="true"], .qqc-seg button[aria-pressed="true"], .qqc-quick button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.qqc-field { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; padding: 6px 0; }
.qqc-field:last-child { border-bottom: 0; }
.qqc-field label, .qqc-field > span { font-weight: 500; }
.qqc-hint { color: var(--muted); display: block; font-size: .75rem; font-weight: 400; }
.qqc-box { align-items: center; display: flex; gap: 6px; }
.qqc-box input[type=text] { background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; font-variant-numeric: tabular-nums; min-height: 44px; padding: 0 10px; text-align: right; width: 112px; }
.qqc-box input.big { font-size: 1.15rem; font-weight: 600; width: 132px; }
.qqc-box input#qqcRate { width: 80px; }
.qqc-box input[readonly] { background: var(--card); color: var(--muted); }
.qqc-unit { border: 1px solid var(--field-line); border-radius: 10px; display: inline-flex; overflow: hidden; }
.qqc-unit button { background: var(--field); border: 0; color: var(--muted); font-weight: 700; min-height: 42px; min-width: 34px; }
.qqc-unit button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.qqc-step { background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; color: var(--brand-dark); font-size: 1.3rem; font-weight: 700; min-height: 44px; min-width: 44px; }
.qqc-step:disabled { opacity: .45; }
.qqc-quick { border-bottom: 1px solid var(--line); display: grid; gap: 6px; grid-template-columns: repeat(4, 1fr); padding: 2px 0 10px; }
.qqc-quick button { background: var(--field); border: 1px solid var(--field-line); border-radius: 999px; font-weight: 600; min-height: 40px; }
.qqc-more { margin-top: 8px; }
.qqc-more summary { align-items: center; color: var(--brand-dark); cursor: pointer; display: flex; font-weight: 600; justify-content: space-between; list-style: none; min-height: 44px; }
.qqc-more summary::-webkit-details-marker { display: none; }
.qqc-more summary::after { color: var(--muted); content: "Show"; font-size: .8rem; font-weight: 500; }
.qqc-more[open] summary::after { content: "Hide"; }
.qqc-seg { display: inline-flex; gap: 4px; }
.qqc-seg button { background: var(--field); border: 1px solid var(--field-line); border-radius: 8px; font-weight: 600; min-height: 40px; min-width: 44px; padding: 0 8px; }
.qqc-switch { background: var(--field); border: 1px solid var(--field-line); border-radius: 999px; height: 30px; position: relative; width: 52px; }
.qqc-switch::after { background: var(--muted); border-radius: 50%; content: ""; height: 22px; left: 3px; position: absolute; top: 3px; transition: left .15s; width: 22px; }
.qqc-switch[aria-checked="true"] { background: var(--brand); border-color: var(--brand); }
.qqc-switch[aria-checked="true"]::after { background: var(--on-brand); left: 25px; }

/* Easy editing: the clear (x) inside a box while typing, and Done right under it */
.qqc-inbox { display: inline-flex; position: relative; }
.qqc-clear { background: transparent; border: 0; border-radius: 50%; color: var(--muted); display: none; font-size: 1.35rem; height: 38px; left: 3px; line-height: 1; position: absolute; top: 50%; transform: translateY(-50%); width: 38px; }
.qqc-inbox.editing .qqc-clear { display: block; }
.qqc-inbox.editing input[type=text] { padding-left: 40px; }

/* The figures */
.qqc-bigpay { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.qqc-amt { color: var(--brand-dark); font-size: 2.1rem; font-variant-numeric: tabular-nums; font-weight: 750; line-height: 1.1; }
.qqc-per { color: var(--muted); font-weight: 600; }
.qqc-rateline { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; margin: 2px 0 10px; }
.qqc-note { background: var(--warn-soft); border-radius: 10px; color: var(--warn); font-size: .85rem; margin: 0 0 10px; padding: 8px 10px; }
.qqc-rows { display: grid; }
.qqc-rows div { border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; padding: 7px 0; }
.qqc-rows div span:last-child { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.qqc-rows div.total { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; margin-top: 2px; }
.qqc-rows div.total span:last-child { color: var(--brand-dark); }
.qqc-rows div.minus span:last-child { color: var(--good); }
.qqc-call { font-weight: 600; margin: 12px 0 0; }
.qqc-estimate { color: var(--muted); font-size: .8rem; margin: 6px 0 0; }
.qqc-status { color: var(--muted); font-size: .8rem; margin: 6px 0 0; min-height: 1.2em; }
.qqc-status.error { color: var(--warn); font-weight: 600; }
.qqc.pending #qqcResults .qqc-amt, .qqc.pending #qqcResults .qqc-rows { opacity: .55; }
.qqc.failed #qqcResults .qqc-amt, .qqc.failed #qqcResults .qqc-rows, .qqc.failed #qqcResults .qqc-rateline { opacity: .35; }
.qqc-foot { color: var(--muted); font-size: .75rem; margin: 0; text-align: center; }

/* The floating bar: the payment, or Done while typing; rides above the phone keyboard (JS/AppGo.js sets --qq-kb) */
.qqc-float { bottom: calc(10px + env(safe-area-inset-bottom, 0px) + var(--qq-kb, 0px)); position: sticky; z-index: 5; }
.qqc-float button { align-items: center; background: var(--brand); border: 0; border-radius: 14px; box-shadow: 0 6px 18px var(--shadow); color: var(--on-brand); display: flex; gap: 10px; justify-content: space-between; min-height: 56px; padding: 8px 16px; text-align: left; width: 100%; }
.qqc-fpay { font-size: 1.15rem; font-variant-numeric: tabular-nums; font-weight: 750; }
.qqc-fcash { font-size: .85rem; font-variant-numeric: tabular-nums; opacity: .9; }
.qqc-fgo { font-size: .85rem; font-weight: 700; white-space: nowrap; }
.qqc-float button.done { background: var(--good); font-size: 1.15rem; font-weight: 750; justify-content: center; }
html.dark .qqc-float button.done { color: #0d1420; }
.qqc .flash { animation: qqc-flash 1.2s ease-out; }
@keyframes qqc-flash { 0% { box-shadow: 0 0 0 4px var(--brand); } 100% { box-shadow: 0 1px 2px var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .qqc .flash { animation: none; } .qqc-switch::after { transition: none; } }
@media (max-width: 360px) { .qqc-box input[type=text] { width: 96px; } .qqc-box input.big { width: 116px; } }

/* Buttons, and the PDF's language */
.qqc-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.qqc-actions.one { grid-template-columns: 1fr; }
.qqc-btn { background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; font-weight: 600; min-height: 48px; }
.qqc-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.qqc-btn:disabled { cursor: default; opacity: .45; }
.qqc-lang { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.qqc-link { background: none; border: 0; color: var(--brand-dark); font-weight: 600; min-height: 40px; padding: 0 2px; text-decoration: underline; text-underline-offset: 3px; }
.qqc-link:disabled { cursor: default; opacity: .45; }

/* Send this estimate (plan decisions 53-60): Send to, Text it, Email it */
.qqc-send { border: 2px solid var(--brand); }
.qqc-send .qqc-eyebrow { color: var(--brand-dark); }
.qqc-to-label { display: block; font-weight: 600; margin-bottom: 6px; }
.qqc-people { display: grid; gap: 8px; margin-bottom: 8px; }
.qqc-people:empty { display: none; }
.qqc-who { background: var(--field); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; padding: 8px 4px 8px 10px; }
.qqc-who-top { align-items: center; display: grid; gap: 10px; grid-template-columns: 36px minmax(0, 1fr) auto; }
.qqc-ini { background: var(--brand-soft); border-radius: 50%; color: var(--brand-dark); display: grid; font-size: .82rem; font-weight: 700; height: 36px; place-items: center; width: 36px; }
.qqc-ini.agent { background: var(--good-soft); color: var(--good); }
.qqc-ini.new { background: var(--warn-soft); color: var(--warn); }
.qqc-who-name { display: grid; line-height: 1.3; min-width: 0; }
.qqc-who-name b { overflow-wrap: anywhere; }
.qqc-who-name span { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.qqc-badge { background: var(--brand-soft); border-radius: 999px; color: var(--brand-dark); display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .04em; margin-left: 6px; padding: 1px 7px; text-transform: uppercase; vertical-align: 2px; }
.qqc-badge.agent { background: var(--good-soft); color: var(--good); }
.qqc-badge.new { background: var(--warn-soft); color: var(--warn); }
.qqc-who-btns { display: flex; }
.qqc-icon-btn { background: none; border: 0; border-radius: 8px; color: var(--brand-dark); font-size: .85rem; font-weight: 600; min-height: 40px; min-width: 40px; padding: 0 6px; }
.qqc-icon-btn.x { color: var(--muted); font-size: 1.35rem; }
.qqc-who-edit { display: grid; gap: 6px 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-right: 6px; }
.qqc-who-edit .full { grid-column: 1 / -1; }
.qqc-in { display: grid; gap: 3px; min-width: 0; }
.qqc-in label { font-size: .85rem; font-weight: 500; }
.qqc-in input { background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; min-height: 44px; min-width: 0; padding: 0 10px; width: 100%; }
.qqc-in input[aria-invalid="true"] { border-color: var(--warn); }
.qqc-in-err { color: var(--warn); font-size: .8rem; font-weight: 600; }
.qqc-who-save { align-items: center; display: flex; flex-wrap: wrap; font-size: .85rem; gap: 6px 8px; grid-column: 1 / -1; }
.qqc-seg2 { border: 1px solid var(--field-line); border-radius: 999px; display: inline-flex; overflow: hidden; }
.qqc-seg2 button { background: var(--field); border: 0; border-left: 1px solid var(--field-line); font-size: .8rem; font-weight: 600; min-height: 38px; padding: 0 10px; }
.qqc-seg2 button:first-child { border-left: 0; }
.qqc-seg2 button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
/* Typing in this card on a phone: the payment bar steps aside, and the page has room to scroll Send to near the top
   with the suggestions under it, above the keyboard (JS/QQCalc.js, toTop / fit) */
.qqc.qqc-picking .qqc-float { display: none; }
@media (pointer: coarse) { .qqc.qqc-picking { padding-bottom: 70vh; } }
.qqc-combo { position: relative; }
.qqc-combo input { background: var(--field); border: 1px dashed var(--field-line); border-radius: 10px; min-height: 46px; padding: 0 12px; width: 100%; }
.qqc-sugg { background: var(--field); border: 1px solid var(--field-line); border-radius: 12px; box-shadow: 0 10px 28px var(--shadow); left: 0; list-style: none; margin: 4px 0 0; max-height: 300px; overflow-y: auto; padding: 4px; position: absolute; right: 0; top: 100%; z-index: 6; }
.qqc-sugg li { align-items: center; border-radius: 8px; cursor: pointer; display: grid; gap: 10px; grid-template-columns: 32px minmax(0, 1fr); padding: 7px 8px; }
.qqc-sugg li[aria-selected="true"] { background: var(--brand-soft); }
@media (hover: hover) { .qqc-sugg li[role="option"]:hover { background: var(--brand-soft); } }
.qqc-sugg li .qqc-ini { height: 32px; width: 32px; }
.qqc-sugg li.head { color: var(--muted); cursor: default; display: block; font-size: .7rem; font-weight: 700; letter-spacing: .07em; padding: 8px 8px 2px; text-transform: uppercase; }
.qqc-sg { display: grid; line-height: 1.3; min-width: 0; }
.qqc-sg span { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.qqc-send-err { background: var(--warn-soft); border-radius: 10px; color: var(--warn); font-size: .88rem; font-weight: 600; margin: 8px 0 0; padding: 8px 10px; }
.qqc-send-err.info { background: var(--good-soft); color: var(--good); }
.qqc-send-err.note { background: none; color: var(--muted); font-weight: 500; padding: 4px 2px 0; }
.qqc-send-btns { margin-top: 12px; }
.qqc-under { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; margin-top: 12px; }
.qqc-prog { background: var(--brand-soft); border: 1px solid var(--brand); border-radius: 12px; margin-top: 10px; padding: 10px 12px 4px; }
.qqc-prog-head { font-weight: 700; margin: 0 0 6px; }
.qqc-prog-list { display: grid; list-style: none; margin: 0; padding: 0; }
.qqc-prog-list li { align-items: center; border-top: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: 26px minmax(0, 1fr) auto; min-height: 52px; padding: 6px 0; }
.qqc-prog-list li:first-child { border-top: 0; }
.qqc-mark { border: 2px solid var(--field-line); border-radius: 50%; display: grid; font-size: .8rem; font-weight: 800; height: 24px; place-items: center; width: 24px; }
.qqc-prog-list li.done .qqc-mark { background: var(--good); border-color: var(--good); color: var(--on-brand); }
html.dark .qqc-prog-list li.done .qqc-mark { color: #0d1420; }
.qqc-prog-list li.now .qqc-mark { border-color: var(--brand); color: var(--brand-dark); }
.qqc-pn { display: grid; line-height: 1.25; min-width: 0; }
.qqc-pn b { overflow-wrap: anywhere; }
.qqc-pn span { color: var(--muted); font-size: .8rem; }
.qqc-prog-list li.done .qqc-pn b { color: var(--muted); }
.qqc-prog-list .qqc-btn { min-height: 42px; padding: 0 14px; }
.qqc-later { color: var(--muted); font-size: .8rem; }
.qqc-log { display: grid; gap: 6px; list-style: none; margin: 10px 0 0; padding: 0; }
.qqc-log:empty { display: none; }
.qqc-log li { background: var(--field); border: 1px solid var(--line); border-radius: 10px; display: grid; font-size: .85rem; gap: 2px; padding: 8px 10px; }
.qqc-log .st { color: var(--muted); }
.qqc-log .st.yes { color: var(--good); font-weight: 600; }

/* Pick a payment and Ratios */
.qqc-tabs { display: grid; gap: 6px; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.qqc-tabs button { background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; font-weight: 600; min-height: 44px; }
.qqc-tabs button[aria-selected="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.qqc-result { align-items: center; background: var(--brand-soft); border-radius: 10px; color: var(--brand-dark); display: flex; flex-wrap: wrap; font-weight: 600; gap: 8px; justify-content: space-between; margin-top: 10px; padding: 10px 12px; }
.qqc-result button { background: var(--brand); border: 0; border-radius: 8px; color: var(--on-brand); font-weight: 600; min-height: 40px; padding: 0 12px; }
.qqc-meter { display: grid; gap: 10px; margin-top: 10px; }
.qqc-meter .m { display: grid; gap: 4px; }
.qqc-meter .top { display: flex; flex-wrap: wrap; font-weight: 600; gap: 4px 8px; justify-content: space-between; }
.qqc-meter .bar { background: var(--line); border-radius: 999px; height: 10px; overflow: hidden; }
.qqc-meter .bar i { background: var(--brand); border-radius: 999px; display: block; height: 100%; }
.qqc-pill { border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 1px 8px; }
.qqc-pill.ok { background: var(--good-soft); color: var(--good); }
.qqc-pill.high { background: var(--warn-soft); color: var(--warn); }

/* Agents (a personal link) and the "Get my personal link" form */
.qqc-agent-note { color: var(--muted); font-size: .8rem; grid-column: 1 / -1; margin: 6px 0 0; }
.qqc-ask-lede { margin: 0 0 6px; }
#qqcAsk .qqc-field input { background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; color: var(--ink); font: inherit; min-height: 44px; padding: 0 10px; width: min(210px, 52vw); }
.qqc-ask-go { margin-top: 12px; width: 100%; }
.qqc a:not([class]) { color: var(--brand-dark); }

/* "Add to my home screen" (plan Phase 3c) */
.qqc-install-lede { margin: 0 0 12px; }
.qqc-steps { margin: 14px 0 0; padding-left: 1.4em; }
.qqc-steps li { margin: 0 0 10px; line-height: 1.45; }
.qqc-steps li::marker { color: var(--brand); font-weight: 700; }

/* The basic calculator (01Shared/AppCalc.aspx): the credit score list, and the note only the loan officer sees */
.qqc-box select { background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; color: var(--ink); font: inherit; max-width: 170px; min-height: 44px; padding: 0 8px; }
.qqc-owner-note { background: var(--brand-soft); border-radius: 10px; font-size: .9rem; margin: 0; padding: 10px 12px; }
