/* ...


 */

@import url('https://cdn.jsdelivr.net/npm/vanilla-cookieconsent@3.1.0/dist/cookieconsent.css');

:root {
  /* Brand */
  --navy:       #0d1b5e;
  --blue:       #3b9fe8;
  --green:      #22c55e;
  --yellow:     #eab308; /* slightly richer than pure F5C400 for legibility on white */
  --red:        #e83b3b;
  --purple:     #7c4ddb;

  /* Bar colors */
  --bar-fast:   #22c55e;
  --bar-medium: #eab308;
  --bar-slow:   #e83b3b;
  --bar-down:   #fecaca;
}

.btn-add {
  background-color: var(--navy);
}

.btn-add:hover {
  opacity: 0.9;
}

.btn-add:active {
  transform: scale(0.98);
}

/* =============================================
   SUMMARY PILLS
   ============================================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.pill-healthy {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  color: #16a34a;
}

.pill-down {
  background: rgba(232,59,59,0.08);
  border: 1px solid rgba(232,59,59,0.2);
  color: var(--red);
}

.pill-avg {
  background: #F8F9FB;
  border: 1px solid #E4E7EC;
  color: #667085;
  font-family: 'IBM Plex Mono', monospace;
}

.pill-uptime {
  background: rgba(59,159,232,0.07);
  border: 1px solid rgba(59,159,232,0.18);
  color: var(--blue);
  font-family: 'IBM Plex Mono', monospace;
}

/* =============================================
   COMPACT TIME TABS
   ============================================= */
.time-tabs {
  display: flex;
  background: white;
  border: 1px solid #E4E7EC;
  border-radius: 8px;
  overflow: hidden;
}

.time-tab {
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  color: #667085;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  font-family: 'IBM Plex Mono', monospace;
}

.time-tab:hover {
  background: #F2F4F7;
  color: #101828;
}

.time-tab.active {
  background: var(--navy);
  color: white;
}

/* =============================================
   SERVICE CARDS
   ============================================= */
.service-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(16,24,40,0.06), 0 1px 2px rgba(16,24,40,0.04);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: box-shadow 220ms;
}

.service-card:hover {
  box-shadow: 0 4px 16px rgba(16,24,40,0.09), 0 2px 4px rgba(16,24,40,0.04);
}

.service-card[data-status="down"] {
  background: #FFFAFA;
}

/* Reveal overlay */
.card-reveal {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 200px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.7) 40%,
    rgba(255,255,255,0.97) 65%
  );
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  border-radius: 0 12px 12px 0;
}

.service-card[data-status="down"] .card-reveal {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,250,250,0.7) 40%,
    rgba(255,250,250,0.97) 65%
  );
}

.service-card:hover .card-reveal {
  opacity: 1;
}

/* Status dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.up       { background: var(--green); }
.status-dot.degraded { background: var(--yellow); animation: pulse-yellow 2.4s infinite; }
.status-dot.down     { background: var(--red);    animation: pulse-red    1.8s infinite; }
.status-dot.unknown  { background: #98A2B3; }

@keyframes pulse-yellow {
  0%  { box-shadow: 0 0 0 0 rgba(234,179,8,0.5); }
  60% { box-shadow: 0 0 0 5px rgba(234,179,8,0); }
  100%{ box-shadow: 0 0 0 0 rgba(234,179,8,0); }
}

@keyframes pulse-red {
  0%  { box-shadow: 0 0 0 0 rgba(232,59,59,0.45); }
  60% { box-shadow: 0 0 0 6px rgba(232,59,59,0); }
  100%{ box-shadow: 0 0 0 0 rgba(232,59,59,0); }
}

/* =============================================
   SPARKLINE
   ============================================= */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 54px;
}

.spark-bar {
  flex: 1;
  min-width: 0;
  border-radius: 2px 2px 0 0;
  transform: scaleY(0);
  transform-origin: bottom;
  animation: barUp 0.18s ease forwards;
}

@keyframes barUp {
  to { transform: scaleY(1); }
}

