/**!
 * @file    sw_palette.css
 * @desc    THE color settings for the students site: every color the stylesheets use comes from here, by job (page,
 *          card, line, text, button fill, success, ...), never as a written-in value. Loaded first by every page head
 *          (LookAndFeel*.shtml), so all stylesheets can use var(--c-...).
 *          Three palettes:
 *            - light (the default, :root);
 *            - dark "near-black" (html[data-theme="dark"]), the owner's chosen dark palette;
 *            - dark "navy" (html[data-theme="dark"][data-dark-palette="navy"]), kept as an alternative (owner 2026-11-22:
 *              "i like both the dark color palettes ... lets not lose those settings").
 *          To change a color everywhere, change it here. Dark mode itself is switched on per site in Site Settings
 *          (students_dark_mode_enabled) and picked per student (ThemeBoot.php).
 *          Shadows: rgba(var(--c-shadow-rgb), <strength>) so their tint follows the palette.
 * @version v7 2026-11-22 - Initial version (palette centralization, option B: ~40 colors by job; light values taken from
 *          the existing brand colors, near-duplicate greys merged; both dark palettes from the dark mode trial).
 * @version v7 2026-11-23 - New roles so large navy areas stay deep in dark mode (in light they are the same navy as
 *          before): band / band-2 (panel title bars, game bars, help drawer head), footer, bubble (own chat bubbles,
 *          flash card fronts, card top strips); danger / danger-hover (delete buttons: a fill, not the error text color).
 * @version v7 2026-11-23 - Role audit (every use checked against its job): fills that carry white text get their own
 *          roles (success-fill, warn-fill, link-fill, neutral-fill, brand-deeper), plus tip (tooltip bubbles) and
 *          line-ink (the darkest rules on older pages). Light values unchanged; dark values chosen by measured contrast.
 *          The light teal tints are now exactly the values the site showed (they were mixed in sw_common.css before).
 * @version v7 2026-11-23 - Role audit, second pass: --c-accent-fill (deep coral fill with white text).
 * @version v7 2026-11-23 - Step 3 (colors in PHP pages and scripts): --c-rt-red / green / gray / black / white (the
 *          editor's other text colors, read by the shared RichText.css), --c-word-new / --c-word-learning (a word's study
 *          state in the study deck), --c-usage-common / uncommon / rare (the word usage pills, white text).
 * @version v7 2026-11-23 - --c-gold-fill: the spark gold as a fill with white text (same gold in light; deeper in
 *          dark, 4.0:1, where --c-gold turns lighter for text).
 * @version v7 2026-11-23 - --c-avatar-1 … 10: the message avatar colors (were a list written into apiinc_Message.php).
 * @version v7 2026-11-23 - --c-fill-text: the fill blue as text (outlined / white buttons, "more" links). Same navy in
 *          light; a lighter blue in dark, where the fill itself (#3a73d8) was too dark to read on the cards (owner).
 * @version v7 2026-11-23 - Comment contrast: --c-placeholder (hint text in empty boxes: the same coral in light, a
 *          light coral in dark, 7.2:1; the coral hover was 3.9), --c-field-line (a soft text box's
 *          edge, 3:1 in dark), --c-inset-card / --c-inset-line (a card inside a card: the comment
 *          list). Dark --c-text-mute #8a99ae (was #7f8ea3, under 4.5:1 on navy and on inset cards).
 * @version v7 2026-11-23 - --c-coral-text: the coral hover as text (same in light; a light coral in dark, where the
 *          hover coral read 3.2 to 3.9:1).
 * @version v7 2026-11-23 - --c-hover-wash / --c-hover-wash-soft: hover backgrounds (= tint-2 / tint-1 in light;
 *          visible in dark, owner: the Add to deck hover was very faint).
 * @author  Charlie Samra
 * @see     ThemeBoot.php (light / dark, which dark palette), js/ThemeBootStatic.js + css/ErrorPage.css (the standalone pages)
 */

