.notifications-page {
  padding-bottom: 65px;
}

.notifications-board {
  max-width: 960px;
  margin-bottom: 24px;
}

.notifications-board-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 15px;
  border-bottom: 1px solid var(--line);
}

.notifications-board-top h2 {
  font-size: 23px;
  font-weight: 650;
}

.notifications-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.notifications-list {
  min-width: 0;
}

.notice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 9px 20px;
  min-width: 0;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.notice-row-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.notice-row-heading h2 {
  min-width: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notice-time,
.notice-detail-time,
.notice-popup-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

.notice-row-excerpt {
  grid-column: 1;
  max-width: 75ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.notice-row-link,
.notifications-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--purple);
  border-radius: 7px;
  color: var(--purple);
  font-size: 12px;
  white-space: nowrap;
}

.notice-row-link {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 9px 14px;
}
.notifications-back { padding: 9px 14px; }

.notice-row-link:hover,
.notifications-back:hover {
  background: var(--surface-2);
}

.notifications-feedback {
  min-width: 0;
}

.notifications-state,
.notifications-loading {
  margin-top: 22px;
  padding: 34px 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
}

.notifications-state h2 {
  font-size: 20px;
  font-weight: 650;
}

.notifications-state p {
  max-width: 65ch;
  margin: 9px auto 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.notifications-state-error {
  border-style: solid;
  border-color: #76566a;
}

.notifications-state-error h2 {
  color: var(--text);
}

.notifications-state-error .secondary {
  min-width: 88px;
}

.notifications-loading {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.notifications-skeleton {
  display: block;
  width: min(68%, 520px);
  height: 12px;
  border-radius: 3px;
  background: var(--surface-2);
}

.notifications-skeleton-title {
  width: min(44%, 320px);
  height: 18px;
}

.notifications-skeleton-short {
  width: min(34%, 230px);
}

.notifications-load-more {
  display: block;
  min-width: 160px;
  margin: 28px auto 0;
}

.notifications-detail-content {
  max-width: 860px;
  padding: 28px 0 35px;
}

.notice-detail {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.notice-detail h1 {
  max-width: 32ch;
  color: var(--text);
  font-size: 31px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notice-detail-time {
  display: block;
  margin-top: 12px;
}

.notice-detail-body {
  max-width: 65ch;
  margin-top: 27px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notice-popup {
  width: min(520px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  max-height: min(680px, calc(100vh - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 48px #0006;
}

.notice-popup::backdrop {
  background: #000b;
}

.notice-popup-content {
  position: relative;
  padding: 31px 30px 28px;
}

.notice-popup h2 {
  max-width: 32ch;
  padding-right: 52px;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notice-popup-time {
  display: block;
  margin-top: 9px;
}

.notice-popup-body {
  max-height: min(45vh, 330px);
  margin: 23px 0 0;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

.notice-popup-actions {
  display: flex;
  gap: 9px;
  margin-top: 24px;
}

.notice-popup-view {
  min-width: 128px;
}

.notice-popup-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
}

.notice-popup-close:hover {
  border-color: var(--purple);
  color: var(--purple);
}

@media (max-width: 600px) {
  .notifications-board-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .notifications-status {
    text-align: left;
  }

  .notice-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 20px 0;
  }

  .notice-row-heading {
    display: block;
  }

  .notice-time {
    display: block;
    margin-top: 6px;
  }

  .notice-row-excerpt,
  .notice-row-link {
    grid-column: 1;
    grid-row: auto;
  }

  .notice-row-link {
    justify-self: start;
    padding-inline: 13px;
  }

  .notifications-state,
  .notifications-loading {
    padding-inline: 18px;
  }

  .notice-detail h1 {
    font-size: 27px;
  }

  .notice-detail-body {
    font-size: 14px;
  }

  .notice-popup {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .notice-popup-content {
    padding: 29px 20px 22px;
  }

  .notice-popup-actions {
    display: grid;
  }

  .notice-popup-view {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-popup,
  .notice-row-link,
  .notifications-back {
    transition: none;
  }
}
