*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  /* The page background belongs here, not only on .policy-main. A background on <body>
     propagates to the canvas; one on an inner <div> does not, so the area behind the sticky
     header stayed white. */
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* ── THEMES ── */
body.dark {
  --bg:             #0d1b2a;
  --surface:        #111f2e;
  --surface2:       #162535;
  --border:         rgba(255,255,255,0.07);
  --text:           #e2ecf2;
  --muted:          #5e8095;
  --soft:           #8dafc2;
  --accent:         #1fc8b4;
  --accent-dim:     rgba(31,200,180,0.09);
  --accent-border:  rgba(31,200,180,0.22);
  --red-dim:        rgba(248,113,113,0.06);
  --red-border:     rgba(248,113,113,0.2);
  --red-text:       #f87171;
  --amber-dim:      rgba(251,191,36,0.07);
  --amber-border:   rgba(251,191,36,0.22);
  --purple-dim:     rgba(167,139,250,0.07);
  --purple-border:  rgba(167,139,250,0.2);
  --purple-text:    #a78bfa;
  --step-line:      rgba(31,200,180,0.2);
  --footer-muted:   #3a5566;
}
body.light {
  --bg:             #f5f7fa;
  --surface:        #ffffff;
  --surface2:       #edf2f7;
  --border:         rgba(0,0,0,0.08);
  --text:           #0d1b2a;
  --muted:          #5a7a8a;
  --soft:           #4a6272;
  --accent:         #0f8f80;
  --accent-dim:     rgba(15,143,128,0.07);
  --accent-border:  rgba(15,143,128,0.22);
  --red-dim:        rgba(220,38,38,0.04);
  --red-border:     rgba(220,38,38,0.16);
  --red-text:       #dc2626;
  --amber-dim:      rgba(180,130,0,0.05);
  --amber-border:   rgba(180,130,0,0.18);
  --purple-dim:     rgba(109,40,217,0.05);
  --purple-border:  rgba(109,40,217,0.15);
  --purple-text:    #7c3aed;
  --step-line:      rgba(15,143,128,0.2);
  --footer-muted:   #5a7a8a;
}

/* ── HEADER ── */
.policy-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 17px; text-decoration: none;
}
.theme-toggle {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── MAIN & LAYOUT ── */
.policy-main { background: var(--bg); min-height: calc(100vh - 60px); padding: 52px 32px 80px; }

.policy-layout {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 228px 1fr;
  gap: 52px; align-items: start;
}

/* ── TOC SIDEBAR ── */
.policy-toc-sidebar {
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: none;
}
.policy-toc-sidebar::-webkit-scrollbar { display: none; }

.toc-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 10px; margin-bottom: 10px;
}
.toc-nav { display: flex; flex-direction: column; gap: 1px; }

.toc-link {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 6px 10px; border-radius: 6px;
  text-decoration: none; color: var(--muted);
  font-size: 12px; line-height: 1.45;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.toc-link:hover { color: var(--text); background: var(--surface2); border-left-color: var(--border); }
.toc-link.active {
  color: var(--accent); background: var(--accent-dim);
  border-left-color: var(--accent); font-weight: 600;
}
.toc-num {
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  min-width: 16px; flex-shrink: 0; margin-top: 1px; opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.toc-link.active .toc-num { color: var(--accent); opacity: 1; }

/* ── CONTENT COLUMN ── */
.policy-content { min-width: 0; }

/* ── DOCUMENT HEADER ── */
.policy-doc-header { margin-bottom: 44px; padding-bottom: 36px; border-bottom: 1px solid var(--border); }
.policy-doc-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: 18px;
}
.policy-doc-title {
  font-family: 'DM Serif Display', serif;
  font-size: 34px; font-weight: 400; color: var(--text);
  margin-bottom: 8px; letter-spacing: -0.5px; line-height: 1.1;
}
.policy-doc-meta { font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.policy-intro-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 16px 18px;
  font-size: 14px; color: var(--soft); line-height: 1.78;
}

/* ── SECTIONS ── */
.policy-section { margin-bottom: 44px; padding-bottom: 44px; border-bottom: 1px solid var(--border); }
.policy-section:last-of-type { border-bottom: none; }

.section-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 20px; font-weight: 400; color: var(--text);
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.3px; line-height: 1.25;
}

.subsection-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  margin: 22px 0 10px; padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.policy-section p { font-size: 14px; color: var(--soft); line-height: 1.8; margin-bottom: 14px; }
.policy-section p:last-child { margin-bottom: 0; }
.policy-section strong { color: var(--text); font-weight: 600; }

/* ── LISTS ── */
.policy-list {
  list-style: none; padding: 0; margin: 0 0 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.policy-list li {
  font-size: 14px; color: var(--soft); line-height: 1.75;
  padding-left: 18px; position: relative;
}
.policy-list li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: 0.65;
}
.policy-list li strong { color: var(--text); font-weight: 600; }

/* ── CALLOUTS ── */
.policy-callout {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  border-radius: 10px; padding: 14px 16px; margin-top: 18px;
  font-size: 13.5px; line-height: 1.65;
}
.policy-callout svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.policy-callout span { color: var(--soft); }