.spark-bar.bar-fast   { background: var(--bar-fast); opacity: 0.6; }
.spark-bar.bar-medium { background: var(--bar-medium); opacity: 0.6; }
.spark-bar.bar-slow   { background: var(--bar-slow); opacity: 0.6; }
.spark-bar.bar-down   { background: var(--bar-down); }

/* =============================================
   NAV LINKS (header)
   ============================================= */
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: #667085;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms, background 150ms;
}

.nav-link:hover {
  color: #101828;
  background: #F2F4F7;
}

.nav-link.active {
  color: var(--navy);
}

/* Blue underline indicator aligned to the header border-b.
   The header uses py-4 (16px) below the h-14 flex container,
   so -20px clears both the padding and sits at the border. */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px 2px 0 0;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 100px;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: #E4E7EC;
  margin: 0 6px;
  flex-shrink: 0;
}

.nav-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  background: none;
  color: #667085;
  cursor: pointer;
  transition: color 150ms, background 150ms;
}

.nav-icon-btn:hover {
  color: #101828;
  background: #F2F4F7;
}

/* =============================================
   USER MENU
   ============================================= */
.avatar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 4px;
  border: 1px solid #E4E7EC;
  border-radius: 100px;
  background: none;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}

.avatar-btn:hover {
  border-color: #D0D5DD;
  background: #F9FAFB;
}

.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.avatar-name {
  font-size: 13px;
  font-weight: 500;
  color: #101828;
}

.avatar-chevron {
  color: #98A2B3;
  transition: transform 200ms;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 215px;
  background: white;
  border: 1px solid #E4E7EC;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  z-index: 50;
}

.dropdown-header-section {
  padding: 12px 14px;
  border-bottom: 1px solid #E4E7EC;
}

.dropdown-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #101828;
  margin-bottom: 2px;
}

.dropdown-user-email {
  font-size: 11.5px;
  font-family: 'IBM Plex Mono', monospace;
  color: #667085;
}

.dropdown-plan-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  padding: 2px 8px;
  background: rgba(59,159,232,0.08);
  border: 1px solid rgba(59,159,232,0.2);
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--blue);
}

.dropdown-items { padding: 4px; }

.dropdown-sep {
  height: 1px;
  background: #E4E7EC;
  margin: 4px 0;
}

.dropdown-item-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 4px;
  border: none;
  background: none;
  color: #667085;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: color 150ms, background 150ms;
  text-align: left;
  text-decoration: none;
}

.dropdown-item-link:hover {
  color: #101828;
  background: #F9FAFB;
}

.dropdown-item-link.danger { color: var(--red); }
.dropdown-item-link.danger:hover { background: rgba(232,59,59,0.06); color: var(--red); }

/* =============================================
   REFRESH BUTTON
   ============================================= */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: white;
  border: 1px solid #E4E7EC;
  border-radius: 8px;
  color: #667085;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
  flex-shrink: 0;
}

.refresh-btn:hover {
  background: #F2F4F7;
  color: #101828;
  border-color: #D0D5DD;
}

.refresh-btn.refreshing {
  color: var(--navy);
  border-color: var(--navy);
}

.refresh-btn.refreshing .refresh-icon {
  animation: spin-refresh 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes spin-refresh {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =============================================
   INCIDENT BANNER
   ============================================= */
.incident-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  animation: pulse-red 1.8s infinite;
}

/* =============================================
   APP FOOTER
   ============================================= */
.app-footer {
  border-top: 1px solid #E4E7EC;
  background: white;
}

.app-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Status cluster */
.footer-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.footer-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse-green 2.4s infinite;
}

