/* VetsLearn // Contracting — VetsLearn v1.1 light theme (Bone / Ink / Rust).
   WS-G brand unification: the tool's local variable NAMES are kept (so every
   component rule is untouched) but their VALUES now alias the shared tokens in
   sd-tools.css. Only the look changes; every class/element the app uses is preserved. */
:root {
  --bg: var(--bone);
  /* --panel and --ink are left undefined here: the tool's local names collide
     with the shared token names of the same name (self-reference would cycle),
     and the tokens already carry the exact values needed — panel surface and
     dark primary text — so the token definitions win. */
  --panel-2: var(--bone-deep);
  --paper: var(--bone);
  --line: var(--bone-line);
  --line-strong: var(--bone-line);
  --muted: var(--ink-mute);
  /* --accent intentionally undefined here so the shared token's rust wins. */
  --accent-dim: var(--accent-deep);
  --accent-soft: var(--panel);
  --urgent: var(--bad);
  --urgent-soft: var(--panel);
  --soon: var(--warn);
  --soon-soft: var(--panel);
  --open: var(--good);
  --open-soft: var(--panel);
  --closed: var(--ink-mute);
  --closed-soft: var(--bone-deep);
  --mono: var(--font-mono);
  --sans: var(--font-sans);
  --radius: 5px;
  --shadow: 0 1px 2px rgba(20,24,31,.06), 0 8px 24px rgba(20,24,31,.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- Masthead ------------------------------------------------------------ */
.masthead {
  background: var(--panel);
  color: var(--ink);
  padding: 34px 0 30px;
  border-bottom: 1px solid var(--border, var(--line));
  border-bottom: 3px solid var(--accent);
}
.mark {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .18em;
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
}
.mark span { color: var(--muted); }
.masthead h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 12px 0 10px;
}
.lede { color: var(--muted); max-width: 64ch; margin: 0; font-size: 15px; }

/* ---- Controls ------------------------------------------------------------ */
.controls {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(20,24,31,.08);
}
.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input[type="text"], .field input[type="password"], .field select {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 11px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#naics, #psc, #state { font-family: var(--mono); }
.field.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding-bottom: 9px;
}
.field.checkbox span { text-transform: none; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink); }
.field.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Field-level note (e.g. the keyword-scope disclosure). */
.field-note { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

/* Veteran-first default control. */
.setaside-field .linklike {
  align-self: flex-start;
  background: none; border: none; padding: 2px 0; margin: 0;
  color: var(--accent); font-family: var(--sans); font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: underline;
}
.setaside-field .linklike:hover { color: var(--accent-deep); }

.actions { display: flex; gap: 12px; margin-top: 18px; }
button {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 10px 18px;
  border: 1px solid transparent;
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
}
button:active { transform: translateY(1px); }
.primary { background: var(--accent); color: var(--bone); }
.primary:hover { background: var(--accent-deep); }
.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.ghost:hover { border-color: var(--muted); background: var(--panel-2); }

/* ---- Status + results ---------------------------------------------------- */
.results-wrap { padding: 26px 24px 60px; }
.status { color: var(--muted); font-size: 14px; margin-bottom: 18px; min-height: 20px; }
.status .count { color: var(--ink); font-weight: 600; }
.status.error {
  background: var(--urgent-soft);
  color: var(--urgent);
  border: 1px solid var(--bad);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.results { display: flex; flex-direction: column; gap: 16px; }

/* ---- Opportunity card ---------------------------------------------------- */
.card {
  display: grid;
  grid-template-columns: 108px 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rail {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  text-align: center;
  border-right: 1px solid var(--line);
}
.rail .days {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
}
.rail .days-label, .rail .status-word {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.rail.urgent { background: var(--urgent-soft); color: var(--urgent); }
.rail.soon   { background: var(--soon-soft);   color: var(--soon); }
.rail.open   { background: var(--open-soft);   color: var(--open); }
.rail.closed, .rail.none { background: var(--closed-soft); color: var(--closed); }
.rail .status-word.big { font-size: 15px; font-family: var(--sans); letter-spacing: 0; }

.body { padding: 18px 20px; min-width: 0; }
.card-title {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 6px;
}
.agency { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chip {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
}
.chip.notice { background: var(--bone-deep); border-color: var(--bone-line); }
.chip.setaside { background: var(--accent-soft); border-color: var(--accent-dim); color: var(--accent); font-family: var(--sans); font-weight: 600; }
.chip.open-bid { background: var(--panel-2); color: var(--muted); font-family: var(--sans); }
.chip.award { background: var(--soon-soft); border-color: var(--warn); color: var(--soon); font-family: var(--sans); font-weight: 600; }

.explain {
  font-size: 13.5px;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
  margin: 0 0 14px;
}
.explain b { color: var(--ink); font-weight: 600; }

.meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.meta .k { font-weight: 600; color: var(--ink); }
.meta code { font-family: var(--mono); font-size: 12.5px; }

.desc {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 14px;
  max-height: 340px;
  overflow-y: auto;
}
.desc.loading { color: var(--muted); font-style: italic; }

.card-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.card-actions a { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.card-actions a:hover { text-decoration: underline; }
.linkbtn {
  background: none; border: none; padding: 0;
  color: var(--accent); font-family: var(--sans); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }
.contact { color: var(--muted); font-size: 13px; }
.contact a { color: var(--muted); text-decoration: underline; }

/* ---- Empty + pager ------------------------------------------------------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h3 { font-family: var(--sans); color: var(--ink); margin: 0 0 6px; }
.skeleton {
  height: 128px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--bone-deep) 30%, var(--panel) 50%, var(--bone-deep) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
  border: 1px solid var(--line);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 26px; }
.pager span { font-size: 13.5px; color: var(--muted); font-family: var(--mono); }

.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; }
.foot p { color: var(--muted); font-size: 13px; max-width: 74ch; margin: 0 0 10px; }
.foot p:last-child { margin-bottom: 0; }
.foot .disclaimer { font-size: 12px; color: var(--muted); opacity: .95; }

@media (max-width: 820px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr; }
  .card { grid-template-columns: 1fr; }
  .rail { flex-direction: row; gap: 10px; border-right: none; border-bottom: 1px solid var(--line); justify-content: flex-start; }
  .rail .days { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  * { transition: none !important; }
}

/* ---- Analysis panel ------------------------------------------------------ */
.linkbtn.primary-link { color: var(--accent); font-weight: 700; }
.analysis {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 16px 18px;
}
.analysis.loading { color: var(--muted); font-style: italic; border-top-color: var(--line-strong); }
.a-err { color: var(--urgent); margin: 0; }

.a-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tier {
  font-family: var(--sans);
  font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
  padding: 5px 12px; border-radius: 999px; border: 1px solid transparent;
}
.tier-beginner { background: var(--open-soft); color: var(--accent); border-color: var(--accent-dim); }
.tier-moderate { background: var(--soon-soft); color: var(--soon); border-color: var(--warn); }
.tier-expert   { background: var(--urgent-soft); color: var(--urgent); border-color: var(--bad); }
.low-commit { background: var(--bone-deep); color: var(--ink-soft); border-color: var(--bone-line); }
.a-src { font-size: 12px; color: var(--muted); margin-left: auto; }

.a-summary { font-size: 14.5px; line-height: 1.6; margin: 0 0 8px; }
.a-buy { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.a-buy b, .a-beginner b { color: var(--ink); }

.a-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 6px; }
.a-col h4, .a-block h4 {
  font-family: var(--sans); font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin: 0 0 8px;
}
.est-range {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  font-family: var(--mono); font-weight: 600; font-size: 20px; color: var(--ink);
}
.est-range em { font-family: var(--sans); font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); }
.est-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0 0; }

.factors { list-style: none; margin: 0; padding: 0; }
.factors li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.factors li:last-child { border-bottom: none; }
.factors b { font-family: var(--mono); color: var(--urgent); font-size: 12.5px; }
.factors b.ok { color: var(--accent); }
.factors .w-zero span { color: var(--muted); }

.a-block { margin-top: 14px; }
.reqs { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
.a-block.flags .reqs li { color: var(--urgent); }
.a-beginner { font-size: 13.5px; line-height: 1.6; background: var(--accent-soft); border: 1px solid var(--accent-dim); border-radius: var(--radius); padding: 10px 13px; margin: 14px 0 0; }
.a-disclaimer { font-size: 11.5px; color: var(--muted); font-style: italic; margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }

@media (max-width: 560px) { .a-grid { grid-template-columns: 1fr; } .a-src { margin-left: 0; width: 100%; } }

/* ---- Eligibility profile panel ------------------------------------------- */
.profile {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px;
}
.profile > summary {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; list-style: none; padding: 9px 0; font-weight: 600;
}
.profile > summary::-webkit-details-marker { display: none; }
.profile-title { font-family: var(--sans); }
.profile-status {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--muted); background: var(--closed-soft);
  padding: 2px 8px; border-radius: 999px;
}
.profile-status.is-set { color: var(--accent); background: var(--accent-soft); }
.profile-lede { font-size: 12.5px; color: var(--muted); margin: 2px 0 12px; line-height: 1.5; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; padding-bottom: 14px; }
.profile-field {
  display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start;
  font-size: 13.5px; cursor: pointer;
}
.profile-field input { margin-top: 3px; accent-color: var(--accent); }
.profile-field .pf-label { font-weight: 500; }
.profile-field .pf-hint { grid-column: 2; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
@media (max-width: 560px) { .profile-grid { grid-template-columns: 1fr; } }

/* ---- Saved searches panel ------------------------------------------------ */
.saved-actions { margin: 2px 0 12px; }
.saved-list { list-style: none; margin: 0; padding: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.saved-empty { font-size: 12.5px; color: var(--muted); }
.saved-item {
  display: inline-flex; align-items: stretch; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-2);
}
.saved-load {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  background: transparent; border: none; color: var(--accent);
  padding: 6px 8px 6px 13px; border-radius: 0; cursor: pointer;
}
.saved-load:hover { background: var(--accent-soft); }
.saved-del {
  font-family: var(--sans); font-size: 12px; line-height: 1;
  background: transparent; border: none; border-left: 1px solid var(--line);
  color: var(--muted); padding: 6px 11px; border-radius: 0; cursor: pointer;
}
.saved-del:hover { background: var(--urgent-soft); color: var(--urgent); }

/* ---- Eligibility badge on a card ----------------------------------------- */
.elig {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; margin-bottom: 10px;
  border: 1px solid transparent;
}
.elig-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.elig-label { font-family: var(--sans); letter-spacing: .01em; }
.elig-detail { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.elig-eligible   { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-dim); }
.elig-open       { color: var(--muted);  background: var(--closed-soft); border-color: var(--line); }
.elig-ineligible { color: var(--urgent); background: var(--urgent-soft); border-color: var(--bad); }
.elig-soleSource { color: var(--closed); background: var(--closed-soft); border-color: var(--line); }
.elig-special    { color: var(--soon);   background: var(--soon-soft);   border-color: var(--warn); }
.elig-ineligible .elig-detail, .elig-special .elig-detail { color: inherit; opacity: .85; }

/* ---- SDVOSB / VOSB certification path ------------------------------------ */
.cert #certBody { padding-bottom: 14px; }
.cert-block { margin-top: 12px; }
.cert-block h4 {
  font-family: var(--sans); font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin: 0 0 8px;
}
.cert-benefits, .cert-help { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
.cert-benefits li { margin-bottom: 4px; }
.cert-help li { margin-bottom: 4px; }
.cert-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.cert-step { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cert-step:last-child { border-bottom: none; }
.cs-head { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.cs-head input { flex: none; accent-color: var(--accent); }
.cs-num {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.cs-head input:checked ~ .cs-num { background: var(--accent); color: var(--bone); }
.cs-head b { font-weight: 600; }
.cs-head input:checked ~ b { color: var(--muted); text-decoration: line-through; }
.cs-detail { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 3px 0 0 29px; }
.cert-block a { color: var(--accent); text-decoration: none; font-weight: 500; }
.cert-block a:hover { text-decoration: underline; }

/* --- Bring-your-own SAM.gov key ------------------------------------------- */
.keyblock {
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.keyblock .key-field { max-width: 520px; }
.keyblock .key-field span { color: var(--accent); font-weight: 600; }
.key-help { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 74ch; }
.key-help a { color: var(--accent); }
