#app .notice-anchor { position: relative; flex: none; }
#app .notice-toggle { position: relative; width: 38px; height: 38px; display: grid; place-items: center; color: var(--accent); }
#app .notice-toggle .icon { width: 20px; height: 20px; }
#app .notice-toggle[aria-expanded=true] { background: var(--blue-soft); border-color: var(--accent); }
.notice-badge {
  position: absolute;
  z-index: 1;
  inset-block-start: -5px;
  inset-inline-end: -5px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding-inline: 3px;
  place-items: center;
  background: #ff0000;
  color: white;
  text-shadow: 0 1px 1px #5c0000;
  border: 1.5px solid var(--surface);
  border-radius: var(--r-pill);
  font: 750 10px/1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.notice-badge[hidden] { display: none; }
.notice-inbox {
  position: fixed;
  z-index: 115;
  top: var(--notice-top,68px);
  right: var(--notice-right,12px);
  width: min(480px,calc(100vw - 20px));
  max-height: var(--notice-height, min(650px,80dvh));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 14px 45px #10182840;
}
.notice-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px 11px;
}
.notice-head h2 { margin: 0; font-size: var(--fs-xl); letter-spacing: -.3px; line-height: 1.3; }
.notice-head small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); }
.notice-head-tools { display: flex; gap: 5px; }
.notice-head-tools button,.notice-read {
  display: grid;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--secondary);
}
.notice-head-tools button:hover,.notice-read:hover { color: var(--blue-text); border-color: var(--accent); }
.notice-head-tools .icon,.notice-read .icon { width: 17px; height: 17px; }
.notice-back .icon { transform: rotate(180deg); }
.notice-tabs {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 16px 10px;
}
.notice-tabs button,.notice-tools button,.notice-more {
  min-height: 31px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--fs-xs);
}
.notice-tabs button[aria-pressed=true],.notice-tools button[aria-pressed=true] {
  border-color: var(--accent);
  background: var(--blue-soft);
  color: var(--blue-text);
  font-weight: 650;
}
.notice-tabs button:hover,.notice-tools button:enabled:hover,.notice-more:hover { color: var(--blue-text); border-color: var(--accent); }
.notice-tabs b { margin-inline-start: 4px; font-size: var(--fs-2xs); }
.notice-tools {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  border-block: 1px solid var(--line);
}
.notice-tools button:disabled { opacity: .46; cursor: default; }
.notice-items,.notice-settings { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.notice-item {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  min-width: 0;
  padding: 0 12px 0 6px;
  border-bottom: 1px solid var(--line);
}
.notice-item.is-unread { background: color-mix(in srgb,var(--blue-soft) 62%,var(--surface)); }
.notice-item.is-unread::before { content: ''; position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: var(--r-xs); background: var(--accent); }
.notice-item:hover { background: var(--surface-2); }
.notice-item-open {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  text-align: left;
  padding: 10px 8px;
  color: inherit;
  background: transparent;
  border: 0;
}
.notice-icon { display: grid; flex: 0 0 32px; height: 32px; place-items: center; border-radius: var(--r-sm); background: var(--blue-soft); color: var(--blue-text); }
.notice-icon .icon { width: 17px; height: 17px; }
.notice-item[data-category=projects] .notice-icon,.notice-item[data-category=ai] .notice-icon { background: var(--violet-soft); }
.notice-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.notice-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); color: var(--muted); }
.notice-text strong,.notice-text small { min-width: 0; overflow-wrap: anywhere; }
.notice-text strong { font-size: var(--fs-sm); line-height: 1.45; font-weight: 650; }
.notice-text small { font-size: var(--fs-xs); color: var(--secondary); line-height: 1.35; }
.notice-empty { text-align: center; padding: 28px 16px; color: var(--muted); font-size: var(--fs-sm); }
.notice-empty>.icon { width: 27px; height: 27px; color: var(--accent); }
.notice-more { width: calc(100% - 28px); margin: 10px 14px; }
.notice-inbox :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.notice-settings { padding: 0 16px 13px; }
.notice-settings fieldset {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px 10px;
  padding: 10px 11px;
  margin: 4px 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.notice-settings legend { padding-inline: 5px; font-size: var(--fs-xs); color: var(--secondary); font-weight: 650; }
.notice-settings label { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: var(--fs-xs); }
.notice-settings input[type=checkbox] { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.notice-settings .notice-dnd { grid-column: 1/-1; justify-content: space-between; }
.notice-dnd select { width: 55%; min-width: 0; }
.notice-settings footer { display: flex; justify-content: flex-end; gap: 7px; }
.notice-settings-status { margin: 0 0 8px; color: var(--danger-text); font-size: var(--fs-xs); }
.notice-settings-status:empty { display: none; }
@media (max-width: 760px) {
  #app .notice-toggle { width: 38px; height: 38px; }
  .notice-head-tools button,.notice-read { width: 40px; height: 40px; }
  .notice-tabs button { min-height: 34px; }
}
@media (max-height: 450px) {
  .notice-head { padding-block: 6px; }
  .notice-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .notice-tabs button { white-space: nowrap; }
}
