/* Brnchost IDC Panel */
:root {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #15171a;
  --ink-2: #3c4047;
  --muted: #6e727a;
  --line: #e3e1da;
  --line-2: #d3d0c7;
  --rx: #0f8b8d;
  --tx: #2a62c9;
  --brand: #2a62c9;
  --logo-light: inline-block;
  --logo-dark: none;
  --wm: url("logo-color.webp");
  --wm-op: .07;
  --drop: #e5484d;
  --ok: #18794e;
  --ok-bg: #e6f4ec;
  --warn: #a35200;
  --warn-bg: #fdf0dc;
  --bad: #c62a2f;
  --bad-bg: #fdecec;
  --focus: #2a62c9;
  --radius: 6px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e11; --surface: #13161a; --surface-2: #181b20; --ink: #ecedef; --ink-2: #c3c6cc;
    --muted: #8a8f98; --line: #23272d; --line-2: #31363d; --rx: #2dc6c8; --tx: #6b9bff; --brand: #6b9bff; --logo-light: none; --logo-dark: inline-block; --wm: url("logo-white.webp"); --wm-op: .05; --drop: #ff6369;
    --ok: #4cc38a; --ok-bg: #12261c; --warn: #f1a10d; --warn-bg: #2a2010; --bad: #ff6369; --bad-bg: #2d1416;
    --focus: #6b9bff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e11; --surface: #13161a; --surface-2: #181b20; --ink: #ecedef; --ink-2: #c3c6cc;
  --muted: #8a8f98; --line: #23272d; --line-2: #31363d; --rx: #2dc6c8; --tx: #6b9bff; --brand: #6b9bff; --logo-light: none; --logo-dark: inline-block; --wm: url("logo-white.webp"); --wm-op: .05; --drop: #ff6369;
  --ok: #4cc38a; --ok-bg: #12261c; --warn: #f1a10d; --warn-bg: #2a2010; --bad: #ff6369; --bad-bg: #2d1416;
  --focus: #6b9bff; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 28px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); margin: 2px 0 0; font-size: 13.5px; }
.eyebrow { margin: 0 0 4px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon-btn svg, .shield svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- butonlar & form ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); font: 500 13.5px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn-solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-ghost { background: transparent; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink-2); }
.icon-btn.spin svg { animation: spin .8s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
.select, .input {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: 13.5px var(--sans);
}
.input { min-width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button {
  height: 32px; padding: 0 12px; border: 0; border-right: 1px solid var(--line); background: transparent;
  color: var(--muted); font: 500 12.5px var(--mono); cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 30px; height: 18px; border-radius: 9px; background: var(--line-2); position: relative; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.toggle input:checked + span { background: var(--ok); }
.toggle input:checked + span::after { transform: translateX(12px); }
.toggle input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- üst alan ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; align-items: center; gap: 28px; height: 60px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 4px; font: 600 18px var(--mono); text-decoration: none; letter-spacing: -0.03em; }
.wordmark i { color: var(--muted); font-style: normal; font-weight: 400; }
.wordmark b { color: var(--rx); font-weight: 600; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 100%;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs em { font: 600 11px/18px var(--mono); font-style: normal; padding: 0 6px; border-radius: 9px; background: var(--bad); color: #fff; }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.service-row { display: flex; align-items: center; gap: 20px; min-height: 52px; border-top: 1px dashed var(--line); flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.svc { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.svc-label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.svc strong { font-weight: 600; }
.svc-host { font: 13px var(--mono); color: var(--muted); }
.ip-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.ip-switch button, .ip-switch select {
  height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: transparent; color: var(--ink-2); font: 500 13px var(--mono); cursor: pointer;
}
.ip-switch button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }
.status-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 15px; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.status-pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.status-pill.bad i { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.demo-note { margin-top: 16px; font: 12.5px var(--mono); color: var(--warn); }
#errorBox { margin-top: 16px; }
.alert { padding: 12px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 13.5px; border: 1px solid transparent; }

main.wrap { padding-top: 24px; padding-bottom: 40px; }
.view > * + * { margin-top: 20px; }

/* ---------- panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 4px; flex-wrap: wrap; }
.chart { height: 340px; padding: 0 8px 8px; }
.chart-md { height: 260px; }
.chart-sm { height: 240px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- hero (genel bakış) ---------- */
.hero {
  display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.hero-state { display: flex; gap: 18px; align-items: center; padding: 28px; border-right: 1px solid var(--line); }
.hero h1 { font-size: 26px; }
.shield { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.shield svg { width: 32px; height: 32px; }
.hero.under-attack .shield { background: var(--bad-bg); color: var(--bad); animation: pulse 1.4s infinite; }
.hero.under-attack .shield .tick { display: none; }
.readouts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.readouts > div { padding: 28px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.readouts > div:last-child { border-right: 0; }
.readouts dt, .cells dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.readouts dd { margin: 8px 0 0; display: flex; flex-direction: column; }
.readouts dd span { font: 600 24px/1.1 var(--mono); letter-spacing: -0.03em; }
.readouts dd small, .cells small { font: 12px var(--mono); color: var(--muted); margin-top: 4px; }
.readouts .danger dd span, .cells .danger dd { color: var(--drop); }
.unit { font-size: .55em; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }

/* ---------- KPI ızgarası ---------- */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.kpi { background: var(--surface); padding: 18px 20px; min-height: 104px; }
.kpi .k-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .k-label::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--k, var(--line-2)); }
.kpi .k-val { font: 600 26px/1.2 var(--mono); margin-top: 10px; letter-spacing: -0.03em; }
.kpi .k-sub { font: 12px var(--mono); color: var(--muted); margin-top: 4px; }

/* ---------- saldırı türleri ---------- */
.typebars { padding: 12px 20px 20px; display: grid; gap: 12px; }
.typebar { display: grid; grid-template-columns: 160px 1fr 48px; gap: 12px; align-items: center; font-size: 13.5px; }
.typebar .bar { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.typebar .bar i { display: block; height: 100%; background: var(--drop); }
.typebar b { font: 600 13px var(--mono); text-align: right; }
/* ---------- kaynak ülkeler ---------- */
.countries { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; padding: 8px 20px 20px; }
.country {
  display: grid; grid-template-columns: 22px 34px minmax(90px, 1fr) 2fr 52px; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.country .rank { font: 500 12px var(--mono); color: var(--muted); }
.cc {
  display: inline-grid; place-items: center; width: 30px; height: 20px; border-radius: 3px;
  font: 600 11px var(--mono); letter-spacing: .04em; background: var(--surface-2); border: 1px solid var(--line-2);
}
.country .c-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country .c-name small { display: block; font: 11.5px var(--mono); color: var(--muted); }
.country .bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.country .bar i { display: block; height: 100%; background: var(--tx); border-radius: 3px; }
.country b { font: 600 13px var(--mono); text-align: right; }
.cc-list { display: inline-flex; gap: 4px; align-items: center; }
.cc-list em { font: 500 11.5px var(--mono); font-style: normal; color: var(--muted); }
.drawer-body .countries { grid-template-columns: 1fr; padding: 0; }
.drawer-body .country { grid-template-columns: 34px minmax(90px, 1fr) 1.4fr 70px; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- tablolar ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.tbl th button { all: unset; cursor: pointer; }
.tbl th button:focus-visible { outline: 2px solid var(--focus); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .mono { font-family: var(--mono); font-size: 13px; }
.tbl .num { font-family: var(--mono); text-align: right; }
.tbl th.num { text-align: right; }
.tbl-compact td, .tbl-compact th { padding: 10px 16px; }
.tag { display: inline-block; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 3px; font: 500 12px var(--mono); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 12px; font: 600 12px var(--sans); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.blocked { background: var(--ok-bg); color: var(--ok); }
.badge.detected { background: var(--warn-bg); color: var(--warn); }
.badge.ongoing { background: var(--bad-bg); color: var(--bad); }
.badge.ongoing::before { animation: pulse 1s infinite; }
.link-btn { all: unset; cursor: pointer; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.link-btn:hover { border-color: var(--ink); }
.link-btn:focus-visible { outline: 2px solid var(--focus); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font: 12.5px var(--mono); color: var(--muted); flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }

/* ---------- hat takibi ---------- */
.live-strip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ls-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 600; }
.ls-head .muted { font: 12px var(--mono); margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); animation: pulse 2s infinite; }
.cells { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; }
.cells > div { padding: 18px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.cells > div:last-child { border-right: 0; }
.cells dd { margin: 8px 0 0; font: 600 22px/1.1 var(--mono); letter-spacing: -0.03em; }

/* ---------- saldırı geçmişi ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; border-top: 3px solid var(--s, var(--line-2)); }
.stat .s-label { font-size: 13px; color: var(--muted); }
.stat .s-val { font: 600 32px/1.2 var(--mono); margin-top: 8px; letter-spacing: -0.03em; display: flex; align-items: baseline; gap: 8px; }
.stat .s-sub { font: 12px var(--mono); color: var(--muted); margin-top: 6px; }
.new-tag { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 3px; background: var(--bad-bg); color: var(--bad); }
.wrap-head { align-items: center; padding-bottom: 16px; }

/* ---------- çekmece ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 15, .45); opacity: 0; transition: opacity .2s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface);
  border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font: 600 18px var(--mono); }
.drawer-body { overflow-y: auto; padding: 20px 24px 32px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0; }
.kv > div { background: var(--surface); padding: 12px 14px; }
.kv dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kv dd { margin: 4px 0 0; font: 500 14px var(--mono); word-break: break-all; }
.drawer-body h3 { font-size: 14px; margin: 24px 0 8px; }
.mini-chart { height: 220px; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- giriş kapısı ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.gate-card h1 { font-size: 22px; margin: 24px 0 8px; }
.gate-card p { color: var(--muted); margin: 0 0 24px; }
.gate-card .btn + .btn { margin-left: 8px; }

.foot { display: flex; justify-content: space-between; padding-bottom: 32px; font: 12px var(--mono); color: var(--muted); }

/* ApexCharts */
.apexcharts-tooltip { font-family: var(--mono) !important; }
.apexcharts-text, .apexcharts-legend-text { font-family: var(--mono) !important; }

/* ---------- duyarlı ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-state { border-right: 0; border-bottom: 1px solid var(--line); }
  .cells { grid-template-columns: repeat(3, 1fr); }
  .cells > div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .top-row { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; height: 44px; }
  .tabs a { white-space: nowrap; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .stat-row, .countries { grid-template-columns: 1fr; }
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .readouts > div:nth-child(2) { border-right: 0; }
  .readouts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .status-pill { margin-left: 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .cells { grid-template-columns: repeat(2, 1fr); }
  .chart { height: 280px; }
  .typebar { grid-template-columns: 110px 1fr 36px; }
  .country { grid-template-columns: 34px 1fr 1fr 44px; }
  .country .rank { display: none; }
  .input { min-width: 0; width: 100%; }
  .top-actions .btn { padding: 0 10px; }
  h1 { font-size: 24px; }
}

/* ---------- marka ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand .logo { height: 30px; width: auto; }
.brand .logo-on-light { display: var(--logo-light); }
.brand .logo-on-dark { display: var(--logo-dark); }
.brand-tag {
  font: 600 11px/1 var(--mono); letter-spacing: .14em; color: var(--brand);
  border: 1px solid var(--brand); border-radius: 3px; padding: 4px 6px;
}
.gate-card .brand .logo { height: 36px; }
.tabs a[aria-selected="true"] { border-bottom-color: var(--brand); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.btn-solid { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- bayraklar ---------- */
.flag {
  display: inline-block; width: 24px; height: 18px; border-radius: 2px; overflow: hidden; flex: none;
  background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-2); vertical-align: middle; position: relative;
}
.flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flag.no-img::after {
  content: attr(data-code); position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 9px var(--mono); color: var(--ink-2);
}
.cc-list { gap: 5px; }
.country { grid-template-columns: 22px 26px minmax(90px, 1fr) 2fr 56px; }
.drawer-body .country { grid-template-columns: 26px minmax(90px, 1fr) 1.4fr 70px; }

/* ---------- mobil: tablolar kart görünümüne geçer ---------- */
@media (max-width: 720px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .tbl.stack tbody tr:last-child { border-bottom: 0; }
  .tbl.stack tbody tr:hover td { background: transparent; }
  .tbl.stack td {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 5px 0; border: 0; white-space: normal; text-align: right;
  }
  .tbl.stack td::before {
    content: attr(data-label); flex: none; text-align: left;
    font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  }
  .tbl.stack td.num { text-align: right; }
  .tbl.stack td.row-head { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
  .tbl.stack td.row-head::before { display: none; }
  .tbl.stack td.row-head { font-weight: 600; }
  .tbl.stack td.row-act { padding-top: 10px; justify-content: flex-end; }
  .tbl.stack td.row-act::before { display: none; }
  .tbl.stack td.row-act .link-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 36px;
    border: 1px solid var(--line-2); border-radius: var(--radius);
  }
  .tbl.stack .empty { width: 100%; }

  .top-actions .btn-ghost { font-size: 12.5px; padding: 0 10px; }
  .service-row { gap: 10px; }
  .svc { width: 100%; }
  .page-head .controls, .wrap-head .controls { width: 100%; }
  .wrap-head .controls .input { flex: 1 1 100%; }
  .wrap-head .controls .select { flex: 1 1 calc(50% - 4px); }
  .wrap-head .controls .btn { flex: 1 1 100%; justify-content: center; }
  .seg { max-width: 100%; overflow-x: auto; }
  .page-head .controls .seg { flex: 1 1 100%; }
  .page-head .controls .seg button { flex: 1; }
  .hero-state { padding: 20px; }
  .readouts > div { padding: 16px; }
  .readouts dd span { font-size: 20px; }
  .kpi { padding: 14px 16px; min-height: 0; }
  .kpi .k-val { font-size: 22px; }
  .stat .s-val { font-size: 26px; }
  .panel-head { padding: 16px 16px 4px; }
  .countries { padding: 4px 16px 16px; }
  .typebars { padding: 12px 16px 16px; }
  .typebar { grid-template-columns: minmax(0, 120px) 1fr 32px; }
  .typebar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pager { justify-content: center; }
  .foot { flex-direction: column; gap: 6px; }
}
@media (max-width: 420px) {
  .brand .logo { height: 24px; }
  .brand-tag { display: none; }
  .top-actions { gap: 6px; }
  .top-actions .btn-ghost { padding: 0 8px; }
  .readouts { grid-template-columns: 1fr 1fr; }
  .readouts dd span { font-size: 18px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .k-val { font-size: 19px; }
  .kpi .k-sub { font-size: 11px; }
  .cells dd { font-size: 18px; }
  .chart { height: 260px; }
  .chart-md, .chart-sm { height: 220px; }
  .country { grid-template-columns: 26px minmax(0, 1fr) 70px 46px; gap: 10px; }
}
.seg button { white-space: nowrap; }
@media (max-width: 720px) { .seg button { padding: 0 8px; } }

/* ---------- megamenü ---------- */
.tabs a { gap: 6px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .6; transition: transform .15s; }
.tabs a[aria-expanded="true"] { color: var(--ink); }
.tabs a[aria-expanded="true"] .chev { transform: rotate(180deg); opacity: 1; }
.top { position: sticky; }
.mega {
  position: absolute; left: 0; right: 0; top: 60px; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 48px -24px rgba(10, 20, 40, .28);
  animation: megaIn .14s ease-out;
}
@keyframes megaIn { from { opacity: 0; transform: translateY(-6px); } }
.mega-inner { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding-top: 24px; padding-bottom: 24px; }
.mega-intro { border-right: 1px solid var(--line); padding-right: 28px; display: flex; flex-direction: column; gap: 12px; }
.mega-intro p { margin: 0; color: var(--ink-2); font-size: 14px; }
.mega-intro .eyebrow { color: var(--brand); }
.mega-go { align-self: flex-start; }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; align-content: start; }
.mega-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--ink); border: 1px solid transparent;
}
.mega-item:hover, .mega-item:focus-visible { background: var(--surface-2); border-color: var(--line); }
.mi-icon {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
}
.mi-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mi-text b { display: block; font-weight: 600; font-size: 14px; }
.mi-text small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.mega-side { margin-top: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font: 12.5px var(--mono); color: var(--ink-2); display: grid; gap: 6px; }
.mega-side:empty { display: none; }
.mega-side div { display: flex; justify-content: space-between; gap: 12px; }
.mega-side span { color: var(--muted); }
.mega-backdrop { position: fixed; inset: 0; z-index: 15; background: rgba(10, 12, 15, .25); }
[id$="Panel"], #hero, #kpis { scroll-margin-top: 150px; }

@media (max-width: 860px) {
  .mega { top: auto; position: absolute; }
  .mega-inner { grid-template-columns: 1fr; gap: 12px; padding-top: 12px; padding-bottom: 16px; max-height: 70vh; overflow-y: auto; }
  .mega-intro { border-right: 0; padding-right: 0; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .mega-intro p:not(.eyebrow), .mega-side { display: none; }
  .mega-grid { grid-template-columns: 1fr; }
  .mega-item { padding: 10px 8px; }
}
@media (max-width: 720px) {
  .top { position: relative; }
  [id$="Panel"], #hero, #kpis { scroll-margin-top: 12px; }
}

/* ---------- animasyonlar ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes popIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 35%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }

.view.enter > * { animation: fadeUp .5s cubic-bezier(.2, .7, .2, 1) both; }
.view.enter > *:nth-child(2) { animation-delay: .06s; }
.view.enter > *:nth-child(3) { animation-delay: .12s; }
.view.enter > *:nth-child(4) { animation-delay: .18s; }
.view.enter > *:nth-child(5) { animation-delay: .24s; }
.view.enter > *:nth-child(6) { animation-delay: .30s; }
.view.enter > *:nth-child(n+7) { animation-delay: .36s; }

.view.enter .kpi, .view.enter .stat, .view.enter .readouts > div, .view.enter .cells > div { animation: fadeUp .45s cubic-bezier(.2, .7, .2, 1) both; }
.view.enter .kpi:nth-child(2), .view.enter .readouts > div:nth-child(2), .view.enter .cells > div:nth-child(2), .view.enter .stat:nth-child(2) { animation-delay: .08s; }
.view.enter .kpi:nth-child(3), .view.enter .readouts > div:nth-child(3), .view.enter .cells > div:nth-child(3), .view.enter .stat:nth-child(3) { animation-delay: .14s; }
.view.enter .kpi:nth-child(4), .view.enter .readouts > div:nth-child(4), .view.enter .cells > div:nth-child(4) { animation-delay: .20s; }
.view.enter .kpi:nth-child(5), .view.enter .cells > div:nth-child(5) { animation-delay: .26s; }
.view.enter .kpi:nth-child(6) { animation-delay: .32s; }
.view.enter .kpi:nth-child(7) { animation-delay: .38s; }
.view.enter .kpi:nth-child(8) { animation-delay: .44s; }

.typebar .bar i, .country .bar i { transform-origin: left; animation: growX .8s cubic-bezier(.2, .7, .2, 1) both .15s; }
.view.enter .shield { animation: popIn .5s cubic-bezier(.3, 1.4, .5, 1) both .1s, glow 2.4s ease-in-out 1s infinite; }
.hero.under-attack .shield { animation: pulse 1.4s infinite; }

.kpi, .stat, .mega-item, .btn, .icon-btn, .seg button, .tabs a, .tbl tbody td, .flag { transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(10, 20, 40, .35); }
.kpi:hover { background: var(--surface-2); }
.kpi:hover .k-label::before { transform: scale(1.6); }
.kpi .k-label::before { transition: transform .2s; }
.btn:active, .icon-btn:active, .seg button:active { transform: scale(.96); }
.mega-item:hover .mi-icon { transform: translateY(-1px) rotate(-4deg); }
.mi-icon { transition: transform .2s; }
.mega:not([hidden]) .mega-item { animation: fadeUp .28s ease-out both; }
.mega:not([hidden]) .mega-item:nth-child(2) { animation-delay: .03s; }
.mega:not([hidden]) .mega-item:nth-child(3) { animation-delay: .06s; }
.mega:not([hidden]) .mega-item:nth-child(4) { animation-delay: .09s; }
.mega:not([hidden]) .mega-item:nth-child(5) { animation-delay: .12s; }
.mega:not([hidden]) .mega-item:nth-child(n+6) { animation-delay: .15s; }
.flag:hover { transform: scale(1.18); }
.tbl.stack tbody tr, #logTbl tbody tr { animation: fadeUp .35s ease-out both; }
.status-pill.ok i { animation: pulse 2.4s infinite; }
.tabs a::after { content: ""; }
[data-live] { transition: color .3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- grafik filigranı (marka logosu) ---------- */
.chart, .mini-chart { position: relative; isolation: isolate; }
.chart::before, .mini-chart::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 52%; width: min(46%, 360px); aspect-ratio: 2000 / 454; transform: translate(-50%, -50%);
  background: var(--wm) center / contain no-repeat; opacity: var(--wm-op);
}
.chart-sm::before, .mini-chart::before { width: min(60%, 260px); }

/* ---------- mobil hamburger menü ---------- */
.menu-btn, .mnav { display: none; }
.menu-btn svg path { transition: transform .22s, opacity .18s; transform-origin: 12px 12px; }
.menu-btn[aria-expanded="true"] .l1 { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .l2 { opacity: 0; }
.menu-btn[aria-expanded="true"] .l3 { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 860px) {
  .tabs { display: none; }
  .menu-btn { display: inline-grid; }
  .top-actions .btn { display: none; }
  .top-row { flex-wrap: nowrap; height: 60px; padding-top: 0; }
  .mnav:not([hidden]) {
    display: block; position: absolute; left: 0; right: 0; top: 60px; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px -20px rgba(10, 20, 40, .35);
    max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain;
    animation: megaIn .18s ease-out;
  }
  .mnav-inner { padding: 8px 16px 16px; }
  .mnav-group { border-bottom: 1px solid var(--line); }
  .mnav-head {
    all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 14px 4px; cursor: pointer;
  }
  .mnav-head:focus-visible { outline: 2px solid var(--focus); border-radius: var(--radius); }
  .mnav-title { flex: 1; min-width: 0; }
  .mnav-title b { display: block; font-size: 15px; font-weight: 600; }
  .mnav-title small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mnav-group.current .mnav-title b { color: var(--brand); }
  .mnav-head .chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); transition: transform .2s; flex: none; }
  .mnav-head[aria-expanded="true"] .chev { transform: rotate(180deg); color: var(--ink); }
  .mnav-badge { font: 600 11px/18px var(--mono); font-style: normal; padding: 0 7px; border-radius: 9px; background: var(--bad); color: #fff; }
  .mnav-items:not([hidden]) { display: grid; gap: 2px; padding: 0 0 12px 46px; animation: fadeUp .22s ease-out; }
  .mnav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: var(--radius);
    color: var(--ink-2); text-decoration: none; font-size: 14px;
  }
  .mnav-item:active, .mnav-item:hover { background: var(--surface-2); color: var(--ink); }
  .mnav-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--brand); flex: none; }
  .mnav-open { justify-content: space-between; font-weight: 600; color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
  .mnav-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 16px; }
  .mnav-foot .btn { justify-content: center; }
  .mnav-foot .btn:first-child { grid-column: 1 / -1; }
  .menu-open-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 15, .35); z-index: 10; }
}
.country .c-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- IP devri notu ---------- */
#sinceNote { margin-top: 16px; }
.since-note {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  color: var(--ink-2); font-size: 13.5px;
}
.since-note svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- olay kaydı ---------- */
.ev-sum { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--line); }
.ev-sum > div { padding: 14px 20px; border-right: 1px solid var(--line); }
.ev-sum > div:last-child { border-right: 0; }
.ev-sum dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ev-sum dd { margin: 6px 0 0; font: 600 18px var(--mono); }
.ev-src { display: inline-flex; align-items: center; gap: 8px; }
.ev-port small { color: var(--muted); margin-left: 4px; font-size: 11.5px; }
.ev-note { padding: 10px 16px; font: 12px var(--mono); color: var(--muted); border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .ev-sum { grid-template-columns: 1fr 1fr; }
  .ev-sum > div:nth-child(2) { border-right: 0; }
  .ev-sum > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ev-sum dd { font-size: 15px; }
}
