/* ==========================================
   DETAILS WRAPPER
========================================== */

.details-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.details-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--text-muted);
}

/* Bubble container */
.details-bubble {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    background: var(--card-bg);
    padding: 14px 16px;
}

/* Placeholder (when nothing selected) */
.details-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 8px;
}

.details-placeholder-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.details-placeholder-hint {
  font-size: 0.75rem;
  opacity: 0.8;
}

.details-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
}

.details-pill.update-health {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    margin-right: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

/* Colour mapping (backend authoritative) */
.details-pill.update-health.green {
    background-color: #0f766e;
    color: #99f6e4;
}

.details-pill.update-health.red,
.details-pill.update-health.amber {
    background-color: #b45309;
    color: #ffedd5;
}

.priority-pill {
  background: #c62828;
  color: #ffffff;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.priority-text {
  font-size: 13px;
  color: #c62828;
  white-space: nowrap;
}

.btn-edit-primary {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-edit-primary:hover {
    background: #1d4ed8;
}

.details-actions-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Header block inside panel */
.details-header-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.details-name {
  font-size: 1rem;
  font-weight: 600;
}

.details-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.details-status {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  
}

/* Grid summary (optional top area) */
/* Grid summary (top metadata strip) */
.details-grid-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.details-field-value {
  font-size: 0.82rem;
  display: grid;
  grid-template-columns: auto;
  align-items: start;
  column-gap: 0px;
  min-height: 24px;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.details-field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
}



.details-status-block {
  margin-left: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;

}


/* ==========================================
   SECTIONS
========================================== */

.details-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.85rem;
}

.details-section h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* ==========================================
   FIELD ROWS
========================================== */

.detail-row {
  display: flex;
  padding: 3px 0;
  border-bottom: 1px solid rgba(150,150,150,0.15);
}

.detail-row:last-child {
  border-bottom: none;
}

.d-label {
  width: 180px;
  font-weight: 600;
  opacity: 0.75;
}

.subsection-title {
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.6;
}

.bad {
  color: #e74c3c;
  font-weight: bold;
}

.btn-danger {
    background: #d9534f;
    color: white;
}

.btn-danger:hover {
    background: #c9302c;
}

/* ================================
   STATUS BADGE + IMPROVED TOOLTIP
================================= */
.details-status { 
    position: relative;
    cursor: default;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
    width: auto !important;
    min-width: 64px;
    max-width: fit-content;
  }

/* Make UPDATE pill match Status pill size/shape exactly */
.details-pill.update-health {
    position: relative;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
    width: auto;
    min-width: 64px;
    max-width: fit-content;
    line-height: 1.3; 
}


/* Color badges */
.details-status.green {
    background: #1f7a1f;
    color: white;
}
.details-status.amber {
    background: #ffca28;
    color: black;
}
.details-status.red {
    background: #d32f2f;
    color: white;
}

/* ===========================
   Traffic-light metric dots (TEXT-BASED)
=========================== */

.metric-line {
    font-size: 0.78rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.1rem;
    color: #e5e7eb; /* default neutral */
}
/* ===========================
   Tooltip metric severity FIX
=========================== */

.details-metric-line {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.15rem;
    color: #e5e7eb;
}

/* Dot base */
.details-metric-line .metric-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Dot colours */
.details-metric-line.green .metric-dot {
    background-color: #22c55e;
}

.details-metric-line.amber .metric-dot {
    background-color: #f59e0b;
}

.details-metric-line.red .metric-dot {
    background-color: #ef4444;
}

/* Emphasise the triggering metric */
.details-metric-line.amber {
    color: #fbbf24;
    font-weight: 500;
}

.details-metric-line.red {
    color: #f87171;
    font-weight: 500;
}


/* ===========================
   Tooltip container (unchanged)
=========================== */

.swam-tooltip {
    position: fixed !important;
    display: none;
    background: rgba(25, 25, 25, 0.97);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 260px;
    min-width: 180px;
    font-size: 0.82rem;
    line-height: 1.25rem;
    z-index: 999999 !important;
    pointer-events: none;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
}


/* ==== FIXED SCROLL BEHAVIOUR FOR DETAILS PANEL ==== */

/* Allow the bubble to scroll when content is long */
.details-bubble {
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Wrapper should not override overflow anymore */
.details-wrapper {
    overflow: visible;     /* No !important */
    position: relative;
}

/* Panel itself inherits scroll rules normally */
#detailsPanel {
    overflow: visible;     /* No !important */
    position: relative;
    max-height: 100%;      /* ensures bubble can scroll internally */
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.network-adapter {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.network-adapter .title {
  font-weight: 600;
  margin-bottom: 4px;
}

.agent-version-badge {
    position: absolute;
    bottom: 10px;
    right: 14px;

    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.03em;

    pointer-events: none; /* totally passive */
    user-select: none;
}
/* -----------------------------------------
   Agent Version Badge – Light + Dark Safe
----------------------------------------- */
.agent-version-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;

    /* LIGHT MODE */
    background: rgba(0, 0, 0, 0.08);
    color: #111;
}

/* DARK MODE — Agent version badge */
body.theme-dark .agent-version-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}


.detail-value.swam-id {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 0.85rem;
}

.copy-icon {
    cursor: pointer;
    opacity: 0.6;
}

.copy-icon:hover {
    opacity: 1;
}

.details-panel {
    position: relative;
}

.tv-link {
    color: #22c55e;
    font-weight: 500;
    text-decoration: none;
}

.tv-link:hover {
    text-decoration: underline;
}

.details-actions {
    position: absolute;
    bottom: 16px;
    right: 16px;
}

/* =====================================================
   UNINSTALL TOGGLE — SHARED BASE
   ===================================================== */

.btn-uninstall-toggle {
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

/* =====================================================
   UNINSTALL (RED) — LIGHT & DARK MODE
   ===================================================== */

.btn-uninstall-toggle.uninstall {
    background: #dc2626; /* red */
    color: #ffffff;
}

.btn-uninstall-toggle.uninstall:hover {
    background: #e77b7b;
}

/* =====================================================
   CANCEL UNINSTALL (GREY) — LIGHT & DARK MODE
   ===================================================== */

.btn-uninstall-toggle.cancel {
    background: #6b7280; /* neutral grey */
    color: #ffffff;
}

.btn-uninstall-toggle.cancel:hover {
    background: #4b5563;
}

/* =====================================================
   LEGACY SUPPORT (DO NOT REMOVE)
   ===================================================== */

.btn-uninstall {
    background: #dc2626;
    color: white;
}

.btn-cancel-uninstall {
    background: #6b7280;
    color: white;
}

/* -----------------------------------------
   Details header actions (new edit UI)
------------------------------------------ */

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.details-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}


.details-hostname {
  font-weight: 700;
}

.details-header-actions {
  margin-left: auto;   /* critical */
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Buttons */
.d-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.12s ease, border-color 0.12s ease;
  user-select: none;
}

.d-btn:active {
  transform: translateY(1px);
}

.d-btn-ghost {
  background: rgba(255,255,255,0.06);
  color: inherit;
}

.d-btn-ghost:hover {
  border-color: rgba(255,255,255,0.28);
}

.d-btn-primary {
  background: rgba(37, 99, 235, 0.95);
  border-color: rgba(37, 99, 235, 0.95);
  color: #fff;
}

.d-btn-primary:hover {
  opacity: 0.95;
}

/* Editing inputs */
.detail-edit-input,
.detail-edit-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.20);
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.detail-edit-textarea {
  min-height: 90px;
  resize: vertical;
}

