/* notifications.css — уведомления: поповер колокольчика (.notif-pop), экран «Все уведомления» (.notif-feed) и раздел
   «Настройки уведомлений» (.notif-settings). Владелец — агент `notify` (волна 1).
   Правила: только var(--…) токены (tests/ui/test_ui_regulation.py), см. docs/THEMES.md. «Не прочитано» передаётся не
   только цветом: точка + полужирный заголовок + текст для скринридера / метка «Новое». */

/* ---------- колокольчик и поповер ---------- */
.bell-wrap { position: relative; }
.notif-pop { --pop-w: 400px; padding: 0; gap: 0; overflow: hidden; }
.notif-pop[aria-busy="true"] .notif-pop-body { min-height: 120px; }
.notif-pop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) var(--s2) var(--s2) var(--s3); border-bottom: var(--border-w) solid var(--border); }
.notif-pop-title { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.notif-pop-title:focus-visible { outline: var(--focus-w) solid var(--ring); outline-offset: var(--focus-offset); border-radius: var(--r-xs); }
.notif-pop-body { max-height: min(60vh, 480px); overflow-y: auto; overscroll-behavior: contain; padding: var(--s1); }
.notif-pop-body .notice { margin: var(--s2); }
.notif-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) var(--s3); border-top: var(--border-w) solid var(--border); background: var(--surface-1); }
.notif-count { margin: var(--s1) var(--s2); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s5) var(--s3);
  text-align: center; }
.notif-empty > .icon { width: calc(var(--icon-size) * 1.5); height: calc(var(--icon-size) * 1.5); color: var(--fg-muted); }

.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s2); align-items: start;
  width: 100%; min-height: 44px; padding: var(--s2); border: 0; border-radius: var(--r); background: transparent;
  color: var(--fg); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) var(--ease); }
.notif-item:hover { background: var(--surface-2); }
.notif-item:active { background: var(--surface-3); }
.notif-item:focus-visible { outline: var(--focus-w) solid var(--ring); outline-offset: calc(-1 * var(--focus-w)); }
.notif-ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--fg-muted); }
.notif-ic .icon { width: 16px; height: 16px; }
.is-unread > .notif-ic { background: var(--accent-soft); color: var(--accent); }
.notif-main { display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: var(--lh-tight); overflow-wrap: anywhere; }
.notif-item.is-unread .notif-title { font-weight: var(--fw-semibold); }
.notif-body { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--fg-muted); font-size: var(--fs-xs); line-height: var(--lh-body); white-space: pre-line; overflow-wrap: anywhere; }
.notif-time { color: var(--fg-muted); font-size: var(--fs-xs); }
.notif-dot { width: 8px; height: 8px; margin-top: var(--s1h); border-radius: var(--r-pill); background: var(--accent); }
.notif-item:not(.is-unread) .notif-dot { visibility: hidden; }

/* ---------- экран «Все уведомления» ---------- */
.notif-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); max-width: 860px; }
.notif-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); padding: var(--s3) var(--s4);
  background: var(--surface-1); border: var(--border-w) solid var(--border); border-radius: var(--r-lg); }
.notif-card.is-unread { border-left: calc(var(--border-w) + 3px) solid var(--accent); }
.notif-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s3); flex-wrap: wrap; }
.notif-card-title { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: var(--lh-tight);
  overflow-wrap: anywhere; }
.notif-card.is-unread .notif-card-title { font-weight: var(--fw-semibold); }
.notif-new { display: inline-block; margin-right: var(--s2); padding: 1px var(--s2); border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--fg); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  vertical-align: 1px; }
.notif-card-body { margin: var(--s1) 0 0; font-size: var(--fs-sm); line-height: var(--lh-body); white-space: pre-line;
  overflow-wrap: anywhere; max-width: 72ch; }
.notif-card-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }

/* ---------- настройки уведомлений ---------- */
.notif-settings { max-width: 860px; }
.ns-rows { display: flex; flex-direction: column; }
.ns-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s4); align-items: center;
  padding: var(--s3) 0; border-bottom: var(--border-w) solid var(--border); }
.ns-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ns-row:first-child { padding-top: 0; }
.ns-row > .hint { grid-column: 1 / -1; margin: 0; font-size: var(--fs-xs); line-height: var(--lh-body); color: var(--fg-muted); }
.ns-row-main { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
.ns-row-main .switch-label { color: var(--fg); font-size: var(--fs-md); }
.ns-next { color: var(--fg); font-weight: var(--fw-medium); }
.field.ns-time { flex-direction: row; align-items: center; gap: var(--s2); }
.field.ns-time > span { color: var(--fg-muted); font-weight: var(--fw-regular); }
.ns-time input[type="time"] { width: 8.5em; }
.ns-quiet-times { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.field.ns-zone { grid-column: 1 / -1; max-width: 420px; }
.ns-tg { display: flex; gap: var(--s2); align-items: flex-start; margin: var(--s2) 0 0; font-size: var(--fs-sm); color: var(--fg-muted); }
.ns-tg .icon { margin-top: 2px; }
.ns-tg.ok .icon { color: var(--success); }
.ns-kinds { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  margin: 0; padding: 0; border: 0; min-width: 0; }
.ns-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ns-group h3 { margin: 0 0 var(--s1); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.ns-group label.check { align-items: flex-start; min-height: 32px; padding: var(--s1) var(--s1); color: var(--fg); }
.ns-group label.check input { flex: none; margin-top: 2px; }
.ns-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  /* на телефоне колокольчик не у края шапки — поповер во всю ширину под шапкой, без выхода за экран */
  .notif-pop { position: fixed; top: calc(var(--topbar-h) + var(--s1)); left: var(--s2); right: var(--s2); width: auto; }
  .notif-card { padding: var(--s3); gap: var(--s2); }
  .ns-row { grid-template-columns: minmax(0, 1fr); }
  .ns-actions .btn { width: 100%; justify-content: center; }
}
