:root {
  color-scheme: dark;
  --page-bg: #11140f;
  --veil: rgba(7, 9, 8, 0.72);
  --veil-heavy: rgba(9, 12, 10, 0.88);
  --text: #f4f4ea;
  --muted: rgba(244, 244, 234, 0.62);
  --faint: rgba(244, 244, 234, 0.38);
  --panel: rgba(16, 20, 17, 0.64);
  --panel-strong: rgba(12, 15, 13, 0.82);
  --border: rgba(244, 244, 234, 0.18);
  --border-strong: rgba(244, 244, 234, 0.38);
  --focus: #c8f46d;
  --focus-soft: rgba(200, 244, 109, 0.13);
  --error: #ff947e;
  --warning: #ffd078;
  --shadow: rgba(0, 0, 0, 0.34);
  --ease: 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dawn"] {
  color-scheme: light;
  --page-bg: #b56f63;
  --veil: rgba(70, 32, 29, 0.58);
  --veil-heavy: rgba(63, 28, 26, 0.78);
  --panel: rgba(81, 38, 34, 0.56);
  --panel-strong: rgba(67, 30, 28, 0.76);
  --focus: #ffe08f;
  --focus-soft: rgba(255, 224, 143, 0.16);
}

html[data-theme="day"] {
  color-scheme: light;
  --page-bg: #75938e;
  --veil: rgba(20, 42, 39, 0.54);
  --veil-heavy: rgba(16, 35, 32, 0.76);
  --panel: rgba(20, 45, 41, 0.52);
  --panel-strong: rgba(15, 37, 34, 0.72);
  --focus: #d8ffef;
  --focus-soft: rgba(216, 255, 239, 0.14);
}

html[data-theme="dusk"] {
  color-scheme: dark;
  --page-bg: #6e3d52;
  --veil: rgba(38, 16, 32, 0.62);
  --veil-heavy: rgba(31, 13, 27, 0.8);
  --panel: rgba(51, 22, 43, 0.58);
  --panel-strong: rgba(42, 17, 35, 0.76);
  --focus: #ffbd7f;
  --focus-soft: rgba(255, 189, 127, 0.15);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page-bg);
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background-color: var(--page-bg);
  background-image:
    linear-gradient(180deg, var(--veil), var(--veil-heavy)),
    url("../assets/home-horizon.webp");
  background-position: center, center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Avenir Next", "Helvetica Neue", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--ease), color var(--ease);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding:
    max(22px, env(safe-area-inset-top))
    max(28px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-left));
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.brand,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
}

.brand-mark {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--focus);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.live-clock,
.back-link {
  color: var(--muted);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: .04em;
}

.back-link {
  transition: color var(--ease), transform var(--ease);
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--focus);
  outline: none;
  transform: translateX(-2px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  align-items: end;
  gap: clamp(42px, 8vw, 128px);
  min-height: 600px;
  padding: clamp(82px, 12vh, 144px) 0 clamp(72px, 10vh, 120px);
}

.hero-copy,
.primary-reading,
.section-block,
.section-heading > * {
  min-width: 0;
}

.eyebrow,
.section-index {
  margin: 0;
  color: var(--focus);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .12em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 14px var(--focus);
  animation: signal 1.8s ease-in-out infinite;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(64px, 9.4vw, 142px);
  font-weight: 800;
  line-height: .78;
  letter-spacing: -.067em;
  text-shadow: 0 16px 48px var(--shadow);
}

.hero h1 em {
  color: var(--focus);
  font-family: "Iowan Old Style", Georgia, serif;
  font-weight: 400;
}

.hero-description {
  max-width: 640px;
  margin: 36px 0 0;
  color: var(--muted);
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-size: 17px;
  line-height: 1.8;
}

.primary-reading {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  box-shadow: 0 30px 80px var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
  backdrop-filter: blur(22px) saturate(1.08);
}

