/* ========================================================================
   Notification chip stack — top-right corner, always visible.
   Drives the operator's "what needs my attention" view across every page.
   PR-C of the unified notifications skill.
   ======================================================================== */

.gr-chip-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  pointer-events: none;
}

.gr-chip-stack > * { pointer-events: auto; }

/* Top summary chip — three-bin counts. Always present, becomes loud only
   when there's something to count. */
.gr-chip-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(100, 116, 139, 0.3);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s, box-shadow 0.12s;
}
.gr-chip-summary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.gr-chip-summary[data-loud="1"] {
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
  color: #fff;
  border-color: rgba(254, 226, 226, 0.4);
}
.gr-chip-summary .bin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gr-chip-summary .bin .icon {
  width: 14px; height: 14px; flex: 0 0 14px;
}
.gr-chip-summary .empty { opacity: 0.5; font-weight: 400; font-style: italic; }

/* Expanded panel — fixed width, scroll when long. */
.gr-chip-panel {
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: rgba(18, 29, 46, 0.96);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  padding: 8px 0;
  color: #e2e8f0;
  display: none;
}
.gr-chip-stack[data-open="1"] .gr-chip-panel { display: block; }
.gr-chip-stack[data-open="1"] .gr-chip-summary { box-shadow: 0 6px 18px rgba(0,0,0,0.4); }

.gr-chip-panel .gr-empty {
  padding: 32px 18px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

.gr-chip-panel .gr-section-title {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.gr-chip-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
  cursor: pointer;
  transition: background 0.1s;
}
.gr-chip-row:first-of-type { border-top: none; }
.gr-chip-row:hover { background: rgba(51, 65, 85, 0.4); }
.gr-chip-row[data-severity="high"] { border-left: 3px solid #dc2626; padding-left: 11px; }
.gr-chip-row[data-severity="medium"] { border-left: 3px solid #f59e0b; padding-left: 11px; }
.gr-chip-row[data-severity="low"] { border-left: 3px solid #3b82f6; padding-left: 11px; }

.gr-chip-row .icon-wrap {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: #cbd5e1;
}
.gr-chip-row[data-severity="high"] .icon-wrap { color: #fca5a5; }
.gr-chip-row[data-severity="medium"] .icon-wrap { color: #fcd34d; }

.gr-chip-row .icon-wrap svg { width: 22px; height: 22px; }

.gr-chip-row .body { min-width: 0; }
.gr-chip-row .title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gr-chip-row .meta {
  font-size: 11px; color: #94a3b8; margin-top: 2px;
}
.gr-chip-row .group-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: rgba(100, 116, 139, 0.3);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #cbd5e1;
}

/* Detail panel (replaces row content when expanded) */
.gr-chip-row[data-expanded="1"] {
  background: rgba(15, 23, 42, 0.6);
  cursor: default;
  display: block;
  padding: 14px;
  border-left: 3px solid rgba(100, 116, 139, 0.6);
}
.gr-chip-row[data-expanded="1"][data-severity="high"]   { border-left-color: #dc2626; }
.gr-chip-row[data-expanded="1"][data-severity="medium"] { border-left-color: #f59e0b; }
.gr-chip-row[data-expanded="1"][data-severity="low"]    { border-left-color: #3b82f6; }

.gr-chip-detail { padding: 0; }
.gr-chip-detail .header {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 8px;
}
.gr-chip-detail .icon-wrap { width: 22px; height: 22px; flex: 0 0 22px; }
.gr-chip-detail .icon-wrap svg { width: 22px; height: 22px; }
.gr-chip-detail h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: #f1f5f9; }
.gr-chip-detail .meta { color: #94a3b8; font-size: 11px; }
.gr-chip-detail .body-text {
  margin: 8px 0;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
}
.gr-chip-detail .evie-summary {
  margin: 10px 0;
  padding: 8px 10px;
  background: rgba(34, 197, 94, 0.08);
  border-left: 2px solid #22c55e;
  border-radius: 4px;
  font-size: 12px;
  color: #d1fae5;
  line-height: 1.5;
}
.gr-chip-detail .evie-summary::before {
  content: "EVIE: ";
  font-weight: 700;
  color: #4ade80;
}

/* Action buttons */
.gr-chip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.gr-chip-action {
  padding: 6px 12px;
  background: rgba(34, 211, 153, 0.15);
  border: 1px solid rgba(34, 211, 153, 0.4);
  color: #34d399;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.gr-chip-action:hover { background: rgba(34, 211, 153, 0.25); }
.gr-chip-action:active { transform: scale(0.97); }
.gr-chip-action[data-confirm="1"] {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}
.gr-chip-action[data-confirm="1"]:hover { background: rgba(245, 158, 11, 0.25); }
.gr-chip-action[data-running="1"] {
  opacity: 0.6; cursor: wait;
}

.gr-chip-action-result {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  border-radius: 4px;
  background: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}
.gr-chip-action-result[data-ok="0"] {
  background: rgba(127, 29, 29, 0.4);
  color: #fecaca;
}

/* Confirm dialog (inline) */
.gr-confirm-overlay {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  color: #fcd34d;
  font-size: 12px;
}
.gr-confirm-overlay strong { display: block; margin-bottom: 6px; color: #fde68a; font-size: 12px; }
.gr-confirm-overlay ul { margin: 4px 0 8px 18px; padding: 0; color: #fef3c7; font-size: 11px; }
.gr-confirm-overlay .actions { display: flex; gap: 6px; margin-top: 8px; }

/* Mobile / narrow */
@media (max-width: 640px) {
  .gr-chip-stack { top: 8px; right: 8px; left: 8px; align-items: stretch; }
  .gr-chip-summary { justify-content: center; }
  .gr-chip-panel { width: 100%; max-height: 70vh; }
}
