@font-face {
  font-family: "Clash Display";
  src: url("/app/ClashDisplay-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("/app/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #0a0b15;
  --stage: #100e1c;
  --panel: #20182b;
  --text: #f7f1ff;
  --muted: #d4c8e2;
  --accent: #ecd2ff;
  --on-accent: #24152e;
  --line: #e8cbff3d;
  --ready: #b8f3db;
  --empty: #f4d5a4;
  --error: #ffc2ba;
  --mono: ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ink); color: var(--text); font: 16px/1.5 "General Sans", system-ui, sans-serif; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-family: "Clash Display", "General Sans", sans-serif; font-weight: 570; letter-spacing: -.035em; }
a { color: inherit; text-underline-offset: .22em; }
button, select {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #171324;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { cursor: default; opacity: .6; }
button:hover:not(:disabled), select:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
.wrap { width: min(1400px, calc(100% - clamp(36px, 9vw, 146px))); margin-inline: auto; }
.skip { position: fixed; left: 12px; top: -75px; z-index: 10; padding: 9px; background: var(--accent); color: var(--on-accent); }
.skip:focus { top: 10px; }
.top { border-bottom: 1px solid var(--line); }
.top-inner, .brand, .workspace, .controls, .command, .command-actions, .command-status, .drawer-bar { display: flex; align-items: center; }
.top-inner { min-height: 66px; justify-content: space-between; gap: 12px; }
.brand { gap: 10px; }
.brand strong { font: 580 28px/1 "Clash Display", sans-serif; letter-spacing: -.035em; }
.brand span { padding-left: 11px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.workspace { gap: 17px; font-size: 13px; font-weight: 650; }
.quiet { font-size: 13px; background: #130f20d9; }
.quiet span { margin-left: 6px; }
.orbit-stage {
  background: linear-gradient(90deg, var(--stage), #100e1c55 36%, #100e1c10 60%, var(--stage)),
    linear-gradient(0deg, var(--stage), #100e1c0d 45%, #100e1c78),
    url("/app/orbite/m42.jpg") 64% 53% / min(104vw, 1180px) auto no-repeat,
    var(--stage);
  border-bottom: 1px solid var(--line);
}
.orbit-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(255px, 24vw, 322px);
  grid-template-areas: "intro controls" "plot inspector" "foot foot";
  column-gap: 22px;
  padding-top: 45px;
}
.intro { grid-area: intro; }
.intro h1 { font-size: clamp(72px, 8vw, 118px); line-height: .86; text-shadow: 0 5px 36px #100b20; }
.intro h1 span { color: var(--accent); }
.intro p { margin-top: 16px; color: var(--muted); }
.controls { grid-area: controls; align-self: end; justify-content: end; flex-wrap: wrap; gap: 8px; }
.controls label { color: var(--muted); font-size: 13px; }
.controls select { font-size: 13px; }
.orbit-visual { grid-area: plot; position: relative; min-height: clamp(282px, 24vw, 368px); }
.orbit-paths { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #f2c9fc8e; stroke-width: 1.1; overflow: visible; pointer-events: none; }
.orbit-paths .faint { stroke: #ead5f34d; }
.orbit-paths .dashed { stroke-dasharray: 3 7; }
.orbit-paths .center-mark { fill: #f4daff; stroke: none; }
.orbit-paths .signal { stroke: #e9bafa; stroke-width: 1.5; opacity: .13; transition: opacity .24s; }
.orbit-visual[data-selected="google-ads"] .signal-ads,
.orbit-visual[data-selected="ga4"] .signal-ga4,
.orbit-visual[data-selected="meta"] .signal-meta,
.orbit-visual[data-selected="gsc"] .signal-gsc { opacity: 1; filter: drop-shadow(0 1px 6px #dab2ff9e); }
.sky-label { position: absolute; top: 55%; left: 50%; color: #fff0fd; text-shadow: 0 1px 6px #160a21; font: 11px/1.4 var(--mono); letter-spacing: .08em; pointer-events: none; }
.sky-label small { display: block; font-size: 9px; }
.star {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translate(-12px, -50%);
  padding: 0 0 0 7px;
  border: 0;
  background: transparent;
  white-space: nowrap;
}
.star i {
  flex: none;
  width: 10px;
  height: 10px;
  border: 2px solid #191026;
  border-radius: 50%;
  background: #edd9ff;
  box-shadow: 0 0 0 1px #f0d4ff9c, 0 2px 10px #e6bcff;
  transition: box-shadow .24s;
}
.star[data-state="empty"] i { background: var(--empty); }
.star[data-state="error"] i { background: var(--error); box-shadow: 0 0 0 1px var(--error); }
.star span { padding: 6px 9px; border: 1px solid #e8cbff62; border-radius: 4px; background: #161123f2; font-size: 13px; }
.star:hover i, .star[aria-pressed="true"] i { box-shadow: 0 0 0 4px #e8c4f766, 0 0 15px 5px #e6bcffb3; }
.star[aria-pressed="true"] span { background: var(--accent); color: var(--on-accent); }
.star-ads { left: 10.95%; top: 72.1%; }
.star-ga4 { left: 32.02%; top: 82.87%; }
.star-meta { left: 64.05%; top: 69.06%; }
.star-gsc { left: 82.02%; top: 30.94%; }
.inspector { grid-area: inspector; align-self: center; min-width: 0; padding: 18px; background: #21182bf5; border: 1px solid #cba0f065; box-shadow: 0 20px 48px #0b071a61; }
.readout { min-height: 182px; }
.inspector h2 { margin: 9px 0 12px; font-size: clamp(26px, 2.3vw, 32px); line-height: 1.02; text-wrap: balance; }
.inspector p, .fine { color: var(--muted); font-size: 14px; line-height: 1.52; }
.badge { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: 11px/1.35 var(--mono); }
.ready { color: var(--ready); }
.empty { color: var(--empty); }
.error { color: var(--error); }
.readout-metric { display: grid; gap: 3px; padding-block: 5px 9px; }
.readout-metric dt { font-size: 14px; color: var(--muted); }
.readout-metric dd { font: 560 clamp(36px, 4.5vw, 55px)/.96 "Clash Display", sans-serif; font-variant-numeric: tabular-nums; }
.readout-metric p { margin-top: 6px; font-size: 12px; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-color: transparent; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 690; }
.primary:hover:not(:disabled) { filter: brightness(1.10); }
.inspector .primary { margin-top: 10px; width: 100%; }
.orbit-foot { grid-area: foot; display: flex; align-items: end; justify-content: space-between; gap: 14px 25px; padding: 7px 0 16px; color: var(--muted); }
.orbit-foot p { font-size: 13px; font-variant-numeric: tabular-nums; }
.orbit-foot a { max-width: 470px; text-align: right; font-size: 11px; }
.command { justify-content: space-between; gap: 12px; min-height: 75px; border-bottom: 1px solid var(--line); padding-block: 9px; }
.command-status { gap: 9px; color: var(--muted); font-size: 14px; }
.command-status i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--accent); }
.command-status[data-state="ready"] i { background: var(--ready); }
.command-status[data-state="error"] i { background: var(--error); }
.command-actions { gap: 8px; }
.analysis-link { color: var(--accent); }
footer { color: var(--muted); padding: 15px 0 23px; font-size: 12px; }
dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 570px);
  max-width: 100%;
  height: 100dvh;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: #171224;
  color: var(--text);
}
dialog::backdrop { background: #080511b8; }
dialog[open] { animation: drawer-in .22s cubic-bezier(.22,.7,.3,1); }
@keyframes drawer-in { from { transform: translateX(25px); opacity: .65; } to { transform: none; opacity: 1; } }
.drawer-inner { padding: 20px clamp(18px, 5vw, 35px) 32px; }
.drawer-bar { justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.drawer-bar button { width: 44px; display: grid; place-items: center; padding: 0; }
.drawer-bar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.drawer-inner h2 { margin: 19px 0 9px; font-size: clamp(33px, 6vw, 45px); line-height: 1.04; }
.drawer-inner h3 { font-size: 22px; }
.drawer-inner .fine { margin: 7px 0 13px; }
.drawer-inner .primary { margin-top: 15px; }
.source { padding-block: 13px; border-top: 1px solid var(--line); }
.source-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.source-note { color: var(--muted); font-size: 14px; margin-top: 7px; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 9px; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 0 8px 8px; overflow-wrap: anywhere; }
th:first-child { width: 43%; text-align: left; padding-left: 0; }
thead th { color: var(--muted); font-size: 12px; font-weight: 550; }
tbody th { font-weight: 520; }
tbody tr { border-top: 1px solid var(--line); }
.tool-list { list-style: none; margin: 7px 0 19px; padding: 0; }
.tool-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }

.search-measurement { padding-block: 1.5rem 2rem; }
.search-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; }
.search-header h1 { font-size: 2.75rem; line-height: 1.05; margin-bottom: .4rem; }
.search-measurement h2 { font-size: 1.45rem; line-height: 1.16; margin-bottom: .45rem; }
.search-measurement .fine { max-width: 75ch; }
#search-totals { margin-top: .65rem; }
#search-totals .fine { margin-top: .6rem; }
.search-inspection { margin-block: 2rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
.search-form { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin-block: .8rem; }
.search-form > div { flex: 1 1 22rem; min-width: 0; max-width: 37rem; }
.search-form label { display: block; margin-bottom: .28rem; font-size: .86rem; color: var(--muted); }
.search-form input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); font: inherit; padding: .5rem .75rem; }
.search-form input::placeholder { color: var(--muted); }
.search-form input:hover { border-color: var(--accent); }
.search-inspection dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1rem; margin-block: .75rem; font-size: .875rem; }
.search-inspection dt { color: var(--muted); }
.search-inspection dd { overflow-wrap: anywhere; }
.search-inspection a { display: inline-flex; min-height: 44px; align-items: center; font-size: .875rem; }
.search-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.search-breakdown td, .search-breakdown th { padding-inline-start: .4rem; }
.search-breakdown th:first-child { padding-inline-start: 0; }
.search-page { width: 100%; min-height: 44px; padding: .3rem 0; border: 0; background: transparent; text-align: left; text-decoration: underline; text-underline-offset: .2em; overflow-wrap: anywhere; font: inherit; }
.search-page:hover { color: var(--accent); }
@media (max-width: 880px) { .search-breakdown { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) {
  .search-header h1 { font-size: 2.25rem; }
  .search-breakdown table { font-size: .81rem; }
  .search-breakdown thead th { font-size: .68rem; }
  .search-breakdown thead th:first-child { width: 36%; }
  .search-breakdown thead th:nth-child(2), .search-breakdown thead th:nth-child(4) { width: 13%; }
  .search-breakdown thead th:nth-child(3) { width: 21%; }
  .search-breakdown thead th:last-child { width: 17%; }
  .search-inspection dl { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .search-inspection dd { margin-bottom: .4rem; }
}
.tool-state.missing { color: var(--muted); }
.analysis:not(:empty) { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); white-space: pre-wrap; }
@media (max-width: 930px) {
  .orbit-inner { column-gap: 15px; }
  .star-gsc { transform: translate(-100%, -50%); flex-direction: row-reverse; padding: 0 0 0 3px; }
}
@media (max-width: 710px) {
  .wrap { width: calc(100% - 36px); }
  .top-inner { min-height: 58px; }
  .brand { gap: 6px; }
  .brand img { width: 25px; height: 25px; }
  .brand strong { font-size: 24px; }
  .brand span { display: none; }
  .workspace { gap: 8px; font-size: 11px; }
  .workspace > span, .workspace button { white-space: nowrap; }
  .orbit-stage { background: linear-gradient(0deg, var(--stage) 18%, #100e1c1c 64%, #100e1c64), url("/app/orbite/m42.jpg") center top / auto 590px no-repeat, var(--stage); }
  .orbit-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "controls" "plot" "inspector" "foot"; padding-top: 29px; }
  .intro h1 { font-size: clamp(58px, 13vw, 82px); }
  .intro p { margin-top: 11px; font-size: 14px; }
  .controls { justify-content: start; margin-top: 13px; }
  .orbit-visual { min-height: 215px; }
  .sky-label { left: 51%; top: 48%; }
  .star { gap: 5px; }
  .star span { padding: 4px 6px; font-size: 12px; }
  .star-gsc { left: 82%; top: 31%; }
  .star-meta { left: 63%; }
  .inspector { padding: 14px; }
  .readout { min-height: auto; }
  .inspector h2 { margin-bottom: 7px; }
  .orbit-foot { display: grid; gap: 5px; padding-top: 12px; }
  .orbit-foot a { text-align: left; }
  .command { align-items: start; flex-direction: column; justify-content: center; gap: 8px; }
}
@media (max-width: 350px) {
  .workspace > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
