/* === agent d: Estimates - the Estimate Builder (sg-estimate-builder 1.4.2, css/glass.css) inside Command Center ===
   Scoped to .eb (builder), .eb-wrap (estimate switcher) and .eb-railcard (ticket right column). Personality: navy + gold. */
.eb, .eb-wrap, .eb-railcard { --mod: #243D90; --mod-rgb: 36 61 144; --eb-sep: rgb(var(--sg-blue-rgb) / .16); --eb-lo: rgb(255 255 255 / .42); --eb-hi: rgb(255 255 255 / .86);
  --eb-ease: cubic-bezier(.32, .72, 0, 1); }
.eb { container-type: inline-size; font-size: 14px; line-height: 1.45; color: var(--ink); max-width: 1240px; margin: 0 auto; padding: 4px 0 18px; }
.eb .grow, .eb-wrap .grow, .eb-railcard .grow { flex: 1 1 auto; }

/* header: mark + "Estimate" + ticket + status pill */
.eb-top { display: flex; align-items: flex-start; gap: 14px; padding: 2px 6px 16px; }
.eb-mark { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1 1 auto; }
.eb-top .eb-pill { flex: none; }
.eb-mark img { width: 30px; height: 30px; display: block; flex: none; }
.eb-top h1 { margin: 0; font-size: 30px; line-height: 1.12; letter-spacing: -.021em; font-weight: 700; }
.eb-sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; letter-spacing: -.005em; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.eb-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* pills */
.eb-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 13px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; letter-spacing: -.005em;
  background: var(--eb-lo); border: .5px solid var(--eb-sep); color: var(--muted); white-space: nowrap; }
.eb-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.eb-pill.idle { color: var(--faint); }
.eb-pill.live { color: var(--sg-blue); background: rgb(var(--sg-blue-rgb) / .14); border-color: rgb(var(--sg-blue-rgb) / .3); }
.eb-pill.warn { color: #A86A00; background: rgb(var(--sg-gold-rgb) / .2); border-color: rgb(var(--sg-gold-rgb) / .42); }
.eb-pill.good { color: #0F7A58; background: rgb(15 138 107 / .12); border-color: rgb(15 138 107 / .3); }
.eb-pill.bad { color: #C7362B; background: rgb(199 54 43 / .1); border-color: rgb(199 54 43 / .28); }
.eb-pill.sm { height: 20px; font-size: 11px; padding: 0 9px; margin-left: 6px; vertical-align: 1px; }

/* glass cards */
.eb-card { background: var(--panel); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  container-type: inline-size; border-radius: 26px; box-shadow: var(--glass-edge), 0 1px 1px rgb(var(--sg-blue-rgb) / .06), 0 8px 24px rgb(var(--sg-blue-rgb) / .12); padding: 18px 20px; margin-bottom: 16px; }
.eb-card h2 { margin: 0 0 14px; font-size: 17px; font-weight: 650; letter-spacing: -.012em; }
.eb-count { color: var(--faint); font-weight: 500; margin-left: 4px; }
.eb-banner { margin: 0 0 16px; padding: 12px 16px; border-radius: 18px; background: rgb(255 255 255 / .62); box-shadow: inset 0 0 0 1px rgb(var(--sg-gold-rgb) / .5); color: var(--ink-2); font-size: 13px; }
.eb-banner b { color: var(--ink); }

.eb-cols { display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: 16px; align-items: start; }
.eb-rail { position: sticky; top: 12px; display: flex; flex-direction: column; }
@container (max-width: 900px) { .eb-cols { grid-template-columns: minmax(0, 1fr) 280px; } }
@container (max-width: 660px) { .eb-cols { grid-template-columns: minmax(0, 1fr); } .eb-rail { position: static; } }

/* fields */
.eb-fld { display: block; margin-bottom: 12px; min-width: 0; }
.eb-fld > span { display: flex; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; letter-spacing: -.004em; }
.eb :where(input:not([type=checkbox]):not([type=file]), textarea, select) {
  width: 100%; font: inherit; color: var(--ink); background: var(--eb-lo); border: .5px solid var(--eb-sep); border-radius: 14px; padding: 9px 12px; min-height: 0; outline: none; box-shadow: none;
  transition: border-color .18s var(--eb-ease), box-shadow .18s var(--eb-ease), background .18s var(--eb-ease); }
.eb textarea { resize: vertical; min-height: 66px; }
.eb :where(input, textarea, select):focus { border-color: var(--sg-blue-lift); box-shadow: 0 0 0 3.5px rgb(var(--sg-blue-rgb) / .22); background: var(--eb-hi); }
.eb :where(input, textarea)::placeholder { color: var(--faint); }
.eb :where(input, textarea, select):disabled { opacity: 1; color: var(--ink-2); background: rgb(255 255 255 / .28); }
.eb-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.eb-grid2.eb-addr { grid-template-columns: 1fr minmax(150px, 200px); }
.eb-grid3 { display: grid; grid-template-columns: 2fr 1fr 110px; gap: 0 10px; }
@container (max-width: 400px) { .eb-grid2, .eb-grid2.eb-addr { grid-template-columns: minmax(0, 1fr); } .eb-grid3 { grid-template-columns: 1fr 1fr; } .eb-grid3 > :first-child { grid-column: 1 / -1; } }

.eb-fold { margin: 2px 0 0; }
.eb-fold > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--sg-blue); padding: 6px 0; display: flex; gap: 8px; align-items: baseline; }
.eb-fold > summary::-webkit-details-marker { display: none; }
.eb-fold > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--eb-ease); align-self: center; }
.eb-fold[open] > summary::before { transform: rotate(45deg); }
.eb-fold > summary .muted { font-weight: 500; color: var(--muted); }
.eb-fold[open] > summary { margin-bottom: 8px; }

