/* AC Estimator (/ac-estimator/): inc/ac-estimator.php + assets/js/ac-estimator.js. Ported from E-dan's approved prototype. */
.ca-est {
	--e-navy: #0b1d3a; --e-green: #22c55e; --e-ice: #38bdf8; --e-paper: #f1f5f9; --e-card: #fff; --e-text2: #475569;
	--e-line: #d5dde8; --e-ice-soft: #e0f2fe; --e-green-soft: #dcfce7; --e-warn: #b45309; --e-warn-soft: #fef3c7; --e-bad: #dc2626; --e-bad-soft: #fee2e2;
	--e-display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif; --e-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
	background: var(--e-paper); color: var(--e-navy); font-family: var(--e-body); font-size: 16px; line-height: 1.45;
}
.ca-est * { box-sizing: border-box; }
.ca-est button, .ca-est input { font: inherit; color: inherit; }
.ca-est h1, .ca-est h2, .ca-est h3 { font-family: var(--e-display); font-weight: 700; margin: 0; text-wrap: balance; line-height: 1.1; color: inherit; letter-spacing: .2px; }
.ca-est-wrap { max-width: 860px; margin: 0 auto; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }

/* compact title */
.ca-est-hero { background: var(--e-navy); color: #fff; }
.ca-est-hero .ca-est-wrap { padding-block: 12px 12px; }
.ca-est-crumb { font-size: 13px; opacity: .8; }
.ca-est .ca-est-crumb a { color: #fff; text-decoration: none; }
.ca-est-hero h1 { font-size: 30px; margin-top: 2px; color: #fff; text-transform: uppercase; }
.ca-est-lede { margin: 6px 0 0; color: #cbd5e1; max-width: 62ch; font-size: 15.5px; }
@media (max-width: 640px) { .ca-est-lede { display: none; } .ca-est-hero h1 { font-size: 26px; } }

.ca-est-main { padding-block: 10px 120px; display: flex; flex-direction: column; gap: 12px; }
.ca-est-panel { background: var(--e-card); border: 1px solid var(--e-line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ca-est-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ca-est .ca-est-type { background: var(--e-card); border: 2px solid var(--e-line); border-radius: 10px; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 62px; text-align: center; color: var(--e-navy); }
.ca-est-type svg { width: 34px; height: 28px; stroke: var(--e-navy); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ca-est-type b { font-family: var(--e-display); font-size: 15px; line-height: 1.05; }
.ca-est .ca-est-type[aria-pressed="true"] { border-color: var(--e-navy); background: var(--e-ice-soft); }
.ca-est-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; min-width: 0; }
.ca-est-scroll::-webkit-scrollbar { display: none; }
.ca-est .ca-est-chip { flex: none; border: 2px solid var(--e-line); background: var(--e-card); border-radius: 999px; padding: 6px 13px; font-weight: 600; cursor: pointer; min-height: 38px; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--e-navy); }
.ca-est .ca-est-chip[aria-pressed="true"] { background: var(--e-navy); border-color: var(--e-navy); color: #fff; }
.ca-est .ca-est-chip.is-sm { padding: 6px 12px; font-size: 14.5px; }
.ca-est button:focus-visible, .ca-est input:focus-visible, .ca-est a:focus-visible, .ca-est summary:focus-visible { outline: 3px solid var(--e-ice); outline-offset: 2px; }
.ca-est-ddrow, .ca-est-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ca-est-kinds:empty { display: none; }
.ca-est .ca-est-kb { border: 2px solid var(--e-line); background: var(--e-card); border-radius: 10px; min-height: 44px; padding: 6px 10px; cursor: pointer; font-family: var(--e-display); font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--e-navy); }
.ca-est-kb small { font-family: var(--e-body); font-size: 12.5px; font-weight: 600; color: var(--e-text2); }
.ca-est .ca-est-kb[aria-pressed="true"] { background: var(--e-navy); border-color: var(--e-navy); color: #fff; }
.ca-est-kb[aria-pressed="true"] small { color: #cbd5e1; }
.ca-est-kb:disabled { opacity: .45; cursor: default; }
.ca-est-dd { position: relative; }
.ca-est .ca-est-ddb { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 4px; border: 2px solid var(--e-line); background: var(--e-card); border-radius: 10px; padding: 6px 12px; cursor: pointer; min-height: 48px; text-align: left; color: var(--e-navy); }
.ca-est-ddb.is-static { cursor: default; }
.ca-est-ddb small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--e-text2); line-height: 1.1; }
.ca-est-ddb b { font-family: var(--e-display); font-size: 20px; line-height: 1.1; white-space: nowrap; }
.ca-est-ddb > span { min-width: 0; overflow: hidden; }
.ca-est-ddb svg { flex: none; width: 14px; height: 14px; stroke: var(--e-navy); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.ca-est-dd.open .ca-est-ddb { border-color: var(--e-navy); }
.ca-est-dd.open .ca-est-ddb svg { transform: rotate(180deg); }
.ca-est-ddm { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 4px); min-width: 190px; background: #fff; border: 2px solid var(--e-navy); border-radius: 12px; box-shadow: 0 12px 28px rgba(11, 29, 58, .22); padding: 4px; display: none; max-height: 380px; overflow: auto; }
.ca-est-dd.open .ca-est-ddm { display: block; }
.ca-est-dd:last-child .ca-est-ddm { left: auto; right: 0; min-width: 270px; }
.ca-est .ca-est-ddo { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; background: transparent; border-radius: 8px; padding: 10px 12px; font-weight: 600; font-size: 16px; cursor: pointer; text-align: left; color: var(--e-navy); }
.ca-est-ddo small { font-weight: 500; color: var(--e-text2); font-size: 13px; }
.ca-est-ddo span, .ca-est-ddo small, .ca-est-fitd summary span { white-space: nowrap; }
.ca-est .ca-est-ddo:hover { background: var(--e-paper); }
.ca-est .ca-est-ddo[aria-selected="true"] { background: var(--e-navy); color: #fff; }
.ca-est-ddo[aria-selected="true"] small { color: #cbd5e1; }
.ca-est-fitd { border: 2px solid var(--e-line); border-radius: 10px; padding: 0 10px; }
.ca-est-fitd summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.ca-est-fitd summary::-webkit-details-marker { display: none; }
.ca-est-fitd summary i { font-style: normal; font-weight: 500; color: var(--e-text2); font-size: 14px; }
.ca-est-fitd summary b { font-size: 13.5px; color: var(--e-text2); font-weight: 600; text-align: right; }
.ca-est-fitd[open] { padding-bottom: 10px; border-color: var(--e-navy); }
.ca-est-dims { display: flex; flex-direction: column; gap: 8px; }
.ca-est-sl { display: grid; grid-template-columns: 64px 1fr 74px; align-items: center; gap: 8px; }
.ca-est-sl label { font-size: 13px; font-weight: 700; color: var(--e-text2); }
.ca-est-sl label small { display: block; font-weight: 500; font-size: 11.5px; color: var(--e-text2); white-space: nowrap; }
.ca-est-sl input[type=range] { width: 100%; accent-color: var(--e-navy); height: 28px; margin: 0; }
.ca-est-f { display: flex; align-items: center; border: 2px solid var(--e-line); border-radius: 9px; background: #fff; padding: 0 6px; }
.ca-est .ca-est-f input { border: 0; outline: 0; width: 100%; padding: 5px 0; font-size: 16px; font-weight: 600; background: transparent; font-variant-numeric: tabular-nums; color: var(--e-navy); text-align: right; box-shadow: none; min-height: 0; }
.ca-est-f i { font-style: normal; color: var(--e-text2); font-size: 12px; margin-left: 3px; }
.ca-est-f:focus-within { border-color: var(--e-navy); }
.ca-est .ca-est-clr { align-self: flex-start; border: 0; background: transparent; color: var(--e-navy); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px 0; font-size: 14px; }
.ca-est-help { font-size: 14px; color: var(--e-text2); }
.ca-est-help summary { cursor: pointer; font-weight: 600; color: var(--e-navy); padding: 4px 2px; }
.ca-est-help p { margin: 6px 2px 0; max-width: 65ch; }
.ca-est-help p:empty { display: none; }

/* results */
.ca-est-reshead { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ca-est-reshead h2 { font-size: 27px; }
.ca-est-count { color: var(--e-text2); font-size: 15px; }
.ca-est-filters { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ca-est-frow { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ca-est-frow::-webkit-scrollbar { display: none; }
.ca-est-frow > span { flex: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--e-text2); width: 46px; }
.ca-est-list { display: flex; flex-direction: column; gap: 12px; }
.ca-est-sys { background: var(--e-card); border: 1px solid var(--e-line); border-radius: 14px; overflow: hidden; border-left: 6px solid var(--e-line); }
.ca-est-sys.is-fit { border-left-color: var(--e-green); }
.ca-est-sys.is-tight { border-left-color: #f59e0b; }
.ca-est-sys.is-no { border-left-color: var(--e-bad); opacity: .78; }
.ca-est-sh { display: flex; justify-content: space-between; gap: 12px; padding: 14px 14px 0; }
.ca-est-sh h3 { font-size: 22px; }
.ca-est-sh p { margin: 3px 0 0; color: var(--e-text2); font-size: 14.5px; }
.ca-est-seer { flex: none; text-align: center; background: var(--e-navy); color: #fff; border-radius: 10px; padding: 6px 10px; min-width: 70px; align-self: flex-start; }
.ca-est-seer b { display: block; font-family: var(--e-display); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ca-est-seer small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #cbd5e1; }
.ca-est-tstat { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; background: var(--e-warn-soft); color: #7c2d12; border-radius: 8px; padding: 4px 9px; font-size: 13px; font-weight: 600; line-height: 1.25; }
.ca-est a.ca-est-tstat { color: #7c2d12; text-decoration: none; }
.ca-est a.ca-est-tstat span { text-decoration: underline; text-underline-offset: 2px; }
.ca-est-tstat i { font-style: normal; font-weight: 700; }
.ca-est-tstat svg { flex: none; width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ca-est-tstat img { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; object-fit: contain; }
.ca-est-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; align-items: center; }
.ca-est-tag { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 10px; background: var(--e-paper); font-variant-numeric: tabular-nums; }
.ca-est-ahriw { display: inline-flex; align-items: center; gap: 4px; }
.ca-est .ca-est-tag.is-ahri { background: var(--e-ice-soft); color: var(--e-navy); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 28px; }
.ca-est-tag.is-ahri u { text-underline-offset: 2px; }
.ca-est .ca-est-info { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--e-navy); color: var(--e-navy); font: 700 14px/1 Georgia, 'Times New Roman', serif; font-style: italic; text-decoration: none; background: #fff; cursor: pointer; }
.ca-est .ca-est-info[aria-expanded="true"] { background: var(--e-navy); color: #fff; }
.ca-est-tip { position: relative; margin: 10px 14px 0; padding: 12px 40px 12px 14px; border-radius: 12px; background: var(--e-ice-soft); color: var(--e-navy); font-size: 14px; line-height: 1.5; }
.ca-est-tip p { margin: 0 0 6px; }
.ca-est-tip a { font-weight: 700; color: var(--e-navy); }
.ca-est-tipx { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--e-navy); font-size: 20px; line-height: 1; cursor: pointer; }
.ca-est-tag.is-ok { background: var(--e-green-soft); }
.ca-est-tag.is-tight { background: var(--e-warn-soft); color: var(--e-warn); }
.ca-est-tag.is-bad { background: var(--e-bad-soft); color: var(--e-bad); }
.ca-est-tag.is-kind { background: var(--e-navy); color: #fff; }
.ca-est-parts { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px 14px; }
@media (min-width: 640px) { .ca-est-parts.is-two { grid-template-columns: 1.25fr 1fr; } }
.ca-est-part { border: 1px solid var(--e-line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.ca-est-part.is-main { background: var(--e-paper); border-color: transparent; }
.ca-est-ph { display: flex; gap: 10px; align-items: flex-start; }
.ca-est-ico { flex: none; width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 1px solid var(--e-line); object-fit: contain; padding: 3px; }
.ca-est-part h4 { margin: 0; font-family: var(--e-body); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--e-text2); font-weight: 700; }
.ca-est-size { font-family: var(--e-display); font-weight: 700; font-size: 25px; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ca-est-size.is-sm { font-size: 20px; }
.ca-est-ph > div { min-width: 0; }
.ca-est-ph:has(.ca-est-snd) .ca-est-size { font-size: 21px; white-space: nowrap; }
.ca-est-size small { font-family: var(--e-body); font-size: 13px; font-weight: 600; color: var(--e-text2); }
.ca-est-part p { margin: 4px 0 0; font-size: 14px; color: var(--e-text2); overflow-wrap: anywhere; }
.ca-est-nick { color: var(--e-navy); }
.ca-est-snd { margin-left: auto; flex: none; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 1px; background: #fff; border: 1px solid var(--e-line); border-radius: 10px; padding: 6px 9px; text-align: center; line-height: 1.1; }
.ca-est-snd svg { width: 22px; height: 22px; display: block; }
.ca-est-snd b { font-family: var(--e-display); font-size: 19px; font-weight: 700; color: var(--e-navy); font-variant-numeric: tabular-nums; }
.ca-est-snd b small { font-family: var(--e-body); font-size: 11px; font-weight: 700; }
.ca-est-snd span { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--e-text2); }
.ca-est-pos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ca-est-pos span { font-size: 12.5px; font-weight: 700; border-radius: 6px; padding: 3px 8px; background: #fff; border: 1px solid var(--e-line); }
.ca-est-pos span.off { color: #94a3b8; text-decoration: line-through; font-weight: 500; }
.ca-est-act { padding: 0 14px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ca-est .ca-est-btn { background: var(--e-green); color: var(--e-navy); border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; cursor: pointer; min-height: 46px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.ca-est .ca-est-btn.is-ghost { background: #fff; border: 2px solid var(--e-navy); }
.ca-est .ca-est-btn.is-ghost-light { background: transparent; border: 2px solid #fff; color: #fff; }
.ca-est .ca-est-btn.is-picked { background: var(--e-navy); color: #fff; }
.ca-est-more { align-self: center; }
.ca-est-empty { background: var(--e-card); border: 1px dashed var(--e-line); border-radius: 14px; padding: 18px; color: var(--e-text2); }

/* request */
.ca-est-req { background: var(--e-navy); color: #fff; border-radius: 14px; padding: 18px; scroll-margin-top: 90px; }
.ca-est-req h2 { font-size: 26px; color: #fff; }
.ca-est-req p { color: #cbd5e1; margin: 8px 0 0; max-width: 62ch; }
.ca-est-req pre { white-space: pre-wrap; word-break: break-word; background: #12284d; border-radius: 10px; padding: 12px; font-family: var(--e-body); font-size: 14.5px; margin: 12px 0 0; color: #fff; }
.ca-est-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.ca-est-row .ca-est-btn { min-width: 0; padding: 12px 8px; white-space: nowrap; font-size: 15.5px; }
/* Nov 10: on narrow phones the phone-number button was wider than its column and stuck out of the box. */
@media (max-width: 460px) { .ca-est-row .ca-est-btn { white-space: normal; text-wrap: balance; line-height: 1.15; font-size: 15px; padding: 10px 6px; } }
@media (max-width: 359px) { .ca-est-row { grid-template-columns: 1fr; } }
.ca-est-hours span { white-space: nowrap; }
.ca-est-fine { font-size: 13.5px; color: var(--e-text2); max-width: 70ch; }
.ca-est-fine p { margin: 0 0 6px; }
.ca-est-fine a { color: var(--e-navy); }
.ca-est-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--e-navy); color: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); display: none; z-index: 50; }
.ca-est-bar.is-on { display: block; }
.ca-est-bar-in { max-width: 860px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
@media (prefers-reduced-motion: no-preference) { .ca-est-sys { transition: opacity .15s; } }
