/* ============================================================
   SONIC DSTAT — style.css v4
   Desain ulang: mobile-first, fluid, nyaman di Android,
   tablet, laptop, PC, dan mode desktop (Samsung DeX / DeX-like).
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0813;
  --panel: #12101e;
  --panel-2: #171327;
  --panel-3: #1c1730;

  --line: #262041;
  --line-soft: #1f1b33;

  --text: #f1edfc;
  --muted: #a49cbb;
  --faint: #7e7692;

  --purple: #a78bfa;
  --purple-deep: #7c5cf0;
  --pink: #f4589b;
  --red: #ff5c73;
  --green: #46e0a2;
  --amber: #fbbf24;

  --grad-brand: linear-gradient(115deg, #b48bff, #7c5cf0 55%, #5b8cf7);

  --header-h: 60px;
  --nav-h: 48px;
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --shadow-1: 0 8px 30px rgba(0, 0, 0, .28);
  --shadow-2: 0 22px 60px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px rgba(167, 139, 250, .16), 0 12px 40px rgba(124, 92, 240, .16);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}

/* Wide screens breathe more: bigger container only when there is room. */
@media (min-width: 1280px) { :root { --container: 1240px; } }
@media (min-width: 1536px) { :root { --container: 1400px; } }

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* offset anchor jump agar tidak ketutup header + nav yang sticky */
  scroll-padding-top: calc(var(--header-h) + var(--nav-h) + 16px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: break-word;
  background-image:
    radial-gradient(ellipse 90% 42% at 50% -4%, rgba(124, 92, 240, .16), transparent 70%),
    radial-gradient(ellipse 60% 38% at 92% 22%, rgba(244, 88, 155, .07), transparent 70%);
  background-attachment: fixed;
}

body.no-scroll { overflow: hidden; }

