/* =============================================================================
   ee_notice.css: THE ONE LOOK OF EVERY NOTIFICATION (owner 2026-11-19: "universal is my
   requirement SSOT easy to change").

   Every notification renders one contract, painted only here:
     <div class="ee-notice" data-tone="info|success|warning|danger"
          data-placement="inline|toast|banner" data-sticky="true|false"
          role="status|alert">                      (alert for warning and danger)
       <span class="ee-notice-icon" aria-hidden="true"><i class="fas ..."></i></span>
       <div class="ee-notice-main">
         <strong class="ee-notice-title">...</strong>   (optional)
         <div class="ee-notice-body">...</div>
         <div class="ee-notice-acts">...</div>          (optional actions)
       </div>
       <button class="ee-notice-close" aria-label="...">  (close, with a name)
     </div>
   Built by ExactEstate/static/js/ee_notice.js (eeNotice.*) for notify(), the Django messages
   (eeFlashStay) and the Angular EeNoticeService; the eeNotify() panel reads the tone tokens
   through data-tone; Bootstrap .alert and the kit's .ee-alert are aliased to the same tokens.
   Loaded once right after the kit (ee_core.html prints it after ee_core_tail.css) on Old pages
   and on New (Angular) pages, which the same Django base hosts.
   Guard: scripts/ci/check_one_notification.py.

   TOKENS: the :root block below is copied verbatim from the kit owner's value list,
   /root/session-trackers/EE-SITE-REDESIGN-GTM-20261119/data/PRODUCT-KIT/KIT-R1/ee_notice.values.css
   (lane KIT-R1). The VALUES are owned there; change them there and copy the block here.
   The second :root block holds tokens this structure needs that their list lacks
   (today's values; listed in data/NOTIFY/TOKENS.md for the kit owner to set).
   Rules below read tokens only: no literal color, radius or shadow.
   Adapted from their reference rules: .ee-notice__orb -> .ee-notice-icon, __text -> -main,
   __title / __body / __acts / __close -> -title / -body / -acts / -close, --<tone> modifier ->
   data-tone, --toast -> data-placement="toast"; a bare <a> in the actions is their __link,
   a bare <button> their __action; an action with a kit role (ee-btn ee-btn-primary /
   ee-btn-ghost) keeps the kit's paint for that role. Their phone rule (<600px, full-width bar,
   accent on top) is kept; on a phone the actions stack full width.
   ============================================================================= */

