/* GMT Diagnostics PWA — mobile-first layout
   All colors via viasat-theme.css custom properties.
   Target: iPhone 14 / iPad / Android phone / PED browser */

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--vs-bg);
  color: var(--vs-text);
  font-family: "Source Sans Pro", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

/* ── App shell ─────────────────────────────────────────────────────────────── */

.gmt-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* ── Top header ────────────────────────────────────────────────────────────── */

.gmt-header {
  flex: 0 0 auto;
  background: var(--vs-topbar);
  color: #fff;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gmt-header-brand {
  font-family: "Uni Neue", "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.gmt-header-brand span { font-weight: 400; opacity: .9; }

.gmt-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gmt-conn-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  flex-shrink: 0;
  transition: background .3s;
}
.gmt-conn-dot.online  { background: #6abf4b; }
.gmt-conn-dot.offline { background: #e05252; }
.gmt-conn-label {
  font-size: 13px;
  opacity: .85;
}

/* ── Scrollable content area ───────────────────────────────────────────────── */

.gmt-content {
  flex: 1 1 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 4px;
}

/* ── Session bar ────────────────────────────────────────────────────────────── */

.gmt-session-bar {
  background: #fff;
  border: 1px solid var(--vs-border-soft);
  border-radius: var(--vs-radius-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gmt-session-id {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: var(--vs-text-subtle);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmt-timer {
  font-family: "Uni Neue", "Segoe UI", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--vs-text);
  white-space: nowrap;
}

/* ── Metric grid ─────────────────────────────────────────────────────────────── */

.gmt-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.gmt-metric {
  background: #fff;
  border: 1px solid var(--vs-border-soft);
  border-radius: var(--vs-radius-md);
  padding: 12px 14px 10px;
}

.gmt-metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--vs-text-subtle);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.gmt-metric-value {
  font-family: "Uni Neue", "Segoe UI", Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--vs-text);
  line-height: 1;
}

.gmt-metric-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--vs-text-subtle);
  margin-left: 2px;
}

.gmt-metric-value.good    { color: var(--vs-success); }
.gmt-metric-value.warn    { color: var(--vs-warning); }
.gmt-metric-value.danger  { color: var(--vs-danger); }

/* ── Event markers ────────────────────────────────────────────────────────────── */

.gmt-markers {
  margin-bottom: 14px;
}

.gmt-markers-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--vs-text-subtle);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 8px;
}

.gmt-marker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gmt-marker-btn {
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--vs-radius-md);
  border: 1px solid var(--vs-border);
  background: #fff;
  color: var(--vs-text);
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  transition: background .15s, border-color .15s;
  touch-action: manipulation;
}

.gmt-marker-btn:hover   { background: var(--vs-surface-soft); }
.gmt-marker-btn:active  { background: var(--vs-border-soft); }
.gmt-marker-btn.pressed { background: #e8f4f7; border-color: #97c7d1; color: var(--vs-topbar); }

/* ── Speed test settings panel ─────────────────────────────────────────────── */

.gmt-speed-panel {
  background: #fff;
  border: 1px solid var(--vs-border-soft);
  border-radius: var(--vs-radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
}

.gmt-speed-panel-head {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  background: #f8fafb;
  border-bottom: 1px solid var(--vs-border-soft);
}

.gmt-speed-panel-body {
  padding: 14px 16px;
}

.gmt-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.gmt-setting-row:last-child { margin-bottom: 0; }

.gmt-setting-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--vs-text);
  white-space: nowrap;
}

.gmt-setting-select {
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-radius-sm);
  padding: 5px 8px;
  font-size: 13px;
  color: var(--vs-text);
  background: #fff;
  min-width: 100px;
}

/* ── Speed test results ───────────────────────────────────────────────────── */

.gmt-result-panel {
  background: #fff;
  border: 1px solid var(--vs-border-soft);
  border-radius: var(--vs-radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.gmt-result-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--vs-text-subtle);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--vs-border-soft);
}

