/* 頁面資料說明 (market-panels/data-notice.js): centred required-reading dialog on every market-data page.
   Phone: full width inside 16px gutters. Desktop: max 520px. Colours follow body / body.dark-mode tokens. */

body.data-notice-open {
  overflow: hidden;
}

.data-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;
}

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

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

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

.data-notice-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 2 * var(--space-16) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  padding: 20px 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);
}

.data-notice-dialog:focus {
  outline: none;
}

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

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

.data-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;
}

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

.data-notice-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-12) 2px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.data-notice-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.data-notice-section + .data-notice-section {
  margin-top: 14px;
}

.data-notice-heading {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 21px;
}

.data-notice-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 21px;
}

.data-notice-list li {
  padding-left: 2px;
}

.data-notice-list li::marker {
  color: var(--faint);
}

.data-notice-footer {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 18px;
}

.data-notice-footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.data-notice-footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-4);
}

.data-notice-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch-target);
  margin: 6px 0 var(--space-8);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
  cursor: pointer;
}

.data-notice-check input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.data-notice-check input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.data-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;
}

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

.data-notice-accept:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.data-notice-hint {
  margin: var(--space-8) 0 0;
  color: var(--up);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.data-notice-hint[hidden] {
  display: none;
}

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