/* Styling for the standalone legal pages served from dashboard/public/:
 * privacy.html, extension-privacy.html, delete-account.html.
 *
 * These are static files outside the Vite build, so they cannot import
 * src/styles/tokens.css. The values below are therefore a THIRD copy of the
 * design tokens — theme.dart is canonical, tokens.css mirrors it, and this
 * mirrors tokens.css. Change all three together, and keep the line references
 * so the next person can find the source.
 *
 * Light mode only, deliberately. A legal document is read once, often on a
 * link from a store listing or an email, and frequently printed. It should
 * look the same for everybody rather than following a system preference the
 * reader did not choose for this purpose.
 *
 * No webfont request. The dashboard declares "DM Sans", system-ui without
 * self-hosting it (tokens.css:23), so this matches what the dashboard actually
 * renders — and a privacy policy that phones a font CDN to tell you it
 * respects your privacy is not a good look.
 */

:root {
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Light theme — tokens.css:26-42 */
  --c-accent: #34c77b;
  --c-bg: #f4f3ef;
  --c-surface: #ffffff;
  --c-surface-alt: #ecebe5;
  --c-border: #d6d5cd;
  --c-text: #14140f;
  --c-text-secondary: #55554d;
  --c-text-muted: #8a8a80;
  /* Mint as TEXT on a light ground. Full-strength accent only reaches ~3.5:1
   * here; this clears 4.5:1. tokens.css:41. */
  --c-accent-text: #1b7a4a;

  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  --r-control: 10px;
  --r-card: 16px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text-secondary);
  line-height: 1.7;
  margin: 0;
  padding: var(--sp-6) var(--sp-5) var(--sp-10);
  -webkit-font-smoothing: antialiased;
}

.legal-header,
.legal-doc,
.legal-footer {
  max-width: 720px;
  margin-inline: auto;
}

.legal-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-bottom: var(--sp-5);
}

.legal-header a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--c-text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.legal-doc {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: var(--sp-8) var(--sp-8) var(--sp-10);
}

h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin: 0 0 var(--sp-2);
}

h2 {
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin: var(--sp-8) 0 var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}

h3 {
  font-size: 15px;
  color: var(--c-text);
  margin: var(--sp-5) 0 var(--sp-2);
}

/* The first heading follows the intro, so it needs no rule above it. */
.legal-doc > h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.date {
  color: var(--c-text-muted);
  font-size: 14px;
  margin: 0 0 var(--sp-6);
}

p {
  margin: 0 0 var(--sp-4);
}

ul {
  padding-left: var(--sp-5);
  margin: 0 0 var(--sp-4);
}

li {
  margin-bottom: var(--sp-2);
}

strong {
  color: var(--c-text);
  font-weight: 600;
}

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

a:hover {
  text-decoration: none;
}

code {
  background: var(--c-surface-alt);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  color: var(--c-text);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--sp-3) 0 var(--sp-5);
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
}

th {
  color: var(--c-text);
  font-weight: 600;
  font-size: 13px;
  border-bottom-color: var(--c-text-muted);
}

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

.legal-footer {
  padding-top: var(--sp-6);
  font-size: 13px;
  color: var(--c-text-muted);
}

.legal-footer a {
  color: var(--c-text-muted);
}

@media (max-width: 560px) {
  body {
    padding: var(--sp-4) var(--sp-3) var(--sp-8);
  }

  .legal-doc {
    padding: var(--sp-5) var(--sp-5) var(--sp-6);
  }

  h1 {
    font-size: 24px;
  }

  /* A three-column table has nowhere to go on a phone, so the processor list
   * becomes stacked rows with the column name as a label. */
  table,
  tbody,
  tr,
  td,
  th {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--c-border);
    padding: var(--sp-3) 0;
  }

  td {
    border: none;
    padding: 2px 0;
  }

  td:first-child {
    color: var(--c-text);
    font-weight: 600;
  }
}

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

  .legal-doc {
    border: none;
    padding: 0;
  }

  .legal-header,
  .legal-footer {
    display: none;
  }
}
