:root {
  --as-ink: #201b2d;
  --as-muted: #5f5a6b;
  --as-purple: #5b2f83;
  --as-purple-dark: #40205d;
  --as-lilac: #f4eef9;
  --as-gold: #c69a37;
  --as-line: #ded6e8;
  --as-bg: #ffffff;
  --as-soft: #faf8fc;
  --as-good: #eef8f1;
  --as-warn: #fff8e8;
  --as-info: #eef5fb;
}

.as-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px 54px;
  color: var(--as-ink);
  line-height: 1.65;
}

.as-page * { box-sizing: border-box; }
.as-page a { color: var(--as-purple-dark); text-underline-offset: 2px; }
.as-page h1, .as-page h2, .as-page h3 { line-height: 1.22; color: var(--as-ink); }
.as-page h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 12px; }
.as-page h2 { margin-top: 38px; font-size: clamp(1.45rem, 2.5vw, 2rem); }
.as-page h3 { margin-top: 26px; font-size: 1.18rem; }
.as-page p, .as-page li { font-size: 1rem; }
.as-page ul, .as-page ol { padding-left: 1.35rem; }
.as-page li + li { margin-top: .42rem; }

.as-breadcrumbs { font-size: .92rem; color: var(--as-muted); margin-bottom: 18px; }
.as-breadcrumbs a { color: inherit; }

.as-hero {
  background: linear-gradient(135deg, var(--as-lilac), #fff);
  border: 1px solid var(--as-line);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 42px);
  box-shadow: 0 10px 35px rgba(64, 32, 93, .06);
}
.as-kicker { font-weight: 800; color: var(--as-purple); letter-spacing: .02em; margin: 0 0 8px; }
.as-subtitle { font-size: 1.12rem; color: var(--as-muted); max-width: 800px; margin: 0; }
.as-brand-line { margin-top: 16px; color: var(--as-purple-dark); }

.as-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 28px;
  padding: 10px;
  border: 1px solid var(--as-line);
  background: var(--as-soft);
  border-radius: 16px;
}
.as-nav a {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}
.as-nav a:hover, .as-nav a:focus-visible, .as-nav .is-current {
  background: var(--as-purple);
  color: #fff;
}

.as-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 18px 0 28px;
}
.as-card {
  border: 1px solid var(--as-line);
  border-radius: 18px;
  background: var(--as-bg);
  padding: 20px;
}
.as-card h2, .as-card h3 { margin-top: 0; }
.as-card p:last-child { margin-bottom: 0; }
.as-card-link { display: inline-block; font-weight: 800; margin-top: 5px; }

.as-notice {
  margin: 20px 0;
  border-left: 5px solid var(--as-purple);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--as-info);
}
.as-notice-warn { background: var(--as-warn); border-left-color: var(--as-gold); }
.as-notice-good { background: var(--as-good); border-left-color: #3e7b4f; }
.as-notice p { margin: 5px 0 0; }

.as-steps {
  counter-reset: asstep;
  list-style: none;
  padding: 0;
}
.as-steps li {
  counter-increment: asstep;
  position: relative;
  margin: 0 0 14px;
  padding: 15px 16px 15px 54px;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  background: #fff;
}
.as-steps li::before {
  content: counter(asstep);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--as-purple);
  color: #fff;
  font-weight: 800;
}

.as-table-wrap { overflow-x: auto; margin: 18px 0 26px; }
.as-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.as-table th, .as-table td { border: 1px solid var(--as-line); padding: 12px; vertical-align: top; text-align: left; }
.as-table th { background: var(--as-lilac); }

