/* The TN List — styles. Light-first tokens; dark via media query + data-theme override. */
:root {
  --paper: #F6F7F5;
  --surface: #FFFFFF;
  --ink: #14201B;
  --ink-2: #4C5954;
  --muted: #7F8C86;
  --line: #E3E6E1;
  --line-soft: #EDEFEA;
  --accent: #B3372C;
  --accent-soft: rgba(179, 55, 44, 0.08);
  --data: #1E6FA8;
  --data-soft: rgba(30, 111, 168, 0.14);
  --good: #157A46;
  --chip: #EEF1EC;
  --shadow: 0 1px 2px rgba(20, 32, 27, 0.05), 0 8px 24px rgba(20, 32, 27, 0.06);
  --focus: #1E6FA8;
  --band-1: rgba(30, 111, 168, 0.28); --band-2: rgba(30, 111, 168, 0.5); --band-3: rgba(30, 111, 168, 0.75); --band-4: #1E6FA8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1311;
    --surface: #171D1A;
    --ink: #EBEFEC;
    --ink-2: #A7B2AC;
    --muted: #79857F;
    --line: #262E29;
    --line-soft: #1F2622;
    --accent: #E06A5C;
    --accent-soft: rgba(224, 106, 92, 0.12);
    --data: #4E93C4;
    --data-soft: rgba(78, 147, 196, 0.18);
    --good: #3FA96F;
    --chip: #212925;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --focus: #4E93C4;
    --band-1: rgba(78, 147, 196, 0.3); --band-2: rgba(78, 147, 196, 0.52); --band-3: rgba(78, 147, 196, 0.76); --band-4: #4E93C4;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1311;
  --surface: #171D1A;
  --ink: #EBEFEC;
  --ink-2: #A7B2AC;
  --muted: #79857F;
  --line: #262E29;
  --line-soft: #1F2622;
  --accent: #E06A5C;
  --accent-soft: rgba(224, 106, 92, 0.12);
  --data: #4E93C4;
  --data-soft: rgba(78, 147, 196, 0.18);
  --good: #3FA96F;
  --chip: #212925;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --focus: #4E93C4;
  --band-1: rgba(78, 147, 196, 0.3); --band-2: rgba(78, 147, 196, 0.52); --band-3: rgba(78, 147, 196, 0.76); --band-4: #4E93C4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--data); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.display { font-family: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif; }
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.wordmark { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 19px; color: var(--ink); }
.wordmark:hover { text-decoration: none; }
.stamp {
  display: inline-block; padding: 1px 7px 2px;
  border: 2px solid var(--good); border-radius: 6px;
  color: var(--good); font-weight: 800; letter-spacing: 0.02em;
  transform: rotate(-3deg); font-size: 16px;
}
.topnav { display: flex; gap: 22px; margin-left: auto; }
.topnav a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.topnav a:hover { color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; }
@media (max-width: 640px) {
  /* Phones: the links move into a dropdown under the sticky bar, opened by a hamburger at the right. */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .nav-toggle .bars { display: flex; flex-direction: column; gap: 4px; }
  .nav-toggle .bars i { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .18s ease, opacity .18s ease; }
  .nav-toggle[aria-expanded="true"] .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .topnav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    flex-direction: column; gap: 0; padding: 4px 20px 8px;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .topnav.open { display: flex; }
  .topnav a { display: block; padding: 13px 0; font-size: 16px; border-top: 1px solid var(--line-soft); }
  .topnav a:first-child { border-top: none; }
}

/* ---------- hero ---------- */
.hero { padding: 52px 0 44px; }
#results, #insights, #method { scroll-margin-top: 72px; }  /* land below the sticky bar */
.hero h1 {
  font-size: clamp(30px, 5vw, 46px); line-height: 1.06; letter-spacing: -0.015em;
  font-weight: 800; margin: 0 0 14px; text-wrap: balance; max-width: 26ch;
}
.hero h1 .em { color: var(--good); }
.hero .sub { color: var(--ink-2); max-width: 62ch; margin: 0 0 26px; font-size: 17px; }
.hero .sub strong { color: var(--ink); }

.searchbox { position: relative; max-width: 660px; }
.searchbox svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#search {
  width: 100%; padding: 15px 18px 15px 48px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
#search::placeholder { color: var(--muted); }
#search:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--data-soft), var(--shadow); }



/* ---------- results ---------- */
.results-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 26px 0 12px;
}
.results-head h2 { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0; margin-right: auto; }
.results-head h2 b { color: var(--ink); }
.sel {
  padding: 7px 30px 7px 12px; font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237F8C86' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.clear-btn { border: none; background: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 6px 4px; display: none; }
.clear-btn.show { display: inline-block; }

.list-head {
  display: grid; gap: 12px; align-items: center;
  grid-template-columns: 34px minmax(200px, 1fr) 150px 88px 96px 104px 20px;
  padding: 8px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600;
}
.list-head .num { text-align: right; }
@media (max-width: 900px) { .list-head { display: none; } }

#list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.row {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.row-main {
  display: grid; gap: 12px; align-items: center; width: 100%;
  grid-template-columns: 34px minmax(200px, 1fr) 150px 88px 96px 104px 20px;
  padding: 13px 16px; border: none; background: none; text-align: left; color: inherit;
}
.row-main:hover { background: var(--line-soft); }
.rank { color: var(--muted); font-size: 12.5px; }
.emp .n, .emp .loc { display: block; }  /* name on one line, headquarters beneath it */
.emp .n { font-weight: 600; font-size: 15.5px; line-height: 1.25; }
.emp .loc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.sector-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--chip); color: var(--ink-2); font-size: 12px; font-weight: 500;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.num { text-align: right; font-size: 14px; }
.cases-n { font-weight: 700; font-size: 16px; }
.badges { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink-2);
}
.flag { font-size: 16px; line-height: 1; }
.badges .flag { margin-right: 2px; }
.chev { color: var(--muted); transition: transform 0.15s; }
.row.open .chev { transform: rotate(180deg); }
@media (max-width: 900px) {
  /* Compact card: employer on the first line, then "TN filings: N" and "Hires 🇨🇦🇲🇽 H-1B" left-aligned. */
  .row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 14px; }
  .row-main .emp { flex: 1 1 100%; }
  .rank, .row-main > span:nth-child(3), .row-main > .num:nth-child(5), .chev { display: none; } /* rank, industry, median salary */
  .row-main .num, .row-main .badges { text-align: left; justify-content: flex-start; }
  .row-main .cases-n { font-size: 14px; }
  .row-main .cases-n::before, .row-main .badges::before {
    font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 12.5px; font-weight: 500; color: var(--muted);
  }
  .row-main .cases-n::before { content: "TN filings: "; }
  .row-main .badges::before { content: "Hires"; margin-right: 2px; }
}

