/* ==========================================================================
   FUNDER Design Tokens
   --------------------------------------------------------------------------
   THIS FILE DEFINES VALUES ONLY. It must never style an element.
   The only selectors allowed here are :root, [data-fn-theme] and the
   .darkCont accessibility bridge at the bottom.

   That rule is what makes this file safe to load in any Master page, on any
   of the five Funder apps (www / gemel / pensiya / polisa / yoatzim),
   without changing a single pixel until a component opts in.

   Two layers:
     1. PRIMITIVES  --fn-green-400, --fn-space-4 ...   fixed, theme-independent
     2. SEMANTIC    --fn-bg-surface, --fn-brand ...    these are what flip in dark

   Components must only ever reference layer 2. A component that reaches for
   --fn-green-400 directly will look wrong the moment the theme changes.
   ========================================================================== */

:root {

  /* ---------------------------------------------------------------- 1.1
     Brand green ramp — anchored on #67cb35 (FUNDER UI brand green).
     400 is the accent / header chrome in Light. Deeper steps (700+) carry
     white text at WCAG AA when a filled control needs it. Lighter steps are
     for dark-mode hover and soft tints. Contrast noted where it matters.
     ---------------------------------------------------------------- */
  --fn-green-50:  #EEF9E8;
  --fn-green-100: #D4F0C4;
  --fn-green-200: #A8E07A;
  --fn-green-300: #7ED44A;   /* accent hover on dark canvas */
  --fn-green-400: #67cb35;   /* BRAND ANCHOR — accent + Light header chrome */
  --fn-green-500: #58B82E;   /* hover on green surface (~7.4:1 with dark ink) */
  --fn-green-600: #4A9E27;   /* pressed / strong border */
  --fn-green-700: #3B7E1F;   /* ~5.3:1 with white — AA for UI text on fill */
  --fn-green-800: #2F6419;   /* focus / deepest */
  --fn-green-900: #1F4210;

  /* 1.2  Neutrals — very slightly green-shifted so they sit with the brand */
  --fn-gray-0:   #FFFFFF;
  --fn-gray-25:  #FAFBF9;
  --fn-gray-50:  #F4F6F3;
  --fn-gray-100: #EDF1EB;
  --fn-gray-200: #E3E8E0;
  --fn-gray-300: #CFD6CB;
  --fn-gray-400: #A7B0A3;
  --fn-gray-500: #79857B;
  --fn-gray-600: #5A6559;
  --fn-gray-700: #414B41;
  --fn-gray-800: #252C26;
  --fn-gray-900: #161C17;
  --fn-gray-950: #0B0F0C;

  /* 1.3  Data semantics.
     Deliberately a different hue family from the brand green, so "up" never
     reads as "branded". Replaces #008000 (5.14) and #FF0000 (4.0 — fails AA). */
  --fn-up-500:    #137333;   /* 5.95:1 on white  */
  --fn-up-300:    #5ED17C;   /* dark mode        */
  --fn-up-bg-l:   #E8F5EC;
  --fn-down-500:  #C62828;   /* 5.62:1 on white  */
  --fn-down-300:  #F26B6B;   /* dark mode        */
  --fn-down-bg-l: #FCEBEB;
  --fn-amber-500: #B7791F;

  /* 1.4  Spacing — 4px grid, matching the reference image's rhythm */
  --fn-space-1:  4px;
  --fn-space-2:  8px;
  --fn-space-3:  12px;
  --fn-space-4:  16px;
  --fn-space-5:  20px;
  --fn-space-6:  24px;
  --fn-space-8:  32px;
  --fn-space-10: 40px;
  --fn-space-12: 48px;
  --fn-space-16: 64px;

  /* 1.5  Radius — the reference commits to exactly two shapes. So do we.
     Anything that is not a small control is either "md" or a full pill. */
  --fn-radius-sm:   6px;
  --fn-radius-md:   12px;
  --fn-radius-lg:   16px;
  --fn-radius-pill: 999px;

  /* Data-table surfaces. List decks (.fn-list-deck) and the search
     results panel (.fn-discover-results) both read this and nothing else.
     Change the number here and every table corner follows. */
  --fn-radius-table: 12px;

  /* Role radii. Components name the job, not the pixel.
     Mobile values match the scale above, so pointing an existing 14px
     card at --fn-radius-card does not move a phone. The desktop query
     further down retunes the scale; roles that alias it follow. */
  --fn-radius-card:    var(--fn-bubble-radius); /* 14 — cards, bubbles, hero-scale panels */
  --fn-radius-compact: 8px;                     /* inner controls, menus */
  --fn-radius-control: var(--fn-radius-sm);     /* buttons and small controls */
  --fn-radius-field:   var(--fn-radius-pill);   /* search — pill on phones, unified on desktop */
  --fn-radius-filter:  var(--fn-radius-pill);   /* header filter selects — pill on phones, unified on desktop */
  --fn-radius-nav:     var(--fn-radius-pill);   /* quick-link bubbles; desktop unifies this */
  --fn-radius-sheet:   28px;                    /* the large auth card */
  --fn-radius-hero:    10px;

  /* ---------------------------------------------------------------- 1.9
     Layout. One content box for the header, the ticker, the page and
     the footer. The steps are the widths the site already ships
     (100% / 750 / 970 / 1170 / 1366); this block is the knob.
     ---------------------------------------------------------------- */
  --fn-container-max: 100%;
  --fn-container-pad: 15px;
  --fn-col-gap:       30px;
  --fn-section-gap:   var(--fn-space-8);
  --fn-rail-gap:      6px;
  --fn-rail-pad:      12px;
  --fn-index-gap:     8px;

  /* 1.6  Typography — one family for the whole product.
     px / em / vw ONLY — never rem. acc_box.js writes an inline font-size
     onto <body> for the accessibility text-size buttons, and rem ignores it.

     Open Sans (Steve Matteson, OFL) ships Hebrew and Latin in the same
     family. The files are self-hosted at assets/fonts/open-sans (variable,
     weights 400-800) and loaded from the site host. Arial then Segoe UI
     are the failure fallback:
     both cover Hebrew on Windows, and Arial is the face the site used
     before this system, so a failed webfont does not change the layout
     language. The legacy self-hosted "Open Sans Hebrew" is a different
     cut and is not in the stack.

     All three roles share that stack. Hierarchy is size and weight,
     not a second family. --fn-font-num is the same face; components add
     font-variant-numeric: tabular-nums on figures.

     Weights — do not paint everything bold:
       400  body, secondary copy
       500  moderate emphasis          (--fn-fw-emphasis)
       600  card titles, labels, key   (--fn-fw-medium / --fn-fw-semibold)
            figures. --fn-fw-medium stays 600 because the existing UI
            already uses that token as its semibold step.
       700  page and section headings  (--fn-fw-bold)
       800  one dominant figure only   (--fn-fw-extrabold)

     Two size layers. Do not point a table or a card at the editorial scale.
       Control (--fn-fs-*)  compact UI, chrome, tables. Unchanged on purpose.
       Roles   (--fn-type-*) editorial and semantic. Fluid only on the
               roles that are page headlines; fixed where density matters.
     Udi's lab figures (44 / 28 / 17 / 18) are the wide-screen targets for
     an article, not a size to stamp on every component. */
  --fn-font-sans:    "Open Sans", Arial, "Segoe UI", sans-serif;
  --fn-font-ui:      var(--fn-font-sans);
  --fn-font-num:     var(--fn-font-sans);
  --fn-font-display: var(--fn-font-sans);

  --fn-fs-xs:   11px;
  --fn-fs-sm:   12px;
  --fn-fs-base: 14px;
  --fn-fs-md:   15px;
  --fn-fs-lg:   17px;
  --fn-fs-xl:   20px;
  --fn-fs-2xl:  26px;

  /* Article H1 reaches 44px at 1440px and floors at 30px below ~430px. */
  --fn-type-display: clamp(30px, 1.4vw + 23.8px, 44px);
  --fn-type-h1:      clamp(24px, 0.9vw + 18px, 32px);
  --fn-type-h2:      clamp(20px, 0.85vw + 15.8px, 28px);
  --fn-type-h3:      clamp(18px, 0.35vw + 16px, 22px);
  --fn-type-h4:      17px;
  --fn-type-body-lg: 18px;
  --fn-type-body:    15px;
  --fn-type-body-sm: 14px;
  --fn-type-caption: 12px;
  --fn-type-table:   13px;
  --fn-type-table-sm: 12px;

  /* ONE headline size for every article card on a phone.
     Not a scale — a single value. Section leads, briefs, the chronological
     stream and a card that happens to have no photo all resolve to this, so
     card size can never imply importance that the data does not carry. The
     page headline (hero) is the only type on a phone allowed to be larger.
     Overridden one step down below 360px in fn/21-mobile.css. */
  --fn-type-card-phone: 17px;
  --fn-leading-card-phone: 1.32;

  --fn-fw-regular:   400;
  --fn-fw-emphasis:  500;
  --fn-fw-medium:    600;
  --fn-fw-semibold:  600;
  --fn-fw-bold:      700;
  --fn-fw-extrabold: 800;
  /* The loaded face is exactly these five weights. 650 is not one of them:
     font-synthesis on this site does not invent a weight, and the browser
     already resolves 650 to 700. Declare --fn-fw-bold instead. */

  --fn-leading-tight:   1.25;
  --fn-leading-base:    1.45;
  --fn-leading-loose:   1.65;
  --fn-leading-display: 1.22;
  --fn-leading-prose:   1.7;
  --fn-leading-data:    1.35;

  /* Open Sans Hebrew paints about 0.08em past a tight line box. Anywhere
     text is clipped (line-clamp or a single-line ellipsis) that stroke is
     cut off the top of ה ח ת. The pad is the room those strokes need.
     The component adds the same amount as a negative block margin, so the
     margin box — the row, the card, the gap — stays where it was. */
  --fn-ink-pad: 0.2em;

  /* ~65 Hebrew characters at the article body size. */
  --fn-measure-prose: 38em;

  --fn-track-tight: 0;

  /* 1.7  Borders, elevation, motion */
  --fn-border-width: 1px;

  /* Elevation is expressed through BORDER first and shadow second. This is
     what keeps the reference image from looking like generic SaaS, and it is
     also the only model that survives the switch to a dark canvas. */
  --fn-shadow-none: none;
  --fn-shadow-sm:   0 1px 2px rgba(22, 28, 23, 0.06);
  --fn-shadow-md:   0 2px 8px rgba(22, 28, 23, 0.08);
  --fn-shadow-pop:  0 8px 24px rgba(22, 28, 23, 0.14);

  --fn-dur-fast: 120ms;
  --fn-dur-base: 200ms;
  --fn-dur-slow: 320ms;
  --fn-ease:     cubic-bezier(0.4, 0, 0.2, 1);

  --fn-z-header:  1030;
  --fn-z-overlay: 1040;

  /* ---------------------------------------------------------------- 1.11
     PAGE CHROME GEOMETRY — where readable content stops under the chrome.
     --------------------------------------------------------------------
     One house rule, read by the floating home/top tools (13-header-sticky),
     the anchor jump (fn-cat-jump.js) and every sticky table header
     (37-sticky-head): content scrolls up to the bottom of the floating
     tools plus one breath, never under them.

       --fn-chrome-bar         the pinned site bar. 0 on desktop (nothing
                               pins); on a phone the bar's own measured
                               height, which fn-header-sticky.js publishes
                               as --fn-sticky-offset on <html> as soon as
                               it runs. Until then, --fn-chrome-bar-est.
       --fn-chrome-tools-inset the tools' distance from the viewport edges
                               while no bar is pinned (top and side).
       --fn-chrome-tools-gap   the tools' gap under a pinned bar (phone).
       --fn-chrome-tools-top   the tools' distance below --fn-chrome-bar:
                               the inset on desktop, the gap on a phone.
       --fn-chrome-tools-size  one round tool button.
       --fn-chrome-breath      the gap content keeps under the chrome.

       --fn-chrome-tools-bottom the tools' bottom edge below the bar
                               (tools-top + tools-size).
       --fn-chrome-line        THE content line: bar + tools-bottom +
                               breath. 0 + 12 + 40 + 8 = 60 on desktop,
                               bar + 8 + 40 + 8 on a phone. The sticky
                               table headers, their caps and the pane
                               clamp read it. The anchor padding
                               (13-header-sticky) and the jump
                               (fn-cat-jump.js) read its parts (bar,
                               tools-bottom, breath), because they add the
                               tools only while the tools are on screen.

     The breath rule: one breath under each chrome edge. Without a page bar
     that is one breath in the line at every width, so changing it moves
     desktop and phone by the same amount (the tools' own gap is a separate
     knob). Under a page-owned bar (the /fund pd-nav, a markets sub-nav)
     both edges count: the consuming rule takes max(--fn-chrome-line,
     bar + stack + breath), so the breath appears once under the tools and
     once under that bar, and whichever edge is lower wins.

     That page bar does NOT change these tokens. Its height is page state,
     so the component that owns it sets --fn-sticky-stack on its container;
     never resolve it here. The derived tokens resolve on :root, so their
     inputs (bar, tools, breath) must be set on :root too. */
  --fn-chrome-bar:         0px;
  --fn-chrome-bar-est:     56px;
  --fn-chrome-tools-inset: 12px;
  --fn-chrome-tools-gap:   8px;
  --fn-chrome-tools-top:   var(--fn-chrome-tools-inset);
  --fn-chrome-tools-size:  40px;
  --fn-chrome-breath:      8px;
  --fn-chrome-tools-bottom: calc(var(--fn-chrome-tools-top) + var(--fn-chrome-tools-size));
  --fn-chrome-line:        calc(var(--fn-chrome-bar) + var(--fn-chrome-tools-bottom) + var(--fn-chrome-breath));

  /* A sticky table header sits over its own table's frozen cells
     (14-list: body 2, footer 6, header 7) and under every piece of site
     chrome (--fn-z-header and up). */
  --fn-z-sticky-head: 8;

  /* 1.8  Bubble / tile geometry — the phone content shell.
     One shape vocabulary for every block that sits on the feed canvas:
     article cards, data modules, boards, "נצפו לאחרונה", the magazine slot.
     These are PRIMITIVES (fixed), the colours below are semantic (they flip).

     Radius is deliberately one step larger than --fn-radius-md: a 12px box on
     a phone still reads as a panel, 14px reads as a bubble. Media inside a
     bubble uses --fn-bubble-media-radius so an inset photo keeps a visibly
     smaller corner than the shell that holds it — that difference is what
     stops the photo from looking like it is floating on its own.

     THE RHYTHM. Five steps, and the ratios between them are the whole point —
     a reader should be able to tell "another card" from "another subject"
     without reading anything:

       6px   inside a card, between its own lines (title → date)
      14px   inside a card, from its edge to its content
      10px   a section label to the first card it introduces
      14px   between two cards, or two peer blocks
      22px   between one group and the next

     Two things were wrong before this pass, and both were about the
     wallpaper. At 12px the band of canvas between two cards was narrower
     than the cards' own corner radius, so the texture only ever appeared in
     the big breaks between categories — it read as decoration AROUND the
     content rather than as the surface the content sits on. And at 28px
     those breaks were doing far more separating than they needed to, since
     a section label already carries its own height and its own rule.

     So: the card step goes UP and the group step comes DOWN, and the ratio
     tightens from 2.3 to 1.6. The category break is still unmistakable —
     22px plus a heading plus 10px is nothing like 14px — but it is now a
     pause rather than a gulf.

     --fn-bubble-label-gap is deliberately the SMALLEST of the three. A
     heading belongs to the group under it, so it should sit closer to its
     own first card than two cards sit to each other; that single asymmetry
     is what makes a group read as a group with no extra lines or boxes. */
  --fn-bubble-radius:       14px;
  --fn-bubble-radius-sm:    10px;
  --fn-bubble-media-radius: 9px;
  --fn-bubble-pad:          14px;
  --fn-bubble-pad-tight:    11px;
  --fn-bubble-line-gap:     6px;
  --fn-bubble-label-gap:    10px;
  --fn-bubble-gap:          14px;
  --fn-bubble-group-gap:    22px;
  --fn-bubble-gutter:       12px;   /* canvas edge → bubble edge */

  /* Brand canvas texture — tile size and how loud it is allowed to be.
     The artwork itself is a mask in fn/21-mobile.css; only its scale and
     weight are decided here so a theme can quieten it without new artwork.

     Tuned down from 154px / 0.10 after seeing it behind real cards: on a
     phone only 12px strips of canvas show between bubbles, and at the first
     weight those strips were busy enough to pull the eye off the content.
     A larger tile puts fewer motifs in each gap, and a lower opacity keeps
     it as something you notice while scrolling rather than something you
     read. It must stay visible — a wallpaper you cannot see is just a
     colour — so the floor here is "recognisable at a glance", not "subtle
     enough to disappear".

     The ink is a NEUTRAL near-black here, not --fn-text-1: the brand's greys
     are deliberately green-shifted, and a green-shifted texture is how the
     white theme would quietly become the mint one. At 0.06 over the canvas
     it resolves to about #EFEFEF — a grey you can see and never read. */
  /* The wallpaper artwork itself.
     One tile of FUNDER marks at four sizes, a trend arrow, a bar chart, a
     shekel coin, candlesticks and a sparkline, drawn as a MASK so a single
     copy of the vector serves every theme and only the ink and the weight
     come from tokens. The F is traced from funder-mark-round, not set in a
     typeface — a font's F is not the brand's F.

     It lives here rather than in 21-mobile.css because a data-URI is a
     value, and because the desktop layer needs to reach it too; declared
     inside the phone media query it was invisible above 767px. */
  --fn-canvas-pattern:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 190 190' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg fill='%23000' stroke='none'%3E%3Crect x='11.4' y='13.3' width='12.6' height='36.9'/%3E%3Crect x='26.4' y='13.3' width='20.1' height='8.8'/%3E%3Crect x='26.4' y='27' width='14.5' height='8.8'/%3E%3Crect x='157.7' y='62.7' width='5.8' height='17'/%3E%3Crect x='164.6' y='62.7' width='9.3' height='4'/%3E%3Crect x='164.6' y='69' width='6.7' height='4'/%3E%3Crect x='106.4' y='129.2' width='8.8' height='25.9'/%3E%3Crect x='116.9' y='129.2' width='14.2' height='6.2'/%3E%3Crect x='116.9' y='138.8' width='10.2' height='6.2'/%3E%3Crect x='55.1' y='171' width='4.1' height='12'/%3E%3Crect x='60' y='171' width='6.5' height='2.9'/%3E%3Crect x='60' y='175.4' width='4.7' height='2.9'/%3E%3C/g%3E%3Cpath d='M89.3 45L102.3 30.1 112.5 38.5 130.2 17.1'/%3E%3Cpath d='M120 17.1h10.2v10.2'/%3E%3Cpath d='M17.1 77.9v35.5'/%3E%3Crect x='13.3' y='84.7' width='7.6' height='20.3' rx='1'/%3E%3Cpath d='M30.6 83v28.7'/%3E%3Crect x='26.8' y='89.7' width='7.6' height='13.5' rx='1'/%3E%3Cpath d='M44.1 79.6v33.8'/%3E%3Crect x='40.3' y='86.3' width='7.6' height='18.6' rx='1'/%3E%3Ccircle cx='92.2' cy='90.3' r='13.2'/%3E%3Cpath d='M85 97.4V83.1H94.2V91.3'/%3E%3Cpath d='M99.3 83.1V97.4H90.1V89.2'/%3E%3Cpath d='M148.2 160.6h33.3'/%3E%3Cpath d='M153.8 160.6V147.9'/%3E%3Cpath d='M161.7 160.6V139.2'/%3E%3Cpath d='M169.6 160.6V151.9'/%3E%3Cpath d='M177.5 160.6V143.9'/%3E%3Cpath d='M9.5 158.2L17.3 152.2 24.2 160.8 32 148.7 38.9 154.8 47.5 144.4'/%3E%3C/svg%3E");
  /* Two sizes for one artwork. 190px was chosen by looking at a 390px
     screen, where it shows two or three marks across the gap between two
     cards. Left at that size on a 1440px window the same tile repeats seven
     times across and stops reading as texture — so the desktop scales the
     tile instead of multiplying it, keeping the marks at roughly the size
     the eye met them on the phone relative to the window. */
  --fn-canvas-pattern-size:    190px;
  --fn-canvas-pattern-size-desktop: 260px;
  /* …and a lighter hand at that size. See the note on the size above:
     the phone sees this through a 14px gap, a monitor sees it across a
     200px margin, so the weight has to come down by roughly half for
     the two to LOOK the same. Chosen by comparing renders, not by
     halving the number. */
  --fn-canvas-pattern-opacity-desktop: 0.022;
  --fn-canvas-pattern-opacity: 0.06;
  --fn-canvas-pattern-ink:     #121212;

  /* The page wallpaper (Udi's art, assets/img/bg). Source is 1672×941 with
     large marks; drawn as a repeating tile so it reads like WhatsApp —
     lots of small doodles — instead of one poster stretched with `cover`.
     Phone tile ~380px (marks ~25px); desktop ~460px (marks ~30px).
     --fn-canvas-color is the artwork's own ground, so the page does not
     flash a different colour before the image arrives. */
  --fn-canvas-image: url("../../img/bg/fn-canvas-light.jpg");
  --fn-canvas-color: #F5F5F5;
  --fn-canvas-tile-size: 380px;
  --fn-canvas-tile-size-desktop: 460px;
  --fn-canvas-blend: normal;


  /* ================================================================ 2
     SEMANTIC TOKENS — LIGHT (default)
     ================================================================ */

  color-scheme: light;

  /* Surfaces */
  --fn-bg-canvas:  #F3F6F1;
  --fn-bg-surface: var(--fn-gray-0);
  --fn-bg-raised:  var(--fn-gray-0);
  --fn-bg-sunken:  var(--fn-gray-100);
  --fn-bg-hover:   var(--fn-gray-100);
  --fn-bg-active:  var(--fn-gray-200);

  /* Bubble surface — Light.
     The light theme must not read as an in-between grey, so the card is
     defined by elevation and a hairline rather than by a tint.

     PURE white, both of them — #FFFFFF canvas and #FFFFFF card. There is no
     half-tone anywhere in this theme: the earlier #FCFCFC canvas was a
     three-unit step nobody asked for, and a step that small is the worst of
     both worlds — too faint to separate anything, just enough to stop the
     white being white.

     What separates a card from the page instead is MATERIAL, not tone: the
     ground carries the brand texture and the card does not, plus a hairline
     and a whisper of shadow. That is a stronger distinction than three units
     of grey ever was, and it is the one the wallpaper was added for.

     Every value here is NEUTRAL rather than one of the brand's deliberately
     green-shifted greys, so the white theme cannot drift toward mint.

     --fn-bubble-canvas is the ground the bubbles sit on, at both sizes:
     26-desktop.css uses it as well as the phone layer.

     It is #FFFFFF and stays #FFFFFF. It was briefly changed to #F4F6F3 to
     make white cards read against it; that was reverted because the white
     canvas is a decision already taken, not something to re-open. The
     separation a card needs comes from its EDGE and its SHADOW — see
     --fn-bubble-border and --fn-bubble-shadow below — and from the gap
     between cards, through which the FUNDER texture shows. Not from
     tinting the page. */
  --fn-bubble-canvas: #FFFFFF;
  --fn-bubble-bg:     #FFFFFF;
  --fn-bubble-bg-press: #F2F2F2;
  --fn-bubble-border: #E2E6E1;
  /* White bubble on a white canvas: the card is carried by elevation and a
     hairline, because a tint is exactly the "halfway grey" this theme is
     not allowed to be — and tinting the canvas instead was tried and
     rejected.

     TWO shadows, doing two jobs. The 1px contact shadow is what makes an
     edge read as an edge rather than as a drawn line; the wide, very soft
     one at 14% is what lifts the card off the page at a glance. Either
     alone looks like a mistake on white: the contact shadow alone reads
     flat, the ambient one alone reads blurry. The border is one step
     darker than it was for the same reason — on #FFFFFF, #E6E6E6 is at the
     threshold where a hairline stops registering. */
  --fn-bubble-shadow:
    0 1px 2px rgba(16, 24, 20, 0.05),
    0 6px 16px -10px rgba(16, 24, 20, 0.14);
  /* --fn-bubble-lift is --fn-bubble-shadow's safe sibling, and it exists
     because of a trap: a card's hairline is drawn as an INSET shadow, so
     the lift has to be the second entry in the same list —

       box-shadow: inset 0 0 0 1px <border>, var(--fn-bubble-lift);

     and `none` is not a shadow. A theme that resolves the variable to
     `none` makes the whole declaration invalid, and the card loses its
     HAIRLINE as well as its lift. That is exactly what happened in dark.
     Every theme therefore gives this a real shadow value, and a theme that
     wants none uses a transparent one rather than the keyword. */
  --fn-bubble-lift:
    0 1px 2px rgba(16, 24, 20, 0.05),
    0 6px 16px -10px rgba(16, 24, 20, 0.14);
  /* THE CARD IS ONE SURFACE.
     The box a photo sits in is the card, not a panel inside it. There is no
     reason for a grey rectangle to appear inside a white bubble: a photo
     covers its box completely, so the colour is only ever seen in the
     fraction of a second before it decodes — and in that moment a grey
     block announces a seam that does not exist once the image lands.

     Separation between the card and the page is the job of the hairline,
     the shadow and the texture on the canvas. It is not the job of a second
     colour inside the card. */
  --fn-bubble-media-bg: var(--fn-bubble-bg);

  /* The one place a neutral grey is still right: a card whose article has
     no photograph at all. That is a real absence and should look like one,
     rather than like a white hole in the layout. */
  --fn-bubble-skeleton: #F2F2F2;

  /* Text */
  --fn-text-1: #0E1410;              /* 17+:1 on white */
  --fn-text-2: #4B5563;              /*  7.6:1 on white */
  --fn-text-3: #596273;              /* ~5.9:1 on white / ~5.4:1 on canvas */
  --fn-text-inverse:  var(--fn-gray-0);

  /* On-brand inks (Light chrome is #67cb35 — white fails AA on it):
       --fn-text-on-brand    ink on a deep --fn-brand FILL (white-capable)
       --fn-on-brand-surface ink on --fn-brand-surface header chrome
       --fn-on-brand-muted   secondary icons/labels on that chrome */
  --fn-text-on-brand:    var(--fn-gray-0);
  --fn-on-brand-surface: #0E1410;
  --fn-on-brand-muted:   #2A3A28;

  /* Lines — neutral on white surfaces; chrome uses on-brand washes in CSS */
  --fn-border:        var(--fn-gray-200);
  --fn-border-strong: var(--fn-gray-300);
  --fn-border-brand:  var(--fn-green-400);

  /* Brand
     --fn-brand        : deep green that carries white text (buttons on light)
     --fn-brand-surface: Light header chrome — one step calmer than the accent
                         so the band reads modern/financial, not neon. Accent
                         (#67cb35) stays for chips, CTAs and focus on white.
     --fn-accent       : #67cb35 — chips, CTAs on white, focus. Dark ink on top. */
  --fn-brand:          var(--fn-green-700);
  --fn-brand-hover:    var(--fn-green-800);
  --fn-brand-surface:  var(--fn-green-500);   /* #58B82E — calmer than accent */
  --fn-brand-surface-hover: var(--fn-green-600);
  --fn-accent:         var(--fn-green-400);
  --fn-accent-hover:   var(--fn-green-500);
  --fn-on-accent:      #0E1410;      /* ~9:1 on #67cb35 */
  --fn-brand-soft:     var(--fn-green-50);

  /* ---------------------------------------------------------------- 2.1a
     INTERACTION — the one approved green.
     --------------------------------------------------------------------
     #67cb35 is the swatch the Dark theme already paints a headline with on
     hover: `.fn-chrono__link:hover .fn-chrono__title { color: var(--fn-brand) }`
     resolves to --fn-green-400 under [data-fn-theme="dark"]. That is the
     green Udi approved, so it is lifted out into its own token and becomes
     the single interaction colour in all three themes. Nothing new was
     mixed — this is the existing brand anchor, named for its job.

     Why two tokens and not one:

       --fn-interactive      THE SIGNAL. Indicators, fills, active borders,
                             underlines, icons, dots. Byte-identical in every
                             theme, which is the whole point: the green has to
                             read as the same green on white and on black.

       --fn-interactive-ink  THE SAME INTENT ON TEXT, and it cannot be one
                             value. #67cb35 is 9.4:1 on the dark canvas but
                             2.06:1 on white — that fails AA even at large
                             sizes, so a light-theme headline may not be
                             painted with it. Light and Soft use the nearest
                             step of the SAME hue that clears 4.5:1
                             (5.01:1 and 5.69:1 respectively).

     An active state never relies on the green alone: the component also
     changes weight, so the selection survives greyscale and colour-blindness
     (WCAG 1.4.1). Hover is --fn-interactive-ink on text; Active/Selected adds
     the --fn-interactive indicator plus weight. Keep that split — a hover
     that looks identical to a selection is the bug this replaces. */
  --fn-interactive:       #67cb35;
  --fn-interactive-ink:   var(--fn-green-700);   /* 5.01:1 on white */
  --fn-interactive-press: var(--fn-green-600);
  --fn-interactive-wash:  rgba(103, 203, 53, 0.10);
  --fn-interactive-line:  rgba(103, 203, 53, 0.42);
  --fn-on-interactive:    #0E1410;               /* ~9:1 on #67cb35 */

  /* Data — market semantics (distinct from brand accent).
     --fn-market-up / --fn-market-down are the aliases components should use. */
  --fn-up:      var(--fn-up-500);
  --fn-up-bg:   var(--fn-up-bg-l);
  --fn-down:    var(--fn-down-500);
  --fn-down-bg: var(--fn-down-bg-l);
  --fn-neutral: var(--fn-text-2);
  --fn-market-up:   var(--fn-up);
  --fn-market-down: var(--fn-down);

  /* Focus */
  --fn-focus:        var(--fn-green-600);
  --fn-focus-invert: var(--fn-gray-0);
  --fn-focus-width:  2px;
  --fn-focus-offset: 2px;

  /* Form controls — white fields sit on the green Light header */
  --fn-field-bg:          var(--fn-gray-0);
  --fn-field-border:      var(--fn-gray-300);
  --fn-field-text:        var(--fn-text-1);
  --fn-field-placeholder: #596273;   /* match --fn-text-3; placeholder is not a label */
  --fn-field-bg-hover:    var(--fn-gray-25);

  /* Controls — the quick-links chips, dropdown triggers and small round
     buttons. A theme changes how a control looks HERE, never with a
     `:root[data-fn-theme] .control {…}` rule: that selector outweighs the
     component's own `.control:hover`, and the control stops reacting to
     the mouse in that theme (Udi, 18/11: the chips did not light up in
     Dark). The component rule reads these for rest and for hover. */
  --fn-control-bg:           var(--fn-bg-surface);
  --fn-control-border:       var(--fn-border);
  --fn-control-bg-hover:     var(--fn-bg-hover);
  --fn-control-border-hover: var(--fn-border-strong);
  /* The floating accessibility launcher. */
  --fn-fab-shadow:           0 8px 24px -12px rgba(14, 20, 16, 0.45),
                             0 1px 0 rgba(14, 20, 16, 0.06);

  /* ---------------------------------------------------------------- 2.1
     HEADER SURFACES — one set of values for all three bands.
     --------------------------------------------------------------------
     The header is .header (brand + tools) with .fn-navband and .fn-railband
     stacked inside it, plus the compact bar the sticky script pins to the
     top on scroll. Those four used to pick their own colours: a green bloom
     on .header, a hard-coded rgba() on the nav band, --fn-bg-sunken on the
     rail. In Light that read as a green header with two different greys
     under it, and the compact bar did not match any of them.

     They now all resolve from here, so "is the header white in the light
     theme" is one value, not four rules to keep in step.

     --fn-header-wash is the tinted light that used to be the problem. In
     Light it is `none`: green is the brand's ACCENT — the rule under the
     header, an active chip, a focus ring — not the colour of the furniture.
     Dark keeps a whisper of it because a pure black band with no light in
     it looks switched off rather than dark. */
  --fn-header-bg:     var(--fn-gray-0);
  --fn-header-wash:   none;
  --fn-nav-bg:        var(--fn-gray-0);
  --fn-rail-bg:       #FAFBFA;
  --fn-header-border: var(--fn-gray-200);
  --fn-header-shadow: 0 1px 0 rgba(14, 20, 16, 0.04), 0 6px 22px -18px rgba(14, 20, 16, 0.22);

  /* The brand signature under the header: Udi's "פס דק ירוק ויבינו שזה
     פאנדר". One deliberate green line, 1px, instead of a green field.

     Udi removed the decorative gradients, so this is now one flat green
     line edge to edge rather than a swatch that fades into the page. A
     fading line reads as an effect; a solid one reads as a rule. */
  --fn-header-rule-h: 1px;
  --fn-header-rule:   var(--fn-interactive);
  --fn-header-rule-opacity: 1;

  /* Logo swap — see fn/02-header.css.
     Light header is green: funder-logo-light (dark slogan) is the interim
     asset. Wordmark green-on-green is weak until a dedicated asset exists. */
  --fn-logo-light-display: block;
  --fn-logo-dark-display:  none;

  /* ---------------------------------------------------------------- 2.2
     STICKY TABLE HEADER — the surface of the header copy and of the cap
     that fills the strip between the chrome and the stuck header, so rows
     never show through above it. It is the table's own surface. */
  --fn-sticky-head-bg: var(--fn-bg-surface);

  /* ---------------------------------------------------------------- 2.3
     PAGE TITLE — the one H1 of a list or static page, with the brand bar
     in front of it (the same green bar as the home-page section heads).
     Fluid between 21px and 25px (25px from 1316px up), so an <h1> title
     is 21px on a phone. --fn-page-title-size-compact is the one step down
     the list grid takes at 768px and below for a title that is not an
     <h1> (and the legacy h1#LookForTitle2). The bar is a vertical blend
     from the accent to the brand green; the rule (fn/38-page-title.css)
     composes it, these are its two colours. */
  --fn-page-title-size:    clamp(21px, 1.9vw, 25px);
  --fn-page-title-size-compact: var(--fn-fs-xl);
  --fn-page-title-leading: 1.32;
  --fn-page-title-weight:  var(--fn-fw-bold);
  --fn-page-title-color:   var(--fn-text-1);
  --fn-page-title-bar-top:   var(--fn-green-400);
  --fn-page-title-bar-color: var(--fn-brand);
  --fn-page-title-bar-w:   4px;
  --fn-page-title-bar-h:   0.95em;
  --fn-page-title-bar-gap: 10px;

  /* ---------------------------------------------------------------- 2.4
     CHART SERIES — the categorical palette every chart draws its Nth
     series with (the compare chart in fn-list.js, the bank deposit /
     credit / loan / prime-period charts, the markets charts). Read in
     order from 1 until a name comes back empty (fn-chart-skin.js). One
     palette for every theme: each hue was chosen to hold on the light card
     and on the dark one, so no theme restates it. */
  --fn-chart-1:  #2F9E5B;
  --fn-chart-2:  #3B82F6;
  --fn-chart-3:  #F59E0B;
  --fn-chart-4:  #E0457B;
  --fn-chart-5:  #8B5CF6;
  --fn-chart-6:  #0EA5B7;
  --fn-chart-7:  #EF4444;
  --fn-chart-8:  #84CC16;
  --fn-chart-9:  #F97316;
  --fn-chart-10: #64748B;
  --fn-chart-11: var(--fn-amber-500);
  --fn-chart-12: #0EA5E9;
  --fn-chart-13: #EC4899;
}


