/* Bullet Portal — Job Estimator (est.js). Scoped to .est / es- classes so it
   can't touch the rest of the portal. Brand Guide: navy text on white cards on
   the off-white page, cyan/teal for accents, the gradient only as an accent. */
.est {
  --ground: #F7F7F7; --surface: #FFFFFF; --surface-2: #F3F5F7; --surface-3: #E7EBEF;
  --line: #E2E7EC; --line-strong: #C6D0DA; --ink: #062141; --ink-2: #2E4460; --muted: #5F7186;
  --accent: #0E92AA; --accent-soft: #DCF3F7; --good: #158457; --good-soft: #DDF5E8;
  --warn: #92660A; --warn-soft: #F5EBCB; --crit: #B03030; --crit-soft: #F7DDDA;
  --teal: #23C2B7; --row-on: #E9F7FA; --flash: #C9F0E0;
  --gradient: linear-gradient(90deg, #062141 0%, #13B3CF 35%, #23C2B7 65%, #43E285 100%);
  --underline: linear-gradient(90deg, #13B3CF 0%, #23C2B7 50%, #43E285 100%);
  --shadow: 0 1px 2px rgba(6,33,65,.05), 0 10px 28px -18px rgba(6,33,65,.22);
  color: var(--ink); font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
.est *, .est *::before, .est *::after { box-sizing: border-box; }
.est [hidden] { display: none !important; }
:where(.est) button { font: inherit; cursor: pointer; }
.est :focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.est h1, .est h2, .est h3 { margin: 0; color: var(--ink); text-wrap: balance; }

.es-wrap { max-width: 1120px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.es-wrap.wide { max-width: 1440px; }
.es-wrap > *, .es-edit > * { min-width: 0; }
.es-edit { display: grid; gap: 16px; min-width: 0; }
.es-muted { color: var(--muted); margin: 4px 0 0; }
.es-sub { color: var(--muted); font-size: 12px; }
.es-pad { padding: 12px 16px 16px; }
.es-pad-x { padding: 0 16px; margin: 0 0 8px; }
.es-pad0 { padding: 0 !important; }
.es-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.es-empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.es-err { color: var(--crit); font-size: 13px; min-height: 1px; }
.num, .es-tbl td.num, .es-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 700; }

.es-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.es-card-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; }
.es-card-h h3 { font-size: 15px; font-weight: 700; padding-bottom: 5px; background: var(--underline) left bottom / 100% 2px no-repeat; }
.es-tot { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

/* buttons */
.es-btn, .es-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 14px; border-radius: 9px;
  font-weight: 700; font-size: 13px; transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease; white-space: nowrap; }
.es-btn { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.es-btn:hover { box-shadow: 0 2px 4px rgba(6,33,65,.06), 0 14px 34px -16px rgba(35,194,183,.45); }
.es-btn.danger { background: var(--crit); border-color: var(--crit); }
.es-btn:disabled { opacity: .6; cursor: default; }
.es-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.es-ghost:hover, .es-ghost.on { border-color: var(--teal); }
.es-ghost.on { background: var(--row-on); }
.es-ghost.danger { color: var(--crit); }
.es-btn.sm, .es-ghost.sm { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.es-btn:active, .es-ghost:active { transform: scale(.98); }
.es-link { background: none; border: 0; padding: 4px; color: var(--accent); font-weight: 600; font-size: 13px; }
.es-link:hover { text-decoration: underline; }
.es-x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 7px; border-radius: 6px; }
.es-x:hover { background: var(--surface-3); color: var(--crit); }
.es-chipbtn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.es-chipbtn:hover { border-color: var(--teal); color: var(--accent); }

/* inputs */
.es-in { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--ink); min-width: 0; }
.es-in:hover { border-color: var(--accent); }
.es-in:disabled { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
input.es-in[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
input.es-in::placeholder { color: #9AA8B8; }
.es-in-sm { font-size: 12px; padding: 3px 6px; }
.es-search { width: min(320px, 100%); padding: 8px 10px; }
.es-modal .es-pad > .es-in { width: 100%; padding: 9px 10px; font-size: 14px; margin-bottom: 6px; }
.es-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.es-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.es-field.wide { grid-column: span 2; }
.es-field small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.es-inline { display: inline-flex; align-items: center; gap: 4px; text-transform: none; letter-spacing: 0; }
.es-inline i { font-style: normal; color: var(--muted); font-weight: 600; }
.es-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }
.es-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.es-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); text-transform: none; letter-spacing: 0; }
.es-seg button { border: 0; background: transparent; padding: 6px 11px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.es-seg button[aria-checked="true"] { background: var(--ink); color: #fff; }

/* pills & chips */
.es-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.es-pill.bid { background: var(--accent-soft); color: var(--accent); }
.es-pill.lock { background: var(--good-soft); color: var(--good); }
.es-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.es-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.es-chip.warn { background: var(--warn-soft); color: var(--warn); }
.es-chip-x { border: 0; background: none; color: var(--muted); padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.es-chip-x:hover { color: var(--crit); }
.es-gl { display: inline-block; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; cursor: help; }

/* list page */
.es-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.es-h1 { font-size: 24px; font-weight: 800; letter-spacing: .01em; }
.es-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.es-who { margin-left: auto; font-size: 12px; color: var(--muted); }
.es-emptycard { text-align: center; padding: 32px 16px; display: grid; justify-items: center; gap: 8px; }
.es-click { cursor: pointer; }
.es-click:hover td { background: var(--surface-2); }
.es-msg { max-width: 560px; display: grid; gap: 10px; }
.es-signin { max-width: 420px; width: 100%; margin: 24px auto; display: grid; }
.es-signin .es-btn { margin-top: 14px; }
.es-signin .es-in { padding: 9px 10px; font-size: 15px; }

/* tables */
.es-tbl-wrap { overflow-x: auto; }
.es-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.es-tbl th { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.es-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.es-tbl tr:last-child td { border-bottom: 0; }
.es-tbl th:first-child, .es-tbl td:first-child { padding-left: 16px; }
.es-tbl th:last-child, .es-tbl td:last-child { padding-right: 12px; }
.es-tbl td input[type=text] { width: 100%; min-width: 170px; }
.es-mini { margin-top: 3px; }
.es-mini input { width: 100%; min-width: 120px; }
.es-none { padding: 14px 16px !important; }
.es-ot { color: var(--warn); font-weight: 700; }
.es-glsel { max-width: 260px; }
tr.es-flash td { animation: es-flash 1.8s ease-out; }
@keyframes es-flash { 0%, 35% { background: var(--flash); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr.es-flash td { animation: none; } }
.es-glsum { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px; border-top: 1px dashed var(--line-strong); font-size: 12px; color: var(--ink-2); }
.es-glitem { display: inline-flex; gap: 5px; align-items: center; font-variant-numeric: tabular-nums; }
.es-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 16px 12px; }
.es-sched { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; padding: 10px 16px; background: var(--surface-2); border-block: 1px solid var(--line); }
.es-sched p { margin: 0; flex: 1 1 280px; }

/* editor header */
.es-ehead { display: grid; gap: 8px; }
.es-back { justify-self: start; padding-left: 0; }
.es-ehead-main { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.es-titlewrap { display: grid; gap: 6px; min-width: 0; flex: 1 1 420px; }
.es-title { font: inherit; font-size: 22px; font-weight: 800; color: var(--ink); border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; margin-left: -7px; background: transparent; width: 100%; }
.es-title:hover:not(:disabled), .es-title:focus { border-color: var(--line-strong); background: var(--surface); }
.es-jobline { font-size: 13px; color: var(--ink-2); }
.es-jobline b { margin-right: 6px; }
.es-scope-in { width: 220px; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.es-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; max-width: 640px; }
.es-save { font-size: 12px; color: var(--muted); min-width: 110px; }
.es-save.dirty, .es-save.saving { color: var(--warn); }
.es-save.error { color: var(--crit); font-weight: 600; }
.es-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.es-banner.lock { background: var(--good-soft); }
.es-warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; display: grid; gap: 2px; }
.es-panel .es-pad { padding-top: 0; }

/* KPIs */
.es-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.es-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.es-kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--underline); }
.es-kpi-l { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.es-kpi-v { font-size: 24px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.es-kpi-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.es-kpi.warn .es-kpi-s { color: var(--warn); font-weight: 600; }
@media (max-width: 1100px) { .es-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .es-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .es-kpi-v { font-size: 20px; } }

/* price + P&L */
.es-bottom { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1380px) { .es-bottom { grid-template-columns: minmax(0, 1fr); } }
.es-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; padding: 10px 16px 12px; background: var(--surface-2); border-block: 1px solid var(--line); }
.es-slider { display: grid; gap: 4px; flex: 1 1 200px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.es-slider b { color: var(--ink); font-size: 15px; letter-spacing: 0; }
.es-slider input { width: 100%; accent-color: var(--accent); }
.es-ladder tbody tr { cursor: pointer; }
.es-ladder td, .es-ladder th { padding-inline: 7px; }
.es-ladder tbody tr:hover td { background: var(--surface-2); }
.es-ladder tr.on td { background: var(--row-on); font-weight: 700; }
.es-ladder tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.es-ladder tr.na td { color: var(--muted); font-style: italic; cursor: default; }
.es-pl td { padding: 5px 8px; }
.es-pl tr.pl-section td { font-weight: 700; padding-top: 12px; }
.es-pl tr.d1 td:first-child { padding-left: 28px; }
.es-pl tr.d2 td:first-child { padding-left: 44px; }
.es-pl tr.pl-group td { font-weight: 600; }
.es-pl tr.pl-subtotal td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.es-pl tr.pl-total td { font-weight: 700; border-top: 2px solid var(--ink); }
.es-pl tr.pl-gross td, .es-pl tr.pl-net td { font-weight: 800; background: var(--good-soft); color: var(--good); }
.es-pl tr.pl-net td { border-top: 2px solid var(--good); }
.es-notes { width: 100%; resize: vertical; margin: 0 16px 16px; width: calc(100% - 32px); }

/* modal + toast */
.es-modal-back { position: fixed; inset: 0; background: rgba(4,20,40,.55); display: grid; place-items: start center; padding: 6vh 16px 16px; z-index: 60; overflow-y: auto; }
.es-modal { background: var(--surface); border-radius: 14px; width: min(720px, 100%); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); border: 1px solid var(--line); overflow: hidden; }
.es-modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 4px; }
.es-modal-h h2 { font-size: 17px; }
html.es-lock { overflow: hidden; }
.es-pick-list { max-height: 58vh; overflow-y: auto; padding: 0 8px 10px; display: grid; gap: 2px; }
.es-pick { text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 10px; display: grid; gap: 4px; color: var(--ink); }
.es-pick:hover, .es-pick:focus-visible { background: var(--surface-2); }
.es-pick-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.es-defaults { display: grid; gap: 10px; }
.es-defaults h3 { font-size: 13px; margin-top: 6px; }
.es-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.es-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #062141; color: #fff; padding: 10px 14px; border-radius: 10px;
  font-weight: 600; font-size: 13px; box-shadow: var(--shadow); z-index: 70; max-width: calc(100% - 32px); display: flex; gap: 10px; align-items: center; }
.es-toast.crit { background: var(--crit); }
.es-toast .es-link { color: #CFEFF6; }

@media (max-width: 640px) {
  .es-wrap { padding: 12px; }
  .es-title { font-size: 19px; }
  .es-actions { justify-content: flex-start; }
  .es-who { margin-left: 0; }
  .es-in { font-size: 16px; }            /* no iOS zoom on focus */
  .es-field.wide { grid-column: auto; }
}

/* compare with similar jobs (phase 3) */
.es-cmp-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 16px 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink-2); font-size: 13px; }
.es-cmp-banner b { color: var(--ink); }
.es-chip.hit { background: var(--good-soft); color: var(--good); }
.es-chipbtn.on { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.es-score { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.es-score i { display: block; width: 56px; height: 6px; border-radius: 3px; background: var(--surface-3); position: relative; overflow: hidden; }
.es-score i b { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.es-cand tr.sel td { background: var(--row-on); }
.es-cand td { white-space: nowrap; }
.es-cand td:nth-child(2) { white-space: normal; min-width: 200px; }
.es-cand td:nth-child(6) { white-space: normal; min-width: 240px; }
.es-cand input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.es-cmp-notes { margin: 0; padding: 4px 16px 10px 34px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.es-cmp-notes:empty { display: none; }
.es-sbs th, .es-sbs td { min-width: 150px; }
.es-sbs th:first-child, .es-sbs td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 210px; }
.es-sbs thead th { vertical-align: bottom; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink); white-space: normal; }
.es-sbs thead th b { display: block; font-size: 13px; }
.es-sbs thead th span { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.es-sbs .me { background: var(--row-on); }
.es-sbs tr.sec td, .es-sbs tr.sec td:first-child { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.es-sbs tr.ind td:first-child { padding-left: 30px; color: var(--ink-2); }
.es-sbs tr.bold td { font-weight: 700; }
.es-sbs .med { color: var(--ink-2); font-style: italic; }
.es-sbs td:first-child .es-sub { font-weight: 400; }
.es-dlt { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.es-dlt.up { background: var(--warn-soft); color: var(--warn); }
.es-dlt.down { background: var(--crit-soft); color: var(--crit); }
.es-grey { color: var(--muted); opacity: .7; }

/* the assistant (phase 4): a panel beside the estimate */
.es-ai-btn { background: linear-gradient(90deg, #0E92AA, #178E87); border-color: transparent; }
.es-ai-btn.on { background: var(--ink); }
.es-ai { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100%; z-index: 50; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: -12px 0 40px -24px rgba(6,33,65,.45); display: flex; flex-direction: column; }
.es-ai::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--underline); }
@media (min-width: 1280px) { html.es-ai-open .es-wrap.wide { margin-right: 456px; margin-left: 16px; } }
.es-ai-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.es-ai-h h3 { font-size: 15px; }
.es-ai-turns { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.es-ai-intro { color: var(--ink-2); font-size: 13.5px; display: grid; gap: 6px; }
.es-ai-intro p { margin: 0; }
.es-ai-me { align-self: flex-end; max-width: 88%; background: var(--ink); color: #fff; padding: 9px 12px; border-radius: 12px 12px 4px 12px; font-size: 13.5px; white-space: pre-wrap; }
.es-ai-me .es-sub { color: #A9BBD1; margin-top: 3px; font-size: 11px; }
.es-ai-bot { align-self: flex-start; max-width: 100%; display: grid; gap: 8px; font-size: 13.5px; }
.es-ai-bot.err { color: var(--crit); }
.es-ai-bot.busy { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.es-ai-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 10px 12px; }
.es-ai-text p { margin: 0 0 6px; } .es-ai-text p:last-child { margin: 0; }
.es-chip.src { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.es-ai-props { display: grid; gap: 8px; }
.es-ai-prop { border: 1px solid var(--accent); border-radius: 10px; padding: 9px 11px; display: grid; gap: 5px; background: var(--surface); }
.es-ai-prop.done { border-color: var(--line); background: var(--surface-2); }
.es-ai-prop.note:not(.done) { border-style: dashed; }
.es-ai-prop-t { font-weight: 600; font-size: 13px; }
.es-added { color: var(--good); font-weight: 700; font-size: 12.5px; }
.es-ai-foot { border-top: 1px solid var(--line); padding: 10px 16px 14px; display: grid; gap: 8px; background: var(--surface); }
.es-ai-chips .es-chipbtn { text-align: left; }
.es-ai-in { width: 100%; resize: vertical; min-height: 64px; font-size: 14px; }
.es-ai-send { justify-content: space-between; }
.es-dots { display: inline-flex; gap: 3px; }
.es-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: es-bob 1s infinite; }
.es-dots i:nth-child(2) { animation-delay: .15s; } .es-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes es-bob { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .es-dots i { animation: none; } }
@media (max-width: 640px) { .es-ai { width: 100%; } .es-ai-in { font-size: 16px; } }
/* past job cost lines + QuickBooks attachments (openJobLines / openAttachment) */
.est .es-lines, .es-modal .es-lines { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.es-modal .es-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.es-modal .es-tbl th, .es-modal .es-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.es-modal .es-tbl th { position: sticky; top: 0; background: var(--surface); }
.es-modal .es-tbl .num { text-align: right; white-space: nowrap; }
.es-modal .es-memo { max-width: 260px; }
.es-clip { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 1px 6px; cursor: pointer; font-size: 12px; }
.es-clip:hover { border-color: var(--accent); }
.es-modal.es-modal-wide { width: min(1100px, 100%); }
.es-file { display: grid; gap: 8px; padding-bottom: 12px; }
.es-frame { width: 100%; height: 75vh; border: 0; background: #fff; }
.es-img { max-width: 100%; display: block; margin: 0 auto; }
.es-modal a.es-ghost { text-decoration: none; }
.es-clip.off { opacity: .45; border-style: dashed; }
/* Takeoff bids (estbid.js): the takeoff → Bullet estimate review, estimator `all` only */
.es-tabs { margin-top: 10px; }
.eb-note { color: var(--ink-2); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.eb-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 980px) { .eb-two { grid-template-columns: minmax(0, 1fr); } }
.eb-tag { margin-left: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--good); background: var(--good-soft); border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }
.eb-have { color: var(--good); font-weight: 700; }
.eb-miss { color: var(--muted); }
.eb-flags { list-style: none; margin: 0; padding: 0 16px 14px; display: grid; gap: 10px; }
.eb-flag { border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface); }
.eb-flag.high { border-left-color: var(--crit); }
.eb-flag.medium { border-left-color: #D9A21B; }
.eb-flag.info { border-left-color: var(--accent); }
.eb-flag.settled { background: var(--surface-2); border-left-color: var(--good); }
.eb-flag p { margin: 0; line-height: 1.5; }
.eb-flag-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.eb-lvl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.eb-lvl.high { color: var(--crit); background: var(--crit-soft); }
.eb-lvl.medium { color: var(--warn); background: var(--warn-soft); }
.eb-lvl.info { color: var(--accent); background: var(--accent-soft); }
.eb-done > summary, .eb-docs > summary { cursor: pointer; padding: 8px 16px 12px; color: var(--accent); font-weight: 600; font-size: 13px; }
.eb-docs > .es-tbl-wrap { max-height: 520px; overflow: auto; border-top: 1px solid var(--line); }
.eb-picks { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.eb-picks .es-field.wide { grid-column: auto; }
.eb-picks select { text-transform: none; letter-spacing: 0; font-weight: 500; width: 100%; }
.eb-picks small { color: var(--muted); }
tr.eb-using td { background: var(--row-on); }
.eb-kv td:first-child { color: var(--ink-2); }
.eb-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; align-items: start; }
.eb-rules .es-link { justify-self: start; align-self: end; }
.eb-lines tr.eb-sec td, .eb-act tr.eb-sec td { font-weight: 700; background: var(--surface-2); }
.eb-lines td:last-child { max-width: 340px; }
.eb-misc { border-top: 1px solid var(--line); display: grid; gap: 8px; }
.eb-misc-h { gap: 10px; }
.eb-misc-t td { padding: 4px 6px; vertical-align: middle; }
.eb-misc-t td:first-child { width: 50%; }
.eb-ref td { color: var(--muted); font-style: italic; }
.eb-subrow td:first-child { padding-left: 26px; color: var(--ink-2); }
.eb-over { color: var(--crit); }
.eb-under { color: var(--good); }
.eb-learn { margin: 0; padding: 4px 16px 16px 34px; display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; }
tr.eb-tbd td, .eb-tbd { color: var(--warn); }
tr.eb-allow td { background: var(--surface-2); }
tr.eb-excl td { text-decoration: line-through; }
.eb-notein { width: 100%; resize: vertical; font-size: 14px; }
@media (max-width: 640px) { .eb-notein, .eb-misc input, .eb-rules input, .eb-picks select { font-size: 16px; } }
