/* HamzahPing — Network Diagnostics by HamzahTech
   Modern terminal-inspired console. Mobile-first from 360px. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2-variations"),
       url("/assets/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght.woff2") format("woff2-variations"),
       url("/assets/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Canvas & surfaces */
  --bg: #0B1220;
  --bg-2: #0D1628;
  --surface: #111B2E;
  --surface-2: #15223A;
  --surface-3: #1A2A47;
  --console: #080E1A;
  --border: #22324F;
  --border-strong: #31466D;

  /* Text (contrast measured on --surface) */
  --text: #E6EDF7;
  --text-2: #B3C1D9;
  --muted: #8193B3;

  /* HamzahTech brand (sampled from logo: navy #183672, blue #3D81D0) */
  --brand-navy: #183672;
  --brand: #3D81D0;
  --brand-bright: #5EA2EE;
  --brand-soft: rgba(94, 162, 238, .12);
  --mark-navy: #2E5BB5;
  --mark-blue: #5EA2EE;

  /* Status — used only for status */
  --ok: #3FBF6F;
  --ok-bg: rgba(63, 191, 111, .12);
  --warn: #E5A537;
  --warn-bg: rgba(229, 165, 55, .12);
  --fail: #F2645F;
  --fail-bg: rgba(242, 100, 95, .12);
  --skip: #8193B3;
  --skip-bg: rgba(129, 147, 179, .1);

  --font-ui: "Inter", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", Consolas, "SFMono-Regular", Menlo, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -16px rgba(0,0,0,.6);
  --gutter: 16px;
  --max: 1240px;
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg) url("/assets/img/console-grid-bg.svg") center top / 1920px auto no-repeat;
  color: var(--text);
  font: 400 15px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-bright); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8CC0FF; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.stack { display: grid; gap: 16px; align-content: start; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ Header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 18, 32, .86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark.sm { width: 20px; height: 20px; }
.brand-mark circle.r0, .brand-mark circle.r2, .console-mark circle.r0, .console-mark circle.r2 { fill: var(--mark-navy); }
.brand-mark circle.r1, .brand-mark circle.r3, .console-mark circle.r1, .console-mark circle.r3 { fill: var(--mark-blue); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; letter-spacing: .14em; font-size: 16px; }
.brand-sub { display: none; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; margin-top: 3px; }

.site-nav {
  position: fixed; inset: var(--header-h) 0 auto 0;
  display: none; flex-direction: column; padding: 8px var(--gutter) 16px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.site-nav.open { display: flex; }
.site-nav a {
  color: var(--text-2); text-decoration: none; padding: 12px 10px; border-radius: 8px; font-weight: 500;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--brand-soft); }
.menu-toggle {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  background: transparent; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.menu-toggle .icon { width: 20px; height: 20px; }

.service-status {
  display: none; align-items: center; gap: 8px;
  font: 600 11px/1 var(--font-mono); letter-spacing: .08em; color: var(--text-2);
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap;
}
.service-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--skip); }
.service-status.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.service-status.down .dot { background: var(--warn); }

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .site-nav {
    position: static; display: flex; flex-direction: row; gap: 2px; padding: 0;
    background: none; border: 0;
  }
  .site-nav a { padding: 8px 12px; font-size: 14px; }
  .service-status { display: inline-flex; }
}
@media (min-width: 1100px) { .brand-sub { display: block; } }

/* ------------------------------------------------------------ Main & footer */

.site-main { flex: 1; padding: 24px 0 56px; outline: none; }
.site-footer { border-top: 1px solid var(--border); background: rgba(8, 14, 26, .6); font-size: 13.5px; color: var(--text-2); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-block: 20px; }
.footer-brand { display: flex; gap: 10px; align-items: center; }
.footer-nav { display: flex; gap: 18px; align-items: center; }
.footer-nav a { color: var(--text-2); text-decoration: none; }
.footer-nav a:hover { color: var(--text); }

