:root {
  --surface: #f2f4f7;
  --card: #ffffff;
  --navy: #021a2e;
  --raised: #0a2a44;
  --ink: #0b2236;
  --muted: #46607a;
  --line: #dbe3ec;
  --brand: #0973b8;
  --brand-hi: #009bff;
  --cyan: #00e5ff;
  --ok: #0f8a4b;
  --bad: #c62828;
  --warn: #a35f00;
  --r: 12px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 400 15px/1.6 Poppins, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Montserrat, Poppins, sans-serif; font-weight: 700; line-height: 1.2; margin: 0; }
a { color: var(--brand); }
code { font-family: var(--mono); font-size: .92em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr, .side-select > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: #fff; padding: 8px 14px; border-radius: 999px; }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 2px; }
.hero :focus-visible { outline-color: var(--cyan); }

/* Top bar */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand img { display: block; height: 40px; width: auto; }
.tag { font: 600 12px Montserrat, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.top-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.top-nav a:hover { color: var(--brand); }

/* Pills */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 11px 22px; cursor: pointer;
  background: var(--brand); color: #fff !important; text-decoration: none;
  font: 600 14px Montserrat, sans-serif; transition: background .15s, transform .15s;
}
.pill:hover { background: #0866a3; }
.pill:active { transform: translateY(1px); }
.pill:disabled { opacity: .6; cursor: progress; }
.pill-sm { padding: 6px 14px; font-size: 13px; }
.pill-ghost { background: transparent; color: var(--brand) !important; box-shadow: inset 0 0 0 1.5px currentColor; }
.pill-ghost:hover { background: rgba(9,115,184,.08); }
.pill-cta { background: var(--brand-hi); color: var(--navy) !important; }
.pill-cta:hover { background: #33afff; }
.top-nav .pill { color: #fff !important; }

/* Hero */
.hero {
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(0,155,255,.28), transparent 60%),
    radial-gradient(600px 300px at 0% 110%, rgba(0,229,255,.12), transparent 60%),
    var(--navy);
  color: #e8f1fa; padding: 56px 0 48px;
}
.hero-head { max-width: 720px; margin-bottom: 32px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 600 12px Montserrat, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2bd97c; box-shadow: 0 0 0 4px rgba(43,217,124,.18); }
.hero h1 { font-size: clamp(28px, 4.2vw, 44px); color: #fff; }
.lead { font-size: 17px; color: #b8cde0; margin: 14px 0 0; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--raised); border: 1px solid rgba(0,155,255,.18); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h2 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8fb4d4; }
.card .muted { color: #8fa9c1; }
.card code { color: #fff; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: #8fa9c1; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.big-ip { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.copyable { cursor: copy; border-bottom: 1px dashed rgba(255,255,255,.3); }
.cmd { display: flex; align-items: center; gap: 8px; background: #031424; border-radius: 8px; padding: 8px 8px 8px 12px; }
.cmd code { flex: 1; min-width: 0; font-size: 12.5px; overflow-wrap: anywhere; color: #cfe6ff; }
.ico { flex: none; background: rgba(0,155,255,.16); color: #cfe6ff; border: 0; border-radius: 999px; padding: 4px 10px; font: 500 12px Poppins, sans-serif; cursor: pointer; }
.ico:hover { background: rgba(0,155,255,.3); }
.dl { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dl-label { font-size: 12px; color: #8fa9c1; width: 34px; }
.card .pill-ghost { color: var(--cyan) !important; align-self: flex-start; }
.card .pill-ghost:hover { background: rgba(0,229,255,.08); }
.card .pill-cta { margin-top: auto; }

/* Tools layout */
.tools { display: grid; grid-template-columns: 230px 1fr; gap: 28px; padding: 40px 0 64px; align-items: start; }
.side { position: sticky; top: 84px; }
.side-select { display: none; }
.side-h { margin: 18px 0 6px; font: 600 11px Montserrat, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.side-h:first-of-type { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 7px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.side a:hover { background: #e6edf4; }
.side a[aria-current="true"] { background: var(--brand); color: #fff; font-weight: 500; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.panel:not(.on) { display: none; }
.panel h2 { font-size: 24px; }
.desc { color: var(--muted); margin: 8px 0 22px; max-width: 680px; }
form { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span2 { grid-column: 1 / -1; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .fld { flex: 1; min-width: 150px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea {
  font: 400 15px Poppins, sans-serif; color: var(--ink); background: #fff;
  border: 1px solid #c8d3df; border-radius: 10px; padding: 11px 14px; width: 100%;
}
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-hi); box-shadow: 0 0 0 3px rgba(0,155,255,.2); }
input[type=range] { accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; padding: 0; }
.seg { display: inline-flex; flex-direction: column; }
.seg label { display: inline-block; }
.seg > label { margin-right: -1px; }
.seg input, .chk input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 18px; border: 1px solid #c8d3df; background: #fff; font-size: 14px; cursor: pointer; }
.seg label:first-of-type span { border-radius: 999px 0 0 999px; }
.seg label:last-of-type span { border-radius: 0 999px 999px 0; }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg input:focus-visible + span, .chk input:focus-visible + span { outline: 2px solid var(--brand-hi); outline-offset: 2px; }
.seg { flex-direction: row; flex-wrap: wrap; }
.seg legend { width: 100%; }
.ports, .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ports legend, .opts legend { width: 100%; }
.chk span { display: inline-block; padding: 6px 12px; border: 1px solid #c8d3df; border-radius: 999px; font-size: 13px; cursor: pointer; background: #fff; user-select: none; }
.chk small { color: var(--muted); }
.chk input:checked + span { background: #e3f2fd; border-color: var(--brand); color: var(--brand); }
.chk input:checked + span small { color: var(--brand); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.actions { display: flex; gap: 10px; align-items: center; }

/* Output */
.term {
  margin: 22px 0 0; background: var(--navy); color: #d6e7f7; border-radius: 10px;
  padding: 18px 20px; font: 400 13px/1.55 var(--mono); white-space: pre; overflow: auto; max-height: 560px;
}
.term.err, .out .err { color: var(--bad); }
.term.err { background: #fff4f4; border: 1px solid #f3c6c6; white-space: pre-wrap; }
.out { margin-top: 22px; }
.out .err { background: #fff4f4; border: 1px solid #f3c6c6; padding: 12px 16px; border-radius: 10px; }
.out pre { background: var(--navy); color: #d6e7f7; border-radius: 10px; padding: 16px 18px; font: 13px/1.55 var(--mono); overflow: auto; margin: 0 0 12px; white-space: pre-wrap; word-break: break-all; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 12px Montserrat, sans-serif; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: #f7f9fb; }
tr:last-child td { border-bottom: 0; }
td code { overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-ok { background: #e3f6ec; color: var(--ok); }
.b-bad { background: #fde8e8; color: var(--bad); }
.b-mute { background: #eef2f6; color: var(--muted); }
.b-warn { background: #fff3e0; color: var(--warn); }
.summary { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 14px; font-size: 14px; }
.summary b { font-weight: 500; }
.pw { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pw code { flex: 1; background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; overflow-wrap: anywhere; }
.copy-btn { background: #e3f2fd; color: var(--brand); border: 0; border-radius: 999px; padding: 6px 14px; font: 500 13px Poppins, sans-serif; cursor: pointer; flex: none; }
.copy-btn:hover { background: #cfe8fb; }
.out-h { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; font: 600 14px Montserrat, sans-serif; }
.kv-wide { grid-template-columns: 140px 1fr; font-size: 14px; }
.kv-wide dt { color: var(--muted); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

/* Footer */
.foot { background: #fff; border-top: 1px solid var(--line); padding: 28px 0; }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot-logo { height: 34px; width: auto; display: block; }
.foot p { margin: 6px 0 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: .2s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .tools { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
  .side { position: static; }
  .side-select { display: block; }
  .side-select select { font-weight: 500; }
  .side .side-h, .side ul { display: none; }
  .top-nav { gap: 14px; }
  .top-nav .pill { display: none; }
  .top-nav a { font-size: 13px; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .tag { display: none; }
  .hero { padding: 36px 0 32px; }
  .panel { padding: 20px 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .kv-wide { grid-template-columns: 1fr; }
  .kv-wide dd { margin-bottom: 8px; }
  .brand img { height: 34px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.tools { scroll-margin-top: 72px; }

/* Keep long tool output (traceroute/MTR/WHOIS) scrolling inside its box instead of widening the page */
.tools > *, .panels, .panel, .out, form, .fld { min-width: 0; }
.term, .out pre { max-width: 100%; -webkit-overflow-scrolling: touch; }
@media (max-width: 600px) {
  .term { font-size: 11.5px; padding: 14px; }
  .out pre { font-size: 12px; padding: 14px; }
  th, td { padding: 8px 10px; }
}