@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  60%  { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.footer-status-text {
  font-size: 12px;
  font-weight: 500;
  color: #16a34a;
}

.footer-status-sep {
  width: 1px;
  height: 12px;
  background: #E4E7EC;
  flex-shrink: 0;
}

.footer-status-link {
  font-size: 12px;
  color: #667085;
  text-decoration: none;
  transition: color 150ms;
}

.footer-status-link:hover { color: #101828; }

/* Right links */
.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link {
  font-size: 12px;
  color: #98A2B3;
  text-decoration: none;
  transition: color 150ms;
  white-space: nowrap;
}

.footer-link:hover { color: #667085; }

.footer-copy {
  font-size: 12px;
  color: #D0D5DD;
  white-space: nowrap;
}

/* =============================================
   SERVICE DETAIL DRAWER
   ============================================= */

/* Backdrop */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16,24,40,0.8);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 280ms ease;
  pointer-events: none;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* Grayscale on background content when drawer is open */
body.drawer-open > header,
body.drawer-open > main {
  filter: grayscale(60%);
  transition: filter 280ms ease;
}

/* Drawer panel */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
  width: 70%;
  background: white;
  box-shadow: -12px 0 48px rgba(16,24,40,0.12), -1px 0 0 #E4E7EC;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.32, 0, 0.15, 1);
}
.drawer.open { transform: translateX(0); }

/* Drawer header (service identity section) */
.drawer-header {
  flex-shrink: 0;
  padding: 20px 24px 0;
  border-bottom: 1px solid #E4E7EC;
  background: white;
}
.drawer-header-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.drawer-identity { display: flex; align-items: flex-start; gap: 10px; }

.drawer-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}
.drawer-status-dot.up       { background: var(--green); }
.drawer-status-dot.degraded { background: var(--yellow); animation: pulse-yellow 2.4s infinite; }
.drawer-status-dot.down     { background: var(--red);    animation: pulse-red 1.8s infinite; }
.drawer-status-dot.unknown  { background: #98A2B3; }

.drawer-name { font-size: 20px; font-weight: 600; color: var(--navy); letter-spacing: -0.03em; line-height: 1.2; }
.drawer-url  { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--blue); margin-top: 2px; }

