/* Estimate Flow — new-estimate cycle (ef- namespace) */

.ef-veil { position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 95; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ef-modal { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); width: min(1040px, 96vw); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }

.ef-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 24px 14px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0; }
.ef-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 8px; }
.ef-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.ef-step { font-size: 12px; font-weight: 600; color: var(--text-faint); padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-soft); }
.ef-step.active { background: var(--accent-ghost); border-color: var(--accent-dim); color: var(--accent); }
.ef-step.done { color: var(--text-dim); cursor: pointer; }
.ef-x { background: none; border: none; color: var(--text-dim); font-size: 26px; cursor: pointer; line-height: 1; }
.ef-x:hover { color: var(--text); }
.ef-x.sm { font-size: 16px; }

.ef-body { padding: 22px 26px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; }
.ef-pane { flex: 1; }
.ef-pane h2 { font-family: var(--font-display); font-size: 24px; font-weight: 500; margin: 0 0 12px; color: var(--text); }
.ef-sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 16px; line-height: 1.5; }
.ef-sub-inline { font-family: var(--font-ui); font-size: 13px; color: var(--text-faint); font-weight: 400; margin-left: 10px; }

.ef-input { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font: inherit; font-size: 13.5px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
.ef-input:focus { outline: none; border-color: var(--accent-dim); }
.ef-input.ef-addr { font-size: 17px; padding: 14px 16px; }
.ef-input.qty { width: 70px; flex-shrink: 0; }
.ef-input.price { width: 110px; flex-shrink: 0; }

.ef-btn { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; padding: 10px 18px; border-radius: var(--radius); cursor: pointer; }
.ef-btn:hover { border-color: var(--accent-dim); }
.ef-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.ef-btn.ghost { background: transparent; }
.ef-btn.lg { font-size: 15px; padding: 14px 26px; }
.ef-btn:disabled { opacity: 0.5; cursor: default; }
.ef-link { background: none; border: none; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.ef-error { background: oklch(0.70 0.16 25 / 0.12); border: 1px solid oklch(0.70 0.16 25 / 0.4); color: var(--text); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-top: 12px; }

/* address matches */
.ef-matches { margin-top: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.ef-matches-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); padding: 10px 14px 6px; }
.ef-match { display: flex; gap: 12px; align-items: baseline; width: 100%; text-align: left; background: none; border: none; border-top: 1px solid var(--border-soft); padding: 11px 14px; cursor: pointer; font: inherit; color: var(--text); }
.ef-match:hover { background: var(--bg-2); }
.ef-match-name { font-weight: 600; font-size: 13.5px; }
.ef-match-addr { color: var(--text-dim); font-size: 12.5px; flex: 1; }
.ef-match-count { color: var(--text-faint); font-size: 12px; }
.ef-linked { margin-top: 12px; color: var(--good); font-size: 13px; }

/* job types */
.ef-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ef-type { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 18px; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.ef-type:hover { border-color: var(--accent-dim); }
.ef-type.active { border-color: var(--accent); background: var(--accent-ghost); }
.ef-type-label { font-family: var(--font-display); font-size: 20px; margin-bottom: 4px; }
.ef-type-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; }
.ef-type-scope { color: var(--text-faint); font-size: 12px; line-height: 1.45; }

/* photos */
.ef-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 14px; max-height: 300px; overflow-y: auto; }
.ef-photo { position: relative; aspect-ratio: 1; border: none; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg-2); }
.ef-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ef-photo.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.ef-photo-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ef-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ef-upload-chip { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; }
.ef-upload-chip img { width: 100%; height: 100%; object-fit: cover; }
.ef-upload-chip button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6); border: none; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; cursor: pointer; line-height: 1; }

/* model / report */
.ef-analyze-cta { text-align: center; padding: 48px 0; }
.ef-analyzing { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 70px 0; color: var(--text-dim); font-size: 14px; }
.ef-spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: ef-spin 0.9s linear infinite; }
@keyframes ef-spin { to { transform: rotate(360deg); } }
.ef-report { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.ef-plan { width: 100%; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.ef-plan-empty { padding: 40px; color: var(--text-faint); text-align: center; background: var(--bg-2); border-radius: var(--radius); }
.ef-plan-label { font-size: 13px; fill: var(--text); font-weight: 600; }
.ef-dmg { stroke: #fff; stroke-width: 1.5; }
.ef-dmg-high { fill: oklch(0.60 0.20 25); }
.ef-dmg-med, .ef-dmg-medium { fill: oklch(0.75 0.15 80); }
.ef-dmg-low { fill: oklch(0.70 0.10 230); }
.ef-dmg-n { font-size: 10px; fill: #fff; font-weight: 700; }
.ef-verify { margin-top: 10px; color: var(--text-faint); font-size: 12px; line-height: 1.5; }
.ef-meas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.ef-meas { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px 8px; text-align: center; }
.ef-meas b { display: block; font-size: 15px; color: var(--text); }
.ef-meas.big b { font-size: 22px; color: var(--accent); }
.ef-meas span { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.ef-damage { margin-bottom: 12px; max-height: 180px; overflow-y: auto; }
.ef-dmg-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; color: var(--text); }
.ef-dmg-num { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.ef-dmg-row.sev-high .ef-dmg-num { background: oklch(0.60 0.20 25 / 0.25); border-color: oklch(0.60 0.20 25); }
.ef-summary { color: var(--text-dim); font-size: 13px; line-height: 1.6; border-top: 1px solid var(--border-soft); padding-top: 12px; }

/* scope */
.ef-scope-row { display: grid; grid-template-columns: 1fr 70px 36px 110px 90px 28px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ef-unit { color: var(--text-faint); font-size: 12px; }
.ef-line-total { text-align: right; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.ef-scope-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; }
.ef-total { color: var(--text-dim); font-size: 14px; }
.ef-total b { color: var(--text); font-size: 18px; }

/* review */
.ef-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.ef-review-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.ef-review-sum { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; color: var(--text); line-height: 1.8; }

.ef-foot { display: flex; gap: 10px; align-items: center; padding-top: 18px; margin-top: auto; flex-shrink: 0; }
.ef-done { text-align: center; padding: 50px 20px; }
.ef-done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--good); color: #08130b; font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.ef-done h2 { font-family: var(--font-display); font-weight: 500; color: var(--text); margin: 0 0 10px; }
.ef-done-detail { color: var(--text-dim); font-size: 14px; line-height: 1.8; margin-bottom: 22px; }

@media (max-width: 860px) {
  .ef-report { grid-template-columns: 1fr; }
  .ef-types { grid-template-columns: 1fr; }
  .ef-review-grid { grid-template-columns: 1fr; }
}
