/* Instant Estimate page */
.est-section { padding-top: 48px; }
.est-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
@media (max-width: 1000px) { .est-layout { grid-template-columns: 1fr; } }

.est-step { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.est-step h2 { font-size: 1.6rem; margin: 0 0 2px; }
.est-step p { margin: 0; color: var(--muted); }
.est-num-badge {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--gold); font-family: var(--head); font-size: 1.2rem; font-weight: 600;
}

/* Project tiles */
.est-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 560px) {
  .est-picker { grid-template-columns: 1fr 1fr; gap: 8px; }
  .est-tile { padding: 12px; }
  .est-tile[aria-pressed="true"] { padding: 11px; }
  .est-tile strong { font-size: .98rem; padding-right: 18px; }
  .est-tile span { font-size: .8rem; }
}
.est-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  font: inherit; color: var(--ink-2); cursor: pointer; position: relative;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.est-tile svg { color: var(--wood-dark); margin-bottom: 6px; }
.est-tile strong { font-family: var(--head); font-weight: 500; color: var(--ink); font-size: 1.05rem; letter-spacing: .02em; line-height: 1.2; }
.est-tile span { font-size: .88rem; color: var(--muted); line-height: 1.3; }
.est-tile:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.est-tile:focus-visible { outline: 3px solid rgba(229,173,79,.5); outline-offset: 2px; }
.est-tile[aria-pressed="true"] { border: 2px solid var(--gold); background: var(--wood-light); padding: 15px; }
.est-tile[aria-pressed="true"]::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5ad4f' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* Project cards */
.est-empty { padding: 28px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; margin: 0; }
.est-cards { display: grid; gap: 18px; }
.est-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 110px; }
.est-card > header { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.est-card .icon { width: 42px; height: 42px; margin: 0; flex: none; }
.est-card h3 { margin: 0; font-size: 1.2rem; flex: 1; min-width: 0; }
.est-card-total { font-family: var(--head); font-size: 1.1rem; color: var(--ink); white-space: nowrap; font-weight: 500; }
.est-remove {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--white);
  font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer;
}
.est-remove:hover { border-color: var(--ink); color: var(--ink); }
.est-fields { padding: 20px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.est-field { min-width: 0; }
.est-field small { display: block; color: var(--muted); font-size: .85rem; margin-top: 5px; line-height: 1.35; }
fieldset.est-field { grid-column: 1 / -1; }
.est-check { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-weight: 400; margin: -6px 0 0; color: var(--ink-2); cursor: pointer; }
.est-check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.est-num { display: flex; align-items: center; border: 1px solid #c9c4ba; border-radius: 8px; background: var(--white); overflow: hidden; }
.est-num:focus-within { outline: 3px solid rgba(165,98,42,.25); border-color: var(--wood); }
.est-num input { border: 0; outline: 0; min-width: 0; }
.est-num input:focus { outline: 0; }
.est-num span { padding: 0 14px; color: var(--muted); white-space: nowrap; font-size: .95rem; }
.est-num.pre span { padding: 0 0 0 14px; }
.est-num.pre input { padding-left: 4px; }
.est-seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #c9c4ba; border-radius: 8px; overflow: hidden; }
.est-seg label { margin: 0; font-weight: 400; cursor: pointer; position: relative; }
.est-seg label + label { border-left: 1px solid #c9c4ba; }
.est-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.est-seg span { display: block; text-align: center; padding: 11px 6px; color: var(--ink); }
.est-seg input:checked + span { background: var(--ink); color: var(--white); }
.est-seg input:focus-visible + span { outline: 3px solid rgba(229,173,79,.6); outline-offset: -3px; }
.est-note { margin: 0; padding: 0 18px 18px; font-size: .9rem; color: var(--muted); }
@media (max-width: 640px) {
  .est-fields { grid-template-columns: 1fr; }
  .est-card > header { flex-wrap: wrap; }
  .est-card-total { order: 4; width: 100%; padding-left: 56px; }
}

/* Summary */
.est-summary { position: sticky; top: 104px; }
@media (max-width: 1000px) { .est-summary { position: static; } }
.est-summary-card { background: var(--ink); color: #d3dbe5; border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.est-summary .eyebrow { color: var(--gold); }
.est-total { display: block; font-family: var(--head); font-size: clamp(1.9rem, 4vw, 2.4rem); color: var(--white); line-height: 1.1; font-weight: 600; margin-bottom: 18px; }
.est-lines { list-style: none; padding: 0; margin: 0 0 20px; border-top: 1px solid rgba(255,255,255,.15); }
.est-lines > li { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.est-group > div { display: flex; justify-content: space-between; gap: 12px; color: var(--white); }
.est-group > div strong { font-weight: 600; }
.est-group > div span { white-space: nowrap; }
.est-group ul { list-style: none; padding: 0; margin: 4px 0 0; font-size: .88rem; color: #aebbc9; }
.est-group ul li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.est-group ul li span:last-child { white-space: nowrap; }
.est-placeholder { color: #aebbc9; font-style: italic; }
.est-cta { width: 100%; justify-content: center; }
.est-mini-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.est-mini-actions button {
  font: inherit; font-size: .9rem; padding: 9px 8px; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.35);
}
.est-mini-actions button:hover { background: rgba(255,255,255,.1); }
.est-fine { font-size: .8rem; line-height: 1.5; color: #9fb0c2; margin: 18px 0 0; }

/* Mobile floating total */
.est-mobile-bar { display: none; }
@media (max-width: 1000px) {
  body.has-estimate .est-mobile-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 55;
    align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px;
    background: var(--ink); color: var(--white); border-radius: 10px; text-decoration: none;
    box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: .9rem;
  }
  .est-mobile-bar strong { font-family: var(--head); font-size: 1.1rem; font-weight: 500; }
  .est-mobile-bar span:last-child { color: var(--gold); }
  body.has-estimate { padding-bottom: 76px; }
}
@media (max-width: 640px) {
  body.has-estimate .est-mobile-bar { bottom: 60px; }
  body.has-estimate { padding-bottom: 128px; }
  .est-mobile-bar span:first-child { display: none; }
}

/* Print: just the estimate */
.print-only { display: none; }
@media print {
  .topbar, .site-header, .page-banner, .est-main, #est-contact, .site-footer, .call-bar, .est-mobile-bar, #est-actions { display: none !important; }
  body { padding: 0 !important; font-size: 12pt; }
  .section { padding: 0; }
  .est-layout { display: block; }
  .est-summary { position: static; }
  .est-summary-card { background: #fff; color: #222; box-shadow: none; padding: 0; }
  .print-only { display: flex; }
  .print-head { gap: 24px; align-items: center; border-bottom: 2px solid #1f3a5c; padding-bottom: 16px; margin-bottom: 20px; font-size: 10pt; }
  .print-head img { width: 180px; }
  .print-head strong { font-family: var(--head); font-size: 16pt; color: #1f3a5c; text-transform: uppercase; }
  .est-summary .eyebrow { color: #7a500c; }
  .est-total { color: #1f3a5c; }
  .est-lines, .est-lines > li { border-color: #ccc; }
  .est-group > div { color: #1f3a5c; }
  .est-group ul, .est-fine { color: #444; }
  .est-fine { font-size: 9pt; }
}