.row-detail { display: none; border-top: 1px solid var(--line); padding: 16px; }
.row.open .row-detail { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr 1.3fr; gap: 22px; }
@media (max-width: 1100px) { .row.open .row-detail { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .row.open .row-detail { grid-template-columns: 1fr; } }
.dt-sub { font-size: 11px; color: var(--muted); margin: 8px 0 2px; }
.dt-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.dt h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.yr-bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.yr-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 26px; }
.yr-bar .bar { width: 100%; background: var(--data); border-radius: 3px 3px 0 0; min-height: 2px; }
.yr-bar .yl { font-size: 10.5px; color: var(--muted); min-height: 13px; }
.yr-bar .yv { font-size: 11px; color: var(--ink-2); }
.yr-bars.compact { gap: 2px; }
.yr-bars.compact .yr-bar { min-width: 0; gap: 2px; }
.yr-bars.compact .yr-bar .yv { display: none; }
.yr-bars.compact .yr-bar .yl { font-size: 9.5px; }
.title-list { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.title-list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.title-list .c { color: var(--muted); }
.fact-line { font-size: 13.5px; color: var(--ink-2); padding: 3px 0; display: flex; justify-content: space-between; gap: 8px; }
.fact-line b { color: var(--ink); font-weight: 600; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.ws-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }

.more-wrap { text-align: center; padding: 10px 0 20px; }
#more {
  padding: 10px 22px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px;
}
#more:hover { border-color: var(--data); color: var(--data); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- insights ---------- */
.section { padding: 44px 0 8px; }
.section > .wrap > h2 {
  font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.01em;
  margin: 0 0 6px; text-wrap: balance;
}
.section .lede { color: var(--ink-2); max-width: 68ch; margin: 0 0 24px; font-size: 15.5px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .chart-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 18px 14px; position: relative;
}
.card h3 { margin: 0 0 2px; font-size: 15.5px; font-weight: 700; }
.card .note { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.card .src { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.tbl-toggle {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--chip); border: none; border-radius: 6px; padding: 4px 8px;
}
.tbl-toggle:hover { color: var(--data); }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--ink); color: var(--paper);
  font-size: 12px; padding: 5px 9px; border-radius: 7px;
  transform: translate(-50%, calc(-100% - 8px)); white-space: nowrap;
  opacity: 0; transition: opacity 0.1s;
}
.chart-tip.show { opacity: 1; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0; }
.data-table th, .data-table td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line-soft); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--muted); font-weight: 600; }

