:root {
  --surface-0: #07100d;
  --surface-1: #0b1712;
  --surface-2: #102019;
  --border-subtle: rgba(172, 207, 188, 0.16);
  --border-strong: rgba(53, 242, 122, 0.34);
  --accent: #35f27a;
  --accent-strong: #19d967;
  --text-primary: #eff8f3;
  --text-secondary: #a0b2a8;
  --text-muted: #71857a;
  --danger: #ff6b77;
  --warning: #ffc36b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-elevated: 0 24px 70px rgba(0, 0, 0, 0.38);
}

html { color-scheme: dark; }

body {
  min-width: 320px;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection { background: rgba(53, 242, 122, 0.28); color: #fff; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #031009 !important;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.main:focus { outline: none; }

.site-flash {
  border-left: 3px solid var(--accent);
  line-height: 1.5;
  animation: flash-in 180ms ease-out;
}
.flash-info { border-left-color: #67b7ff; }
.flash-warning { border-left-color: var(--warning); }
.flash-danger, .flash-error { border-left-color: var(--danger); }

.floating-msg-btn {
  width: 52px;
  height: 52px;
  right: 20px;
  bottom: 20px;
  z-index: 1190;
  border: 1px solid rgba(53, 242, 122, 0.46);
  background: linear-gradient(145deg, #22dd6d, #0ca950);
  color: #031009;
  box-shadow: 0 14px 34px rgba(12, 169, 80, 0.3);
}
.floating-msg-btn:hover {
  color: #031009;
  box-shadow: 0 18px 42px rgba(12, 169, 80, 0.42);
}
.cookie-banner:not([hidden]) ~ .floating-msg-btn { bottom: 190px; }

.cookie-banner {
  width: min(600px, calc(100% - 32px));
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}
.cookie-banner strong { font-size: 0.86rem; }
.cookie-banner p { font-size: 0.72rem; }
.cookie-banner button, .cookie-banner a {
  min-height: 36px;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
}

.error-page {
  display: grid;
  min-height: 68vh;
  place-items: center;
  padding: 48px 20px;
  text-align: center;
}
.error-page > div {
  width: min(620px, 100%);
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 0, rgba(53, 242, 122, 0.09), transparent 45%), var(--surface-1);
}
.error-page .error-code {
  color: var(--accent);
  font: 700 0.72rem/1 "Space Grotesk", sans-serif;
  letter-spacing: 0.18em;
}
.error-page h1 {
  margin: 16px 0 10px;
  font: 700 clamp(2rem, 6vw, 3.8rem)/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.055em;
}
.error-page p { color: var(--text-secondary); line-height: 1.7; }
.error-page a {
  display: inline-flex;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #031009 !important;
  font-weight: 800;
  text-decoration: none;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .flash-stack { top: 74px; }
  .cookie-banner {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    max-height: min(72vh, 430px);
    overflow-y: auto;
    gap: 14px;
    padding: 16px;
  }
  .cookie-banner > div:last-child { gap: 8px; }
  .cookie-banner button, .cookie-banner a { min-height: 42px; font-size: 0.68rem; }
  .cookie-banner:not([hidden]) ~ .floating-msg-btn { bottom: auto; top: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keep chat access slightly lower than the 80% viewport line, clear of phone safe areas. */
.floating-msg-btn,
.cookie-banner:not([hidden]) ~ .floating-msg-btn {
  top: auto !important;
  right: auto !important;
  left: max(20px, env(safe-area-inset-left)) !important;
  bottom: max(15vh, calc(env(safe-area-inset-bottom) + 20px)) !important;
  border-radius: 16px;
  background: linear-gradient(145deg,#35f27a,#12b85a);
  box-shadow: 0 16px 40px rgba(18,184,90,.32),inset 0 1px rgba(255,255,255,.36);
}
