/* Site-wide safety notice. The server adds the markup to every HTML page (server/safety-notice.ts);
   notice.js adds session memory and focus handling. Prefixed "sn-" to stay self-contained. */

html.sn-lock,
html.sn-lock body {
  overflow: hidden !important;
}

.sn-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(251, 191, 36, 0.13), transparent 70%),
    rgba(3, 6, 12, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: inherit;
  animation: sn-fade-in 320ms ease-out both;
}

.sn-overlay.sn-leaving {
  animation: sn-fade-out 280ms ease-in both;
}

.sn-card {
  position: relative;
  margin: auto;
  width: min(580px, 100%);
  padding: 26px 30px 24px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 18px;
  background: linear-gradient(180deg, #111827 0%, #0a0e17 100%);
  color: #e5e7eb;
  box-shadow:
    0 0 0 4px rgba(251, 191, 36, 0.06),
    0 0 56px rgba(251, 191, 36, 0.2),
    0 28px 90px rgba(0, 0, 0, 0.65);
  animation:
    sn-rise 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both,
    sn-glow 4.5s ease-in-out 600ms infinite;
  outline: none;
}

.sn-card::before {
  content: "";
  position: absolute;
  inset: 0 24px auto;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, #fb7185 15%, #fbbf24 50%, #5eead4 85%, transparent);
}

.sn-wave {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 12px;
  overflow: visible;
}

.sn-wave-line,
.sn-wave-glow {
  fill: none;
  stroke: url(#sn-wave-gradient);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sn-wave-line {
  stroke-width: 3;
  stroke-dasharray: var(--sn-wave-length);
  stroke-dashoffset: var(--sn-wave-length);
  animation: sn-draw 1.8s cubic-bezier(0.3, 0.7, 0.2, 1) 250ms forwards;
}

.sn-wave-glow {
  stroke-width: 10;
  opacity: 0.16;
  filter: blur(4px);
}

.sn-eyebrow {
  margin: 0 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fbbf24;
}

.sn-title {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: #fff8e7;
}

.sn-intro {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5e1;
}

.sn-keep {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 650;
  color: #f1f5f9;
}

.sn-points {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.sn-point {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 14.5px;
  line-height: 1.55;
  color: #d1d5db;
}

.sn-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  margin-top: -2px;
}

.sn-icon-research {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.12);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.3);
}

.sn-icon-caution {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.13);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.35);
}

.sn-icon-care {
  color: #5eead4;
  background: rgba(94, 234, 212, 0.12);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.3);
}

.sn-agreement {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-left: 3px solid #fbbf24;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 550;
  color: #fef3c7;
}

.sn-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 15px;
  font-weight: 650;
  color: #ffffff;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.sn-check:hover {
  border-color: rgba(251, 191, 36, 0.5);
}

.sn-check.sn-checked {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.sn-check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #fbbf24;
  cursor: pointer;
}

.sn-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.sn-enter-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
}

.sn-enter {
  min-width: 148px;
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: #1a1205;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  box-shadow: 0 0 26px rgba(251, 191, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 160ms ease;
}

.sn-enter:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.sn-enter:disabled {
  color: #6b7280;
  background: #1f2937;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  cursor: not-allowed;
}

.sn-hint {
  font-size: 12.5px;
  color: #94a3b8;
}

.sn-back {
  margin-right: auto;
  padding: 8px 2px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: #94a3b8;
  cursor: pointer;
}

.sn-back:hover {
  color: #e2e8f0;
  text-decoration: underline;
}

.sn-card :focus-visible {
  outline: 2px solid #fde68a;
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .sn-card {
    padding: 22px 18px 18px;
  }

  .sn-title {
    font-size: 26px;
  }

  .sn-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .sn-enter-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .sn-enter {
    width: 100%;
  }

  .sn-hint {
    text-align: center;
  }

  .sn-back {
    margin: 0 auto;
  }
}

@keyframes sn-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sn-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes sn-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes sn-glow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.06), 0 0 56px rgba(251, 191, 36, 0.2), 0 28px 90px rgba(0, 0, 0, 0.65);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1), 0 0 76px rgba(251, 191, 36, 0.3), 0 28px 90px rgba(0, 0, 0, 0.65);
  }
}

@keyframes sn-draw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sn-overlay,
  .sn-overlay.sn-leaving,
  .sn-card {
    animation: none;
  }

  .sn-wave-line {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ---- Every page: the notice is part of the HTML, with or without JavaScript ---- */

.sn-root {
  font-family: var(--font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  line-height: 1.5;
  text-align: left;
}

/* Already agreed this session (set before first paint by the server's inline check). */
html.sn-accepted .sn-root {
  display: none !important;
}

.sn-root:not(.sn-js) .sn-js-only,
.sn-root.sn-js .sn-nojs-only {
  display: none !important;
}

/* Without JavaScript: a hidden switch that the "Enter" label turns on. */
.sn-root .sn-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
}

#sn-entered:checked ~ .sn-overlay {
  display: none;
}

#sn-entered:focus-visible ~ .sn-overlay label.sn-enter {
  outline: 2px solid #fbbf24;
  outline-offset: 3px;
}

label.sn-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
}

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

@supports selector(:has(*)) {
  html:has(.sn-root:not(.sn-js) #sn-entered:not(:checked)),
  html:has(.sn-root:not(.sn-js) #sn-entered:not(:checked)) body {
    overflow: hidden !important;
  }

  .sn-check:has(input:checked) {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
  }

  /* Enter stays unusable until the box is ticked. */
  .sn-root:not(:has(#sn-agree:checked)) label.sn-enter {
    color: #6b7280;
    background: #1f2937;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    cursor: not-allowed;
    pointer-events: none;
  }

  .sn-root:not(:has(#sn-agree:checked)) #sn-entered {
    visibility: hidden;
  }

  .sn-root:not(.sn-js):has(#sn-agree:checked) .sn-hint {
    display: none;
  }
}