/* ---- LIGHT (default) ------------------------------------------------------------------------------------------- */
:root {
    /* surfaces */
    --c-page:         #f5fcfc;   /* behind the cards, every page */
    --c-surface:      #ffffff;   /* cards, panels, menus, inputs */
    --c-surface-2:    #f5f8fa;   /* quiet boxes inside a card, off-white rows */
    --c-surface-3:    #e9ecef;   /* light grey fills: chips, disabled, tracks */
    --c-tint-1:       #f5fcfc;   /* faintest teal wash: hovers (= 4% logo teal on white) */
    --c-tint-2:       #e8f9f8;   /* pale teal: selected items, pills (= 9% logo teal on white) */
    --c-hover-wash:      #e8f9f8;   /* hover background of buttons, links and options (= --c-tint-2 in light) */
    --c-hover-wash-soft: #f5fcfc;   /* hover background of list rows and cards (= --c-tint-1 in light) */
    --c-tint-3:       #d1f2f1;   /* light teal: borders on the pale tints (= 18% logo teal on white) */

    /* lines */
    --c-line-faint:   #eef2ef;   /* dividers inside a card */
    --c-line:         #e0e8e3;   /* card and panel borders */
    --c-line-strong:  #cccccc;   /* form fields, tables, stronger rules */
    --c-field-line:   #e0e8e3;   /* the edge of a soft text box (lesson comment box); kept visible in dark */
    --c-inset-card:   #ffffff;   /* a card inside a card (a comment in the lesson's comment list) */
    --c-inset-line:   #e2e5e3;   /* its edge and inner dividers */
    --c-placeholder:  #e63c4b;   /* hint text in an empty box (coral, every input) */
    --c-coral-text:   #e63c4b;   /* the coral hover as TEXT (link / button hovers, eyebrow labels, Samraisms "?") */
    --c-line-bold:    #999999;   /* darker grey borders and rules (was #777 / #8c8b8b / #999)  */

    /* text */
    --c-text:         #0b2a66;   /* headings and body text (navy) */
    --c-text-strong:  #212529;   /* near-black text (was #000 / #212529 / #333 / #1f2937) */
    --c-text-soft:    #34405a;   /* intros, descriptions */
    --c-text-faint:   #4f5b6b;   /* labels, hints, meta */
    --c-text-mute:    #6c757d;   /* lightest readable grey: footnotes, captions */
    --c-text-pale:    #9aa6ae;   /* deliberately pale: disabled controls, placeholders, eyebrow labels, done steps */
    --c-on-fill:      #ffffff;   /* text and icons on a colored fill (buttons, bands, badges) */
    --c-on-fill-soft: rgba(255, 255, 255, 0.9);
    --c-on-fill-rgb:  255, 255, 255;   /* for see-through white on fills: rgba(var(--c-on-fill-rgb), 0.25) */

    /* brand */
    --c-brand:        #01b9af;   /* the logo teal: icons, accents, fills with white text */
    --c-brand-deep:   #007d80;   /* deep teal fills */
    --c-brand-text:   #006a71;   /* teal as text on white (readable) */
    --c-accent:       #ff4f5e;   /* coral: badges, highlights */
    --c-hover:        #e63c4b;   /* coral hover, every button */
    --c-accent-deep:  #c8323f;   /* small coral text on the coral tint */
    --c-accent-soft:  #ffe9eb;   /* coral tint: count badges */
    --c-fill:         #0b2a66;   /* navy fills: buttons (also their outline color when outlined) */
    --c-fill-text:    #0b2a66;   /* the fill's color as TEXT: outlined / white buttons, "more" links (= --c-fill in light) */
    --c-fill-2:       #12377f;   /* the button gradient end */
    --c-band:         #0b2a66;   /* large navy areas: side-panel title bars, game bars, help drawer head, message headers */
    --c-band-2:       #12377f;   /* their gradient end */
    --c-footer:       #0b2a66;   /* the page footer */
    --c-bubble:       #0b2a66;   /* the student's own chat bubbles, flash card fronts, the strip on top of page cards */
    --c-gold:         #f88a00;   /* the logo's spark gold */
    --c-gold-fill:    #f88a00;   /* the spark gold as a fill with white text (study deck "struggled", the "due" badge, the ready Vote button) */
    --c-link:         #007bff;   /* plain blue links / focus (older pages) */
    --c-black:        #000000;   /* backdrops behind photos and video (stays black in every palette) */

    /* status */
    --c-success:      #2e7a4a;
    --c-success-bg:   #e8f5ed;
    --c-warn:         #8a5200;   /* warning text (brown) */
    --c-warn-line:    #e6c765;
    --c-warn-bg:      #fff4cf;
    --c-error:        #c63838;
    --c-error-bg:     #fbe8e8;
    --c-mark:         rgba(255, 204, 0, 0.8);   /* highlighted words */

    /* status, more shades */
    --c-success-line: #b7dfc5;   /* pale green borders on success boxes */
    --c-error-line:   #f5c6cb;   /* pale red borders on error boxes, missed tiles */
    --c-error-deep:   #a32a1f;   /* dark red text in error boxes */

    /* fills that carry white text, one per job. The status colors above are TEXT colors: in dark mode they turn
       pale so they read on dark cards, so a filled button or banner uses its own fill role, which stays deep. */
    --c-success-fill: #2e7a4a;   /* filled success buttons / banners */
    --c-warn-fill:    #8a5200;   /* filled warning icons / buttons */
    --c-danger:       #c63838;   /* delete / remove buttons */
    --c-danger-hover: #a32a1f;   /* their hover, error table headings */
    --c-link-fill:    #007bff;   /* blue filled buttons, active page number, checked boxes (older Bootstrap-style parts) */
    --c-neutral-fill: #6c757d;   /* grey filled buttons */
    --c-neutral-fill-hover: #4f5b6b;
    --c-brand-deeper: #006a71;   /* the deepest teal, as a fill (hero gradient ends); --c-brand-text is the TEXT teal */
    --c-accent-fill:  #c8323f;   /* deep coral fill with white text ("live" voice button, "now" step pill); --c-accent-deep is the TEXT */

    /* tooltips and the strongest rules */
    --c-tip:          #212529;   /* tooltip bubbles and their arrows, keyboard keys (white text on it) */
    --c-line-ink:     #212529;   /* the darkest lines: black table rules and boxes on older pages */

    /* stars and achievements (ratings, games, "mastered") */
    --c-star:         #d4a017;
    --c-star-hover:   #e8b835;
    --c-star-bg:      #ffe89b;   /* "mastered" / perfect-score badges */
    --c-on-star:      #5a4300;   /* text on a star-colored fill */
    --c-mark-bg:      #fff3a3;   /* highlighted words, the crossword cursor */

    /* rich-text colors teachers can pick in the editor (.rt-*) */
    --c-rt-red:       #c0392b;
    --c-rt-green:     #1e7e34;
    --c-rt-blue:      #1565c0;
    --c-rt-orange:    #d35400;
    --c-rt-yellow:    #f5c518;
    --c-rt-purple:    #8e44ad;
    --c-rt-pink:      #d6336c;
    --c-rt-brown:     #8d5524;
    --c-rt-gray:      #6c757d;
    --c-rt-black:     #000000;   /* the editor's "Black": in dark mode it becomes the light text color */
    --c-rt-white:     #ffffff;

    /* search result icons by type */
    --c-cat-theme:    #8a5d12;
    --c-cat-vocab:    #8a3030;
    --c-cat-quiz:     #4b2e94;

    /* words: study state (study deck counts) and usage (the Common / Uncommon / Rare pills, white text on them) */
    --c-word-new:      #2b6cb0;
    --c-word-learning: #7a4fd0;
    --c-usage-common:  #01b9af;
    --c-usage-uncommon: #2b6cb0;
    --c-usage-rare:    #7a7f87;

    /* message avatars: each sender's initial on one of these (picked from the name), white text; the same in dark */
    --c-avatar-1:  #5b7c99;
    --c-avatar-2:  #7c5b99;
    --c-avatar-3:  #995b7c;
    --c-avatar-4:  #5b9979;
    --c-avatar-5:  #996b5b;
    --c-avatar-6:  #5b9999;
    --c-avatar-7:  #7d8a5b;
    --c-avatar-8:  #8a5b7d;
    --c-avatar-9:  #4f6e88;
    --c-avatar-10: #88634f;

    /* game status on a dark (navy) bar */
    --c-ok-on-fill:   #8ee0a8;
    --c-warn-on-fill: #ffd27a;
    /* shadows */
    --c-shadow-rgb:   20, 50, 30;
    /* generated by palette_rgb.py: numeric twins for see-through colors, rgba(var(--c-x-rgb), alpha) */
    --c-surface-rgb: 255, 255, 255;
    --c-page-rgb: 245, 252, 252;
    --c-text-rgb: 11, 42, 102;
    --c-text-strong-rgb: 33, 37, 41;
    --c-fill-rgb: 11, 42, 102;
    --c-brand-rgb: 1, 185, 175;
    --c-accent-rgb: 255, 79, 94;
    --c-hover-rgb: 230, 60, 75;
    --c-link-rgb: 0, 123, 255;
    --c-success-rgb: 46, 122, 74;
    --c-error-rgb: 198, 56, 56;
    --c-warn-line-rgb: 230, 199, 101;
    --c-star-rgb: 212, 160, 23;
    --c-mark-bg-rgb: 255, 243, 163;
    --c-line-strong-rgb: 204, 204, 204;
    --c-black-rgb: 0, 0, 0;
}

