:root {
  color-scheme: dark;
  --bg: #0b1110;
  --surface: #121c1a;
  --surface-soft: #172421;
  --surface-strong: #eef8f2;
  --ink: #eef8f2;
  --muted: #9fb0aa;
  --line: rgba(185, 209, 200, 0.16);
  --brand: #29c7ad;
  --brand-deep: #7fe7d3;
  --accent: #f2a54a;
  --accent-soft: rgba(242, 165, 74, 0.13);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(127, 231, 211, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(242, 165, 74, 0.045) 1px, transparent 1px),
    linear-gradient(140deg, rgba(41, 199, 173, 0.14), transparent 36%),
    linear-gradient(320deg, rgba(242, 165, 74, 0.09), transparent 38%),
    var(--bg);
  background-repeat: repeat, repeat, no-repeat, no-repeat, repeat;
  background-size: 56px 56px, 56px 56px, cover, cover, auto;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(11, 17, 16, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand span:last-child {
  color: #f4fbf7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.14rem;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #071311;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: 8px;
  font-weight: 900;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 8px;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--brand-deep);
  background: rgba(41, 199, 173, 0.12);
  outline: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 22px;
  min-height: 520px;
  padding: clamp(34px, 6vw, 64px) 0 28px;
  text-align: center;
}

.dashboard-copy {
  order: 2;
  max-width: 560px;
  opacity: 0.82;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--brand-deep);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard h1 {
  margin: 8px 0 0;
  color: #f7fff9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
}

.lead {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.6vw, 1.06rem);
  line-height: 1.5;
}

.ip-panel {
  position: relative;
  order: 1;
  width: 100%;
  max-width: 760px;
  padding: 24px;
  background: rgba(18, 28, 26, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  text-align: center;
}

.ip-value {
  display: block;
  width: 100%;
  margin-top: 10px;
  overflow: hidden;
  color: var(--surface-strong);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(2.1rem, 6vw, 4.7rem);
  font-weight: 800;
  line-height: 0.98;
  overflow-wrap: normal;
  text-overflow: clip;
  white-space: nowrap;
  word-break: keep-all;
}

.ip-value.is-long {
  font-size: clamp(1.55rem, 4.6vw, 3.2rem);
}

.panel-actions {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #071311;
  background: var(--brand);
  border-color: var(--brand);
  outline: none;
}

.ip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
  text-align: left;
}

.ip-grid div {
  min-width: 0;
  padding: 14px;
  background: rgba(23, 36, 33, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ip-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ip-grid dd {
  min-height: 1.4em;
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.status-line {
  margin-top: 18px;
  padding: 12px 14px;
  color: #ffdca8;
  background: var(--accent-soft);
  border: 1px solid rgba(242, 165, 74, 0.34);
  border-radius: 8px;
  font-size: 0.93rem;
  text-align: center;
}

.tool-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 34px;
}

.tool-strip a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 14px;
  color: var(--ink);
  background: rgba(18, 28, 26, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.tool-strip a:hover,
.tool-strip a:focus-visible {
  border-color: rgba(41, 199, 173, 0.58);
  box-shadow: 0 10px 30px rgba(41, 199, 173, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.tool-icon {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 42px;
  height: 36px;
  padding: 0 8px;
  place-items: center;
  color: #071311;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.tool-card {
  min-width: 0;
  padding: 22px;
  background: rgba(18, 28, 26, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.tool-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-heading h2 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: 0;
}

.tool-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 20px;
}

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

.tool-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-form input,
.tool-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #0c1513;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.tool-form input:focus,
.tool-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(41, 199, 173, 0.16);
}

.tool-form button {
  align-self: end;
  min-height: 46px;
  padding: 0 18px;
  color: #061210;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.tool-form button:hover,
.tool-form button:focus-visible {
  background: var(--accent);
  outline: none;
}

.result {
  min-height: 172px;
  max-height: 360px;
  margin: 18px 0 0;
  padding: 14px;
  overflow: auto;
  color: #d8fff3;
  background: #060b0a;
  border: 1px solid rgba(185, 209, 200, 0.12);
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result.is-error {
  color: #ffd6d2;
}

.result.is-success {
  color: #d6efe8;
}

.map-panel {
  height: 260px;
  margin-top: 14px;
  overflow: hidden;
  background: #060b0a;
  border: 1px solid rgba(185, 209, 200, 0.16);
  border-radius: 8px;
}

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

.map-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.9) contrast(1.05);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
  }

  .dashboard {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 42px;
  }

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

  .tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    padding: 14px 12px;
  }

  .dashboard h1 {
    font-size: 2rem;
    line-height: 1;
  }

  .panel-head {
    min-height: 132px;
    padding-top: 24px;
  }

  .ip-value {
    font-size: clamp(1.9rem, 8.5vw, 2.8rem);
  }

  .panel-actions {
    top: 14px;
    right: 14px;
  }

  .ip-panel,
  .tool-card {
    padding: 16px;
  }

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

  .tool-form button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
  }
}
