/*
 * Shared styling for Midori's public policy pages: privacy.html, terms.html,
 * support.html (PLAN.md P2-2) and licenses.html (F17).
 *
 * NOT used by delete-account.html, which inlines its own copy on purpose. That
 * page has to render for someone who has already uninstalled the app and may be
 * on a poor connection, so it requests no assets at all. These three are read by
 * people who are choosing to read them and can afford one stylesheet.
 *
 * Same palette as the app: --green is the #0c5624 that the splash, the manifest
 * and the theme-color meta all share.
 */
:root {
  --ink: #1a2b1e;
  --muted: #55665a;
  --ground: #f2f5f1;
  --card: #ffffff;
  --line: #dfe6df;
  --green: #0c5624;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8efe8;
    --muted: #9fb2a4;
    --ground: #131a14;
    --card: #1b241d;
    --line: #2c382e;
    --green: #7cc496;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 32px 20px 64px;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 44rem; margin: 0 auto; }

h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 36px 0 8px; color: var(--green); text-wrap: balance; }
h3 { font-size: 1rem; margin: 24px 0 6px; }

.lede { color: var(--muted); margin: 0 0 8px; }
.updated { color: var(--muted); font-size: 0.875rem; margin: 0 0 32px; }
.lang-switch { margin: 0 0 16px; font-size: 0.875rem; text-align: right; }

/* The Thai pages (privacy-th.html and the rest): a Thai face before the Latin
   fallbacks, and taller lines so stacked vowels and tone marks are not clipped. */
:root:lang(th) body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  line-height: 1.75;
}
:root:lang(th) h1 { line-height: 1.4; }
:root:lang(th) th { text-transform: none; letter-spacing: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 16px 0;
}

/* For the one thing on these pages a reader must not skim past: that the sync
   encryption is not end-to-end. It is the claim most finance apps get wrong,
   and burying it in a paragraph would be the dishonest way to be accurate. */
.callout {
  border-left: 4px solid var(--green);
  background: var(--card);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

ol, ul { padding-left: 1.25rem; }
li { margin: 6px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9375rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--green); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* Wide tables scroll inside their own box rather than pushing the page sideways. */
.table-scroll { overflow-x: auto; }

/* licenses.html (F17): a component name heads its row, so it reads as a name
   rather than as a column label. */
th[scope="row"] { color: var(--ink); font-size: inherit; text-transform: none; letter-spacing: 0; font-weight: 600; }
caption { text-align: left; color: var(--muted); padding-bottom: 6px; }
.ver { color: var(--muted); font-weight: 400; }

/* Licence texts keep their own line breaks; a long line scrolls in its box. */
pre.licence {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 24rem;
  overflow: auto;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

code {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.9em;
}

a { color: var(--green); }
a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
