/* H-1B Salary Explorer. The look borrows from the form behind the data, the Labor Condition
   Application: cool form paper, form-blue rules and boxes, ink-blue figures, and one red
   "certified" stamp. Public Sans is the US federal design system's typeface. */
:root {
  --paper: #fbfcfe; --sheet: #ffffff; --text: #18202c; --muted: #566173; --rule: #c9d4e3; --rule-soft: #e3e9f2;
  --form: #1b3a6b; --ink: #1f4e9c; --link: #1f4e9c; --stamp: #c4302b; --tint: #eef3fa; --warn: #fff3cd;
  --serif: "Merriweather", Georgia, serif; --sans: "Public Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1622; --sheet: #151e2c; --text: #e6ebf2; --muted: #9aa7b8; --rule: #33445c; --rule-soft: #243246;
    --form: #a9c1e8; --ink: #9cc0ff; --link: #9cc0ff; --stamp: #ff6b5e; --tint: #1b2738; --warn: #3a3218;
  }
  .map image { filter: invert(.86) hue-rotate(180deg); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.55 var(--sans); font-variant-numeric: tabular-nums; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ink) 45%, transparent); outline-offset: 2px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header: a form's title block, closed by a double rule */
.bar { background: var(--sheet); border-bottom: 3px double var(--form); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { color: var(--form); font: 900 19px/1 var(--serif); display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.stamp { font: 700 12px/1 var(--sans); letter-spacing: .04em; color: var(--stamp); border: 2px solid var(--stamp); border-radius: 4px; padding: 4px 6px 3px; transform: rotate(-6deg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stamp) 35%, transparent); }
.bar nav { display: flex; gap: 20px; font-size: 15px; font-weight: 500; }
.bar nav a { color: var(--text); }
.sample { background: var(--warn); text-align: center; padding: 6px 16px; font-size: 14px; }

/* type scale: 14 / 16 / 17 / 19 / 30 / 38 */
h1 { font: 900 clamp(26px, 3.4vw, 34px)/1.15 var(--serif); color: var(--form); margin: 24px 0 6px; max-width: 30ch; }
h1 .sub { display: block; font: 500 16px/1.4 var(--sans); color: var(--muted); margin-top: 8px; }
h2 { font: 700 19px/1.3 var(--serif); color: var(--form); margin: 40px 0 12px; }
.lede { font-size: 17px; line-height: 1.5; color: var(--muted); max-width: 66ch; margin: 8px 0 16px; }
.crumbs { margin: 20px 0 -18px; font-size: 14px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); max-width: 70ch; }

/* home */
.hero { padding: 24px 0 2px; }
.hero h1 { font-size: clamp(28px, 3.8vw, 38px); max-width: none; letter-spacing: -.01em; margin-top: 0; }
.try { font-size: 15px; color: var(--muted); margin: -8px 0 20px; }

/* search: a form field */
.search { position: relative; max-width: 640px; margin: 0 0 24px; }
.search input { width: 100%; font: 16px var(--sans); padding: 11px 14px; border: 1px solid var(--rule); border-bottom: 2px solid var(--form); border-radius: 2px; background: var(--sheet); color: var(--text); }
.search.big input { font-size: 17px; padding: 12px 16px; border: 2px solid var(--form); border-bottom-width: 3px; }
.search input:focus { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 22%, transparent); }
.sugg { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 6px 0 0; padding: 4px; list-style: none; background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; box-shadow: 0 10px 30px rgba(20, 40, 80, .14); }
.sugg a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 10px; border-radius: 3px; color: var(--text); }
.sugg a:hover, .sugg [aria-selected=true] a { background: var(--tint); text-decoration: none; }
.sugg b { font-weight: 600; }
.sugg span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.results { list-style: none; padding: 0; max-width: 760px; }
.results li { padding: 9px 0; border-bottom: 1px solid var(--rule-soft); display: flex; justify-content: space-between; gap: 12px; }
.results span { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* the figures, as boxes on a form: small label top left, the entry below */
.stats { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 1fr; border: 1px solid var(--form); background: var(--sheet); margin: 0 0 8px; }
.stats div { padding: 10px 16px 14px; border-left: 1px solid var(--rule); }
.stats div:first-child { border-left: 0; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 6px 0 0; font-size: 19px; font-weight: 600; color: var(--text); }
.stats dd.big { font: 900 30px/1.1 var(--serif); color: var(--ink); }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .stats dd.big { font-size: 26px; }
}

/* layout */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; }
@media (max-width: 960px) { .cols3 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .cols2 { grid-template-columns: 1fr; } }
.cols2 > *, .cols3 > * { min-width: 0; }

