/* Pip's shared tokens (lab-site, L099; L103 cream only): one file for the
   app and the public site (heypip.help), so the two can't drift apart.

   CREAM ONLY (L103). The light (cream) tokens always apply. The dark tokens
   are kept below, behind ONE switch: PIP_DARK_ENABLED in client/theme.js
   (false). That script marks the root with data-dark-enabled only when the
   switch is on, and every dark block here needs that attribute, so with the
   switch off nothing dark can apply: not the phone's dark mode, not a saved
   choice (theme.js clears it), not the export's own dark rules. To turn dark
   mode back on, set PIP_DARK_ENABLED = true in client/theme.js (pages then
   follow the device); nothing here needs to change.

   The light block's selector also carries :not(#pip-dark-off), which matches
   every page (no element has that id) at a weight that beats the site
   export's own prefers-color-scheme dark block, so the site is cream even
   with JavaScript off.

   Who loads it:
     - the app (client/index.html), right AFTER styles.css, so these values
       win over the app's own earlier definitions of the same names;
     - every page of the site (server/routes/site.js, the "skin" rewrite),
       after the export's own <style>, so these values win there too.
   Change a shared value HERE, never only in styles.css: styles.css still
   defines these names (its history), but this file is read last.

   L103: the one primary button (--pip-btn-*): matte, raised, a flat salmon
   fill with no shine, a soft shadow underneath, and a slight press; the
   secondary the same shape in cream with a thin border. Every primary and
   secondary button in the app and on the site uses these.

   DESIGN_SYSTEM.md 1.0 lists these values in a table. */
