/* Lemonade legal pages — design tokens mirror the Flutter app
 * Spacing: 4 · 8 · 12 · 16
 * Type: 10 label · 12 meta · 13 body · 16 title
 * Color: #000 primary · #525252 meta · #E8E8E8 surface · #E0E0E0 border
 *        AppColors.action #24A0ED for links
 */

:root {
  --text-primary: #000000;
  --text-secondary: #525252;
  --bg: #ffffff;
  --border: #e0e0e0;
  --surface-muted: #e8e8e8;
  --hint: rgba(82, 82, 82, 0.4);
  --action: #24a0ed;
  --action-hover: #1a8cd8;
  --danger: #e53935;
  --max: 40rem;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space: clamp(1rem, 4vw, 1.5rem);
  --font: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-label: 10px;
  --font-meta: 12px;
  --font-body: 13px;
  --font-title: 16px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--font-body);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
}

a {
  color: var(--action);
  text-decoration: none;
}

a:hover {
  color: var(--action-hover);
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--text-primary);
  background: var(--surface-muted);
  padding: 0.08em 0.35em;
  border-radius: var(--space-xs);
  word-break: break-all;
}

/* —— Header (no bottom divider — matches app chrome) —— */
.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0 var(--space);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand {
  flex-shrink: 0;
  color: var(--text-primary);
  font-weight: 700;
  font-size: var(--font-title);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
}

.brand:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) 10px;
  border-radius: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--font-body);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav a:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--surface-muted);
}

@media (max-width: 420px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-top: var(--space-md);
    padding-bottom: 10px;
    min-height: 0;
    gap: var(--space-sm);
  }

  .nav {
    justify-content: flex-start;
    margin-left: -6px;
  }
}

/* —— Layout —— */
main {
  flex: 1;
  padding: clamp(1.25rem, 4vw, 2rem) 0 clamp(2rem, 5vw, 3rem);
}

.wrap {
  width: min(100% - (var(--space) * 2), var(--max));
  margin: 0 auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Flatten former card chrome — structure only, no box */
.card,
.card-header,
.card-body {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  padding: 0;
  margin: 0;
}

.card-header {
  margin-bottom: var(--space-lg);
  padding-bottom: 0;
  border-bottom: 0;
}

.card-header h1 {
  margin: 0;
  font-size: var(--font-title);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.card-header .lead {
  margin: var(--space-sm) 0 0;
}

.card-header .meta {
  margin: var(--space-md) 0 0;
}

.lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-body);
  line-height: 1.55;
}

.meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-meta);
  line-height: 1.5;
}

/* —— Settings-style list (no row dividers — matches app) —— */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-md) 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.list-row:hover {
  background: transparent;
  text-decoration: none;
  color: inherit;
}

.list-row:hover .list-row-title {
  color: var(--action);
}

.list-row-text {
  flex: 1;
  min-width: 0;
}

.list-row-title {
  margin: 0;
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  transition: color 0.12s ease;
}

.list-row-subtitle {
  margin: var(--space-xs) 0 0;
  font-size: var(--font-meta);
  color: var(--text-secondary);
  line-height: 1.4;
}

.list-row-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

/* —— Buttons —— */
.actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

@media (min-width: 480px) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px var(--space-lg);
  border-radius: 999px;
  font-family: inherit;
  font-size: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  text-align: center;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

/* Filled CTA matches app primary black */
.button-primary {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.button-primary:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
  text-decoration: none;
}

.button-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border-color: var(--border);
}

.button-secondary:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
  text-decoration: none;
}

/* —— Legal prose —— */
.prose {
  padding: 0;
}

.prose h2 {
  margin: 1.35rem 0 var(--space-sm);
  font-size: var(--font-title);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  scroll-margin-top: 4rem;
}

.prose h2:first-of-type {
  margin-top: var(--space-sm);
}

.prose h3 {
  margin: 1rem 0 var(--space-xs);
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  scroll-margin-top: 4rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: var(--font-body);
  line-height: 1.55;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li {
  margin: var(--space-xs) 0;
}

.prose li::marker {
  color: var(--text-secondary);
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.toc {
  background: var(--surface-muted);
  border: 0;
  border-radius: var(--space-sm);
  padding: 14px var(--space-lg);
  margin: 0 0 var(--space-lg);
}

.toc strong {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--font-meta);
  font-weight: 600;
  color: var(--text-secondary);
}

.toc ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-secondary);
  font-size: var(--font-body);
  columns: 1;
  column-gap: 1.25rem;
}

@media (min-width: 560px) {
  .toc ol {
    columns: 2;
  }
}

.toc li {
  margin: 0.2rem 0;
  break-inside: avoid;
}

.toc a {
  font-weight: 500;
  color: var(--action);
}

.toc a:hover {
  color: var(--action-hover);
}

/* —— Footer (no top divider) —— */
.site-footer {
  margin-top: auto;
  background: var(--bg);
  padding: 14px 0;
  color: var(--text-secondary);
  font-size: var(--font-meta);
}

.site-footer-inner {
  width: min(100% - (var(--space) * 2), var(--max));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 560px) {
  .site-footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.site-footer a {
  color: var(--text-secondary);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--text-primary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) 14px;
}

.home-meta {
  margin: var(--space-lg) 0 0;
  color: var(--text-secondary);
  font-size: var(--font-meta);
}

/* Home: spacing only (already no list dividers globally) */
.page-home .card-header {
  margin-bottom: var(--space-sm);
}

.page-home .list-row {
  padding: var(--space-md) 0;
}

/* 404 title */
.page-error h1 {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-title);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
