/* BidRidge styles. Mobile first. */
:root {
  --ink: #1c2b3a;
  --ink-2: #44546a;
  --muted: #6b7785;
  --line: #dde3ea;
  --bg: #f4f6f8;
  --card: #ffffff;
  --brand: #1f3b57;
  --accent: #c2622d;
  --accent-ink: #ffffff;
  --ok: #1e7a46; --ok-bg: #e3f4ea;
  --warn: #9a5b00; --warn-bg: #fff3d6;
  --bad: #a3242a; --bad-bg: #fde7e8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 2px 8px rgba(20, 30, 45, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; } h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-top: 1em; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }

/* top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand-logo { height: 38px; width: auto; display: block; }
#topbar-right { display: flex; gap: 6px; }
.iconbtn { text-decoration: none; color: var(--brand); font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.iconbtn:hover, .iconbtn:focus-visible { background: var(--bg); }

main { max-width: 860px; margin: 0 auto; padding: 12px 16px 96px; }

/* panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h2 { display: inline; }
details.panel > summary::after { content: "Show"; float: right; color: var(--brand); font-weight: 600; font-size: .9rem; }
details.panel[open] > summary::after { content: "Hide"; }
details.panel[open] > summary { margin-bottom: 12px; }
.hero { padding: 20px 4px 8px; }
.hero p { color: var(--ink-2); margin: 0 0 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 1rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #b9c3ce; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(194, 98, 45, .35); outline-offset: 1px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); border-color: var(--accent); }
.btn-danger { color: var(--bad); border-color: #f0c4c6; }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 1.05rem; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* job list */
.search { width: 100%; margin: 4px 0 10px; }
.joblist { display: grid; gap: 8px; }
.jobcard { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; background: #fff; }
.jobcard:hover { border-color: #b9c3ce; }
.jc-name { font-weight: 700; }
.jc-sub { color: var(--muted); font-size: .9rem; }
.jc-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.jc-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--ink-2); }
.pill-sold, .pill-done { background: var(--ok-bg); color: var(--ok); }
.pill-sent { background: #e6eefb; color: #2856a3; }
.pill-lead { background: #fbe9dd; color: #9a4518; }
.pill-lost { background: var(--bad-bg); color: var(--bad); }

/* forms */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px 16px; }
@media (min-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } .grid.g3 { grid-template-columns: 1fr 1fr 1fr; } .field.wide { grid-column: 1 / -1; } }
.grid.g3 { grid-template-columns: 1fr 1fr; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=search], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c9d2dc; border-radius: 10px; background: #fff; color: var(--ink); font: 1rem var(--font); }
textarea { min-height: 88px; resize: vertical; }
.inwrap { display: flex; align-items: stretch; }
.inwrap input { flex: 1; min-width: 0; }
.inwrap .affix { display: flex; align-items: center; padding: 0 10px; color: var(--muted); background: var(--bg); border: 1px solid #c9d2dc; font-size: .9rem; }
.inwrap .affix:first-child { border-right: 0; border-radius: 10px 0 0 10px; }
.inwrap .affix:last-child { border-left: 0; border-radius: 0 10px 10px 0; }
.inwrap .affix:first-child + input { border-radius: 0 10px 10px 0; }
.inwrap input:not(:last-child) { border-radius: 10px 0 0 10px; }
.inwrap .affix:first-child + input:not(:last-child) { border-radius: 0; }
.hint { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.fb { color: #2856a3; font-size: .82rem; margin-top: 4px; }
.fb:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 8px 12px; border-radius: 99px; border: 1px solid #c9d2dc; background: #fff; color: var(--ink); font: 600 .9rem var(--font); cursor: pointer; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-ghost { border-style: dashed; color: var(--muted); }
.chip-ghost.on { background: #e9eef4; color: var(--ink-2); border-color: #9fb0c2; }

/* job header + steps */
.jobhead { position: sticky; top: calc(55px + env(safe-area-inset-top, 0px)); z-index: 10; background: var(--bg); margin: 0 -16px; padding: 6px 16px 8px; border-bottom: 1px solid var(--line); }
.jh-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.steps::-webkit-scrollbar { display: none; }
.step { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .88rem;
  padding: 6px 10px 6px 6px; border-radius: 99px; background: #fff; border: 1px solid var(--line); }
.stepn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); font-size: .78rem; }
.step.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.step.on .stepn { background: rgba(255, 255, 255, .2); }
.sumbar { display: grid; grid-template-columns: auto auto auto 1fr; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }
.sb-lab { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sb-price { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.sb-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-status { justify-self: end; font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 99px; }
.sb-status.ok, .status-tag.ok { background: var(--ok-bg); color: var(--ok); }
.sb-status.flag, .status-tag.flag { background: var(--bad-bg); color: var(--bad); }
.status-tag { font-size: .75rem; padding: 3px 9px; border-radius: 99px; vertical-align: middle; margin-left: 6px; }
.stepfoot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); }
.stepfoot .btn { flex: 1; max-width: 260px; }

/* outputs */
.out { margin: 10px 0 0; }
.out.big { font-size: 1.05rem; margin: 6px 0 12px; padding: 10px 12px; background: #eef3f8; border-radius: 10px; }
.notice { padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.notice.warn { background: var(--warn-bg); color: #6b4300; }
.sidecard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; }
.sidename { font-weight: 700; border: 0; padding: 4px 0; min-height: 32px; background: transparent; width: 60%; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv b { text-align: right; font-variant-numeric: tabular-nums; }

/* price */
.optgrid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
@media (min-width: 600px) { .optgrid { grid-template-columns: repeat(3, 1fr); } }
.optcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.optcard.rec { border: 2px solid var(--accent); background: #fff8f3; }
.oc-name { font-weight: 700; }
.oc-price { font-size: 1.7rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.oc-row { display: flex; justify-content: space-between; font-size: .9rem; padding: 2px 0; }
.oc-row span { color: var(--muted); }
.check { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.check:last-child { border-bottom: 0; }
.st { display: inline-block; text-align: center; font-weight: 800; font-size: .72rem; padding: 3px 0; border-radius: 6px; }
.st-ok { background: var(--ok-bg); color: var(--ok); }
.st-check { background: var(--bad-bg); color: var(--bad); }
.st-info { background: var(--warn-bg); color: var(--warn); }
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.strong td { font-weight: 700; }
.tbl.edit input { min-height: 36px; padding: 6px 8px; width: 84px; text-align: right; border: 1px solid #c9d2dc; border-radius: 8px; font: .92rem var(--font); }
.tbl.edit td:first-child input { width: 100%; text-align: left; }
.tbl.edit input.flags { width: 76px; text-align: left; text-transform: uppercase; }
.tick { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.tick input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--brand); }
.prose ol { padding-left: 1.2em; } .prose li { margin: 6px 0; }

/* proposal document */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 12px 0; box-shadow: var(--shadow); font-size: .95rem; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--brand); padding-bottom: 10px; }
.doc-co { font-size: 1.4rem; font-weight: 800; color: var(--brand); }
.doc-sub { color: var(--muted); font-size: .82rem; }
.doc-logo { height: 64px; width: auto; }
.doc-title { color: #2a6f86; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em; margin: 14px 0 10px; }
.doc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; font-size: .9rem; margin-bottom: 8px; }
.doc-info span { display: inline-block; width: 92px; color: var(--muted); font-weight: 700; font-size: .8rem; }
.doc h3 { background: var(--brand); color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; padding: 5px 8px; margin: 16px 0 8px; }
.doc p { margin: 0 0 6px; }
.doc-tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.doc-tbl th { background: #e9eef4; text-align: left; padding: 6px; font-size: .78rem; }
.doc-tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.doc-tbl .r { text-align: right; } .doc-tbl .big { font-size: 1.1rem; font-weight: 800; color: var(--brand); }
.doc-tbl tr.rec td { background: #fff3cc; }
.doc-desc { font-size: .82rem; color: var(--ink-2); margin-top: 2px; }
.doc-scope { columns: 2; column-gap: 28px; padding: 0; margin: 0; list-style: none; font-size: .88rem; }
.doc-scope li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; break-inside: avoid; }
.doc-list { margin: 0; padding-left: 1.1em; font-size: .88rem; }
.sig { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; margin-top: 30px; }
.sig div { border-top: 1px solid var(--ink); padding-top: 4px; font-size: .8rem; color: var(--muted); }
@media (max-width: 560px) { .doc { padding: 16px; } .doc-info { grid-template-columns: 1fr; } .doc-scope { columns: 1; } .doc-logo { height: 44px; } .doc-co { font-size: 1.1rem; } }

.print-only { display: none; }

.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(20, 30, 45, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 18px; max-width: 420px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.modal p { margin: 0 0 12px; font-weight: 600; }
#copybox, #pastebox { margin-top: 8px; font: .8rem ui-monospace, Menlo, monospace; }

/* trade picker */
.tradegrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .tradegrid { grid-template-columns: 1fr 1fr; } }
.tradecard { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; box-shadow: var(--shadow); min-height: 84px; }
.tradecard:hover, .tradecard:focus-visible { border-color: var(--accent); outline: none; }
.tc-name { font-weight: 800; font-size: 1.05rem; }
.tc-blurb { color: var(--muted); font-size: .9rem; }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: .85rem; }
.qtyin { width: 76px; min-height: 34px; padding: 4px 6px; text-align: right; border: 1px solid #c9d2dc; border-radius: 8px; font: .9rem var(--font); }
.d-block { display: block; }
.doc-note { color: var(--muted); font-size: .8rem; }
.doc-checks { list-style: none; padding: 0; margin: 0 0 8px; font-size: .88rem; }
.doc-checks li::before { content: "\2610  "; }
.settabs { margin-top: 10px; }
details.sidecard > summary { list-style: none; cursor: pointer; gap: 10px; }
details.sidecard > summary::-webkit-details-marker { display: none; }
details.sidecard[open] > summary { margin-bottom: 8px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* print: only the proposal or job pack content */
@media print {
  @page { size: letter; margin: 0.5in; }
  html { font-size: 12.5px; }
  body { background: #fff; font-size: 10pt; }
  .doc { font-size: 9.5pt; }
  .doc h3 { margin: 10px 0 6px; padding: 3px 8px; }
  .doc-head { padding-bottom: 6px; } .doc-title { margin: 8px 0 6px; }
  .sig { margin-top: 22px; }
  .panel { break-inside: avoid; }
  .print-only { display: flex !important; margin-bottom: 10px; }
  .no-print, .topbar, .jobhead, .stepfoot, #toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .panel, .doc { box-shadow: none; border: 0; padding: 0; margin: 0 0 12px; }
  details.panel > summary::after { content: ""; }
  .doc h3, .doc-tbl th, .doc-tbl tr.rec td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-info { grid-template-columns: 1fr 1fr; } .doc-scope { columns: 2; }
  .chip:not(.on), .chip-ghost { display: none; }
  .stepbody .field input[type=date] { border: 0; padding: 0; }
}

/* setup wizard, settings, leads */
.wizard h1 { margin-top: 14px; }
.radios { display: grid; gap: 8px; margin: 10px 0 14px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,59,87,.15); }
.radio input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--brand); }
.logo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.logo-prev { max-height: 64px; max-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.logo-prev.empty { display: grid; place-items: center; width: 160px; height: 64px; color: var(--muted); font-size: .85rem; }
.summary { padding-left: 1.2em; } .summary li { margin: 4px 0; }
.tpl { display: grid; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.tpl-lab { font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.tpl code { font-size: .78rem; word-break: break-all; white-space: pre-wrap; }
.tpl .btn { justify-self: start; }
#leadpaste { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.about-logo { height: 48px; width: auto; }
.prose code { background: var(--bg); padding: 1px 4px; border-radius: 4px; font-size: .85em; }

/* close-out + track record */
.tbl.cmp td.good { color: var(--ok); font-weight: 600; }
.tbl.cmp td.bad { color: var(--bad); font-weight: 600; }
.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.statrow div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.statrow span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.statrow b { font-size: 1.25rem; }
.ok-text { color: var(--ok); font-weight: 600; }
.sharedetails { margin: 8px 0; } .sharedetails summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.sharedetails p { margin: 6px 0; }
.notice:not(.warn) { background: var(--bg); border: 1px solid var(--line); }
.tbl.cmp { font-size: .9rem; } .tbl.cmp td, .tbl.cmp th { padding-left: 6px; padding-right: 6px; }
.terms h3 { margin: 16px 0 4px; } .terms p { margin: 0 0 8px; }
.terms .radio { margin: 18px 0 10px; }
.disclaimer-line { font-size: .8rem; color: var(--muted); margin: 6px 4px 0; }
/* licensing */
.licbar { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #e6eefb; color: #1f3b57; font-size: .95rem; }
.licbar.bad { background: var(--warn-bg); color: #6b4300; }
.licbar a { font-weight: 700; margin-left: 6px; }
.licstate { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 8px 0 14px; background: var(--bg); }
.licstate.ok { background: var(--ok-bg); border-color: #b9e0c8; }
.licstate.bad { background: var(--warn-bg); border-color: #f0d9a8; }
.warn-text { color: #9a5b00; font-weight: 600; margin-top: 4px; }
.buygrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 8px 0; }
.buycard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.buyprice { font-size: 1.6rem; font-weight: 800; color: var(--brand); margin: 4px 0; }
