/* MB Construction estimator. Uses the site's tokens from style.css. */
.est { padding: 56px 0 120px; background: var(--bg-soft); }
.est .container { max-width: 1240px; }
#estimator h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 10px; }
#estimator h3 { margin: 40px 0 8px; }
#estimator h4 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-dk); margin: 20px 0 6px; }
.est-sub { color: var(--muted); max-width: 46em; margin-bottom: 26px; }
.est-help { color: var(--muted); font-size: .94rem; margin: -2px 0 12px; max-width: 46em; }
.est-fine { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 14px 0 0; }
.est-note, .est-warn, .est-sample { font-size: .93rem; line-height: 1.5; border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.est-note { background: var(--teal-soft); color: var(--teal-xdk); }
.est-warn { background: #fdf0e3; color: #7a4210; border: 1px solid #f1d2b0; }
.est-sample { background: #fff; border: 1px dashed var(--accent); color: var(--ink); margin: 0 0 22px; }
.est-err { color: #a3261f; font-weight: 600; min-height: 1.4em; margin: 8px 0 0; }
.est-link { background: none; border: 0; font: inherit; font-weight: 600; color: var(--teal); cursor: pointer; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }
.est-link:hover { color: var(--teal-dk); }

/* chooser */
.est-choose { max-width: 960px; margin: 0 auto; text-align: center; }
.est-choose .est-sub { margin-left: auto; margin-right: auto; }
.est-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 8px; }
.est-big { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 36px 24px; cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.est-big:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.est-big strong { font-size: 1.3rem; }
.est-big > span:last-child { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.est-ic { width: 60px; height: 60px; border-radius: 16px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.est-ic svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.est-resume { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 0 auto 24px; max-width: 640px; }

/* header + progress */
.est-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.est-top span { color: var(--muted); font-size: .94rem; }
.est-prog { list-style: none; display: flex; gap: 6px; margin: 0 0 22px; padding: 0; overflow-x: auto; }
.est-prog li { flex: 1 0 auto; }
.est-prog button { width: 100%; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px 7px 8px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.est-prog button:disabled { cursor: default; opacity: .55; }
.est-prog .n { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; font-size: .78rem; }
.est-prog .done button { color: var(--teal-dk); }
.est-prog .done .n { background: var(--teal); color: #fff; }
.est-prog .cur button { background: var(--teal-xdk); color: #fff; border-color: var(--teal-xdk); }
.est-prog .cur .n { background: var(--accent); color: #fff; }

/* layout */
.est-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.est-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 40px 32px; box-shadow: var(--shadow); }
.est-side { position: sticky; top: 100px; }
.est-sum { background: var(--teal-xdk); color: #fff; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); max-height: calc(100vh - 124px); overflow: auto; }
.est-sum summary { list-style: none; cursor: pointer; display: block; }
.est-sum summary::-webkit-details-marker { display: none; }
.est-sum .lbl { display: block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-lt); font-weight: 700; }
.est-sum .big { display: block; font-size: 1.75rem; font-weight: 800; line-height: 1.2; margin-top: 4px; letter-spacing: -.01em; }
.est-sum h4 { color: var(--accent-lt); }
.est-sum ul { list-style: none; margin: 0; padding: 0; }
.est-sum li { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; line-height: 1.4; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.est-sum .amt { white-space: nowrap; color: #d3e2ea; }
.est-sum .est-meta { margin-top: 10px; font-size: .88rem; color: #d3e2ea; }
.est-sum .est-empty { color: #d3e2ea; font-size: .92rem; margin: 14px 0 0; }
.est-sum .est-fine { color: #b5cbd6; }
.est-sum .est-warn { background: rgba(231,163,102,.15); border-color: rgba(231,163,102,.4); color: #f6dcc2; }
.est-sum em, .est-lines em { font-style: normal; opacity: .7; }
.tier { text-transform: capitalize; font-weight: 700; padding: 1px 9px; border-radius: 999px; font-size: .82rem; }
.t-standard { background: #d7ecdf; color: #1d5a37; }
.t-moderate { background: #fbe6c8; color: #7a4a0e; }
.t-extensive { background: #f6d2cd; color: #8a2a20; }
.tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; background: rgba(231,163,102,.25); color: #a35a1f; padding: 1px 7px; border-radius: 999px; }
.est-sum .tag { color: #f6dcc2; }

/* fields */
.est-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; margin-bottom: 14px; }
.est-f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.est-f.full { margin-top: 18px; }
.est-f input, .est-f select, .est-f textarea { font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid #c3ced5; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.est-f textarea { resize: vertical; }
.est-in { display: flex; align-items: center; gap: 10px; }
.est-in em, .est-q em { font-style: normal; color: var(--muted); font-weight: 400; white-space: nowrap; }
.est-chk { display: flex; gap: 10px; align-items: center; margin: 6px 0 14px; cursor: pointer; }
.est-chk input { width: 20px; height: 20px; accent-color: var(--teal); }
.est-calc { background: var(--teal-soft); border-radius: 10px; padding: 12px 16px; margin: 6px 0 0; }

/* option cards */
.est-g { border: 0; padding: 0; margin: 0 0 30px; min-width: 0; }
.est-g legend { font-weight: 700; font-size: 1.12rem; padding: 0; margin-bottom: 10px; }
.est-g.compact legend { font-size: .98rem; }
.est-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.est-ow { display: flex; flex-direction: column; gap: 8px; }
.est-ow.wide { grid-column: 1 / -1; }
.est-o { position: relative; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 46px; cursor: pointer; transition: border-color .15s, background .15s; line-height: 1.4; }
.est-o:hover { border-color: #b9cad3; }
.est-o.on { border-color: var(--teal); background: var(--teal-soft); }
.est-o input { position: absolute; left: 15px; top: 16px; width: 20px; height: 20px; accent-color: var(--teal); }
.est-o .t { font-weight: 600; font-size: .98rem; }
.est-o .d { color: var(--muted); font-size: .85rem; }
.est-o .b { align-self: flex-start; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; background: #fdf0e3; color: #a35a1f; padding: 1px 8px; border-radius: 999px; margin-top: 4px; }
.est-q { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; padding: 4px 6px 0 6px; }
.est-q input { width: 90px; padding: 8px 10px; border: 1px solid #c3ced5; border-radius: 8px; font: inherit; }
.est-sub-g { background: var(--bg-soft); border-radius: 12px; padding: 16px 18px 4px; margin-bottom: 4px; }
.est-sub-g .est-g { margin-bottom: 16px; }

/* review */
.est-total { background: var(--teal-xdk); color: #fff; border-radius: 12px; padding: 22px 26px; display: flex; flex-direction: column; gap: 4px; margin: 10px 0 8px; }
.est-total strong { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; }
.est-total span { color: #d3e2ea; font-size: .92rem; }
.est-lines { list-style: none; margin: 0; padding: 0; }
.est-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.est-lines .amt { white-space: nowrap; color: var(--muted); }
.est-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* nav + toast */
.est-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 22px; }
.est-toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--teal-xdk); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 60; max-width: 90vw; font-size: .95rem; }
.est-toast.on { opacity: 1; transform: translate(-50%, 0); }
.est-hero-sm { padding: 72px 0 64px; }

@media (max-width: 900px) {
  .est { padding: 28px 0 150px; }
  .est-grid { grid-template-columns: 1fr; }
  .est-main { padding: 26px 20px 22px; }
  .est-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 55; }
  .est-sum { border-radius: 16px 16px 0 0; padding: 14px 18px; max-height: 72vh; }
  .est-sum .big { font-size: 1.35rem; }
  .est-sum:not([open]) summary::after { content: "Tap for details"; display: block; font-size: .78rem; color: #b5cbd6; margin-top: 2px; }
  .est-cards { grid-template-columns: 1fr; }
  .est-fields { grid-template-columns: 1fr; }
  .est-opts { grid-template-columns: 1fr; }
  .est-toast { bottom: 120px; }
}
@media print {
  .site-header, .site-footer, .est-prog, .est-side, .est-nav, .est-actions, .est-top, .page-hero { display: none !important; }
  .est { background: #fff; padding: 0; }
  .est-main { border: 0; box-shadow: none; padding: 0; }
}