/* tables: ruled like a form, no boxes inside boxes */
.tbl-wrap { overflow-x: auto; }
table.sum { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--sheet); border-top: 2px solid var(--form); border-bottom: 1px solid var(--form); }
.sum th { text-align: left; font: 600 13px var(--sans); color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.sum td { padding: 7px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.sum tr:last-child td { border-bottom: 0; }
.sum tbody tr:hover td { background: var(--tint); }
.sum .r { text-align: right; }
.sum td.r { white-space: nowrap; }
.sum td.m { font-weight: 600; color: var(--text); }
.nw { white-space: nowrap; }
.sum th button { all: unset; cursor: pointer; }
.sum th button:hover { color: var(--text); }
.sum th[aria-sort=ascending] button::after { content: " ▲"; font-size: 10px; }
.sum th[aria-sort=descending] button::after { content: " ▼"; font-size: 10px; }
.sum th button:focus-visible { outline: 2px solid var(--link); }
.more { font-size: 15px; margin: 10px 0 0; }
.cols3 .hide-s { display: none; }
@media (max-width: 560px) { .hide-s { display: none; } .sum { font-size: 14px; } .sum td, .sum th { padding: 6px 6px; } }

/* map */
.map { margin: 8px 0 8px; }
.map svg { width: 100%; height: auto; display: block; }
.map circle { stroke: var(--sheet); stroke-width: .9; fill-opacity: .9; }
.map a circle:hover { stroke: var(--stamp); stroke-width: 2.2; }
.map figcaption { font-size: 14px; color: var(--muted); margin-top: 4px; }
.legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; margin-left: 4px; }
.legend span { white-space: nowrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* filings */
.filings { margin-top: 16px; }
.ctl { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin-bottom: 12px; }
.ctl label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.ctl input, .ctl select { font: 15px var(--sans); padding: 8px 10px; border: 1px solid var(--rule); border-bottom: 2px solid var(--form); border-radius: 2px; background: var(--sheet); color: var(--text); min-width: 120px; }
.ctl input { min-width: 260px; }
@media (max-width: 560px) { .ctl input { min-width: 0; width: 100%; } .ctl label:first-child { flex-basis: 100%; } }
.fstats { margin: 4px 0; font-size: 16px; }
.fstats b { font-weight: 700; color: var(--ink); }
.hist { margin: 4px 0 14px; max-width: 640px; }
.hist svg { width: 100%; height: auto; display: block; }
.hist rect { fill: var(--ink); opacity: .78; }
.hist rect:hover { opacity: 1; }
.hist line { stroke: var(--stamp); stroke-width: 1.5; }
.hist text { font: 12px var(--sans); fill: var(--muted); }
.hist .medlab { fill: var(--stamp); font-weight: 700; }
.more-rows button { font: 600 15px var(--sans); padding: 9px 16px; border: 1px solid var(--form); border-radius: 2px; background: var(--sheet); color: var(--form); cursor: pointer; }
.more-rows button:hover { background: var(--tint); }
.loading { color: var(--muted); padding: 20px 0; }

/* lists */
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chips a { display: inline-flex; gap: 6px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px; padding: 5px 10px; font-size: 14px; color: var(--text); }
.chips a:hover { border-color: var(--form); text-decoration: none; }
.chips span { color: var(--muted); }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; }
.letters a { min-width: 36px; text-align: center; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 2px; background: var(--sheet); font-weight: 600; }
.letters a[aria-current] { background: var(--form); border-color: var(--form); color: var(--sheet); }
.list { columns: 3 260px; column-gap: 32px; list-style: none; padding: 0; font-size: 15px; }
.list li { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--rule-soft); display: flex; justify-content: space-between; gap: 10px; }
.list span { color: var(--muted); font-size: 14px; }
.state-group h2 { margin-top: 28px; }

.prose { max-width: 68ch; }
.prose li { margin: 8px 0; }
.foot { margin-top: 56px; padding-top: 16px; padding-bottom: 36px; border-top: 3px double var(--form); font-size: 14px; color: var(--muted); }
.foot p { max-width: 90ch; }
.hero ~ .map svg { max-width: 900px; margin: 0 auto; }
.map figcaption { min-height: 3em; } /* the legend fills in after load; keep its line reserved */
/* Filings load after the page: keep a screen of space so nothing below jumps into view. */
.filings > .loading { min-height: 100vh; }
.map-row .map { margin-top: 0; }
.filings h2 { margin-top: 32px; }