.gmt-shaping-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #f0f3f5;
}
.gmt-shaping-row:last-child { border-bottom: none; }
.gmt-shaping-key   { color: var(--vs-text-subtle); }
.gmt-shaping-val   { font-weight: 700; color: var(--vs-text); font-family: monospace; }
.gmt-shaping-flag  { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.gmt-shaping-flag.warn   { background: #fff3db; color: #805000; }
.gmt-shaping-flag.danger { background: #fbe8e8; color: #7f171b; }

/* ── Bottom action bar ──────────────────────────────────────────────────────── */

.gmt-action-bar {
  flex: 0 0 auto;
  background: #fff;
  border-top: 1px solid var(--vs-border-soft);
  padding: 10px 14px 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
}

.gmt-action-bar .btn {
  flex: 1;
  font-size: 14px;
  padding: 10px 8px;
}

/* ── Loading / offline states ─────────────────────────────────────────────── */

.gmt-offline-banner {
  background: #fff3db;
  border-bottom: 1px solid var(--vs-border-soft);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #805000;
  text-align: center;
  display: none;
}
.gmt-offline-banner.visible { display: block; }

.gmt-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  background: #fff3db;
  color: #805000;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
}

/* ── Login overlay ──────────────────────────────────────────────────────────── */

.gmt-login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--vs-bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}

/* ── Tabs ────────────────────────────────────────────────────────────────────── */

.gmt-tabs {
  display: flex;
  border-bottom: 2px solid var(--vs-border-soft);
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gmt-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--vs-text-subtle);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.gmt-tab.active {
  color: var(--vs-topbar);
  border-bottom-color: var(--vs-topbar);
}

/* ── Responsive adjustments ─────────────────────────────────────────────────── */

@media (min-width: 480px) {
  .gmt-metric-grid { grid-template-columns: repeat(3, 1fr); }
  .gmt-marker-grid { grid-template-columns: repeat(6, 1fr); }
  .gmt-content { padding: 20px 20px 4px; }
}

@media (min-width: 768px) {
  .gmt-metric-grid { grid-template-columns: repeat(4, 1fr); }
  .gmt-header { height: 64px; padding: 0 24px; }
  .gmt-content { padding: 24px 24px 4px; max-width: 900px; margin: 0 auto; }
  .gmt-action-bar { max-width: 900px; margin: 0 auto; width: 100%; }
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */

.gmt-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gmt-spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes gmt-spin { to { transform: rotate(360deg); } }

/* ── Setup modal ─────────────────────────────────────────────────────────────── */

.gmt-modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

.gmt-icon-btn {
  background: none; border: none; color: #fff;
  font-size: 20px; cursor: pointer; padding: 4px 8px;
  opacity: .8; transition: opacity .15s;
}
.gmt-icon-btn:hover { opacity: 1; }

/* ── User menu ────────────────────────────────────────────────────────────── */

.gmt-user-menu { position: relative; }

.gmt-user-btn {
  background: none; border: none; color: #fff;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  font-size: 13px; opacity: .9; transition: opacity .15s, background .15s;
  font-family: inherit;
}
.gmt-user-btn:hover { opacity: 1; background: rgba(255,255,255,.12); }
.gmt-user-btn svg { flex-shrink: 0; }

#user-label {
  max-width: 80px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.gmt-user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 600;
  background: #fff; border: 1px solid var(--vs-border-soft);
  border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.14);
  min-width: 170px; overflow: hidden;
}

.gmt-dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 16px; font-size: 14px; font-weight: 500;
  color: var(--vs-text); background: none; border: none;
  cursor: pointer; transition: background .12s; font-family: inherit;
}
.gmt-dropdown-item:hover { background: var(--vs-surface-soft); }
.gmt-dropdown-danger { color: var(--vs-danger); }
.gmt-dropdown-danger:hover { background: #fbe8e8; }

/* ── Network list (admin panel) ──────────────────────────────────────────── */

.gmt-net-list {
  border: 1px solid var(--vs-border-soft);
  border-radius: 8px; overflow: hidden;
  margin-bottom: 4px;
}

.gmt-net-row {
  border-bottom: 1px solid var(--vs-border-soft);
  background: #fff;
}
.gmt-net-row:last-child { border-bottom: none; }

.gmt-net-view,
.gmt-net-editor {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 9px 12px; gap: 8px;
}

.gmt-net-name {
  font-size: 14px; font-weight: 600; color: var(--vs-text);
  flex: 1;
}

.gmt-net-input {
  flex: 1; font-size: 14px;
}

.gmt-net-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}