/* ---- DARK: near-black (the default dark palette) --------------------------------------------------------------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --c-page:         #0e1622;
    --c-surface:      #162131;
    --c-surface-2:    #1d2a3d;
    --c-surface-3:    #26354b;
    --c-tint-1:       #122130;
    --c-tint-2:       #15303a;
    --c-hover-wash:      #234858;   /* a clear teal lift on hover: 1.65:1 against the card (the tints were 1.0 to 1.2); fill-text on it 4.7 */
    --c-hover-wash-soft: #1d3646;   /* rows / cards: 1.3:1 */
    --c-tint-3:       #1f4550;

    --c-line-faint:   #223047;
    --c-line:         #2b3b52;
    --c-line-strong:  #3d5068;
    --c-field-line:   #5a7192;   /* 3:1 on the card */
    --c-inset-card:   #1d2a3d;   /* one step lighter than the card it sits on */
    --c-inset-line:   #3d5068;
    --c-placeholder:  #ff8a95;   /* light coral: 7.2:1 on the card (the coral hover was 3.9) */
    --c-coral-text:   #ff8a95;   /* 7.2:1 on the card, 5.9 on the coral-tinted eyebrow (the coral hover was 3.2 to 3.9) */
    --c-line-bold:    #56698a;

    --c-text:         #e4ebf5;
    --c-text-strong:  #f1f5fb;
    --c-text-soft:    #b9c5d6;
    --c-text-faint:   #95a3b8;
    --c-text-mute:    #8a99ae;   /* 5.6:1 on the card, 5.0 on an inset card and on navy (was #7f8ea3: 4.3 / 4.4) */
    --c-text-pale:    #5f6f86;
    --c-on-fill:      #ffffff;
    --c-on-fill-soft: rgba(255, 255, 255, 0.9);
    --c-on-fill-rgb:  255, 255, 255;   /* for see-through white on fills: rgba(var(--c-on-fill-rgb), 0.25) */

    --c-brand:        #01b9af;
    --c-brand-deep:   #0f9a93;
    --c-brand-text:   #4fd6cd;
    --c-accent:       #ff4f5e;
    --c-hover:        #e63c4b;
    --c-accent-deep:  #ff8a95;
    --c-accent-soft:  #3a1d24;
    --c-fill:         #3a73d8;   /* outline color on the dark cards; carries white text */
    --c-fill-text:    #8fb4f5;   /* the fill blue lightened for text: 7.8:1 on the near-black card, 7.0:1 on navy (#3a73d8 was 3.6 / 3.2) */
    --c-fill-2:       #275bb8;
    --c-band:         #16305f;
    --c-band-2:       #1d3d78;
    --c-footer:       #0a111b;
    --c-bubble:       #1f4a9a;
    --c-gold:         #f8a133;
    --c-gold-fill:    #b86e0c;
    --c-link:         #6ea8ff;
    --c-black:        #000000;

    --c-success:      #7fe0a8;
    --c-success-bg:   #143a2a;
    --c-warn:         #f3d27a;
    --c-warn-line:    #8a7330;
    --c-warn-bg:      #3a3215;
    --c-error:        #ff9a9a;
    --c-error-bg:     #3d1c20;
    --c-mark:         rgba(255, 204, 0, 0.35);

    --c-success-line: #2f5a40;
    --c-error-line:   #6a2e35;
    --c-error-deep:   #ff8f8f;

    /* fills with white text: each at least as readable as its light value (white on it 4.5:1 or more) */
    --c-success-fill: #2b7a4d;
    --c-warn-fill:    #9a6510;
    --c-danger:       #c0404a;
    --c-danger-hover: #a8323b;
    --c-link-fill:    #2f6fd6;
    --c-neutral-fill: #55657d;
    --c-neutral-fill-hover: #66789a;
    --c-brand-deeper: #0b6f6a;
    --c-accent-fill:  #c13a46;

    --c-tip:          #3b4d66;   /* a raised bubble, lighter than the cards so it stands out; white text 8.6:1 */
    --c-line-ink:     #7f8ea3;   /* strong but not glaring on the dark cards */

    --c-star:         #f0c040;
    --c-star-hover:   #f5d06a;
    --c-star-bg:      #4a3c12;
    --c-on-star:      #2b2000;
    --c-mark-bg:      #5a4a10;

    --c-rt-red:       #ff8a7a;
    --c-rt-green:     #6fd08f;
    --c-rt-blue:      #6aa8ff;
    --c-rt-orange:    #ff9a4d;
    --c-rt-yellow:    #f5d040;
    --c-rt-purple:    #c58be0;
    --c-rt-pink:      #ff7aa8;
    --c-rt-brown:     #d6a070;
    --c-rt-gray:      #9aa8bb;
    --c-rt-black:     #f1f5fb;
    --c-rt-white:     #ffffff;

    --c-cat-theme:    #e0b060;
    --c-cat-vocab:    #ff8a8a;
    --c-cat-quiz:     #b8a0ff;

    --c-word-new:      #7fb0f0;
    --c-word-learning: #b79af0;
    --c-usage-common:  #01b9af;
    --c-usage-uncommon: #2f66b8;
    --c-usage-rare:    #5f6b7a;

    --c-ok-on-fill:   #8ee0a8;
    --c-warn-on-fill: #ffd27a;
    --c-shadow-rgb:   0, 0, 0;
    /* generated by palette_rgb.py: numeric twins for see-through colors, rgba(var(--c-x-rgb), alpha) */
    --c-surface-rgb: 22, 33, 49;
    --c-page-rgb: 14, 22, 34;
    --c-text-rgb: 228, 235, 245;
    --c-text-strong-rgb: 241, 245, 251;
    --c-fill-rgb: 58, 115, 216;
    --c-brand-rgb: 1, 185, 175;
    --c-accent-rgb: 255, 79, 94;
    --c-hover-rgb: 230, 60, 75;
    --c-link-rgb: 110, 168, 255;
    --c-success-rgb: 127, 224, 168;
    --c-error-rgb: 255, 154, 154;
    --c-warn-line-rgb: 138, 115, 48;
    --c-star-rgb: 240, 192, 64;
    --c-mark-bg-rgb: 90, 74, 16;
    --c-line-strong-rgb: 61, 80, 104;
    --c-black-rgb: 0, 0, 0;
}

