/* KnowTheBid site styles, direction C ("The verdict"). Tokens live in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--font-body); }
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { color: var(--focus); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(30px, 4.4vw, 48px); margin: 8px 0 16px; max-width: 22ch; }
h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 40px 0 12px; }
h3 { font-size: 20px; margin: 16px 0 6px; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
.small { font-size: 14px; color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px; z-index: 10; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 24px; }
.draft-banner { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--paper);
  text-align: center; padding: 8px 16px; font-weight: 700; font-size: 14px; letter-spacing: .02em; }

/* header and footer */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 24px; text-decoration: none; }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.site-header nav a { text-decoration: none; }
.site-footer { margin-top: 64px; border-top: 1px solid var(--rule); padding: 24px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.notice { font-size: 13px; color: var(--muted); }
.crumbs { font-size: 14px; color: var(--muted); margin-top: 20px; }

/* project page */
.answer { font-size: 19px; max-width: 70ch; }
.byline { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); margin: 12px 0 28px; }
.byline img { border-radius: 50%; object-fit: cover; flex: none; }
.byline p { margin: 0; }
.grid-checker { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.checker h2 { margin-top: 0; font-size: 24px; }
.checker-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; align-items: end; }
.checker-form label { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; gap: 4px; }
.checker-form input, .checker-form select { min-height: 48px; background: transparent; border: 0;
  border-bottom: 1.5px solid var(--ink); font: 19px var(--font-body); color: var(--ink); padding: 0; width: 100%; }
.btn-primary { min-height: 48px; background: var(--accent); color: #fff; border: 0; border-radius: 4px;
  font: 700 16px var(--font-body); padding: 0 20px; cursor: pointer; }
.btn-secondary { min-height: 44px; background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
  border-radius: 4px; font: 600 15px var(--font-body); padding: 0 16px; cursor: pointer; }
.result { margin-top: 20px; border-top: 1px solid var(--rule); padding-top: 16px; }
.verdict-word { font-family: var(--font-display); font-size: 48px; font-weight: 600; margin: 0; line-height: 1.1; }
.verdict-fair { color: var(--verdict); }
.verdict-low, .verdict-high { color: var(--ink); }
.verdict-early, .verdict-none { font-size: 28px; color: var(--ink); }
.verdict-line, .scope, .zone-line, .national { margin: 8px 0; }
.national { font-size: 15px; color: var(--muted); }
.tape { margin: 34px 0 8px; }
.tape-bar { position: relative; height: 28px; background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 10%), var(--verdict-mist); border: 1px solid var(--ink); border-radius: 2px; }
.tape-zone { position: absolute; top: 0; bottom: 0; background: var(--verdict-light); }
.tape-marker { position: absolute; top: -10px; bottom: -10px; width: 3px; margin-left: -1.5px; background: var(--accent); }
.tape-marker span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--ink); }
.tape-tick { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--ink); }
.tape-zone-labels { position: relative; height: 22px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--verdict); }
.tape-zone-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tape-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }
.fig { font-variant-numeric: tabular-nums; }

