/* DreamFundSL legal & support pages (terms.html, privacy.html, refunds.html,
   contact.html). Standalone on purpose, like maintenance.css: these pages must
   keep working even if app.css / app.js are mid-deploy, and they must be
   readable without JavaScript. theme.js only flips data-theme. */
:root {
  color-scheme: light;
  --bg: #f5f6f8; --card: #ffffff; --line: #e1e4ea;
  --text: #101a2c; --muted: #4f5a6a; --faint: #8a93a1;
  --accent: #0c6f84; --accent-dim: #e2eef2; --accent-strong: #095a6b;
  --note-bg: #fff7e0; --note-line: #e8c766; --note-text: #5a4400;
  --shadow: 0 10px 30px rgba(11, 18, 32, 0.08);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1a; --card: #111a2c; --line: #223049;
  --text: #e8edf5; --muted: #a3afc1; --faint: #6b7789;
  --accent: #2dd4bf; --accent-dim: #12302f; --accent-strong: #5eead4;
  --note-bg: #2a2410; --note-line: #6b5a1c; --note-text: #f0d98a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.65; font-size: 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); z-index: 10; }
.skip-link:focus { left: 12px; }

/* ---------- top bar ---------- */
.lg-top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.lg-top-row { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lg-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.lg-brand span span { color: var(--accent); }
.lg-brand img { display: block; }
.lg-top-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lg-top-links a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.lg-top-links a:hover { background: var(--accent-dim); color: var(--text); }
.lg-top-links a[aria-current="page"] { color: var(--text); background: var(--accent-dim); }

/* ---------- layout ---------- */
.lg-wrap { max-width: 1040px; margin: 0 auto; padding: 32px 20px 56px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.lg-toc { position: sticky; top: 84px; font-size: 14px; }
.lg-toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin: 0 0 10px; }
.lg-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.lg-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.lg-toc li a:hover { color: var(--text); border-left-color: var(--accent); }
.lg-doc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 36px 40px; min-width: 0; }
.lg-doc h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; }
.lg-meta { color: var(--faint); font-size: 14px; margin: 0 0 22px; }
.lg-lede { font-size: 17px; color: var(--muted); margin: 0 0 8px; }
.lg-doc h2 { font-size: 21px; line-height: 1.3; margin: 40px 0 10px; letter-spacing: -0.01em; padding-top: 8px; border-top: 1px solid var(--line); }
.lg-doc h2:first-of-type { margin-top: 28px; }
.lg-doc h3 { font-size: 16px; margin: 22px 0 6px; }
.lg-doc p { margin: 0 0 14px; overflow-wrap: anywhere; }
.lg-doc ul, .lg-doc ol { margin: 0 0 16px; padding-left: 22px; }
.lg-doc li { margin: 0 0 6px; overflow-wrap: anywhere; }
.lg-doc strong { font-weight: 650; }

.lg-note { background: var(--note-bg); border: 1px solid var(--note-line); color: var(--note-text); border-radius: 12px; padding: 14px 16px; margin: 0 0 18px; font-size: 15px; }
.lg-note p { margin: 0; }
.lg-key { background: var(--accent-dim); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; padding: 14px 18px; margin: 0 0 22px; }
.lg-key h2 { border: 0; margin: 0 0 8px; padding: 0; font-size: 16px; }
.lg-key ul { margin: 0; }

.lg-table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; }
.lg-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.lg-table th, .lg-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.lg-table th { background: var(--accent-dim); font-weight: 650; }
.lg-table tr:last-child td { border-bottom: 0; }

.lg-contact-card { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 0 0 22px; }
.lg-contact-card > div { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.lg-contact-card h3 { margin: 0 0 4px; font-size: 15px; }
.lg-contact-card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- footer ---------- */
.lg-foot { border-top: 1px solid var(--line); }
.lg-foot-row { max-width: 1040px; margin: 0 auto; padding: 22px 20px 36px; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.lg-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.lg-foot a { color: var(--muted); }
.lg-foot a:hover { color: var(--text); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .lg-wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 20px; }
  .lg-toc { position: static; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
  .lg-toc ol { columns: 2; column-gap: 24px; border-left: 0; }
  .lg-toc li a { padding-left: 0; border-left: 0; margin-left: 0; }
  .lg-doc { padding: 24px 20px; }
  .lg-doc h1 { font-size: 26px; }
}
@media (max-width: 520px) {
  .lg-toc ol { columns: 1; }
  .lg-top-links a { padding: 6px 8px; font-size: 13px; }
}
@media print {
  .lg-top, .lg-toc, .lg-foot, .skip-link { display: none; }
  html, body { background: #fff; color: #000; }
  .lg-wrap { display: block; padding: 0; }
  .lg-doc { border: 0; box-shadow: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
