:root {
  --ink: #17272b;
  --muted: #64767a;
  --paper: #f4f1e9;
  --card: #fffdf8;
  --line: #d8ddd8;
  --pine: #174b42;
  --pine-dark: #0d332d;
  --sky: #d8edf0;
  --amber: #e7a337;
  --red: #a93c36;
  --shadow: 0 20px 55px rgba(23, 39, 43, .11);
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: var(--pine); }
.site-header, .admin-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(20px, 5vw, 72px); background: rgba(244, 241, 233, .95); border-bottom: 1px solid rgba(23, 75, 66, .12); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: var(--pine); color: white; font-size: 13px; letter-spacing: .08em; }
.quiet-link { color: var(--muted); text-decoration: none; font-weight: 650; }
.customer-shell main { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding-bottom: 80px; }
.hero { min-height: 520px; display: grid; grid-template-columns: 1.35fr .65fr; align-items: center; gap: clamp(34px, 7vw, 90px); padding: clamp(70px, 10vw, 130px) 0 80px; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .13em; font-size: 12px; font-weight: 850; color: var(--pine); }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(42px, 7vw, 82px); margin: 0; }
h1 span { color: var(--pine); }
.hero-copy { max-width: 690px; color: var(--muted); font-size: clamp(18px, 2vw, 22px); }
.trust-card { background: var(--pine); color: #f2faf7; padding: 30px; border-radius: 26px; box-shadow: var(--shadow); transform: rotate(1deg); }
.trust-card ul { padding-left: 20px; }
.trust-card li { margin: 12px 0; }
.trust-label { color: #bfe0d8; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.fine-print { font-size: 13px; color: var(--muted); }
.trust-card .fine-print { color: #bfe0d8; }
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 900px; margin: -38px auto 28px; position: relative; z-index: 2; }
.path-card { display: grid; gap: 7px; text-align: left; border: 1px solid var(--line); border-radius: 15px; padding: 20px; background: var(--card); color: var(--ink); box-shadow: 0 8px 22px rgba(23, 39, 43, .08); cursor: pointer; }
.path-card strong { font-size: 19px; }
.path-card span { color: var(--muted); line-height: 1.4; }
.path-card.active { border-color: var(--pine); box-shadow: 0 0 0 2px var(--pine), 0 8px 22px rgba(23, 39, 43, .08); }
.intake-card, .result-card, .panel, .login-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.intake-card { max-width: 900px; margin: 0 auto; overflow: hidden; }
.progress-wrap { padding: 28px clamp(22px, 5vw, 48px) 22px; background: #eef4ef; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; }
.progress-wrap h2 { margin: 0; }
.progress-track { grid-column: 1 / -1; height: 7px; background: #d4dfda; border-radius: 99px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 16.66%; background: var(--amber); border-radius: inherit; transition: width .25s ease; }
#intake-form { padding: clamp(25px, 5vw, 50px); }
.path-panel > form:not(#intake-form), .path-panel > p, .path-panel > .output-preview { margin-left: clamp(25px, 5vw, 50px); margin-right: clamp(25px, 5vw, 50px); }
.path-panel > form:not(#intake-form) { padding: 14px 0 clamp(25px, 5vw, 50px); }
.output-preview { margin-top: 24px; margin-bottom: 10px; border-left: 5px solid var(--amber); background: #fff6e8; border-radius: 8px; padding: 16px 18px; }
.form-step { display: none; animation: reveal .25s ease; }
.form-step.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
label, legend { display: block; font-weight: 750; margin: 0 0 8px; }
input, select, textarea { width: 100%; border: 1px solid #bdc9c5; border-radius: 11px; background: white; color: var(--ink); padding: 13px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--pine); box-shadow: 0 0 0 4px rgba(23, 75, 66, .12); }
fieldset { border: 0; padding: 0; margin: 28px 0; }
.field-grid { display: grid; gap: 22px; margin-bottom: 24px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.field-help, .optional { color: var(--muted); font-size: 13px; font-weight: 500; }
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; }
.choice { margin: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; }
.choice span { display: block; padding: 11px 22px; border: 1px solid #bdc9c5; border-radius: 99px; background: white; }
.choice input:checked + span { background: var(--pine); border-color: var(--pine); color: white; }
.choice input:disabled + span { color: #8a9692; background: #eef1ef; border-style: dashed; cursor: not-allowed; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 800; cursor: pointer; text-decoration: none; }
.button.primary { background: var(--pine); color: white; }
.button.primary:hover { background: var(--pine-dark); }
.button.secondary { background: var(--sky); color: var(--pine-dark); }
.button.text-button { color: var(--pine); background: transparent; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
.vehicle-confirm { margin-top: 18px; border-left: 5px solid var(--amber); background: #fff6e8; padding: 16px 18px; border-radius: 8px; }
.confirmation { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-top: 14px; }
.confirmation input { width: 18px; height: 18px; }
.consents { display: grid; gap: 14px; margin-top: 25px; }
.consents label { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-weight: 500; }
.consents input { width: 18px; height: 18px; margin-top: 3px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.review-item { background: #f2f5f2; border-radius: 10px; padding: 12px; }
.review-item small { display: block; color: var(--muted); }
.disclosure { margin-top: 22px; background: #fff4dd; border: 1px solid #ead2a4; border-radius: 12px; padding: 18px; }
.alert { margin-top: 18px; padding: 13px 16px; border-radius: 10px; background: var(--sky); }
.alert.error { color: #7d201d; background: #fce9e7; }
.result-card { max-width: 900px; margin: 30px auto; padding: clamp(24px, 5vw, 48px); }
.result-card h2 { font-size: clamp(30px, 5vw, 52px); margin: 10px 0; }
.result-amount { font-size: clamp(40px, 8vw, 72px); font-weight: 900; color: var(--pine); }
footer { background: var(--ink); color: #dce8e5; padding: 40px clamp(20px, 5vw, 72px); }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: #dce8e5; }

.admin-shell { background: #edf1ee; }
.admin-main { width: min(1420px, calc(100% - 32px)); margin: 0 auto; padding: 46px 0 90px; }
.login-card { max-width: 480px; margin: 7vh auto; padding: 36px; }
.login-card h1 { font-size: 42px; }
.login-card form { display: grid; gap: 16px; }
.dashboard-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.dashboard-title h1 { font-size: clamp(40px, 6vw, 68px); }
.mode-pill { border: 1px solid var(--pine); color: var(--pine); border-radius: 99px; padding: 8px 14px; font-size: 13px; font-weight: 800; }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 32px 0 22px; padding-bottom: 5px; }
.admin-tabs button { border: 0; background: transparent; color: var(--muted); padding: 11px 16px; border-radius: 9px; font-weight: 750; white-space: nowrap; }
.admin-tabs button.active { background: var(--pine); color: white; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 20px; }
.metric strong { display: block; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: 13px; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.panel { padding: 24px; box-shadow: 0 10px 32px rgba(23, 39, 43, .07); margin-bottom: 18px; overflow: hidden; }
.panel h2 { margin-top: 0; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.status { display: inline-block; border-radius: 99px; background: #e5ece8; padding: 4px 9px; font-size: 12px; font-weight: 750; }
.detail-panel { margin-top: 20px; }
.breakdown-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.breakdown-grid > div { background: #f1f5f2; border-radius: 10px; padding: 13px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
pre { white-space: pre-wrap; word-break: break-word; background: #142a28; color: #d9f2eb; border-radius: 10px; padding: 14px; max-height: 460px; overflow: auto; }
#rule-editor { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .trust-card { transform: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
  .path-grid { margin-top: -25px; }
}
@media (max-width: 620px) {
  .site-header, .admin-header { padding: 12px 18px; }
  .brand > span:last-child { font-size: 14px; }
  .customer-shell main { width: min(100% - 20px, 1180px); }
  .hero { padding: 60px 8px; }
  h1 { font-size: 43px; }
  .field-grid.two, .review-grid, .breakdown-grid { grid-template-columns: 1fr; }
  .inline-field { grid-template-columns: 1fr; }
  .progress-wrap { grid-template-columns: 1fr; }
  .progress-track { grid-column: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-title { align-items: start; flex-direction: column; }
  .panel-heading { align-items: start; flex-direction: column; }
  .path-grid { grid-template-columns: 1fr; }
}
@media print {
  .site-header, footer, .form-actions, .admin-tabs, .button { display: none !important; }
  body { background: white; }
  .result-card, .panel { box-shadow: none; border-color: #bbb; }
}