.gmt-net-btn {
  background: none; border: 1px solid var(--vs-border-soft);
  border-radius: 6px; cursor: pointer;
  font-size: 13px; padding: 3px 8px;
  color: var(--vs-text-subtle); transition: background .12s, color .12s;
  line-height: 1.4;
}
.gmt-net-edit:hover   { background: #e8f0fe; color: #1a56db; border-color: #93b4fb; }
.gmt-net-save:hover   { background: #e6f4ea; color: #1a7f37; border-color: #82c99a; }
.gmt-net-remove:hover,
.gmt-net-cancel:hover { background: #fbe8e8; color: var(--vs-danger); border-color: #f5a0a0; }

.gmt-net-empty {
  padding: 16px 14px; font-size: 13px;
  color: var(--vs-text-subtle); text-align: center;
}

/* ── Session history list ─────────────────────────────────────────────────── */

.gmt-history-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 700; color: var(--vs-text);
  border-bottom: 1px solid var(--vs-border-soft);
}
.gmt-history-count {
  background: var(--vs-primary); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 10px;
  padding: 1px 7px; min-width: 20px; text-align: center;
}
.gmt-history-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--vs-border-soft);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,.05);
  transition: background .12s;
}
.gmt-history-row:last-child { border-bottom: none; }
.gmt-history-row:hover,
.gmt-history-row:active { background: var(--vs-surface-soft); }

/* iOS Safari: pointer-events:none on all non-button children lets click reach the row div */
.gmt-history-row .gmt-history-main > span,
.gmt-history-row .gmt-history-sub,
.gmt-history-row .gmt-history-main { pointer-events: none; }
.gmt-history-stop-btn,
.gmt-history-del-btn { pointer-events: auto; }

.gmt-history-stop-btn {
  background: none; border: 1px solid var(--vs-border-soft);
  border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600;
  padding: 2px 8px; color: var(--vs-danger); font-family: inherit;
  transition: background .12s; flex-shrink: 0; touch-action: manipulation;
}
.gmt-history-stop-btn:hover { background: #fbe8e8; border-color: #f5a0a0; }

.gmt-history-del-btn {
  background: none; border: 1px solid var(--vs-border-soft);
  border-radius: 6px; cursor: pointer; font-size: 13px;
  padding: 2px 7px; color: var(--vs-text-subtle); font-family: inherit;
  transition: background .12s, border-color .12s, color .12s;
  flex-shrink: 0; touch-action: manipulation;
}
.gmt-history-del-btn:hover { background: #fbe8e8; border-color: #f5a0a0; color: var(--vs-danger); }
.gmt-history-del-btn--confirm {
  background: #fbe8e8; border-color: var(--vs-danger);
  color: var(--vs-danger); font-size: 11px; font-weight: 700; padding: 2px 10px;
}
.gmt-history-main {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.gmt-history-ped  { font-size: 14px; font-weight: 700; color: var(--vs-text); }
.gmt-history-net  { font-size: 13px; color: var(--vs-text-subtle); }
.gmt-history-dur  { font-size: 13px; color: var(--vs-text-subtle); margin-left: auto; }
.gmt-history-sub  { font-size: 12px; color: var(--vs-text-subtle); }
.gmt-history-id   { font-family: monospace; font-size: 11px; }
.gmt-badge-active {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: #e6f4ea; color: #1a7f37;
  border-radius: 10px; padding: 1px 8px;
}
.gmt-badge-done {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: #f1f3f4; color: var(--vs-text-subtle);
  border-radius: 10px; padding: 1px 8px;
}

/* Admin panel — scrollable card */
#admin-panel .vs-login-card {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Session Report Overlay ──────────────────────────────────────────────── */

.gmt-report-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--vs-bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.gmt-report {
  display: flex; flex-direction: column;
  height: 100%; height: 100dvh;
  overflow: hidden;
}

.gmt-report-topbar {
  flex: 0 0 auto;
  background: var(--vs-topbar);
  color: #fff;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  height: 56px;
}

.gmt-report-backbtn {
  background: none; border: none; color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 6px 10px; border-radius: 6px; opacity: .9;
  transition: background .15s;
  font-family: inherit;
}
.gmt-report-backbtn:hover { background: rgba(255,255,255,.15); opacity: 1; }

.gmt-report-title-lbl {
  font-size: 16px; font-weight: 700; flex: 1;
}

.gmt-report-sid-chip {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px; background: rgba(255,255,255,.15);
  border-radius: 6px; padding: 3px 8px;
}

.gmt-report-body {
  flex: 1 1 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 24px;
  display: flex; flex-direction: column; gap: 12px;
}

.gmt-report-loading {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: var(--vs-text-subtle); font-size: 15px;
}

/* Spinner for report loading */
.gmt-spinner-lg {
  width: 36px; height: 36px;
  border: 3px solid var(--vs-border-soft);
  border-top-color: var(--vs-topbar);
  border-radius: 50%;
  animation: gmt-spin .7s linear infinite;
}

/* ── Report Cards ─────────────────────────────────────────────────────────── */

.gmt-rpt-card {
  background: #fff;
  border: 1px solid var(--vs-border-soft);
  border-radius: var(--vs-radius-lg);
  padding: 16px;
}

.gmt-rpt-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--vs-text-subtle);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}

/* ── Meta card ────────────────────────────────────────────────────────────── */

.gmt-rpt-meta-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.gmt-rpt-ped  { font-size: 18px; font-weight: 700; color: var(--vs-text); }
.gmt-rpt-net  { font-size: 14px; color: var(--vs-text-subtle); }
.gmt-rpt-dur  { font-size: 13px; color: var(--vs-text-subtle); margin-left: auto; }
.gmt-rpt-meta-sub { font-size: 12px; color: var(--vs-text-subtle); }

/* ── Speed grid ───────────────────────────────────────────────────────────── */

.gmt-rpt-speed-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 540px) {
  .gmt-rpt-speed-grid {
    grid-template-columns: 1fr 1fr auto;
    align-items: start;
  }
}