:root {
    /* tone: surface (the tint), border (1 px line in the tone's hue), accent (left edge, icon, link ink: 4.5:1 on its tint) */
    --ee-notice-surface-info: var(--ee-banner-info-tint, #e6f0f6);
    --ee-notice-border-info: var(--ee-banner-info-edge, #81b4d0);
    --ee-notice-accent-info: var(--ee-banner-info-ink, #0369a1);
    --ee-notice-surface-success: var(--ee-banner-success-tint, #e8f2ec);
    --ee-notice-border-success: var(--ee-banner-success-edge, #8ac09e);
    --ee-notice-accent-success: var(--ee-banner-success-ink, #126c33);
    --ee-notice-surface-warning: var(--ee-banner-warning-tint, #fff4c7);
    --ee-notice-border-warning: var(--ee-banner-warning-edge, #e3bd3a);
    --ee-notice-accent-warning: var(--ee-banner-warning-ink, #7a5600);
    --ee-notice-surface-danger: var(--ee-bad-tint, #fdecec);
    --ee-notice-border-danger: var(--ee-bad-line, #efa3a0);
    --ee-notice-accent-danger: var(--ee-bad-ink, #b91c1c);
    /* text: Ink title, a quieter body line */
    --ee-notice-text: var(--ee-n-900, #0f172a);
    --ee-notice-text-quiet: var(--ee-n-700, #1e293b);
    --ee-notice-font: var(--ee-font-family, 'Plus Jakarta Sans', system-ui, sans-serif);
    --ee-notice-title-size: var(--ee-fs-14, 0.875rem);
    --ee-notice-body-size: var(--ee-fs-14, 0.875rem);
    --ee-notice-link-size: var(--ee-fs-13, 0.8125rem);
    --ee-notice-title-weight: var(--ee-fw-strong, 600);
    /* shape */
    --ee-notice-radius: var(--ee-r-card, 12px);
    --ee-notice-edge: 4px;                      /* the tone's accent edge (left; on a phone, top) */
    --ee-notice-shadow: none;                   /* inline: flat */
    --ee-notice-shadow-float: var(--ee-float, 0 8px 24px rgba(15, 23, 42, 0.16), 0 1px 3px rgba(15, 23, 42, 0.10));
    --ee-notice-gap: var(--ee-space-3, 0.75rem);
    --ee-notice-pad: var(--ee-space-3, 0.75rem) var(--ee-space-3, 0.75rem) var(--ee-space-3, 0.75rem) var(--ee-space-4, 1rem);
    --ee-notice-toast-width: 30rem;
    --ee-notice-toast-inset: var(--ee-space-5, 1.25rem);
    --ee-notice-z: var(--ee-z-toast, 1080);
    /* the icon orb on the tint */
    --ee-notice-orb-bg: var(--ee-glass-light, rgba(255, 255, 255, 0.62));
    --ee-notice-orb-size: 2.25rem;
    /* actions: ONE main action = glass on the tint (translucent white, the tone's line, Ink label); links in the tone's ink */
    --ee-notice-action-bg: var(--ee-gl-neutral, rgba(255, 255, 255, 0.72));
    --ee-notice-action-bg-hover: var(--ee-n-0, #ffffff);
    --ee-notice-action-text: var(--ee-n-900, #0f172a);
    --ee-notice-action-radius: var(--ee-r-control, 6px);
    --ee-notice-action-height: var(--ee-h-default, 2.25rem);
    --ee-notice-action-weight: var(--ee-fw-button, 700);
    --ee-notice-link-weight: var(--ee-fw-strong, 600);
    --ee-notice-close-size: var(--ee-h-compact, 1.875rem);
    --ee-notice-close-bg: var(--ee-glass-light, rgba(255, 255, 255, 0.62));
    --ee-notice-touch: var(--ee-h-touch, 2.75rem);   /* every target on a phone */
    /* motion */
    --ee-notice-in: 200ms;
    --ee-notice-out: 220ms;
}
:root {
    --ee-notice-line-width: 1px;                 /* added by structure: the 1 px tone line */
    --ee-notice-orb-radius: 9999px;              /* added by structure: the icon orb's round shape (their reference rule) */
    --ee-notice-edge-phone: 3px;                 /* added by structure: the accent edge on top on a phone (their reference rule) */
}

/* ---- tone: each family member picks its tone's three tokens ------------------ */
.ee-notice, .alert, .ee-alert, .ee-notify-modal, .ee-alert-indigo {
    --t-surface: var(--ee-notice-surface-info);
    --t-border: var(--ee-notice-border-info);
    --t-accent: var(--ee-notice-accent-info);
}
.ee-notice[data-tone="success"], .alert-success, .ee-alert-success, .ee-notify-modal[data-tone="success"] {
    --t-surface: var(--ee-notice-surface-success);
    --t-border: var(--ee-notice-border-success);
    --t-accent: var(--ee-notice-accent-success);
}
.ee-notice[data-tone="warning"], .alert-warning, .ee-alert-warning, .ee-notify-modal[data-tone="warning"] {
    --t-surface: var(--ee-notice-surface-warning);
    --t-border: var(--ee-notice-border-warning);
    --t-accent: var(--ee-notice-accent-warning);
}
.ee-notice[data-tone="danger"], .alert-danger, .alert-error, .ee-alert-danger, .ee-alert-error,
.ee-notify-modal[data-tone="danger"] {
    --t-surface: var(--ee-notice-surface-danger);
    --t-border: var(--ee-notice-border-danger);
    --t-accent: var(--ee-notice-accent-danger);
}

/* ---- the notice ------------------------------------------------------------ */
.ee-notice, .alert, .ee-alert, .ee-alert-indigo {
    box-sizing: border-box;
    background: var(--t-surface) !important;
    color: var(--ee-notice-text) !important;
    border: var(--ee-notice-line-width) solid var(--t-border) !important;
    border-left: var(--ee-notice-edge) solid var(--t-accent) !important;
    border-radius: var(--ee-notice-radius) !important;
    box-shadow: var(--ee-notice-shadow);
    padding: var(--ee-notice-pad);
    font-family: var(--ee-notice-font);
    font-size: var(--ee-notice-body-size);
    line-height: 1.45;
    margin-bottom: var(--ee-notice-gap);
}
.ee-notice {
    display: flex !important;   /* bootstrap-notify writes display: inline-block on its container */
    align-items: flex-start;
    gap: var(--ee-notice-gap);
    text-align: left;
    max-width: 100%;
    animation: ee-notice-in var(--ee-notice-in) ease-out both;
}
.ee-notice-icon, .ee-alert-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ee-notice-orb-size);
    height: var(--ee-notice-orb-size);
    border-radius: var(--ee-notice-orb-radius);
    background: var(--ee-notice-orb-bg);
    border: var(--ee-notice-line-width) solid var(--t-border);
    color: var(--t-accent);
}
.ee-notice-icon i, .ee-alert-icon i { color: var(--t-accent); }
.ee-notice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-self: center; }
/* Nothing in a notice overflows its box at any width: words wrap, never cut. */
.ee-notice-title, .ee-notice-body, .ee-alert-text {
    white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
}
.ee-notice-title, .ee-alert-text {
    font-size: var(--ee-notice-title-size);
    font-weight: var(--ee-notice-title-weight);
    color: var(--ee-notice-text);
}
.ee-notice-body { color: var(--ee-notice-text-quiet); }
.ee-notice-acts:empty { display: none; }
.ee-notice-acts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ee-space-1, 0.25rem) var(--ee-notice-gap);
    margin-top: var(--ee-space-2, 0.5rem);
    padding-top: var(--ee-space-2, 0.5rem);
    border-top: var(--ee-notice-line-width) solid var(--t-border);
}
.ee-notice-acts form { margin: 0; }
/* a bare link: their __link */
.ee-notice-acts a:not(.ee-btn) {
    display: inline-flex; align-items: center; min-height: var(--ee-notice-close-size);
    color: var(--t-accent) !important; font-size: var(--ee-notice-link-size);
    font-weight: var(--ee-notice-link-weight); text-decoration: none;
}
.ee-notice-acts a:not(.ee-btn):hover { text-decoration: underline; text-underline-offset: 2px; }
/* a bare button: their __action (glass on the tint) */
.ee-notice-acts button:not(.ee-btn), .ee-notify-modal .ee-notify-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--ee-notice-action-height); padding: 0 var(--ee-space-3, 0.75rem);
    border: var(--ee-notice-line-width) solid var(--t-border) !important;
    border-radius: var(--ee-notice-action-radius) !important;
    background: var(--ee-notice-action-bg) !important; color: var(--ee-notice-action-text) !important;
    font: inherit; font-size: var(--ee-notice-body-size); font-weight: var(--ee-notice-action-weight); cursor: pointer;
}
.ee-notice-acts button:not(.ee-btn):hover, .ee-notify-modal .ee-notify-btn:hover {
    background: var(--ee-notice-action-bg-hover) !important; border-color: var(--t-accent) !important;
}
/* the ONE square close: their __close */
.ee-notice-close {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: var(--ee-notice-close-size); height: var(--ee-notice-close-size); padding: 0;
    border: var(--ee-notice-line-width) solid var(--t-border) !important;
    border-radius: var(--ee-notice-action-radius) !important;
    background: var(--ee-notice-close-bg) !important; color: var(--ee-notice-text-quiet) !important;
    opacity: 1 !important; text-shadow: none !important; float: none !important; cursor: pointer;
}
.ee-notice-close:hover { background: var(--ee-notice-action-bg-hover) !important; color: var(--ee-notice-text) !important; }
.ee-notice-acts a:focus-visible, .ee-notice-acts button:focus-visible, .ee-notice-close:focus-visible {
    outline: 2px solid var(--t-accent); outline-offset: 2px;
}
/* a guided error's fix (apps/utils/error_guidance.py) on its own line */
.ee-notice-fix { display: block; margin-top: var(--ee-space-1, 0.25rem); color: var(--ee-notice-text-quiet); }

/* ---- legacy markup on the same tokens: layout only, no paint of its own -------- */
.ee-alert { display: block; overflow: hidden; }
.ee-alert-icon { float: left; margin-right: var(--ee-notice-gap); }
.alert { display: flex; align-items: flex-start; gap: var(--ee-notice-gap); }
.alert .alert-link, .alert a:not(.btn):not(.ee-btn) { color: var(--t-accent); }
@media (max-width: 767.98px) {
    .alert:not(.d-flex) { display: block; }
    .alert:not(.d-flex) > i:first-child { margin-right: var(--ee-space-2, 0.5rem); }
}

/* ---- placement: toast (floating), banner (full width), inline (in the flow) ------ */
/* THE STACK (structure, 2026-11-20): every floating notice lives in ONE container
   (eeNotice.stack(), ee_notice.js), pinned where a toast was pinned, which lays them out in
   order with the notice gap and scrolls inside the viewport when they are taller than it. A
   notice never positions itself, so none can cover another at any width (the walk of
   2026-11-20 saw each toast pinned to the same corner, one on top of the other). The values are
   the toast's own tokens: inset, width, layer. */
.ee-notice-stack {
    position: fixed;
    right: var(--ee-notice-toast-inset);
    bottom: var(--ee-notice-toast-inset);
    width: min(var(--ee-notice-toast-width), calc(100vw - 2 * var(--ee-notice-toast-inset)));
    max-height: calc(100vh - 2 * var(--ee-notice-toast-inset));
    max-height: calc(100dvh - 2 * var(--ee-notice-toast-inset));
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: var(--ee-notice-gap);
    z-index: var(--ee-notice-z);
    pointer-events: none;
}
.ee-notice-stack:empty { display: none; }
.ee-notice-stack > * { pointer-events: auto; flex: 0 0 auto; }
/* A toast outside the stack (an older caller) keeps the pinned corner it always had. */
.ee-notice[data-placement="toast"] {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    right: var(--ee-notice-toast-inset) !important;
    bottom: var(--ee-notice-toast-inset) !important;
    width: min(var(--ee-notice-toast-width), calc(100vw - 2 * var(--ee-notice-toast-inset))) !important;
    margin: 0 !important;
    box-shadow: var(--ee-notice-shadow-float) !important;
    z-index: var(--ee-notice-z) !important;
}
/* In the stack the stack places it: in the flow, its full width, no offsets of its own. */
.ee-notice-stack > .ee-notice[data-placement="toast"] {
    position: relative !important;
    top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
    width: auto !important;
    max-width: none !important;
}
.ee-notice[data-placement="toast"] .progress { display: none !important; }
.ee-notice[data-placement="banner"] { width: 100%; margin-bottom: 0; }
.ee-notice.is-leaving { animation: ee-notice-out var(--ee-notice-out) ease-in forwards; overflow: hidden; pointer-events: none; }
@keyframes ee-notice-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ee-notice-out { 0% { opacity: 1; max-height: 20rem; } 60% { opacity: 0; max-height: 20rem; } 100% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; border-width: 0; } }
@media (prefers-reduced-motion: reduce) { .ee-notice, .ee-notice.is-leaving { animation-duration: 0.01ms; } }

/* ---- a phone: full-width bar, accent on top, every target 44 px, actions stacked --- */
@media (max-width: 599.98px) {
    .ee-notice {
        border-radius: 0 !important; border-left-width: 0 !important; border-right: 0 !important;
        border-top: var(--ee-notice-edge-phone) solid var(--t-accent) !important;
    }
    .ee-notice-acts { flex-direction: column; align-items: stretch; }
    .ee-notice-acts > a, .ee-notice-acts > button, .ee-notice-acts > form,
    .ee-notice-acts > form > button { width: 100%; min-height: var(--ee-notice-touch); justify-content: center; }
    .ee-notice-close { width: var(--ee-notice-touch); height: var(--ee-notice-touch); }
    /* a Bootstrap .alert used as a toast or a banner (fixed or sticky) takes the same phone bar;
       an inline .alert inside a form keeps its box */
    .alert.fixed-top, .alert.fixed-bottom, .alert.position-fixed, .alert.sticky-top,
    .alert[data-placement="toast"], .alert[data-placement="banner"] {
        border-radius: 0 !important; border-left-width: 0 !important; border-right: 0 !important;
        border-top: var(--ee-notice-edge-phone) solid var(--t-accent) !important;
        left: 0 !important; right: 0 !important; width: auto !important;
    }
    .alert.fixed-bottom, .alert[data-placement="toast"] { bottom: 0 !important; margin: 0 !important; }
    .ee-notice[data-placement="toast"] {
        left: 0 !important; right: 0 !important; bottom: 0 !important; width: auto !important;
        border-bottom: 0 !important;
        padding-bottom: calc(var(--ee-space-3, 0.75rem) + env(safe-area-inset-bottom, 0px));
    }
    /* the phone's bar: the stack spans the width at the bottom edge, as the toast did */
    .ee-notice-stack { left: 0; right: 0; bottom: 0; width: auto; max-height: 100vh; max-height: 100dvh; }
    .ee-notice-stack > .ee-notice[data-placement="toast"] { left: auto !important; right: auto !important; bottom: auto !important; }
}

/* ---- the eeNotify() panel: its header wears the same tone tokens -------------- */
.ee-notify-modal .ee-notify-header {
    background: var(--t-surface) !important;
    color: var(--ee-notice-text) !important;
    border-bottom: var(--ee-notice-line-width) solid var(--t-border);
    border-left: var(--ee-notice-edge) solid var(--t-accent);
}
.ee-notify-modal .ee-notify-header h4, .ee-notify-modal .ee-notify-close { color: var(--ee-notice-text) !important; }
.ee-notify-modal .ee-notify-header i { color: var(--t-accent) !important; }

/* ---- the Product Updates detail drawer (Read more of a notice card or a page banner) ---- */
/* Moved verbatim from apps/support/templates/support/client_communications.html (2026-11-20, lane
   NOTICE-FN-1): the drawer is now shared by the Product Updates cards and the page banner
   (templates/includes/notice_drawer.html), so its placement lives with the rest of the notice paint.
   The shared drawer slides from the LEFT (it is the mobile sidebar). A detail drawer belongs on the
   right on desktop; on a phone it is full-bleed, so the side stops mattering. */
#ee-notice-drawer .ee-notice-drawer {
    left: auto;
    right: 0;
    transform: translateX(100%);
}
#ee-notice-drawer.show .ee-notice-drawer { transform: translateX(0); }
@media (max-width: 767.98px) {
    #ee-notice-drawer .ee-notice-drawer { width: 100%; max-width: none; }
    /* Full-width, tappable actions: a 32px button in a card footer is
       not a target on a phone. */
    .ee-notice-card .ee-card-footer .ee-btn { width: 100%; min-height: 44px; }
    .ee-notice-card .ee-card-footer { flex-direction: column; align-items: stretch; }
}
