/* =========================================================
   Legal documents (Terms of Use). Built on index.css (shared header,
   footer, tokens) and the landing page's visual language: a pale teal
   heading band with one ochre word, ink headings, teal accents.
   Long-form reading: a contents list beside a comfortable text column.
   ========================================================= */
.legal-doc { background: #fff; }

/* ---------- Heading band ---------- */
.legal-band {
  background: #eef5f5;
  border-bottom: 1px solid #e3ebec;
  padding: clamp(28px, 4vh, 40px) 0 clamp(24px, 3.5vh, 34px);
}
.legal-band-inner { max-width: 1120px; margin: 0 auto; }
.legal-band h1 {
  margin: 0;
  font-size: clamp(36px, 3.4vw, 50px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink, #111827);
}
.legal-meta {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted, #6b7280);
}

/* ---------- Contents + document ---------- */
.legal-body { padding: clamp(40px, 6vh, 64px) 0 clamp(56px, 9vh, 96px); }
.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}
.legal-contents {
  position: sticky;
  top: calc(var(--header-h, 62px) + 24px);
  max-height: calc(100vh - var(--header-h, 62px) - 48px);
  overflow-y: auto;
  padding-right: 8px;
}
.legal-contents-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark, #2f696f);
}
.legal-contents ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid #e3ebec; }
.legal-contents a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.4;
  color: var(--body, #374151);
  text-decoration: none;
}
.legal-contents a span { color: var(--muted, #6b7280); }
.legal-contents a:hover { color: var(--teal-dark, #2f696f); border-left-color: var(--teal, #397f86); }

.legal-article { max-width: 760px; }
.terms-intro p {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink, #111827);
}
.terms-section {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid #e8eeee;
  scroll-margin-top: calc(var(--header-h, 62px) + 16px);
}
.terms-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink, #111827);
}
.terms-num { color: var(--teal, #397f86); }
.legal-article p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body, #374151);
}
.legal-article strong { font-weight: 600; color: var(--ink, #111827); }
/* links in the text: teal, medium weight, always underlined so they read as links */
.legal-article a { color: var(--teal-dark, #2f696f); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(57, 127, 134, 0.55); text-decoration-thickness: 1.5px; text-underline-offset: 3px; overflow-wrap: anywhere; transition: color 0.15s ease, text-decoration-color 0.15s ease, background-color 0.15s ease; }
.legal-article a:hover { color: var(--teal, #397f86); text-decoration-color: currentColor; text-decoration-thickness: 2px; background: rgba(57, 127, 134, 0.07); border-radius: 2px; }
.legal-article a:focus-visible { outline: 2px solid var(--teal, #397f86); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .legal-article a { transition: none; } }
.terms-list { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 10px; }
.terms-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  font-size: 16px;
  line-height: 1.7;
  color: var(--body, #374151);
}
.terms-mark { color: var(--teal-dark, #2f696f); font-weight: 600; }

/* ---------- Tablets and phones: contents above the document ---------- */
@media (max-width: 1023px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .legal-contents { position: static; max-height: none; overflow: visible; padding: 18px 20px; border-radius: 14px; background: #f7fafa; border: 1px solid #e3ebec; }
  .legal-contents ol { border-left: 0; columns: 2; column-gap: 24px; }
  .legal-contents a { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .legal-contents ol { columns: 1; }
  .terms-intro p { font-size: 16.5px; }
  .terms-section h2 { font-size: 19px; }
  .legal-article p, .terms-list li { font-size: 15.5px; }
  .terms-list li { grid-template-columns: 28px minmax(0, 1fr); }
}

/* ---------- Bullet lists and tables (Privacy Policy) ---------- */
.legal-bullets { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.legal-bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body, #374151);
}
.legal-bullets li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal, #397f86);
}
.legal-table-wrap { margin: 4px 0 20px; overflow-x: auto; border: 1px solid #e3ebec; border-radius: 12px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.legal-table thead th {
  padding: 12px 16px;
  background: #eef5f5;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark, #2f696f);
}
.legal-table tbody th,
.legal-table tbody td {
  padding: 12px 16px;
  border-top: 1px solid #e8eeee;
  text-align: left;
  vertical-align: top;
  color: var(--body, #374151);
}
.legal-table tbody th { width: 34%; font-weight: 600; color: var(--ink, #111827); }
.legal-table tbody tr:nth-child(even) { background: #fafcfc; }
@media (max-width: 640px) {
  .legal-bullets li { font-size: 15.5px; }
  /* tables become stacked label/value pairs, so nothing scrolls sideways */
  .legal-table thead { display: none; }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table th, .legal-table td { display: block; width: auto; }
  .legal-table tbody th { width: auto; padding: 12px 14px 2px; border-top: 1px solid #e8eeee; }
  .legal-table tbody td { padding: 0 14px 12px; border-top: 0; }
  .legal-table tbody tr:first-child th { border-top: 0; }
}

/* ---------- Sub-clauses and three-column tables (Data Processing Addendum) ---------- */
.legal-article h3 {
  margin: 24px 0 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink, #111827);
  scroll-margin-top: calc(var(--header-h, 62px) + 16px);
}
.legal-article h3 .terms-num { margin-right: 4px; }
.legal-table--3 tbody th { width: 24%; }
.legal-table--3 tbody td:last-child { width: 34%; }
@media (max-width: 640px) {
  .legal-table--3 tbody td { padding: 0 14px 8px; }
  .legal-table--3 tbody td:last-child { width: auto; padding-bottom: 12px; color: var(--muted, #6b7280); }
}
