/* WDS Bid Intake. Tokens and type from the Claude Design file "WDS Bid Intake" (WDS brand). */
:root {
  --ink: #0D0E15; --text: #1A1C24; --body: #3F444B; --muted: #5E646C; --nav-muted: #9AA1AA;
  --line: #E3E5E8; --line-2: #C9CDD2; --bg: #F9FAFA; --panel: #F4F5F6; --grey: #EEEFF1; --dark: #33373D;
  --orange: #E77521; --orange-ink: #A9500F; --orange-bg: #FDF1E7; --orange-line: #F3C9A6;
  --blue: #2F4A7A; --blue-bg: #E8EDF6; --blue-line: #C3D0E6;
  --green: #1E6B45; --green-bg: #E6F2EA; --green-line: #B9DBC6;
  --head: Archivo, sans-serif; --sans: Barlow, 'Trade Gothic Next', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 var(--sans); }
a { color: var(--ink); } a:hover { color: var(--orange-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 40px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 13px; }
.eyebrow { margin: 0; font: 700 12px/1.3 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.eyebrow.orange { color: var(--orange-ink); } .eyebrow.blue { color: var(--blue); } .eyebrow.green { color: var(--green); }
h1, h2, h3 { font-family: var(--head); text-transform: uppercase; color: var(--ink); margin: 0; }
h1 { font-weight: 900; font-size: 44px; line-height: 1; }
h2 { font-weight: 900; font-size: 18px; }
.warn { color: var(--orange-ink); }

/* Header */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; min-height: 76px; }
.top .logo { display: flex; padding: 12px 0; }
.top nav { display: flex; gap: 4px; flex: 1 1 auto; }
.top nav a { font: 700 14px var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--nav-muted);
  text-decoration: none; padding: 26px 14px 22px; border-bottom: 4px solid transparent; }
