.global-work-alerts {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.global-followup-alert {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #128478 0%, #6647df 100%);
  box-shadow: 0 14px 38px rgb(29 44 78 / 28%);
  font: 800 14px/1.2 Pretendard, "Noto Sans KR", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.global-followup-alert.maintenance {
  background: linear-gradient(135deg, #b9492f 0%, #7447c7 100%);
}

.global-followup-alert.maintenance.critical,
.global-followup-alert.maintenance.long {
  box-shadow: 0 0 0 4px rgb(199 71 50 / 13%), 0 16px 42px rgb(99 38 46 / 32%);
}

.global-followup-alert:hover {
  transform: translateY(-1px);
  box-shadow: 0 17px 42px rgb(29 44 78 / 34%);
}

.global-followup-alert strong {
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 999px;
  color: #6745d9;
  background: #fff;
  font-size: 12px;
}

.work-attention-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0;
  padding: 11px 14px;
  border: 1px solid #f0c8bc;
  border-radius: 14px;
  background: linear-gradient(105deg, #fff6f2 0%, #faf7ff 60%, #f2f8ff 100%);
  box-shadow: 0 10px 26px rgb(57 39 82 / 8%);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
}

.work-attention-banner.critical {
  border-color: #e7a393;
  background: linear-gradient(105deg, #fff0eb 0%, #fff7f4 58%, #f8f3ff 100%);
}

.work-attention-banner.long {
  border-color: #d87c6b;
  background: linear-gradient(105deg, #ffe9e5 0%, #fff3ef 58%, #f5efff 100%);
  box-shadow: 0 0 0 3px rgb(199 71 50 / 9%), 0 13px 32px rgb(91 39 51 / 13%);
}

.work-attention-copy,
.work-attention-links,
.work-attention-links a {
  display: flex;
  align-items: center;
}

.work-attention-copy {
  min-width: 0;
  gap: 10px;
}

.work-attention-copy > div {
  display: grid;
  gap: 2px;
}

.work-attention-copy strong {
  color: #472c37;
  font-size: 14px;
}

.work-attention-copy small {
  color: #7b6870;
  font-size: 11px;
}

.work-attention-pulse {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #d84f38;
  box-shadow: 0 0 0 5px rgb(216 79 56 / 12%);
  animation: work-attention-pulse 2.2s ease-out infinite;
}

.work-attention-links {
  flex: 0 0 auto;
  gap: 7px;
}

.work-attention-links a {
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d9e1eb;
  border-radius: 9px;
  color: #344557;
  background: rgb(255 255 255 / 85%);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.work-attention-links a.urgent {
  border-color: #efc2b7;
  color: #a43e2d;
}

.work-attention-links b,
.nav-alert-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #6d4bd2;
  font-size: 10px;
  font-weight: 900;
}

.work-attention-links .urgent b,
.nav-alert-count.maintenance {
  background: #c74732;
}

.nav-alert-count {
  flex: 0 0 auto;
  margin-left: 0;
  vertical-align: middle;
}

:is(.portal-actions, .topbar-actions) > a[href="./work.html"],
:is(.portal-actions, .topbar-actions) > .nav-menu > summary {
  position: relative;
}

:is(.portal-actions, .topbar-actions):has(> a > .nav-alert-count, > .nav-menu > summary > .nav-alert-count) {
  row-gap: 10px;
}

:is(.portal-actions, .topbar-actions) > a[href="./work.html"] > .nav-alert-count,
:is(.portal-actions, .topbar-actions) > .nav-menu > summary > .nav-alert-count {
  position: absolute;
  top: -10px;
  right: -2px;
  z-index: 1;
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 2px solid #fff;
}

.nav-alert-count.followup {
  background: #128478;
}

.nav-alert-count.total {
  background: #6d4bd2;
}

.topbar-actions a.has-work-alerts:not(.active),
.nav-menu summary.has-work-alerts:not(.active) {
  border-color: #efb3a6;
  color: #9e392b;
  background: #fff4f1;
  box-shadow: inset 0 0 0 2px rgb(199 71 50 / 7%);
}

.topbar-actions a.has-work-alerts.critical,
.topbar-actions a.has-work-alerts.long,
.nav-menu summary.has-work-alerts.critical,
.nav-menu summary.has-work-alerts.long {
  animation: work-menu-attention 2.4s ease-in-out infinite;
}

.maintenance-alert-panel {
  display: none;
  width: min(390px, calc(100vw - 40px));
  overflow: hidden;
  border: 1px solid #e5e9f0;
  border-radius: 18px;
  color: #182338;
  background: #fff;
  box-shadow: 0 22px 56px rgb(29 44 78 / 24%);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
}

.maintenance-alert-panel.open {
  display: block;
  animation: maintenance-alert-open 160ms ease-out;
}

.maintenance-alert-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 17px 13px;
  border-bottom: 1px solid #edf0f5;
  background: linear-gradient(135deg, #fff4f0 0%, #f6f1ff 100%);
}

.maintenance-alert-panel header div {
  display: grid;
  gap: 3px;
}

.maintenance-alert-panel header span {
  color: #98503e;
  font-size: 12px;
  font-weight: 800;
}

.maintenance-alert-panel header strong {
  font-size: 17px;
  line-height: 1.35;
}

.maintenance-alert-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: #667085;
  background: rgb(255 255 255 / 75%);
  font-size: 22px;
  cursor: pointer;
}

.maintenance-alert-list {
  max-height: min(360px, 52vh);
  overflow-y: auto;
  padding: 6px;
}

.maintenance-alert-list h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px 12px 5px;
  color: #586477;
  font-size: 11px;
}

.maintenance-alert-list h3:not(:first-child) {
  margin-top: 5px;
  border-top: 1px solid #edf0f5;
}

.maintenance-alert-list h3 b {
  color: #7653cf;
}

.maintenance-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.maintenance-alert-item.urgent {
  border-left: 3px solid #d65a44;
}

.maintenance-alert-item.critical,
.maintenance-alert-item.long {
  background: #fff8f6;
}

.maintenance-alert-item.long {
  border-left-color: #ad2f27;
}

.maintenance-alert-item:hover,
.maintenance-alert-item:focus-visible {
  outline: none;
  background: #f6f3ff;
}

.maintenance-alert-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.maintenance-alert-copy strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maintenance-alert-copy small {
  color: #68748a;
  font-size: 12px;
  line-height: 1.35;
}

.maintenance-alert-arrow {
  flex: 0 0 auto;
  color: #7653cf;
  font-size: 17px;
  font-weight: 800;
}

.maintenance-alert-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #edf0f5;
}

.maintenance-alert-actions a {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  color: #6546c5;
  background: #f4f1ff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

@keyframes work-attention-pulse {
  70%, 100% {
    box-shadow: 0 0 0 9px rgb(216 79 56 / 0%);
  }
}

@keyframes maintenance-alert-open {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes work-menu-attention {
  50% { box-shadow: inset 0 0 0 3px rgb(199 71 50 / 12%); }
}

.work-summary-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: #182338;
  background: #fff;
  box-shadow: 0 28px 80px rgb(26 37 64 / 30%);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
  animation: work-summary-open 180ms ease-out;
}

.work-summary-dialog::backdrop {
  background: rgb(16 31 50 / 48%);
  backdrop-filter: blur(3px);
}

.work-summary-dialog.closing {
  opacity: 0;
  transform: translateY(8px) scale(.985);
  transition: opacity 160ms ease, transform 160ms ease;
}

.work-summary-dialog article { margin: 0; }

.work-summary-dialog header {
  position: relative;
  padding: 22px 24px 18px;
  padding-right: 72px;
  border-bottom: 1px solid #eee8e7;
  background: linear-gradient(135deg, #fff1ed 0%, #faf5ff 100%);
}

.work-summary-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid #e8deda;
  border-radius: 12px;
  color: #715f64;
  background: rgb(255 255 255 / 82%);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.work-summary-close:hover,
.work-summary-close:focus-visible {
  color: #a43e2d;
  background: #fff;
}

.work-summary-dialog.critical header,
.work-summary-dialog.long header { background: linear-gradient(135deg, #ffe8e2 0%, #fff7f4 62%, #f5efff 100%); }
.work-summary-dialog header span { color: #b44230; font-size: 12px; font-weight: 900; }
.work-summary-dialog header h2 { margin: 5px 0 4px; font-size: 24px; letter-spacing: -.035em; }
.work-summary-dialog header p { margin: 0; color: #765f65; font-size: 12px; line-height: 1.5; }
.work-summary-dialog-list { max-height: min(430px, 55vh); overflow-y: auto; padding: 8px; }
.work-summary-dialog-list > a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 12px 13px; border-radius: 12px; color: inherit; text-decoration: none; }
.work-summary-dialog-list > a:hover, .work-summary-dialog-list > a:focus-visible { outline: none; background: #f7f3ff; }
.work-summary-kind { padding: 5px 7px; border-radius: 7px; color: #a43e2d; background: #fff0ec; font-size: 10px; font-weight: 900; }
.work-summary-dialog-list div { display: grid; min-width: 0; gap: 3px; }
.work-summary-dialog-list strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.work-summary-dialog-list small { color: #6d7789; font-size: 11px; line-height: 1.4; }
.work-summary-dialog-list b { color: #7653cf; font-size: 17px; }
.work-summary-dialog-list .work-summary-more { display: block; color: #6546c5; font-size: 12px; font-weight: 850; text-align: center; }
@keyframes work-summary-open {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .work-attention-pulse,
  .topbar-actions a.has-work-alerts,
  .nav-menu summary.has-work-alerts,
  .work-summary-dialog { animation: none; }
}

@media (max-width: 640px) {
  .global-work-alerts {
    right: 12px;
    bottom: 12px;
  }

  .maintenance-alert-panel {
    width: calc(100vw - 24px);
  }

  .work-attention-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .work-attention-links {
    width: 100%;
  }

  .work-attention-links a {
    flex: 1;
    justify-content: center;
  }

  .work-summary-dialog header { padding: 19px 18px 15px; }
}
