/* Notification center. Uses the dashboard color, type, and radius tokens. */

.nav-bell-slot {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.notify-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card, #fff);
  color: var(--ink, #142033);
  cursor: pointer;
  padding: 0;
}

.notify-bell:focus-visible,
.notify-panel button:focus-visible,
.notify-item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.notify-bell svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.notify-badge {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #9f1239;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--card, #fff);
}

.notify-backdrop {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 44;
  background: rgba(11, 17, 27, 0.42);
}
.notify-backdrop[hidden] { display: none !important; }

.notify-panel {
  position: fixed;
  z-index: 46;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(440px, 100%);
  max-width: 100%;
  height: 100dvh;
  max-height: none;
  overflow: hidden;
  background: var(--card, #ffffff);
  color: var(--ink, #142033);
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding-bottom: env(safe-area-inset-bottom);
}

.notify-panel[hidden] { display: none !important; }

html[data-theme="dark"] .notify-bell {
  background: #131f2d;
  color: #f2f6fb;
  border-color: #314356;
}
html[data-theme="dark"] .notify-badge { box-shadow: 0 0 0 2px #101a27; }
html[data-theme="light"] .notify-panel { background: #ffffff; color: #142033; }
html[data-theme="dark"] .notify-panel {
  background: #101a27;
  color: #eef3f8;
  border-left-color: #314356;
}

.notify-head, .notify-filters, .notify-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.notify-head { position: sticky; top: 0; background: var(--card); z-index: 1; }
.notify-head h2 { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -0.03em; }
.notify-status { margin-left: auto; color: var(--muted); font-size: 0.75rem; }

.notify-filters { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.notify-filters[hidden] { display: none !important; }
.notify-filters-secondary { background: var(--surface-muted, transparent); }
.notify-panel button:disabled { opacity: 0.45; cursor: default; }
.notify-filters button, .notify-foot button, .notify-close, .notify-more {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.notify-filters button[aria-pressed="true"] {
  background: var(--info-bg);
  color: var(--info);
  border-color: transparent;
}

.notify-list { overflow: auto; min-width: 0; width: 100%; padding: 8px; -webkit-overflow-scrolling: touch; }
.notify-day { margin: 10px 6px 4px; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.notify-item {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  padding: 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.notify-body { min-width: 0; }
.notify-item.unread { background: var(--surface-muted); }
.notify-item .title { margin: 0; font-weight: 680; font-size: 0.98rem; line-height: 1.35; overflow-wrap: anywhere; }
.notify-item .when-line { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.notify-item .when { color: inherit; }
.history-label {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-muted, rgba(148, 163, 184, .18));
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.notify-item .summary, .notify-detail { color: var(--muted); font-size: 0.86rem; }
.notify-item .summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: auto;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.notify-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.notify-actions button {
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  border-radius: 999px;
  min-height: 32px;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
}
.notify-detail {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
  gap: 4px 10px;
  align-items: baseline;
}
.notify-detail .explain { grid-column: 1 / -1; color: var(--ink); overflow-wrap: break-word; }
.notify-detail dt { margin: 0; color: var(--muted); font-weight: 650; }
.notify-detail dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.notify-detail .ref { color: var(--muted); font-size: 0.72rem; }
.notify-detail a { color: var(--link); }

.sev { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-size: 0.85rem; }
.sev.critical { background: var(--bad-bg); color: var(--bad); }
.sev.warning { background: var(--warn-bg); color: var(--warn); }
.sev.success { background: var(--good-bg); color: var(--good); }
.sev.info { background: var(--info-bg); color: var(--info); }
.sev.neutral { background: var(--surface-muted); color: var(--muted); }

.notify-empty, .notify-error { padding: 28px 16px; text-align: center; color: var(--muted); }
.notify-foot { flex-wrap: wrap; border-bottom: 0; border-top: 1px solid var(--line); justify-content: flex-start; }
.notify-foot button { min-height: 44px; }

.notify-toasts {
  position: fixed;
  z-index: 50;
  top: 12px;
  right: 12px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
}
.notify-toast {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.notify-toast.critical { border-left-color: var(--bad); }
.notify-toast.success { border-left-color: var(--good); }
.notify-toast button { float: right; border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }

@media (max-width: 720px) {
  .notify-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.35);
  }
  .notify-backdrop[hidden] { display: none !important; }
  .notify-panel {
    z-index: 46;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .notify-filters button, .notify-bell, .notify-close, .notify-foot button { min-height: 44px; }
  .notify-detail { grid-template-columns: 1fr; }
  .notify-item { padding: 14px 12px; }
  body.notifications-open { overflow: hidden; }
  .notify-toasts { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; right: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .notify-panel, .notify-toast { transition: none; }
}
