/* ================================================================
   INDEX — SPEEDTEST HERO + GAUGE DESIGN
   ================================================================ */

/* Main wrapper */
.st-main {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ── Hero ───────────────────────────────────────────────────── */
.st-hero {
    text-align: center;
    padding: 36px 20px 18px;
}

.st-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 20px;
    border: 1px solid var(--border-2);
    border-radius: 30px;
    color: var(--text-2);
    font-size: 0.77rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin-bottom: 22px;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.st-title {
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 13px;
    color: var(--text);
}

.gradient-word {
    background: linear-gradient(135deg, #818cf8 0%, #06b6d4 55%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.st-subtitle {
    color: var(--text-2);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* ── Custom Server Picker ───────────────────────────────────── */
.ssp-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 22px;
    width: 100%;
    max-width: 480px;
    text-align: left;
}

/* Trigger button */
.ssp-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 30px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 10px 16px 10px 16px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.ssp-trigger:hover,
.ssp-trigger[aria-expanded="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.ssp-trigger-icon { color: var(--accent); flex-shrink: 0; }
.ssp-trigger-text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.ssp-trigger-chevron {
    color: var(--text-2);
    flex-shrink: 0;
    transition: transform 0.22s ease;
}
.ssp-trigger[aria-expanded="true"] .ssp-trigger-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel */
.ssp-dropdown {
    position: fixed;  /* akan di-posisikan via JS */
    z-index: 9999;
    background: var(--surface-2, rgba(14,14,30,0.97));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-2);
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(99,102,241,0.1);
    width: 480px;
    max-width: calc(100vw - 24px);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.ssp-dropdown.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Search input */
.ssp-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
}
.ssp-search {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
}
.ssp-search::placeholder { color: var(--text-2); opacity: 0.6; }

/* Server list */
.ssp-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}
.ssp-list::-webkit-scrollbar { width: 4px; }
.ssp-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* Server item */
.ssp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}
.ssp-item:hover  { background: rgba(99,102,241,0.1); }
.ssp-item.active { background: rgba(99,102,241,0.16); }
.ssp-item-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(99,102,241,0.12);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}
.ssp-item-body { flex: 1; min-width: 0; }
.ssp-item-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ssp-item-meta {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}
.ssp-item-loc {
    font-size: 0.68rem;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ssp-item-dist {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}
.ssp-item-ping {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 20px;
    background: rgba(16,185,129,0.12);
    color: #10b981;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}
.ssp-item-ping.slow { background: rgba(245,158,11,0.12); color: #f59e0b; }
.ssp-item-ping.bad  { background: rgba(239,68,68,0.1);   color: #ef4444; }

/* Empty / no-result state */
.ssp-empty {
    text-align: center;
    padding: 18px;
    color: var(--text-2);
    font-size: 0.8rem;
}

/* ── Mobile: picker lebih kompak ────────────────────────────── */
@media (max-width: 640px) {
    .ssp-wrap { max-width: 100%; }
    .ssp-trigger { font-size: 0.78rem; padding: 8px 12px; }
    .ssp-dropdown { width: calc(100vw - 24px); border-radius: 12px; }
    .ssp-item { padding: 8px 10px; gap: 9px; }
    .ssp-item-icon { width: 26px; height: 26px; border-radius: 6px; }
    .ssp-item-name { font-size: 0.76rem; }
    .ssp-item-loc, .ssp-item-dist { font-size: 0.62rem; }
    .ssp-list { max-height: 240px; }
}

/* Desktop override — dulu pakai st-server-picker-wrap */
@media (min-width: 900px) {
    .ssp-wrap { margin-bottom: 14px; max-width: 400px; }
}

/* Server info triple-cards */
.st-server-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.st-server-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 18px 10px 14px;
    min-width: 164px;
    transition: border-color 0.2s ease;
}

.st-server-card:hover { border-color: var(--border-2); }

.sc-icon { color: var(--accent); flex-shrink: 0; }

.sc-text { display: flex; flex-direction: column; text-align: left; min-width: 0; }

.sc-label {
    display: block;
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-2);
    margin-bottom: 2px;
    font-weight: 600;
}

.sc-value {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.sc-online   { color: #10b981; }
.sc-offline  { color: #ef4444; }
.sc-checking { color: #f59e0b; }
.sc-waiting  { color: var(--text-2); }

/* ── Gauge Section ──────────────────────────────────────────── */
.st-gauge-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 16px;
}

.st-gauge {
    position: relative;
    width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.gauge-track {
    fill: none;
    stroke: rgba(99, 102, 241, 0.1);
    stroke-width: 10;
    stroke-linecap: round;
}

.gauge-arc {
    fill: none;
    stroke: url(#gaugeGrad);
    stroke-width: 11;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

/* Gauge center button */
.gauge-btn {
    position: relative;
    z-index: 2;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, rgba(110, 95, 210, 0.75) 0%, rgba(22, 16, 60, 0.92) 72%);
    border: 2px solid rgba(120, 100, 230, 0.38);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: white;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    box-shadow: 0 0 28px rgba(100, 80, 220, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    animation: gauge-idle 3s ease-in-out infinite;
}

/* hide MULAI icon+label while test runs */
.gauge-btn > svg,
.gauge-btn .gauge-btn-label {
    transition: opacity 0.25s ease;
}
.gauge-btn.running > svg,
.gauge-btn.running .gauge-btn-label {
    opacity: 0;
    pointer-events: none;
}

/* ── In-button gauge display ─────────────────────────────────── */
.gauge-display {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gauge-btn.running .gauge-display {
    opacity: 1;
}

.gd-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
}

.gd-value {
    font-size: 2.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
    color: #fff;
    line-height: 1;
    transition: font-size 0.15s ease, color 0.25s ease;
    text-shadow: 0 0 12px rgba(255,255,255,0.25);
}

.gd-unit {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
    line-height: 1;
}

.gauge-btn:hover:not(:disabled) {
    transform: scale(1.07);
    box-shadow: 0 0 50px rgba(100, 80, 220, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: none;
}

.gauge-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    animation: none;
    box-shadow: none;
}

/* Saat tes berjalan tombol di-disabled, tapi tampilan di dalam harus tetap jelas */
.gauge-btn.running {
    opacity: 1;
    animation: gauge-pulse 1.1s ease-in-out infinite;
    border-color: rgba(99, 102, 241, 0.7);
}

.gauge-btn-label { line-height: 1; }

@keyframes gauge-idle {
    0%, 100% { box-shadow: 0 0 28px rgba(100, 80, 220, 0.32), inset 0 1px 0 rgba(255,255,255,0.1); }
    50%       { box-shadow: 0 0 52px rgba(120, 95, 245, 0.58), 0 0 90px rgba(100, 80, 220, 0.18), inset 0 1px 0 rgba(255,255,255,0.1); }
}

@keyframes gauge-pulse {
    0%, 100% { box-shadow: 0 0 28px rgba(99,102,241,0.5), 0 0 0 0 rgba(99,102,241,0.38); }
    50%       { box-shadow: 0 0 55px rgba(99,102,241,0.9), 0 0 0 18px rgba(99,102,241,0); }
}

.gauge-phase {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-2);
    letter-spacing: 0.3px;
    min-height: 1.2em;
    transition: color 0.3s ease;
}

/* ── Live speed readout (inside gauge) ──────────────────────── */
.gauge-live-speed {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gauge-live-speed.visible {
    opacity: 1;
}

.gls-num {
    display: block;
    font-size: 2.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    color: var(--text);
    line-height: 1;
    transition: color 0.25s ease;
    text-shadow: 0 0 18px rgba(99,102,241,0.35);
}

.gls-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 5px;
}

.gls-phase-icon {
    flex-shrink: 0;
    opacity: 0.8;
    transition: color 0.25s ease;
}

.gls-unit {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-2);
}

/* ── Metric Cards ───────────────────────────────────────────── */
.st-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 16px;
}

.metric-card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px 16px 20px;
    transition: border-color 0.22s ease, transform 0.22s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card.ping::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.metric-card.jitter::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.metric-card.download::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.metric-card.upload::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

.metric-card:hover { border-color: var(--border-2); }
.metric-card:hover::before { opacity: 1; }

.metric-card.testing {
    border-color: var(--accent);
    animation: card-pulse 1.4s ease-in-out infinite;
}
.metric-card.testing::before { opacity: 1; }

.metric-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.metric-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-2);
}

.metric-icon {
    width: 20px;
    height: 20px;
    opacity: 0.55;
}

.metric-card.ping     .metric-icon { stroke: #f59e0b; opacity: 0.8; }
.metric-card.jitter   .metric-icon { stroke: #f59e0b; opacity: 0.8; }
.metric-card.download .metric-icon { stroke: #818cf8; opacity: 0.8; }
.metric-card.upload   .metric-icon { stroke: #22d3ee; opacity: 0.8; }

.metric-value-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.metric-val {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1;
    transition: color 0.3s ease;
}

.metric-unit {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.metric-card.ping     .metric-val,
.metric-card.ping     .metric-unit  { color: #f59e0b; }
.metric-card.jitter   .metric-val,
.metric-card.jitter   .metric-unit  { color: #fbbf24; }
.metric-card.download .metric-val,
.metric-card.download .metric-unit  { color: #818cf8; }
.metric-card.upload   .metric-val,
.metric-card.upload   .metric-unit  { color: #22d3ee; }

/* ── Stop button bar ────────────────────────────────────────── */
.st-stop-wrap {
    justify-content: center;
    padding: 0 20px 12px;
}

/* ── History ────────────────────────────────────────────────── */
.st-history {
    padding: 0 20px 32px;
}

.st-history-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.st-history-hdr h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-2);
    font-weight: 600;
}

.st-history-clear {
    font-size: 0.7rem;
    color: var(--text-2);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 3px 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
}

.st-history-clear:hover { color: var(--red); border-color: rgba(239,68,68,0.4); }

/* History — desktop card design */
.shi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shi:hover {
    border-color: var(--border-2);
    box-shadow: 0 2px 14px rgba(0,0,0,0.1);
}

/* Header row: server + timestamp */
.shi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px 10px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg, rgba(99,102,241,0.06), transparent 55%);
    gap: 12px;
}

.shi-hdr-server {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.shi-hdr-lbl {
    font-size: 0.57rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-2);
    line-height: 1;
}

.shi-hdr-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shi-hdr-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
    flex-shrink: 0;
}

.shi-hdr-ts {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
}

/* Metric blocks row (like CIB items) */
.shi-blocks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.shi-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px;
    border-right: 1px solid var(--border);
    transition: background 0.15s ease;
}
.shi-block:last-child { border-right: none; }
.shi:hover .shi-block { background: rgba(99,102,241,0.02); }

.shi-b-lbl {
    font-size: 0.57rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-2);
    line-height: 1;
}

.shi-b-val {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
}

.shi-b-val small {
    font-size: 0.64rem;
    font-weight: 500;
    opacity: 0.7;
}

.shi-ping-c   { color: #f59e0b; }
.shi-jitter-c { color: #fbbf24; }
.shi-dl-c     { color: #818cf8; }
.shi-ul-c     { color: #22d3ee; }

/* Share meta group: timestamp + share button grouped at right */
.shi-hdr-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Share button inside each history item */
.shi-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px 5px 10px;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 20px;
    background: rgba(99,102,241,0.08);
    color: #818cf8;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}
.shi-share-btn svg { flex-shrink: 0; }
.shi-share-btn:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.65);
    color: #c7d2fe;
}
.shi-share-btn:active { transform: scale(0.95); }

/* ── Responsive ─────────────────────────────────────────────── */
/* Auto-select hint line */
.st-auto-hint {
    font-size: 0.72rem;
    color: var(--accent);
    min-height: 1.1em;
    margin-top: -14px;
    margin-bottom: 18px;
    letter-spacing: 0.2px;
    transition: opacity 0.3s ease;
}

/* ── DESKTOP TWO-COLUMN LAYOUT ──────────────────────────────── */
/* Hero (kiri) | Gauge (kanan) — semuanya terlihat tanpa scroll  */
@media (min-width: 900px) {
    .st-main {
        display: grid;
        grid-template-columns: 1fr 360px;
        grid-template-areas:
            "hero     gauge"
            "metrics  metrics"
            "stop     stop"
            "info     info"
            "history  history";
        column-gap: 48px;
        align-items: start;
        max-width: 1100px;
    }
    .st-hero          { grid-area: hero;    padding: 24px 0 10px; text-align: left;  }
    .st-gauge-section { grid-area: gauge;   padding: 12px 0 8px;  align-self: center; }
    .st-metrics       { grid-area: metrics; padding: 0; margin-bottom: 14px; }
    .st-stop-wrap     { grid-area: stop;    padding: 0 0 10px; }
    .cib-section      { grid-area: info;    padding: 0 0 18px; }
    .st-history       { grid-area: history; padding: 0 0 36px; }

    /* Hero text — compact & left-aligned */
    .st-badge        { margin-bottom: 14px; }
    .st-title        { font-size: clamp(1.8rem, 2.8vw, 2.6rem); letter-spacing: -1px; margin-bottom: 10px; }
    .st-subtitle     { font-size: 0.88rem; margin-bottom: 18px; }
    .st-auto-hint    { margin-bottom: 14px; }
    .ssp-wrap { margin-bottom: 14px; }
    .st-server-cards { justify-content: flex-start; }

    /* Gauge compact */
    .st-gauge  { width: 300px; height: 300px; }
    .gauge-btn { width: 138px; height: 138px; }

    /* Metric cards compact */
    .st-metrics { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .metric-card { padding: 10px 12px 12px; }
    .metric-val  { font-size: 1.65rem; }
}

@media (min-width: 1200px) {
    .st-main { max-width: 1240px; column-gap: 64px; grid-template-columns: 1fr 420px; }
    .st-gauge  { width: 340px; height: 340px; }
    .gauge-btn { width: 155px; height: 155px; }
    .st-title  { font-size: 3rem; }
    .metric-card { padding: 12px 14px 14px; }
    .metric-val  { font-size: 1.8rem; }
}

@media (max-width: 640px) {
    .page-scroll { padding: 68px 0 12px; }

    /* Navbar compact */
    .navbar { }
    .nav-container { height: 52px; min-height: 52px; padding: 0 12px; gap: 8px; }
    .nav-logo .logo-img { height: 26px; }
    .lbn-sub { display: none; }
    .lbn-main { font-size: 0.78rem; letter-spacing: 0.15em; }
    .theme-toggle { width: 28px; height: 28px; font-size: 0.82rem; margin-left: 2px; flex-shrink: 0; }
    .nav-toggle { width: 34px; height: 34px; flex-shrink: 0; }
    .nav-toggle span { width: 16px; }

    /* Body content area */
    .st-main { padding: 0 12px; }

    /* Hero */
    .st-hero { padding: 24px 0 18px; }
    .st-title { font-size: 1.7rem; letter-spacing: -0.8px; }
    .st-subtitle { font-size: 0.8rem; margin-bottom: 20px; }
    .st-badge { font-size: 0.71rem; padding: 5px 14px; margin-bottom: 16px; }
    /* Server picker — compact on mobile */
    .ssp-wrap { width: 100%; max-width: 100%; }
    .ssp-chevron { right: 10px; }
    .st-server-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        width: 100%;
    }
    .st-server-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2px;
        padding: 6px 8px;
        min-width: 0;
    }
    .st-server-cards .st-server-card:first-child { display: none; }
    .sc-icon { width: 12px; height: 12px; }
    .sc-text { align-items: center; text-align: center; }
    .sc-label { font-size: 0.48rem; letter-spacing: 0.35px; margin-bottom: 1px; }
    .sc-value {
        font-size: 0.64rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Gauge on mobile */
    .st-gauge { width: 320px; height: 320px; }
    .gauge-btn { width: 145px; height: 145px; }

    /* Metrics 2x2 */
    .st-metrics { grid-template-columns: repeat(2, 1fr); padding: 0 12px; gap: 6px; }
    .metric-card { padding: 10px 10px 12px; }
    .metric-label { font-size: 0.58rem; letter-spacing: 0.9px; }
    .metric-icon { width: 15px; height: 15px; }
    .metric-card-top { margin-bottom: 10px; }
    .metric-val { font-size: 1.35rem; letter-spacing: -1px; }
    .metric-unit { font-size: 0.68rem; }

    /* CIB bar: handled by its own @media block below */
    .cib-section { padding: 0 12px 16px; }

    .st-history { padding: 0 12px 28px; }
    .st-stop-wrap { padding: 0 12px 10px; }
    .st-gauge-section { padding: 8px 12px 24px; }

    /* History: mobile — header server+waktu, blocks 2-col */
    .shi-header { padding: 9px 12px 8px; }
    .shi-hdr-name { font-size: 0.82rem; }
    .shi-hdr-ts { font-size: 0.68rem; }
    .shi-hdr-meta { gap: 8px; }
    .shi-share-btn { padding: 5px 9px; }
    .shi-share-btn .ssbtn-txt { display: none; }
    .shi-blocks { grid-template-columns: repeat(2, 1fr); }
    .shi-block {
        padding: 8px 10px;
        border-top: 1px solid var(--border);
    }
    .shi-block:nth-child(even) { border-right: none; }
    .shi-b-val { font-size: 0.8rem; }
}

/* ── Custom Error Modal ─────────────────────────────────────────────────── */
#st-error-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.st-err-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.st-err-box {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(239, 68, 68, 0.30);
    border-radius: 16px;
    padding: 28px 24px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    animation: st-err-pop .22s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes st-err-pop {
    from { transform: scale(.88) translateY(12px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}
.st-err-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.st-err-icon {
    width: 26px;
    height: 26px;
    color: #ef4444;
}
.st-err-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 10px;
    line-height: 1.4;
}
.st-err-body {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin: 0 0 22px;
}
.st-err-btn {
    display: inline-block;
    padding: 10px 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    letter-spacing: .02em;
}
.st-err-btn:hover  { opacity: .88; }
.st-err-btn:active { transform: scale(.96); }

/* Mobile — lebih kecil */
@media (max-width: 480px) {
    .st-err-box { padding: 22px 18px 20px; border-radius: 14px; }
    .st-err-title { font-size: 0.93rem; }
    .st-err-body  { font-size: 0.8rem; margin-bottom: 18px; }
    .st-err-btn   { padding: 9px 28px; font-size: 0.85rem; }
}

