:root {
  --bg: #fdfbf7;
  --text: #2a2a2a;
  --heading: #1a1a2e;
  --muted: #6b6b6b;
  --link: #1a5b8e;
  --code-bg: #f0ede5;
  --rule: #e8e4dc;
  --card-bg: #f2f7f3;
  --card-border: #e0ebe1;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

header.nav {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

header.nav a { color: var(--muted); text-decoration: none; }
header.nav a:hover { color: var(--link); text-decoration: underline; }

h1, h2 { color: var(--heading); }
h1 { margin-top: 0; }
h2 { margin-top: 2rem; }

a { color: var(--link); }

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.95em;
}

ul { padding-left: 1.25rem; }

.product-list {
  list-style: none;
  padding: 0;
}

.product-list li {
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.product-list li a {
  font-weight: 600;
  text-decoration: none;
}

.product-list li p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.doc-links {
  list-style: none;
  padding: 0;
}

.doc-links li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.doc-links li:last-child { border-bottom: none; }

.doc-links a { font-weight: 600; text-decoration: none; }
.doc-links a:hover { text-decoration: underline; }

.doc-links .desc {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

footer.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==========================================================================
   Modern legal-page styles. Used by Knitlex pages via <body class="legal">.
   Other apps continue to use the simpler default styles above.
   ========================================================================== */

body.legal {
  --legal-bg: #f8f9fb;
  --legal-card: #ffffff;
  --legal-card-border: #e6e8ec;
  --legal-heading: #0f172a;
  --legal-text: #1f2937;
  --legal-muted: #64748b;
  --legal-accent: #1a5b8e;
  --legal-soft: #f1f3f6;
  --legal-callout: #f6f8fb;
  --legal-radius: 14px;

  max-width: 880px;
  background: var(--legal-bg);
  color: var(--legal-text);
  padding: 0 1.25rem 4rem;
  font-feature-settings: "ss01", "kern";
}

body.legal header.nav {
  margin-top: 1.5rem;
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 0.875rem;
}

.legal-hero {
  text-align: center;
  padding: 3.25rem 1rem 2.5rem;
  margin-bottom: 1.75rem;
}

.legal-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--legal-card);
  border: 1px solid var(--legal-card-border);
  border-radius: 16px;
  margin-bottom: 1.5rem;
  color: var(--legal-heading);
}

.legal-hero-icon svg {
  width: 28px;
  height: 28px;
}

.legal-hero h1 {
  margin: 0 0 0.85rem;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--legal-heading);
  line-height: 1.15;
}

.legal-hero .lead {
  margin: 0 auto 0.85rem;
  max-width: 36rem;
  font-size: 1.05rem;
  color: var(--legal-text);
}

.legal-hero .updated {
  font-size: 0.875rem;
  color: var(--legal-muted);
  margin: 0;
}

.legal-section {
  background: var(--legal-card);
  border: 1px solid var(--legal-card-border);
  border-radius: var(--legal-radius);
  padding: 1.85rem 1.85rem 1.55rem;
  margin: 0 0 1.15rem;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.legal-section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.legal-section-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--legal-soft);
  border-radius: 10px;
  color: var(--legal-heading);
  flex-shrink: 0;
}

.legal-section-icon svg {
  width: 18px;
  height: 18px;
}

.legal-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--legal-heading);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.legal-section h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--legal-heading);
}

.legal-section h3:first-child {
  margin-top: 0;
}

.legal-section p {
  margin: 0 0 0.8rem;
  line-height: 1.65;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul,
.legal-section ol {
  padding-left: 1.4rem;
  margin: 0.4rem 0 0.9rem;
}

.legal-section li {
  margin-bottom: 0.45rem;
  line-height: 1.6;
}

.legal-section li::marker {
  color: var(--legal-muted);
}

.legal-section a {
  color: var(--legal-accent);
}

.legal-section code {
  background: var(--legal-soft);
  border-radius: 4px;
  padding: 0.08rem 0.35rem;
  font-size: 0.92em;
}

.legal-section .callout {
  background: var(--legal-callout);
  border: 1px solid var(--legal-card-border);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
  margin: 0.85rem 0;
  font-size: 0.95rem;
}

.legal-section .callout p:last-child {
  margin-bottom: 0;
}

.legal-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.92rem;
}

.legal-section th,
.legal-section td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--legal-card-border);
  vertical-align: top;
}

.legal-section th {
  color: var(--legal-muted);
  font-weight: 600;
  background: var(--legal-soft);
}

.legal-doc-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0 0;
}

@media (min-width: 600px) {
  .legal-doc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.legal-doc-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem;
  background: var(--legal-card);
  border: 1px solid var(--legal-card-border);
  border-radius: var(--legal-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.legal-doc-card:hover {
  border-color: #c5cad4;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.legal-doc-card-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--legal-soft);
  border-radius: 10px;
  color: var(--legal-heading);
}

.legal-doc-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--legal-heading);
}

.legal-doc-card-desc {
  color: var(--legal-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

body.legal footer.site-footer {
  margin-top: 3rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--legal-card-border);
  font-size: 0.85rem;
  color: var(--legal-muted);
  text-align: center;
}
