/* BIDR Connected: BIDR Technologies navy, white and one gold accent (DESIGN.md). App shell: navy bar, one 76rem work column. */
:root {
  --paper: #ffffff; --mist: #f2f4f7; --mist-2: #dadee5; --head: #0a2248; --body: #42526a; --rule: #c8ced6; --rule-strong: #5d6b80;
  --band: #0a2248; --band-2: #0b2440; --on-band: #e1e9f5; --on-band-muted: #aebbd0; --band-rule: #1f3a5f;
  --gold: #d6ac4e; --gold-text: #8c5f10; --gold-numeral: #a8761a; --focus: #0a2248; --focus-band: #f0c45a;
  --card: #ffffff; --table-head: #f7f8fa; --link: #0a2248; --field: #ffffff; --field-border: #768296; --placeholder: #66748a;
  --ok-bg: #e7f3ea; --ok-fg: #1d5c2e; --warn-bg: #fbf2dc; --warn-fg: #7a5208; --bad-bg: #f8e5e3; --bad-fg: #a3261b; --info-bg: #e6edf7; --info-fg: #0a2248;
  --shadow: 0 1px 2px rgba(5, 25, 45, .08), 0 8px 24px rgba(5, 25, 45, .08);
  --font: "Assistant", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #05192d; --mist: #0b2440; --mist-2: #1f3a5f; --head: #e1e9f5; --body: #aebbd0; --rule: #1f3a5f; --rule-strong: #8f9bb0;
    --band: #0b2440; --band-2: #0a2248; --on-band: #e1e9f5; --on-band-muted: #aebbd0; --band-rule: #1f3a5f;
    --gold: #d6ac4e; --gold-text: #e0bb68; --gold-numeral: #e0bb68; --focus: #f0c45a; --focus-band: #f0c45a;
    --card: #0a2248; --table-head: #0b2440; --link: #e1e9f5; --field: #05192d; --field-border: #8f9bb0; --placeholder: #8f9bb0;
    --ok-bg: #12351f; --ok-fg: #a9dcb6; --warn-bg: #3a2c0b; --warn-fg: #f0d28e; --bad-bg: #3d1512; --bad-fg: #f2b3ac; --info-bg: #0b2440; --info-fg: #e1e9f5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #05192d; --mist: #0b2440; --mist-2: #1f3a5f; --head: #e1e9f5; --body: #aebbd0; --rule: #1f3a5f; --rule-strong: #8f9bb0;
  --band: #0b2440; --band-2: #0a2248; --on-band: #e1e9f5; --on-band-muted: #aebbd0; --band-rule: #1f3a5f;
  --gold: #d6ac4e; --gold-text: #e0bb68; --gold-numeral: #e0bb68; --focus: #f0c45a; --focus-band: #f0c45a;
  --card: #0a2248; --table-head: #0b2440; --link: #e1e9f5; --field: #05192d; --field-border: #8f9bb0; --placeholder: #8f9bb0;
  --ok-bg: #12351f; --ok-fg: #a9dcb6; --warn-bg: #3a2c0b; --warn-fg: #f0d28e; --bad-bg: #3d1512; --bad-fg: #f2b3ac; --info-bg: #0b2440; --info-fg: #e1e9f5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--body); font-family: var(--font); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--head); margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img { max-width: 100%; }
.wrap { max-width: 76rem; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--body); opacity: .85; }
.small { font-size: .875rem; }

/* App bar */
.bar { background: var(--band); color: var(--on-band); border-bottom: 3px solid var(--gold); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--band); }
.bar .wrap { display: flex; align-items: center; gap: .75rem 1.5rem; min-height: 3.75rem; flex-wrap: wrap; padding-block: .5rem; }
.bar :focus-visible { outline-color: var(--focus-band); }
.brand { display: flex; align-items: baseline; gap: .5rem; color: var(--on-band); text-decoration: none; white-space: nowrap; }
.brand b { font-weight: 800; letter-spacing: .08em; font-size: 1.05rem; }
.brand span { font-weight: 700; letter-spacing: .16em; font-size: .8rem; color: var(--gold); text-transform: uppercase; }
.nav { display: flex; gap: .25rem; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--on-band-muted); text-decoration: none; font-weight: 700; font-size: .95rem; padding: .45rem .7rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--on-band); }
.nav a[aria-current="page"] { color: var(--on-band); border-bottom-color: var(--gold); }
.nav .sep { width: 1px; background: var(--band-rule); margin: .35rem .4rem; }
.who { display: flex; align-items: center; gap: .75rem; color: var(--on-band-muted); font-size: .875rem; white-space: nowrap; min-width: 0; }
.who b { color: var(--on-band); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .bar { position: static; }
  .who { width: 100%; justify-content: space-between; }
  .who > span:first-child { display: none; }
}
.demo-strip { background: var(--warn-bg); color: var(--warn-fg); font-size: .875rem; font-weight: 600; border-bottom: 1px solid var(--rule); }
.demo-strip .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding-block: .45rem; }
.demo-strip button { font: inherit; font-weight: 700; background: none; border: 1px solid currentColor; color: inherit; padding: .1rem .55rem; cursor: pointer; }
.demo-strip button[aria-pressed="true"] { background: var(--warn-fg); color: var(--warn-bg); }