.d-btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
}

.d-btn-danger:hover {
    background: #dc2626;
}

.details-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);

    display: flex;
    align-items: center;
    justify-content: space-between; /* ← key change */
    gap: 16px;
}

.footer-swam-id {
    flex-shrink: 0;
}

.details-content-flow {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0; /* critical for zoom + overflow */
}
.details-flex-spacer {
    flex: 1 1 auto;
}

/* =====================================================
   LIGHT MODE — DETAILS PANEL CONTRAST FIX
   ===================================================== */

body.theme-light .details-bubble {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.18);
}

/* Section separators */
body.theme-light .details-section {
    border-top: 1px dashed rgba(15, 23, 42, 0.18);
}

/* Field rows */
body.theme-light .detail-row {
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

/* Labels vs values */
body.theme-light .d-label {
    color: #334155;
    opacity: 0.9;
}

body.theme-light .d-value {
    color: #0f172a;
}


body.theme-light .details-status.amber {
    background: #f59e0b;          /* true amber (Tailwind amber-500) */
    color: #1f2937;               /* dark slate text */
    border: 1px solid #d97706;    /* amber-600 outline */
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
/* =====================================================
   LIGHT MODE — BUTTON POLISH
   ===================================================== */

body.theme-light .d-btn {
    border: 1px solid rgba(15, 23, 42, 0.18);
}

/* Primary (Edit / Save) */
body.theme-light .d-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

body.theme-light .d-btn-primary:hover {
    background: #1d4ed8;
}

/* Danger (Delete / Uninstall) */
body.theme-light .d-btn-danger,
body.theme-light .btn-uninstall-toggle.uninstall {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

body.theme-light .d-btn-danger:hover,
body.theme-light .btn-uninstall-toggle.uninstall:hover {
    background: #b91c1c;
}
/* Network cards – accent consistency */
.network-adapter {
    border-left: 4px solid var(--accent);
    background: var(--card-bg);
}

.theme-light .network-adapter {
    border-left-color: var(--accent);
    background: #f9fafb;
}

/* =========================================
   NETWORK CARDS — LIGHT MODE (MATCH DARK)
   ========================================= */

body.theme-light .network-adapter {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-left-width: 4px; /* same as dark */
    border-radius: 12px;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 6px 14px rgba(0, 0, 0, 0.08);
}

/* Preserve exact accent logic */
body.theme-light .network-adapter.lan {
    border-left-color: #22c55e; /* green */
}

body.theme-light .network-adapter.wifi {
    border-left-color: #3b82f6; /* blue */
}

body.theme-light .network-adapter .title {
    color: #0f172a;
}

.status-explanation {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.4;
    color: #e5e7eb; /* light text on dark bg */
}

/* Light mode: darker text is readable */
body.theme-light .details-status.red + .status-explanation {
  color: #7f1d1d;
}

body.theme-light .details-status.amber + .status-explanation {
  color: #78350f;
}

/* Dark mode: keep it bright so it's visible */
body:not(.theme-light) .details-status.red + .status-explanation {
  color: #fecaca; /* light red */
}

body:not(.theme-light) .details-status.amber + .status-explanation {
  color: #fde68a; /* light amber */
}



.network-adapter.lan    { border-left: 4px solid #22c55e; }
.network-adapter.wifi   { border-left: 4px solid #3b82f6; }
.network-adapter.virtual{ border-left: 4px solid #a855f7; }

/* ==========================================
   Diagnostic popover
   ========================================== */

.diagnostic-action {
  position: relative;
  display: inline-block;
}

.diagnostic-popover {
  position: absolute;
  top: 42px;
  right: 0;
  width: 240px;
  background: var(--panel-bg, #0f172a);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  z-index: 50;

  display: none;
}

.diagnostic-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: var(--panel-bg, #0f172a);
  border-left: 1px solid rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.08);
  transform: rotate(45deg);
}

/* Header */
.diagnostic-popover-header {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Body */
.diagnostic-popover-body {
  padding: 12px;
}

.diagnostic-popover-body label {
  display: block;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.diagnostic-popover-body input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: inherit;
}

.diagnostic-popover-body input:focus {
  outline: none;
  border-color: #38bdf8;
}

/* Help text */
.diagnostic-help {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 6px;
}

/* Actions */
.diagnostic-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.diagnostic-popover.open {
  display: block;
}

/* ==========================================
   Laptop / High-DPI safety net
   ========================================== */

/* ==========================================
   Responsive safety (only when genuinely narrow)
   ========================================== */

@media (max-width: 1200px) {
  .details-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .details-header-actions {
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* =====================================================
   STATUS / UPDATE EXPLANATION — CARD BUBBLE (HOVER ONLY)
   ===================================================== */

#statusExplanation[style*="position: absolute"] {
    background: var(--card-bg);
    color: var(--text-main);

    border-radius: 12px;
    padding: 12px 14px;
    max-width: 320px;

    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);

    font-size: 0.85rem;
    line-height: 1.4;
    white-space: normal;

    z-index: 1000;
}

/* Inner content should not flatten the card */
#statusExplanation[style*="position: absolute"] .status-explanation {
    margin: 0;
    color: inherit;
}



/* =====================================================
   UPDATE PILL — MATCH STATUS BUBBLE (LIGHT + DARK)
   ===================================================== */

#statusExplanation {
    background: #111827; /* fallback dark */
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow:
        0 6px 18px rgba(0,0,0,0.25),
        0 12px 32px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 1;                 /* override earlier fade */
    white-space: normal;        /* allow wrapping like status bubble */
    max-width: 320px;
}
/* Light mode — Update bubble should look like Status bubble */

body.theme-light #statusExplanation {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.08),
        0 12px 28px rgba(0,0,0,0.12);
}
/* Update bubble header polish */

#statusExplanation .details-status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
body.theme-light #statusExplanation .details-status.green {
    background: #22c55e;
    color: #ffffff;
}

/* =====================================================
   DIAGNOSTIC POPOVER — LIGHT MODE CONTRAST FIX
   ===================================================== */

body.theme-light .diagnostic-popover {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow:
        0 4px 12px rgba(0,0,0,0.08),
        0 12px 28px rgba(0,0,0,0.12);
}

body.theme-light .diagnostic-popover::before {
    background: #ffffff;
    border-left: 1px solid rgba(15, 23, 42, 0.18);
    border-top: 1px solid rgba(15, 23, 42, 0.18);
}

/* Header */
body.theme-light .diagnostic-popover-header {
    color: #0f172a;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

/* Labels */
body.theme-light .diagnostic-popover-body label {
    color: #334155;
    opacity: 1;
}

/* Inputs */
body.theme-light .diagnostic-popover-body input {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.2);
}

body.theme-light .diagnostic-popover-body input::placeholder {
    color: #94a3b8;
}

body.theme-light .diagnostic-popover-body input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Help text */
body.theme-light .diagnostic-help {
    color: #64748b;
    opacity: 1;
}

/* Footer divider */
body.theme-light .diagnostic-popover-actions {
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

/* =====================================================
   LIGHT MODE — UPDATE PILL (CLEAN OVERRIDE)
   ===================================================== */

body.theme-light .details-pill.update-health.green {
    background: #d1fae5;          /* soft green */
    color: #065f46;               /* readable green text */
    border: 1px solid #6ee7b7;
}

body.theme-light .details-pill.update-health.amber,
body.theme-light .details-pill.update-health.red {
    background: #ffedd5;          /* soft amber */
    color: #7c2d12;               /* dark amber text */
    border: 1px solid #fdba74;
}

.details-pill.update-health {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.details-pill.update-health:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* =====================================================
   TOUCH FRIENDLY TARGETS (iPad+)
   ===================================================== */

@media (pointer: coarse) {

  .d-btn,
  .btn-uninstall-toggle,
  .diagnostic-popover-actions button {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 14px;
  }

}
@media (pointer: coarse) {

  .diagnostic-popover {
    right: auto;
    left: 0;
    transform: translateX(-10%);
  }

}
@media (pointer: coarse) {

  .details-bubble {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

}

@media (pointer: coarse) {

  .details-subtitle,
  .details-field-label,
  .diagnostic-help {
    font-size: 0.85rem;
  }

}

@media (pointer: coarse) {

  .diagnostic-popover-body input {
    min-height: 44px;
    font-size: 15px;
  }
}

/* Keep the status pill aligned with text baseline */
.details-status {
  line-height: 1;
}

.av-label.green {
    color: #22c55e;
    font-weight: 600;
}

.av-label.amber {
    color: #f59e0b;
    font-weight: 600;
}

.av-label.red {
    color: #ef4444;
    font-weight: 700;
}
/* =====================================================
   UPDATES HOVER BUBBLE — MATCH STATUS TOOLTIP
   ===================================================== */

#updateBubble {
    position: absolute;
    background: var(--card-bg);
    color: var(--text-main);

    border-radius: 12px;
    padding: 12px 14px;
    max-width: 320px;

    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);

    font-size: 0.85rem;
    line-height: 1.4;

    z-index: 1000;
}

/* Inner content consistency */
#updateBubble .status-explanation {
    margin: 0;
    color: inherit;
}
/* =========================================================
   Combined Status + Updates bubble layout
   ========================================================= */

.swam-dual-bubble {
    display: flex;
    flex-direction: column;
    gap: 14px; /* visual separation between sections */
}
/* Extra breathing room after SYSTEM STATUS metrics */
.status-explanation {
    padding-bottom: 4px;
}

.status-explanation + .status-explanation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft, rgba(255,255,255,0.08));
}
.status-explanation-line {
    margin-top: 4px;
}

.status-explanation-recommendation {
    margin-top: 6px;
    line-height: 1.4;
}
/* =========================================================
   Status + Updates typography alignment
   ========================================================= */

/* Make Updates text match Status metric font */
.status-explanation-line,
.status-explanation-recommendation {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: normal;
}

/* Match label/value emphasis used in status metrics */
.status-explanation-line strong {
    font-weight: 600;
}

/* Reduce visual crowding inside Updates block */
.status-explanation-line + .status-explanation-line {
    margin-top: 3px;
}
/* =========================================================
   Status + Updates text — LIGHT MODE FIX (CORRECT)
   ========================================================= */

/* Base typography (safe for both modes) */
.details-metric-line,
.status-explanation-line,
.status-explanation-recommendation {
    font-size: 13px;
    line-height: 1.4;
}

/* Labels */
.metric-label,
.status-explanation-line strong {
    font-weight: 600;
}

/* LIGHT MODE — match rest of app */
body.theme-light .details-metric-line {
    color: #0f172a;
}

body.theme-light .status-explanation-line {
    color: #0f172a;
}

/* Labels slightly darker */
body.theme-light .metric-label,
body.theme-light .status-explanation-line strong {
    color: #020617;
}

/* Severity emphasis (light mode) */
body.theme-light .details-metric-line.red {
    color: #b91c1c;
}

body.theme-light .details-metric-line.amber {
    color: #b45309;
}
