/* ════════════════════════════════════════════════════════════════════
   DB status pill + modal
   ════════════════════════════════════════════════════════════════════ */

/* Developer-Mode gate (B-6): the DB Status pill (which also surfaces the
   "v3 · static" / "v4 · live" mode badge + product count + HEALTH LATENCY
   readout via its modal) is an internal debug surface. Hidden unless
   `body.dev-mode` is set by apps/desktop-virtual-lab/dev-mode.js. */
body:not(.dev-mode) #db-status-pill { display: none !important; }

.db-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;   /* ↑ tap target (DESIGN.md §8.1) */
  padding: 6px 12px 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 6px;
}
.db-pill:hover {
  border-color: var(--ink-1);
  background: var(--surface-2);
  color: var(--ink-1);
}

.db-pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
  position: relative;
}
.db-pill.mode-v4 .db-pill-dot {
  background: var(--good);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
  animation: pulse 2.5s ease-in-out infinite;
}
.db-pill.mode-v3 .db-pill-dot { background: var(--ink-1); }
.db-pill.mode-offline .db-pill-dot { background: var(--warn); }
.db-pill.mode-connecting .db-pill-dot { background: var(--ink-3); }

.db-pill-label { font-weight: 500; }
.db-pill-count {
  color: var(--ink-3);
  font-size: 9.5px;
  padding-left: 6px;
  border-left: 1px solid var(--line);
  margin-left: 1px;
}
.db-pill-count:empty { display: none; }

/* Modal styling extends existing .modal-backdrop / .modal-sheet */
.db-status-modal .modal-sheet { width: min(560px, 92vw); }

.db-mod-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.db-mod-row:last-child { border-bottom: none; }
.db-mod-key {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.db-mod-val {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.db-mod-val code {
  font-family: var(--font-mono);
  background: var(--paper-soft);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}
.db-mod-error {
  color: var(--bad);
  font-family: var(--font-mono);
  font-size: 11px;
}

.db-mod-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.db-mod-section-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 10px;
}
.db-mod-skus {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}
.db-sku-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--ink-1);
  border: 1px solid var(--ink-1);
}
.db-sku-pill.cached {
  background: var(--paper-soft);
  color: var(--ink-2);
  border-color: var(--line);
}
.db-mod-note {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.5;
}
.db-mod-note-small {
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  flex: 1;
}

.db-status-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* DB refresh toast */
.db-toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 1500;   /* above floating panels (1000-1099) so DB feedback isn't hidden (DESIGN.md §8.4.A z-table) */
  background: var(--ink-1);
  color: var(--surface);   /* theme-aware reverse ink (DESIGN.md §3.3) */
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--dur-enter) var(--ease-out),
              transform var(--dur-enter) var(--ease-out);
}
.db-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