/* ==========================================================================
   1.11a  PHONE CHROME
   --------------------------------------------------------------------------
   On a phone the site bar pins (fn-header-sticky.js) and the tools drop
   under it by their own gap.
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --fn-chrome-bar:       var(--fn-sticky-offset, var(--fn-chrome-bar-est));
    --fn-chrome-tools-top: var(--fn-chrome-tools-gap);
  }
}


/* ==========================================================================
   1.10  DESKTOP MEASURE
   --------------------------------------------------------------------------
   Sharper corners from the laptop breakpoint up. Phones keep the rounder
   scale: this query never matches them. On desktop every corner uses ONE
   radius — --fn-radius-desktop, set to match the table (the smallest
   shape on the page). Change that single number and every component
   follows; no component carries its own desktop radius.
   Container widths stay on the steps the site already used.
   ========================================================================== */

@media (min-width: 768px) {
  :root { --fn-container-max: 750px; }
}

@media (min-width: 992px) {
  :root {
    --fn-container-max: 970px;

    /* The one desktop radius — equals the table corner. */
    --fn-radius-desktop: 6px;

    --fn-radius-sm: var(--fn-radius-desktop);
    --fn-radius-md: var(--fn-radius-desktop);
    --fn-radius-lg: var(--fn-radius-desktop);
    --fn-radius-compact: var(--fn-radius-desktop);
    --fn-bubble-radius: var(--fn-radius-desktop);
    --fn-bubble-radius-sm: var(--fn-radius-desktop);
    --fn-bubble-media-radius: var(--fn-radius-desktop);
    --fn-radius-table: var(--fn-radius-desktop);
    --fn-radius-sheet: var(--fn-radius-desktop);
    --fn-radius-hero: var(--fn-radius-desktop);
    --fn-radius-nav: var(--fn-radius-desktop);
    --fn-radius-filter: var(--fn-radius-desktop);
    --fn-radius-field: var(--fn-radius-desktop);
    --fn-radius-card: var(--fn-radius-desktop);

    --fn-rail-gap: 8px;
    --fn-rail-pad: 6px;
  }
}