.primary-reading::after {
  position: absolute;
  right: -54px;
  bottom: -74px;
  width: 180px;
  height: 180px;
  border: 1px solid color-mix(in srgb, var(--focus) 30%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 28px color-mix(in srgb, var(--focus) 4%, transparent);
  content: "";
  pointer-events: none;
}

.reading-head,
.reading-foot,
.probe-card header,
.probe-card footer,
.source-card header,
.section-heading,
.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reading-head {
  align-items: start;
  color: var(--muted);
  font-size: 11px;
}

.reading-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--focus);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7px;
  font-weight: 650;
  letter-spacing: .16em;
}

.reading-kicker::before {
  width: 14px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  content: "";
}

.reading-head .status-chip {
  margin-left: auto;
}

.status-chip,
.probe-state,
.source-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  letter-spacing: .08em;
}

.status-chip::before,
.probe-state::before,
.source-state::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.is-success,
.probe-card.is-success .probe-state,
.source-card.is-success .source-state {
  color: var(--focus);
}

.is-error,
.probe-card.is-error .probe-state,
.source-card.is-error .source-state {
  color: var(--error);
}

.is-loading::before,
.probe-card.is-loading .probe-state::before,
.source-card.is-loading .source-state::before {
  animation: signal 1.2s ease-in-out infinite;
}

.primary-ip {
  position: relative;
  z-index: 1;
  min-height: 1.2em;
  margin: 52px 0 10px;
  overflow-wrap: anywhere;
  color: var(--focus);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(27px, 3vw, 45px);
  font-weight: 650;
  letter-spacing: -.045em;
}

