/* Buknal legal pages — shared styles for every app's Privacy Policy and Terms of Use.
   System fonts only: a privacy page shouldn't make third-party font requests.
   Each app sets its own accent by overriding --accent on <body> (see .app-yardkit). */

:root {
  --ground: #f5f6f3;
  --surface: #ffffff;
  --ink: #17201a;
  --ink-soft: #3a453d;
  --muted: #5f6a62;
  --rule: #dfe4dd;
  --tint: #eef2ec;
  --accent: #2c6fdb;
  --accent-ink: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.875rem, 1.4rem + 2vw, 2.5rem);

  --measure: 68ch;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1310;
    --surface: #151b17;
    --ink: #e7ece7;
    --ink-soft: #c4ccc5;
    --muted: #97a299;
    --rule: #27302a;
    --tint: #1b231d;
    --accent: #7aa7f5;
    --accent-ink: #0e1310;
  }
}

/* Per-app accents */
.app-yardkit { --accent: #2f7a3b; }
@media (prefers-color-scheme: dark) {
  .app-yardkit { --accent: #72c07f; }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: var(--step-0)/1.65 var(--font);
  padding-inline: 16px;
  padding-block: 0 48px;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ---------- Site header ---------- */
.site-header {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 20px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step--1);
  text-transform: uppercase;
}
.brand:hover { color: var(--accent); }

/* ---------- App masthead ---------- */
.masthead {
  max-width: 1040px;
  margin: 0 auto;
  padding-block: 40px 8px;
  display: grid;
  gap: 20px;
}
.app-id { display: flex; align-items: center; gap: 14px; }
.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 22.5%;
  flex: none;
  box-shadow: 0 0 0 1px var(--rule);
  background: var(--tint);
}
.app-id p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.app-id .app-name { color: var(--ink); font-weight: 600; font-size: var(--step-1); }

.masthead h1 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.updated { margin: 0; color: var(--muted); font-size: var(--step--1); }
.updated time { font-variant-numeric: tabular-nums; }

/* Privacy / Terms switcher */
.doc-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--tint);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.doc-tabs a {
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--step--1);
  white-space: nowrap;
}
.doc-tabs a:hover { color: var(--ink); }
.doc-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }

/* ---------- Document layout ---------- */
.doc {
  max-width: 1040px;
  margin: 0 auto;
  padding-block: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}
@media (min-width: 900px) {
  .doc { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
  .toc { position: sticky; top: 24px; align-self: start; }
}

.toc h2 {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 600;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--step--1);
  line-height: 1.4;
}
.toc a::before { content: counter(toc); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.2em; }
.toc a:hover { color: var(--accent); }
@media (max-width: 899px) {
  .toc { border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; background: var(--surface); }
}

.prose { max-width: var(--measure); min-width: 0; }
.prose > section { counter-increment: sec; scroll-margin-top: 24px; }
.prose { counter-reset: sec; }
.prose h2 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 48px 0 12px;
  text-wrap: balance;
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.prose h2::before {
  content: counter(sec);
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 1.4em;
}
.prose > section:first-of-type h2 { margin-top: 0; }
.prose h3 { font-size: var(--step-1); margin: 28px 0 8px; line-height: 1.35; }
.prose p { margin: 0 0 14px; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { margin: 0 0 16px; padding-left: 1.25em; color: var(--ink-soft); }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--muted); }

/* Plain-language summary box at the top of each document */
.summary {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 40px;
}
.summary h2 { margin: 0 0 8px; font-size: var(--step-1); }
.summary h2::before { content: none; }
.summary p:last-child, .summary ul:last-child { margin-bottom: 0; }

/* Data table — mirrors the App Store "App Privacy" label */
.table-wrap { overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: var(--step--1); line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
thead th { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; background: var(--tint); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink); font-weight: 600; }
td { color: var(--ink-soft); }
.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--tint);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}

.contact-card {
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.contact-card p { margin: 0; }

/* ---------- Home page app list ---------- */
.home { max-width: 1040px; margin: 0 auto; padding-block: 48px 0; }
.home h1 { font-family: var(--font-display); font-size: var(--step-3); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 8px; }
.home > p { color: var(--muted); margin: 0 0 32px; max-width: var(--measure); }
.app-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.app-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.app-row .app-meta { min-width: 0; flex: 1; }
.app-row h2 { margin: 0; font-size: var(--step-1); }
.app-row p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.app-row nav { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: var(--step--1); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1040px;
  margin: 64px auto 0;
  padding-block: 20px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer a { color: var(--muted); }

/* On phones, a 3-column table can't hold its shape: stack each row into
   labeled blocks so no column is pushed off-screen. */
@media (max-width: 620px) {
  /* The table must stop behaving like a table, or rows keep their column
     widths and run past the container instead of shrinking to it. */
  table, tbody { display: block; width: 100%; min-width: 0; }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  tbody tr {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rule);
  }
  tbody tr:last-child { border-bottom: 0; }
  td { display: block; padding: 0; border: 0; }
  td:first-child { font-size: var(--step-0); margin-bottom: 2px; }
  td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
  }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header nav, .doc-tabs, .toc { display: none; }
  .doc { display: block; }
}
