/* ---------------------------------------------------------------------------------------------
   The homeowner's quotation page. Deliberately not the app: a fixed light document palette, generous
   measure, and type sized for reading on a phone in a kitchen rather than scanning on a desk. Every
   token is declared locally so the staff theme's dark variables can never leak in.
   --------------------------------------------------------------------------------------------- */

.public-root {
    --cq-ink: #1a1d21;
    --cq-ink-soft: #5b6470;
    --cq-line: #dfe3e8;
    --cq-paper: #ffffff;
    --cq-ground: #f4f6f8;
    --cq-accent: #14532d;
    --cq-accent-soft: #e8f1ec;
    --cq-warn: #8a2b2b;

    min-height: 100vh;
    background: var(--cq-ground);
    color: var(--cq-ink);
    color-scheme: light;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.cq-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 28px 18px 64px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cq-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 2px 8px;
}

.cq-brand { display: flex; align-items: center; gap: 12px; }
.cq-logo { max-height: 46px; max-width: 190px; object-fit: contain; }
.cq-company { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.cq-tagline { font-size: 13px; color: var(--cq-ink-soft); }
.cq-contact { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.cq-contact a { color: var(--cq-ink-soft); text-decoration: none; }
.cq-contact a:hover { color: var(--cq-accent); text-decoration: underline; }

.cq-card {
    background: var(--cq-paper);
    border: 1px solid var(--cq-line);
    border-radius: 12px;
    padding: 22px 24px;
}

.cq-centred { text-align: center; padding: 48px 24px; }

.cq-card h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; text-wrap: balance; }
.cq-card h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -0.01em; }
.cq-card h3 { font-size: 15px; margin: 0 0 4px; }
.cq-subhead { margin-top: 22px !important; }
.cq-small { font-size: 13px; color: var(--cq-ink-soft); }

.cq-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cq-ref { font-size: 13px; color: var(--cq-ink-soft); font-variant-numeric: tabular-nums; }
.cq-headline-total { text-align: right; }
.cq-headline-total span { display: block; }
.cq-headline-total strong { font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.cq-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 20px 0 0; }
.cq-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--cq-ink-soft); }
.cq-facts dd { margin: 2px 0 0; font-size: 14px; }

.cq-items { display: flex; flex-direction: column; }
.cq-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: start; padding: 16px 0; border-top: 1px solid var(--cq-line); }
.cq-item:first-child { border-top: 0; padding-top: 0; }
.cq-item-image { width: 96px; height: 96px; object-fit: contain; background: var(--cq-ground); border-radius: 8px; }
.cq-item-desc { font-size: 13px; color: var(--cq-ink-soft); margin: 0 0 8px; }
.cq-item-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cq-spec { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.cq-spec li { display: flex; gap: 6px; }
.cq-spec span { color: var(--cq-ink-soft); }

.cq-extras { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--cq-line); font-size: 13px; }
.cq-extras li { display: flex; justify-content: space-between; gap: 12px; }

.cq-totals { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cq-totals th { text-align: left; font-weight: 400; color: var(--cq-ink-soft); padding: 7px 0; }
.cq-totals td { text-align: right; padding: 7px 0; }
.cq-totals .cq-discount td, .cq-totals .cq-discount th { color: var(--cq-accent); }
.cq-totals .cq-grand th, .cq-totals .cq-grand td { border-top: 2px solid var(--cq-ink); font-size: 19px; font-weight: 650; color: var(--cq-ink); padding-top: 12px; }

.cq-finance { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.cq-plan { border: 1px solid var(--cq-line); border-radius: 10px; padding: 14px; background: var(--cq-ground); }
.cq-plan-months { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--cq-ink-soft); }
.cq-plan-monthly { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cq-plan-monthly span { font-size: 13px; font-weight: 400; color: var(--cq-ink-soft); }

.cq-terms { white-space: pre-wrap; font-size: 14px; color: var(--cq-ink-soft); margin: 0; }

.cq-act { border-color: var(--cq-accent); }
.cq-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.cq-btn {
    appearance: none;
    border: 1px solid var(--cq-line);
    background: var(--cq-paper);
    color: var(--cq-ink);
    border-radius: 8px;
    padding: 11px 20px;
    font: inherit;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.cq-btn:hover { border-color: var(--cq-ink-soft); }
.cq-btn.primary { background: var(--cq-accent); border-color: var(--cq-accent); color: #fff; }
.cq-btn.primary:hover { filter: brightness(1.1); }
.cq-btn.ghost { background: transparent; }
.cq-btn:disabled { opacity: .55; cursor: not-allowed; }
.cq-btn:focus-visible { outline: 3px solid var(--cq-accent); outline-offset: 2px; }

.cq-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--cq-ink-soft); margin: 14px 0 5px; }
.cq-input { width: 100%; padding: 12px 14px; border: 1px solid var(--cq-line); border-radius: 8px; font: inherit; font-size: 18px; background: var(--cq-paper); color: var(--cq-ink); }
.cq-input:focus-visible { outline: 3px solid var(--cq-accent); outline-offset: 1px; }
.cq-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; }
.cq-check input { margin-top: 4px; }

.cq-error { background: #fdeeee; border: 1px solid #f0c2c2; color: var(--cq-warn); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }

.cq-decision { border-left: 4px solid var(--cq-ink-soft); }
.cq-decision.good { border-left-color: var(--cq-accent); background: var(--cq-accent-soft); }

.cq-foot { text-align: center; font-size: 12px; color: var(--cq-ink-soft); padding-top: 8px; }
.cq-foot span + span { margin-left: 14px; }

/* The reason picker is a shared app component; give its app-themed controls the document's look. */
.cq-act .form-group { margin-top: 14px; }
.cq-act .label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--cq-ink-soft); margin-bottom: 5px; }
.cq-act .field { width: 100%; padding: 11px 13px; border: 1px solid var(--cq-line); border-radius: 8px; font: inherit; background: var(--cq-paper); color: var(--cq-ink); }

@media (max-width: 560px) {
    .cq-page { padding: 18px 12px 48px; }
    .cq-card { padding: 18px 16px; border-radius: 10px; }
    .cq-item { grid-template-columns: 72px 1fr; }
    .cq-item-image { width: 72px; height: 72px; }
    .cq-item-price { grid-column: 2; text-align: right; }
    .cq-contact { align-items: flex-start; }
    .cq-headline-total { text-align: left; }
}

@media print {
    .public-root { background: #fff; }
    .cq-card { border: 0; padding: 0 0 18px; break-inside: avoid; }
    .cq-act, .cq-actions { display: none; }
}

/* The staff app paints a dark ground on html/body; a document page must not sit on it. */
html:has(.public-root), html:has(.public-root) body { background: #f4f6f8; }