.gmt-rpt-speed-col { min-width: 0; }

.gmt-rpt-big-num {
  font-family: "Uni Neue", "Segoe UI", Arial, sans-serif;
  font-size: 40px; font-weight: 700; line-height: 1;
  color: var(--vs-text); margin: 4px 0 8px;
}

.gmt-rpt-unit {
  font-size: 16px; font-weight: 400;
  color: var(--vs-text-subtle); margin-left: 4px;
}

.gmt-rpt-sub-stats {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--vs-text-subtle);
}
.gmt-rpt-sub-stats b { color: var(--vs-text); }

/* ── Chart ────────────────────────────────────────────────────────────────── */

.gmt-rpt-chart-wrap {
  width: 100%; border-radius: 6px;
  overflow: hidden; background: #f8fafb;
  margin-bottom: 6px;
}

.gmt-rpt-chart {
  display: block; width: 100%; height: 80px;
}

/* ── Side column (latency/jitter/bbloat) ──────────────────────────────────── */

.gmt-rpt-side-col {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 120px;
}

.gmt-rpt-side-metric {}

.gmt-rpt-side-val {
  font-family: "Uni Neue", "Segoe UI", Arial, sans-serif;
  font-size: 22px; font-weight: 700; color: var(--vs-text); line-height: 1;
}
.gmt-rpt-side-val.good    { color: var(--vs-success); }
.gmt-rpt-side-val.warn    { color: var(--vs-warning); }
.gmt-rpt-side-val.bad     { color: var(--vs-danger); }

/* ── Flag chips ───────────────────────────────────────────────────────────── */