/* ------------------------------------------------------------ Generic UI */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 650; color: var(--text);
}
.card-title .icon { color: var(--brand-bright); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.notice { color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-3); border-color: #3E5785; color: var(--text); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  font-family: var(--font-mono); letter-spacing: .06em; font-size: 13.5px;
}
.btn-primary:hover { background: #4B8FE0; border-color: #4B8FE0; color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: transparent; }
.btn .icon { width: 16px; height: 16px; }
.btn.copied { border-color: var(--ok); color: var(--ok); }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select {
  width: 100%; min-height: 46px; padding: 0 14px;
  background: var(--console); border: 1px solid var(--border-strong); border-radius: 10px;
  font-family: var(--font-mono); font-size: 15px; color: var(--text);
}
.input::placeholder { color: #5C6E8F; }
.input:focus, .select:focus { outline: none; border-color: var(--brand-bright); box-shadow: 0 0 0 3px var(--brand-soft); }
.select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.tool-form { display: grid; gap: 12px; }
@media (min-width: 720px) {
  .tool-form { grid-template-columns: 1fr auto; align-items: end; }
  .tool-form.with-select { grid-template-columns: 1fr 160px auto; }
}

/* Status chips (icon + text: never colour alone) */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px/1 var(--font-mono); letter-spacing: .04em;
  padding: 6px 9px; border-radius: 999px; white-space: nowrap;
  color: var(--skip); background: var(--skip-bg);
}
.chip .icon { width: 14px; height: 14px; }
.chip.ok, .s-ok { color: var(--ok); }
.chip.ok { background: var(--ok-bg); }
.chip.warn, .s-warn { color: var(--warn); }
.chip.warn { background: var(--warn-bg); }
.chip.fail, .s-fail { color: var(--fail); }
.chip.fail { background: var(--fail-bg); }
.chip.info { color: var(--brand-bright); background: var(--brand-soft); }

/* Key/value lists */
.kv { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.kv dt:first-child { margin-top: 0; }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.kv dd.mono { font-size: 13.5px; }
@media (min-width: 560px) {
  .kv { grid-template-columns: minmax(120px, 34%) 1fr; }
  .kv dt { margin-top: 0; padding: 7px 0; border-bottom: 1px solid rgba(34, 50, 79, .6); }
  .kv dd { padding: 7px 0; border-bottom: 1px solid rgba(34, 50, 79, .6); }
  .kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
}
.list { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 6px; }

.code-value {
  display: block; font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; word-break: break-all;
}

/* Skeletons */
.skeleton {
  display: inline-block; height: 1em; width: 12ch; border-radius: 4px; vertical-align: -2px;
  background: linear-gradient(90deg, #17243C 0%, #213252 50%, #17243C 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ Pages */

.page { display: grid; gap: 24px; }
.page.narrow { max-width: 860px; }
.page-head { display: grid; gap: 8px; max-width: 760px; }
.page-head h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 750; outline: none; }
.eyebrow { font: 600 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brand-bright); }
.lead { color: var(--text-2); font-size: 16px; }
.illustration { width: 100%; height: auto; opacity: .9; }
.empty-state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 18px; color: var(--muted); }
.empty-state img { width: min(320px, 80%); height: auto; }

.prose h2 { font-size: 17px; margin: 22px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 18px; margin: 0; display: grid; gap: 8px; }
.about-grid { display: grid; gap: 16px; }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1.6fr 1fr; } }
.brand-card { display: grid; gap: 10px; text-align: center; }
.parent-logo { background: #fff; border-radius: 10px; padding: 12px; display: grid; place-items: center; }
.parent-logo img { width: min(220px, 100%); height: auto; }

/* ------------------------------------------------------------ Console */

.console-section { display: grid; gap: 14px; }
.console {
  background: linear-gradient(180deg, rgba(14, 23, 41, .96), rgba(8, 14, 26, .98));
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(94, 162, 238, .04), 0 24px 60px -30px rgba(0, 0, 0, .8), 0 0 80px -40px rgba(61, 129, 208, .35);
  overflow: hidden;
  min-width: 0;
}
.console-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: rgba(21, 34, 58, .55);
  font: 600 11.5px/1.2 var(--font-mono); letter-spacing: .1em; color: var(--text-2);
}
.console-bar .lights { display: flex; gap: 6px; }
.console-bar .lights i { width: 9px; height: 9px; border-radius: 50%; background: #2A3B5C; display: block; }
.console-bar .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-mark { width: 22px; height: 22px; }
.console-mark.active circle { animation: dotpulse 1.2s ease-in-out infinite; }
.console-mark.active circle.r1 { animation-delay: .15s; }
.console-mark.active circle.r2 { animation-delay: .3s; }
.console-mark.active circle.r3 { animation-delay: .45s; }
@keyframes dotpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.console-body {
  padding: 16px 14px 18px;
  font: 400 13px/1.7 var(--font-mono);
  color: #CFE0F7;
}
.c-line { display: flex; flex-wrap: wrap; gap: 0 10px; min-height: 1.7em; }
.c-key { color: var(--muted); white-space: pre; }
.c-val { color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.c-dim { color: var(--muted); }
.c-accent { color: var(--brand-bright); }
.c-gap { height: 10px; }
.ipline { display: grid; gap: 2px; }
.ipline .row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ipline .copy-inline {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; min-height: 26px;
  border: 1px solid var(--border-strong); border-radius: 6px; background: transparent; cursor: pointer;
  font: 600 11px/1 var(--font-mono); color: var(--text-2); letter-spacing: .04em;
}
.ipline .copy-inline:hover { color: var(--text); border-color: var(--brand); }
.ipline .copy-inline.copied { color: var(--ok); border-color: var(--ok); }
.ipline .copy-inline .icon { width: 13px; height: 13px; }

.prompt-form { display: grid; gap: 12px; margin-top: 14px; }
.prompt {
  display: flex; align-items: center; gap: 10px;
  background: rgba(5, 9, 17, .7); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 0 12px; min-height: 52px;
}
.prompt:focus-within { border-color: var(--brand-bright); box-shadow: 0 0 0 3px var(--brand-soft); }
.prompt .ps1 { color: var(--brand-bright); font-weight: 700; user-select: none; }
.prompt input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none; padding: 12px 0;
  font: 500 16px/1.2 var(--font-mono); color: #fff; caret-color: var(--brand-bright);
}
.prompt input::placeholder { color: #50627F; }
.prompt .cursor { width: 9px; height: 18px; background: var(--brand-bright); animation: blink 1.05s steps(1) infinite; }
.prompt input:focus ~ .cursor, .prompt input:not(:placeholder-shown) ~ .cursor, .prompt.idle-off .cursor { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.prompt-form .btn-primary { min-height: 50px; }
@media (min-width: 640px) { .prompt-form { grid-template-columns: 1fr auto; } }
.hint-examples { display: none; }
@media (min-width: 640px) { .hint-examples { display: inline; } }
.form-error { color: var(--warn); font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.form-error .icon { width: 16px; height: 16px; margin-top: 2px; }

.c-output { margin-top: 14px; display: grid; gap: 0; }
.c-output:empty { display: none; }
.stage-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; animation: lineIn .22s ease-out both; }
.stage-line .num { color: var(--muted); flex: none; }
.stage-line .name { flex: none; white-space: nowrap; }
.stage-line .leader { flex: 1 1 12px; min-width: 12px; border-bottom: 1px dotted #33476B; transform: translateY(-4px); }
.stage-line .res { flex: none; display: inline-flex; gap: 10px; white-space: nowrap; font-weight: 600; }
.stage-line .res .ms { color: var(--text-2); font-weight: 400; }
.stage-line.pending .res { color: var(--muted); font-weight: 400; }
.stage-line.running .res::after { content: "▍"; color: var(--brand-bright); animation: blink .8s steps(1) infinite; }
.stage-sub { color: var(--muted); padding-left: 6ch; animation: lineIn .22s ease-out both; }
.result-line { margin-top: 10px; font-weight: 700; letter-spacing: .03em; animation: lineIn .22s ease-out both; }
.result-msg { color: var(--text-2); animation: lineIn .22s ease-out both; }
@keyframes lineIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (max-width: 420px) {
  .console-body { font-size: 12px; padding: 14px 12px 16px; }
  .stage-line .res .ms { display: none; }
}

.boot .boot-line { opacity: 0; animation: lineIn .2s ease-out forwards; }

.shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
.shortcut {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; min-height: 40px;
  border: 1px solid var(--border); border-radius: 999px; background: rgba(17, 27, 46, .7);
  color: var(--text-2); text-decoration: none; font: 600 12.5px/1 var(--font-mono); letter-spacing: .06em;
}
.shortcut:hover { color: var(--text); border-color: var(--brand); background: var(--surface-2); }
.shortcut .icon { width: 15px; height: 15px; color: var(--brand-bright); }

.home-grid { display: grid; gap: 20px; }
.layers-intro { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layers-intro .item { background: rgba(17, 27, 46, .6); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.layers-intro .item strong { display: flex; align-items: center; gap: 8px; font: 700 12.5px/1.2 var(--font-mono); letter-spacing: .08em; color: var(--text); }
.layers-intro .item strong .icon { width: 15px; height: 15px; color: var(--brand-bright); }
.layers-intro .item p { font-size: 13px; color: var(--muted); margin-top: 6px; }
@media (min-width: 900px) { .layers-intro { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------------------------------------------------ Report */

.report { display: grid; gap: 16px; scroll-margin-top: calc(var(--header-h) + 12px); }
.reveal { animation: cardIn .3s ease-out both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.summary { display: grid; gap: 16px; }
.summary-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.verdict { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.verdict .icon { width: 30px; height: 30px; stroke-width: 1.6; margin-top: 2px; }
.verdict h2 { font: 750 clamp(18px, 3.6vw, 24px)/1.2 var(--font-mono); letter-spacing: .02em; }
.verdict p { color: var(--text-2); margin-top: 4px; }
.verdict .notes { margin: 6px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13.5px; display: grid; gap: 2px; }
.summary-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--border); padding-top: 14px; }
.summary-meta div { min-width: 0; }
.summary-meta span { display: block; font-size: 12px; color: var(--muted); }
.summary-meta strong { display: block; font: 500 13.5px/1.4 var(--font-mono); overflow-wrap: anywhere; }
@media (min-width: 900px) { .summary-meta { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.layer-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .layer-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .layer-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.layer {
  position: relative; display: grid; gap: 6px; text-align: left; cursor: help;
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--skip);
  border-radius: 10px; padding: 12px; min-width: 0;
}
.layer.ok { border-top-color: var(--ok); }
.layer.warn { border-top-color: var(--warn); }
.layer.fail { border-top-color: var(--fail); }
.layer .lname { font: 700 12px/1 var(--font-mono); letter-spacing: .12em; color: var(--text-2); }
.layer .lstate { display: flex; align-items: center; gap: 6px; font: 650 13px/1.25 var(--font-mono); overflow-wrap: anywhere; }
.layer .lstate .icon { width: 16px; height: 16px; }
.layer .lms { font: 400 12px/1 var(--font-mono); color: var(--muted); min-height: 12px; }
.layer .tip {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px; font-size: 12.5px; line-height: 1.45; color: var(--text); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-2px); transition: opacity .12s, transform .12s, visibility .12s;
  min-width: 200px;
}
.layer:hover .tip, .layer:focus-visible .tip, .layer:focus .tip { opacity: 1; visibility: visible; transform: none; }
.layer-strip .layer:nth-child(2n) .tip { left: auto; right: 0; }

.cards { display: grid; gap: 16px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card .msg { color: var(--text-2); font-size: 13.5px; margin-bottom: 12px; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: hop; }
.chain li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline;
  font: 400 12.5px/1.45 var(--font-mono); background: var(--console); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px;
}
.chain li::before { counter-increment: hop; content: counter(hop); color: var(--muted); }
.chain .u { overflow-wrap: anywhere; word-break: break-all; min-width: 0; }
.chain .st { font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--console); border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-width: 0; }
.stat span { display: block; font-size: 11.5px; color: var(--muted); }
.stat strong { display: block; font: 650 16px/1.3 var(--font-mono); overflow-wrap: anywhere; }

details.raw { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
details.raw summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
details.raw summary::-webkit-details-marker { display: none; }
details.raw summary .icon { transition: transform .15s; color: var(--muted); }
details.raw[open] summary .icon { transform: rotate(90deg); }
details.raw pre {
  margin: 0; padding: 14px 18px 18px; border-top: 1px solid var(--border);
  font: 400 12.5px/1.6 var(--font-mono); color: #BCD0EC; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 520px; overflow: auto;
}
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------ Tables (stack on mobile) */

.table-wrap { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font: 600 11.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2); padding: 11px 12px;
}
table.data td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; min-width: 0; }
table.data td.mono { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; word-break: break-word; }
table.data td.type { font: 700 12.5px var(--font-mono); color: var(--brand-bright); white-space: nowrap; }
table.data td.act { width: 1%; white-space: nowrap; }
@media (max-width: 719px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border-top: 1px solid var(--border); padding: 8px 0; }
  table.data tr:first-child { border-top: 0; }
  table.data td { border: 0; padding: 4px 12px; display: grid; grid-template-columns: 70px 1fr; gap: 10px; }
  table.data td::before { content: attr(data-label); font: 600 11px/1.6 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  table.data td.act { width: 100%; }
}

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
}
.banner .icon { width: 22px; height: 22px; margin-top: 1px; }
.banner strong { display: block; font-family: var(--font-mono); letter-spacing: .03em; }
.banner p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.banner.ok { border-color: rgba(63, 191, 111, .35); }
.banner.warn { border-color: rgba(229, 165, 55, .4); }
.banner.fail { border-color: rgba(242, 100, 95, .4); }

.tool-layout { display: grid; gap: 20px; }
@media (min-width: 1000px) {
  .tool-layout.has-aside { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}
.tool-aside img { width: 100%; height: auto; }
@media (max-width: 999px) { .tool-aside { display: none; } }
.spinner-line { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); color: var(--text-2); }
.spinner { width: 18px; height: 18px; }
.spinner circle { animation: dotpulse 1.2s ease-in-out infinite; }

/* My IP */
.myip-hero { display: grid; gap: 14px; }
.big-ip {
  font: 700 clamp(24px, 6.4vw, 44px)/1.15 var(--font-mono); letter-spacing: .01em;
  overflow-wrap: anywhere; word-break: break-all; color: #fff;
}
.big-ip.v6 { font-size: clamp(18px, 4.4vw, 32px); }
.big-ip.none { color: var(--muted); font-size: clamp(20px, 4vw, 28px); }
.proto { display: flex; flex-wrap: wrap; gap: 8px; }

/* Trace */
.route { list-style: none; margin: 0; padding: 0; position: relative; }
.route li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding-bottom: 14px; animation: lineIn .2s ease-out both; }
.route li::before { content: ""; position: absolute; left: 21px; top: 30px; bottom: -2px; width: 2px; background: var(--border-strong); }
.route li:last-child::before { display: none; }
.route .hopn {
  width: 44px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  font: 700 13px var(--font-mono); background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2);
}
.route li.dest .hopn { background: var(--brand); border-color: var(--brand); color: #fff; }
.route li.silent .hopn { border-style: dashed; color: var(--muted); }
.route .hop-body { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.route .hop-host { font: 600 13.5px/1.4 var(--font-mono); overflow-wrap: anywhere; }
.route .hop-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.route .rtts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.route .rtt { font: 500 12px/1 var(--font-mono); padding: 5px 7px; border-radius: 6px; background: var(--console); border: 1px solid var(--border); }
.route .rtt.to { color: var(--muted); }

/* ------------------------------------------------------------ Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .prompt .cursor, .console-mark.active circle, .skeleton { animation: none !important; }
  .boot .boot-line { opacity: 1; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .shortcuts, .prompt-form, .report-actions { display: none !important; }
}
