:root {
  color-scheme: dark;
  --paper: #111916;
  --ink: #e7eee8;
  --muted: #9aa9a0;
  --line: #34423b;
  --mint: #c9f16a;
  --mint-dark: #a7cf65;
  --coral: #f18469;
  --blue: #8ebbd5;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
}

.topbar {
  height: 68px;
  padding: 0 clamp(20px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.mark {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  background: var(--mint);
  color: #172321;
  font-family: var(--mono);
  font-size: 16px;
}

.wordmark-light { color: var(--muted); font-weight: 500; }
.live-indicator, .route-chip { display: inline-flex; align-items: center; gap: 8px; }
.live-indicator { color: var(--muted); font: 10px var(--mono); letter-spacing: .8px; }
.live-dot, .route-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b9c3d; }

main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 76px); }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 58px 0 34px; }
.eyebrow { margin: 0; color: var(--muted); font: 10px var(--mono); letter-spacing: .8px; }
.eyebrow span { color: var(--coral); padding: 0 5px; }

h1 {
  margin: 19px 0 0;
  max-width: 720px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.03;
  letter-spacing: 0;
  font-weight: 700;
}

h1 em { color: #b6d687; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.refresh-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: 12px var(--mono);
  cursor: pointer;
}
.refresh-button:hover { background: var(--ink); color: var(--paper); }
.refresh-button span { margin-right: 7px; color: var(--coral); font-size: 18px; vertical-align: -1px; }

.ip-band {
  display: flex;
  min-height: 142px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 30px;
  background: #202c27;
  color: var(--ink);
}
.ip-band .eyebrow { color: #a9b5ae; }
.public-ip { display: block; margin-top: 10px; font: clamp(24px, 4vw, 40px) var(--mono); letter-spacing: 0; overflow-wrap: anywhere; }
.ip-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 13px; }
.route-chip { padding: 8px 11px; border: 1px solid #53615b; border-radius: 2px; color: #e5e9e2; font: 11px var(--mono); white-space: nowrap; }
.route-dot { background: var(--mint); }
.updated { color: #a9b5ae; font: 10px var(--mono); }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 14px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 19px; font-weight: 650; }
.section-heading > span { color: var(--muted); font: 9px var(--mono); letter-spacing: .4px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-panel { min-width: 0; padding: 24px 24px 12px; border: 1px solid var(--line); background: #19231f; }
.server-panel { border-top: 3px solid var(--mint-dark); }
.browser-panel { border-top: 3px solid #5b88a3; }
.panel-heading { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel-index { display: grid; width: 34px; aspect-ratio: 1; place-items: center; background: var(--mint); color: var(--ink); font: 11px var(--mono); }
.browser-panel .panel-index { background: var(--blue); }
.panel-heading h3 { margin: 4px 0 0; font-size: 20px; font-weight: 650; }
.heading-mark { margin-left: auto; color: var(--coral); font: 24px Georgia, serif; }
.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: minmax(110px, .75fr) minmax(0, 1.25fr); gap: 14px; padding: 13px 0; border-bottom: 1px solid #34423b; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 12px; }
.detail-row dd { margin: 0; overflow-wrap: anywhere; font: 11px/1.5 var(--mono); }

.location-panel { margin-top: 14px; padding: 21px 24px; border: 1px solid var(--line); background: #202c27; }
.location-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.location-heading h2 { margin-top: 5px; }
.location-button { min-height: 42px; padding: 0 15px; border: 1px solid var(--mint); border-radius: 3px; background: var(--mint); color: #172321; font: 11px var(--mono); cursor: pointer; }
.location-button:hover:not(:disabled) { background: #dcff8b; }
.location-button:disabled { cursor: wait; opacity: .65; }
.location-status { margin: 14px 0 0; color: #bdc9c1; font-size: 12px; line-height: 1.5; }
.location-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 10px 0 0; }
.location-details .detail-row { grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); }

.note-band { display: flex; align-items: center; gap: 13px; margin-top: 18px; padding: 16px 18px; background: #202c27; }
.note-symbol { display: grid; flex: 0 0 21px; width: 21px; aspect-ratio: 1; place-items: center; border: 1px solid #829775; border-radius: 50%; color: var(--mint); font: italic 14px Georgia, serif; }
.note-band p { flex: 1; margin: 0; color: #d4dfd7; font-size: 12px; line-height: 1.5; }
.note-label { color: var(--mint); font: 9px var(--mono); white-space: nowrap; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 34px; color: var(--muted); font: 9px var(--mono); }
.footer-separator { padding: 0 5px; color: var(--coral); }

@media (max-width: 720px) {
  .topbar { height: 58px; }
  .intro { align-items: flex-start; flex-direction: column; padding: 44px 0 25px; }
  h1 { font-size: 40px; }
  .refresh-button { align-self: stretch; }
  .ip-band { align-items: flex-start; flex-direction: column; padding: 23px 20px; }
  .ip-meta { align-items: flex-start; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-panel { padding-right: 17px; padding-left: 17px; }
  .detail-row { grid-template-columns: minmax(95px, .7fr) minmax(0, 1.3fr); gap: 9px; }
  .note-band { align-items: flex-start; flex-wrap: wrap; }
  .note-band p { min-width: calc(100% - 45px); }
  .note-label { margin-left: 34px; }
  .location-panel { padding-right: 17px; padding-left: 17px; }
  .location-heading { align-items: flex-start; flex-direction: column; }
  .location-button { width: 100%; }
  .location-details { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: no-preference) {
  main { animation: enter .45s ease-out both; }
  @keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}
