@import url("geist.css");
@import url("details.css");
@import url("filters.css");

:root {
  color-scheme: light;
  --canvas: #f4f5f6;
  --card: #fff;
  --ink: #1c1d1f;
  --text-2: #3b424d;
  --muted: #505967;
  --line: #e4e7ec;
  --line-strong: #d5d9e0;
  --line-hover: #9aa3af;
  --field: #f9fafb;
  --neutral: #eeeff1;
  --primary: #266df0;
  --primary-hover: #2160d8;
  --link: #1f5fd6;
  --key: #e8f0fe;
  --key-fg: #1a56cf;
  --key-hover: #d9e6fd;
  --key-line: #c3d6fb;
  --rail: #181818;
  --rail-hover: #272727;
  --rail-active: #313131;
  --rail-muted: #d4d4d4;
  --rail-width: 240px;
  --radius: 8px;
  --radius-control: 6px;
  --radius-dialog: 12px;
  --gutter: 32px;
  font: 14px/1.5 "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height, 56px) + 8px); }
body, h1, h2, h3, p { margin: 0; }
body { min-height: 100vh; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.035em; }
h2 { font-size: 18px; line-height: 28px; font-weight: 600; letter-spacing: -.025em; }
h3 { font-size: 15px; line-height: 21px; font-weight: 600; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:disabled { cursor: default; opacity: .46; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.brand-mark { display: block; width: 32px; height: 32px; flex: none; }
.skip { position: fixed; left: 12px; top: -70px; z-index: 30; padding: 8px 14px; border-radius: 6px; background: var(--card); }
.skip:focus { top: 8px; }
.rail { position: fixed; z-index: 10; inset: 0 auto 0 0; width: var(--rail-width); padding: 24px 12px 16px; background: var(--rail); color: white; overflow: auto; }
.wordmark { --mark-ink: var(--rail); display: flex; align-items: center; gap: 12px; margin: 0 8px 24px; width: fit-content; color: inherit; text-decoration: none; font-size: 18px; font-weight: 600; }
#views { display: grid; gap: 2px; }
#views a { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 7px 12px; border-radius: 6px; color: var(--rail-muted); font-size: 14px; line-height: 20px; text-decoration: none; }
#views a:hover { color: white; background: var(--rail-hover); }
#views a[aria-current=page] { color: white; background: var(--rail-active); font-weight: 550; }
.rail :focus-visible { outline-color: white; }
.shell { min-width: 0; min-height: 100dvh; margin-left: var(--rail-width); }
.topbar { position: sticky; top: 0; z-index: 8; border-bottom: 1px solid var(--line-strong); background: var(--canvas); }
.topbar-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 56px; width: 100%; max-width: 1680px; margin-inline: auto; padding: 8px var(--gutter); }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { font-size: 16px; line-height: 24px; letter-spacing: 0; }
.detail-back { display: grid; place-items: center; width: 36px; height: 36px; color: var(--key-fg); background: var(--key); border: 1px solid var(--key-line); border-radius: var(--radius-control); }
.detail-back:hover { background: var(--key-hover); }
.mobile-brand { display: none; --mark-ink: white; color: var(--rail); }
.settings-open, .pager button, .dialog-foot button, .table-control {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px;
  padding: 5px 12px; border: 1px solid var(--key-line); border-radius: var(--radius-control);
  background: var(--key); color: var(--key-fg); font-size: 13px; font-weight: 550; text-decoration: none;
}
.settings-open:hover, .pager button:enabled:hover, .dialog-foot button:enabled:hover, .table-control:hover { background: var(--key-hover); }
.settings-open { margin-inline-start: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.settings-open b { font-weight: inherit; }
.workspace { width: 100%; max-width: 1680px; min-width: 0; margin-inline: auto; padding: 16px var(--gutter) 48px; }
.workspace:focus { outline: none; }
.browse-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.scope-control { display: inline-flex; align-items: stretch; gap: 2px; padding: 2px; border: 1px solid var(--key-line); border-radius: var(--radius-control); background: var(--key); }
.scope-control button { padding: 4px 10px; min-height: 28px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--key-fg); font-size: 13px; line-height: 18px; font-weight: 500; }
.scope-control button:hover { background: var(--key-hover); }
.scope-control button[aria-pressed=true] { border-color: var(--primary); background: var(--card); font-weight: 600; }
.scope-control button:focus-visible { outline-offset: -2px; }
label { display: grid; gap: 6px; min-width: 0; color: var(--text-2); font-size: 13px; font-weight: 500; }
input, select { display: block; width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--card); font-size: 14px; font-weight: 400; }
input:hover, select:hover { border-color: var(--line-hover); }
input::placeholder { color: var(--muted); }
select { cursor: pointer; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-field, .filter-key { position: relative; min-width: 0; }
.search-field { flex: 1 1 180px; }
.search-field .icon, .filter-key .icon { position: absolute; inset: 50% auto auto 10px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 34px; }
.filter-key { flex: 0 1 auto; }
.filter-key::after { content: ""; position: absolute; inset: 50% 12px auto auto; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); color: var(--key-fg); pointer-events: none; }
.filter-key .icon { color: var(--key-fg); }
.filter-key select { appearance: none; width: auto; max-width: 200px; padding-inline: 32px 26px; background: var(--key); border-color: var(--key-line); color: var(--key-fg); font-size: 13px; font-weight: 550; text-overflow: ellipsis; }
.filter-key select:hover { background: var(--key-hover); }
.filter-key select.is-applied { background: var(--card); border-color: var(--primary); }
.filter-key option, .filter-key optgroup { color: var(--ink); background: var(--card); }
.sort-key select { background: var(--card); border-color: var(--line-strong); color: var(--text-2); }
.sort-key :is(.icon, select), .sort-key::after { color: var(--muted); }
.sort-key select:hover { background: var(--field); }
.section-head, .dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-meta { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.result-meta, .pager span { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats-info { position: relative; }
.stats-info summary { display: grid; place-items: center; width: 30px; height: 34px; border-radius: var(--radius-control); color: var(--key-fg); list-style: none; }
.stats-info summary::-webkit-details-marker, .test-report > summary::-webkit-details-marker { display: none; }
.stats-info summary:hover, .stats-info[open] summary { background: var(--key); }
.stats-info p { position: absolute; inset: calc(100% + 6px) 0 auto auto; z-index: 4; width: min(270px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--card); color: var(--text-2); box-shadow: 0 12px 24px #0f11151a; white-space: normal; }
#definition { margin-bottom: 12px; max-width: 80ch; color: var(--text-2); }
#definition:empty, #overview:empty { display: none; }
.facts { display: flex; flex-wrap: wrap; gap: 16px 36px; padding: 14px 16px; margin: 8px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.metric { display: grid; gap: 2px; }
.metric strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.metric span, .small { font-size: 12px; }
.metric span, .waiting, .subtle, .empty p, .note { color: var(--muted); }
#overview .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: min(100%, 420px); }
#overview .metric strong { font: 500 18px/24px "Geist Mono", ui-monospace, monospace; }
#overview .metric span:first-of-type { color: var(--text-2); font-weight: 500; }
.note { font-size: 13px; margin: 8px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(218px,100%),1fr)); gap: 12px; align-items: start; }
.tile { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); text-decoration: none; }
.tile:is(:hover,:focus-visible) { border-color: var(--line-hover); }
.tile:is(:hover,:focus-visible) .card-title { color: var(--link); }
.thumb { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; aspect-ratio: 1.1; min-width: 0; overflow: hidden; background: var(--neutral); border-bottom: 1px solid var(--line); }
.thumb img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.tile-info { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 10px 12px; min-width: 0; }
.card-title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; font-size: 14px; line-height: 20px; }
.tile-meta, .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tile-meta { justify-content: space-between; color: var(--muted); font-size: 12px; }
.card-metrics { display: grid; gap: 2px; margin: 2px 0; padding: 6px 0; border-block: 1px solid var(--line); font-size: 12px; line-height: 17px; }
.card-metrics > div { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 6px; }
.card-metrics dt { color: var(--muted); }
.card-metrics dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }
.card-metrics abbr { color: var(--muted); text-decoration: none; }
.country-label, .country-flags { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.country-flag { font-family: "Geist", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.country-flag { flex: none; font-size: 16px; line-height: 1; }
.tags { list-style: none; margin: 0; padding: 0; gap: 4px; }
.tag, .status { display: inline-block; padding: 2px 7px; border-radius: 5px; background: var(--neutral); color: var(--text-2); font-size: 12px; font-weight: 500; line-height: 16px; overflow-wrap: anywhere; }
.tile .tag { max-width: 100%; white-space: normal; }
.tag.pending, .status.progress { background: #fff8db; color: #8b5500; }
.status.success { background: #e5faf1; color: #016b4e; }
.status.error { background: #ffeef1; color: #993443; }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 24px 0 0; }
.pager button { width: 36px; padding: 0; }
#prev .icon { transform: rotate(180deg); }
.table-scroll { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table-scroll:focus-visible { outline-offset: -2px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { height: 40px; background: var(--canvas); color: var(--text-2); font-size: 12px; font-weight: 550; }
td { font-size: 14px; line-height: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:is(:hover,:focus-within) { background: var(--field); }
td a { font-weight: 500; }
.row-link { min-height: 36px; color: var(--ink); text-decoration: none; }
.row-link:is(:hover,:focus-visible) { color: var(--link); text-decoration: underline; }
.row-link::after { content: ""; width: 6px; height: 6px; flex: none; margin-inline-start: auto; border: solid var(--muted); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.row-title, .test-case { display: flex; align-items: center; gap: 10px; }
.mosaic, .test-case img { flex: none; width: 40px; height: 40px; object-fit: contain; background: var(--neutral); border-radius: 4px; }
td small { display: block; color: var(--muted); font-size: 12px; }
.mobile-stat-label { display: none; }
#results :is(th, td):not(:first-child) { text-align: right; }
#results td:nth-child(3) { position: relative; }
#results td:nth-child(3) > a { display: inline-flex; min-width: 30px; min-height: 30px; align-items: center; justify-content: center; padding-inline: 4px; border-radius: var(--radius-control); background: var(--key); color: var(--key-fg); text-decoration: none; }
#results td:nth-child(3) > a:hover { background: var(--key-hover); }
.empty { padding: 24px 16px; border: 1px dashed var(--line-hover); border-radius: var(--radius); background: var(--card); }
.empty h3 { margin-bottom: 4px; }
#test-panel { display: grid; gap: 8px; }
.test-report { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.test-report > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; list-style: none; border-radius: var(--radius); }
.test-report > summary::before { content: ""; width: 6px; height: 6px; flex: none; margin-right: 4px; border: solid var(--muted); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.test-report[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.test-report[open] > summary::before { transform: rotate(135deg); }
.test-report > summary:hover { background: var(--field); }
.test-report > summary:focus-visible { outline-offset: -3px; }
.test-report > summary .status { max-width: 40%; margin-inline-start: auto; }
.test-report > section { min-width: 0; padding: 12px 14px 14px; }
.test-report > section > .note:first-child { margin-block-start: 0; }
#test-panel .facts { background: var(--field); }
#test-panel td { max-width: 38ch; }
.test-case { align-items: flex-start; }
#test-panel ul { padding-left: 20px; }
summary { font-weight: 550; }
.case-detail summary, .intake-help summary { color: var(--link); }
.case-detail { margin-top: 4px; }
.case-detail ul { margin: 5px 0 10px; }
.case-detail li { margin-bottom: 5px; }
.case-detail summary { font-size: 13px; }
.assigned { min-width: 130px; }
dialog { width: min(380px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--card); color: var(--ink); box-shadow: 0 16px 48px #0f111526; }
dialog::backdrop { background: #0f111599; }
.dialog-head, .dialog-body, .dialog-foot { padding: 16px 20px; }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-head button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--key-fg); }
.dialog-head button:hover { background: var(--key); }
.dialog-body input { width: 100px; margin-top: 6px; }
.dialog-body p { margin-top: 10px; color: var(--muted); font-size: 13px; }
.intake-help { margin-top: 12px; font-size: 13px; }
.intake-help p { margin-top: 4px; }
.dialog-foot { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-foot button[type=submit] { background: var(--primary); border-color: var(--primary); color: white; }
.dialog-foot button[type=submit]:enabled:hover { background: var(--primary-hover); }
#setting-message:empty { display: none; }
@media (min-width:768px) and (max-width:1279px), (max-width:767px) and (orientation:landscape) {
  :root { --rail-width: 88px; --gutter: 24px; }
  .rail { padding: 16px 6px; }
  .wordmark { justify-content: center; margin: 0 auto 18px; }
  .wordmark span { display: none; }
  #views a { flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 6px 0; font-size: 12px; line-height: 16px; }
}
@media (max-width:767px) and (orientation:portrait) {
  :root { --rail-width: 0px; --gutter: 16px; scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .rail { inset: auto 0 0; width: 100%; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); overflow: visible; }
  .wordmark { display: none; }
  #views { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #views a { flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 4px 0; font-size: 12px; line-height: 16px; }
  .shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mobile-brand { display: block; }
  .mobile-brand .brand-mark { width: 26px; height: 26px; }
  .topbar-title { gap: 8px; }
}
@media (max-width:760px) {
  #results .table-scroll, #test-panel .scores { overflow: visible; border: 0; background: transparent; }
  #results table, #test-panel .scores table { display: block; }
  #results thead, .scores thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  #results tbody, .scores tbody { display: grid; gap: 8px; }
  #results tbody tr, .scores tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
  }
  #results td, .scores td { display: block; min-width: 0; border: 0; padding: 6px 12px; }
  #results td:first-child, .scores td:first-child {
    grid-column: 1 / -1;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--line);
    background: var(--field);
  }
  #results td:not(:first-child) { text-align: start; }
  #results .row-link { min-height: 44px; }
  #results td:nth-child(3) > a { min-width: 28px; min-height: 24px; }
  #results td:nth-child(3) > a::after { content: ""; position: absolute; inset: 0; }
  #results .mobile-stat-label, .scores .mobile-stat-label { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
  .scores td:first-child { font-weight: 600; }
  #test-panel .table-scroll:not(.compact,.scores) table { min-width: 680px; }
  #test-panel .table-scroll:not(.compact,.scores) :is(th, td):first-child {
    position: sticky;
    z-index: 1;
    inset-inline-start: 0;
    width: 130px;
    max-width: 130px;
    border-inline-end: 1px solid var(--line);
  }
  #test-panel .table-scroll:not(.compact,.scores) td:first-child { background: var(--card); }
  #test-panel .table-scroll:not(.compact,.scores) tr:focus-within td:first-child { background: var(--field); }
  #test-panel .compact:not(.scores) table { table-layout: fixed; }
  #test-panel .compact:not(.scores) th:first-child { width: 40%; }
  #test-panel .test-case { flex-wrap: wrap; gap: 4px; }
}
@media (min-width:480px) and (max-width:760px) {
  #results tbody tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width:620px) {
  :root { --gutter: 14px; }
  .topbar-inner { gap: 6px 8px; padding-block: 6px 8px; }
  .detail-back { width: 44px; height: 44px; }
  .settings-open, .pager button { min-height: 44px; }
  .pager button { width: 44px; }
  .workspace { padding-top: 12px; padding-bottom: 28px; }
  .tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-field { grid-column: 1 / -1; }
  .tools :is(input,select) { width: 100%; max-width: none; height: 44px; font-size: 16px; }
  .scope-control button { padding-inline: 8px; min-height: 36px; }
  .browse-bar:has(#approach-kind:not([hidden])) .result-meta { flex-basis: 100%; justify-content: flex-end; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .tile-info { padding: 8px; gap: 6px; }
  .thumb { aspect-ratio: 1.05; }
  .tile-meta { column-gap: 4px; font-size: 11px; }
  .tags { gap: 3px; }
  .tag { font-size: 11px; line-height: 15px; padding: 2px 5px; }
  .test-report > section { padding: 12px; }
  th, td { padding: 9px; }
}
