:root {
  /* BrivaColors / BrivaMoodPalette — Settings & Me subpages */
  --paper: #1c102e;
  --card: #321c4a;
  --card-elevated: #3d2858;
  --ink: #f7f4ff;
  --muted: #d0b8e0;
  --body: #c4b0d4;
  --line: #5a3878;
  --line-soft: rgba(90, 56, 120, 0.65);
  --accent: #f7f4ff;
  --accent-warm: #ff8a3d;
  --accent-warm-deep: #e86a28;
  --accent-warm-soft: rgba(255, 138, 61, 0.12);
  --accent-warm-line: rgba(255, 138, 61, 0.35);
  --success: #22c55e;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  text-align: left;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 18px 28px;
  box-shadow: var(--shadow);
}

/* ── Header / brand ── */
.legal-header {
  margin-bottom: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.brand {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.2;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Pill nav ── */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: none;
}

nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

nav a.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #1c102e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

nav a:not(.active):active {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Title block ── */
.title-block {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

h1 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-warm);
  flex-shrink: 0;
}

/* ── Body copy ── */
.legal-main > p,
.legal-main > ul,
section > p,
section > ul {
  color: var(--body);
}

p {
  margin: 0 0 14px;
}

h2 {
  position: relative;
  margin: 26px 0 10px;
  padding-left: 12px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent-warm);
}

h2:first-of-type {
  margin-top: 0;
}

ul {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

ul:not(.plain) li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 18px;
  color: var(--body);
}

ul:not(.plain) li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-warm);
  opacity: 0.85;
}

/* ── IAP highlight panel ── */
.iap-panel {
  margin: 24px 0;
  padding: 16px 16px 6px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    180deg,
    var(--accent-warm-soft) 0%,
    rgba(50, 28, 74, 0.95) 100%
  );
  border: 1px solid var(--accent-warm-line);
}

.iap-panel h2 {
  margin-top: 0;
}

.iap-panel h2::before {
  background: var(--accent-warm);
}

.iap-panel p:last-child {
  margin-bottom: 12px;
}

/* ── Support step lists ── */
ol.steps {
  margin: 10px 0 16px;
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.steps li {
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card-elevated);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  color: var(--body);
  font-size: 14px;
}

.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #1c102e;
  font-size: 12px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

/* ── Links ── */
a {
  color: var(--accent-warm);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255, 138, 61, 0.45);
  text-underline-offset: 2px;
}

a:active {
  opacity: 0.85;
}

/* ── Contact chip ── */
.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 14px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #1c102e !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}

.contact-chip:active {
  opacity: 0.9;
}

/* ── Legal doc links (support footer list) ── */
.doc-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-links li {
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-elevated);
}

.doc-links li::before {
  display: none;
}

.doc-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.doc-links a span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

/* ── Footer ── */
footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

footer a {
  font-size: 12px;
}

/* ── Page accents ── */
.legal-support h1 {
  letter-spacing: -0.02em;
}

@media (min-width: 480px) {
  .wrap {
    padding: 20px 20px 48px;
  }

  .card {
    padding: 28px 28px 32px;
  }

  h1 {
    font-size: 30px;
  }
}