.gmt-rpt-flag-chip {
  display: inline-block; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 3px 10px; margin-top: 4px;
}
.gmt-rpt-flag-chip.warn   { background: #fff3db; color: #805000; }
.gmt-rpt-flag-chip.danger { background: #fbe8e8; color: #7f171b; }

/* ── ⓘ Info button with tooltip ──────────────────────────────────────────── */

.gmt-rpt-metric-label {
  font-size: 12px; font-weight: 600; color: var(--vs-text-subtle);
  text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px;
  display: flex; align-items: center; gap: 4px;
}

.gmt-info-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 0; color: var(--vs-text-subtle);
  opacity: .65; transition: opacity .15s;
  position: relative; display: inline-flex;
  font-family: inherit;
}
.gmt-info-btn:hover { opacity: 1; }

/* CSS tooltip removed — gmt-float-tooltip JS handles all [data-tip] elements */

/* ── IP info card ─────────────────────────────────────────────────────────── */

.gmt-rpt-ip-grid { display: flex; flex-direction: column; gap: 8px; }

.gmt-rpt-ip-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; padding: 6px 0;
  border-bottom: 1px solid var(--vs-border-soft);
}
.gmt-rpt-ip-row:last-child { border-bottom: none; }
.gmt-rpt-ip-row--highlight { background: #f0f9f0; border-radius: 6px; margin: -2px 0; }
.gmt-rpt-ip-icon { font-size: 16px; color: var(--vs-text-subtle); flex-shrink: 0; width: 20px; text-align: center; }
.gmt-rpt-ip-lbl  { color: var(--vs-text-subtle); flex: 0 0 110px; font-size: 13px; }
.gmt-rpt-ip-val  { font-weight: 600; color: var(--vs-text); font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.gmt-rpt-asn     { font-weight: 400; color: var(--vs-text-subtle); }

/* ── Shaping card ─────────────────────────────────────────────────────────── */

.gmt-rpt-shaping-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 0;
}

.gmt-rpt-shaping-item {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 6px 0; font-size: 13px;
  border-bottom: 1px solid #f0f3f5;
}
.gmt-rpt-shaping-item:last-child { border-bottom: none; }
.gmt-rpt-shaping-lbl { color: var(--vs-text-subtle); display: flex; align-items: center; gap: 4px; }
.gmt-rpt-shaping-val { font-weight: 700; color: var(--vs-text); font-family: monospace; }

/* ── Events timeline ──────────────────────────────────────────────────────── */

.gmt-rpt-events { display: flex; flex-direction: column; }

.gmt-rpt-event-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0; font-size: 13px;
  border-bottom: 1px solid #f0f3f5;
}
.gmt-rpt-event-row:last-child { border-bottom: none; }
.gmt-rpt-event-ts { color: var(--vs-text-subtle); font-family: monospace; font-size: 12px; flex-shrink: 0; }
.gmt-rpt-event-type { font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 999px; flex-shrink: 0; }
.gmt-rpt-event-type.evt-warn    { background: #fff3db; color: #805000; }
.gmt-rpt-event-type.evt-danger  { background: #fbe8e8; color: #7f171b; }
.gmt-rpt-event-type.evt-neutral { background: #e8f4f7; color: #0f628f; }
.gmt-rpt-event-val { color: var(--vs-text-subtle); font-size: 12px; }

/* ── Latency timeline ─────────────────────────────────────────────────────── */

.gmt-rpt-tl-stats {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--vs-text-subtle); margin-bottom: 10px;
}
.gmt-rpt-tl-stats b { color: var(--vs-text); }
.gmt-rpt-tl-gap-lbl { color: #ef4444; font-weight: 600; }
.gmt-rpt-tl-axis {
  width: 100%; height: 18px; margin-top: 2px;
  display: block; overflow: visible;
}

/* ── Live ping test ───────────────────────────────────────────────────────── */

.gmt-rpt-ping-info { font-size: 13px; color: var(--vs-text-subtle); margin-bottom: 12px; }

.gmt-rpt-ping-btn {
  background: var(--vs-primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
  padding: 8px 20px; touch-action: manipulation;
  transition: background .15s;
}
.gmt-rpt-ping-btn:hover { background: #0a4e72; }
.gmt-rpt-ping-btn:disabled { opacity: .6; cursor: default; }

.gmt-rpt-ping-results { margin-top: 16px; }

.gmt-rpt-ping-summary {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 14px;
}
.gmt-rpt-ping-stat { text-align: center; }
.gmt-rpt-ping-stat-val {
  font-size: 28px; font-weight: 800; font-family: 'Uni Neue', 'Segoe UI', Arial, sans-serif;
  line-height: 1.1;
}
.gmt-rpt-ping-stat-val.good { color: #16a34a; }
.gmt-rpt-ping-stat-val.warn { color: #ca8a04; }
.gmt-rpt-ping-stat-val.bad  { color: var(--vs-danger); }
.gmt-rpt-ping-stat-lbl { font-size: 11px; color: var(--vs-text-subtle); margin-top: 2px; }

.gmt-rpt-ping-dots {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 10px;
}
.gmt-ping-dot {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.gmt-ping-dot--good { background: #16a34a; }
.gmt-ping-dot--warn { background: #ca8a04; }
.gmt-ping-dot--bad  { background: var(--vs-danger); }
.gmt-ping-dot--lost { background: #6b7280; }

.gmt-rpt-ping-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--vs-text-subtle); align-items: center;
}
.gmt-rpt-ping-legend .gmt-ping-dot { width: 10px; height: 10px; }

/* ── IP info bar (active session) ────────────────────────────────────────── */

.gmt-ip-info-bar {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--vs-text-subtle);
  padding: 4px 2px; margin-bottom: 8px;
  border-top: 1px solid var(--vs-border-soft);
}
.gmt-ip-info-icon { font-size: 13px; }
.gmt-ip-info-sep  { opacity: .4; }
#m-ip { font-family: "SFMono-Regular", Consolas, monospace; font-weight: 600; color: var(--vs-text); }
#m-geo { color: var(--vs-text-subtle); }

/* ── Live speed chart ─────────────────────────────────────────────────────── */

.gmt-live-chart-panel {
  background: var(--vs-panel); border-radius: 12px;
  border: 1px solid var(--vs-border-soft);
  padding: 12px 14px 10px; margin-bottom: 14px;
}

.gmt-lc-header {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; margin-bottom: 8px; flex-wrap: wrap;
}

.gmt-lc-phase {
  font-weight: 700; font-size: 13px; padding: 2px 9px;
  border-radius: 999px; border: 1.5px solid transparent;
}
.gmt-lc-phase--dl { background: #fff4eb; color: #c05600; border-color: #f6821f; }
.gmt-lc-phase--ul { background: #f3f0fe; color: #5b21b6; border-color: #7c3aed; }
.gmt-lc-phase--warmup { background: #f0f3f5; color: #0f628f; border-color: #9ca3af; }

.gmt-lc-peak { margin-left: auto; font-weight: 700; color: var(--vs-text); font-size: 13px; }

.gmt-lc-lat { font-size: 12px; color: var(--vs-text-subtle); flex-shrink: 0; }

.gmt-lc-svg {
  display: block; width: 100%; height: 110px;
  border-radius: 6px; background: #fafafa;
}

.gmt-lc-legend {
  display: flex; gap: 14px; margin-top: 8px; font-size: 12px;
}
.gmt-lc-leg { display: flex; align-items: center; gap: 5px; }
.gmt-lc-leg::before {
  content: ''; display: inline-block;
  width: 18px; height: 3px; border-radius: 99px;
}
.gmt-lc-leg--dl::before { background: #f6821f; }
.gmt-lc-leg--ul::before { background: #7c3aed; }
.gmt-lc-leg--dl { color: #c05600; font-weight: 600; }
.gmt-lc-leg--ul { color: #5b21b6; font-weight: 600; }

/* ── Heartbeat sparkline & tile pulse ─────────────────────────────────────── */

.gmt-lat-sparkline {
  display: block; width: 100%; height: 20px; margin-top: 4px;
}

@keyframes gmt-tile-pulse {
  0%   { background: var(--vs-panel); }
  15%  { background: rgba(15, 98, 143, 0.12); }
  100% { background: var(--vs-panel); }
}

.gmt-tile-pulse { animation: gmt-tile-pulse 0.7s ease-out; }

/* ── Report responsive ────────────────────────────────────────────────────── */

@media (min-width: 768px) {
  .gmt-report-body { padding: 20px 24px 32px; max-width: 900px; margin: 0 auto; width: 100%; }
  .gmt-rpt-big-num { font-size: 48px; }
  .gmt-rpt-ping-summary { grid-template-columns: repeat(4, 1fr); }
}

/* ── Network Path Analysis waterfall ─────────────────────────────────────── */

.gmt-np-panel {
  background: var(--vs-panel); border-radius: 12px;
  border: 1px solid var(--vs-border-soft);
  padding: 14px 16px 12px; margin-bottom: 14px;
}

.gmt-np-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.gmt-np-title  { font-weight: 700; font-size: 15px; color: var(--vs-text); }
.gmt-np-total  { font-size: 13px; color: var(--vs-text-subtle); }

.gmt-np-waterfall { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.gmt-np-row { display: grid; grid-template-columns: 130px 1fr max-content; align-items: center; gap: 8px; }

.gmt-np-label { font-size: 12px; color: var(--vs-text-subtle); white-space: nowrap; }

.gmt-np-bar-wrap {
  display: flex; align-items: center;
  height: 20px; min-width: 0; overflow: hidden;
}
.gmt-np-bar {
  height: 14px; border-radius: 3px; flex-shrink: 0;
  transition: width 0.3s ease;
}
.gmt-np-val       { font-size: 12px; font-weight: 600; color: var(--vs-text); white-space: nowrap; text-align: right; }
.gmt-np-val-zero  { font-size: 12px; color: var(--vs-text-subtle); white-space: nowrap; text-align: right; }
.gmt-np-val-none  { font-size: 12px; color: var(--vs-text-subtle); font-style: italic; text-align: right; }

.gmt-np-summary {
  border-top: 1px solid var(--vs-border-soft);
  padding-top: 10px; margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.gmt-np-sum-row {
  display: flex; justify-content: space-between; font-size: 12px;
  color: var(--vs-text-subtle);
}
.gmt-np-sum-row span:last-child { font-weight: 600; color: var(--vs-text); text-align: right; }
.gmt-np-range { font-weight: 400; color: var(--vs-text-subtle); }
.gmt-np-nat   { font-weight: 400; color: var(--vs-text-subtle); }

.gmt-np-flags { display: flex; flex-direction: column; gap: 5px; }
.gmt-np-flag  { font-size: 12px; padding: 5px 10px; border-radius: 6px; }
.gmt-np-flag.warn { background: #fff4eb; color: #c05600; }
.gmt-np-flag.info { background: #f0f3f5; color: var(--vs-text-subtle); }
.gmt-np-flag.ok   { background: #f0fdf4; color: #166534; }
.gmt-np-error     { font-size: 12px; color: #dc2626; }

/* ── Connectivity probe settings panel ─────────────────────────────────────── */
.gmt-conn-endpoints-section  { margin-top: 12px; }
.gmt-conn-endpoints-title    { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--vs-text-subtle); margin-bottom: 6px; }
.gmt-conn-endpoint-list      { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.gmt-conn-endpoint-row       { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: 6px; font-size: 12px; }
.gmt-conn-ep-label           { font-weight: 600; min-width: 70px; color: var(--vs-text); }
.gmt-conn-ep-url             { flex: 1; color: var(--vs-text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmt-conn-ep-remove          { background: none; border: none; cursor: pointer; color: var(--vs-text-subtle); font-size: 13px; padding: 0 2px; line-height: 1; }
.gmt-conn-ep-remove:hover    { color: var(--vs-danger); }
.gmt-conn-add-row            { display: flex; gap: 6px; }
.gmt-conn-input              { flex: 1; padding: 5px 8px; border: 1px solid var(--vs-border); border-radius: 6px; font-size: 12px; background: var(--vs-bg); color: var(--vs-text); }
.gmt-conn-input-sm           { flex: 0 0 90px; }
.gmt-conn-add-btn            { padding: 5px 10px; background: var(--vs-primary); color: #fff; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.gmt-conn-add-btn:hover      { background: #0a4e72; }

/* ── Connectivity probe report section ─────────────────────────────────────── */
.gmt-rpt-subtitle      { font-size: 11px; font-weight: 400; color: var(--vs-text-subtle); margin-left: 6px; }
.gmt-conn-ep-grid      { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.gmt-conn-ep-card      { background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: 8px; padding: 10px 12px; }
.gmt-conn-ep-head      { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.gmt-conn-ep-name      { font-weight: 600; font-size: 13px; color: var(--vs-text); }
.gmt-conn-ep-stat      { font-size: 11px; font-weight: 600; }
.gmt-conn-ep-stat.good { color: #16a34a; }
.gmt-conn-ep-stat.warn { color: #ca8a04; }
.gmt-conn-ep-stat.bad  { color: var(--vs-danger); }
.gmt-conn-sparkline    { width: 100%; height: 40px; display: block; margin-bottom: 6px; }
.gmt-conn-dot-row      { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.gmt-conn-dot          { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.gmt-conn-dot.ok       { background: #16a34a; }
.gmt-conn-dot.fail     { background: #dc2626; }

/* ── Admin settings page ────────────────────────────────────────────────────── */
.gmt-admin-page-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.gmt-admin-page-title   { font-family: 'Uni Neue','Segoe UI',Arial,sans-serif; font-size: 20px; font-weight: 700; margin: 0; color: var(--vs-text); }

/* ── Connectivity probe status indicator ─────────────────────────────────────── */
.gmt-conn-probe-status  { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--vs-text-subtle); margin-left: auto; padding-left: 12px; }
.gmt-conn-probe-dot     { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; animation: gmt-probe-pulse 1.5s ease-in-out infinite; flex-shrink: 0; }
@keyframes gmt-probe-pulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }

/* ── Bootstrap-style floating tooltip ───────────────────────────────────────── */
.gmt-float-tooltip {
  position: fixed;
  z-index: 99999;
  background: #212529;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 5px 9px;
  border-radius: 4px;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  font-family: system-ui, -apple-system, sans-serif;
}

/* ── Flight number badge ─────────────────────────────────────────────────────── */
.gmt-rpt-flight {
  font-size: 12px; font-weight: 600; color: #0f628f;
  background: rgba(15,98,143,.1); border-radius: 4px;
  padding: 2px 7px; letter-spacing: .02em;
}

/* ── Background stream — active panel ────────────────────────────────────────── */
.gmt-stream-panel       { border-radius: 8px; border: 1px solid var(--vs-border); background: var(--vs-surface); margin-bottom: 12px; overflow: hidden; }
.gmt-stream-panel-head  { padding: 11px 14px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; color: var(--vs-text); }
.gmt-stream-panel-head:hover { background: var(--vs-surface-raised); }
.gmt-stream-panel-body  { padding: 10px 14px 14px; border-top: 1px solid var(--vs-border); }
.gmt-stream-live        { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 18px; font-weight: 700; }
.gmt-stream-live-dot    { width: 10px; height: 10px; border-radius: 50%; background: #16a34a; flex-shrink: 0; animation: gmt-probe-pulse 1s ease-in-out infinite; }
.gmt-stream-live-unit   { font-size: 12px; font-weight: 400; color: var(--vs-text-subtle); margin-left: -4px; }
.gmt-stream-drop-badge  { font-size: 11px; font-weight: 700; color: #dc2626; background: rgba(220,38,38,.1); border-radius: 4px; padding: 2px 7px; margin-left: 4px; }
.gmt-stream-btn-row     { display: flex; gap: 8px; margin-top: 12px; }
.gmt-stream-note        { font-size: 11px; color: var(--vs-text-subtle); margin-top: 8px; }

/* ── Background stream — report section ─────────────────────────────────────── */
.gmt-rpt-stream-note     { font-size: 11px; color: var(--vs-text-subtle); margin-bottom: 10px; }
.gmt-rpt-stream-segment  { margin-bottom: 20px; }
.gmt-rpt-stream-segment:last-child { margin-bottom: 0; }
.gmt-rpt-stream-seg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gmt-rpt-stream-profile  { font-size: 14px; font-weight: 700; color: var(--vs-text); }
.gmt-rpt-stream-target   { font-size: 11px; color: var(--vs-text-subtle); background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: 4px; padding: 1px 6px; }
.gmt-rpt-stream-seg-num  { font-size: 11px; color: var(--vs-text-subtle); }
.gmt-rpt-stream-stats    { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--vs-text-subtle); margin-bottom: 10px; }
.gmt-rpt-stream-stats .good { color: #16a34a; }
.gmt-rpt-stream-stats .warn { color: #ca8a04; }
.gmt-rpt-stream-stats .bad  { color: #dc2626; }
.gmt-rpt-stream-drops    { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gmt-rpt-stream-drop-chip { font-size: 11px; background: rgba(220,38,38,.1); color: #dc2626; border-radius: 4px; padding: 2px 8px; font-weight: 600; }
.gmt-rpt-stream-legend   { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--vs-text-subtle); margin-top: 6px; }
.gmt-stream-leg          { display: inline-block; width: 16px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 3px; }
.gmt-stream-leg--good    { background: #16a34a; }
.gmt-stream-leg--warn    { background: #f59e0b; }
.gmt-stream-leg--bad     { background: #dc2626; }
.gmt-stream-leg--drop    { background: #dc2626; width: 2px; height: 12px; }
