/* Bid Protest Portal. Plain, accessible government style (WCAG 2.1 AA contrast). */
:root {
  --navy: #14294a; --navy-2: #1f3d6b; --blue: #1a5bb5; --blue-dark: #134a96; --blue-wash: #e8f0fb;
  --ink: #1b1f24; --ink-2: #454c55; --line: #d5dae1; --line-2: #e7eaee; --bg: #f6f7f9; --white: #fff;
  --green: #1d6b3c; --green-wash: #e3f2e8; --amber: #7a4b00; --amber-wash: #fbefd6;
  --red: #9b1c1c; --red-wash: #fbe5e5; --gray-wash: #eceff3; --purple: #4b2d8a; --purple-wash: #ece6f8;
  --radius: 6px; --maxw: 72rem;
  --font: "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.55; }
.wrap { max-width: var(--maxw); margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; color: var(--navy); }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .35rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 46rem; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }

/* header */
.skip { position: absolute; left: -9999px; top: 0; background: #ffbf47; color: #000; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.demo-banner { background: #fff4d6; color: #4a3500; font-size: .85rem; text-align: center; padding: .35rem 16px; border-bottom: 1px solid #ecd9a5; }
.masthead { background: var(--navy); color: var(--white); }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .9rem; padding-bottom: .9rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.seal { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #c9d6ea; display: grid; place-items: center; font-weight: 700; letter-spacing: .04em; font-size: .95rem; background: var(--navy-2); }
.brand-name { display: block; font-weight: 700; font-size: 1.1rem; }
.brand-office { display: block; font-size: .85rem; color: #c9d6ea; }
.masthead-tools { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; font-size: .92rem; }
.who { color: #dfe7f3; }
.link-btn { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: .25rem; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; padding-bottom: 0; }
.nav a { color: #dfe7f3; text-decoration: none; padding: .6rem .8rem; border-bottom: 3px solid transparent; font-weight: 600; font-size: .95rem; }
.nav a:hover { color: #fff; border-bottom-color: #7fa3d6; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: #ffbf47; }

/* buttons */
.btn { display: inline-block; background: var(--blue); color: #fff; border: 2px solid var(--blue); border-radius: var(--radius); padding: .6rem 1.1rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--blue); }
.btn-outline:hover { background: var(--blue-wash); color: var(--blue-dark); }
.btn-small { padding: .3rem .75rem; font-size: .9rem; }
.btn-ghost { background: transparent; border-color: #9fb6d8; color: #fff; }
.btn-ghost:hover { background: var(--navy-2); border-color: #fff; }
.masthead .btn-small:not(.btn-ghost) { background: #fff; color: var(--navy); border-color: #fff; }

main { padding: 2rem 0 3rem; min-height: 60vh; }

/* hero */
.hero { background: var(--white); border-bottom: 1px solid var(--line); padding: 2.5rem 0; margin: -2rem 0 2rem; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.step-num { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--blue-wash); color: var(--blue-dark); font-weight: 700; margin-bottom: .5rem; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { background: #eef1f5; color: var(--ink-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--ink-2); font-size: .85rem; }
.case-link { font-weight: 700; white-space: nowrap; }

/* badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-filed { background: var(--blue-wash); color: var(--blue-dark); border-color: #c4d6f1; }
.badge-under_review { background: var(--amber-wash); color: var(--amber); border-color: #ecd29d; }
.badge-hearing_scheduled { background: var(--purple-wash); color: var(--purple); border-color: #d3c6ef; }
.badge-decided { background: var(--green-wash); color: var(--green); border-color: #b7dcc4; }
.badge-dismissed, .badge-withdrawn { background: var(--gray-wash); color: #3d434b; border-color: #d3d8df; }

/* forms */
.filters { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; margin-bottom: 1rem; }
.filters .wide { grid-column: span 2; }
@media (max-width: 40rem) { .filters .wide { grid-column: auto; } }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.hint { display: block; font-weight: 400; color: var(--ink-2); font-size: .82rem; }
input, select { width: 100%; font: inherit; font-size: 1rem; padding: .55rem .65rem; border: 1px solid #8a939e; border-radius: 4px; background: #fff; color: var(--ink); }
.filter-actions { display: flex; gap: .5rem; }
.result-count { color: var(--ink-2); margin: .5rem 0; }

/* case page */
.case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .25rem 1.5rem; margin: 1rem 0 0; }
.facts div { padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.facts dt { font-size: .82rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: .1rem 0 0; font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.6rem; border-left: 2px solid var(--line); margin-left: .45rem; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -.5rem; top: .2rem; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.timeline time { display: block; font-size: .85rem; color: var(--ink-2); }
.decision { border-left: 4px solid var(--green); }
.decision.dismissed { border-left-color: #6b7380; }
.decision .summary { font-weight: 700; font-size: 1.05rem; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); }
.doc-list li:last-child { border-bottom: 0; }
.party-list { list-style: none; padding: 0; margin: 0; }
.party-list li { padding: .35rem 0; }
.party-list span { color: var(--ink-2); font-size: .88rem; display: block; }

/* login */
.role-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.role-card { display: flex; flex-direction: column; gap: .4rem; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; cursor: pointer; font: inherit; color: inherit; }
.role-card:hover { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.role-card .role { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue-dark); }
.role-card .name { font-weight: 700; font-size: 1.1rem; color: var(--navy); }
.role-card .org { color: var(--ink-2); font-size: .9rem; }
.role-card .desc { font-size: .9rem; margin-top: .3rem; }

.notice { background: var(--blue-wash); border: 1px solid #c4d6f1; border-radius: var(--radius); padding: .85rem 1rem; color: #133a73; }
.rules-table td:last-child { text-align: right; font-weight: 600; }
.empty { padding: 2rem; text-align: center; color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

footer { background: #e9ecf0; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); }
.footer-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.1rem; padding-bottom: 1.1rem; }

/* ---------- phase 2: filing wizard ---------- */
.steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 1.25rem 0 1rem; flex-wrap: wrap; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; font-weight: 600; }
.steps .num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--gray-wash); font-size: .8rem; }
.steps li.current { border-color: var(--blue); color: var(--navy); box-shadow: 0 0 0 2px var(--blue-wash); }
.steps li.current .num { background: var(--blue); color: #fff; }
.steps li.done { color: var(--green); }
.steps li.done .num { background: var(--green-wash); color: var(--green); }
.alert { background: var(--red-wash); color: var(--red); border: 1px solid #efb9b9; border-left: 4px solid var(--red); border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.step-legend { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: .6rem; padding: 0; }
.choice-row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.choice, .target { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; cursor: pointer; background: #fff; font-weight: 400; margin: 0; }
.choice:hover, .target:hover { border-color: var(--blue); }
.choice:has(input:checked), .target:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); box-shadow: 0 0 0 1px var(--blue); }
.choice input, .target input, .radio input { width: auto; margin-top: .3rem; accent-color: var(--blue); }
.choice .hint { margin-top: .2rem; }
.target-list { display: grid; gap: .6rem; }
.target-body { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.target-fee { font-weight: 700; white-space: nowrap; }
.target.disabled { cursor: not-allowed; background: #f3f4f6; color: var(--ink-2); }
.target.disabled:hover { border-color: var(--line); }
.window { font-size: .85rem; font-weight: 600; }
.window.open { color: var(--green); }
.window.closed { color: var(--red); }
textarea { width: 100%; font: inherit; font-size: 1rem; padding: .65rem; border: 1px solid #8a939e; border-radius: 4px; margin: .5rem 0 .25rem; resize: vertical; }
input[type=file] { padding: .5rem; margin: .5rem 0 1rem; }
.link-btn.dark { color: var(--red); }
.wizard-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.wizard-nav #next, .wizard-nav #submit { margin-left: auto; }
.pay-demo { border: 1px dashed #9aa5b4; border-radius: var(--radius); padding: 1rem; background: #fafbfc; }
.pay-amount { font-size: 1.15rem; margin: 0 0 .75rem; }
.radio { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; margin: .4rem 0; cursor: pointer; }
legend .hint { margin: .2rem 0 .5rem; }

/* receipt */
.receipt-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin: 0 0 .25rem; }
.ok { color: var(--green); font-weight: 700; margin: 0; }
@media print {
  #site-header, #site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
  main { padding: 0; }
}

/* ---------- phase 3: staff workspace + case views ---------- */
.ws-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.ws-grid > div { display: grid; gap: 1rem; align-content: start; }
@media (max-width: 52rem) { .ws-grid { grid-template-columns: 1fr; } }
.card-title { font-size: 1.05rem; margin: 0 0 .65rem; }
.count { display: inline-block; min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px; background: var(--gray-wash); color: var(--ink-2); font-size: .8rem; text-align: center; vertical-align: middle; }
.grounds-card { border-left: 4px solid var(--blue); }
.grounds p { margin: 0 0 .6rem; white-space: normal; }
.grounds p:last-child { margin-bottom: 0; }
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
@media (max-width: 40rem) { .head-side { align-items: flex-start; } }
.action-bar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin: 1rem 0; padding: .85rem 1rem; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form select { width: auto; max-width: 100%; }
.action-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.panel { margin: 0 0 1rem; border-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 40rem) { .form-grid { grid-template-columns: 1fr; } }
.lbl { font-weight: 600; font-size: .92rem; margin-bottom: .2rem; }
.panel-actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.flash { background: var(--green-wash); color: var(--green); border: 1px solid #b7dcc4; border-left: 4px solid var(--green); border-radius: var(--radius); padding: .7rem 1rem; margin: 0 0 1rem; font-weight: 600; }
.flash.bad { background: var(--red-wash); color: var(--red); border-color: #efb9b9; border-left-color: var(--red); }
.dl-list { list-style: none; margin: 0; padding: 0; }
.dl { display: flex; flex-direction: column; padding: .5rem 0 .5rem .75rem; border-left: 3px solid var(--line); margin-bottom: .5rem; }
.dl span { font-size: .88rem; color: var(--ink-2); }
.dl.met { border-left-color: var(--green); } .dl.met span { color: var(--green); }
.dl.soon { border-left-color: #d08a00; } .dl.soon span { color: var(--amber); font-weight: 600; }
.dl.overdue { border-left-color: var(--red); } .dl.overdue span { color: var(--red); font-weight: 600; }
.dl-inline { font-size: .9rem; } .dl-inline .sub { display: block; font-size: .82rem; }
.dl-inline.soon .sub { color: var(--amber); font-weight: 600; }
.dl-inline.overdue .sub { color: var(--red); font-weight: 600; }
.timeline li.internal::before { border-color: #8a939e; }
.tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; background: var(--gray-wash); color: var(--ink-2); padding: 0 .35rem; border-radius: 3px; }
.note-list, .notice-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.note-list li { border-top: 1px solid var(--line-2); padding: .65rem 0; }
.note-list p { margin: 0 0 .2rem; }
#note-form textarea { margin-top: 0; }
.notice-list li { border-top: 1px solid var(--line-2); padding: .5rem 0; }
.notice-list li:first-child, .note-list li:first-child { border-top: 0; }
details summary { cursor: pointer; display: flex; flex-direction: column; gap: .1rem; }
.notice-body { white-space: pre-wrap; font-family: var(--font); font-size: .9rem; background: #f8f9fb; border: 1px solid var(--line-2); border-radius: 4px; padding: .75rem; margin: .5rem 0 0; }
.facts.one { grid-template-columns: 1fr; margin: 0; }
.facts.one div:last-child { border-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; margin-bottom: .5rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: var(--ink-2); display: flex; flex-direction: column; font-size: .9rem; }
.stat:hover { border-color: var(--blue); }
.stat-n { font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.nowrap { white-space: nowrap; }

/* ---------- phase 4: decisions ---------- */
.dec-status { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; vertical-align: middle; border: 1px solid transparent; }
.dec-status.draft { background: var(--gray-wash); color: #3d434b; }
.dec-status.submitted { background: var(--amber-wash); color: var(--amber); border-color: #ecd29d; }
.dec-status.returned { background: var(--red-wash); color: var(--red); border-color: #efb9b9; }
.dec-status.published, .dec-status.approved { background: var(--green-wash); color: var(--green); border-color: #b7dcc4; }
.dec-card { border-left: 4px solid var(--purple); }
.dec-card.submitted { border-left-color: #d08a00; }
.outcome-row { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.return-note { background: var(--red-wash); border: 1px solid #efb9b9; border-radius: var(--radius); padding: .65rem .85rem; margin-bottom: .85rem; color: #6d1414; }
.approve-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-2); }
.public-grounds { border-left: 4px solid var(--blue); }

/* ---------- phase 5: admin ---------- */
.outage-banner { background: var(--red); color: #fff; text-align: center; padding: .55rem 16px; font-weight: 600; font-size: .92rem; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #7a1515; border-color: #7a1515; }
.link-btn.blue { color: var(--blue); }
.text-red { color: var(--red); } .text-amber { color: var(--amber); }
.settings-card { margin-bottom: 1rem; }
.tier-table { max-width: 32rem; }
.tier-table td { padding: .35rem .5rem .35rem 0; border: 0; vertical-align: middle; }
.tier-table th { background: none; padding: 0 .5rem .25rem 0; }
.tier-table input { max-width: 12rem; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.bars li { display: grid; grid-template-columns: minmax(7rem, 9rem) 1fr 2.5rem; align-items: center; gap: .6rem; font-size: .92rem; }
.bar-track { height: .7rem; background: var(--gray-wash); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bar-n { text-align: right; font-weight: 700; }
td.detail { font-size: .85rem; max-width: 28rem; }
.kv { display: inline-block; margin: 0 .5rem .2rem 0; word-break: break-word; }
.kv b { color: var(--ink-2); font-weight: 600; }
code { background: var(--gray-wash); padding: .05rem .35rem; border-radius: 3px; font-size: .85rem; }
@media print {
  .action-bar, .panel, #note-form, .notice, .flash { display: none !important; }
  .ws-grid { grid-template-columns: 1fr; }
}
.doc-list .sub { display: block; }
.passcode-card { margin-bottom: 1rem; max-width: 30rem; }
