/* Native adaptation inspired by tom2almighty/monitor-theme-design (MIT).
 * See third-party-notices.txt. Uses VibeMonitor's existing controls and data.
 */
:root {
  color-scheme: light;
  --background: #eeece8;
  --foreground: #36352f;
  --card-bg: #fdfcf9;
  --card-hover: #fffefa;
  --card-data-bg: #f4f2ed;
  --primary: #b65b3c;
  --primary-light: #f5e8df;
  --primary-text: #fff;
  --muted: #f1eee7;
  --muted-foreground: #706f66;
  --border: #e1dfd8;
  --border-focus: #b65b3c;
  --success: #059669;
  --label-green: #0a7252;
  --label-blue: #245d9c;
  --label-orange: #a04b13;
  --warning: #b7791f;
  --destructive: #c2413c;
  --control-bg: #fffefa;
  --shadow-sm: 0 1px 3px rgba(54, 53, 47, .05);
  --shadow-md: 0 3px 10px rgba(54, 53, 47, .06);
  --shadow-lg: 0 12px 36px rgba(54, 53, 47, .12);
}
body { background: var(--background); }
body::before {
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='.13'/%3E%3C/svg%3E") repeat;
  filter: none;
  opacity: .4;
}
::selection { background: var(--primary-light); color: var(--foreground); }
.container {
  max-width: 1480px;
  width: calc(100% - 48px);
  margin: 32px auto 96px;
  padding: 24px 28px 28px;
  background: rgba(253, 252, 249, .94);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 18px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.navbar {
  margin-bottom: 24px;
  padding: 0 0 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
.brand-title { color: var(--foreground); font-size: 18px; font-weight: 650; }
.hex-section-label { font-size: 13px; font-weight: 650; color: var(--foreground); }
.hex-section-label::before { background: var(--success); }
.hex-stats { display: block; margin-bottom: 24px; }
.hex-globe-panel { display: none; }
/* 1px gaps over a bordered grid draw the dividers at any column count. */
.hex-stats-grid {
  --hex-stat-columns: 3;
  grid-template-columns: repeat(var(--hex-stat-columns), minmax(0, 1fr));
  grid-template-rows: auto;
  gap: 1px;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.hex-stat:nth-child(n) { padding: 16px 20px; gap: 8px; border: 0; background: var(--card-data-bg); }
.hex-stat dd strong { font-size: 22px; letter-spacing: -.4px; }
.hex-stat small { font-size: 11px; }
.controls-bar { margin-bottom: 14px; }
.node-grid { grid-template-columns: minmax(0, 1fr); gap: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.node-card, .node-card:hover { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.hex-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr)) minmax(0, 7.8fr);
  grid-template-areas:
    "identity identity identity resources"
    "network network network resources"
    "facts facts facts probes"
    "billing billing price probes";
  align-items: start;
  gap: 6px 6px;
  padding: 10px 0;
}
.hex-card + .hex-card { border-top: 1px solid var(--border); }
.hex-card:hover { transform: none; background: var(--card-data-bg); }
.hex-node-header { grid-area: identity; gap: 10px; }
.hex-node-identity h2 { font-size: 14px; font-weight: 650; }
.hex-node-identity { row-gap: 4px; }
/* Keep system, ASN, service regions and resource captions at one text level. */
.hex-system,
.node-network-identity,
body .hex-card .hex-metric .metric-name {
  color: var(--muted-foreground);
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}
/* Clickable metrics keep the caption tone but turn bold, use the body ink and
   step up to the value size, so the chart behind each one is easy to find. */
body .hex-card .hex-metric.metric-button .metric-name { color: var(--foreground); font-size: 12px; font-weight: 650; }
/* Higher specificity than the flat caption rule above, which would otherwise
   keep the hover and keyboard focus colour muted. */
body .hex-card .metric-button:hover .metric-name,
body .hex-card .metric-button:focus-visible .metric-name { color: var(--primary); }
.node-network-identity { gap: 4px 12px; }
.node-google-region { gap: 5px; }
.node-google-region img { flex-basis: 1em; width: 1em; height: 1em; }
.hex-status { padding: 3px 6px; border-radius: 5px; background: var(--card-data-bg); }
.hex-status.is-online { background: color-mix(in srgb, var(--success) 12%, transparent); }
.hex-resources { grid-area: resources; margin-left: 18px; gap: 6px 16px; }
.hex-metric { gap: 3px; }
.hex-metric .metric-meta strong { font-size: 12px; font-weight: 500; }
.hex-metric .metric-name { font-size: 11px; }
.progress-track { height: 4px; border-radius: 99px; background: #e6e5e0; }
.progress-bar { border-radius: 99px; background: var(--success); }
.progress-bar.high { background: var(--warning); }
.progress-bar.critical { background: var(--destructive); }
.hex-network { grid-area: network; padding-top: 0; gap: 8px; }
.hex-network > div, .hex-network > button { align-items: flex-start; gap: 2px; text-align: left; }
.hex-network strong { font-size: 13px; }
.hex-network span { font-size: 10px; }
.hex-facts { grid-area: facts; }
.hex-facts > div { align-items: flex-start; gap: 2px; text-align: left; }
.hex-facts > div + div { border: 0; }
.hex-facts strong { font-size: 10px; }
.hex-probes { grid-area: probes; margin-left: 18px; padding: 0; border: 0; }
.hex-billing { grid-area: billing; padding: 0; gap: 6px; border: 0; background: transparent; border-radius: 0; }
.hex-billing > div { gap: 2px; }
.hex-card-footer { grid-area: price; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 0; border: 0; padding: 0; font-size: 11px; }
.hex-card-footer strong { color: var(--foreground); font-size: 12px; }
.hex-probes .ping-sample-row { padding-top: 4px; }
.hex-probes .ping-row-heading { margin-bottom: 4px; }
.sample-bar { height: 6px; border-radius: 2px; }
.sample-bar.fast { background: var(--success); opacity: .8; }
.btn { border-radius: 7px; background: var(--control-bg); box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--muted); }
.btn-primary, .btn.active { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 86%, #000); }
.btn-danger { background: var(--destructive); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--destructive) 86%, #000); }
.site-menu-panel, .modal { background: rgba(253, 252, 249, .98); border: 1px solid var(--border); box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.modal { border-radius: 12px; }
.modal-title { font-size: 17px; }
.modal-overlay { background: rgba(54, 53, 47, .28); }
.form-input, .form-select, .form-textarea { background: var(--control-bg); border-color: var(--border); border-radius: 7px; }
.theme-row { background: var(--card-bg); border-radius: 8px; }
/* Retain shared fixed positioning, safe-area inset and horizontal centering. */
.powered-by-pill { background: rgba(253, 252, 249, .94); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
/* Wide screens fit all six metrics in one strip. */
@media (min-width: 1320px) {
  .hex-stats-grid { --hex-stat-columns: 6; }
}
@media (max-width: 1120px) {
  .hex-card { grid-template-columns: repeat(3, minmax(80px, 1fr)) minmax(0, 5.4fr); }
  .hex-stats-grid { --hex-stat-columns: 2; }
  .hex-stat:nth-child(n) { padding: 14px; }
}
@media (max-width: 720px) {
  .container { width: calc(100% - 24px); margin-top: 18px; padding: 18px 14px; border-radius: 12px; }
  .hex-stat dd strong { font-size: 20px; }
  .hex-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "identity identity identity"
      "network network network"
      "facts facts facts"
      "billing billing price"
      "resources resources resources"
      "probes probes probes";
    padding: 10px 0;
    gap: 8px 6px;
  }
  .hex-resources, .hex-probes { margin-left: 0; }
  .hex-facts strong { font-size: 11px; }
}
@media (max-width: 360px) {
  .hex-stats-grid { --hex-stat-columns: 1; }
}
