/* ============================================================
   Early warnings: bell and panel
   ============================================================ */
.al { position: relative; }
.al-bell {
  position: relative; display: flex; align-items: center; padding: 6px 10px; cursor: pointer;
  background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius-pill);
  color: var(--text-secondary); transition: background 0.15s, color 0.15s;
}
.al-bell:hover, .al-bell[aria-expanded="true"] { background: var(--bg-hover); color: var(--text-primary); }
.al-bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.al-bell__count {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: var(--status-blocked); color: #fff; border: 2px solid var(--bg-primary);
  font: 600 9.5px/13px var(--font-mono); text-align: center; animation: al-pop 0.3s cubic-bezier(.3,1.6,.5,1) both;
}

.al-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 400; width: 380px; max-width: calc(100vw - 24px);
  max-height: min(620px, calc(100vh - 80px)); display: flex; flex-direction: column;
  background: var(--bg-card, var(--bg-primary)); border: 1px solid var(--border-color); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.06);
  transform-origin: top right; animation: al-in 0.18s ease-out both;
}
.al-panel[hidden] { display: none; }
.al-panel__head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 10px; }
.al-panel__title { font: 600 14px/1.2 var(--font-body); color: var(--text-primary); }
.al-panel__asof { font: 400 11px/1 var(--font-mono); color: var(--text-tertiary); }

.al-filters { display: flex; gap: 4px; padding: 0 16px 10px; border-bottom: 1px solid var(--border-color); }
.al-filter {
  padding: 4px 9px; border-radius: var(--radius-pill); border: 1px solid transparent; background: none; cursor: pointer;
  font: 500 11.5px/1.2 var(--font-body); color: var(--text-secondary);
}
.al-filter span { font-family: var(--font-mono); color: var(--text-tertiary); margin-left: 2px; }
.al-filter:hover { background: var(--bg-tertiary); }
.al-filter.is-on { background: var(--text-primary); color: var(--bg-primary); }
.al-filter.is-on span { color: inherit; opacity: 0.7; }
.al-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.al-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.al-item {
  position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 9px 10px 9px 16px;
  border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit;
  animation: al-row 0.25s ease-out both; animation-delay: var(--d, 0ms); transition: background 0.12s;
}
.al-item:hover { background: var(--bg-tertiary); }
.al-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.al-item::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--status-idle); }
.al-item--high::before { background: var(--status-blocked); }
.al-item--medium::before { background: var(--status-progress); }
.al-item.is-new .al-item__kind::after { content: "New"; margin-left: 6px; padding: 1px 5px; border-radius: 3px; background: var(--accent-wash); color: var(--accent); letter-spacing: 0.04em; }
.al-item__kind { font: 700 9.5px/1.4 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.al-item__title { font: 600 13px/1.35 var(--font-body); color: var(--text-primary); }
.al-item__detail { font-size: 12px; line-height: 1.45; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.al-empty { padding: 24px 16px; text-align: center; font-size: 12.5px; color: var(--text-tertiary); }

.al-rules { border-top: 1px solid var(--border-color); padding: 10px 16px; font-size: 12px; color: var(--text-secondary); }
.al-rules summary { cursor: pointer; font-weight: 500; color: var(--text-tertiary); }
.al-rules ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.55; }

@keyframes al-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes al-row { from { opacity: 0; transform: translateX(4px); } to { opacity: 1; transform: none; } }
@keyframes al-pop { from { transform: scale(0.4); } to { transform: scale(1); } }
@media (max-width: 600px) {
  .al-panel { position: fixed; top: 56px; left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .al-panel, .al-item, .al-bell__count { animation: none; } }

.al-foot { padding: 10px 16px 12px; border-top: 1px solid var(--border-color); }
.al-email {
  display: inline-flex; align-items: center; gap: 7px; width: 100%; justify-content: center; padding: 8px 12px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-primary);
  font: 600 12.5px/1 var(--font-body); color: var(--text-primary); transition: background 0.12s;
}
.al-email:hover { background: var(--bg-tertiary); }
.al-email:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
