/* Shopping Tracker — legal pages.
   Palette matches the app's own brand green so these read as part of the product. */

:root {
  --ground: #FBFDF7;
  --surface: #FFFFFF;
  --surface-sunk: #F0F3EC;
  --ink: #17201A;
  --ink-soft: #47524A;
  --ink-faint: #6E7A71;
  --rule: #DDE4D9;
  --accent: #3D6B4A;
  --accent-deep: #16301F;
  --accent-wash: #E8F2E9;

  /* Masthead keeps the app's own colours in both themes — it is a brand bar, not a surface.
     Deliberately not redefined in the dark blocks below. */
  --brand-bar: #16301F;
  --brand-bar-ink: #BEEFC8;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F140F;
    --surface: #161C16;
    --surface-sunk: #131813;
    --ink: #E7ECE4;
    --ink-soft: #B4BDB0;
    --ink-faint: #8B948A;
    --rule: #28302A;
    --accent: #A1D2AC;
    --accent-deep: #BEEFC8;
    --accent-wash: #1B271D;
  }
}

:root[data-theme="dark"] {
  --ground: #0F140F;
  --surface: #161C16;
  --surface-sunk: #131813;
  --ink: #E7ECE4;
  --ink-soft: #B4BDB0;
  --ink-faint: #8B948A;
  --rule: #28302A;
  --accent: #A1D2AC;
  --accent-deep: #BEEFC8;
  --accent-wash: #1B271D;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.masthead {
  background: var(--brand-bar);
  color: var(--brand-bar-ink);
  padding: 22px 24px;
}

.masthead-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.masthead svg { width: 30px; height: 30px; flex: none; }

.masthead-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead a { color: inherit; text-decoration: none; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  text-wrap: balance;
}

.updated {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin: 0 0 36px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  text-wrap: balance;
}

h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  margin: 26px 0 6px;
}

p { margin: 0 0 16px; }

ul { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }

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

strong { font-weight: 700; }

/* Plain-English summary at the top — the part most people actually read. */
.summary {
  background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 6px;
  padding: 22px 24px;
  margin: 0 0 40px;
}

.summary h2 {
  border: 0;
  padding: 0;
  margin: 0 0 10px;
  font-size: 1.15rem;
}

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

.toc {
  background: var(--surface-sunk);
  border-radius: 6px;
  padding: 18px 24px;
  margin: 0 0 40px;
}

.toc h2 {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 0.94rem;
}

.table-scroll { overflow-x: auto; }

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
}

footer {
  border-top: 1px solid var(--rule);
  margin-top: 56px;
  padding-top: 22px;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

footer a { color: var(--accent); }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .masthead { background: #fff; color: #000; border-bottom: 1px solid #000; }
  .toc, .summary { border: 1px solid #999; background: #fff; }
  a { color: #000; }
}