/* line items */
.eb-lines { display: flex; flex-direction: column; gap: 8px; }
.eb-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 104px 96px 32px; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 18px; background: var(--eb-lo); border: .5px solid var(--eb-sep); }
.eb .eb-line input { padding: 6px 9px; border-radius: 11px; }
.eb .eb-line input.eb-nm { font-weight: 600; letter-spacing: -.006em; background: transparent; border-color: transparent; padding: 2px 6px; margin-left: -6px; width: calc(100% + 6px); }
.eb .eb-line input.eb-nm:hover:not(:disabled) { border-color: var(--eb-sep); }
.eb .eb-line input.eb-nm:focus { background: var(--eb-hi); border-color: var(--sg-blue-lift); }
.eb .eb-line input.eb-nm:disabled { background: transparent; color: var(--ink); }
.eb-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.eb-meta { font-size: 11.5px; color: var(--faint); margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.eb-disc { display: inline-flex; align-items: center; gap: 4px; }
.eb .eb-disc input { width: 56px; padding: 2px 6px; border-radius: 8px; font-size: 12px; }
.eb-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 640; }
.eb-x { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--faint); font-size: 17px; cursor: pointer; line-height: 1; transition: background .15s, color .15s, transform .1s; }
.eb-x:hover { background: rgb(255 59 48 / .14); color: #D7362B; }
.eb-x:active { transform: scale(.9); }
@container (max-width: 500px) { .eb-line { grid-template-columns: minmax(0, 1fr) 60px 82px 30px; } .eb-line .eb-line-l { grid-column: 1 / -1; } .eb-line .eb-amt { grid-column: 1 / 2; grid-row: 2; text-align: left; } }
.eb-empty { padding: 26px 16px; text-align: center; color: var(--muted); border-radius: 18px; border: 1px dashed var(--eb-sep); }

/* catalog picker */
.eb-picker { margin-top: 12px; }
.eb-prow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eb .eb-search { flex: 1 1 200px; width: auto; border-radius: var(--r-pill); }
.eb-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--r-pill); background: var(--eb-lo); border: .5px solid var(--eb-sep); flex: none; }
.eb-seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); height: 30px; padding: 0 15px; border-radius: var(--r-pill); cursor: pointer; transition: background .2s var(--eb-ease), color .2s var(--eb-ease), transform .1s; }
.eb-seg button[aria-selected="true"] { background: var(--eb-hi); color: var(--ink); box-shadow: 0 1px 3px rgb(16 24 40 / .12); }
.eb-seg button:active { transform: scale(.97); }
.eb .btn.eb-sm, .eb-railcard .btn.eb-sm { height: 30px; min-height: 30px; padding: 0 12px; font-size: 12.5px; }
.eb-cat { margin-top: 8px; max-height: 232px; overflow: auto; overscroll-behavior: contain; border-radius: 18px; border: .5px solid var(--eb-sep); background: var(--eb-lo); }
.eb-cat-item { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-bottom: .5px solid var(--eb-sep); cursor: pointer; transition: background .12s; }
.eb-cat-item:last-child { border-bottom: 0; }
.eb-cat-item:hover, .eb-cat-item:focus-visible { background: var(--eb-hi); outline: none; }
.eb-cat-item:active { background: rgb(var(--sg-blue-rgb) / .1); }
.eb-cat-item.none { cursor: default; color: var(--muted); }
.eb-cat-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.eb-rate { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.eb-tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); background: rgb(var(--sg-blue-rgb) / .14); color: var(--sg-blue); flex: none; }
.eb-tag.part { background: rgb(var(--sg-gold-rgb) / .24); color: #8A5A00; }
.eb-tag.adder { background: rgb(15 138 107 / .12); color: #0F7A58; }
.eb-note { margin: 6px 4px 0; font-size: 11.5px; color: var(--faint); }
.eb-new { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--eb-lo); border: .5px solid var(--eb-sep); }

/* totals + actions */
.eb-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.eb .eb-row input { width: 104px; text-align: right; padding: 5px 9px; font-variant-numeric: tabular-nums; }
.eb-row.eb-grand { margin-top: 6px; padding-top: 13px; border-top: .5px solid var(--eb-sep); color: var(--ink); font-size: 15px; font-weight: 600; align-items: baseline; }
.eb-row.eb-grand b { font-size: 27px; letter-spacing: -.022em; font-weight: 700; }
.eb-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.eb-acts .btn, .eb-acts .eb-relwrap { width: 100%; }
.eb-acts .btn { height: 38px; font-size: 14px; justify-content: center; font-weight: 600; letter-spacing: -.006em; border-radius: var(--r-pill); text-decoration: none; transition: transform .16s var(--eb-ease), box-shadow .16s var(--eb-ease), opacity .16s; }
.eb-acts .btn:active:not(:disabled) { transform: scale(.965); }
.eb-acts .btn:disabled, .eb-acts .btn[disabled] { opacity: .42; pointer-events: none; }
.eb-acts .btn-secondary { background: #fff; border: .5px solid var(--eb-sep); color: var(--ink); }
.eb-acts .btn-secondary:hover { box-shadow: 0 1px 1px rgb(var(--sg-blue-rgb) / .06), 0 8px 24px rgb(var(--sg-blue-rgb) / .12); }
.eb-acts .btn-gold { color: #2A1D02; background: linear-gradient(180deg, var(--sg-gold), var(--sg-gold-deep)); border: .5px solid rgb(255 255 255 / .34); box-shadow: 0 1px 1px rgb(120 80 0 / .18), 0 8px 20px rgb(var(--sg-gold-rgb) / .34); }
.eb-acts .btn-primary { box-shadow: 0 1px 1px rgb(var(--sg-blue-rgb) / .3), 0 8px 20px rgb(var(--sg-blue-rgb) / .34); }
.eb .btn.eb-ghost { background: transparent; border: 0; box-shadow: none; color: var(--sg-blue); }
.eb .btn.eb-ghost:hover { background: rgb(var(--sg-blue-rgb) / .06); }
.eb-relwrap { display: flex; flex-direction: column; gap: 6px; }
.eb-hint { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); }
.eb-relwrap .eb-hint { margin: 0 2px; }
.eb-hint.bad { color: #C7362B; }
.eb-alt { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--eb-sep); }
.eb-banner .eb-alt { display: inline-flex; border: 0; margin: 0 0 0 6px; padding: 0; }
.eb-link { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--sg-blue); cursor: pointer; text-decoration: none; }
.eb-link:hover { text-decoration: underline; }
.eb-link.sm { font-size: 11.5px; font-weight: 500; padding: 0; }
.eb-dirty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 8px 12px; border-radius: 14px; background: rgb(var(--sg-gold-rgb) / .16); font-size: 12.5px; color: #8A5A00; }
.eb-dirty span { flex: 1 1 0; min-width: 120px; }

/* where this is */
.eb-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.eb-step { display: flex; gap: 11px; align-items: flex-start; padding: 7px 0; position: relative; }
.eb-step:not(:last-child)::after { content: ''; position: absolute; left: 9.5px; top: 30px; bottom: -6px; width: 1px; background: var(--eb-sep); }
.eb-mk { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px; margin-top: 1px; border: 1.5px solid var(--eb-sep); display: grid; place-items: center; color: var(--faint); background: rgb(255 255 255 / .5); transition: background .25s var(--eb-ease), border-color .25s var(--eb-ease); }
.eb-mk .ico { width: 12px; height: 12px; stroke-width: 3; }
.eb-step.done .eb-mk { background: var(--sg-blue); border-color: var(--sg-blue); color: #fff; }
.eb-step.part .eb-mk { background: #fff; border-color: var(--sg-blue); color: var(--sg-blue); }
.eb-step.active .eb-mk { border-color: var(--sg-gold-deep); box-shadow: 0 0 0 3px rgb(var(--sg-gold-rgb) / .22); }
.eb-st { font-weight: 600; letter-spacing: -.006em; }
.eb-step:not(.done):not(.part):not(.active) .eb-st { color: var(--muted); font-weight: 500; }
.eb-step.skip .eb-mk { border-style: dashed; background: transparent; }
.eb-step.skip .eb-st, .eb-step.skip .eb-sd { opacity: .7; }
.eb-sd { font-size: 12px; color: var(--muted); }
.eb-sd a { color: var(--sg-blue); font-weight: 600; }
.eb-trail { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.eb-trail li { padding: 6px 0; border-top: .5px solid var(--eb-sep); }
.eb-trail .muted { font-size: 11.5px; }

/* start card + estimate switcher */
.eb-start .eb-empty-card { max-width: 640px; }
.eb-empty-card p { margin: 0 0 14px; color: var(--ink-2); }
.eb-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 1240px; margin: 0 auto 6px; padding: 0 6px; }
.eb-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 13px; border-radius: var(--r-pill); border: .5px solid var(--eb-sep); background: var(--eb-lo); font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; transition: background .15s, transform .1s; }
.eb-chip:active { transform: scale(.97); }
.eb-chip.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(16 24 40 / .12), inset 0 0 0 1px rgb(var(--sg-blue-rgb) / .3); }
.eb-chip-st { color: var(--muted); }
.eb-switch .btn { height: 32px; min-height: 32px; }

/* ticket right column: the builder's left-rail card */
.eb-railcard .eb-rhd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.eb-railcard .eb-rhd img { width: 20px; height: 20px; }
.eb-railcard .eb-rhd b { font-size: 14px; letter-spacing: -.008em; }
.eb-railcard .eb-pill.sm { margin-left: 0; }
.eb-big { font-size: 25px; font-weight: 700; letter-spacing: -.022em; font-variant-numeric: tabular-nums; }
.eb-racts { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.eb-racts .btn { width: 100%; justify-content: center; border-radius: var(--r-pill); text-decoration: none; }

@media (max-width: 620px) {
  .eb-card { padding: 16px; border-radius: 22px; }
  .eb-top h1 { font-size: 26px; }
  .eb-prow .eb-seg { order: 1; } .eb .eb-search { order: 3; flex-basis: 100%; } .eb-prow .eb-sm { order: 2; margin-left: auto; }
}
@media (prefers-reduced-transparency: reduce) { .eb-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; } }
@media (prefers-reduced-motion: reduce) { .eb *, .eb-wrap *, .eb-railcard * { transition-duration: .001ms !important; } }
@container (max-width: 560px) {
  .eb-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .eb-sub .eb-dot { display: inline-block; vertical-align: middle; margin: 0 6px; }
  .eb-mark img { width: 24px; height: 24px; }
}