@media (min-width: 1200px) {
  :root { --fn-container-max: 1170px; }
}

@media (min-width: 1440px) {
  :root {
    --fn-container-max: 1366px;
    /* The rail gap is a minimum: justify-content: space-between shares the
       leftover equally, so the chips still sit ~8px apart. 10px stopped the
       16 chips fitting once the label went to 13px (02-header.css). */
    --fn-rail-gap: 6px;
    --fn-rail-pad: 8px;
  }
}


/* ==========================================================================
   3. SEMANTIC TOKENS — DARK
   --------------------------------------------------------------------------
   Two entry points, in this precedence order:
     a. [data-fn-theme="dark"]  — explicit user choice, always wins
     b. prefers-color-scheme    — OS preference, only when the user has not
                                  explicitly chosen light
   Light stays the product default: an OS-level dark preference alone must not
   flip a user into a theme the rest of the site does not support yet.

   Principles applied here:
     - canvas is #0B0F0C, not #000. Pure black causes halation on Hebrew,
       which carries more ink per glyph than Latin.
     - depth comes from BORDER, not shadow. Shadows do not read on dark.
     - the greens move DOWN the ramp (700 -> 400), because a green that is
       readable on white is invisible on near-black.
   ========================================================================== */

:root[data-fn-theme="dark"] {
  color-scheme: dark;

  --fn-bg-canvas:  var(--fn-gray-950);
  --fn-bg-surface: #121713;
  --fn-bg-raised:  #181E19;
  --fn-bg-sunken:  #080B09;
  --fn-bg-hover:   #1D241E;
  --fn-bg-active:  #242C25;

  /* Bubble surface — Dark.
     The canvas drops below --fn-bg-canvas and the bubble rises above it, so
     the two separate by luminance the way they do in Light by hairline. The
     texture is drawn in light ink at a low opacity: enough to feel like a
     surface, far too quiet to compete with 15:1 body text on the bubble. */
  --fn-bubble-canvas: #070A08;
  --fn-bubble-bg:     #151B16;
  --fn-bubble-bg-press: #1E2620;
  --fn-bubble-border: #2C352E;
  --fn-bubble-shadow: none;
  /* The phone layer wants no shadow on a near-black canvas, but the desktop
     card still has to sit above the page at 1440 where there is far more
     open ground around it. Soft, black, and only visible at the corners. */
  --fn-bubble-lift:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 8px 20px -12px rgba(0, 0, 0, 0.65);
  --fn-bubble-media-bg: var(--fn-bubble-bg);
  --fn-bubble-skeleton: #1E2620;
  /* Light enough to read as drawn on the surface, desaturated enough not to
     read as illustration laid over it. */
  --fn-canvas-pattern-opacity: 0.045;
  --fn-canvas-pattern-ink: #A9D694;
  --fn-canvas-image: url("../../img/bg/fn-canvas-dark.jpg");
  --fn-canvas-color: #100F0F;

  --fn-text-1: #E8EDE9;              /* 15.3:1 on --fn-bg-surface */
  --fn-text-2: #9AA69C;              /*  7.2:1 */
  --fn-text-3: #79857B;              /*  4.6:1 */
  --fn-text-inverse:  var(--fn-gray-900);
  --fn-text-on-brand:    #0E1410;    /* on a bright green button fill */
  --fn-on-brand-surface: #E8EDE9;    /* on the near-black nav band      */
  --fn-on-brand-muted:   #9AA69C;

  --fn-border:        #252C26;
  --fn-border-strong: #333C34;
  --fn-border-brand:  var(--fn-green-400);

  /* Dark: accent is #67cb35 on dark surfaces. Header stays dark — green is
     accent only, not a full chrome fill. */
  --fn-brand:          var(--fn-green-400);
  --fn-brand-hover:    var(--fn-green-300);
  --fn-brand-surface:  #1A2418;
  --fn-brand-surface-hover: #24302A;
  --fn-accent:         var(--fn-green-400);
  --fn-accent-hover:   var(--fn-green-300);
  --fn-on-accent:      #0E1410;
  --fn-brand-soft:     #172016;

  /* Interaction — Dark is where the approved green came from, so text takes
     it unchanged: #67cb35 on the #0B0F0C canvas is 9.4:1. */
  --fn-canvas-pattern-opacity-desktop: 0.022;

  --fn-interactive:       #67cb35;
  --fn-interactive-ink:   #67cb35;
  --fn-interactive-press: var(--fn-green-300);
  --fn-interactive-wash:  rgba(103, 203, 53, 0.14);
  --fn-interactive-line:  rgba(103, 203, 53, 0.46);
  --fn-on-interactive:    #0E1410;

  --fn-up:      var(--fn-up-300);
  --fn-up-bg:   #10241A;
  --fn-down:    var(--fn-down-300);
  --fn-down-bg: #2A1414;
  --fn-neutral: var(--fn-text-2);
  --fn-market-up:   var(--fn-up);
  --fn-market-down: var(--fn-down);

  --fn-focus:        var(--fn-green-300);
  --fn-focus-invert: var(--fn-gray-950);

  --fn-field-bg:          #181E19;
  --fn-field-border:      #333C34;
  --fn-field-text:        var(--fn-text-1);
  --fn-field-placeholder: #8B968D;
  --fn-field-bg-hover:    #1D241E;

  /* Controls rise one step off the surface; hover is a clear step above
     that (#1D241E, the old hover, was 1.1:1 against the rest fill and could
     not be seen), with an edge that brightens with it. */
  --fn-control-bg:           var(--fn-bg-raised);
  --fn-control-bg-hover:     #2F3A31;
  --fn-control-border-hover: #56645A;
  --fn-fab-shadow:           0 10px 28px -10px rgba(0, 0, 0, 0.65);

  --fn-shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.5);
  --fn-shadow-md:  0 2px 8px rgba(0, 0, 0, 0.55);
  --fn-shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.65);

  /* Header — Dark. Three near-black bands that separate from each other by
     value alone.

     --fn-header-wash used to be two radial blooms: a green one top-right-of-
     centre and a BLUE one at the far side, to make the band read as "lit".
     Both are gone. Udi's dark mode is black, greys, white and the one green,
     and a blue bloom was neither on that list nor defensible as data. The
     bands now separate the way the rest of the dark theme does — one step of
     grey each — and the green appears on the 1px rule underneath, which is a
     signature rather than an effect. */
  --fn-header-bg:     var(--fn-bg-surface);
  --fn-header-wash:   none;
  --fn-nav-bg:        var(--fn-bg-sunken);
  --fn-rail-bg:       var(--fn-bg-surface);
  --fn-header-border: var(--fn-border);
  --fn-header-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  --fn-header-rule:   var(--fn-interactive);
  --fn-header-rule-opacity: 0.55;

  --fn-logo-light-display: none;
  --fn-logo-dark-display:  block;
}