/* Page */
main.page { padding-block: clamp(1.5rem, 4vw, 2.5rem) 4rem; display: grid; gap: 1.75rem; }
/* Grid children default to their content's width; let wide tables scroll inside .tablewrap instead of widening the page. */
main.page > *, .block > *, .panel > *, .cols > *, #tp, #cpanel, #tabpanel { min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; }
.page-head .t { display: grid; gap: .35rem; min-width: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; color: var(--gold-text); }
.page-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; letter-spacing: -.012em; }
.page-head p { max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
section.block { display: grid; gap: 1rem; }
section.block > h2, .h2 { font-size: 1.35rem; font-weight: 800; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* Buttons */
.btn { font: inherit; font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.5rem;
  padding: .45rem 1rem; border: 1px solid var(--head); background: var(--paper); color: var(--head); cursor: pointer; text-decoration: none; border-radius: 2px; white-space: nowrap; }
.btn:hover { background: var(--mist); }
.btn.primary { background: var(--head); color: var(--paper); }
.btn.primary:hover { opacity: .92; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #05192d; }
.btn.quiet { border-color: var(--rule); }
.btn.danger { border-color: var(--bad-fg); color: var(--bad-fg); }
.btn.onband { background: transparent; color: var(--on-band); border-color: var(--on-band-muted); }
.btn.onband:hover { background: var(--band-2); }
.btn.sm { min-height: 2rem; padding: .25rem .65rem; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Cards, panels */
.panel { background: var(--card); border: 1px solid var(--rule); padding: clamp(1rem, 2.5vw, 1.5rem); display: grid; gap: 1rem; min-width: 0; }
.panel.tight { padding: 1rem; gap: .75rem; }
.panel h3 { font-size: 1.1rem; font-weight: 800; }
.callout { border-left: 4px solid var(--gold); background: var(--mist); padding: .9rem 1.1rem; display: grid; gap: .35rem; }
.callout.info { border-left-color: var(--head); }
.callout.bad { border-left-color: var(--bad-fg); background: var(--bad-bg); color: var(--bad-fg); }
.callout.ok { border-left-color: var(--ok-fg); background: var(--ok-bg); color: var(--ok-fg); }
.callout strong { color: var(--head); }
.callout.bad strong, .callout.ok strong { color: inherit; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); border: 1px solid var(--rule); background: var(--card); }
.stats > div { padding: 1rem 1.25rem; display: grid; gap: .1rem; border-left: 1px solid var(--rule); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.stats dd { margin: 0; font-size: 2rem; font-weight: 800; color: var(--head); line-height: 1.05; font-variant-numeric: tabular-nums; }
.stats a { text-decoration: none; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: .15rem .5rem;
  border: 1px solid var(--rule-strong); color: var(--head); white-space: nowrap; line-height: 1.45; }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: transparent; }
.pill.gold { background: var(--gold); color: #05192d; border-color: transparent; }
.pill.info { background: var(--info-bg); color: var(--info-fg); border-color: transparent; }
.pill.plain { border-color: var(--rule); color: var(--body); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.contract-tag { font-weight: 800; color: var(--gold-text); font-variant-numeric: tabular-nums; }

/* Forms */
form.form, .form { display: grid; gap: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: .3rem; min-width: 0; }
.field > span, .field > label, fieldset > legend { font-weight: 700; color: var(--head); font-size: .925rem; }
.field small, .hint { font-size: .825rem; color: var(--body); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="number"], input[type="search"],
input[type="date"], input[type="datetime-local"], select, textarea {
  font: inherit; color: var(--head); background: var(--field); border: 1px solid var(--field-border); border-radius: 2px; padding: .55rem .7rem; width: 100%; min-height: 2.6rem; }
textarea { min-height: 6rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
fieldset { border: 1px solid var(--rule); padding: .9rem 1rem 1rem; margin: 0; display: grid; gap: .5rem; min-width: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem .9rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; accent-color: var(--head); flex: none; }
.check b { color: var(--head); display: block; font-weight: 700; }
.check small { display: block; }
.err { color: var(--bad-fg); font-weight: 700; font-size: .9rem; }
.form-foot { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule-strong); max-width: 100%; }
.seg button { font: inherit; font-weight: 700; font-size: .9rem; border: 0; border-left: 1px solid var(--rule); background: var(--paper); color: var(--head); padding: .4rem .8rem; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--head); color: var(--paper); }

/* Tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--card); position: relative; }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th, table.t td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.t thead th { background: var(--table-head); color: var(--head); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--mist); }
table.t .name { font-weight: 700; color: var(--head); }

/* Bid list */
.finder { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .finder { grid-template-columns: minmax(0, 1fr); } }
.filters { position: sticky; top: 5rem; display: grid; gap: 1rem; }
@media (max-width: 900px) { .filters { position: static; } }
.radius-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.radius-row button { font: inherit; font-size: .875rem; font-weight: 700; padding: .3rem .6rem; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--head); cursor: pointer; }
.radius-row button[aria-pressed="true"] { background: var(--head); color: var(--paper); border-color: var(--head); }
.bidlist { display: grid; gap: .75rem; }
.bidcard { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--rule-strong); padding: 1rem 1.15rem; display: grid;
  grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1.25rem; text-decoration: none; color: inherit; }
.bidcard:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); }
.bidcard.open { border-left-color: var(--gold); }
.bidcard h3 { font-size: 1.15rem; font-weight: 800; }
.bidcard .meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .9rem; }
.bidcard .due { text-align: right; display: grid; gap: .15rem; align-content: start; }
.bidcard .due b { font-size: 1.35rem; font-weight: 800; color: var(--head); font-variant-numeric: tabular-nums; line-height: 1.1; }
@media (max-width: 560px) { .bidcard { grid-template-columns: minmax(0, 1fr); } .bidcard .due { text-align: left; } }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: thin; }
.tabs button { font: inherit; font-weight: 700; color: var(--body); background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem .9rem; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--head); border-bottom-color: var(--gold); }
.tabs .count { font-weight: 600; font-variant-numeric: tabular-nums; opacity: .8; }