/* ---- DARK: navy (saved alternative; Site Setting students_dark_palette = navy, stamped by ThemeBoot.php) --------- */
html[data-theme="dark"][data-dark-palette="navy"] {
    --c-page:         #0f1d3a;
    --c-surface:      #18284a;
    --c-surface-2:    #203359;
    --c-surface-3:    #2a3f66;
    --c-tint-1:       #142a4a;
    --c-tint-2:       #15394f;
    --c-hover-wash:      #214a6a;
    --c-hover-wash-soft: #1b3a5c;
    --c-line-faint:   #253a62;
    --c-line:         #2f4675;
    --c-line-strong:  #3f5a8a;
    --c-field-line:   #5a76a8;
    --c-inset-card:   #203359;
    --c-inset-line:   #3f5a8a;
    --c-line-bold:    #5a74a6;
    --c-footer:       #0b1630;
    --c-text-pale:    #66789a;   /* the navy cards are a touch lighter: pale text keeps the near-black ratio (3.2:1) */
    /* generated by palette_rgb.py: numeric twins for see-through colors, rgba(var(--c-x-rgb), alpha) */
    --c-surface-rgb: 24, 40, 74;
    --c-page-rgb: 15, 29, 58;
    --c-line-strong-rgb: 63, 90, 138;
}
