.catalog-system-status {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 28px;
  padding: 4px 14px;
  box-sizing: border-box;
  font: 700 12px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: background .2s, color .2s, opacity .2s;
}

.catalog-system-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.catalog-system-status[data-state="online"] { background: #e8f7ee; color: #14753d; }
.catalog-system-status[data-state="warning"],
.catalog-system-status[data-state="draining"] {
  min-height: 40px;
  background: #fff3cd;
  color: #765400;
  border-bottom: 1px solid #e8cb73;
}
.catalog-system-status[data-state="maintenance"],
.catalog-system-status[data-state="offline"],
.catalog-system-status[data-state="unknown"] {
  min-height: 40px;
  background: #fde8e7;
  color: #a32622;
  border-bottom: 1px solid #efaaa7;
}

.catalog-system-status[data-state="online"] .catalog-system-message { display: none; }
.catalog-system-status[data-state="online"] .catalog-system-label::after { content: "System online"; }
.catalog-system-status[data-state="warning"] .catalog-system-label::after { content: "Update soon"; }
.catalog-system-status[data-state="draining"] .catalog-system-label::after { content: "Update in progress"; }
.catalog-system-status[data-state="maintenance"] .catalog-system-label::after { content: "Maintenance"; }
.catalog-system-status[data-state="offline"] .catalog-system-label::after,
.catalog-system-status[data-state="unknown"] .catalog-system-label::after { content: "Reconnecting"; }

/* Register has its own full-screen workspace. Keep connection state as a
   discreet side indicator instead of pushing the POS down with a banner. */
body:has(.reg) .catalog-system-status {
  position: fixed;
  top: 78px;
  right: 12px;
  z-index: 1400;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 4px;
  border: 2px solid currentColor;
  border-radius: 8px;
  font-size: 0;
  background: rgba(255,255,255,.92);
  box-shadow: 0 3px 12px rgba(15,23,42,.2);
}
body:has(.reg) .catalog-system-status::before {
  width: 10px;
  height: 10px;
  box-shadow: none;
}
body:has(.reg) .catalog-system-status .catalog-system-label,
body:has(.reg) .catalog-system-status .catalog-system-message { display: none; }

.catalog-draft-recovery {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1600;
  width: min(390px, calc(100vw - 36px));
  box-sizing: border-box;
  border: 1px solid #c7d2e1;
  border-radius: 16px;
  background: #fff;
  color: #172033;
  padding: 16px;
  box-shadow: 0 16px 45px rgba(18, 35, 60, .23);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.catalog-draft-recovery strong { display: block; font-size: 16px; margin-bottom: 4px; }
.catalog-draft-recovery p { margin: 0 0 12px; color: #536176; }
.catalog-draft-actions { display: flex; gap: 8px; }
.catalog-draft-actions button { border: 0; border-radius: 9px; padding: 9px 13px; font: 700 13px system-ui; cursor: pointer; }
.catalog-draft-restore { background: #1769e0; color: #fff; }
.catalog-draft-discard { background: #edf1f6; color: #27364a; }

@media (max-width: 700px) {
  .catalog-system-status { position: relative; }
  .catalog-system-status[data-state="online"] { min-height: 24px; padding: 3px 10px; font-size: 11px; }
  body:has(.reg) .catalog-system-status { position: fixed; top: 62px; right: 8px; min-height: 0; padding: 4px; font-size: 0; }
  .catalog-draft-recovery { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}
