.ecu-notifications {
  position: relative;
  z-index: 20;
  flex: none;
}

.ecu-notifications [hidden] { display: none !important; }

.ecu-notification-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.ecu-notification-bell:hover,
.ecu-notification-bell[aria-expanded='true'] {
  color: var(--text);
  border-color: var(--border);
  background: var(--panel);
}

.ecu-notification-bell svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 50% 24%;
}

.ecu-notification-bell.has-uploads::after {
  position: absolute;
  inset: auto 3px 3px auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--purple);
  content: '';
}

.ecu-notification-badge {
  position: absolute;
  inset: 0 0 auto auto;
  min-width: 12px;
  padding: 1px 2px;
  border-radius: 8px;
  background: var(--lime);
  color: #131c0b;
  font: 700 8px/1.2 system-ui, sans-serif;
}

.ecu-notification-preview {
  position: absolute;
  z-index: 1;
  inset: calc(100% + 4px) 0 auto auto;
  width: max-content;
  max-width: min(246px, calc(100vw - 78px));
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #151b25;
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecu-notification-preview-text { display: inline-block; }
.ecu-notification-preview.is-error { color: #ffbb93; }

.ecu-notification-history {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  width: min(316px, calc(100vw - 82px));
  max-height: min(360px, calc(100dvh - 80px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px #0006;
  color: var(--text);
  font-size: 12px;
}

.ecu-notification-heading {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px 5px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.ecu-notification-heading h2 { margin: 0; font-size: 13px; }
.ecu-notification-close { padding: 2px 6px; border: 0; background: transparent; font-size: 17px; }
.ecu-notification-list { margin: 0; padding: 0; list-style: none; }
.ecu-notification-empty { margin: 0; padding: 12px; color: var(--muted); }

.ecu-notification-row {
  display: grid;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ecu-notification-row.is-error > span { color: #ffbb93; }
.ecu-notification-row time, .ecu-notification-upload-status { color: var(--muted); font-size: 10px; }
.ecu-notification-progress { width: 100%; height: 4px; accent-color: var(--purple); }

@media (prefers-reduced-motion: reduce) {
  .ecu-notification-preview-text { display: inline; }
}
