:root {
  color-scheme: light;
  --bg: #f8fbff;
  --panel: #ffffff;
  --panel-alpha: rgba(255, 255, 255, 0.92);
  --card: #ffffff;
  --ink: #17213a;
  --muted: #6d7a96;
  --soft: #f3f7ff;
  --input-bg: #ffffff;
  --result-bg: #f7faff;
  --map-bg: #e9f0fb;
  --line: #e5ebf5;
  --blue: #4c82ff;
  --violet: #7662ff;
  --green: #16b779;
  --link: #2d66e8;
  --copy-bg: #ffffff;
  --pill-bg: #f1f5ff;
  --public-bg: #eafaf3;
  --warm-soft: #fff4e5;
  --danger-soft: #fff0f0;
  --guide-text: #4e5d78;
  --hero-bg-1: rgba(99, 126, 255, 0.08);
  --hero-bg-2: rgba(77, 130, 255, 0.12);
  --shadow: 0 18px 50px rgba(48, 76, 130, 0.13);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1320;
  --panel: #141b2a;
  --panel-alpha: rgba(20, 27, 42, 0.94);
  --card: #101827;
  --ink: #edf3ff;
  --muted: #98a8c8;
  --soft: #192339;
  --input-bg: #101827;
  --result-bg: #0b1220;
  --map-bg: #111b2e;
  --line: #26344e;
  --link: #8fb0ff;
  --copy-bg: #101827;
  --pill-bg: #17233c;
  --public-bg: #102d25;
  --warm-soft: #302514;
  --danger-soft: #321b22;
  --guide-text: #c2cce0;
  --hero-bg-1: rgba(76, 130, 255, 0.14);
  --hero-bg-2: rgba(118, 98, 255, 0.16);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, var(--hero-bg-1), transparent 28%),
    radial-gradient(circle at 92% 12%, var(--hero-bg-2), transparent 26%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header,
main,
.footer {
  width: min(100% - 36px, 1180px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: 11px;
  box-shadow: 0 12px 24px rgba(92, 109, 255, 0.24);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a,
.footer a {
  color: var(--link);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.theme-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: var(--panel-alpha);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 16px;
}

.lookup {
  width: min(100%, 600px);
  margin: 0 auto 38px;
  text-align: center;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(66, 92, 138, 0.12);
}

.lookup input {
  min-width: 0;
  height: 50px;
  padding: 0 20px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.lookup input::placeholder {
  color: var(--muted);
}

.lookup button,
.tool-form button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-weight: 850;
}

.lookup p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ip-card,
.map-card,
.tool-card,
.browser,
.guides article {
  background: var(--panel-alpha);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.ip-card {
  min-width: 0;
  padding: 20px;
}

.ip-summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.country-ring {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 2px dotted #7da1ff;
  border-radius: 999px;
}

.country-ring span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(34, 72, 132, 0.08);
}

.label,
.ip-heading,
dt,
.user-agent strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ip-heading {
  margin: 0;
  line-height: 1.2;
}

.ip-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 4px;
}

#currentIp {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(25px, 3.2vw, 38px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  text-overflow: clip;
  white-space: nowrap;
}

.copy-icon,
.copy-button,
.refresh-button {
  border: 1px solid var(--line);
  background: var(--copy-bg);
  color: var(--muted);
  font-weight: 800;
}

.copy-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  font-size: 13px;
}

.ip-main p {
  margin: 6px 0 0;
  color: #5f77a8;
  font-weight: 650;
}

.ip-main {
  min-width: 0;
}

.status-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.pill,
.refresh-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.pill {
  color: #416bdd;
  background: var(--pill-bg);
}

.pill.public {
  color: #0c9d67;
  background: var(--public-bg);
}

.refresh-button {
  border: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding-top: 16px;
}

.detail-tile {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  column-gap: 10px;
  min-width: 0;
  padding: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(51, 78, 125, 0.06);
}

.tile-icon {
  grid-area: icon;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  align-self: center;
  color: #4e7dff;
  background: #eef4ff;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}

.detail-tile:nth-child(3n) .tile-icon {
  color: #0fa56c;
  background: #eafaf3;
}

.detail-tile:nth-child(3n + 1) .tile-icon {
  color: #ed9a2c;
  background: var(--warm-soft);
}

.country-icon {
  color: #d84343;
  background: var(--danger-soft);
}

dt {
  grid-area: label;
  margin: 0 0 4px;
}

dd {
  grid-area: value;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.user-agent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-agent p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #42506c;
  font-family: var(--mono);
  font-size: 11px;
}

.copy-button {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
}

.map-card {
  display: flex;
  min-width: 0;
  min-height: 430px;
  padding: 14px;
}

.map-card iframe {
  display: block;
  width: 100%;
  min-height: 100%;
  height: auto;
  border: 0;
  border-radius: 16px;
  background: var(--map-bg);
}

.map-card.is-hidden {
  display: none;
}

.tools,
.browser,
.guides {
  margin-top: 22px;
}

.tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-card,
.browser,
.guides article {
  padding: 22px;
}

h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0;
}