/* ==========================================================================
   3b. SEMANTIC TOKENS — SOFT (ירקרק)
   --------------------------------------------------------------------------
   Light ink and chrome on a mint-tinted canvas: third stop of the header
   theme button (light → dark → soft). Only surfaces and lines move; text,
   brand and data colours inherit from Light and keep their AA ratios
   (--fn-text-3 is ~5.2:1 on this canvas).
   ========================================================================== */

:root[data-fn-theme="soft"] {
  --fn-bg-canvas:  #E4EFDE;
  --fn-bg-surface: #F6FBF3;
  --fn-bg-raised:  #FBFDF9;
  --fn-bg-sunken:  #DAE8D2;
  --fn-bg-hover:   #E9F3E3;
  --fn-bg-active:  #D4E4CB;

  --fn-border:        #D2E0CA;
  --fn-border-strong: #BCCDB2;

  /* Bubble surface — Soft (ירקרק). This is the theme that carries the
     branded wallpaper: a mint canvas a step deeper than --fn-bg-canvas so the
     near-white bubbles detach from it cleanly, and the FUNDER texture drawn
     in a deep green at a weight that survives on the canvas but never shows
     through a bubble. Text is never set on this canvas — it lives on the
     bubbles — so the pattern cannot cost a contrast ratio. */
  --fn-bubble-canvas: #DBEBD2;
  --fn-bubble-bg:     #FBFDF9;
  --fn-bubble-bg-press: #EFF7EA;
  --fn-bubble-border: #CADCC0;
  --fn-bubble-shadow: 0 1px 2px rgba(31, 66, 16, 0.06);
  --fn-bubble-lift: 0 1px 2px rgba(31, 66, 16, 0.06);
  --fn-bubble-media-bg: var(--fn-bubble-bg);
  --fn-bubble-skeleton: #E8F2E2;
  --fn-canvas-pattern-opacity: 0.075;
  --fn-canvas-pattern-ink: #2F6419;
  --fn-canvas-image: url("../../img/bg/fn-canvas-soft.jpg");
  --fn-canvas-color: #68CD53;

  /* Ink for the few labels that sit straight on this saturated canvas
     (ticker, section headers, page intros). The bubble greys and the market
     greens/reds drop to ~3:1 here; these clear 5:1 against #68CD53. */
  --fn-on-canvas-ink:  #1F3A14;
  --fn-on-canvas-up:   #0B4A1E;
  --fn-on-canvas-down: #7F1717;
  /* Rest and hover ink are both the on-canvas ink on this wallpaper, so a
     text control standing on it lights this pale backing on hover instead
     (00-page.css). */
  --fn-on-canvas-hover-bg: rgba(255, 255, 255, 0.55);

  /* Header — Soft. Mint furniture rather than white, so the header belongs
     to the same room as the wallpaper under it; still no bloom, because the
     canvas is already the green in this theme. */
  --fn-header-bg:     var(--fn-bg-surface);
  --fn-header-wash:   none;
  --fn-nav-bg:        var(--fn-bg-surface);
  --fn-rail-bg:       #EDF6E8;
  --fn-header-border: #CADCC0;
  --fn-header-shadow: 0 1px 0 rgba(31, 66, 16, 0.05), 0 6px 22px -18px rgba(31, 66, 16, 0.22);

  --fn-brand-soft:     #DDF0D2;
  --fn-field-bg-hover: #F6FBF3;

  /* Light brand (#3B7E1F) is 4.2:1 on this mint canvas. One step deeper
     still carries white text on a fill and clears 4.5:1 as text. */
  --fn-brand:          var(--fn-green-800);
  --fn-brand-hover:    var(--fn-green-900);

  /* Interaction — the indicator green is unchanged; text goes one step
     deeper than Light because the canvas here is mint, not white
     (#2F6419 is 5.69:1 on the canvas and 6.92:1 on a card). */
  --fn-canvas-pattern-opacity-desktop: 0.038;

  --fn-interactive:       #67cb35;
  --fn-interactive-ink:   var(--fn-green-800);
  --fn-interactive-press: var(--fn-green-900);
  --fn-interactive-wash:  rgba(103, 203, 53, 0.14);
  --fn-interactive-line:  rgba(47, 100, 25, 0.38);
  --fn-on-interactive:    #0E1410;
}