.primary-location {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.address-pair {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.address-row {
  min-width: 0;
  padding: 15px 14px 14px;
}

.address-row:first-child {
  padding-left: 0;
  border-right: 1px solid var(--border);
}

.address-row:last-child {
  padding-right: 0;
}

.address-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8px;
  letter-spacing: .09em;
}

.address-label::before {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.address-row strong {
  display: block;
  min-height: 1.3em;
  margin: 9px 0 5px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(17px, 1.5vw, 23px);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.25;
}

.address-note {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.address-row.is-success .address-label,
.address-row.is-success strong {
  color: var(--focus);
}

.address-row.is-warning .address-label,
.address-row.is-warning strong {
  color: var(--warning);
}

.address-row.is-error .address-label,
.address-row.is-error strong {
  color: var(--error);
}

.address-row.is-loading .address-label::before {
  animation: signal 1.2s ease-in-out infinite;
}

.reading-foot {
  position: relative;
  z-index: 1;
  align-items: end;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 54px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.reading-foot strong {
  font-size: 12px;
  font-weight: 600;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  transition: border-color var(--ease), background-color var(--ease), color var(--ease), transform var(--ease);
}

.refresh-button:hover,
.refresh-button:focus-visible {
  border-color: var(--focus);
  background: var(--focus-soft);
  color: var(--focus);
  outline: none;
  transform: translateY(-2px);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: .62;
  transform: none;
}

.section-block {
  padding: clamp(52px, 7vw, 92px) 0;
  border-top: 1px solid var(--border);
}

.section-heading {
  align-items: end;
  gap: 32px;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin: 10px 0 0;
  font-size: clamp(32px, 4vw, 55px);
  font-weight: 700;
  letter-spacing: -.045em;
}

.section-heading > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
}

.swipe-hint {
  display: none;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
}

.probe-card {
  grid-column: span 3;
  display: flex;
  min-height: 278px;
  flex-direction: column;
  padding: 22px;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: background-color var(--ease), transform var(--ease);
}

.probe-card.is-featured {
  grid-column: span 6;
  background:
    linear-gradient(135deg, var(--focus-soft), transparent 58%),
    color-mix(in srgb, var(--panel-strong) 86%, transparent);
}

.probe-card:hover {
  position: relative;
  z-index: 2;
  background-color: var(--panel-strong);
  transform: translateY(-3px);
}

.node-code {
  color: var(--focus);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  letter-spacing: .12em;
}

.probe-card h3 {
  margin: 43px 0 12px;
  font-size: 15px;
  font-weight: 620;
}

.probe-ip,
.source-value {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.probe-ip {
  font-size: 21px;
}

.probe-card.is-featured .probe-ip {
  font-size: clamp(24px, 3vw, 38px);
}

.probe-detail,
.source-place {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.probe-card footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 9px;
}

.latency {
  font-family: "SFMono-Regular", Menlo, monospace;
}

.probe-card.is-backup .probe-state {
  color: var(--focus);
}

.probe-card.is-backup .probe-ip,
.probe-card.is-backup .probe-detail {
  display: none;
}

.probe-card.is-backup h3 {
  margin-bottom: 10px;
}

.probe-backup {
  position: relative;
  min-width: 0;
  margin-bottom: 10px;
}

.probe-backup-viewport {
  position: relative;
  width: 100%;
  min-height: 72px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--focus) 42%, transparent);
  border-radius: 2px;
  background: #101410;
}

.probe-backup-frame {
  position: absolute;
  width: 1200px;
  height: 650px;
  border: 0;
  filter: invert(1) hue-rotate(180deg) contrast(.9);
  opacity: .78;
  pointer-events: none;
  transform-origin: 0 0;
}

.probe-backup-viewport.is-direct {
  height: 58px;
  min-height: 58px;
}

.probe-backup-frame.is-direct {
  position: static;
  width: 100%;
  height: 58px;
  filter: invert(1) hue-rotate(180deg) contrast(.9);
}

.probe-backup-link {
  display: inline-flex;
  margin-top: 6px;
  color: var(--muted);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8px;
  letter-spacing: .08em;
  text-decoration: none;
}

.probe-backup-link:hover,
.probe-backup-link:focus-visible {
  color: var(--focus);
  outline: none;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.source-card {
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.source-card header {
  margin-bottom: 18px;
}

.source-card header a {
  color: var(--muted);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-decoration: none;
}

.source-card header a:hover,
.source-card header a:focus-visible {
  color: var(--focus);
  outline: none;
}

.source-place {
  min-height: 1.6em;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ai-card {
  display: grid;
  min-width: 0;
  min-height: 132px;
  grid-template-rows: auto auto 1fr auto;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background:
    linear-gradient(145deg, var(--focus-soft), transparent 58%),
    color-mix(in srgb, var(--panel) 76%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.ai-card header,
.ai-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-card header a {
  color: var(--focus);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .08em;
  text-decoration: none;
}

.ai-card header a:hover,
.ai-card header a:focus-visible {
  color: var(--text);
  outline: none;
}

.ai-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 8px;
}

.ai-state::before {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.ai-card.is-success .ai-state {
  color: var(--focus);
}

.ai-card.is-loading .ai-state::before {
  animation: signal 1.2s ease-in-out infinite;
}

.ai-ip {
  margin-top: 16px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(13px, 1.25vw, 18px);
  font-weight: 620;
  line-height: 1.25;
}

.ai-place {
  display: -webkit-box;
  margin: 6px 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-meta {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 7px;
}

.ai-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.environment-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.environment-grid > div {
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 54%, transparent);
}

.environment-grid dt {
  margin-bottom: 9px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .1em;
}

.environment-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.55;
}

.route-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 42px;
  padding: 34px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.route-notes p {
  margin: 0;
  color: var(--muted);
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-size: 12px;
  line-height: 1.75;
}

.route-notes strong {
  color: var(--text);
}

.page-footer {
  gap: 20px;
  padding-top: 24px;
  color: var(--faint);
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  letter-spacing: .05em;
}

.page-footer a {
  text-decoration: none;
}

.page-footer a:hover,
.page-footer a:focus-visible {
  color: var(--focus);
  outline: none;
}

@keyframes signal {
  0%, 100% { opacity: .4; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1); }
}

/* 宽屏使用一屏仪表盘布局，避免检测结果分散在长页面中。 */
@media (min-width: 1100px) and (min-height: 720px) {
  .page-shell {
    display: grid;
    width: min(1600px, 100%);
    height: 100vh;
    height: 100svh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .topbar {
    padding-bottom: 11px;
  }

  main {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1.72fr) minmax(330px, .68fr);
    grid-template-rows: minmax(190px, 30%) minmax(150px, 24%) minmax(102px, 17%) minmax(90px, 15%);
    grid-template-areas:
      "hero hero"
      "route sources"
      "ai ai"
      "device device";
    align-content: space-between;
    column-gap: 14px;
  }

  .hero {
    grid-area: hero;
    grid-column: 1 / -1;
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1.15fr) minmax(550px, 1fr);
    align-items: center;
    gap: clamp(24px, 2.5vw, 44px);
    padding: 12px 0;
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  .hero h1 {
    font-size: clamp(54px, 5.7vw, 86px);
    line-height: .8;
  }

  .hero-description {
    max-width: 720px;
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.5;
  }

  .hero-copy {
    opacity: .78;
  }

  .hero-copy h1 {
    color: color-mix(in srgb, var(--text) 88%, transparent);
  }

  .primary-reading {
    isolation: isolate;
    min-height: 228px;
    padding: 18px 20px;
    border-color: color-mix(in srgb, var(--focus) 58%, var(--border-strong));
    background:
      radial-gradient(circle at 74% 20%, color-mix(in srgb, var(--focus) 13%, transparent), transparent 42%),
      linear-gradient(115deg, color-mix(in srgb, var(--panel-strong) 96%, #000 4%), color-mix(in srgb, var(--panel) 88%, transparent));
    box-shadow:
      0 30px 90px rgba(0, 0, 0, .42),
      0 0 48px color-mix(in srgb, var(--focus) 11%, transparent),
      inset 0 1px 0 color-mix(in srgb, var(--focus) 18%, transparent);
  }

  .primary-reading::before {
    position: absolute;
    z-index: 2;
    top: -1px;
    left: 18px;
    width: 38%;
    height: 2px;
    background: linear-gradient(90deg, var(--focus), color-mix(in srgb, var(--focus) 12%, transparent));
    box-shadow: 0 0 16px color-mix(in srgb, var(--focus) 58%, transparent);
    content: "";
    pointer-events: none;
  }

  .primary-reading::after {
    opacity: .72;
  }

  .status-chip {
    padding: 4px 7px;
    border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
    border-radius: 99px;
    background: rgba(0, 0, 0, .14);
  }

  .address-pair {
    margin-top: 17px;
    border-color: color-mix(in srgb, var(--focus) 24%, var(--border));
  }

  .address-row {
    padding: 13px 14px 12px;
  }

  .address-row:first-child {
    padding-left: 0;
    background: linear-gradient(90deg, color-mix(in srgb, var(--focus) 7%, transparent), transparent 72%);
  }

  .address-row:last-child {
    padding-right: 0;
  }

  .address-row strong {
    margin: 8px 0 5px;
    font-size: clamp(20px, 1.9vw, 28px);
  }

  .address-note {
    min-height: 2.8em;
    color: color-mix(in srgb, var(--text) 62%, transparent);
    font-size: 8px;
  }

  .address-row:first-child.is-success strong {
    text-shadow: 0 0 18px color-mix(in srgb, var(--focus) 24%, transparent);
  }

  .address-row:last-child.is-success strong {
    color: var(--text);
  }

  .reading-foot {
    margin-top: 13px;
    padding-top: 10px;
    border-color: color-mix(in srgb, var(--focus) 20%, var(--border));
  }

  .refresh-button {
    min-height: 32px;
    padding-inline: 12px;
    border-color: color-mix(in srgb, var(--focus) 38%, var(--border-strong));
    background: color-mix(in srgb, var(--focus) 6%, transparent);
  }

  .section-block {
    min-height: 0;
    padding: 10px 0;
  }

  .section-heading {
    min-height: 36px;
    margin-bottom: 8px;
  }

  .section-heading h2 {
    margin-top: 3px;
    font-size: 21px;
  }

  .section-heading > p {
    max-width: 330px;
    font-size: 9px;
    line-height: 1.4;
  }

  .section-block[aria-labelledby="routeTitle"] {
    grid-area: route;
    grid-column: 1;
    padding-right: 0;
  }

  .section-block[aria-labelledby="sourceTitle"] {
    grid-area: sources;
    grid-column: 2;
    padding-left: 0;
  }

  .section-block[aria-labelledby="sourceTitle"] .section-heading > p {
    display: none;
  }

  .route-grid {
    height: calc(100% - 44px);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 6px;
    border: 0;
  }

  .probe-card,
  .probe-card.is-featured {
    grid-column: auto;
    display: flex;
    min-height: 0;
    padding: 11px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
  }

  .probe-card header {
    display: flex;
  }

  .probe-card h3 {
    margin: 10px 0 6px;
    font-size: 11px;
  }

  .probe-ip,
  .probe-card.is-featured .probe-ip {
    font-size: clamp(12px, 1.08vw, 16px);
  }

  .probe-detail {
    display: -webkit-box;
    margin-top: 5px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.4;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .probe-card footer {
    padding-top: 8px;
    font-size: 8px;
  }

  .probe-card.is-backup h3 {
    margin: 7px 0 5px;
  }

  .probe-card.is-backup .probe-backup {
    margin-bottom: 3px;
  }

  .probe-card.is-backup .probe-backup-viewport,
  .probe-card.is-backup .probe-backup-viewport.is-direct {
    height: 46px !important;
    min-height: 46px;
  }

  .probe-card.is-backup .probe-backup-frame.is-direct {
    height: 46px;
  }

  .probe-card.is-backup .probe-backup-link {
    display: none;
  }

  .source-grid {
    height: calc(100% - 44px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .source-card {
    display: grid;
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
    padding: 6px 10px;
    overflow: hidden;
  }

  .source-card header {
    grid-column: 1 / -1;
    margin-bottom: 3px;
  }

  .source-value {
    font-size: clamp(13px, 1.15vw, 16px);
    line-height: 1.15;
  }

  .source-place {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 7px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ai-section {
    grid-area: ai;
    display: grid;
    grid-template-columns: 195px minmax(0, 1fr);
    align-items: stretch;
  }

  .ai-section .section-heading {
    height: 100%;
    align-items: start;
    margin: 0;
  }

  .ai-section .section-heading > p {
    display: none;
  }

  .ai-grid {
    height: 100%;
    gap: 5px;
  }

  .ai-card {
    min-height: 0;
    padding: 8px 10px;
    overflow: hidden;
  }

  .ai-ip {
    margin-top: 7px;
    font-size: clamp(11px, 1vw, 15px);
  }

  .ai-place {
    margin: 3px 0 5px;
    font-size: 7px;
    line-height: 1.2;
  }

  .ai-meta {
    padding-top: 4px;
    white-space: nowrap;
  }

  .environment-section {
    grid-area: device;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 195px minmax(0, 1fr);
    align-items: stretch;
  }

  .environment-section .section-heading {
    height: 100%;
    align-items: start;
    margin: 0;
  }

  .environment-section .section-heading > p {
    display: none;
  }

  .environment-grid {
    height: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .environment-grid > div {
    display: flex;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    padding: 11px 12px;
  }

  .environment-grid dt {
    margin-bottom: 9px;
  }

  .environment-grid dd {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .route-notes {
    display: none;
  }

  .page-footer {
    padding-top: 6px;
  }
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .primary-reading {
    max-width: 720px;
  }

  .probe-card,
  .probe-card.is-featured {
    grid-column: span 6;
  }

  .ai-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .environment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    background-position: center top, center top;
    background-attachment: scroll;
  }

  .page-shell {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .topbar {
    padding-bottom: 12px;
  }

  .brand,
  .back-link {
    min-height: 36px;
  }

  .live-clock {
    display: none;
  }

  .hero {
    min-height: 0;
    gap: 24px;
    padding: 34px 0 36px;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .hero h1 {
    font-size: clamp(46px, 14.4vw, 58px);
    line-height: .82;
  }

  .hero-description {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.65;
  }

  .primary-reading {
    padding: 18px;
  }

  .reading-kicker {
    display: none;
  }

  .primary-ip {
    margin: 26px 0 7px;
    font-size: clamp(24px, 8.2vw, 32px);
  }

  .primary-location {
    font-size: 11px;
  }

  .primary-ip,
  .primary-location {
    display: none;
  }

  .address-pair {
    margin-top: 18px;
  }

  .address-row {
    padding: 14px 12px 13px;
  }

  .address-row:first-child {
    padding-left: 0;
  }

  .address-row:last-child {
    padding-right: 0;
  }

  .address-row strong {
    margin: 10px 0 6px;
    font-size: clamp(13px, 4.35vw, 17px);
    line-height: 1.3;
  }

  .address-note {
    min-height: 4.2em;
    -webkit-line-clamp: 3;
  }

  .reading-foot {
    margin-top: 18px;
    padding-top: 14px;
  }

  .refresh-button {
    min-height: 44px;
  }

  .section-heading {
    display: grid;
    align-items: start;
    gap: 12px;
    margin-bottom: 24px;
  }

  .section-block {
    padding: 32px 0;
  }

  .section-heading h2 {
    margin-top: 7px;
    font-size: clamp(30px, 9.6vw, 38px);
  }

  .section-heading > p {
    max-width: none;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
  }

  .swipe-hint {
    display: block;
    color: var(--focus);
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 9px;
    letter-spacing: .06em;
  }

  .route-grid,
  .source-grid,
  .ai-grid {
    display: flex;
    gap: 10px;
    margin-right: calc(-1 * max(16px, env(safe-area-inset-right)));
    padding-right: max(16px, env(safe-area-inset-right));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 0 max(16px, env(safe-area-inset-right));
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .route-grid::-webkit-scrollbar,
  .source-grid::-webkit-scrollbar,
  .ai-grid::-webkit-scrollbar {
    display: none;
  }

  .route-grid {
    border: 0;
  }

  .probe-card,
  .probe-card.is-featured {
    flex: 0 0 min(80vw, 310px);
    display: flex;
    min-height: 206px;
    padding: 18px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .probe-card:hover {
    transform: none;
  }

  .probe-card header {
    display: flex;
  }

  .probe-card h3 {
    margin: 28px 0 10px;
  }

  .probe-ip,
  .probe-card.is-featured .probe-ip {
    font-size: clamp(21px, 6.8vw, 27px);
  }

  .probe-detail {
    margin-top: 9px;
    overflow: visible;
    white-space: normal;
  }

  .probe-card footer {
    margin-top: auto;
    padding-top: 18px;
  }

  .source-grid {
    grid-template-columns: none;
  }

  .source-card {
    flex: 0 0 min(78vw, 300px);
    min-height: 126px;
    padding: 18px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .source-card header {
    margin-bottom: 15px;
  }

  .source-value {
    font-size: 20px;
  }

  .ai-grid {
    grid-template-columns: none;
  }

  .ai-card {
    flex: 0 0 min(72vw, 260px);
    min-height: 124px;
    padding: 14px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .ai-ip {
    margin-top: 12px;
    font-size: clamp(15px, 4.6vw, 19px);
  }

  .environment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .environment-grid > div {
    min-height: 78px;
    padding: 10px;
  }

  .environment-grid dt {
    margin-bottom: 8px;
  }

  .environment-grid dd {
    font-size: 10px;
    line-height: 1.5;
  }

  .route-notes {
    display: none;
  }

  .page-footer {
    display: grid;
    gap: 10px;
    justify-items: start;
    padding-top: 18px;
    line-height: 1.6;
  }
}

@media (max-width: 420px) {
  .brand > span:last-child {
    display: none;
  }

  .reading-foot {
    align-items: center;
  }

  .refresh-button {
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    padding-inline: 13px;
  }
}

@media (max-width: 340px) {
  .reading-foot {
    display: grid;
    align-items: start;
  }

  .refresh-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