img, canvas, svg { max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

::selection { background: rgba(167, 139, 250, .35); }

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Ambient dot texture — subtle, GPU friendly */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(rgba(167, 139, 250, .8) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(#000, transparent 80%);
  -webkit-mask-image: linear-gradient(#000, transparent 80%);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--purple-deep);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  transition: top .2s;
}
.skip-link:focus { top: 10px; }

/* ---------- Layout helpers ---------- */
.wrap {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

main { position: relative; z-index: 1; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: var(--gutter);
  background: rgba(10, 8, 19, .82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  font-size: 16px;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--grad-brand);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(154, 100, 255, .45);
  flex: none;
}

.brand .purple { color: var(--purple); }

.top-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 16, 30, .7);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.top-status .clock { color: var(--faint); font-variant-numeric: tabular-nums; }

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
.pulse.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.pulse.err  { background: var(--red);   box-shadow: 0 0 10px var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Nav kategori (baris kedua, sticky, bisa discroll) ---------- */
.main-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px var(--gutter);
  background: rgba(10, 8, 19, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;           /* Firefox */
  -webkit-overflow-scrolling: touch;
}
.main-nav::-webkit-scrollbar { display: none; }

.main-nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .18s, background .18s, border-color .18s;
}
.main-nav a:hover { color: var(--text); background: rgba(124, 92, 240, .12); }
.main-nav a.active {
  color: #fff;
  background: var(--grad-brand);
  border-color: rgba(167, 139, 250, .4);
  box-shadow: 0 6px 18px rgba(124, 92, 240, .3);
}

/* ---------- Ad slots ---------- */
.ad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.ad-banner, .ad-slot {
  position: relative;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #3a3050;
  border-radius: var(--r-md);
  background: linear-gradient(140deg, #161224, #100d1a);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.ad-banner {
  grid-column: 1 / -1;
  min-height: 92px;
  border: 1px solid #4a2f72;
  background:
    radial-gradient(ellipse 80% 120% at 50% -20%, #4d2a78, #161020 72%);
}
.ad-banner span {
  font-weight: 900;
  font-size: clamp(18px, 3.4vw, 24px);
  letter-spacing: .1em;
  background: linear-gradient(100deg, #fff, #cbb2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ad-banner small, .ad-slot small { color: var(--muted); font-size: 11px; margin-top: 5px; }
.ad-slot b {
  position: absolute;
  top: 8px;
  left: 9px;
  border: 1px solid #3a3050;
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .08em;
}
.ad-slot strong { font-size: 13px; color: #b7afc8; font-weight: 700; }
.ad-banner:hover, .ad-slot:hover {
  border-color: rgba(167, 139, 250, .55);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(124, 92, 240, .2);
}
.ad-banner:active, .ad-slot:active { transform: translateY(0); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(44px, 9vw, 84px) 6px clamp(30px, 6vw, 56px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  color: #948bb0;
}
.hero .eyebrow {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(18, 16, 30, .7);
}

.hero h1 {
  margin: clamp(16px, 3vw, 26px) 0 12px;
  font-size: clamp(44px, 11vw, 88px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.055em;
}
.hero h1 .purple {
  background: linear-gradient(105deg, #c3a6ff, #8b5cf6 45%, #f4589b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(14px, 1.9vw, 17px);
  line-height: 1.75;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin: clamp(22px, 4vw, 34px) auto;
}
.feature-pills span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: #d4cde4;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.feature-pills i {
  font-style: normal;
  color: var(--purple);
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.primary-btn, .small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 12px 32px rgba(124, 92, 240, .32);
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.primary-btn {
  min-height: 52px;
  padding: 0 34px;
  border-radius: 16px;
  font-size: 16px;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(124, 92, 240, .42); }
.primary-btn:active { transform: translateY(0) scale(.98); }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(18, 16, 30, .6);
  color: #d4cde4;
  font-weight: 700;
  font-size: 15px;
  transition: border-color .18s, color .18s, background .18s;
}
.ghost-btn:hover { border-color: rgba(167, 139, 250, .5); color: #fff; background: rgba(124, 92, 240, .1); }

/* ---------- Stats strip ---------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 clamp(26px, 5vw, 44px);
}

.stats-strip > div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  position: relative;
  overflow: hidden;
}
.stats-strip > div::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: .55;
}
.stats-strip small {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
}
.stats-strip strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.stats-strip strong em { font-style: normal; font-size: 12px; color: var(--faint); font-weight: 600; margin-left: 4px; }

/* ---------- Panels ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-1);
}

/* ---------- Live chart panel ---------- */
.live-chart-panel {
  padding: clamp(16px, 3vw, 24px);
  margin: 0 0 clamp(26px, 5vw, 42px);
  border-color: #372c55;
  background:
    radial-gradient(ellipse 60% 90% at 100% 0%, rgba(124, 92, 240, .08), transparent 60%),
    linear-gradient(150deg, var(--panel-2), var(--panel) 70%);
  box-shadow: var(--shadow-2);
}

.chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-heading h2 { margin: 7px 0 4px; font-size: clamp(18px, 2.6vw, 23px); letter-spacing: -.03em; }
.chart-heading p { margin: 0; color: var(--faint); font-size: 12px; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid #285844;
  border-radius: 999px;
  background: rgba(16, 37, 30, .7);
  color: #80e6b2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
}

.chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px clamp(18px, 4vw, 40px);
  margin: 20px 0 12px;
}
.chart-summary div { display: grid; gap: 3px; }
.chart-summary small { font-size: 9.5px; letter-spacing: .13em; color: var(--faint); font-weight: 700; }
.chart-summary b { font-size: clamp(18px, 2.6vw, 22px); color: #f6f1ff; font-variant-numeric: tabular-nums; }
.chart-summary em { font-style: normal; font-size: 10px; color: var(--faint); }
.chart-summary .in b { color: #b79dff; }
.chart-summary .out b { color: #ff8ab5; }

.live-chart-wrap { position: relative; height: clamp(190px, 32vw, 260px); }

/* ---------- Section headings ---------- */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-heading h2 { margin: 6px 0 0; font-size: clamp(19px, 3vw, 25px); letter-spacing: -.035em; }

.count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-3);
  color: #b3a9c9;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Content grid (server list + sidebar) ---------- */
.content-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.content-grid > * { min-width: 0; } /* biar scrollable tabs tidak melebarkan kolom */

/* ---------- Host groups & rows ---------- */
.groups { display: grid; gap: 12px; }

.host-group {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: linear-gradient(150deg, #141021, #100d1b);
  overflow: hidden;
}
.host-group.collapsed .host-list { display: none; }

.group-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 8px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
}
.group-head:hover { background: rgba(124, 92, 240, .06); }
.group-head .count { margin-left: auto; }

.chev {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--purple);
  transition: transform .22s;
}
.host-group.collapsed .chev { transform: rotate(-90deg); }

.host-list { padding: 0 8px 10px; }

.host-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .16s, border-color .16s;
  -webkit-tap-highlight-color: transparent;
}
.host-row:last-child { border-bottom-color: transparent; }
.host-row:hover { background: #1b1629; border-color: #3c3160; }
.host-row.selected { background: #221a38; border-color: #57448a; }
.host-row:active { background: #241c3c; }

.host-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 12px currentColor;
  color: var(--purple);
}
.host-dot.red { background: var(--red); color: var(--red); }

.host-info { flex: 1; min-width: 0; }
.host-ip {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.host-provider {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.host-meta {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #5b4480;
  border-radius: 7px;
  background: #241a39;
  color: #c3a5ff;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.host-speed {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--pink);
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.host-speed small { font-size: 10px; color: var(--faint); font-weight: 600; }
.host-speed.dead { color: var(--faint); }

/* ---------- Sidebar ---------- */
.side-column { display: grid; gap: 14px; align-content: start; }

.side-panel { padding: 20px; }
.side-panel h3 { margin: 9px 0 14px; font-size: 16px; letter-spacing: -.01em; }

.metric-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
}
.metric-line:first-of-type { border-top: 0; }
.metric-line b { color: #e9e2f6; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
  color: #c9c1da;
  font-size: 13px;
  font-weight: 600;
}
.tool-link:first-of-type { border-top: 0; }
.tool-link span { color: var(--purple); }
.tool-link:hover { color: #fff; }

.join-panel {
  padding: 20px;
  border: 1px solid #3a2c58;
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 90% 120% at 0% 0%, rgba(124, 92, 240, .22), transparent 60%),
    linear-gradient(150deg, #211437, #151020);
}
.join-panel h3 { margin: 0 0 8px; font-size: 16px; }
.join-panel p { margin: 0 0 16px; font-size: 12.5px; color: #b0a7c4; line-height: 1.65; }

.small-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 12px;
  box-shadow: none;
}

/* ---------- Layer 7 ---------- */
.section-block { margin: clamp(40px, 7vw, 64px) 0; }

.l7-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

.l7-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
  overflow: hidden;
}
.l7-card > .group-head {
  min-height: 52px;
  padding: 6px 15px;
  font-size: 13px;
  letter-spacing: .02em;
  color: #cfc6e2;
}
.l7-list { padding: 2px 15px 10px; }
.l7-card.collapsed > .l7-list { display: none; }
.l7-card.collapsed > .group-head .chev { transform: rotate(-90deg); }

.l7-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .16s;
  -webkit-tap-highlight-color: transparent;
}
.l7-row:hover { background: #1b1629; }
.l7-row:active { background: #241c3c; }
.l7-row .host-info { flex: 1; }
.l7-rqps {
  flex: none;
  color: var(--pink);
  font-size: 13.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* grafik kecil di modal detail (Layer 7) */
.modal-chart-wrap {
  position: relative;
  width: 100%;
  height: clamp(150px, 34vw, 200px);
  margin-top: 14px;
}
.metric-box strong .st-on,
.metric-box strong.st-on { color: #4ade80; }
.metric-box strong .st-off,
.metric-box strong.st-off { color: var(--red); }

/* ---------- Leaderboard ---------- */
.leaderboard { padding: 6px 18px; }

.leader-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.leader-row:last-child { border-bottom: 0; }

.rank {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: #b9aee0;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rank-1 { border-color: #8a6d2f; background: linear-gradient(140deg, #3d2f10, #241b08); color: #ffd57a; }
.rank-2 { border-color: #6f7480; background: linear-gradient(140deg, #2e323a, #1e2126); color: #e3e9f2; }
.rank-3 { border-color: #8a5a3a; background: linear-gradient(140deg, #3a2412, #23150a); color: #ffb37a; }

.leader-row .host-info { flex: 1; min-width: 0; }
.leader-value {
  display: grid;
  justify-items: end;
  gap: 5px;
  flex: none;
}
.leader-value b { font-size: 13px; color: var(--pink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.leader-bar {
  width: clamp(48px, 12vw, 120px);
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.leader-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-brand);
}

/* ---------- Utilities / states ---------- */
.muted { color: var(--faint); font-size: 12.5px; }

.loading-card, .error-card {
  padding: 26px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.error-card { border-color: #5c2b3a; background: #1c1017; }
.error-card b { display: block; color: #ff9fb1; font-size: 14px; margin-bottom: 6px; }
.error-card .small-btn { margin-top: 14px; }

.skel-card {
  padding: 18px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--panel);
}
.skel-line {
  height: 12px;
  margin: 10px 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #1a1628 25%, #262040 50%, #1a1628 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skel-line.w60 { width: 60%; }
.skel-line.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
footer {
  margin-top: clamp(48px, 8vw, 84px);
  border-top: 1px solid var(--line-soft);
  padding: 22px 0 max(26px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}
footer b { color: #d6b8ff; }
footer .foot-brand { letter-spacing: .12em; font-weight: 700; font-size: 10.5px; }

/* ---------- Modal detail (bottom-sheet di mobile, dialog di desktop) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end; /* mobile: sheet dari bawah */
  justify-content: center;
  padding: 0;
}
.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 9, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.detail-card {
  position: relative;
  width: min(680px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(18px, 4vw, 28px);
  padding-bottom: max(clamp(18px, 4vw, 28px), env(safe-area-inset-bottom));
  border: 1px solid #3b3155;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(160deg, #16121f, #100d19 60%);
  box-shadow: var(--shadow-2);
  animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0; } }

/* Desktop: dialog terpusat */
@media (min-width: 761px) {
  .modal { align-items: center; padding: 18px; }
  .detail-card {
    max-height: min(88dvh, 900px);
    border-radius: 22px;
    border-bottom: 1px solid #3b3155;
  }
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -4px -4px 0 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(30, 25, 46, .9);
  color: #cfc6e2;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.modal-close:hover { color: #fff; border-color: #57448a; }

.detail-title { margin: 4px 44px 5px 0; font-size: clamp(18px, 4vw, 23px); letter-spacing: -.02em; }
.detail-sub { color: var(--faint); font-size: 12.5px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 14px;
}
.metric-box {
  padding: 13px 14px;
  border: 1px solid #312a48;
  border-radius: var(--r-md);
  background: var(--panel-2);
}
.metric-box small {
  display: block;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .11em;
}
.metric-box strong {
  font-size: clamp(17px, 3vw, 21px);
  font-weight: 750;
  color: #ffb3cf;
  font-variant-numeric: tabular-nums;
}
.metric-box strong em { font-style: normal; font-size: 11px; color: var(--faint); margin-left: 3px; font-weight: 600; }

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.modal-actions .ghost-btn { min-height: 44px; font-size: 13px; padding: 0 18px; }
.modal-actions .small-btn { min-height: 44px; }

.modal-note { margin: 14px 0 4px; }

/* ---------- Halaman detail ---------- */
.detail-main {
  position: relative;
  z-index: 1;
  padding: clamp(20px, 4vw, 44px) 0 30px;
}
.detail-main #detailPage { max-width: 820px; margin-inline: auto; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #c4b1ee;
  font-size: 13px;
  font-weight: 700;
  background: rgba(18, 16, 30, .7);
  transition: border-color .18s, color .18s;
}
.back-link:hover { border-color: #57448a; color: #fff; }

.detail-panel { padding: clamp(16px, 3vw, 22px); margin: 14px 0; }
.detail-panel h3 {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 800;
  color: #a89fce;
  letter-spacing: .14em;
}

.detail-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.detail-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
}

.detail-chart-wrap { position: relative; width: 100%; height: clamp(220px, 40vw, 300px); }
.detail-chart-wrap canvas { display: block; width: 100%; height: 100%; }
.chart-status { margin-top: 10px; font-size: 11.5px; color: var(--faint); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.info-cell {
  padding: 11px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .02);
}
.info-cell small {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .11em;
  margin-bottom: 4px;
}
.info-cell b { font-size: 13px; font-weight: 650; word-break: break-all; }

/* ---------- Responsive breakpoints ---------- */

/* Smartphone besar / tablet potrait */
@media (min-width: 640px) {
  .stats-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ad-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ad-banner { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  footer { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* Tablet landscape / laptop kecil */
@media (min-width: 900px) {
  :root { --header-h: 66px; --nav-h: 50px; }
  .host-row { min-height: 62px; }
  .l7-grid { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
}

/* Laptop / PC: dua kolom */
@media (min-width: 1024px) {
  .content-grid { grid-template-columns: minmax(0, 1.75fr) minmax(272px, .85fr); gap: 26px; }
  .hero h1 { font-size: clamp(64px, 7vw, 88px); }
}

/* PC / mode desktop besar */
@media (min-width: 1536px) {
  body { font-size: 15.5px; }
  .hero { padding-top: 92px; }
  .host-list { padding: 0 12px 12px; }
  .leaderboard { padding: 8px 22px; }
}

/* Touch: target sentuh lebih lega */
@media (pointer: coarse) {
  .host-row { min-height: 62px; padding: 12px 10px; }
  .main-nav a { min-height: 42px; }
  .tool-link, .back-link { min-height: 46px; }
}

/* Efek hover hanya untuk perangkat yang benar-benar punya hover */
@media (hover: none) {
  .host-row:hover { background: transparent; border-color: transparent; }
  .host-row:not(:last-child):hover { border-bottom-color: var(--line-soft); }
  .primary-btn:hover { transform: none; box-shadow: 0 12px 32px rgba(124, 92, 240, .32); }
}

/* Reduce motion: hormati preferensi pengguna */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .skel-line { animation: none; }
}

/* Mode desktop yang sempit (DeX / split screen): pastikan tak ada scroll horizontal */
@media (max-width: 400px) {
  .host-meta .tag { display: none; }
  .top-status .clock { display: none; }
  .hero h1 { font-size: clamp(40px, 13vw, 48px); }
}

/* Print */
@media print {
  .topbar, .main-nav, .ambient, .ad-grid, .modal, footer, .live-chart-wrap { display: none !important; }
  body { background: #fff; color: #111; }
  .panel, .host-group, .l7-card { border-color: #ccc; background: #fff; }
}

/* ============================================================
   v10 — Hamburger menu & drawer navigasi
   ============================================================ */
.menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, .08);
  border-color: #362d5c;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .22s ease, opacity .18s ease;
}

.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 2, 10, .62);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}

.nav-overlay.open { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 95;
  height: 100dvh;
  width: min(86vw, 330px);
  display: flex;
  flex-direction: column;
  padding:
    calc(16px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  transform: translateX(103%);
  transition: transform .28s ease;
}

.nav-drawer.open { transform: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-brand {
  font-weight: 800;
  letter-spacing: .04em;
  font-size: .95rem;
  color: var(--text);
}

.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.drawer-close:hover { background: rgba(255, 255, 255, .08); }

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.drawer-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
}

.drawer-link.active {
  color: #fff;
  background: linear-gradient(115deg, rgba(167, 139, 250, .22), rgba(124, 92, 240, .16));
  border-color: rgba(167, 139, 250, .45);
}

.drawer-link .dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.drawer-link.active .dot {
  background: var(--purple);
  box-shadow: 0 0 10px rgba(167, 139, 250, .8);
}

.drawer-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: .75rem;
  letter-spacing: .08em;
}

/* ============================================================
   v10 — Preview overview (top servers & Layer 7)
   ============================================================ */
.preview-grid {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.preview-panel { padding: 18px; }
.preview-panel .section-heading { margin-bottom: 12px; }
.preview-list { display: flex; flex-direction: column; }

a.preview-link {
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-md);
}

a.preview-link:hover { background: rgba(255, 255, 255, .04); }

@media (min-width: 900px) {
  .preview-grid { grid-template-columns: 1fr 1fr; }
}

/* Native Local HTTP entry inside Layer 7 / Non Protected. */
.local-dstat-row { display:flex; align-items:center; text-decoration:none; cursor:pointer; }
.local-dstat-row:hover { background:rgba(125,192,255,.07); }
.local-open-label { color:#80bdf2; font:700 10px ui-monospace,monospace; letter-spacing:.04em; white-space:nowrap; }
@media(max-width:520px) { .local-open-label { font-size:9px; } .local-dstat-row { gap:10px; } }