/* ==========================================================================
   3c. SEMANTIC TOKENS — CLASSIC (קלאסי)
   --------------------------------------------------------------------------
   The old FUNDER beige (#fefaf0) as the canvas, with the existing financial
   wallpaper tinted onto it. Bubbles, type and interaction green stay in the
   2027 language. Table stripes keep the familiar cream (#f9f1e1 / #f2e7d1).
   ========================================================================== */

:root[data-fn-theme="classic"] {
  color-scheme: light;

  --fn-bg-canvas:  #fefaf0;
  --fn-bg-surface: #FFFEFA;
  --fn-bg-raised:  #FFFFFF;
  --fn-bg-sunken:  #f9f1e1;
  --fn-bg-hover:   #f9f1e1;
  --fn-bg-active:  #f1e5cd;

  --fn-bubble-canvas: #fefaf0;
  --fn-bubble-bg:     #FFFEFA;
  --fn-bubble-bg-press: #f9f1e1;
  --fn-bubble-border: #f2e7d1;
  --fn-bubble-shadow:
    0 1px 2px rgba(80, 60, 20, 0.05),
    0 6px 16px -10px rgba(80, 60, 20, 0.12);
  --fn-bubble-lift:
    0 1px 2px rgba(80, 60, 20, 0.05),
    0 6px 16px -10px rgba(80, 60, 20, 0.12);
  --fn-bubble-media-bg: var(--fn-bubble-bg);
  --fn-bubble-skeleton: #f9f1e1;

  --fn-canvas-image: url("../../img/bg/fn-canvas-light.jpg");
  --fn-canvas-color: #fefaf0;
  --fn-canvas-blend: multiply;
  --fn-canvas-pattern-opacity: 0.05;
  --fn-canvas-pattern-ink: #6B5A3A;
  --fn-canvas-pattern-opacity-desktop: 0.02;

  --fn-text-1: #1A140C;
  --fn-text-2: #5C5346;
  --fn-text-3: #6E6558;
  --fn-text-inverse: #FFFEFA;
  --fn-text-on-brand: #FFFEFA;
  --fn-on-brand-surface: #1A140C;
  --fn-on-brand-muted: #3A3226;

  --fn-border:        #f2e7d1;
  --fn-border-strong: #e6d5b4;
  --fn-border-brand:  var(--fn-green-400);

  --fn-brand:          var(--fn-green-700);
  --fn-brand-hover:    var(--fn-green-800);
  --fn-brand-surface:  var(--fn-green-500);
  --fn-brand-surface-hover: var(--fn-green-600);
  --fn-accent:         var(--fn-green-400);
  --fn-accent-hover:   var(--fn-green-500);
  --fn-on-accent:      #0E1410;
  --fn-brand-soft:     #f9f1e1;

  --fn-interactive:       #67cb35;
  --fn-interactive-ink:   var(--fn-green-700);
  --fn-interactive-press: var(--fn-green-600);
  --fn-interactive-wash:  rgba(103, 203, 53, 0.10);
  --fn-interactive-line:  rgba(103, 203, 53, 0.42);
  --fn-on-interactive:    #0E1410;

  --fn-up:      var(--fn-up-500);
  --fn-up-bg:   #E8F5EC;
  --fn-down:    var(--fn-down-500);
  --fn-down-bg: #FCEBEB;
  --fn-neutral: var(--fn-text-2);
  --fn-market-up:   var(--fn-up);
  --fn-market-down: var(--fn-down);

  --fn-focus:        var(--fn-green-600);
  --fn-focus-invert: #FFFEFA;
  --fn-field-bg:          #FFFFFF;
  --fn-field-border:      #e6d5b4;
  --fn-field-text:        var(--fn-text-1);
  --fn-field-placeholder: #6E6558;
  --fn-field-bg-hover:    #fefaf0;

  --fn-header-bg:     #fefaf0;
  --fn-header-wash:   none;
  --fn-nav-bg:        #fefaf0;
  --fn-rail-bg:       #f9f1e1;
  --fn-header-border: #f2e7d1;
  --fn-header-shadow: 0 1px 0 rgba(80, 60, 20, 0.06), 0 6px 22px -18px rgba(80, 60, 20, 0.18);
  --fn-header-rule:   var(--fn-interactive);
  --fn-header-rule-opacity: 1;

  --fn-logo-light-display: block;
  --fn-logo-dark-display:  none;
}