.warn-callout {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--amber-dim); border: 1px solid var(--amber-border);
  border-radius: 10px; padding: 14px 16px; margin-top: 18px;
  font-size: 13.5px; line-height: 1.65;
}
.warn-callout svg { flex-shrink: 0; margin-top: 2px; color: #fbbf24; }
.warn-callout span { color: var(--soft); }

.danger-callout {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--red-dim); border: 1px solid var(--red-border);
  border-radius: 10px; padding: 14px 16px; margin-top: 18px;
  font-size: 13.5px; line-height: 1.65;
}
.danger-callout svg { flex-shrink: 0; margin-top: 2px; color: var(--red-text); }
.danger-callout span { color: var(--soft); }

/* ── SPECIAL: Privacy Section 2 Consent Highlight ── */
.consent-section {
  background: var(--purple-dim); border: 1px solid var(--purple-border);
  border-radius: 14px; padding: 22px 22px; margin-bottom: 44px;
  padding-bottom: 22px; border-bottom: none; position: relative;
}
.consent-section::before {
  content: 'Sensitive Data';
  position: absolute; top: -10px; left: 18px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--purple-text); background: var(--bg);
  padding: 0 8px;
}
.consent-section .subsection-title { border-left-color: var(--purple-text); }
.consent-section .policy-callout {
  background: rgba(167,139,250,0.06); border-color: var(--purple-border);
}
.consent-section .policy-callout svg { color: var(--purple-text); }

/* ── ROLE CARDS ── */
.role-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.role-card p { font-size: 13.5px; color: var(--soft); line-height: 1.75; margin: 0; }
.role-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; width: fit-content;
}
.role-badge.buyer     { background: rgba(59,130,246,0.12); color: #60a5fa; }
.role-badge.seller    { background: rgba(31,200,180,0.12); color: #1fc8b4; }
.role-badge.admin     { background: rgba(245,158,11,0.12); color: #fbbf24; }
.role-badge.superadmin{ background: rgba(168,85,247,0.12); color: #c084fc; }

/* ── RIGHTS GRID ── */
.rights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.right-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
}
.right-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.right-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.right-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── DOC GRID ── */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.doc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
}
.doc-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.doc-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.doc-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── STEP TIMELINE ── */
.step-list { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-direction: column; }
.step-list li {
  display: flex; align-items: flex-start; gap: 14px;
  font-size: 14px; color: var(--soft); line-height: 1.75;
  padding-bottom: 24px; position: relative;
}
.step-list li:last-child { padding-bottom: 0; }
.step-list li:not(:last-child)::before {
  content: ''; position: absolute;
  left: 12px; top: 27px; bottom: 0; width: 1px;
  background: var(--step-line);
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; position: relative; z-index: 1;
}
.step-list li strong { color: var(--text); }

/* ── PROHIBITED LIST ── */
.prohibited-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 7px; }
.prohibited-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--soft); line-height: 1.72;
  padding: 10px 14px;
  background: var(--red-dim); border: 1px solid var(--red-border);
  border-radius: 8px;
}
.prohibited-list li::before {
  content: '✕'; color: var(--red-text); font-weight: 800; font-size: 10px;
  flex-shrink: 0; margin-top: 4px;
}

/* ── PROHIBITED SUB-SECTIONS: red left accent ── */
.prohibited-sub {
  padding-left: 14px;
  border-left: 2px solid rgba(248,113,113,0.3);
  margin-bottom: 24px;
}
.prohibited-sub .subsection-title {
  border-left: none; padding-left: 0;
  color: var(--red-text);
}

/* ── CONTACT ── */
.contact-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px; margin-top: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.contact-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--soft);
}
.contact-row svg { color: var(--accent); flex-shrink: 0; }
.contact-row strong { color: var(--text); font-weight: 600; }

/* ── LINK ── */
.policy-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.policy-link:hover { text-decoration: underline; }

/* ── FOOTER NAV ── */
.policy-footer-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 0 0; margin-top: 16px; border-top: 1px solid var(--border);
}
.pfn-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: none; background: var(--surface); transition: all 0.2s;
}
.pfn-link:hover { color: var(--accent); border-color: var(--accent-border); }

/* ── PAGE FOOTER ── */
.policy-page-footer {
  background: var(--bg); border-top: 1px solid var(--border);
  padding: 18px 48px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--footer-muted);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--footer-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .policy-layout { grid-template-columns: 1fr; gap: 0; }
  .policy-toc-sidebar { position: static; max-height: none; margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
  .toc-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .toc-link { border-left: none; border-radius: 6px; padding: 5px 10px; }
  .toc-link.active { border-left: none; background: var(--accent-dim); }
}
@media (max-width: 768px) {
  .policy-main { padding: 32px 16px 60px; }
  .policy-header { padding: 0 20px; }
  .policy-doc-title { font-size: 26px; }
  .rights-grid { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .policy-page-footer { padding: 14px 20px; flex-direction: column; gap: 8px; text-align: center; }
}
@media (max-width: 480px) {
  .policy-doc-title { font-size: 22px; }
  .section-title { font-size: 18px; }
}