.as-calc {
  margin: 18px 0;
  background: #241b31;
  color: #fff;
  border-radius: 16px;
  padding: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.as-checklist {
  border: 1px solid var(--as-line);
  border-radius: 18px;
  padding: 18px 20px;
  background: var(--as-soft);
}
.as-checklist h2, .as-checklist h3 { margin-top: 0; }

.as-sources {
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid var(--as-line);
}
.as-sources h2 { margin-top: 0; font-size: 1.35rem; }
.as-reviewed { color: var(--as-muted); font-size: .92rem; }

.as-next {
  margin-top: 34px;
  padding: 20px;
  border: 1px solid var(--as-line);
  border-radius: 18px;
  background: var(--as-lilac);
}
.as-next h2 { margin-top: 0; }


/* ------------------------------------------------------------
   Awareverse site-wide theme integration
   site.css owns the light/dark palette. These rules only make
   AwareAdult components participate cleanly in that theme.
------------------------------------------------------------- */

/* Light mode: retain the softer AwareAdult panels. */
body.light-mode .as-hero,
body.light-mode .as-nav,
body.light-mode .as-card,
body.light-mode .as-steps li,
body.light-mode .as-checklist,
body.light-mode .as-next {
  color: var(--as-ink);
}

/* Dark mode: use the same glass/card language as the rest of Awareverse. */
body:not(.light-mode) .as-page {
  color: var(--text);
}

body:not(.light-mode) .as-hero,
body:not(.light-mode) .as-nav,
body:not(.light-mode) .as-card,
body:not(.light-mode) .as-steps li,
body:not(.light-mode) .as-checklist,
body:not(.light-mode) .as-next {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0,0,0,.20);
}

body:not(.light-mode) .as-hero h1,
body:not(.light-mode) .as-hero h2,
body:not(.light-mode) .as-hero h3,
body:not(.light-mode) .as-card h1,
body:not(.light-mode) .as-card h2,
body:not(.light-mode) .as-card h3,
body:not(.light-mode) .as-checklist h1,
body:not(.light-mode) .as-checklist h2,
body:not(.light-mode) .as-checklist h3,
body:not(.light-mode) .as-next h1,
body:not(.light-mode) .as-next h2,
body:not(.light-mode) .as-next h3 {
  color: var(--text) !important;
  -webkit-text-fill-color: currentColor !important;
}

body:not(.light-mode) .as-hero h1 {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
}

body:not(.light-mode) .as-subtitle,
body:not(.light-mode) .as-reviewed,
body:not(.light-mode) .as-breadcrumbs {
  color: var(--text-muted) !important;
}

body:not(.light-mode) .as-kicker,
body:not(.light-mode) .as-brand-line,
body:not(.light-mode) .as-brand-line strong {
  color: #c4b5fd !important;
  -webkit-text-fill-color: currentColor !important;
}

body:not(.light-mode) .as-nav a {
  color: #e9d5ff;
}
body:not(.light-mode) .as-nav a:hover,
body:not(.light-mode) .as-nav a:focus-visible,
body:not(.light-mode) .as-nav a.is-current,
body:not(.light-mode) .as-nav .is-current {
  background: rgba(165,111,255,.30);
  color: #fff;
}

/* Notices remain distinctive but readable in dark mode. */
body:not(.light-mode) .as-notice {
  background: rgba(125,211,252,.10);
  border-left-color: #7dd3fc;
  color: var(--text);
}
body:not(.light-mode) .as-notice-warn {
  background: rgba(251,191,36,.10);
  border-left-color: #fbbf24;
}
body:not(.light-mode) .as-notice-good {
  background: rgba(52,211,153,.10);
  border-left-color: #34d399;
}
body:not(.light-mode) .as-notice,
body:not(.light-mode) .as-notice p,
body:not(.light-mode) .as-notice li,
body:not(.light-mode) .as-notice strong {
  color: var(--text) !important;
  -webkit-text-fill-color: currentColor !important;
}

/* IMPORTANT: allow site.css to own table colours in dark mode. */
body:not(.light-mode) .as-table {
  background: rgba(255,255,255,.07);
  color: var(--text);
}
body:not(.light-mode) .as-table th {
  background: linear-gradient(135deg,#a56fff,#6c5ce7);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
body:not(.light-mode) .as-table td {
  background: transparent;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  border-color: rgba(255,255,255,.18);
}
body:not(.light-mode) .as-table td p,
body:not(.light-mode) .as-table td span,
body:not(.light-mode) .as-table td li,
body:not(.light-mode) .as-table td strong {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}

body:not(.light-mode) .as-page a {
  color: #c4b5fd;
}

@media (max-width: 620px) {
  .as-page { padding-left: 14px; padding-right: 14px; }
  .as-nav { padding: 8px; }
  .as-nav a { width: 100%; }
}
