/* TinyMate legal pages — self-contained, no external fonts/CDN.
   Two documents × three languages (en, zh, ja), copied from the LoneCat set
   (tools/legal/render.py there). No generator here — edit these files directly. */

:root {
  --bg: #f6f3ec;
  --paper: #fffdf8;
  --ink: #1c1b18;
  --muted: #5c574e;
  --line: #e4ddd0;
  --accent: #c45c26;
  --accent-ink: #9a4418;
  --accent-soft: #f3e2d6;
  --radius: 12px;
  --max: 42rem;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(
      1200px 400px at 10% -10%,
      var(--accent-soft),
      transparent 60%
    ),
    var(--bg);
}

/* Arabic and Thai sit a long way down a Latin-first stack, and the faces that
   pick them up by accident are not always the ones installed here. Naming a
   family that actually covers the script keeps both pages readable instead of
   boxy. The Latin fallbacks stay on the end for the company name and "TinyMate",
   which are not translated. */
html[dir="rtl"] body {
  font-family: "SF Arabic", "Geeza Pro", Tahoma, var(--font);
}

html:lang(th) body {
  font-family: "Thonburi", "Leelawadee UI", var(--font);
}

/* Arabic is a cursive script: negative tracking breaks the joins inside a word.
   The headings are tightened for Latin above, so the three places that do it
   are reset here rather than left to look broken in one language. */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] .brand strong {
  letter-spacing: normal;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-ink);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

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

.site-header {
  padding: 1.25rem 0 0.5rem;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
}

.brand strong {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--muted);
  font-size: 0.95rem;
}

nav.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

nav.tabs a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

nav.tabs a[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffdf8;
}

nav.tabs a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

nav.tabs a[aria-current="page"]:hover {
  color: #fffdf8;
}

/* The language switch sits directly under the document tabs: same pill shape,
   but the current language is marked with a wash of the accent rather than a
   black fill, so the two rows do not both read as "where am I".
   They are a size down from the tabs above and carry the language's own name —
   a reader who has landed in the wrong language is the one who has to find
   their way out, and "日本語" is findable where "Japanese" is not. */
nav.langs {
  margin-top: -1.25rem;
}

nav.langs a {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

nav.langs a[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

nav.langs a[aria-current="page"]:hover {
  color: var(--accent-ink);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem 1.75rem;
  box-shadow: 0 1px 0 rgba(28, 27, 24, 0.04);
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  /* Anchored headings must clear the top of the viewport when jumped to. */
  scroll-margin-top: 1rem;
}

h3 {
  margin: 1.1rem 0 0.35rem;
  font-size: 1rem;
}

h2 + h3 {
  margin-top: 0.6rem;
}

p,
ul,
ol {
  margin: 0.55rem 0;
}

/* Logical, not `left`: the Arabic pages run the other way and an indent on the
   `left` edge would hang the list markers outside the card. */
ul,
ol {
  padding-inline-start: 1.25rem;
}

li + li {
  margin-top: 0.3rem;
}

li > ul,
li > ol {
  margin: 0.3rem 0 0;
}

.meta {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* The copyright line that closes each document. Same muted type as .meta, but
   centred and at the end of the page rather than under the title. */
.copy {
  margin: 1.75rem 0 0;
  text-align: center;
  font-size: 0.85rem;
}

.lead {
  font-size: 1.05rem;
}

/* The accent bar follows the writing direction too: on the right for Arabic,
   which is where the eye starts. */
.note {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-inline-start: 3px solid var(--accent);
  background: var(--accent-soft);
  border-start-end-radius: 8px;
  border-end-end-radius: 8px;
  font-size: 0.95rem;
}

.note p:first-child {
  margin-top: 0;
}

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

.toc {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
}

.toc strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-inline-start: 1.2rem;
}

/* Two-column summary rows: label left, answer right. Kept for future tables
   even though no page uses one today; still logical rather than `left` so a
   table added to the Arabic page comes out the right way round. */
table {
  width: 100%;
  margin: 0.75rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

th {
  font-weight: 700;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: none;
}

/* Two columns, but only when there is room for the label column. Never
   `nowrap` on `th`: labels like "Deletion requests" are wider than a third of
   a phone, and an unbreakable one pushes the whole card sideways. */
@media (min-width: 520px) {
  th {
    width: 34%;
  }
}

/* Narrow screens: one entry per block, the label sitting above its answer. */
@media (max-width: 519px) {
  th,
  td {
    display: block;
    padding: 0;
    border-bottom: none;
  }

  tr {
    display: block;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: none;
  }

  th {
    padding-bottom: 0.1rem;
  }
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.05em 0.35em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  word-break: break-all;
}

.footer {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer a {
  color: inherit;
}

@media print {
  body {
    background: #fff;
  }

  nav.tabs,
  .toc {
    display: none;
  }

  .card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