/* ---------- methodology ---------- */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .method-grid { grid-template-columns: 1fr; } }
.method-grid .card h3 { font-size: 16px; margin-bottom: 8px; }
.method-grid .card p, .method-grid .card li { font-size: 14px; color: var(--ink-2); }
.method-grid .card p { margin: 0 0 10px; }
.method-grid .card ul { margin: 0; padding-left: 18px; }
.method-grid .card li { margin-bottom: 6px; }
.method-grid .card b, .method-grid .card strong { color: var(--ink); }

/* ---------- chart marks ---------- */
.c-bar { fill: var(--data); }
.c-bar:hover { fill: color-mix(in srgb, var(--data) 82%, var(--ink)); }
.c-bar-em { fill: var(--accent); }
.c-bar-part { opacity: 0.45; }
.c-grid { stroke: var(--line-soft); stroke-width: 1; }
.c-axis { stroke: var(--line); stroke-width: 1.2; }
.c-lab { fill: var(--muted); font-size: 10.5px; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.c-val { fill: var(--ink-2); font-size: 11px; font-weight: 600; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.c-line { fill: none; stroke: var(--data); stroke-width: 2; stroke-linejoin: round; }
.c-dot { fill: var(--accent); }
.c-pt { fill: var(--data); stroke: var(--surface); stroke-width: 2; }       /* point markers with a surface ring */
.c-cross { stroke: var(--ink-2); stroke-width: 1; opacity: 0.45; pointer-events: none; }

/* ---------- mobile: floating "jump to end of table" ---------- */
.jump-end {
  position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; display: none; align-items: center; justify-content: center;
  background: var(--data); color: #fff; border: none; box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
@media (max-width: 640px) { .jump-end { display: flex; } }
.jump-end.show { opacity: 1; transform: none; pointer-events: auto; }
.jump-end svg { width: 22px; height: 22px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 26px 0 40px; color: var(--muted); font-size: 12.5px; }
footer .wrap { display: flex; flex-direction: column; gap: 10px; }
footer p { margin: 0; max-width: 88ch; line-height: 1.55; }
footer .foot-count { color: var(--ink-2); }
footer .foot-links a { color: var(--ink-2); font-weight: 500; }
footer .foot-links a + a::before { content: "·"; margin: 0 8px; color: var(--muted); }

/* ---------- case table (default view) ---------- */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.vt { padding: 7px 14px; border: none; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.vt + .vt { border-left: 1px solid var(--line); }
.vt.active { background: var(--data); color: #fff; }
.filter-row { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 120px 160px 200px 190px; gap: 8px; margin-bottom: 12px; }
.filter-row.no-sort { grid-template-columns: 1.3fr 1.3fr 1fr 120px 160px 200px; }
@media (max-width: 1100px) { .filter-row, .filter-row.no-sort { grid-template-columns: 1fr 1fr 1fr 1fr; } }
/* Mobile: the filters collapse behind a "Filters" accordion; fields stack full-width, 44px tall. */
.filters-toggle { display: none; }
@media (max-width: 640px) {
  .filters-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 14px; margin: 0 0 12px;
    font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  }
  .filters-toggle .chev { margin-left: auto; color: var(--muted); transition: transform .15s ease; }
  .filters-toggle[aria-expanded="true"] { margin-bottom: 0; border-radius: 10px 10px 0 0; }
  .filters-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
  .fbadge { background: var(--data); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 18px; min-width: 20px; padding: 0 6px; text-align: center; }
  .filter-row, .filter-row.no-sort { display: none; grid-template-columns: 1fr; gap: 10px; }
  .filter-row.open, .filter-row.no-sort.open {
    display: grid; padding: 12px; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--line); border-top: none; border-radius: 0 0 10px 10px;
  }
  .filter-row .fin, .filter-row .sel { font-size: 16px; padding: 11px 12px; min-height: 44px; } /* 16px prevents iOS focus zoom */
  .filter-row .sel { padding-right: 34px; }
  .filter-row .msel-btn { min-height: 44px; }
}
.fin {
  padding: 7px 12px; font: inherit; font-size: 13.5px; color: var(--ink); min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.fin::placeholder { color: var(--muted); }
.fin:focus, .sel:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--data-soft); }
/* multi-select dropdown (year filed) */
.msel { position: relative; min-width: 0; }
.msel-btn { width: 100%; height: 100%; min-height: 36px; text-align: left; cursor: pointer; line-height: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msel-btn.on { color: var(--data); font-weight: 600; }
.msel-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content;
  max-width: calc(100vw - 32px); max-height: 320px; overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.msel-menu label { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.msel-menu label:hover { background: var(--data-soft); }
.msel-menu label .c { margin-left: auto; padding-left: 14px; color: var(--muted); font-size: 12px; }
.msel-menu .msel-all { border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; margin-bottom: 4px; padding-bottom: 8px; }
.msel-menu input { accent-color: var(--data); margin: 0; width: 15px; height: 15px; }
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.summary b { color: var(--ink); }
.bands { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.band-bar { display: flex; width: 200px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--chip); }
.band-bar span { height: 100%; }
.band-key { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.band-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.b1 { background: var(--band-1); } .b2 { background: var(--band-2); } .b3 { background: var(--band-3); } .b4 { background: var(--band-4); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.case-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.case-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
.case-table th[data-sort] { cursor: pointer; user-select: none; }
.case-table th[data-sort]:hover, .case-table th.sorted { color: var(--ink); }
.case-table th .dir { font-size: 9px; margin-left: 3px; }
.case-table th.num, .case-table td.num { text-align: right; }
.case-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); }
.case-table tr:last-child td { border-bottom: none; }
.crow { cursor: pointer; }
.crow:hover td, .crow.open td { background: var(--line-soft); }
.c-emp .n { font-weight: 600; color: var(--ink); }
.c-title { color: var(--ink); }
.st { font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-C, .st-E { color: var(--good); } .st-D { color: var(--accent); } .st-W, .st-O { color: var(--muted); }
.cdetail td { background: var(--paper); padding: 14px 16px 16px; }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1000px) { .cd { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  /* Phones: the table runs edge to edge (no side margins or borders), with tighter cells, smaller
     type and a 600px minimum width, so far less sideways scrolling is needed. */
  .table-wrap { margin: 0 -20px; border-radius: 0; border-left: none; border-right: none; }
  .case-table { min-width: 600px; font-size: 12.5px; }
  .case-table th { padding: 8px 7px; font-size: 10.5px; letter-spacing: 0.04em; }
  .case-table td { padding: 7px; }
  .case-table th:first-child, .case-table td:first-child { padding-left: 14px; }
  .case-table th:last-child, .case-table td:last-child { padding-right: 14px; }
  .crow td:last-child .muted-sm { display: none; }  /* Worker cell: flag only; the degree stays in the detail panel */
  /* An expanded detail row inherits the table's width, so right-aligned values would sit off-screen.
     Pin the panel to the left edge of the scroller and size it to the viewport (cell padding 14px × 2). */
  .cd { grid-template-columns: 1fr; gap: 14px; position: sticky; left: 0; width: calc(100vw - 28px); max-width: 100%; }
  .fact-line { justify-content: flex-start; gap: 10px; }
  .fact-line > span:first-child { flex: 0 0 126px; }
  .fact-line b { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
}
.linkish { border: none; background: none; color: var(--data); font: inherit; font-weight: 600; padding: 0; cursor: pointer; text-decoration: underline; }
.case-table .empty { text-align: center; color: var(--muted); padding: 40px 0; }
.muted-sm { font-size: 11.5px; color: var(--muted); }