:root, :root:not(#pip-dark-off), :root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAF6F1;
  --bg-alt: #F0EBE3;
  --surface: #FFFFFF;
  --text: #2A1816;
  --text-soft: #7A615C;
  --text-faint: #B5A39E;
  --line: rgba(42,24,22,0.10);
  --line-soft: rgba(42,24,22,0.05);
  --coral: #C97272;
  --coral-soft: #E8A8A0;
  --coral-deep: #A85858;
  --coral-tint: #F4DDD7;
  --coral-text: #A85858;
  --coral-on-tint: #8F4646;
  --sage: #5B9B8E;
  --sage-text: #3E7468;
  --amber: #C89464;
  --amber-text: #8F5E2C;
  --ring: rgba(201,114,114,0.35);
  --focus: #C6615D;
  --font-display: 'Song Myung', Georgia, 'Times New Roman', serif;
  --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --track-lg: -0.025em;
  --track-sm: -0.015em;
  --primary-top: #DE7E76;
  --primary: #C6615D;
  --primary-highlight: #ECA69C;
  --btn-top: var(--pip-btn-bg);
  --btn-bottom: var(--pip-btn-bg);
  --btn-solid: var(--pip-btn-bg);
  --on-primary: #FFFFFF;
  --btn-shadow: var(--pip-btn-shadow);
  --btn-shadow-press: var(--pip-btn-shadow-press);
  --btn2-top: #FFFDFB;
  --btn2-bottom: #F7F2EC;
  --btn2-edge: #E2D8CE;
  --btn2-shadow: inset 0 10px 8px -4px rgba(255,255,255,0.95), inset 0 -5px 7px -3px rgba(42,24,22,0.09), inset 0 0 0 0 rgba(42,24,22,0), 0 2px 8px rgba(42,24,22,0.12);
  --btn2-shadow-press: inset 0 6px 6px -4px rgba(255,255,255,0.35), inset 0 -2px 4px -2px rgba(42,24,22,0.04), inset 0 3px 6px 0 rgba(42,24,22,0.13), 0 1px 2px rgba(42,24,22,0.08);
  /* L103: the one button. Matte, raised: a flat salmon fill (no shine, no
     gradient, no grain), a soft shadow underneath, 16px corners (the task
     panel card's), and a slight press. White 19px / 700 on it is 3.99:1,
     WCAG large text. The secondary is the same shape in cream with a thin
     border. The older paper tokens below point at these, so every rule that
     still names them draws the matte button too. */
  --pip-btn-radius: 16px;
  --pip-btn-bg: #C6615D;
  --pip-btn-fg: #FFFFFF;
  --pip-btn-shadow: 0 1px 0 rgba(122,40,36,0.28), 0 4px 10px rgba(122,40,36,0.14), 0 10px 22px rgba(122,40,36,0.07);
  --pip-btn-shadow-press: 0 0 0 rgba(122,40,36,0), 0 1px 3px rgba(122,40,36,0.18), 0 3px 8px rgba(122,40,36,0.05);
  --pip-btn2-bg: #FFFDF9;
  --pip-btn2-fg: #2A1816;
  --pip-btn2-border: rgba(42,24,22,0.16);
  --pip-btn2-shadow: 0 1px 0 rgba(42,24,22,0.05), 0 4px 10px rgba(42,24,22,0.05), 0 10px 22px rgba(42,24,22,0.03);
  --pip-btn2-shadow-press: 0 0 0 rgba(42,24,22,0), 0 1px 3px rgba(42,24,22,0.07), 0 3px 8px rgba(42,24,22,0.02);
  --btn-gloss: none;
  --btn-amber-gloss: none;
  --btn-amber-top: #C89464;
  --btn-amber-bottom: #C89464;
  --btn-amber-shadow: 0 1px 0 rgba(110,72,36,0.30), 0 4px 10px rgba(110,72,36,0.14);
  --btn-amber-shadow-press: 0 0 0 rgba(110,72,36,0), 0 1px 3px rgba(110,72,36,0.18);
  --field: #F1EAE2;
  --field-shadow: inset 0 2px 5px rgba(42,24,22,0.13), inset 0 1px 1.5px rgba(42,24,22,0.10), 0 1px 0 rgba(255,255,255,0.95);
  --orb-fill: radial-gradient(circle at 32% 28%, #ECA69C 0%, #DE7E76 50%, #C6615D 100%);
  --shadow-orb: 0 10px 24px rgba(218,113,108,0.35);
  --shadow-orb-press: 0 4px 12px rgba(218,113,108,0.30), inset 0 3px 8px rgba(150,60,58,0.28);
  --shadow-chip: 0 1px 2px rgba(42,24,22,0.05), 0 5px 14px rgba(201,114,114,0.13), inset 0 -3px 6px rgba(168,88,88,0.09), inset 0 2px 3px rgba(255,255,255,0.95);
  --shadow-chip-press: 0 1px 2px rgba(42,24,22,0.06), 0 2px 5px rgba(201,114,114,0.14), inset 0 -4px 8px rgba(168,88,88,0.15), inset 0 1px 2px rgba(255,255,255,0.45);
  --chip-fill: linear-gradient(180deg, #FFFFFF 0%, #FFFBFA 55%, #FBF1EE 100%);
  --chip-fill-press: linear-gradient(180deg, #FCF4F1 0%, #FBF1EE 100%);
  --shadow-card: 0 1px 2px rgba(42,24,22,0.04), 0 8px 24px rgba(42,24,22,0.06);
  --cat-circle-bg: #F9DED6;
  --groove: #F0E9E1;
  --groove-sh: rgba(42,24,22,0.10);
  --groove-hl: rgba(255,255,255,0.95);
  --contact: 0 1px 1.5px rgba(42,24,22,0.22), 0 2px 5px rgba(42,24,22,0.12);
  --initial-fill: radial-gradient(circle at 32% 28%, #FBC3B7 0%, #F29484 40%, #DD7062 72%, #B9554C 100%);   /* L126: the 3D orb's colors */
  --initial-raise: inset 0 1px 1px rgba(255,255,255,0.30), inset 0 -2px 3px rgba(110,36,32,0.22);
  --sel-fill: #F3D9D3;
  --sel-shadow: inset 0 2px 5px rgba(122,40,36,0.16), inset 0 1px 1.5px rgba(122,40,36,0.12), 0 1px 0 rgba(255,255,255,0.95);
  --card-paper-top: #FFFDFB;
  --card-paper-bottom: #FBF8F4;
  --card-paper-shadow: inset 0 1px 0 #FFFFFF, 0 1px 0 #E2D8CE, 0 6px 14px rgba(42,24,22,0.05);
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 .08'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23p%29'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not(#pip-dark-off)[data-dark-enabled]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1A0E10;
    --bg-alt: #221318;
    --surface: #2A1A1D;
    --text: #F2E7E1;
    --text-soft: #B59A92;
    --text-faint: #6E5450;
    --line: rgba(242,231,225,0.10);
    --line-soft: rgba(242,231,225,0.05);
    --coral-tint: #3A2020;
    --coral-text: #E8A8A0;
    --coral-on-tint: #E8A8A0;
    --sage-text: #7DB8AB;
    --amber-text: #DDB083;
    --ring: rgba(201,114,114,0.50);
    --focus: #DE7E76;
    --primary-top: #DA786F;
    --primary: #BE5A55;
    --primary-highlight: #E89D93;
    --btn-shadow: inset 0 10px 8px -4px rgba(255,255,255,0.18), inset 0 -6px 8px -3px rgba(60,14,12,0.42), inset 0 0 0 0 rgba(60,14,12,0), 0 4px 12px rgba(0,0,0,0.45);
    --btn-shadow-press: inset 0 6px 6px -4px rgba(255,255,255,0.04), inset 0 -2px 4px -2px rgba(60,14,12,0.20), inset 0 3px 6px 0 rgba(60,14,12,0.50), 0 1px 3px rgba(0,0,0,0.40);
    --btn2-top: #3B2A2E;
    --btn2-bottom: #2F2124;
    --btn2-edge: #160C0E;
    --btn2-shadow: inset 0 10px 8px -4px rgba(255,235,228,0.09), inset 0 -5px 7px -3px rgba(0,0,0,0.35), inset 0 0 0 0 rgba(0,0,0,0), 0 3px 8px rgba(0,0,0,0.40);
    --btn2-shadow-press: inset 0 6px 6px -4px rgba(255,235,228,0.02), inset 0 -2px 4px -2px rgba(0,0,0,0.15), inset 0 3px 6px 0 rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.30);
    --field: #120A0B;
    --field-shadow: inset 0 2px 4px rgba(0,0,0,0.45), inset 0 1px 1px rgba(0,0,0,0.35), 0 1px 0 rgba(255,235,228,0.06);
    --orb-fill: radial-gradient(circle at 32% 28%, #E89D93 0%, #DA786F 50%, #BE5A55 100%);
    --shadow-orb: 0 10px 28px rgba(218,113,108,0.40), 0 2px 8px rgba(0,0,0,0.35);
    --shadow-orb-press: 0 4px 12px rgba(218,113,108,0.32), inset 0 3px 8px rgba(60,16,14,0.45);
    --shadow-chip: 0 1px 2px rgba(0,0,0,0.25), 0 6px 16px rgba(0,0,0,0.30), inset 0 -3px 6px rgba(0,0,0,0.28), inset 0 1px 2px rgba(255,200,190,0.14);
    --shadow-chip-press: 0 1px 2px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.30), inset 0 -4px 8px rgba(0,0,0,0.38), inset 0 1px 1px rgba(255,200,190,0.06);
    --chip-fill: linear-gradient(180deg, #33212A 0%, #2C1B1F 55%, #261619 100%);
    --chip-fill-press: linear-gradient(180deg, #2A1A1D 0%, #241517 100%);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.20), 0 8px 24px rgba(0,0,0,0.30);
    --cat-circle-bg: #F2CBBF;
    --groove: #110809;
    --groove-sh: rgba(0,0,0,0.60);
    --groove-hl: rgba(255,235,228,0.075);
    --contact: 0 1px 1.5px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.40);
    --initial-raise: inset 0 1px 1px rgba(255,255,255,0.22), inset 0 -2px 3px rgba(60,16,14,0.35);
    --sel-fill: #45262A;
    --sel-shadow: inset 0 2px 5px rgba(0,0,0,0.55), inset 0 1px 1.5px rgba(0,0,0,0.40), 0 1px 0 rgba(255,235,228,0.07);
    --card-paper-top: #2F2023;
    --card-paper-bottom: #2A1A1D;
    --card-paper-shadow: inset 0 1px 0 rgba(255,235,228,0.07), 0 1px 0 #160C0E, 0 6px 14px rgba(0,0,0,0.30);
  }
}
:root:not(#pip-dark-off)[data-dark-enabled][data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A0E10;
  --bg-alt: #221318;
  --surface: #2A1A1D;
  --text: #F2E7E1;
  --text-soft: #B59A92;
  --text-faint: #6E5450;
  --line: rgba(242,231,225,0.10);
  --line-soft: rgba(242,231,225,0.05);
  --coral-tint: #3A2020;
  --coral-text: #E8A8A0;
  --coral-on-tint: #E8A8A0;
  --sage-text: #7DB8AB;
  --amber-text: #DDB083;
  --ring: rgba(201,114,114,0.50);
  --focus: #DE7E76;
  --primary-top: #DA786F;
  --primary: #BE5A55;
  --primary-highlight: #E89D93;
  --btn-shadow: inset 0 10px 8px -4px rgba(255,255,255,0.18), inset 0 -6px 8px -3px rgba(60,14,12,0.42), inset 0 0 0 0 rgba(60,14,12,0), 0 4px 12px rgba(0,0,0,0.45);
  --btn-shadow-press: inset 0 6px 6px -4px rgba(255,255,255,0.04), inset 0 -2px 4px -2px rgba(60,14,12,0.20), inset 0 3px 6px 0 rgba(60,14,12,0.50), 0 1px 3px rgba(0,0,0,0.40);
  --btn2-top: #3B2A2E;
  --btn2-bottom: #2F2124;
  --btn2-edge: #160C0E;
  --btn2-shadow: inset 0 10px 8px -4px rgba(255,235,228,0.09), inset 0 -5px 7px -3px rgba(0,0,0,0.35), inset 0 0 0 0 rgba(0,0,0,0), 0 3px 8px rgba(0,0,0,0.40);
  --btn2-shadow-press: inset 0 6px 6px -4px rgba(255,235,228,0.02), inset 0 -2px 4px -2px rgba(0,0,0,0.15), inset 0 3px 6px 0 rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.30);
  --field: #120A0B;
  --field-shadow: inset 0 2px 4px rgba(0,0,0,0.45), inset 0 1px 1px rgba(0,0,0,0.35), 0 1px 0 rgba(255,235,228,0.06);
  --orb-fill: radial-gradient(circle at 32% 28%, #E89D93 0%, #DA786F 50%, #BE5A55 100%);
  --shadow-orb: 0 10px 28px rgba(218,113,108,0.40), 0 2px 8px rgba(0,0,0,0.35);
  --shadow-orb-press: 0 4px 12px rgba(218,113,108,0.32), inset 0 3px 8px rgba(60,16,14,0.45);
  --shadow-chip: 0 1px 2px rgba(0,0,0,0.25), 0 6px 16px rgba(0,0,0,0.30), inset 0 -3px 6px rgba(0,0,0,0.28), inset 0 1px 2px rgba(255,200,190,0.14);
  --shadow-chip-press: 0 1px 2px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.30), inset 0 -4px 8px rgba(0,0,0,0.38), inset 0 1px 1px rgba(255,200,190,0.06);
  --chip-fill: linear-gradient(180deg, #33212A 0%, #2C1B1F 55%, #261619 100%);
  --chip-fill-press: linear-gradient(180deg, #2A1A1D 0%, #241517 100%);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.20), 0 8px 24px rgba(0,0,0,0.30);
  --cat-circle-bg: #F2CBBF;
  --groove: #110809;
  --groove-sh: rgba(0,0,0,0.60);
  --groove-hl: rgba(255,235,228,0.075);
  --contact: 0 1px 1.5px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.40);
  --initial-raise: inset 0 1px 1px rgba(255,255,255,0.22), inset 0 -2px 3px rgba(60,16,14,0.35);
  --sel-fill: #45262A;
  --sel-shadow: inset 0 2px 5px rgba(0,0,0,0.55), inset 0 1px 1.5px rgba(0,0,0,0.40), 0 1px 0 rgba(255,235,228,0.07);
  --card-paper-top: #2F2023;
  --card-paper-bottom: #2A1A1D;
  --card-paper-shadow: inset 0 1px 0 rgba(255,235,228,0.07), 0 1px 0 #160C0E, 0 6px 14px rgba(0,0,0,0.30);
}

/* ── L103: the one primary button, and its secondary ──────────────────────
   Every filled button in the app (the main pill .btn-send, the cards' and the
   popover's, the sheets' Done and Save, the drawer's) and the site's
   (data-pip-btn, set by siteSkin.js; the helper's pages draw theirs from
   these tokens in server/routes/publicPage.js). The :is() lists match the
   older rules' weight in styles.css, and this file is read last. */
:is(.btn-send, .req-actions button.primary, .req-actions a.primary, .pop-actions .primary, .ps-done, .ps-save .primary, .dr-focus .drf-act, .pip-btn),
:is(.btn-send, .req-actions button.primary, .req-actions a.primary, .pop-actions .primary, .ps-done, .ps-save .primary, .dr-focus .drf-act, .pip-btn)[data-pressed] {
  background-color: var(--pip-btn-bg); background-image: none; color: var(--pip-btn-fg);
  border: 0; border-radius: var(--pip-btn-radius); box-shadow: var(--pip-btn-shadow);
}
:is(.btn-send, .req-actions button.primary, .req-actions a.primary, .pop-actions .primary, .ps-done, .ps-save .primary, .dr-focus .drf-act, .pip-btn)[data-pressed],
:is(.btn-send, .pip-btn):active:not(:disabled) { box-shadow: var(--pip-btn-shadow-press); }
:is(.btn-send, .pip-btn):active:not(:disabled) { translate: 0 2px; }
/* The needs-you pill keeps amber (its ink label), matte the same way. */
:is(.req-actions button.primary, .dr-focus .drf-act)[data-tone="sug"],
:is(.req-actions button.primary, .dr-focus .drf-act)[data-tone="sug"][data-pressed] {
  background-color: var(--amber); background-image: none; box-shadow: var(--btn-amber-shadow);
}
:is(.req-actions button.primary, .dr-focus .drf-act)[data-tone="sug"][data-pressed] { box-shadow: var(--btn-amber-shadow-press); }
/* The secondary: the same shape, cream, a thin border. */
.btn-second, .btn-second[data-pressed] {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 10px; padding: 0 18px;
  font: 600 17px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: translate 120ms ease, scale 120ms ease, box-shadow 120ms ease;
}
.btn-second, .btn-second[data-pressed], .pf-tile, .pf-tile[data-pressed] {
  background-color: var(--pip-btn2-bg); background-image: none; color: var(--pip-btn2-fg);
  border: 1px solid var(--pip-btn2-border); border-radius: var(--pip-btn-radius); box-shadow: var(--pip-btn2-shadow);
}
.btn-second[data-pressed], .pf-tile[data-pressed], .btn-second:active:not(:disabled) { box-shadow: var(--pip-btn2-shadow-press); }
.btn-second:disabled { opacity: 0.5; cursor: default; }
.btn-second:focus-visible, .pip-btn:focus-visible, .btn-send:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  :is(.btn-send, .pip-btn, .btn-second):active { translate: none; }
}
