.agency-topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.agency-notification-wrap {
  position: relative;
}

.agency-notification-button,
.agency-mobile-notification-button {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #637589;
  background: rgba(255, 255, 255, .36);
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 14px;
}

.agency-notification-button:hover,
.agency-mobile-notification-button:hover {
  color: #2f78c8;
  background: rgba(255, 255, 255, .54);
}

.agency-notification-button svg,
.agency-mobile-notification-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agency-mobile-notification-button {
  display: none;
}

.agency-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  color: #fff;
  background: #e85a65;
  border: 2px solid rgba(245, 251, 254, .94);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 750;
  line-height: 14px;
}

.agency-notification-badge[hidden] {
  display: none;
}

.agency-notification-badge:not([hidden]) {
  display: grid;
}

.agency-notification-panel {
  position: fixed;
  z-index: 2400;
  top: 86px;
  right: 20px;
  width: min(390px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 105px));
  color: #263648;
  background: rgba(247, 251, 254, .94);
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 21px;
  box-shadow: 0 24px 65px rgba(31, 54, 73, .16);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  overflow: hidden;
}

.agency-notification-panel[hidden] {
  display: none;
}

.notification-panel-head {
  min-height: 76px;
  padding: 17px 18px 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(71, 96, 119, .08);
}

.notification-panel-head span {
  display: block;
  color: #8794a3;
  font-size: 8px;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-panel-head h2 {
  margin: 3px 0 0;
  color: #28394c;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.notification-panel-head > button,
.notification-panel-footer button {
  padding: 5px 0;
  color: #3c7fc8;
  background: transparent;
  border: 0;
  font-size: 8.5px;
  font-weight: 650;
}

.notification-panel-list {
  max-height: 455px;
  overflow-y: auto;
}

.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  border-bottom: 1px solid rgba(71, 96, 119, .07);
}

.notification-item.is-unread {
  background: rgba(51, 133, 219, .035);
}

.notification-item.is-unread::before {
  content: "";
  position: absolute;
  top: 23px;
  left: 8px;
  width: 4px;
  height: 4px;
  background: #3984d4;
  border-radius: 50%;
}

.notification-item-main {
  min-width: 0;
  padding: 13px 8px 13px 16px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.notification-item-main:hover {
  background: rgba(255, 255, 255, .32);
}

.notification-item-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #3c82cf;
  background: rgba(60, 130, 207, .08);
  border-radius: 11px;
  font-size: 10px;
  font-weight: 750;
}

.notification-item-icon.task_overdue {
  color: #c85d65;
  background: rgba(200, 93, 101, .08);
}

.notification-item-icon.task_due_today {
  color: #bd813f;
  background: rgba(189, 129, 63, .08);
}

.notification-item-copy {
  min-width: 0;
}

.notification-item-copy strong,
.notification-item-copy span,
.notification-item-copy small {
  display: block;
}

.notification-item-copy strong {
  color: #304256;
  font-size: 9.5px;
  font-weight: 680;
}

.notification-item-copy span {
  margin-top: 3px;
  color: #718297;
  font-size: 8.5px;
  line-height: 1.45;
}

.notification-item-copy small {
  margin-top: 5px;
  color: #9aa5b2;
  font-size: 7.5px;
}

.notification-item-dismiss {
  align-self: start;
  width: 25px;
  height: 25px;
  margin-top: 9px;
  padding: 0;
  color: #97a2ae;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.notification-item-dismiss:hover {
  color: #bf5963;
  background: rgba(191, 89, 99, .06);
}

.notification-empty {
  min-height: 265px;
  padding: 30px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.notification-empty > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #338967;
  background: rgba(51, 137, 103, .08);
  border-radius: 14px;
}

.notification-empty strong {
  margin-top: 12px;
  color: #45576b;
  font-size: 11px;
}

.notification-empty p {
  max-width: 240px;
  margin: 5px 0 0;
  color: #8794a3;
  font-size: 8.5px;
  line-height: 1.5;
}

.notification-panel-footer {
  min-height: 45px;
  padding: 8px 18px;
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(71, 96, 119, .08);
}

.notification-settings-card {
  margin-top: 16px;
  padding: 22px;
}

.notification-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.notification-settings-head > div > span {
  display: block;
  color: #8794a4;
  font-size: 8.5px;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-settings-head h2 {
  margin: 3px 0 0;
}

.notification-settings-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.notification-timezone {
  padding: 6px 9px;
  color: #687b8e;
  background: rgba(255, 255, 255, .3);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 9px;
  font-size: 8px;
}

.notification-settings-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.notification-settings-group {
  padding: 16px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .49);
  border-radius: 17px;
}

.notification-settings-group > header {
  min-height: 43px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notification-group-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  color: #3b82ce;
  background: rgba(59, 130, 206, .08);
  border-radius: 10px;
  font-size: 8px;
}

.notification-group-icon.is-telegram {
  color: #278ac2;
}

.notification-group-icon.is-calendar {
  color: #786cd4;
}

.notification-group-icon.is-moon {
  color: #5e7189;
}

.notification-settings-group h3 {
  margin: 0;
  color: #35475a;
  font-size: 11px;
}

.notification-settings-group header p {
  margin: 3px 0 0;
  color: #8a97a6;
  font-size: 8px;
}

.notification-setting-row,
.notification-select-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(72, 96, 121, .07);
}

