/*
 * LexaAI — legal document styles.
 * Tokenized; no raw hex values are used outside the :root token defs.
 * Light theme by default, dark via prefers-color-scheme.
 */
:root {
  --bg: #FFFFFF;
  --bg-surface: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-banner: #FFF8E6;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;
  --gold: #B8960C;
  --gold-light: rgba(184, 150, 12, 0.06);
  --gold-border: rgba(184, 150, 12, 0.25);
  --red: #B91C1C;
  --red-dim: rgba(185, 28, 28, 0.08);
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --measure: 72ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1117;
    --bg-surface: #161822;
    --bg-card: #1C1F2E;
    --bg-banner: #2A2410;
    --text: #E8E6E3;
    --text-muted: #8B8D98;
    --text-dim: #5A5F73;
    --border: #2E3347;
    --border-strong: #3A3F55;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.legal-shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.legal-topbar a { color: var(--gold); text-decoration: none; }
.legal-topbar a:hover { text-decoration: underline; }
.legal-topbar .brand { font-weight: 600; color: var(--text); letter-spacing: -0.01em; }

.draft-banner {
  background: var(--bg-banner);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--text);
}
.draft-banner strong { color: var(--gold); }

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}
p, li { font-size: 15px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }
a { color: var(--gold); }
code, .mono {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: 4px;
}
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.meta {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.meta span strong { color: var(--text); font-weight: 600; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--bg-surface);
  font-weight: 600;
}

.callout {
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
  font-size: 14px;
}
.callout.warning {
  background: var(--red-dim);
  border-left-color: var(--red);
}

.footer-note {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

@media print {
  .legal-topbar a, .draft-banner { color: var(--text) !important; }
  .draft-banner { border: 1px solid var(--text-muted); background: transparent; }
  body { color: black; }
}
