/* Public legal pages (Terms, Privacy) and Help. Plain, readable; served under the site CSP. The only script on the
   legal pages is /legal/look.js (the app's look); Help also loads /help/contact.js.

   LOOKS (2026-10-04). Every colour is a --lg-* variable. The :root values are the original colours, so Bright +
   Fire (no data-mode / data-accent on <html>) looks exactly as before. /legal/look.js sets the attributes from the
   look this device saved in the app; the blocks below reuse the app's Dark and Ice values (src/styles.css, LOOKS).

   WCAG AA, checked for every pair below (4.5:1 text, 3:1 borders and focus rings):
   Bright + Fire (unchanged): text #2d2118 on page #fff8ed 14.8:1, on white 15.6:1; links/brand #a4470f 5.7:1 on page,
     6.0:1 on white; muted #6b5a4c 6.2:1 / 6.6:1; white on button #a4470f 6.0:1; ok #2f6b2f 6.1:1; error #9b1c1c
     7.7:1; focus #d66b24 3.3:1. (Old, kept as is: field border #c9b29b is only 2.0:1 on white, rules #ead9c6 are
     decorative at 1.3:1.)
   Bright + Ice: links/brand #1a5a94 6.8:1 on page, 7.2:1 on white; focus and notice bar #2f7fc4 4.0:1 on page,
     4.2:1 on white; white on button #1d5f9e 6.6:1, on hover #164b7d 9.0:1.
   Dark + Fire: text #e3dcd2 14.0:1 on page #0e1013, 12.0:1 on card #1c2026; headings #f6f1ea 17.0:1 / 14.6:1, field
     text 15.5:1 on field #171a1f; links/brand #ffb070 10.6:1 / 9.1:1; muted #c2bab0 9.9:1 / 8.5:1; focus, notice bar
     and radio #ff8a2a 8.1:1 on page, 7.0:1 on card, 7.4:1 on field; field border #79818b 4.4:1 on field, 4.8:1 on
     page; rules and table borders #5a626c 3.1:1 on page; white on button #b0560d 5.0:1, on hover #9a4a08 6.3:1;
     ok #8fd48a 10.8:1; error #ff9b8f 9.4:1.
   Dark + Ice: links/brand #9fd3ff 12.0:1 on page, 10.3:1 on card; focus, notice bar and radio #4db2ff 8.3:1 on page,
     7.1:1 on card, 7.6:1 on field; white on button #2272b8 5.0:1, on hover #1a78c4 4.6:1. */
:root {
  color-scheme: light;
  --lg-page: #fff8ed;
  --lg-card: #fff;            /* notice box, table headings */
  --lg-field: #fff;           /* form fields */
  --lg-field-text: #2d2118;   /* was `inherit`, the same colour */
  --lg-text: #2d2118;
  --lg-heading: #2d2118;
  --lg-muted: #6b5a4c;
  --lg-accent-text: #a4470f;  /* brand line and links */
  --lg-accent: #d2691e;       /* notice bar */
  --lg-focus: #d66b24;
  --lg-radio: #a4470f;
  --lg-rule: #ead9c6;         /* nav line and table borders */
  --lg-field-border: #c9b29b;
  --lg-button: #a4470f;
  --lg-button-hover: #a4470f; /* Bright + Fire never had a hover colour; it keeps none */
  --lg-button-text: #fff;
  --lg-ok: #2f6b2f;
  --lg-error: #9b1c1c;
}
:root[data-accent="ice"] {
  --lg-accent-text: #1a5a94;
  --lg-accent: #2f7fc4;
  --lg-focus: #2f7fc4;
  --lg-radio: #1d5f9e;
  --lg-button: #1d5f9e;
  --lg-button-hover: #164b7d;
}
:root[data-mode="dark"] {
  color-scheme: dark;
  --lg-page: #0e1013;
  --lg-card: #1c2026;
  --lg-field: #171a1f;
  --lg-field-text: #f6f1ea;
  --lg-text: #e3dcd2;
  --lg-heading: #f6f1ea;
  --lg-muted: #c2bab0;
  --lg-accent-text: #ffb070;
  --lg-accent: #ff8a2a;
  --lg-focus: #ff8a2a;
  --lg-radio: #ff8a2a;
  --lg-rule: #5a626c;
  --lg-field-border: #79818b;
  --lg-button: #b0560d;
  --lg-button-hover: #9a4a08;
  --lg-button-text: #fff;
  --lg-ok: #8fd48a;
  --lg-error: #ff9b8f;
}
:root[data-mode="dark"][data-accent="ice"] {
  --lg-accent-text: #9fd3ff;
  --lg-accent: #4db2ff;
  --lg-focus: #4db2ff;
  --lg-radio: #4db2ff;
  --lg-button: #2272b8;
  --lg-button-hover: #1a78c4;
}