.drawer-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.drawer-action-btn {
  height: 30px; display: flex; align-items: center; gap: 5px;
  padding: 0 10px; border: 1px solid #E4E7EC; border-radius: 4px;
  background: none; font-size: 12px; font-weight: 500; color: #667085;
  cursor: pointer; transition: background 150ms, color 150ms, border-color 150ms;
}
.drawer-action-btn:hover { background: #F2F4F7; color: #101828; border-color: #D0D5DD; }

.drawer-close-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 4px;
  color: #98A2B3; cursor: pointer; transition: background 150ms, color 150ms;
}
.drawer-close-btn:hover { background: #F2F4F7; color: #101828; }

.drawer-meta-row {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 14px; flex-wrap: wrap;
}
.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 100px; font-size: 11.5px; font-weight: 500;
}
.status-chip.up       { background: rgba(34,197,94,0.1);  color: #16a34a; }
.status-chip.degraded { background: rgba(234,179,8,0.1);  color: #92400e; }
.status-chip.down     { background: rgba(232,59,59,0.1);  color: var(--red); }
.status-chip.unknown  { background: #F2F4F7;               color: #667085; }

.drawer-meta-sep { width: 3px; height: 3px; border-radius: 50%; background: #98A2B3; flex-shrink: 0; }
.drawer-meta-text { font-size: 12px; color: #98A2B3; }

/* Drawer tabs strip */
.drawer-tabs {
  flex-shrink: 0; display: flex; align-items: center;
  padding: 0 24px; border-bottom: 1px solid #E4E7EC;
  background: white;
}
.drawer-tab {
  position: relative; padding: 11px 12px;
  font-size: 13px; font-weight: 500; color: #667085;
  border: none; background: none; white-space: nowrap; cursor: pointer;
  transition: color 150ms;
}
.drawer-tab:hover { color: #101828; }
.drawer-tab.active { color: var(--navy); }
.drawer-tab.active::after {
  content: ''; position: absolute; bottom: -1px;
  left: 12px; right: 12px; height: 2px;
  background: var(--blue); border-radius: 2px 2px 0 0;
}

/* Scrollable body */
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Section label */
.section-label {
  font-size: 11px; font-weight: 600; color: #98A2B3;
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 14px;
}

/* ── Performance stat strip ── */
.perf-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid #E4E7EC;
}
.perf-stat {
  display: flex; flex-direction: column;
  padding: 18px 16px 16px;
  border-right: 1px solid #E4E7EC;
}
.perf-stat:last-child { border-right: none; }
.perf-stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px; font-weight: 500; line-height: 1; letter-spacing: -0.03em;
}
.perf-stat-unit { font-size: 11px; color: #98A2B3; font-weight: 400; }
.perf-stat-label { font-size: 11px; color: #98A2B3; margin-top: 6px; }
.pv-fast { color: #16a34a; }
.pv-good { color: #101828; }
.pv-warn { color: #92400e; }
.pv-slow { color: var(--red); }
.pv-none { color: #98A2B3; font-size: 16px; }

/* ── Chart section (drawer) ── */
.chart-section { padding: 20px 24px; border-bottom: 1px solid #E4E7EC; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chart-title { font-size: 13px; font-weight: 600; color: #101828; }

.drawer-time-selector {
  display: flex; background: #F2F4F7;
  border: 1px solid #E4E7EC; border-radius: 8px; overflow: hidden;
}
.drawer-time-btn {
  padding: 4px 9px; font-size: 11.5px; font-weight: 500;
  font-family: 'IBM Plex Mono', monospace; color: #667085;
  background: none; border: none; cursor: pointer; transition: background 150ms, color 150ms;
}
.drawer-time-btn:hover { background: white; color: #101828; }
.drawer-time-btn.active { background: var(--navy); color: #fff; }

/* ── Incident history (Performance tab) ── */
.incidents-section { padding: 20px 24px 32px; }
.incidents-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.incidents-title { font-size: 13px; font-weight: 600; color: #101828; }
.incidents-link { font-size: 12px; color: var(--blue); font-weight: 500; text-decoration: none; }

.incident-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-top: 1px solid #E4E7EC;
}
.incident-row:first-child { border-top: none; padding-top: 0; }
.incident-dot-col { flex-shrink: 0; padding-top: 3px; }
.incident-dot { width: 8px; height: 8px; border-radius: 50%; }
.incident-dot.open     { background: var(--red);    animation: pulse-red 1.8s infinite; }
.incident-dot.resolved { background: #98A2B3; }
.incident-dot.degraded { background: var(--yellow); }
.incident-body { flex: 1; }
.incident-title { font-size: 13px; font-weight: 500; color: #101828; margin-bottom: 2px; }
.incident-meta  { font-size: 11.5px; color: #98A2B3; font-family: 'IBM Plex Mono', monospace; }
.incident-badge { flex-shrink: 0; display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 500; }
.badge-open     { background: rgba(232,59,59,0.1);  color: var(--red); }
.badge-resolved { background: #F2F4F7;               color: #98A2B3; }
.badge-degraded { background: rgba(234,179,8,0.1);  color: #92400e; }
.incidents-empty {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px; background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.18); border-radius: 8px;
}
.incidents-empty-icon { flex-shrink: 0; color: #16a34a; }
.incidents-empty-text { font-size: 13px; font-weight: 500; color: #16a34a; }
.incidents-empty-sub  { font-size: 12px; color: #98A2B3; margin-top: 2px; }

/* ── uPlot CSS (from uPlot@1.6.32/dist/uPlot.min.css) ── */
.uplot,.uplot *,.uplot *::before,.uplot *::after{box-sizing:border-box;}
.uplot{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;line-height:1.5;width:min-content;}
.u-wrap{position:relative;user-select:none;}
.u-over,.u-under{position:absolute;}
.u-under{overflow:hidden;}
.uplot canvas{display:block;position:relative;width:100%;height:100%;}
.u-axis{position:absolute;}
.u-select{background:rgba(0,0,0,.07);position:absolute;pointer-events:none;}
.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform;}
.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B;}
.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B;}
.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box !important;}
.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none;}

/* ── Chart tooltip ── */
.u-tooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: rgba(16,24,40,0.88); color: #fff;
  padding: 5px 10px; border-radius: 5px;
  font-size: 11.5px; white-space: nowrap;
  transform: translate(-50%, -100%);
  margin-top: -8px;
}
.u-tt-time { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: #98A2B3; margin-right: 6px; }
.u-tt-val  { font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
.u-tt-unit { font-size: 10px; color: #98A2B3; }
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  /* Overlay scrollbars - don't take up content space */
  html {
    scrollbar-width:  thin;
    scrollbar-color:  rgba(156, 163, 175, 0.5) transparent;
    scrollbar-gutter: stable; /* Prevent layout shift */
  }

  /* For Webkit browsers (Chrome, Safari, Edge) */
  html::-webkit-scrollbar {
    width: 8px;
    /* Position scrollbar as overlay */
  }

  html::-webkit-scrollbar-track {
    background: transparent;
  }

  html::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.3);
    border-radius:    4px;
    border:           2px solid transparent;
    background-clip:  content-box;
    transition:       background-color 0.2s ease;
  }

  html::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.6);
  }

  /* Force overlay behavior */
  * {
    scrollbar-width: thin;
  }

  /* Modern overlay scrollbars (supported in newer browsers) */
  @supports (scrollbar-gutter: stable) {
    html {
      scrollbar-gutter: stable both-edges; /* Prevent content shift */
    }
  }

  /* Alternative: Use CSS to force overlay positioning */
  body {
    position: relative;
  }

  /* Custom overlay scrollbar for specific containers if needed */
  .overlay-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
  }

  .overlay-scroll::-webkit-scrollbar {
    width:    6px;
    position: absolute;
    right:    0;
  }

  .overlay-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.3);
    border-radius:    3px;
  }
}

@layer components {
  /* Custom font classes for page titles */
  .font-title-inter {
    font-family: 'Inter', sans-serif;
  }

  .font-title-space-mono {
    font-family: 'Space Mono', monospace;
  }

  /* Page title styles with different fonts */
  .page-title-inter {
    font-family:    'Inter', sans-serif;
    font-weight:    600;
    letter-spacing: -0.025em;
  }

  .page-title-space-mono {
    font-family:    'Space Mono', monospace;
    font-weight:    700;
    letter-spacing: -0.05em;
  }
}
.chart {
  width:  100%;
  height: 128px;
}

.chart canvas {
  width:  100%;
  height: 100%;
}

h1 {
  font-size:     1.5em;
  margin-bottom: 10px;
}
/* app/assets/stylesheets/variant_switcher.css
 *
 * Import this in application.css (development only, or always — it's a no-op
 * in production since the partial only renders in development):
 *
 *   @import "variant_switcher";
 *
 * Or inline it in your layout inside <% if Rails.env.development? %>
 */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --vs-bg:            #0f0f10;
  --vs-bg-hover:      #1a1a1e;
  --vs-border:        #2a2a30;
  --vs-accent:        #7c6dff;
  --vs-accent-dim:    rgba(124, 109, 255, 0.15);
  --vs-text:          #e8e8f0;
  --vs-text-muted:    #666680;
  --vs-active-bg:     rgba(124, 109, 255, 0.12);
  --vs-active-border: #7c6dff;
  --vs-shadow:        0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  --vs-radius:        10px;
  --vs-font:          'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --vs-z:             2147483647; /* max z-index */
}

/* ── Panel ─────────────────────────────────────────────────────────────────── */
.vs-panel {
  position:       fixed;
  bottom:         24px;
  right:          24px;
  z-index:        var(--vs-z);
  width:          220px;
  background:     var(--vs-bg);
  border:         1px solid var(--vs-border);
  border-radius:  var(--vs-radius);
  box-shadow:     var(--vs-shadow);
  font-family:    var(--vs-font);
  font-size:      11px;
  color:          var(--vs-text);
  user-select:    none;
  overflow:       hidden;
  transition:     box-shadow 0.15s ease;
  /* Ensure it doesn't interfere with the page layout */
  pointer-events: auto;
}

.vs-panel.vs-dragging {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor:     grabbing;
}

/* ── Header / drag handle ──────────────────────────────────────────────────── */
.vs-header {
  display:       flex;
  align-items:   center;
  gap:           7px;
  padding:       9px 12px;
  cursor:        grab;
  border-bottom: 1px solid transparent;
  transition:    border-color 0.15s, background 0.15s;
}

.vs-header:hover {
  background: var(--vs-bg-hover);
}

.vs-panel.vs-expanded .vs-header {
  border-bottom-color: var(--vs-border);
}

.vs-logo {
  color:       var(--vs-accent);
  flex-shrink: 0;
  display:     flex;
  align-items: center;
}

.vs-title {
  font-weight:    600;
  letter-spacing: 0.04em;
  color:          var(--vs-text);
  flex:           1;
  font-size:      10px;
  text-transform: uppercase;
}

.vs-current-badge {
  font-size:      9px;
  padding:        2px 6px;
  background:     var(--vs-accent-dim);
  color:          var(--vs-accent);
  border-radius:  4px;
  border:         1px solid rgba(124, 109, 255, 0.3);
  letter-spacing: 0.02em;
  max-width:      70px;
  overflow:       hidden;
  text-overflow:  ellipsis;
  white-space:    nowrap;
}

.vs-chevron {
  color:       var(--vs-text-muted);
  display:     flex;
  align-items: center;
  transition:  transform 0.2s ease;
  flex-shrink: 0;
}

.vs-panel.vs-expanded .vs-chevron {
  transform: rotate(180deg);
}

/* ── Body (collapsible) ────────────────────────────────────────────────────── */
.vs-body {
  display:        none;
  flex-direction: column;
  padding:        6px;
  gap:            2px;
  max-height:     320px;
  overflow-y:     auto;
}

.vs-body::-webkit-scrollbar {
  width: 4px;
}

.vs-body::-webkit-scrollbar-track {
  background: transparent;
}

.vs-body::-webkit-scrollbar-thumb {
  background:    var(--vs-border);
  border-radius: 2px;
}

.vs-panel.vs-expanded .vs-body {
  display: flex;
}

/* ── Variant buttons ───────────────────────────────────────────────────────── */
.vs-btn {
  display:        flex;
  align-items:    flex-start;
  gap:            8px;
  padding:        7px 9px;
  background:     transparent;
  border:         1px solid transparent;
  border-radius:  6px;
  color:          var(--vs-text);
  cursor:         pointer;
  text-align:     left;
  font-family:    var(--vs-font);
  font-size:      11px;
  transition:     background 0.1s, border-color 0.1s;
  flex-direction: column;
  gap:            2px;
}

.vs-btn:hover {
  background:   var(--vs-bg-hover);
  border-color: var(--vs-border);
}

.vs-btn.vs-active {
  background:   var(--vs-active-bg);
  border-color: var(--vs-active-border);
  color:        #b8b0ff;
}

.vs-btn .vs-dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--vs-text-muted);
  flex-shrink:   0;
  margin-top:    3px;
  /* Keep dot in a row with label */
  align-self:    flex-start;
  display:       inline-block;
}

/* Put dot and label on same row */
.vs-btn {
  flex-direction: row;
  align-items:    flex-start;
  flex-wrap:      wrap;
}

.vs-btn-label {
  flex:        1;
  line-height: 1.4;
}

.vs-btn.vs-active .vs-dot {
  background: var(--vs-accent);
  box-shadow: 0 0 6px rgba(124, 109, 255, 0.6);
}

.vs-btn-desc {
  display:      block;
  width:        100%;
  padding-left: 14px;
  font-size:    9.5px;
  color:        var(--vs-text-muted);
  line-height:  1.4;
  margin-top:   1px;
}

/* ── Keyboard hint ─────────────────────────────────────────────────────────── */
.vs-shortcut {
  font-size:      9px;
  color:          var(--vs-text-muted);
  text-align:     center;
  padding:        6px 6px 4px;
  letter-spacing: 0.03em;
  border-top:     1px solid var(--vs-border);
  margin-top:     4px;
}

/* ── In-page variant badge (overlaid on the active variant block) ─────────── */
.vs-variant-wrapper {
  position: relative;
}

.vs-variant-badge {
  position:       absolute;
  top:            6px;
  left:           6px;
  z-index:        calc(var(--vs-z) - 1);
  font-family:    var(--vs-font);
  font-size:      9px;
  font-weight:    600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding:        3px 8px;
  background:     var(--vs-accent);
  color:          #fff;
  border-radius:  4px;
  pointer-events: none;
  opacity:        0.85;
}

.vs-variant-badge--default {
  background: #3a8a4a;
}