.tool-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 86px;
  gap: 9px;
  margin-bottom: 12px;
}

.tool-form.two {
  grid-template-columns: minmax(0, 1fr) 86px;
}

.tool-form input,
.tool-form select {
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

.tool-form button {
  border-radius: 10px;
}

.result-box {
  min-height: 112px;
  max-height: 240px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  background: var(--result-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12px;
}

.browser-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.browser-item {
  min-width: 0;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.browser-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.browser-item span {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 850;
}

.guides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.guides-heading {
  grid-column: 1 / -1;
  max-width: 920px;
  padding: 18px 2px 8px;
}

.guides-heading span {
  display: block;
  margin-bottom: 10px;
  color: #4c82ff;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guides-heading h2 {
  max-width: 980px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.03;
  letter-spacing: -0.02em;
}

.guides-heading p {
  margin: 0;
  color: #5f6f8e;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 650;
  line-height: 1.55;
}

.guides article {
  min-height: 260px;
  padding: 34px;
}

.guides .featured-guide {
  grid-column: 1 / -1;
  min-height: 250px;
  background:
    linear-gradient(135deg, rgba(76, 130, 255, 0.08), rgba(118, 98, 255, 0.08)),
    var(--card);
}

.guides article h2 {
  margin-bottom: 16px;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.guides p {
  margin: 0;
  color: var(--guide-text);
  font-size: 18px;
  line-height: 1.8;
}

.legal-page {
  max-width: 860px;
}

.content-page {
  max-width: 980px;
}

.article-hero,
.article-card,
.related-guides {
  background: var(--panel-alpha);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.article-hero {
  padding: clamp(30px, 5vw, 56px);
  margin-bottom: 22px;
}

.article-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-hero h1 {
  max-width: 860px;
  margin: 0 0 16px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.article-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 650;
  line-height: 1.6;
}

.article-card,
.related-guides {
  padding: clamp(24px, 4vw, 40px);
}

.article-card + .article-card,
.related-guides {
  margin-top: 18px;
}

.article-card h2,
.related-guides h2 {
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.15;
}

.article-card h3 {
  margin: 24px 0 10px;
  font-size: 22px;
}

.article-card p,
.article-card li {
  color: var(--guide-text);
  font-size: 18px;
  line-height: 1.8;
}

.article-card ul,
.article-card ol {
  padding-left: 22px;
}

.article-card code {
  padding: 2px 5px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
}

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

.related-grid a,
.guide-link-grid a {
  display: block;
  padding: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 850;
  text-decoration: none;
}

.guide-link-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.guide-link-grid span,
.related-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.legal-card {
  padding: clamp(24px, 4vw, 42px);
  background: var(--panel-alpha);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.legal-card h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: 0;
}

.legal-card section {
  margin-top: 28px;
}

.legal-card p,
.legal-card li {
  color: var(--guide-text);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 38px;
  color: var(--muted);
  font-size: 13px;
}

.footer nav {
  display: flex;
  gap: 26px;
}

@media (max-width: 860px) {
  .result-layout {
    grid-template-columns: 1fr;
  }

  .ip-summary,
  .detail-grid,
  .tools,
  .browser-grid,
  .guides,
  .related-grid,
  .guide-link-grid {
    grid-template-columns: 1fr;
  }

  .guides .featured-guide {
    grid-column: auto;
  }

  .ip-summary {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .status-row {
    justify-content: flex-start;
  }

  .country-ring {
    width: 64px;
    height: 64px;
  }

  .country-ring span {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .map-card iframe {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    gap: 18px;
    flex-wrap: wrap;
  }

  .lookup {
    margin-bottom: 34px;
  }

  .lookup-form,
  .tool-form,
  .tool-form.two {
    grid-template-columns: 1fr;
  }

  .lookup button,
  .tool-form button {
    min-height: 44px;
  }

  .ip-card,
  .map-card {
    padding: 18px;
    border-radius: 18px;
  }

  .ip-summary {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 20px;
  }

  .country-ring {
    width: 62px;
    height: 62px;
  }

  .country-ring span {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .detail-grid {
    padding-top: 20px;
  }

  #currentIp {
    font-size: clamp(25px, 7vw, 34px);
  }

  .map-card iframe {
    min-height: 260px;
  }

  .guides article {
    min-height: auto;
    padding: 24px;
  }

  .guides-heading p,
  .guides p {
    font-size: 16px;
    line-height: 1.7;
  }

  .guides-heading h2 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .guides article h2 {
    font-size: 24px;
  }
}

@media (max-width: 430px) {
  .site-header,
  main,
  .footer {
    width: min(100% - 24px, 1120px);
  }

  .ip-card,
  .map-card {
    padding: 14px;
  }

  .ip-summary {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .country-ring {
    width: 50px;
    height: 50px;
    border-width: 1px;
  }

  .country-ring span {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .ip-line {
    gap: 6px;
  }

  #currentIp {
    font-size: clamp(22px, 6.4vw, 28px);
  }

  .copy-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }

  .detail-tile {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px;
  }

  .tile-icon {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  #currentIp {
    font-size: clamp(19px, 6vw, 22px);
  }
}