body { margin: 0; background: var(--lg-page); color: var(--lg-text); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 42rem; margin: 0 auto; padding: 32px 20px 56px; }
.brand { margin: 0; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.8rem; color: var(--lg-accent-text); }
h1 { margin: 6px 0 4px; font-size: 2rem; line-height: 1.2; }
h1, h2, h3 { color: var(--lg-heading); }
.updated { margin: 0 0 24px; color: var(--lg-muted); font-size: 0.9rem; }
.notice { padding: 14px 16px; border-left: 4px solid var(--lg-accent); background: var(--lg-card); border-radius: 6px; }
a { color: var(--lg-accent-text); text-underline-offset: 2px; }
a:focus-visible { outline: 3px solid var(--lg-focus); outline-offset: 2px; }
nav { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--lg-rule); }
h2 { margin: 30px 0 6px; font-size: 1.3rem; line-height: 1.3; }
h3 { margin: 18px 0 4px; font-size: 1.05rem; line-height: 1.3; }
ul { padding-left: 22px; }
/* Counsel's full text (2026-09-28): the provider table in Privacy §5, all-caps legal paragraphs. */
.tableWrap { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--lg-rule); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--lg-card); }
p.caps { font-weight: 600; }
li { margin: 4px 0; }

/* Help page contact form (2026-09-28; public/help/contact.js). Touch targets are at least 44px tall and
   inputs use 17px text so phones do not zoom in on focus. No inline styles: the CSP allows none. */
.contactForm { margin: 20px 0 8px; }
.contactForm[hidden], .contactUnavailable[hidden] { display: none; }
.contactIntro { margin: 0 0 8px; font-weight: 600; }
.contactTypes { margin: 0 0 14px; padding: 0; border: 0; }
.contactTypes legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.contactChoice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: 18px; cursor: pointer; }
.contactChoice input { width: 20px; height: 20px; margin: 0; accent-color: var(--lg-radio); }
.contactLabel { display: block; margin: 12px 0 4px; font-weight: 600; }
.contactOptional { font-weight: 400; color: var(--lg-muted); }
.contactInput { box-sizing: border-box; display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--lg-field-border); border-radius: 8px; background: var(--lg-field); color: var(--lg-field-text); font: inherit; }
textarea.contactInput { min-height: 9em; resize: vertical; }
.contactInput:focus-visible, .contactChoice input:focus-visible, .contactSubmit:focus-visible { outline: 3px solid var(--lg-focus); outline-offset: 2px; }
.contactHint { margin: 4px 0 0; font-size: 0.9rem; color: var(--lg-muted); }
.contactPrivacy { margin: 14px 0 0; font-size: 0.95rem; }
.contactSubmit { min-height: 48px; margin-top: 16px; padding: 10px 24px; border: 0; border-radius: 8px; background: var(--lg-button); color: var(--lg-button-text); font: inherit; font-weight: 600; cursor: pointer; }
.contactSubmit:hover { background: var(--lg-button-hover); }
.contactSubmit[aria-disabled="true"] { opacity: 0.6; cursor: wait; }
.contactStatus, .contactError { margin: 12px 0 0; }
.contactStatus:empty, .contactError:empty { margin: 0; }
.contactStatus { color: var(--lg-ok); font-weight: 600; }
.contactError { color: var(--lg-error); font-weight: 600; }
.contactUnavailable { margin: 12px 0 0; color: var(--lg-muted); }
/* Honeypot: off-screen for people, still in the DOM for bots. Never display:none (bots skip those). */
.contactHp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 480px) { .contactSubmit { width: 100%; } }