.notification-setting-row.is-disabled {
  opacity: .48;
}

.notification-setting-row strong,
.notification-setting-row small,
.notification-select-row strong,
.notification-select-row small {
  display: block;
}

.notification-setting-row strong,
.notification-select-row strong {
  color: #4a5c70;
  font-size: 9px;
}

.notification-setting-row small,
.notification-select-row small {
  margin-top: 2px;
  color: #929dab;
  font-size: 7.5px;
}

.notification-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
}

.notification-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.notification-switch i {
  position: absolute;
  inset: 0;
  padding: 3px;
  background: rgba(101, 119, 139, .19);
  border-radius: 999px;
  transition: background .15s ease;
}

.notification-switch i::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(43, 61, 78, .14);
  transition: transform .15s ease;
}

.notification-switch input:checked + i {
  background: #4288d5;
}

.notification-switch input:checked + i::after {
  transform: translateX(16px);
}

.notification-switch input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(66, 136, 213, .11);
}

.notification-select-row select {
  width: auto;
  min-width: 105px;
  min-height: 35px;
  padding: 0 9px;
  color: #526579;
  background: rgba(255, 255, 255, .38);
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 10px;
  font-size: 8.5px;
}

.telegram-setting-actions {
  min-height: 44px;
  padding-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(72, 96, 121, .07);
}

.settings-soft-button {
  min-height: 32px;
  padding: 0 10px;
  color: #3c7ec7;
  background: rgba(255, 255, 255, .34);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 9px;
  font-size: 8.5px;
  font-weight: 650;
}

.settings-link-button {
  color: #6f8194;
  background: transparent;
  border: 0;
  font-size: 8.5px;
}

.settings-link-button.danger {
  color: #bd5963;
}

.telegram-setup-note {
  margin: 6px 0 0;
  color: #8c98a6;
  font-size: 7.5px;
  line-height: 1.45;
}

.notification-time-fields {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  border-top: 1px solid rgba(72, 96, 121, .07);
}

.notification-time-fields.is-disabled {
  opacity: .45;
}

.notification-time-fields label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8694a4;
  font-size: 8px;
}

.notification-time-fields input {
  width: 84px;
  min-height: 34px;
  padding: 0 7px;
  color: #526579;
  background: rgba(255, 255, 255, .38);
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 9px;
  font-size: 8.5px;
}