/* ==========================================================================
   3d. SEMANTIC TOKENS — WHITE (לבן נקי)
   --------------------------------------------------------------------------
   The Light theme with the wallpaper taken away: a plain, neutral white page
   for readers who find the illustrated background distracting. Everything
   else — text, brand, data colours, header, bubbles — is inherited from
   Light unchanged, so contrast ratios are exactly Light's. Only the ground
   moves: no tile image, no pattern, pure #FFFFFF behind the cards.

   With no texture showing through the gaps, the cards are separated by the
   hairline and shadow they already carry (--fn-bubble-border / -lift).
   ========================================================================== */

:root[data-fn-theme="white"] {
  color-scheme: light;

  /* The list pages and other reading surfaces paint --fn-bg-canvas as their
     ground; in Light that is a pale green, which would show as a tinted block
     on a white page. */
  --fn-bg-canvas: #FFFFFF;
  --fn-canvas-image: none;
  --fn-canvas-color: #FFFFFF;
  --fn-canvas-blend: normal;
  --fn-canvas-pattern-opacity: 0;
  --fn-canvas-pattern-opacity-desktop: 0;
  --fn-bubble-canvas: #FFFFFF;

  /* Slightly firmer hairline than Light: Light leans on the wallpaper to
     show where a card ends; here the edge has to do it alone. */
  --fn-bubble-border: #DDE2DB;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-fn-theme="light"]):not([data-fn-theme="dark"]) {
    /* Intentionally empty for now.
       Light is the shipped default until every component supports dark.
       When we are ready to honour the OS preference, this block receives the
       same declarations as [data-fn-theme="dark"] above — that is the only
       change required, nothing else in the codebase moves. */
  }
}


