:root {
  color-scheme: light;
  --ink: #182b29;
  --muted: #667572;
  --line: #dce5df;
  --paper: #f2f5ef;
  --surface: #fff;
  --green: #176b55;
  --green-dark: #104b3e;
  --green-pale: #e9f4ed;
  --coral: #dc795a;
  --shadow: 0 18px 48px rgba(24, 43, 41, .07);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(#c8d8ce 0.7px, transparent 0.7px);
  background-size: 19px 19px;
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  height: 58px;
  border-bottom: 1px solid rgba(205, 218, 209, .8);
  background: rgba(250, 252, 248, .94);
  backdrop-filter: blur(14px);
}

.header-inner, .container, .footer-inner {
  width: calc(100% - 48px);
  margin: 0 auto;
}

.header-inner, .footer-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-tool { color: var(--green-dark); font-size: 12px; font-weight: 600; text-underline-offset: 4px; }
.header-tool:hover { color: var(--coral); }

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-dot { color: var(--coral); }
.header-note, .eyebrow, .panel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.header-note { color: var(--muted); }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #32966f;
  box-shadow: 0 0 0 4px #e0f1e5;
}

main.container { padding-top: 20px; padding-bottom: 24px; }
.eyebrow { color: var(--green); }

h1, h2, .ip-value, .map-top b {
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  max-width: 760px;
  margin: 6px 0;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.04;
}

.intro {
  max-width: 640px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 14px;
  align-items: stretch;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.details-panel { padding: 16px 18px 12px; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-kicker { color: var(--muted); }
.live-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #cce7d7;
  border-radius: 999px;
  color: var(--green-dark);
  background: #f2faf4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

.ip-value {
  margin: 8px 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ip-value.loading { color: #8d9994; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.copy-btn:hover:not(:disabled) { border-color: #9dbdaf; background: #f5faf6; }
.copy-btn:active:not(:disabled) { transform: translateY(1px); }
.copy-btn:disabled { opacity: .5; cursor: not-allowed; }
.copy-btn:focus-visible, a:focus-visible { outline: 3px solid #82bca4; outline-offset: 3px; }

.section-line { margin: 12px 0 4px; border-top: 1px solid var(--line); }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.data-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px solid #edf1ed;
}
.data-label { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.data-value { min-width: 0; text-align: right; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.info-footer { padding-top: 8px; text-align: right; }
.info-footer a { color: var(--green-dark); font-size: 12px; font-weight: 600; text-underline-offset: 3px; }
.dev-credit {
  margin-top: auto;
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.dev-credit a { color: var(--green-dark); font-weight: 700; text-underline-offset: 3px; }
.mono { font-family: "Space Grotesk", sans-serif; }
.unavailable { color: #899591; font-weight: 500; }
.error { display: none; margin: 10px 0 0; color: #a54738; font-size: 12px; }

.map-panel { position: relative; min-height: 350px; background: #e4ebe3; }
#map-frame, #map-frame iframe { width: 100%; height: 100%; min-height: 350px; border: 0; }
#map-frame iframe { display: block; }
.map-top {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  max-width: calc(100% - 32px);
  padding: 11px 14px;
  border: 1px solid rgba(220, 229, 223, .95);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 18px rgba(24, 43, 41, .12);
}

.map-top b { display: block; font-size: 13px; }
.map-top small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 80px 24px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.map-placeholder[hidden] { display: none; }
.map-link {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(24, 43, 41, .12);
}
.map-link:hover { color: var(--green-dark); background: #f4faf5; }

.bottom-note {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.bottom-note span:last-child { text-align: right; }
.foot { min-height: 64px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.foot a { color: var(--green-dark); }

@media (min-width: 851px) {
  body { display: flex; min-height: 100vh; min-height: 100dvh; flex-direction: column; }
  main.container { display: flex; flex: 1; min-height: 0; flex-direction: column; }
  .content-grid { flex: 1; min-height: 0; }
  .details-panel { display: flex; flex-direction: column; }
  .data-grid { flex: 1; align-content: space-evenly; }
}

@media (max-width: 850px) {
  main.container { padding-top: 18px; }
  .content-grid { grid-template-columns: 1fr; }
  .map-panel, #map-frame, #map-frame iframe { min-height: 240px; }
}

@media (max-width: 560px) {
  .header-inner, .container, .footer-inner { width: calc(100% - 32px); }
  .site-header { height: 52px; }
  .header-actions { flex-direction: column; align-items: flex-end; gap: 3px; }
  .header-tool { font-size: 9px; }
  .header-note { font-size: 8px; }
  main.container { padding-top: 10px; padding-bottom: 16px; }
  h1 { margin: 4px 0; font-size: 36px; text-align: center; }
  .intro { margin-bottom: 10px; font-size: 13px; line-height: 1.35; }
  .details-panel { display: flex; min-height: calc(100svh - 200px); flex-direction: column; padding: 12px 12px 8px; }
  .data-grid { flex: 1; align-content: space-evenly; }
  .dev-credit { margin-top: 8px; padding: 10px 0 2px; border-top: 1px solid var(--line); }
  .panel-kicker { font-size: 9px; }
  .live-pill { padding: 5px 7px; font-size: 8px; }
  .ip-value { margin: 6px 0; font-size: 28px; text-align: center; }
  .data-grid { column-gap: 10px; }
  .data-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 0; }
  .data-label, .data-value { font-size: 12px; text-align: left; }
  .map-panel { aspect-ratio: 1; min-height: 0; margin-top: 24px; }
  #map-frame, #map-frame iframe { min-height: 0; }
  .bottom-note { display: none; }
  .footer-inner { gap: 12px; font-size: 10px; }
}

@media (max-width: 560px) and (max-height: 740px) {
  .intro { display: none; }
  .details-panel { min-height: calc(100svh - 140px); }
  .data-row { padding: 8px 0; }
  .map-panel, #map-frame, #map-frame iframe { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