/* Detail lists */
dl.kv { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: .5rem 1rem; margin: 0; }
dl.kv dt { font-weight: 700; color: var(--head); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.kv { grid-template-columns: minmax(0, 1fr); } dl.kv dd { margin-bottom: .4rem; } }
.prose { white-space: pre-wrap; max-width: 75ch; overflow-wrap: anywhere; }

/* Docs */
.docs { display: grid; border-top: 1px solid var(--rule); }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); align-items: center; }
.doc .name { font-weight: 700; color: var(--head); overflow-wrap: anywhere; }
.viewer-host { height: min(78vh, 52rem); border: 1px solid var(--rule); background: var(--mist); }

/* Q&A */
.qa { display: grid; gap: .75rem; }
.q { border: 1px solid var(--rule); background: var(--card); padding: .9rem 1rem; display: grid; gap: .5rem; }
.q .a { border-left: 3px solid var(--gold); padding-left: .8rem; }

/* Quote builder */
.lines input { min-height: 2.25rem; padding: .35rem .5rem; }
.lines td { padding: .4rem .5rem; }
.lines .del { width: 2.25rem; }
.total-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 1rem; padding: .75rem 0; border-top: 2px solid var(--head); }
.total-row b { font-size: 1.75rem; font-weight: 800; color: var(--head); font-variant-numeric: tabular-nums; }

/* Auth */
.auth { max-width: 30rem; margin: clamp(1rem, 5vw, 3rem) auto; }
.empty { border: 1px dashed var(--rule-strong); padding: 2rem 1.25rem; text-align: center; display: grid; gap: .5rem; justify-items: center; }
.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--head); color: var(--paper);
  padding: .65rem 1.1rem; font-weight: 700; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad-fg); color: #fff; }
.loading { padding: 3rem 0; text-align: center; }
.foot { border-top: 1px solid var(--rule); padding-block: 1.25rem; font-size: .85rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
dialog { border: 1px solid var(--rule); background: var(--card); color: var(--body); padding: 0; max-width: min(40rem, calc(100vw - 32px)); width: 100%; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5, 25, 45, .55); }
dialog .dlg { padding: 1.25rem; display: grid; gap: 1rem; }
@media (prefers-reduced-motion: no-preference) { .bidcard, .btn { transition: background-color .12s ease, box-shadow .12s ease, border-color .12s ease; } }