/* ==========================================================================
   4. BRIDGE: the existing accessibility high-contrast mode
   --------------------------------------------------------------------------
   acc_box.js puts .darkCont / .brightCont on `body, div, iframe` with a large
   set of !important rules in template.css. That is a WCAG high-contrast mode,
   not a design theme, and it must keep winning — a user who asked for maximum
   contrast gets maximum contrast, not our palette.

   Rather than fight it, we collapse our tokens to the same pure black/white
   values it uses, so the two systems agree instead of layering.
   ========================================================================== */

body.darkCont {
  /* The control tokens are aliases; restated here so they resolve against
     this block's colours (a value aliased on :root would keep the theme's). */
  --fn-control-bg:           var(--fn-bg-surface);
  --fn-control-border:       var(--fn-border);
  --fn-control-bg-hover:     var(--fn-bg-hover);
  --fn-control-border-hover: var(--fn-border-strong);
  --fn-bg-canvas:  #000000;
  --fn-bg-surface: #000000;
  --fn-bg-raised:  #000000;
  --fn-bg-sunken:  #000000;
  --fn-bg-hover:   #1A1A1A;
  --fn-bg-active:  #262626;

  /* High-contrast mode owns the surface: bubbles collapse to a white outline
     on black and the wallpaper is switched off entirely. */
  --fn-bubble-canvas: #000000;
  --fn-bubble-bg:     #000000;
  --fn-bubble-bg-press: #1A1A1A;
  --fn-bubble-border: #FFFFFF;
  --fn-bubble-shadow: none;
  /* no lift in this theme — a TRANSPARENT shadow, not `none`,
     so the hairline beside it in the same list survives. */
  --fn-bubble-lift: 0 0 0 0 rgba(0, 0, 0, 0);
  --fn-bubble-media-bg: #000000;
  --fn-bubble-skeleton: #000000;
  --fn-canvas-pattern-opacity: 0;
  --fn-canvas-image: none;
  --fn-canvas-color: #000000;

  --fn-header-bg:     #000000;
  --fn-header-wash:   none;
  --fn-nav-bg:        #000000;
  --fn-rail-bg:       #000000;
  --fn-header-border: #FFFFFF;
  --fn-header-shadow: none;
  --fn-header-rule:   #FFFFFF;
  --fn-header-rule-opacity: 1;

  --fn-text-1: #FFFFFF;
  --fn-text-2: #FFFFFF;
  --fn-text-3: #FFFFFF;
  --fn-text-on-brand:    #000000;
  --fn-on-brand-surface: #FFFFFF;
  --fn-on-brand-muted:   #FFFFFF;

  --fn-border:        #FFFFFF;
  --fn-border-strong: #FFFFFF;
  --fn-border-brand:  #FFFFFF;

  --fn-brand:         #FFFFFF;
  --fn-brand-hover:   #FFFFFF;
  --fn-brand-surface: #000000;
  --fn-brand-surface-hover: #1A1A1A;
  --fn-accent:        #FFFFFF;
  --fn-on-accent:     #000000;
  --fn-brand-soft:    #000000;

  /* The approved green does not survive high-contrast mode; the interaction
     signal becomes pure white, and weight still carries the active state. */
  --fn-interactive:       #FFFFFF;
  --fn-interactive-ink:   #FFFFFF;
  --fn-interactive-press: #FFFFFF;
  --fn-interactive-wash:  #000000;
  --fn-interactive-line:  #FFFFFF;
  --fn-on-interactive:    #000000;

  /* The focus ring follows the interaction signal: a green ring on pure
     black is the one colour this mode removes everywhere else. */
  --fn-focus:        #FFFFFF;
  --fn-focus-invert: #000000;

  --fn-up:   #FFFFFF;
  --fn-down: #FFFFFF;
  /* The change pills paint white text on these, so the light tint
     backgrounds would leave them unreadable. */
  --fn-up-bg:   #000000;
  --fn-down-bg: #000000;
  --fn-market-up:   var(--fn-up);
  --fn-market-down: var(--fn-down);

  --fn-field-bg:          #000000;
  --fn-field-border:      #FFFFFF;
  --fn-field-text:        #FFFFFF;
  --fn-field-placeholder: #FFFFFF;

  --fn-shadow-sm: none;
  --fn-shadow-md: none;

  --fn-logo-light-display: none;
  --fn-logo-dark-display:  block;
}

