/* The legal pages (terms and privacy): one readable column on the page ground, in every theme. */

.terms-page { background: var(--grad-page); min-height: 100vh; color: var(--ink); }

.terms-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(820px, 100%);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top, 0px)) 16px 16px;
}
.terms-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -0.06em; color: var(--ink); text-decoration: none; }
.terms-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.terms-lang { display: inline-flex; padding: 3px; border-radius: var(--radius-btn); background: var(--card); box-shadow: var(--edge); }
.terms-lang button, .terms-print {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font: 600 13px var(--sans);
  cursor: pointer;
}
.terms-lang button:hover, .terms-print:hover { color: var(--ink); }
.terms-lang button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.terms-print { border-radius: var(--radius-btn); background: var(--card); box-shadow: var(--edge); }

.terms { width: min(820px, 100%); margin: 0 auto; padding: 0 16px 56px; }
.terms article { padding: 40px 44px 44px; border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-card); overflow-wrap: anywhere; }
.terms article + article { margin-top: 24px; }
.terms article[hidden] { display: none; }
@media (max-width: 600px) { .terms article { padding: 28px 20px 30px; } }

.terms h1 { margin: 0; font-size: clamp(32px, 7vw, 44px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.terms h2 { margin: 36px 0 12px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; scroll-margin-top: 16px; }
.terms p, .terms li { font-size: 15px; font-weight: 400; line-height: 1.65; color: var(--ink-2); }
.terms p { margin: 0 0 10px; }
.terms strong { font-weight: 700; color: var(--ink); }
.terms a { color: var(--ink); font-weight: 600; }
.terms code { font: 600 13px var(--sans); }

.terms-meta { margin: 10px 0 18px !important; color: var(--muted) !important; font-size: 14px !important; }
.terms-draft { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--paper-hi); box-shadow: inset 3px 0 0 var(--ink); font-size: 14px !important; }

/* a field still to be filled in before the terms go public */
.todo { padding: 1px 5px; border-radius: 5px; background: var(--paper-lo); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }

.terms section > ol { margin: 0; padding: 0; list-style: none; counter-reset: clause; }
.terms section > ol > li { position: relative; margin: 0 0 10px; padding-left: 30px; counter-increment: clause; }
.terms section > ol > li::before { content: counter(clause) "."; position: absolute; left: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.terms section ul { margin: 8px 0 0; padding-left: 18px; }
.terms section ul li { margin-bottom: 5px; }

.terms-index { margin-top: 24px; padding: 18px 20px; border-radius: var(--radius); background: var(--paper-hi); box-shadow: var(--edge); }
.terms-index ol { margin: 0; padding-left: 24px; columns: 2; column-gap: 28px; }
.terms-index li { margin-bottom: 4px; font-size: 14px; line-height: 1.4; break-inside: avoid; }
.terms-index a { font-weight: 500; color: var(--ink-2); text-decoration: none; }
.terms-index a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 600px) { .terms-index ol { columns: 1; } }

/* tables scroll inside their own box on a phone, so the page itself never scrolls sideways */
.terms-table { margin: 14px 0 16px; overflow-x: auto; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); }
.terms-table table { width: 100%; min-width: 620px; border-collapse: collapse; }
.terms-table th, .terms-table td { padding: 10px 12px; font-size: 13px; line-height: 1.5; text-align: left; vertical-align: top; color: var(--ink-2); overflow-wrap: normal; }
.terms-table th { font-weight: 700; color: var(--ink); background: var(--paper-hi); }
.terms-table tr + tr td, .terms-table tbody tr:first-child td { border-top: 1px solid var(--line-soft); }
.terms section > ul { margin: 0 0 10px; padding-left: 20px; }

.terms-form { padding: 16px 18px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); }

:root[data-theme="dark"] .todo { background: var(--paper-lo); }

@media print {
  .terms-page { background: #FFFFFF; }
  .terms-tools, .terms-index { display: none; }
  .terms article { padding: 0; box-shadow: none; background: none; }
  .terms p, .terms li { color: #111113; font-size: 11pt; }
  .terms-table { overflow: visible; }
  .terms-table table { min-width: 0; }
  .terms-table th, .terms-table td { color: #111113; font-size: 9pt; }
  .terms h2 { break-after: avoid; }
}