/* H2 region bar */
.region-bar { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px 24px; }
.region-bar figcaption { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin-bottom: 12px; }
.region-bar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.region-bar li { display: grid; grid-template-columns: 90px 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; font-size: 15px; }
.rb-track { height: 12px; background: var(--paper); border-radius: 2px; overflow: hidden; }
.rb-fill { display: block; height: 100%; background: var(--verdict-pale); }
.rb-empty { background: repeating-linear-gradient(45deg, var(--paper) 0 4px, var(--rule) 4px 6px); }
.rb-val { font-weight: 600; text-align: right; }
.rb-who { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
.region-bar li.is-you .rb-name { font-weight: 700; }
.region-bar li.is-you .rb-fill { background: var(--verdict); }

/* questions and second-quote slot */
.ask { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.questions { padding-left: 22px; }
.questions li { margin-bottom: 14px; }
.questions strong { display: block; }
.questions span { color: var(--muted); font-size: 15px; }
.second-quote { margin-top: 40px; }
.second-quote h2 { margin-top: 0; }

/* what moves, tables, faq */
.moves ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.moves .big { display: block; font-family: var(--font-display); font-size: 36px; font-weight: 600; color: var(--verdict); }
.moves h3 { margin-top: 4px; }
.moves p { margin: 0; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.metro, .method table { overflow-x: auto; }
.tag { display: inline-block; font-size: 12px; color: var(--muted); }
details { border-bottom: 1px solid var(--rule); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
.related ul, .sources ul { padding-left: 20px; }

/* hubs and home */
.hub-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.hub-list h2 { margin-top: 0; font-size: 22px; }
.home-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding-top: 32px; }
.seal { width: 150px; height: 150px; border-radius: 50%; border: 2px solid var(--ink); display: flex; flex-direction: column;
  align-items: center; justify-content: center; transform: rotate(-8deg); text-align: center; font-size: 13px; background: var(--surface); }
.seal-n { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.house { width: 100%; max-width: 640px; height: auto; display: block; margin: 16px auto; }
.house .line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; pointer-events: none; }
.house .hot { fill: transparent; cursor: pointer; }
.house a:hover .hot, .house a:focus .hot { fill: var(--verdict-mist); }
.house .lbl { font: 600 15px var(--font-body); fill: var(--ink); text-anchor: middle; text-decoration: underline; }
.house a:focus { outline: none; }
.house a:focus .hot { stroke: var(--focus); stroke-width: 3; }
.trade-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.trade-tiles a { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 14px; text-decoration: none; height: 100%; }
.trade-tiles span { display: block; font-size: 14px; color: var(--muted); }
.matt { display: flex; gap: 20px; align-items: center; margin-top: 40px; }
.matt img, .author-head img { border-radius: 6px; object-fit: cover; flex: none; }
.matt h2 { margin-top: 0; }
.author-head { display: flex; gap: 20px; align-items: center; }
.source dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 15px; }
.source dt { font-weight: 600; }
.source dd { margin: 0; overflow-wrap: anywhere; }
main { overflow-wrap: break-word; }
.source dd ul { margin: 0; padding-left: 18px; }

/* Phase 2.3: comparison bars, study, city reports, electrician block */
.span-bar { position: relative; height: 14px; background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; margin: 6px 0 2px; }
.span-fill { position: absolute; top: 0; bottom: 0; background: var(--verdict-light); }
.span-med { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.span-label { margin: 2px 0; font-size: 14px; }
.cmp-region h2 { font-size: 22px; margin-top: 28px; }
.cmp-row { margin: 10px 0 14px; }
.cmp-name { font-weight: 600; }
.claims li { margin-bottom: 10px; }
.claims .not-stable { color: var(--muted); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.att h3 { margin-top: 0; }
.electrician { margin-top: 32px; }
.electrician h2 { margin-top: 0; font-size: 24px; }
.code-fact { background: var(--verdict-mist); }
.city-table td:first-child { font-weight: 600; }
.histogram { margin: 0 0 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 16px; }
.histogram svg { width: 100%; height: 180px; display: block; }
.histogram .hbar { fill: var(--verdict-light); }
.histogram figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.histogram .hist-max { margin: 0; font-size: 13px; color: var(--muted); }
.histogram svg { border-top: 1px dashed var(--rule); }
.histogram .hist-x { position: relative; height: 1.5em; margin-top: 6px; font-size: 13px; color: var(--muted); }
.histogram .hx { position: absolute; top: 0; white-space: nowrap; }
.histogram .hx.first { left: 0; }
.histogram .hx.mid { transform: translateX(-50%); }
.histogram .hx.last { right: 0; }
.know, .scope-explainer { margin-top: 32px; }

@media (max-width: 720px) {
  .checker-form { grid-template-columns: 1fr; }  /* three fields side by side truncate the job names */
}
@media (max-width: 860px) {
  .grid-checker, .ask { grid-template-columns: 1fr; }
  .moves ul { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: 1fr; }
  .seal { width: 120px; height: 120px; margin-bottom: 28px; }
  .second-quote { margin-top: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header nav { gap: 6px 14px; font-size: 14px; padding-bottom: 10px; }
  .matt, .author-head { flex-direction: column; align-items: flex-start; }
  .source dl { grid-template-columns: 1fr; }
  table { font-size: 14px; display: block; overflow-x: auto; }
  th, td { padding: 8px 6px; }
  .verdict-word { font-size: 40px; }
  .histogram .hist-x { font-size: 12px; }
}
@media print {
  .site-header, .site-footer, .checker, .region-bar, .moves, .metro, .faq, .related, .sources, .byline, .answer, h1, .crumbs, .draft-banner, .second-quote { display: none !important; }
  .ask { display: block; }
  body { background: #fff; }
}
