@font-face {
  font-family: "Space Grotesk";
  src: url("space-grotesk.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #070a1a;
  --surface: #0e1426;
  --raised: #151d33;
  --hover: #1d2840;
  --ink: #f3f5f8;
  --muted: #a9b5cb;
  --accent: #d6b274;
  --accent-light: #f2cb89;
  --blue: #a0bceb;
  --line: #2b354e;
  --focus: #e8c78c;
  --shell: 1240px;
  font: 16px/1.5 "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 87% 2%, #17213a 0, transparent 38rem);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p { line-height: 1.55; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { background: #070a1ae6; border-bottom: 1px solid #222b42; }
.topbar-inner, .shell { width: min(100% - 4.5rem, var(--shell)); margin-inline: auto; }
.topbar-inner { height: 68px; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.wordmark { display: inline-flex; gap: .7rem; align-items: center; text-decoration: none; font-size: 1.22rem; font-weight: 700; letter-spacing: -.035em; white-space: nowrap; }
.wordmark strong { font-weight: 500; color: var(--accent); margin-left: .18em; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #d6b27414; border: 1px solid #ad8b535c; display: grid; place-items: center; }
.brand-mark i, .locator { display: block; position: relative; border: 1px solid currentColor; width: 19px; height: 19px; border-radius: 50%; color: var(--accent-light); }
.brand-mark i::before, .brand-mark i::after { content: ''; position: absolute; }
.brand-mark i::before { inset: -1px 4px; border: 1px solid currentColor; border-radius: 50%; }
.brand-mark i::after { inset: 5px 0; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.nav-link { display: inline-flex; min-height: 42px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: .5rem .85rem; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--ink); background: var(--surface); }
.nav-link:hover { background: var(--raised); border-color: #536687; }
.shell { padding-bottom: 3rem; }

.intro { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: 2.5rem; padding: 3rem 0 2rem; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.5rem); font-weight: 700; letter-spacing: -.075em; line-height: .96; }
.intro h1 { font-size: clamp(3.35rem, 6.75vw, 6.15rem); }
h1 em { font-style: normal; color: var(--accent); }
.intro-tools { justify-self: end; width: min(100%, 32rem); }
.intro-tools > p { max-width: 29rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.1rem); margin: 0 0 1.15rem; }
.lookup { position: relative; z-index: 6; }
.search { display: flex; align-items: center; gap: .75rem; min-height: 62px; padding: .35rem .4rem .35rem 1rem; border: 1px solid #475572; border-radius: 10px; background: #11182a; box-shadow: 0 10px 24px #02050e60; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #d6b2742b; }
.search input { width: 100%; min-width: 0; padding: .48rem .08rem; background: none; color: var(--ink); border: 0; }
.search input:focus { outline: none; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search-icon { height: 16px; width: 16px; position: relative; flex: 0 0 16px; margin-right: 3px; border: 1.5px solid var(--accent); border-radius: 50%; }
.search-icon::after { content: ''; position: absolute; height: 1.5px; width: 7px; background: var(--accent); transform: rotate(45deg); left: 10px; top: 12px; border-radius: 2px; }
.button { min-height: 44px; padding: .62rem 1.08rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid transparent; text-decoration: none; text-align: center; font-weight: 700; }
.primary { color: #141221; background: var(--accent); }
.primary:hover { background: var(--accent-light); }
.secondary { background: var(--raised); color: var(--ink); border-color: var(--line); }
.secondary:hover { background: var(--hover); border-color: #536687; }
.search-menu { position: absolute; top: calc(100% + .4rem); width: 100%; max-height: 320px; overflow: auto; background: var(--surface); box-shadow: 0 14px 30px #030510c7; border: 1px solid #435170; border-radius: 10px; padding: .35rem; }
.dropdown-status:not(:empty) { padding: .55rem .7rem; color: var(--muted); }
.place-list { list-style: none; padding: 0; margin: 0; }
.place-list li[role="option"], .place-list button { width: 100%; border: 0; border-radius: 7px; background: none; color: inherit; padding: .62rem .7rem; display: grid; gap: .14rem; text-align: left; cursor: pointer; }
.place-list li[role="option"]:hover, .place-list li[aria-selected="true"] { background: var(--hover); box-shadow: inset 2px 0 var(--accent); }
.place-list small { color: var(--muted); font-size: .875rem; line-height: 1.35; }

.map-frame { overflow: hidden; border: 1px solid #35405a; border-radius: 16px; background: var(--surface); box-shadow: 0 24px 54px #02040e96; }
.map-stage {
  isolation: isolate;
  position: relative;
  height: clamp(440px, 42vw, 560px);
  overflow: hidden;
  background:
    linear-gradient(#7796ca12 1px, transparent 1px) center / 43px 43px,
    linear-gradient(90deg, #7796ca12 1px, transparent 1px) center / 43px 43px,
    radial-gradient(ellipse at center, #202f50 1%, #10172c 53%, #090e20 88%);
}
#globe { position: absolute; inset: 0; cursor: grab; }
#globe:active { cursor: grabbing; }
.map-guide { position: absolute; z-index: 2; top: 1.2rem; left: 1.2rem; width: min(calc(100% - 5.5rem), 15.8rem); padding: 1rem; border: 1px solid #45516c; border-radius: 9px; background: #0d1427f0; box-shadow: 0 10px 28px #05081368; }
.map-label { display: flex; gap: .6rem; align-items: center; font-size: 1rem; font-weight: 700; }
.locator { width: 15px; height: 15px; color: var(--accent); }
.locator::before { content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%; inset: 0; margin: auto; background: currentColor; box-shadow: 0 0 8px #d6b27480; }
.map-guide > p { margin: .52rem 0 0; color: var(--muted); font-size: .9rem; }
.map-results { margin-top: .75rem; max-height: 235px; overflow: auto; border-top: 1px solid var(--line); padding-top: .6rem; }
.map-results button:hover, .map-results button:focus-visible { background: var(--hover); }
.map-feedback { color: var(--ink); font-size: .9rem; }
.map-actions { position: absolute; z-index: 2; right: 1.2rem; top: 1.2rem; display: grid; border: 1px solid #45516c; border-radius: 8px; background: #0d1427f0; }
.map-button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); font-size: 1.22rem; line-height: 1; font-weight: 700; }
.map-button:first-child { border-radius: 7px 7px 0 0; color: var(--accent); }
.map-button:last-child { border-radius: 0 0 7px 7px; }
.map-button + .map-button { border-top: 1px solid #45516c; }
.map-button:hover { background: var(--hover); }
.map-button:focus-visible { z-index: 1; }
.map-pin { width: 13px; height: 13px; border: 2px solid #ffe6b5; border-radius: 50%; background: #d6b274; box-shadow: 0 0 0 5px #d6b27442, 0 0 19px #e6bd77c0; padding: 0; }
.map-pin.selected { width: 19px; height: 19px; border: 3px solid #f7e3ba; background: #fff3d4; box-shadow: 0 0 0 7px #d6b27462, 0 0 20px #f2cb89b3; cursor: inherit; }
.map-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1rem; border-top: 1px solid #35405a; padding: .6rem .9rem; }
.map-credit { color: var(--muted); font-size: .78rem; }
.map-credit a { text-underline-offset: .15em; }
.map-credit a:hover { color: var(--accent-light); }
.example-row { display: flex; gap: .42rem; align-items: center; flex-wrap: wrap; color: var(--muted); }
.example-row > span { font-size: .875rem; font-weight: 600; margin-right: .25rem; }
.example { background: var(--raised); color: var(--ink); border-radius: 6px; border: 1px solid #3b4865; padding: .34rem .59rem; font-weight: 600; font-size: .88rem; min-height: 36px; }
.example:hover { background: var(--hover); border-color: #9c8055; color: var(--accent-light); }

.evaluation-panel, .admin-card, .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(1.05rem, 3vw, 1.8rem); }
.evaluation-panel { margin-top: 1.3rem; scroll-margin-top: 1rem; border-color: #6a5842; }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.section-heading h2, .run-details h2, .answers h2 { font-size: clamp(1.4rem, 3vw, 2.05rem); letter-spacing: -.045em; }
.eyebrow { font-size: .875rem; font-weight: 650; color: var(--accent); margin-bottom: .35rem; }
.muted { color: var(--muted); }
progress { width: 100%; accent-color: var(--accent); margin: 1.1rem 0 .45rem; height: .6rem; border: 0; border-radius: 10px; }
progress::-webkit-progress-bar { background: var(--raised); border-radius: 10px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 10px; }
.metrics { margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; }
.metrics > div { background: var(--raised); border: 1px solid var(--line); border-top-color: #687694; border-radius: 9px; padding: .75rem .85rem; }
.metrics dt, .run-facts dt { font-weight: 600; color: var(--muted); font-size: .9rem; }
.metrics dd { margin: .25rem 0 0; font-size: clamp(1.55rem, 3vw, 2.35rem); font-weight: 650; letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: var(--accent-light); }
.metrics dd span, .score span { font-size: .74em; color: var(--muted); font-weight: 500; }
.page-heading { margin: 2.6rem 0 1.15rem; }
.page-heading .muted { margin-top: .52rem; }
.admin-metrics { margin-top: 1.35rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1.1rem; }
.filters label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 650; }
.filters input, .filters select, .field-stack input:not([type="hidden"]) { min-height: 44px; min-width: 10rem; font-size: 1rem; font-weight: 450; padding: .5rem .68rem; border: 1px solid #465473; border-radius: 7px; background: var(--page); color: var(--ink); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: .9rem; color: var(--muted); background: var(--raised); }
th, td { padding: .8rem .7rem; border-bottom: 1px solid var(--line); }
td small { display: block; font-size: .875rem; color: var(--muted); margin-top: .15rem; }
.status-pill { display: inline-flex; border-radius: 100px; padding: .27rem .66rem; font-size: .875rem; font-weight: 600; line-height: 1.3; color: #c4d2ec; background: #23314b; }
.status-pill.succeeded { background: #1e383c; color: #b6e2d9; }
.status-pill.partial { background: #3a2f21; color: #f0cd90; }
.status-pill.failed { background: #422638; color: #ffc0ca; }
.status-pill.running { background: #233657; color: #c7ddff; }
.text-link { color: var(--blue); font-weight: 650; text-underline-offset: .18em; }
.text-link:hover { color: var(--accent-light); }
.back-link { display: inline-block; margin-bottom: .85rem; }
.empty { padding: 1.7rem 0; color: var(--muted); }
.pagination { display: flex; gap: .5rem; margin-top: .9rem; }
.login-shell { max-width: 30rem; padding-top: 3.5rem; }
.login-card { border-top-color: #9a805a; }
.login-card h1 { font-size: clamp(1.85rem, 7vw, 2.6rem); }
.login-card > p { margin-top: .7rem; }
.field-stack { display: grid; gap: .65rem; margin-top: 1.25rem; }
.field-stack label { font-weight: 700; }
.field-stack .button { margin-top: .3rem; }
.notice { margin: 1rem 0; padding: .7rem .85rem; background: #1d293f; border: 1px solid #3d506e; border-radius: 8px; color: var(--ink); }
.notice.error { color: #ffc0ca; background: #422638; border-color: #74516a; margin: 0; }
.run-facts { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.run-facts dd { margin: .25rem 0 0; }
.run-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.answers { margin-top: 1.4rem; }
.answers h2 { margin-bottom: .7rem; }
.answer-group { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); margin-bottom: .55rem; }
.answer-group > summary { cursor: pointer; min-height: 48px; padding: .7rem 1rem; background: var(--raised); }
.answer-group > summary:hover { background: var(--hover); }
.answer-group > summary span { float: right; color: var(--muted); }
.answer-list { padding: 0; margin: 0; list-style: none; }
.answer-list > li { padding: .85rem 1rem; border-top: 1px solid var(--line); }
.answer-list p { margin-top: .35rem; }
.answer-heading { display: flex; justify-content: space-between; align-items: start; gap: .6rem; }
.score { flex: 0 0 auto; color: var(--accent-light); font-variant-numeric: tabular-nums; }
.answer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .4rem; color: var(--muted); font-size: .9rem; }

@media (max-width: 850px) {
  .topbar-inner, .shell { width: calc(100% - 2.5rem); }
  .intro { gap: 1.5rem; }
  .map-stage { height: 440px; }
}

@media (max-width: 620px) {
  .topbar-inner, .shell { width: calc(100% - 1.5rem); }
  .topbar-inner { height: 61px; }
  .intro { grid-template-columns: 1fr; gap: 1rem; padding: 2.1rem 0 1.3rem; }
  .intro h1 { font-size: clamp(3rem, 11vw, 4.1rem); }
  .intro-tools { justify-self: start; }
  .intro-tools > p { margin-bottom: .95rem; }
  .search { gap: .55rem; padding-left: .75rem; min-height: 55px; }
  .search .button { padding-inline: .75rem; }
  .map-frame { border-radius: 11px; }
  .map-stage { height: 400px; }
  #globe { top: 3.6rem; }
  .map-guide { top: .65rem; left: .65rem; padding: .65rem; width: min(calc(100% - 4.5rem), 13.65rem); }
  .map-guide > p { font-size: .875rem; }
  .map-actions { top: .65rem; right: .65rem; }
  .map-footer { padding-inline: .65rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example-row > span { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
