.btn:disabled { opacity: .55; cursor: wait; }

/* Soft glass surfaces over an ambient color field. */
:root {
  --vibemonitor-layout: cards;
  color-scheme: light;
  --background: #d8dcea;
  --foreground: #172235;
  --card-bg: rgba(250, 252, 255, .72);
  --card-hover: rgba(255, 255, 255, .88);
  --card-data-bg: rgba(240, 246, 255, .48);
  --primary: #356dcc;
  --primary-light: rgba(232, 240, 255, .72);
  --primary-text: #fff;
  --muted: rgba(239, 245, 255, .54);
  --muted-foreground: #536276;
  --border: rgba(255, 255, 255, .6);
  --border-focus: #356dcc;
  --success: #238364;
  --label-green: #07543f;
  --label-blue: #1c4786;
  --label-orange: #82380f;
  --warning: #986700;
  --destructive: #c23b50;
  --control-bg: rgba(255, 255, 255, .8);
  --shadow-sm: 0 10px 30px rgba(42, 55, 99, .12);
  --shadow-md: 0 20px 48px rgba(42, 55, 99, .18);
}
.container { position: relative; z-index: 1; max-width: 1480px; padding: 24px 36px 96px; }
body { background: var(--background); }
.powered-by-pill {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100vw - 28px);
  padding: 9px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 12px 32px rgba(42, 55, 99, .2), inset 0 1px 0 rgba(255, 255, 255, .75);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  color: var(--muted-foreground);
  font-size: 12px;
  white-space: nowrap;
}
body::before {
  content: '';
  position: fixed;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 60% at 8% 18%, rgba(255, 170, 139, .9), transparent 78%),
    radial-gradient(ellipse 55% 72% at 84% 8%, rgba(103, 171, 228, .84), transparent 76%),
    radial-gradient(ellipse 45% 54% at 55% 46%, rgba(151, 147, 209, .52), transparent 78%),
    radial-gradient(ellipse 52% 68% at 88% 94%, rgba(250, 154, 94, .8), transparent 78%),
    linear-gradient(135deg, #efc8c4 0%, #c7d4e9 48%, #edba9f 100%);
  filter: blur(28px) saturate(1.14);
}
.navbar {
  position: relative;
  z-index: 40;
  padding: 8px 0;
  margin-bottom: 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.brand-title { font-size: 19px; }
.brand-icon { background: rgba(255, 255, 255, .7); border-radius: 10px; }
.btn { border-radius: 8px; font-weight: 500; }
.hex-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.hex-section-heading .connection-status { margin: 0; padding: 0; max-width: none; font-size: 11px; }
.hex-section-heading .connection-status[data-state="stale"] { padding: 3px 8px; border-radius: 6px; }
.hex-section-label { font-size: 11px; font-weight: 400; color: var(--success); }
.hex-section-label::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--success); border-radius: 50%; margin-right: 6px; }
.hex-stats { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr); gap: 18px; margin-bottom: 24px; align-items: center; }
.hex-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); min-width: 0; min-height: 240px; overflow: hidden; background: rgba(255, 255, 255, .61); border: 1px solid rgba(255, 255, 255, .68); border-radius: 20px; box-shadow: 0 22px 55px rgba(42, 55, 99, .16), inset 0 1px 0 rgba(255, 255, 255, .72); backdrop-filter: blur(22px) saturate(145%); -webkit-backdrop-filter: blur(22px) saturate(145%); }
.hex-stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; transition: background-color .25s ease; }
.hex-stat:nth-child(3n+2), .hex-stat:nth-child(3n+3) { border-left: 1px solid rgba(255, 255, 255, .52); }
.hex-stat:nth-child(n+4) { border-top: 1px solid rgba(255, 255, 255, .52); }
.hex-stat dt { font-size: 12px; font-weight: 400; color: var(--muted-foreground); }
.hex-stat dd { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hex-stat dd strong { font-size: 25px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; transition: color .25s ease; }
.hex-stat .unit { font-style: normal; font-size: .62em; font-weight: 500; letter-spacing: 0; color: var(--muted-foreground); margin-left: .22em; }
.hex-stat small { font-size: 11px; color: var(--muted-foreground); }
.hex-stat.is-idle dd strong { color: var(--muted-foreground); }
.hex-globe-panel { position: relative; min-width: 0; height: 340px; background: radial-gradient(circle at 54% 48%, rgba(255, 255, 255, .2), transparent 68%); }
.hex-globe-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.hex-globe-canvas:active { cursor: grabbing; }
.controls-bar { justify-content: flex-start; gap: 12px; margin-bottom: 18px; }
.node-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.hex-card { padding: 20px; border-radius: 14px; gap: 22px; min-width: 0; }
.hex-card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, .88); }
.node-card {
  background: rgba(250, 252, 255, .7);
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 16px 38px rgba(42, 55, 99, .14), inset 0 1px 0 rgba(255, 255, 255, .74);
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}
.node-card:hover { background: rgba(255, 255, 255, .82); box-shadow: 0 22px 48px rgba(42, 55, 99, .18); }
.hex-card.offline { opacity: 1; }
.hex-node-header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.hex-node-identity { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.hex-node-identity h2 { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.hex-region { font-size: 11px; color: var(--muted-foreground); }
.hex-system { grid-column: 1 / -1; color: var(--muted-foreground); font-size: 11px; overflow-wrap: anywhere; }
.hex-status { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 10px; color: var(--muted-foreground); background: var(--card-data-bg); border-radius: 5px; padding: 3px 6px; }
.hex-status i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.hex-status.is-online { color: var(--success); background: color-mix(in srgb, var(--success) 9%, transparent); }
.hex-resources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.hex-metric { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.metric-button { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.metric-button:hover .metric-name { color: var(--primary); text-decoration: underline; }
.metric-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 5px; border-radius: 3px; }
/* Every caption that opens a history chart carries a chart glyph and a bolder
   weight, so the click target reads as interactive without hovering. */
.metric-button .metric-name { font-weight: 600; }
.hex-network-total span { font-weight: 600; }
.metric-history-icon { width: 1em; height: 1em; margin-left: 3px; vertical-align: -0.15em; opacity: .55; }
.metric-button:hover .metric-history-icon,
.metric-button:focus-visible .metric-history-icon,
.hex-network-total:hover .metric-history-icon,
.hex-network-total:focus-visible .metric-history-icon { opacity: 1; }
.hex-metric .metric-meta { gap: 6px; align-items: center; }
.hex-metric .metric-meta strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hex-metric small { font-size: 10px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.progress-track { height: 3px; border: 0; border-radius: 1px; }
.progress-bar { border-radius: 1px; }
.hex-network { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 2px; }
.hex-network > div, .hex-network > button { display: flex; flex-direction: column; gap: 5px; align-items: center; min-width: 0; text-align: center; }
.hex-network-total { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.hex-network-total:hover span { text-decoration: underline; }
.hex-network-total:focus-visible { outline: 2px solid var(--primary); outline-offset: 5px; border-radius: 3px; }
.hex-network span { font-size: 11px; color: var(--primary); }
.hex-network-total span { color: var(--foreground); }
.hex-network > div:last-child span { color: var(--success); }
.hex-network strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hex-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hex-facts > div { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; text-align: center; }
.hex-facts > div + div { border-left: 1px solid var(--border); }
.hex-facts span, .hex-billing span { font-size: 11px; color: var(--muted-foreground); }
.hex-facts strong { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hex-probes { border-top: 1px solid var(--border); padding-top: 14px; }
.ping-panel { background: transparent; padding: 0; border-radius: 0; }
.panel-label { font-size: 11px; }
.ping-row-heading { font-size: 10px; }
.target-dot { width: 5px; height: 5px; }
.sample-bar { height: 8px; border-radius: 1px; }
.sample-bar.fast { background: var(--primary); opacity: .65; }
.sample-bar.received { background: var(--success); opacity: .65; }
.ping-empty { font-size: 11px; padding: 6px 0; }
.hex-billing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hex-billing > div { display: flex; flex-direction: column; gap: 4px; }
.hex-billing strong { font-size: 12px; font-weight: 500; }
.hex-billing small { font-size: 10px; color: var(--muted-foreground); }
.hex-card-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 14px; margin-top: auto; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 11px; overflow-wrap: anywhere; }
.hex-card-footer strong { font-weight: 500; }
.hex-card.offline .hex-network strong { color: var(--muted-foreground); }
/* Shared caption colors take precedence over built-in theme text defaults.
   Cards 2 and 3 stay muted: they are quiet at zero and turn red when alerting. */
body .hex-section-label,
body .hex-stat:nth-child(1) dt,
body .hex-stat:nth-child(5) dt,
body .hex-metric:nth-child(2) .metric-name,
body .hex-network > div:last-child span,
body .hex-facts > div:nth-child(3) > span,
body .hex-billing > div:nth-child(2) > span,
body .hex-probes .ping-panel:nth-child(1) .panel-label { color: var(--label-green); }
body .hex-stat:nth-child(4) dt,
body .hex-stat:nth-child(6) dt,
body .hex-metric:nth-child(1) .metric-name,
body .hex-metric:nth-child(4) .metric-name,
body .hex-network-total span,
body .hex-facts > div:nth-child(2) > span,
body .hex-probes .ping-panel:nth-child(2) .panel-label { color: var(--label-blue); }
body .hex-metric:nth-child(3) .metric-name,
body .hex-network > div:first-child span,
body .hex-facts > div:nth-child(1) > span,
body .hex-billing > div:nth-child(1) > span,
body .hex-card-footer::before { color: var(--label-orange); }
/* Alert states carry meaning, so they win over the positional caption colors. */
body .hex-stat.is-alert dt,
body .hex-stat.is-alert dd strong,
body .hex-stat.is-alert dd strong .unit { color: var(--destructive); }
body .hex-stat.is-alert { background: color-mix(in srgb, var(--destructive) 10%, var(--card-data-bg)); }
.hex-card-footer::before { content: "费用金额"; }
.modal { border-radius: 14px; }
@media (max-width: 1120px) {
  .node-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .container { padding-left: 24px; padding-right: 24px; }
  .hex-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(96px, 1fr)); min-height: 0; }
  .hex-stat:nth-child(3n+3) { border-left: 0; }
  .hex-stat:nth-child(even) { border-left: 1px solid rgba(255, 255, 255, .52); }
  .hex-stat:nth-child(odd) { border-left: 0; }
  .hex-stat:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .52); }
  .hex-stat { padding: 16px; }
  .hex-stat dd strong { font-size: 22px; }
}
@media (max-width: 900px) {
  .hex-stats { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .hex-globe-panel { height: 300px; }
}
@media (max-width: 720px) {
  .container { padding: 14px 14px 92px; }
  .navbar { gap: 12px; padding: 6px 0; margin-bottom: 20px; }
  .hex-stats { margin-bottom: 16px; }
  .hex-stats-grid { grid-template-rows: repeat(3, minmax(96px, 1fr)); }
  .hex-stat { padding: 14px; }
  .hex-stat dd strong { font-size: 20px; }
  .hex-globe-panel { height: 340px; }
  .node-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hex-card { padding: 18px; }
  .ping-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .hex-stats-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .hex-stat:nth-child(n) { border-left: 0; }
  .hex-stat:nth-child(n+2) { border-top: 1px solid rgba(255, 255, 255, .52); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Weekly direct-egress identity, immediately below the operating system. */
.node-network-identity { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; color: var(--muted-foreground); font-size: 11px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.node-network-identity > .node-asn { flex-basis: 100%; }
.node-google-region { display: inline-flex; align-items: center; gap: 5px; }
.node-google-region img { flex: 0 0 14px; width: 14px; height: 14px; }
.ss-detail-value > .node-network-identity { margin-top: 4px; }

/* Equal icon columns keep system, ASN and service-region rows aligned. */
.hex-system, .node-network-identity > .node-asn { display: flex; align-items: flex-start; gap: 5px; }
.hex-system > span, .node-asn > span { min-width: 0; }
.node-info-icon { display: block; flex: 0 0 1em; width: 1em; height: 1em; margin-top: .25em; }
.node-google-region img { flex-basis: 1em; width: 1em; height: 1em; }
