* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #10203a;
  --muted: #5b6b83;
  --brand: #2463eb;
  --brand-dark: #174bc4;
  --border: #dfe6f0;
  --ok: #0e9f6e;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(16, 32, 58, .06);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1080px, 92%); margin: 0 auto; }

.site-header { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.brand-dot { color: var(--brand); }
.brand:hover { text-decoration: none; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: .92rem; font-weight: 600; }
.nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }

.site-footer { background: var(--card); border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding: 28px 0; }
.footer-col { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.footer-col strong { margin-bottom: 4px; }
.footer-col p { color: var(--muted); }
.footer-col span { color: var(--muted); }

main.site-main { padding: 28px 0 48px; }

/* Hero / IP card */
.hero { text-align: center; padding: 8px 0 28px; }
.hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.hero .sub { color: var(--muted); margin-top: 6px; }

.ip-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; text-align: center; margin-bottom: 24px;
}
.ip-address { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.02em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.ip-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); margin-bottom: 10px; }
.actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 9px;
  font-weight: 700; font-size: .92rem; border: 1px solid transparent; cursor: pointer;
  background: var(--brand); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-outline { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: .84rem; }

.banner { padding: 12px 16px; border-radius: 10px; font-size: .92rem; margin-bottom: 24px; display: flex; gap: 10px; align-items: center; }
.banner-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.banner-info { background: #e0f2fe; color: #0c4a6e; border: 1px solid #bae6fd; }
.banner-ok { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* Info grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2 { font-size: 1.05rem; margin-bottom: 14px; }
.card h3 { font-size: .95rem; margin: 18px 0 8px; }

.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef2f8; font-size: .92rem; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--muted); }
.info-row .v { font-weight: 600; text-align: right; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab { padding: 9px 18px; font-weight: 700; font-size: .92rem; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Map */
.map-wrap { height: 340px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.map-placeholder { height: 340px; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; background: #eef2f8; color: var(--muted); border-radius: var(--radius); }
.leaflet-container { font-family: inherit; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-bad { background: #fee2e2; color: #991b1b; }
.badge-muted { background: var(--bg); color: var(--muted); }

/* Tools grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tool-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.tool-tile:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.tool-tile .tool-icon { font-size: 1.4rem; }
.tool-tile strong { font-size: .96rem; }
.tool-tile span { color: var(--muted); font-size: .84rem; }

/* Forms */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.input, .select {
  flex: 1; min-width: 240px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px;
  font-size: .95rem; background: var(--card); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: .95rem; }
.faq details p { margin-top: 10px; color: var(--muted); font-size: .92rem; }

/* Blog */
.article { max-width: 720px; }
.article .article-meta { color: var(--muted); font-size: .85rem; margin: 10px 0 18px; }
.article article h2 { font-size: 1.25rem; margin: 22px 0 8px; }
.article article h3 { font-size: 1.05rem; margin: 16px 0 6px; }
.article article p, .article article li { color: #334155; margin-bottom: 10px; }
.article article ul, .article article ol { padding-left: 22px; margin-bottom: 10px; }
.article article code { background: #eef2f8; padding: 2px 6px; border-radius: 5px; font-size: .9em; }

.result-box { overflow-x: auto; }
.result-box pre { background: #0b1526; color: #d7e3f4; padding: 16px; border-radius: 10px; font-size: .82rem; line-height: 1.5; max-height: 480px; overflow: auto; }

.spin-row { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.speed-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 18px 0; }
.speed-metric { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.speed-metric .num { font-size: 1.7rem; font-weight: 800; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.speed-metric .lbl { color: var(--muted); font-size: .85rem; }
.speed-bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.speed-bar > div { height: 100%; background: var(--brand); width: 0; transition: width .3s; }

.blog-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.blog-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); }
.blog-card:hover { border-color: var(--brand); text-decoration: none; }
.blog-card .lvl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.blog-card h3 { margin: 6px 0; }
.blog-card p { color: var(--muted); font-size: .88rem; }

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.5rem; }
}