:root {
  color-scheme: light;
  --navy: #101e38;
  --muted: #50617b;
  --blue: #1d58df;
  --line: #dce5f2;
  --surface: #f4f7fc;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--navy);
  background: var(--surface);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #5791ff; outline-offset: 3px; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { display: none; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid #e3eaf5; }
.nav { min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; width: max-content; font-size: 1.22rem; font-weight: 780; letter-spacing: -.045em; }
.brand-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: #235ff0; }
.brand-icon svg { width: 23px; height: 23px; }
.brand-accent { color: var(--blue); }
.nav nav { display: flex; align-items: stretch; align-self: stretch; gap: 1.875rem; }
.nav nav a { display: grid; place-items: center; position: relative; color: var(--muted); font-size: .91rem; font-weight: 650; }
.nav nav a[aria-current] { color: var(--blue); }
.nav nav a[aria-current]::after { content: ""; position: absolute; height: 2px; inset: auto 0 0; background: #2464f5; border-radius: 2px 2px 0 0; }
.privacy-link { display: inline-flex; gap: .4rem; align-items: center; justify-self: end; color: var(--muted); background: none; border: 0; font-size: .88rem; font-weight: 650; padding: .5rem 0; }
.privacy-link:hover, .nav nav a:hover { color: var(--blue); }
.intro { padding: 43px 0 25px; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -.054em; font-weight: 780; }
.intro p { color: var(--muted); margin-top: .6rem; line-height: 1.55; }

.connection-card { padding: clamp(14px, 3vw, 28px); }
.ip-pair { display: grid; gap: .55rem; grid-template-columns: minmax(0, .75fr) minmax(0, 1.4fr); }
.ip-readout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .55rem; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; background: var(--surface); }
.family-label { color: var(--muted); font-size: .875rem; font-weight: 700; }
.ip-address { grid-column: 1; color: var(--navy); font-family: var(--mono); font-size: clamp(.94rem, 2vw, 1.25rem); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ip-readout .button { grid-column: 2; grid-row: 1 / 3; min-height: 36px; padding: .4rem .55rem; }
.ip-state { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .875rem; }
.state-dot { width: .43rem; height: .43rem; background: #8493ad; border-radius: 50%; flex: none; }
.ip-state[data-live="true"] .state-dot { background: #16835b; }
.connection-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-top: .6rem; }
.connection-actions .button { min-height: 36px; padding: .4rem .55rem; }
.copy-status { color: var(--muted); font-size: .875rem; }
.connection-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(16px, 3vw, 28px); margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.connection-body h3 { font-size: 1rem; margin-bottom: .35rem; }
.connection-facts { margin-top: .55rem; }
.connection-facts > div { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: .5rem; border-top: 1px solid var(--line); padding: .42rem 0; font-size: .9rem; }
.connection-facts dt { color: var(--muted); }
.connection-facts dd { font-weight: 630; overflow-wrap: anywhere; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 41px; border: 1px solid transparent; border-radius: 9px; padding: .5rem .85rem; font-size: .88rem; font-weight: 700; line-height: 1.2; }
.primary { background: #225dee; color: #fff; }
.primary:hover:not(:disabled) { background: #174ccc; }
.secondary { background: #eff4ff; color: #194fbf; border-color: #d9e5ff; }
.secondary:hover:not(:disabled) { background: #e1ecff; }
.button:disabled { cursor: default; opacity: .6; }
.block { margin-top: 29px; }
.section-title { font-size: 1.25rem; font-weight: 760; letter-spacing: -.031em; margin-bottom: .78rem; }
.diagnostics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 8px #18366308; min-width: 0; }
.card-heading { display: flex; align-items: center; gap: .62rem; }
.card-heading h3 { font-size: .94rem; font-weight: 740; line-height: 1.3; }
.icon-tile { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #eaf1ff; color: #235de1; flex: none; }
.icon-tile svg { width: 18px; height: 18px; }
.muted, .tool-copy, .status { color: var(--muted); font-size: .87rem; line-height: 1.45; }
.location-source { display: inline-block; margin-top: .33rem; color: var(--blue); font-size: .81rem; text-decoration: underline; }
.location-map { display: grid; min-width: 0; margin: 0; border: 1px solid #213e75; border-radius: 12px; overflow: hidden; color: #dfebff; background: #102448; }
.map-stage {
  position: relative;
  isolation: isolate;
  aspect-ratio: 960 / 440;
  background:
    radial-gradient(circle at 17px 13px, #c9dbffb8 0 1px, transparent 1.5px) 0 0 / 87px 69px,
    radial-gradient(circle at 35px 47px, #6c9dde9c 0 1px, transparent 1.4px) 3px 7px / 119px 84px,
    radial-gradient(circle at 47px 33px, #b2cbfb80 0 .6px, transparent 1.1px) 3px 13px / 81px 103px,
    radial-gradient(ellipse at 50% 48%, #152a50, #080f24 72%);
}
.map-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .48s ease; }
.map-stage[data-phase="map"] #country-map,
.map-stage[data-phase="space"] #earth-flight,
.map-stage[data-phase="approach"] #earth-flight { opacity: 1; }
.street-map { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #e9edf0; visibility: hidden; }
.map-stage[data-phase="streets"] .street-map { visibility: visible; }
.location-replay { margin-top: .75rem; display: flex; width: max-content; }
@media (prefers-reduced-motion: reduce) {
  .map-stage canvas { transition: none; }
}
.location-map figcaption { padding: .45rem .65rem; border-top: 1px solid #2b4774; font-size: .82rem; line-height: 1.35; }
.tool-card { padding: 19px 20px 20px; }
.tool-card h3 { font-size: 1.04rem; letter-spacing: -.017em; }
.tool-copy { margin: .52rem 0 .9rem; }
.fields { display: grid; }
.fields label { display: grid; gap: 5px; font-size: .86rem; font-weight: 680; }
.fields input { width: 100%; min-width: 0; height: 41px; border: 1px solid #d3deee; background: #fff; border-radius: 8px; padding: 0 .65rem; color: var(--navy); font-size: .94rem; }
.fields input::placeholder { color: #61738e; }
.button-row { display: flex; gap: .72rem; align-items: center; flex-wrap: wrap; margin-top: 13px; }
.metrics, .family-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metrics > div, .family-results > div { background: #f5f8fe; border: 1px solid #e7edf7; border-radius: 9px; padding: .46rem .55rem; }
.metrics dt, .family-results dt { color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: .23rem; line-height: 1.3; }
.metrics dt svg { color: #235de1; }
.metrics dd { margin-top: .23rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.15; }
.metrics small { color: var(--muted); font-size: .75rem; font-weight: 550; }
.status { margin-top: .65rem; }
.status:empty { margin-top: 0; }
.dns-fallback { margin-top: .7rem; padding: .65rem; border: 1px solid var(--line); border-radius: 8px; background: #f5f8fe; }
.dns-fallback .button { margin-top: .5rem; }
.record-list { list-style: none; padding: 0; margin: .65rem 0 0; display: grid; gap: .38rem; }
.record-list li { border: 1px solid #e7edf7; border-radius: 8px; background: #f5f8fe; padding: .44rem .55rem; display: grid; gap: .21rem; overflow-wrap: anywhere; }
.record-list code { font-family: var(--mono); font-size: .87rem; }
.family-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr minmax(270px, .76fr); gap: 1rem; align-items: center; }
.family-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.family-results > div { padding: .65rem .7rem; }
.family-results dd { font-size: .87rem; font-weight: 680; margin-top: .28rem; overflow-wrap: anywhere; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: 27px; padding: 12px 0 18px; color: var(--muted); font-size: .86rem; }
.footer > span { display: flex; gap: .4rem; align-items: center; }
.footer svg { color: var(--blue); }
.fallback { margin-top: 1rem; padding: 1rem; }
dialog { width: min(485px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--navy); box-shadow: 0 16px 50px #10214245; }
dialog::backdrop { background: #0b1939a6; }
dialog h2 { padding-right: 2rem; margin-bottom: .75rem; }
dialog p { color: var(--muted); line-height: 1.55; margin-top: .6rem; }
.close-button { position: absolute; right: 13px; top: 13px; border: 0; border-radius: 8px; background: #edf3ff; padding: .4rem; display: grid; place-items: center; color: var(--blue); }

@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .tool-card { padding: 14px; }
  .metrics { gap: 4px; }
  .metrics > div { padding-inline: .31rem; }
}
@media (max-width: 610px) {
  .intro { padding-top: 30px; }
  .nav { min-height: 61px; gap: .65rem; }
  .nav nav { gap: .8rem; }
  .nav nav a { font-size: .82rem; }
  .brand { font-size: 1.05rem; gap: .4rem; }
  .brand-icon { width: 30px; height: 30px; }
  .brand-icon svg { width: 20px; height: 20px; }
  .connection-body, .ip-pair { grid-template-columns: minmax(0, 1fr); }
  .diagnostics-grid, .family-card { grid-template-columns: minmax(0, 1fr); }
  .metrics > div { padding-inline: .55rem; }
}
@media (max-width: 425px) {
  .shell { width: calc(100% - 28px); }
  .nav .privacy-link span { display: none; }
  .nav .privacy-link { padding: .5rem .25rem; }
  .nav .privacy-link svg { width: 20px; height: 20px; }
  .footer { align-items: flex-start; flex-direction: column; }
}


.location-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
#device-location-status:not(:empty) { margin-top: .5rem; }


/* Search guide content */
.guide-section { margin-top: 34px; }
.guide-intro { max-width: 78ch; color: var(--muted); font-size: 1rem; line-height: 1.65; margin: -.15rem 0 1rem; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guide-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.guide-card h3, .guide-faq h3 { font-size: 1.05rem; line-height: 1.35; margin-bottom: .5rem; }
.guide-card p, .guide-faq p { color: var(--muted); font-size: 1rem; line-height: 1.65; }
.guide-card a { color: var(--blue); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.guide-faq { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.guide-faq details { border-top: 1px solid var(--line); padding: .8rem 0; }
.guide-faq summary { font-weight: 680; line-height: 1.5; cursor: pointer; }
.guide-faq details p { padding-top: .45rem; }
@media (max-width: 610px) { .guide-grid { grid-template-columns: 1fr; } .guide-card, .guide-faq { padding: 15px; } }