body.brightCont {
  /* The control tokens are aliases; restated here so they resolve against
     this block's colours (a value aliased on :root would keep the theme's). */
  --fn-control-bg:           var(--fn-bg-surface);
  --fn-control-border:       var(--fn-border);
  --fn-control-bg-hover:     var(--fn-bg-hover);
  --fn-control-border-hover: var(--fn-border-strong);
  --fn-bg-canvas:  #FFFFFF;
  --fn-bg-surface: #FFFFFF;
  --fn-bg-raised:  #FFFFFF;
  --fn-bg-sunken:  #FFFFFF;
  --fn-bg-hover:   #E8E8E8;
  --fn-bg-active:  #D0D0D0;

  --fn-bubble-canvas: #FFFFFF;
  --fn-bubble-bg:     #FFFFFF;
  --fn-bubble-bg-press: #E8E8E8;
  --fn-bubble-border: #000000;
  --fn-bubble-shadow: none;
  /* no lift in this theme — a TRANSPARENT shadow, not `none`,
     so the hairline beside it in the same list survives. */
  --fn-bubble-lift: 0 0 0 0 rgba(0, 0, 0, 0);
  --fn-bubble-media-bg: #FFFFFF;
  --fn-bubble-skeleton: #FFFFFF;
  --fn-canvas-pattern-opacity: 0;
  --fn-canvas-image: none;
  --fn-canvas-color: #FFFFFF;

  --fn-header-bg:     #FFFFFF;
  --fn-header-wash:   none;
  --fn-nav-bg:        #FFFFFF;
  --fn-rail-bg:       #FFFFFF;
  --fn-header-border: #000000;
  --fn-header-shadow: none;
  --fn-header-rule:   #000000;
  --fn-header-rule-opacity: 1;

  --fn-text-1: #000000;
  --fn-text-2: #000000;
  --fn-text-3: #000000;
  --fn-text-on-brand:    #FFFFFF;
  --fn-on-brand-surface: #000000;
  --fn-on-brand-muted:   #000000;

  --fn-border:        #000000;
  --fn-border-strong: #000000;
  --fn-border-brand:  #000000;

  --fn-brand:         #000000;
  --fn-brand-hover:   #000000;
  --fn-brand-surface: #FFFFFF;
  --fn-brand-surface-hover: #E8E8E8;
  --fn-accent:        #000000;
  --fn-on-accent:     #FFFFFF;
  --fn-brand-soft:    #FFFFFF;

  /* Same bridge as .darkCont, inverted: the signal is pure black. */
  --fn-interactive:       #000000;
  --fn-interactive-ink:   #000000;
  --fn-interactive-press: #000000;
  --fn-interactive-wash:  #FFFFFF;
  --fn-interactive-line:  #000000;
  --fn-on-interactive:    #FFFFFF;

  --fn-focus:        #000000;
  --fn-focus-invert: #FFFFFF;

  --fn-up:   #000000;
  --fn-down: #000000;
  --fn-up-bg:   #FFFFFF;
  --fn-down-bg: #FFFFFF;
  --fn-market-up:   var(--fn-up);
  --fn-market-down: var(--fn-down);

  --fn-field-bg:          #FFFFFF;
  --fn-field-border:      #000000;
  --fn-field-text:        #000000;
  --fn-field-placeholder: #000000;

  --fn-shadow-sm: none;
  --fn-shadow-md: none;

  --fn-logo-light-display: block;
  --fn-logo-dark-display:  none;
}

/* Role tokens that alias a semantic one resolve on :root, before the two
   bridges above redefine the semantic one on <body>. Restated once for
   both, so they resolve again against the high-contrast values. */
body.darkCont,
body.brightCont {
  --fn-sticky-head-bg:       var(--fn-bg-surface);
  --fn-page-title-color:     var(--fn-text-1);
  --fn-page-title-bar-color: var(--fn-brand);
}
