/* 分點警示網頁提示 (market-panels/broker-alert-notice.js): closable centred dialog listing newly hit alerts.
   Same layer, card and accent button as the 資料說明 dialog (data-notice.css). Phone: 16px gutters. Desktop: max 480px. */

body.broker-alert-notice-open {
  overflow: hidden;
}

.broker-alert-notice-layer {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding:
    calc(var(--space-16) + env(safe-area-inset-top, 0px))
    var(--space-16)
    calc(var(--space-16) + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  transition: opacity 180ms ease;
}

.broker-alert-notice-layer.is-open {
  opacity: 1;
}

.broker-alert-notice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 19, 0.62);
}

body:not(.dark-mode) .broker-alert-notice-backdrop {
  background: rgba(8, 20, 38, 0.48);
}

.broker-alert-notice-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 2 * var(--space-16) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  padding: var(--space-16) 18px var(--space-16);
  border: 1px solid var(--line);
  border-radius: var(--radius-12);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(5, 11, 20, 0.32);
}

.broker-alert-notice-dialog:focus {
  outline: none;
}

.broker-alert-notice-head {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.broker-alert-notice-mark {
  flex: 0 0 auto;
  width: 3px;
  height: 16px;
  background: var(--accent);
}

.broker-alert-notice-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  line-height: 24px;
  letter-spacing: 0;
}

.broker-alert-notice-close {
  position: relative;
  flex: 0 0 auto;
  width: var(--touch-target);
  height: var(--touch-target);
  margin: -10px -10px -10px 0;
  border: 0;
  border-radius: var(--radius-8);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.broker-alert-notice-close::before,
.broker-alert-notice-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.broker-alert-notice-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.broker-alert-notice-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.broker-alert-notice-close:hover {
  color: var(--text);
}

.broker-alert-notice-lead {
  margin: var(--space-4) 0 var(--space-12);
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
}

.broker-alert-notice-list {
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border-bottom: 1px solid var(--line-soft);
}

.broker-alert-notice-row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-height: 60px;
  padding: var(--space-8) 2px;
  border-top: 1px solid var(--line-soft);
  color: inherit;
  text-decoration: none;
}

.broker-alert-notice-row:hover {
  background: var(--accent-soft);
}

.broker-alert-notice-main {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 2px;
}

.broker-alert-notice-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broker-alert-notice-symbol {
  color: var(--muted);
  font-size: 12px;
}

.broker-alert-notice-rule {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.broker-alert-notice-go {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

.broker-alert-notice-go::after {
  content: " ›";
}

.broker-alert-notice-note {
  margin: var(--space-12) 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 18px;
}

.broker-alert-notice-accept {
  min-height: 48px;
  width: 100%;
  padding: 0 var(--space-16);
  border: 0;
  border-radius: var(--radius-8);
  background: var(--accent);
  color: var(--accent-ink, var(--panel));
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.broker-alert-notice-accept:hover {
  filter: brightness(1.06);
}

.broker-alert-notice-close:focus-visible,
.broker-alert-notice-row:focus-visible,
.broker-alert-notice-accept:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .broker-alert-notice-layer {
    transition: none;
  }
}