.notification-settings-footer {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

.notification-settings-footer > span {
  color: #748598;
  font-size: 8.5px;
}

.notification-settings-footer > span.success {
  color: #2c8a68;
}

.notification-settings-footer > span.error {
  color: #bf5963;
}

@media (max-width: 900px) {
  .agency-mobile-notification-button {
    width: 42px;
    height: 42px;
    margin-left: auto;
    display: grid;
    color: #637488;
    background: rgba(255, 255, 255, .52);
    border-color: rgba(255, 255, 255, .75);
    border-radius: 13px;
  }

  .agency-notification-panel {
    top: 68px;
    right: 10px;
    max-height: calc(100dvh - 80px);
  }
}

@media (max-width: 700px) {
  .notification-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .agency-notification-panel {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .notification-settings-card {
    padding: 17px;
  }

  .notification-settings-head {
    display: block;
  }

  .notification-timezone {
    display: inline-block;
    margin-top: 10px;
  }

  .notification-settings-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

:root[data-theme="dark"] .notification-settings-card .notification-settings-group {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(158, 180, 220, .12);
}

:root[data-theme="dark"] .notification-settings-card .notification-timezone,
:root[data-theme="dark"] .notification-settings-card .settings-soft-button {
  color: #9fc7f3;
  background: rgba(255, 255, 255, .055);
  border-color: rgba(158, 180, 220, .14);
}

:root[data-theme="dark"] .notification-settings-card .notification-settings-group h3,
:root[data-theme="dark"] .notification-settings-card .notification-setting-row strong,
:root[data-theme="dark"] .notification-settings-card .notification-select-row strong {
  color: var(--text);
}

:root[data-theme="dark"] .notification-settings-card .notification-settings-head > div > span,
:root[data-theme="dark"] .notification-settings-card .notification-settings-group header p,
:root[data-theme="dark"] .notification-settings-card .notification-setting-row small,
:root[data-theme="dark"] .notification-settings-card .notification-select-row small,
:root[data-theme="dark"] .notification-settings-card .telegram-setup-note,
:root[data-theme="dark"] .notification-settings-card .notification-time-fields label,
:root[data-theme="dark"] .notification-settings-card .notification-settings-footer > span {
  color: var(--muted);
}

:root[data-theme="dark"] .notification-settings-card .notification-setting-row,
:root[data-theme="dark"] .notification-settings-card .notification-select-row,
:root[data-theme="dark"] .notification-settings-card .telegram-setting-actions,
:root[data-theme="dark"] .notification-settings-card .notification-time-fields {
  border-color: rgba(158, 180, 220, .1);
}

:root[data-theme="dark"] .notification-settings-card .notification-select-row select,
:root[data-theme="dark"] .notification-settings-card .notification-time-fields input {
  color: var(--text);
  background: rgba(7, 16, 33, .48);
  border-color: rgba(158, 180, 220, .15);
}

/* Detailed per-event notification controls. */
.notification-settings {
  display: grid;
  gap: 16px;
}

.notification-channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.notification-settings-group,
.notification-event-card,
.notification-quiet-card {
  color: var(--settings-ink, var(--appearance-workspace-text-primary, #1b2835));
  background: var(--settings-panel, rgba(255, 255, 255, .44));
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(43, 74, 100, .045);
  backdrop-filter: blur(var(--appearance-workspace-effective-blur, 18px));
  -webkit-backdrop-filter: blur(var(--appearance-workspace-effective-blur, 18px));
}

.notification-settings-group {
  padding: 20px;
}

.notification-settings-group > header {
  min-height: 52px;
}

.notification-group-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  font-size: 10px;
}

.notification-settings-group h3 {
  color: var(--settings-ink, #35475a);
  font-size: 16px;
}

.notification-settings-group header p {
  margin-top: 5px;
  color: var(--settings-muted, #7c8b9b);
  font-size: 12px;
}

.notification-setting-row {
  min-height: 70px;
}

.notification-setting-row strong {
  color: var(--settings-ink, #4a5c70);
  font-size: 14px;
}

.notification-setting-row small {
  max-width: 390px;
  margin-top: 4px;
  color: var(--settings-muted, #7c8b9b);
  font-size: 13.5px;
  line-height: 1.4;
}

.notification-switch {
  width: 44px;
  height: 26px;
  flex-basis: 44px;
}

.notification-switch i::after {
  width: 20px;
  height: 20px;
}

.notification-switch input:checked + i::after {
  transform: translateX(18px);
}

.telegram-setting-actions {
  min-height: 52px;
}

.settings-soft-button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
}

.settings-link-button {
  font-size: 13px;
}

.telegram-setup-note {
  font-size: 13px;
}

.notification-event-card {
  padding: 20px;
}

.notification-event-head {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 196px;
  gap: 16px;
  align-items: end;
}

.notification-event-head > div:first-child > span,
.notification-quiet-card > div:first-child > span {
  display: block;
  color: var(--settings-blue, #177df3);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.notification-event-head h3,
.notification-quiet-card h3 {
  margin: 4px 0 4px;
  color: var(--settings-ink, #1b2835);
  font-size: 19px;
}

.notification-event-head p,
.notification-quiet-card p {
  margin: 0;
  color: var(--settings-muted, #738397);
  font-size: 13.5px;
  line-height: 1.45;
}

.notification-event-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  color: var(--settings-muted, #738397);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.notification-event-list {
  margin-top: 12px;
}

.notification-event-row {
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--settings-line, rgba(72, 96, 121, .1));
}

.notification-event-copy {
  min-width: 0;
  padding: 14px 0;
}

.notification-event-copy > span {
  display: block;
  margin-bottom: 7px;
  color: #6576dc;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-event-copy > strong {
  display: block;
  color: var(--settings-ink, #263648);
  font-size: 16px;
}

.notification-event-copy > small {
  display: block;
  max-width: 680px;
  margin-top: 5px;
  color: var(--settings-muted, #738397);
  font-size: 13.5px;
  line-height: 1.45;
}

.notification-event-row > div:nth-child(2),
.notification-event-row > div:nth-child(3) {
  display: grid;
  place-items: center;
}

.notification-reminder-select {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--settings-muted, #738397);
  font-size: 13px;
}

.notification-reminder-select select {
  min-height: 34px;
  padding: 0 9px;
  color: var(--settings-ink, #263648);
  background: rgba(255, 255, 255, .48);
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 10px;
  font-size: 13px;
}

.notification-quiet-card {
  min-height: 132px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
}

.notification-quiet-card > div:first-child {
  max-width: 650px;
}

.notification-time-fields {
  min-height: 54px;
  border: 0;
}

.notification-time-fields label {
  color: var(--settings-muted, #738397);
  font-size: 13px;
}

.notification-time-fields input {
  width: 120px;
  min-height: 40px;
  color: var(--settings-ink, #263648);
  font-size: 13px;
}

.notification-settings-footer {
  min-height: 54px;
  margin-top: 0;
}

.notification-settings-footer > span {
  font-size: 13px;
}

@media (max-width: 880px) {
  .notification-channel-grid {
    grid-template-columns: 1fr;
  }

  .notification-quiet-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .notification-time-fields {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .notification-event-head {
    grid-template-columns: 1fr;
  }

  .notification-event-columns {
    display: none;
  }

  .notification-event-row {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 14px 0;
  }

  .notification-event-copy {
    grid-column: 1 / -1;
    padding: 0;
  }

  .notification-event-row > div:nth-child(2),
  .notification-event-row > div:nth-child(3) {
    min-height: 42px;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 8px;
    color: var(--settings-muted, #738397);
    font-size: 12.5px;
  }

  .notification-event-row > div:nth-child(2)::before {
    content: "В сервисе";
  }

  .notification-event-row > div:nth-child(3)::before {
    content: "Telegram";
  }

  .notification-quiet-card {
    grid-template-columns: 1fr auto;
  }
}