.top nav a[aria-current] { color: #fff; border-bottom-color: var(--orange); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--dark); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 2px; background: var(--orange); color: var(--ink); font: 800 14px var(--head);
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.btn:hover { background: #d4661a; color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; min-height: 44px; font-weight: 700; font-size: 13px; }
.btn.ghost { background: #fff; border: 1px solid var(--line-2); color: var(--text); font: 600 14px var(--sans);
  text-transform: none; letter-spacing: 0; min-height: 44px; }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { min-height: 36px; padding: 0 12px; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: 14px; }
.link:hover { color: var(--orange-ink); }
.field { display: flex; flex-direction: column; gap: 4px; font: 700 11px var(--head); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea, .input { min-height: 44px; border: 1px solid var(--line-2); background: #fff;
  font: 600 15px var(--sans); letter-spacing: 0; text-transform: none; color: var(--text); padding: 0 10px; }
.field textarea, textarea.input { padding: 8px 10px; min-height: 80px; resize: vertical; font-weight: 400; line-height: 1.45; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); padding: 0 12px; min-height: 44px; background: #fff; }
.search input { border: 0; outline: none; font-size: 15px; width: 220px; background: transparent; } .search:focus-within { outline: 3px solid var(--orange); outline-offset: 2px; }
.alert { padding: 12px 16px; background: var(--orange-bg); border: 1px solid var(--orange-line); color: var(--ink); }
/* Live updates (live.js): who else is here, and the "changed by someone else" note */
.presence:not(:empty) { margin-left: 8px; color: var(--green); font-weight: 600; }
.live-note { position: fixed; right: 16px; bottom: 16px; z-index: 20; max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px; background: var(--orange-bg); border: 1px solid var(--orange-line); color: var(--ink);
  box-shadow: 0 6px 20px rgba(13, 14, 21, .18); font-size: 14px; }

/* Cards, pills, tables */
.card { background: #fff; border: 1px solid var(--line); }
.card.pad { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 4px 10px; font: 700 12px var(--head); letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap; }
.pill.active, .pill.reading, .pill.changed { background: var(--orange-bg); color: var(--orange-ink); border-color: var(--orange-line); }
.pill.pending, .pill.assist, .pill.flagged, .pill.extra { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.pill.won, .pill.done, .pill.approved { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.pill.lost, .pill.draft, .pill.missing, .pill.other { background: var(--grey); color: var(--body); border-color: #D5D8DC; }
.pill.failed { background: #FBE9E7; color: #9A2A12; border-color: #F0C2B8; }
.pill.xs { font-size: 10px; padding: 3px 7px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; background: var(--panel); padding: 12px 16px; font: 700 12px var(--head); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
td { padding: 16px; border-top: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 20px; } th:last-child, td:last-child { padding-right: 20px; }
.scroll { overflow-x: auto; position: relative; }   /* relative: keeps absolutely placed sr-only labels inside */
.stack { display: flex; flex-direction: column; gap: 2px; }
.strong { font-weight: 700; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; font: 600 14px var(--sans);
  border: 1px solid var(--line-2); background: #fff; color: var(--body); text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Bids list */
main.page { padding-top: 48px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 28px; }
.title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.lede { margin: 0; color: var(--muted); font-size: 17px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--bar); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px; }
.stat b { font: 900 34px/1 var(--head); color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { min-height: 52px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font: 700 14px var(--head);
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none;
  border-bottom: 4px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--orange); }
.tabs a span { font: 600 13px var(--sans); color: var(--muted); }
.segs { display: flex; gap: 3px; } .segs i { width: 28px; height: 6px; background: var(--line); }
.segs i.done { background: var(--dark); } .segs i.active { background: var(--orange); } .segs.closed i { background: var(--line-2); }
dialog { border: 0; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(13, 14, 21, .3); }
dialog::backdrop { background: rgba(13, 14, 21, .45); }
dialog form, dialog .ask { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Bid header */
.bidhead { background: #fff; border-bottom: 1px solid var(--line); }
.bidhead .wrap { padding-top: 28px; display: flex; flex-direction: column; gap: 20px; }
.bidhead h1 { font-size: 36px; line-height: 1.05; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; color: var(--body); margin-top: 10px; }
/* Inline bid fields: label text and control share one baseline row */
.bidform .facts label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.bidform .facts .input { min-height: 32px; padding: 2px 8px; font-size: 14px; color: var(--ink); width: auto; }
.bidsite { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.titlerow { display: flex; align-items: center; gap: 16px; }
.titlerow form { flex: 1; min-width: 0; }
.title-input { font: 900 36px/1.05 var(--head); text-transform: uppercase; color: var(--ink); border: 1px solid transparent; background: none;
  padding: 2px 4px; margin-left: -5px; width: 100%; }
.title-input:hover { border-color: var(--line); } .title-input:focus { border-color: var(--orange); outline: none; }
.ws-tabs { display: flex; gap: 4px; margin-top: 4px; }
.ws-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; font: 800 14px var(--head);
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none; border-bottom: 4px solid transparent; }
.ws-tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }

/* Documents */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 24px;
  border: 2px dashed var(--line-2); background: #fff; text-align: center; cursor: pointer; }
.drop:hover, .drop:focus-within { border-color: var(--orange); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .big { font: 800 17px var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.addendum { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; background: var(--orange-bg); border: 1px solid var(--orange-line); }
.addendum .grid-2 > div { background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.pdf { width: 34px; height: 40px; flex: none; background: var(--panel); border: 1px solid var(--line); display: flex;
  align-items: center; justify-content: center; font: 800 10px var(--head); color: var(--body); }
.docrow { display: flex; align-items: center; gap: 12px; }
dl.kv { margin: 0; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 12px; font-size: 15px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.flaglist, .tradelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.flaglist li { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.flaglist li:last-child { border-bottom: 0; }
.flaglist ul { margin: 0; padding-left: 18px; font-size: 14px; }
.tradelist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.tradelist form { display: inline; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
details > summary { cursor: pointer; }
pre.log { white-space: pre-wrap; font-size: 12px; max-height: 240px; overflow: auto; background: var(--panel); padding: 10px; margin: 0; }

/* Scope */
main.scope { padding-top: 28px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.trades { flex: 1 1 250px; max-width: 290px; min-width: 0; display: flex; flex-direction: column; }
.trades .head { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.bar { height: 6px; background: var(--line); } .bar i { display: block; height: 6px; background: var(--dark); }
.trades ul { list-style: none; margin: 0; padding: 6px 0; max-height: 75vh; overflow: auto; }
.trades li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px;
  padding: 8px 16px 8px 12px; text-decoration: none; border-left: 4px solid transparent; }
.trades li a[aria-current="page"] { border-left-color: var(--orange); background: var(--orange-bg); }
.trades li a .n { font-weight: 600; font-size: 15px; color: var(--ink); }
.trades li[draggable] { cursor: grab; }
.trades li.dragging { opacity: .45; }
.editor { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; background: var(--grey); border: 1px solid var(--line); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px;
  background: #fff; border-bottom: 1px solid var(--line); }
.paper-wrap { padding: 28px 20px 40px; display: flex; justify-content: center; }
.paper { width: 100%; max-width: 760px; background: #fff; box-shadow: 0 1px 3px rgba(13, 14, 21, .12); padding: 56px 64px;
  display: flex; flex-direction: column; gap: 26px; font-size: 15px; line-height: 1.55; }
.paper .doc-head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 18px; border-bottom: 3px solid var(--ink); }
.paper .doc-head h2 { font-size: 28px; line-height: 1.1; }
.paper section { display: flex; flex-direction: column; gap: 8px; }
.paper h3 { font-weight: 800; font-size: 15px; letter-spacing: .06em; }
.paper dl.kv { grid-template-columns: 150px minmax(0, 1fr); gap: 4px 12px; font-size: 15px; }
.lines { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.line { scroll-margin-top: 80px; }
.line:target { background: var(--orange-bg); }
.line.check { box-shadow: inset 3px 0 0 var(--orange); }
.line .tools { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.line .tools form { display: inline; }
.line .tools button { background: none; border: 0; padding: 2px 0; cursor: pointer; color: var(--muted); text-decoration: underline; font-size: 13px; }
.line .tools button:hover { color: var(--orange-ink); }
.mark { background: var(--orange-bg); color: var(--orange-ink); font-weight: 600; padding: 0 4px; font-size: 13px; }
.mark.std { background: var(--grey); color: var(--body); }
.mark.ok { background: var(--green-bg); color: var(--green); }
.src { margin-top: 4px; padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.src img { max-width: 100%; border: 1px solid var(--line); background: #fff; }
.src q { font-style: italic; }
.edit-form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.add-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.add-line input { flex: 1; min-height: 36px; border: 1px dashed var(--line-2); padding: 0 10px; font-size: 14px; }
.sendback td { padding: 6px 0; }
.sendback td:last-child { text-align: right; color: var(--muted); }
.side { flex: 1 1 300px; max-width: 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side .card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.side .t { font: 900 15px var(--head); text-transform: uppercase; color: var(--ink); }
.flag { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--panel); font-size: 14px; }
.flag.gap, .flag.contradiction { background: var(--orange-bg); } .flag.overlap, .flag.question { background: var(--blue-bg); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); margin: 0; }

/* Print: the scope document only */
@media print {
  .no-print { display: none !important; }
  body, html { background: #fff; }
  .print-doc { padding: 0; }
  .print-doc h2 { break-after: avoid; }
}

@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper { padding: 28px 20px; }
  .trades, .side { max-width: none; }
  h1 { font-size: 32px; }
}

/* Scope editor: trades | document | sticky sources pane */
/* Full window width (not .wrap's 1360px): Contents 25% | sheet 75%; with Sources open 25/50/25. */
main.editor-grid { max-width: none; padding: 24px 24px 64px; display: grid; gap: 20px; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
@media (min-width: 801px) {   /* phones keep one column; there the pane is a bottom sheet */
  main.editor-grid.src-open { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); }
}
.pane[hidden] { display: none; }
.editor-grid .paper-wrap { padding: 24px 16px 40px; }
/* Letter-shaped pages: 0.75in margins are 8.8% of the 8.5in width (percent padding is width-based).
   Page breaks are drawn by paginate() in scope.html. */
.editor-grid .paper { max-width: none; padding: 8.8%; }
.pgap { list-style: none; display: block; pointer-events: none; }   /* width + offset set by paginate() */
main.editor-grid.no-nav { grid-template-columns: minmax(0, 1fr) 380px; }
.editor-grid .trades { max-width: none; position: sticky; top: 16px; }
.editor-grid .trades .t, .pane .t { font: 900 15px var(--head); text-transform: uppercase; color: var(--ink); }
.editor-grid .trades ul { max-height: calc(100vh - 260px); }
.add-trade { padding: 10px 12px; border-top: 1px solid var(--line); }
.add-trade select { width: 100%; min-height: 36px; font-size: 14px; }
.pane { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.pane-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); min-height: 48px; align-items: center; }
.pane-body { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.srcview { display: flex; flex-direction: column; gap: 10px; }
.paper .lines { list-style: none; padding-left: 0; gap: 2px; }
.line { padding: 4px 8px; margin: 0 -8px; border-radius: 2px; cursor: text; }
.line:hover { background: var(--panel); }
.line.sel { background: var(--orange-bg); }
.line .ln { display: block; width: 100%; border: 0; background: transparent; resize: none; padding: 0; font: inherit;
  line-height: 1.5; color: var(--text); field-sizing: content; min-height: 1.5em; outline: none; }
.line .ln:focus { box-shadow: 0 2px 0 var(--orange); }
.line.saving { opacity: .6; }
/* No per-line tag row: Remove/Restore float at the line's right on hover; errors show there too. */
.line { position: relative; }
.line .meta { position: absolute; right: 8px; top: 100%; z-index: 2; display: flex; gap: 10px; align-items: center;
  font-size: 12px; color: var(--muted); }
.line .meta:has(.state:not(:empty)), .line:hover .meta, .line:focus-within .meta { background: #fff; padding: 0 4px; }
.checktag { flex: none; align-self: center; border: 0; cursor: pointer; background: var(--orange-bg); color: var(--orange-ink);
  font: 600 12px var(--sans); padding: 1px 6px; border-radius: 2px; }
.checktag:hover { background: var(--orange); color: #fff; }
.line .acts { margin-left: auto; display: flex; gap: 8px; visibility: hidden; }
/* Only while hovered or being edited (not just 'last selected', which lingers after clicking away). */
.line:hover .acts, .line:focus-within .acts { visibility: visible; }
.line .acts button, .line .srcbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); text-decoration: underline; font-size: 12px; }
.line .acts button:hover { color: var(--orange-ink); }
.line.changed { box-shadow: inset 3px 0 0 var(--blue); }
.add-line input { border: 0; border-bottom: 1px dashed var(--line-2); min-height: 32px; padding: 0; background: transparent; }
/* Phone width: one column, Sources pinned to the bottom of the screen. */
@media (max-width: 800px) {
  main.editor-grid, main.editor-grid.no-nav { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 50vh; }
  .pane { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 45vh; z-index: 30; }
}
.ws-tabs .tab-note { font: 600 13px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
.bidhead .wrap { gap: 14px; padding-top: 20px; }

/* Scope sheet document: styled after WDS's own Word scope sheets (serif body, centered logo,
   bold title block, underlined section headings, bullets, address footer). */
.paper.doc { font-family: Cambria, Georgia, 'Times New Roman', serif; font-size: 15px; line-height: 1.4; gap: 14px; padding: 48px 64px; }
.doc .doc-logo { display: block; width: 220px; height: auto; margin: 0 auto 8px; }
.doc .doc-title { margin: 0; font-weight: 700; }
.doc .doc-disclaimer { margin: 0; font-weight: 700; }
.doc .doc-sec { gap: 2px; }
.doc .doc-sec h3, .doc h2.doc-scopes { font: 400 15px Cambria, Georgia, serif; text-transform: none; letter-spacing: 0;
  text-decoration: underline; color: var(--text); margin: 6px 0 0; }
.doc h2.doc-scopes { text-decoration: none; font-weight: 700; margin-top: 18px; }
.doc .trade { scroll-margin-top: 16px; }
.doc .trade-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.doc .trade-ctl { display: flex; gap: 12px; align-items: baseline; font: 13px var(--sans); }
.doc .trade-ctl form { display: inline; }
.doc .lines { list-style: disc; padding-left: 26px; gap: 0; }
.doc .lines > .line { display: list-item; margin: 0 -8px 0 0; padding: 2px 8px 2px 4px; }
.doc .ln-row { display: flex; gap: 6px; align-items: baseline; }
.doc .kind { font-weight: 700; white-space: nowrap; }
.doc .line .ln { font-family: inherit; }
.doc .line .meta { font-family: var(--sans); }
.doc .add-line { margin-left: 26px; display: flex; gap: 8px; font-family: var(--sans); }
.doc .add-line select { border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.doc .add-line input { flex: 1; font-size: 14px; }
.doc .alert { margin: 4px 0; font-family: var(--sans); }
.doc .doc-footer { margin: 24px 0 0; padding-top: 8px; border-top: 1px solid var(--line); text-align: center;
  font: 12px var(--sans); color: var(--muted); }
.line.front .acts [data-act="accept"], .line.front .acts [data-act="restore"] { display: none; }

.open-doc { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 0; border: 0;
  background: none; cursor: zoom-in; text-align: left; }
.open-doc:hover img { outline: 2px solid var(--orange); }
dialog.docview { width: min(1200px, calc(100vw - 32px)); height: calc(100vh - 48px); max-height: none; padding: 0;
  display: none; flex-direction: column; }
dialog.docview[open] { display: flex; }
.docview-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.docview iframe { flex: 1; border: 0; width: 100%; }

/* Print view: just the document */
.print-body { background: #fff; }
.print-note { max-width: 816px; margin: 16px auto; }
.print-doc { max-width: 816px; margin: 0 auto 40px; box-shadow: none; }
.print-doc ul { margin: 0; padding-left: 26px; }
@media print {
  @page { margin: 0.75in; }
  .print-doc { padding: 0; max-width: none; }
  .doc .doc-sec { break-inside: auto; }
  .doc .doc-sec h3 { break-after: avoid; }
}
.line.new { box-shadow: inset 3px 0 0 var(--green); }
.mark.new { background: var(--green-bg); color: var(--green); }

/* WDS heading groups ('Asphalt & Striping') and 'o' sub-bullets */
.doc h3.group-head { margin-top: 10px; }
.doc .trade.in-group .trade-sub { font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc .lines > .line.sub { margin-left: 22px; list-style-type: circle; }
.print-doc li.sub { margin-left: 22px; list-style-type: circle; }

/* Checkboxes: WDS orange with rounded corners instead of the browser's blue square. */
input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0;
  border: 1.5px solid var(--line-2); border-radius: 5px; background: #fff; cursor: pointer; vertical-align: middle;
  transition: background-color .12s, border-color .12s; }
input[type="checkbox"]:hover { border-color: var(--orange); }
input[type="checkbox"]:checked { border-color: var(--orange); background: var(--orange) no-repeat center / 12px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 2px; }
input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }

/* Themed dropdowns and calendar (static/controls.js). The native control stays in the form, visually
   hidden (not display:none, so the browser can still point at it for required-field messages). */
.cs-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.cs-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 34px 0 10px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 6px; background: #fff no-repeat right 10px center / 12px; color: var(--text);
  font: 600 15px var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; transition: border-color .12s; }
.cs-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%23A9500F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cs-date { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23A9500F' stroke-width='1.3'%3E%3Crect x='1.5' y='2.5' width='9' height='8' rx='1.5'/%3E%3Cpath d='M1.5 5h9M4 1.2v2.2M8 1.2v2.2'/%3E%3C/svg%3E"); }
.field .cs-btn { min-height: 44px; }
.cs-btn:hover, .cs-btn[aria-expanded="true"] { border-color: var(--orange); }
.cs-btn:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 2px; }
.cs-btn:disabled { opacity: .5; cursor: not-allowed; }
.add-trade .cs-btn { width: 100%; font-size: 14px; }
.doc .add-line .cs-btn { border-color: transparent; background-color: transparent; color: var(--muted); font-size: 13px; }
.cs-pop { position: fixed; z-index: 50; background: #fff; border: 1px solid var(--orange-line); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(13, 14, 21, .14); padding: 4px; font: 500 15px var(--sans); color: var(--text); }
.cs-pop ul { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.cs-pop li { padding: 8px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.cs-pop li:hover, .cs-pop li.cs-active { background: var(--orange-bg); }
.cs-pop li[aria-selected="true"] { color: var(--orange-ink); font-weight: 700; }
.cs-pop li[aria-disabled="true"] { color: var(--muted); cursor: default; background: none; }
.cs-cal { width: 292px; padding: 12px; }
.cs-cal button { font: inherit; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text); }
.cs-cal button:focus-visible { outline: 2px solid var(--orange-ink); }
.cs-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-family: var(--head); }
.cs-cal-head button { width: 32px; height: 32px; font-size: 20px; color: var(--orange-ink); }
.cs-cal-head button:hover { background: var(--orange-bg); }
.cs-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cs-dow { font: 700 11px var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.cs-grid button, .cs-times button { height: 34px; }
.cs-grid button:hover, .cs-times button:hover { background: var(--orange-bg); }
.cs-cal .cs-today { box-shadow: inset 0 0 0 1px var(--orange-line); }
.cs-cal button.cs-on { background: var(--orange); color: #fff; font-weight: 700; }
.cs-time { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.cs-times { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin-top: 4px; }
.cs-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.cs-foot .btn.sm { color: #fff; background: var(--orange); border-color: var(--orange); border-radius: 6px; }
.bidform .facts .cs-btn { padding-right: 28px; background-position: right 8px center; }

/* Drafting eye candy (scope.html). Pulse + moving stripe in the toolbar; while drafting, a soft
   scan line sweeps the sheet (driven by the toolbar's .drafting via :has, so it stops when the
   toolbar is swapped on completion); a first draft shows shimmering placeholder lines. */
.drafting { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 8px;
  background: var(--orange-bg); border: 1px solid var(--orange-line); color: var(--ink); overflow: hidden; }
.drafting .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: none;
  animation: wds-pulse 1.4s ease-in-out infinite; }
.drafting.waiting .pulse { background: var(--muted); }
.drafting .stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--orange) 40%, transparent 80%) 0 0 / 50% 100% no-repeat;
  animation: wds-stripe 1.6s linear infinite; }
/* background-attachment: fixed keeps the sweep on the part of the sheet that's on screen. */
main.editor-grid:has(#toolbar .drafting) .paper {
  background: linear-gradient(180deg, transparent, rgba(244, 118, 34, .12) 60%, rgba(244, 118, 34, .42) 97%, transparent)
              0 -160px / 100% 160px no-repeat fixed, #fff;
  animation: wds-scan 3.2s ease-in-out infinite; }
.skeleton { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 24px; }
.skeleton i { display: block; height: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--line) 50%, var(--panel) 100%) 0 0 / 200% 100%;
  animation: wds-shimmer 1.4s linear infinite; }
.skeleton i[style="width:0%"] { height: 18px; background: none; animation: none; }
/* Pre-bid fill: answers land one by one (live.js swaps rows), the meter grows, blanks shimmer. */
.meter { display: block; width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--orange); transition: width .6s ease; }
#prebid-main:has(.drafting) textarea:placeholder-shown {
  background: linear-gradient(90deg, var(--panel) 0%, var(--orange-bg) 50%, var(--panel) 100%) 0 0 / 200% 100%;
  animation: wds-shimmer 1.4s linear infinite; }
@keyframes wds-pulse { 0%, 100% { transform: scale(.8); opacity: .6; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes wds-stripe { from { background-position: -100% 0; } to { background-position: 200% 0; } }
@keyframes wds-scan { from { background-position: 0 -160px, 0 0; } to { background-position: 0 100vh, 0 0; } }
@keyframes wds-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .drafting .pulse, .drafting .stripe, .skeleton i, #prebid-main textarea { animation: none; }
  main.editor-grid:has(#toolbar .drafting) .paper { animation: none; background: #fff; }
}
.named { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

/* Dropdown button: <details class="menu"><summary class="btn ...">Label ▾</summary><div class="menu-list">buttons</div> */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.menu-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 240px; display: flex; flex-direction: column;
  padding: 4px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(13, 14, 21, .15); }
.menu-list button { text-align: left; background: none; border: 0; padding: 9px 12px; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--orange-bg); color: var(--orange-ink); }
.menu-list button:disabled { color: var(--muted); background: none; cursor: default; }
/* Inline-editable table cells: look like text until hovered or focused. */
.input.cell { width: 100%; min-width: 120px; border-color: transparent; background: transparent; }
.input.cell:hover { border-color: var(--line); } .input.cell:focus { border-color: var(--orange); background: #fff; }
/* Text edited in place on the scope sheet (title block, disclaimer, section headings): reads like the
   printed text, shaded like a line on hover / while typing. Saved on leaving the box (data-autosubmit). */
.doc .plain { display: block; width: 100%; margin: 0; padding: 0 4px; border: 0; border-radius: 2px; background: transparent;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; resize: none; field-sizing: content; outline: none; }
.doc .doc-title.plain, .doc .doc-disclaimer.plain { font-weight: 700; }
.doc .plain:hover { background: var(--panel); }
.doc .plain:focus { background: var(--orange-bg); }
.doc h3:has(.plain) { flex: 1; margin-left: -4px; }
.doc .add-sec { margin-left: 0; margin-top: 12px; }

/* Bids list: a bid being deleted in the background (bids.purge) greys out under a moving stripe. */
tr.deleting td { color: var(--muted, #8A9099); opacity: .7; }
.deleting-bar { display: block; position: relative; overflow: hidden; padding: 6px 12px; border-radius: 6px;
  font: 700 12px var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--orange-ink);
  background: linear-gradient(90deg, var(--orange-bg) 0%, var(--orange-bg) 35%, #fff 50%, var(--orange-bg) 65%, var(--orange-bg) 100%);
  background-size: 200% 100%; animation: wds-shimmer 1.2s linear infinite; }
@media (prefers-reduced-motion: reduce) { .deleting-bar { animation: none; } }

/* Bid intake: owner picker, assisting estimators, address row */
[data-new-owner][hidden] { display: none; }
.bidform .facts [data-new-owner] { display: inline-flex; align-items: center; gap: 6px; }
.bidform .facts [data-new-owner][hidden] { display: none; }
.assist { position: relative; font-size: 14px; color: var(--muted); }
.assist summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.assist form { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 200px; padding: 12px; gap: 8px; background: #fff;
  border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(13, 14, 21, .15); display: flex; flex-direction: column; }
.assist .check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
/* Account page: before/after of a proposed card, and the bid header's owner tips. */
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.compare:has(> .stack:only-child) { grid-template-columns: minmax(0, 1fr); }
.before { margin: 0; padding: 10px 12px; max-height: 420px; overflow: auto; white-space: pre-wrap; background: var(--grey); border: 1px solid var(--line); font: 400 14px/1.45 var(--sans); }
@media (max-width: 800px) { .compare { grid-template-columns: minmax(0, 1fr); } }
.owner-tips { margin: 0 0 10px; border: 1px solid var(--orange-line); background: var(--orange-bg); padding: 8px 14px; }
.owner-tips summary { font: 700 13px var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--orange-ink); }
.owner-tips ul { margin: 8px 0 4px; padding-left: 20px; }
/* Revised: lines the latest update added or changed; stays after approval, replaced by the next update's. */
.revtag { flex: none; align-self: center; margin-left: 8px; padding: 1px 6px; font: 700 11px var(--head); letter-spacing: .06em;
  text-transform: uppercase; background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-line); }
.print-doc .revtag { background: none; color: inherit; border: 1px solid currentColor; font-weight: 700; }
.revpick { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.revpick select { min-height: 32px; font-size: 13px; max-width: 280px; }
.rev-banner { margin: 12px 20px 0; }
/* Scope page: "Finish in BuildingConnected" steps after a send (web/bc_guide.py). */
.bc-guide { margin: 12px 20px 0; padding: 10px 16px; border: 1px solid var(--line-2); background: #fff; }
.bc-guide summary { cursor: pointer; font: 700 14px var(--head); }
.bc-guide ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.bc-guide-pkgs { margin: 0; padding-left: 20px; columns: 3 200px; }
/* UX pass: folded job details, numbered tabs, next-step bar, danger action */
.facts.key { margin-top: 4px; gap: 8px 24px; align-items: center; }
.jobinfo { border-top: 1px solid var(--line); padding-top: 8px; }
.jobinfo > summary { cursor: pointer; font-size: 14px; color: var(--body); min-height: 32px; display: flex; align-items: center; }
.jobinfo .facts { margin-top: 6px; }
.btn.danger { color: #9B1C1C; border-color: #D9A5A5; } .btn.danger:hover { border-color: #9B1C1C; }
.danger-zone { margin-left: auto; }
.ws-tabs .step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--ink); font: 800 12px var(--head); letter-spacing: 0; }
.ws-tabs a[aria-selected="true"] .step { background: var(--orange); }
.nextbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px;
  background: var(--orange-bg); border: 1px solid var(--orange-line); }
.nextbar p { margin: 0; color: var(--body); }
@media (max-width: 800px) { .ws-tabs { overflow-x: auto; } .ws-tabs a { padding: 0 12px; white-space: nowrap; } }
.doc .trade-ctl .btn { min-height: 30px; font-size: 13px; padding: 0 12px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.danger-link { color: #9B1C1C; }
.adduser { padding: 0 24px 8px; } .adduser[open] { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.adduser > summary { list-style: none; cursor: pointer; display: inline-flex; }
.jobinfo .link-ish { color: var(--orange-ink); text-decoration: underline; margin-left: 6px; }
@media (max-width: 600px) { .titlerow { flex-wrap: wrap; gap: 8px; } .titlerow form { flex-basis: 100%; order: 3; } .title-input { font-size: 26px; } }
/* Phones: the top nav scrolls sideways, trade controls wrap, and no input is wider than the screen. */
@media (max-width: 600px) { .top nav { overflow-x: auto; min-width: 0; } .doc .trade-head, .doc .trade-ctl { flex-wrap: wrap; } input, select, textarea, .cs-btn { max-width: 100%; min-width: 0; box-sizing: border-box; } .revpick .cs-btn { min-width: 0 !important; flex: 1 1 auto; } }
