/* יומני היקר — design tokens ("רך ואלגנטי")
   Colour scheme: follows the device by default; html[data-scheme="light"|"dark"] forces one (owner's choice). */
:root {
  --bg: #FAF6F3;
  --surface: #FFFFFF;
  --surface-2: #F5EDE8;
  --surface-3: #EDE2DB;
  --text: #2A1F24;
  --text-2: #7A6B70;
  --text-3: #8F7F86;
  --border: #EDE2DC;
  --border-2: #DFCFC8;
  --accent: #C7607A;
  --accent-ink: #B04E68;
  --accent-text: #FFFFFF;
  --accent-soft: #F7E1E7;
  --accent-soft-2: #F1CBD6;
  --success: #2F7A5C;
  --success-soft: #E3F2EA;
  --danger: #C8503F;
  --danger-soft: #FBE6E2;
  --warning: #9A6410;
  --warning-soft: #FBF0DC;
  --info: #4F7FB3;
  --info-soft: #E3ECF7;
  --overlay: rgba(28, 14, 20, .45);
  --shadow-1: 0 1px 2px rgba(42, 31, 36, .05), 0 6px 20px rgba(42, 31, 36, .06);
  --shadow-2: 0 12px 40px rgba(42, 31, 36, .16);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --font: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Hebrew', Arial, sans-serif;
  --nav-h: 64px;
  --header-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t: 200ms;
  color-scheme: light;
}

@supports (color: color-mix(in srgb, red 50%, white)) {
  :root {
    --accent-ink: color-mix(in srgb, var(--accent) 85%, black);
    --accent-soft: color-mix(in srgb, var(--accent) 13%, white);
    --accent-soft-2: color-mix(in srgb, var(--accent) 26%, white);
  }
}

/* ---- dark tokens: device preference (unless the page forces light) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #1B1518;
    --surface: #241C20;
    --surface-2: #2E2429;
    --surface-3: #3A2D33;
    --text: #F4ECEF;
    --text-2: #BBAAB1;
    --text-3: #83727A;
    --border: #3A2E34;
    --border-2: #4C3D44;
    --accent-ink: #E9A1B4;
    --accent-soft: #3A252C;
    --accent-soft-2: #4E2F39;
    --success: #6BBF9B;
    --success-soft: #1F3A30;
    --danger: #E0705F;
    --danger-soft: #4A2622;
    --warning: #E0A650;
    --warning-soft: #453218;
    --info: #7FA8D8;
    --info-soft: #22303F;
    --overlay: rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-2: 0 12px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
  @supports (color: color-mix(in srgb, red 50%, white)) {
    :root:not([data-scheme="light"]) {
      --accent-ink: color-mix(in srgb, var(--accent) 70%, white);
      --accent-soft: color-mix(in srgb, var(--accent) 22%, #241C20);
      --accent-soft-2: color-mix(in srgb, var(--accent) 34%, #241C20);
    }
  }
}

/* ---- dark tokens: forced by the page (html[data-scheme="dark"]) ---- */
:root[data-scheme="dark"] {
  --bg: #1B1518;
  --surface: #241C20;
  --surface-2: #2E2429;
  --surface-3: #3A2D33;
  --text: #F4ECEF;
  --text-2: #BBAAB1;
  --text-3: #83727A;
  --border: #3A2E34;
  --border-2: #4C3D44;
  --accent-ink: #E9A1B4;
  --accent-soft: #3A252C;
  --accent-soft-2: #4E2F39;
  --success: #6BBF9B;
  --success-soft: #1F3A30;
  --danger: #E0705F;
  --danger-soft: #4A2622;
  --warning: #E0A650;
  --warning-soft: #453218;
  --info: #7FA8D8;
  --info-soft: #22303F;
  --overlay: rgba(0, 0, 0, .6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
  --shadow-2: 0 12px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@supports (color: color-mix(in srgb, red 50%, white)) {
  :root[data-scheme="dark"] {
    --accent-ink: color-mix(in srgb, var(--accent) 70%, white);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, #241C20);
    --accent-soft-2: color-mix(in srgb, var(--accent) 34%, #241C20);
  }
}
