/* ============================================================================
   Steady Ahead — GLOBAL STYLES
   ----------------------------------------------------------------------------
   Theming is driven entirely by the CSS custom properties in :root below.
   To restyle the whole site (colors, corners, spacing, shadows), edit ONLY
   these variables. Palette: shades of blue + green with a yellow accent;
   all text uses a dark grey (never pure black). Checklist-specific styles
   live in checklist.css.
   ========================================================================= */

:root {
    /* ---- Brand palette: blues, greens, yellow accent ---- */
    --color-primary:        #2f7d95;   /* blue-teal (primary actions, links) */
    --color-primary-dark:   #245f72;
    --color-primary-light:  #e3eef2;
    --color-primary-soft:   #7dadbe;   /* lighter primary — unfilled part of gauge circles */
    --color-secondary:      #4f9d69;   /* green (secondary actions, success) */
    --color-secondary-dark: #3c7b51;
    --color-secondary-light:#e6f2ea;
    --color-accent:         #f2c14e;   /* yellow (highlights, badges) */
    --color-accent-dark:    #d9a72f;
    /* Coach-lane colors on the booking calendar (distinct from primary blue
       and from green, which means "finished"). */
    --color-lane-1:         #8e6bb5;   /* violet */
    --color-lane-2:         #d9832f;   /* orange */
    --color-lane-3:         #c05d8e;   /* rose */
    --color-all-avail:      #2f7d95;   /* teal — the "all available coaches" band (schedule.php) */

    /* ---- Text & surfaces (dark grey text, never black) ---- */
    --color-text:           #3d3935;   /* dark warm-grey body text */
    --color-text-muted:     #7e7a71;
    --color-heading:        #33312d;   /* warm-neutral charcoal — also the page frame */
    --color-bg:             #f5f9f9;   /* page background */
    --color-surface:        #ffffff;   /* cards, panels */
    --color-border:         #dfdcd6;   /* warm-neutral hairline (was cool #d9e4e6) */

    /* ---- Feedback ---- */
    --color-error:          #c0492f;
    --color-error-light:    #fae6e1;
    --color-info:           #2f7d95;
    --color-info-light:     #e3eef2;

    /* ---- Shape & depth (easy to change) ---- */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(52, 49, 45, 0.08);
    --shadow-md: 0 4px 16px rgba(52, 49, 45, 0.10);

    /* ---- Spacing & type ---- */
    --space-xs: 6px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 56px;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-head: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --maxw: 1080px;
    /* Header/footer side inset: 0 once there are dark gutters (viewport >= max-width),
       then grows 1px per 1px as the viewport narrows, capping at 20px (≈ viewport < 1060). */
    --edge-pad: clamp(0px, calc(var(--maxw) - 100vw), var(--space-md));
}

/* ---- Reset-ish base ---- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-heading);   /* darkest grey frames the page */
    line-height: 1.55;
    font-size: 16px;
}
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--color-heading); line-height: 1.25; margin: 0 0 var(--space-sm); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 var(--space-sm); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Darken text links on hover (button-styled links keep their own colors). */
a:not(.sancom-btn):hover { color: var(--color-primary-dark); }

/* ---- Layout shell ---- */
.sancom-container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-md); }
main.sancom-main { padding: 3px 0 var(--space-xs); }
/* Main content floats on a light "sheet" over the dark-grey body. */
main.sancom-main > .sancom-container {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 16px var(--space-md) var(--space-lg);
}

/* ---- Environment / version band ---- */
/* Full-width tier strip rendered as the TOP ROW INSIDE .sancom-header (golden DEV /
   light-yellow STAGING + version; nothing on prod — see render_env_band()).
   Living inside the sticky header means the JS-measured --hdr-h (= header
   offsetHeight) grows to include it, so the sticky page <h1>, tabs, and category
   heads all track it automatically — there is NO per-tier offset constant to
   drift (the prod-vs-dev divergence that misbehaved on the sibling app). It is a
   separate row above .sancom-header-inner, so it never joins the nav's narrow-width
   flex-wrap. Fixed 22px; it does not shrink on scroll (the inner row does). */
.sancom-envband {
    text-align: center;
    height: 22px; line-height: 22px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.05em;
    white-space: nowrap; overflow: hidden;
}
.sancom-envband-dev { background: #e5ab00; color: #3a2f00; }   /* golden DEV */
.sancom-envband-stg { background: #ffe493; color: #3a2f00; }   /* light-yellow STAGING */
.sancom-envband-ver { font-weight: 400; opacity: 0.85; }

/* ---- Header & navigation ---- */
.sancom-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    /* Pinned while the page scrolls; the page <h1> sticks just beneath it. */
    position: sticky; top: 0; z-index: 90;
}
.sancom-header-inner {
    display: flex; align-items: center;
    gap: var(--space-md); padding: var(--space-sm) var(--edge-pad);   /* flush to the sheet edge, min 20px from window */
    padding-right: var(--space-md);   /* the right end (last menu item / avatar) always keeps its 20px margin, also at full width (Greg, 2026-11-28) */
    max-width: var(--maxw); margin: 0 auto;
    transition: padding 0.18s ease;   /* header shrinks smoothly on scroll */
}
/* Brand: the stepping-stones mark, then the lettering over the tagline (v0.37.0). */
.sancom-logo { display: flex; align-items: center; gap: 10px; }
.sancom-logo:hover { text-decoration: none; }
/* STEPPING-STONES MARK (Greg, 2026-11-28; replaced the 2026-11-22 stone stack, which replaced the owl):
   the six stones of Greg's assets/Steady-Ahead-steppingstones.png redrawn as outlines -- each stone
   measured from the PNG (centre, size, tilt) and drawn as a true ellipse, so the lines are smooth at
   any size; light fill, the heading grey outline. Sized to about the old mark's AREA (it is wider:
   1.8085 = its width / height). The stones sit 5px high ALWAYS (Greg, 2026-11-28: the old scrolled
   position); scrolling changes only the header bar's height, never the mark, lettering or tagline. Footer: steppingstones_footer.svg (light lines for the dark
   footer). Favicon: favicon_steady.png (the stones on the white disc). */
.sancom-logo-mark {
    --mk-h: 48px;
    position: relative; display: block; flex: none;
    height: var(--mk-h); width: calc(var(--mk-h) * 1.8085);
}
.sancom-logo-mark img { display: block; height: 100%; width: 100%; transform: translateY(-5px); }
@media (max-width: 720px) { .sancom-logo-mark { --mk-h: 36px; } }
/* The lettering (SteadyAhead_v3_words.png, "coaching" cut off) at 42px / 30px and the tagline under it
   in the same quiet style (lowercase, small, letter-spaced, #444). Every page since v0.37.0; the class
   names date from the 2026-11-07 public-look trial. */
.sancom-home-logo-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.sancom-home-logo-text { display: block; flex: none; width: auto; height: 42px; max-width: 46vw; object-fit: contain; }
.sancom-home-logo-tag {
    font-family: var(--font-body); font-size: 13px; line-height: 1.35; letter-spacing: 0.09em;
    color: #444; white-space: nowrap; padding-left: 2px;
    position: relative; top: -5px;   /* tucked 5px closer to the lettering (Greg, 2026-11-28) */
}
@media (max-width: 720px) {
    .sancom-home-logo-text { height: 30px; }
    .sancom-home-logo-tag { font-size: 10.5px; letter-spacing: 0.05em; }
}
/* margin-left:auto pushes the nav (and the avatar after it) to the right edge */
.sancom-nav { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; margin-left: auto; }
.sancom-nav a { color: var(--color-text-muted); font-size: 0.95rem; }
.sancom-nav a:hover, .sancom-nav a.active { color: var(--color-primary-dark); text-decoration: none; }
/* Current page: a hairline same-color stroke thickens the glyphs slightly —
   faux-bold without the width shift (and none of the multi-copy/outline
   pitfalls: same glyph, same color, sub-pixel width). */
.sancom-nav a.active { -webkit-text-stroke: 0.6px currentColor; }
.sancom-nav .sancom-nav-admin { color: var(--color-secondary-dark); font-weight: 600; }
.sancom-nav-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--color-heading); font-size: 1.6rem; line-height: 1; padding: 2px 8px; }

/* Between full width and the hamburger, keep the four nav items on ONE row:
   tighter gaps + smaller type (the fluid logo above does the rest — the old
   two-row wrap made the pinned header stack too tall). Should wrapping ever
   return, the JS-measured --hdr-h keeps the sticky offsets correct anyway. */
@media (max-width: 940px) and (min-width: 721px) {
    .sancom-header-inner { gap: var(--space-sm); }
    .sancom-nav { gap: var(--space-sm); }
    .sancom-nav a { font-size: 0.85rem; }
}

/* Scrolled: the HEADER itself compresses smoothly — tighter vertical padding,
   smaller logo, and a shorter avatar SLOT (.sancom-avatar height only reserves row
   space; the 72px circle itself is absolutely positioned and keeps its size,
   simply protruding further into the pinned page title / content below). */
html.sancom-scrolled .sancom-header-inner { padding-top: 6px; padding-bottom: 6px; }
html.sancom-scrolled .sancom-avatar { height: 28px; }

/* ---- Sticky, shrinking page title ---- */
/* The page <h1> pins below the site header (offset = the header's REAL height,
   measured into --hdr-h by layout_footer JS — it changes when the hamburger
   opens). Once the page is scrolled (html.sancom-scrolled, toggled with
   hysteresis), the title shrinks. Its background bleeds sheet-edge to
   sheet-edge (the .sancom-intro negative-margin trick) so all content — including
   the green intro band — slides cleanly underneath it. */
main.sancom-main > .sancom-container > h1 {
    position: sticky; top: var(--hdr-h, 67px); z-index: 40;
    background: var(--color-bg);
    margin: 0 calc(-1 * var(--space-md)) var(--space-sm);
    padding: 6px var(--space-md);
    transition: font-size 0.15s ease, box-shadow 0.15s ease;
}
html.sancom-scrolled main.sancom-main > .sancom-container > h1 {
    font-size: 1.25rem;
    box-shadow: 0 1px 0 var(--color-border);   /* hairline under the pinned title */
}

/* Collapse the menu to a hamburger on narrow screens (avatar stays visible).
   720px (not the content pages' 640px): with the fluid logo bottoming at 32px,
   one nav row stops fitting reliably below ~720 (Chrome's wider metrics). */
@media (max-width: 720px) {
    .sancom-header-inner { flex-wrap: wrap; }
    .sancom-nav-toggle { display: inline-flex; margin-left: auto; }
    .sancom-nav { display: none; order: 10; width: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: var(--space-xs) 0 0; }
    .sancom-nav.open { display: flex; }
    .sancom-nav a { padding: 12px 2px; border-top: 1px solid var(--color-border); font-size: 1rem; }
}

/* PUBLIC LOOK (logged-out pages, body.sancom-public): the logo + tagline plus four menu
   items need more room, so the hamburger takes over at 860px instead of 720px.
   Same rules as the 720px block above. */
@media (max-width: 860px) and (min-width: 721px) {
    body.sancom-public .sancom-header-inner { flex-wrap: wrap; }
    body.sancom-public .sancom-nav-toggle { display: inline-flex; margin-left: auto; }
    body.sancom-public .sancom-nav { display: none; order: 10; width: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: var(--space-xs) 0 0; }
    body.sancom-public .sancom-nav.open { display: flex; }
    body.sancom-public .sancom-nav a { padding: 12px 2px; border-top: 1px solid var(--color-border); font-size: 1rem; }
}

/* ---- Avatar menu (header, right-most) ---- */
/* The wrapper reserves only a logo-height (42px) slot in the header row while
   the 76px circle (72px + 2px border each side) overflows it — 6px of air
   above, hanging ~16px below the header line. Keeps the header slim. */
.sancom-avatar { position: relative; width: 76px; height: 42px; flex: none; z-index: 70; transition: height 0.18s ease; }
.sancom-avatar-btn {
    /* z-index keeps the circle painting OVER the opened menu it overlaps */
    position: absolute; top: -6px; left: 0; z-index: 61;
    width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
    padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
    /* Real 2px border: it sits ON the clip edge, covering it, so the drop shadow
       can't bleed inward here (the box-shadow-ring approach exposed that edge and
       leaked in some browsers). Hover/open swaps the border to primary. */
    background: var(--color-primary); border: 2px solid var(--color-border);
    box-shadow: 2px 2px 5px rgba(52, 49, 45, 0.35);
    transition: border-color 0.15s ease;
}
.sancom-avatar-btn:hover, .sancom-avatar-btn[aria-expanded="true"] { border-color: var(--color-primary); }
.sancom-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sancom-avatar-initials { color: #fff; font-weight: 600; font-size: 1.5rem; letter-spacing: 0.5px; }
.sancom-avatar-menu {
    /* 60px = 42px slot + 12px header padding + 1px border + 5px gap, so the
       menu sits just under the header line and the circle (bottom edge at
       70px) overlaps its top by ~10px. */
    position: absolute; right: 0; top: 60px; min-width: 200px; z-index: 60;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 6px 0;
}
.sancom-avatar-menu[hidden] { display: none; }
.sancom-avatar-menu-user { padding: 8px 16px 10px; }
.sancom-avatar-menu-user strong { display: block; color: var(--color-heading); }
.sancom-avatar-menu-user span { font-size: 0.85rem; }
/* Each entry carries a light-grey top rule — same look as the hamburger menu
   (the user block's old border-bottom is gone so the rules never double up). */
.sancom-avatar-menu a {
    display: block; padding: 9px 16px; color: var(--color-text); font-size: 0.95rem;
    border-top: 1px solid var(--color-border);
}
.sancom-avatar-menu a:hover, .sancom-avatar-menu a.active { background: var(--color-primary-light); color: var(--color-primary-dark); text-decoration: none; }
.sancom-avatar-menu .sancom-avatar-menu-admin { color: var(--color-secondary-dark); font-weight: 600; }
/* Impersonation menu: "Stop impersonating {first}" lives INSIDE the identity
   block, right under "Viewing as …" + email (both the badge menu and the
   hamburger user block use .sancom-imp-stop-link). */
.sancom-avatar-menu form { margin: 0; }
.sancom-imp-stop-link { display: block; text-align: left; padding: 6px 0 0; font-size: 0.9rem; }
/* In the avatar pulldown, the Stop row gets the same full-width top rule as
   the entries below it (negative margins cancel the identity block's padding);
   9px rule-to-text matches the entries' padding exactly. */
.sancom-avatar-menu .sancom-avatar-menu-user form {
    margin: 8px -16px 0; padding: 9px 16px 0;
    border-top: 1px solid var(--color-border);
}
.sancom-avatar-menu .sancom-avatar-menu-user .sancom-imp-stop-link { padding-top: 0; }

/* ---- Impersonation badge (header, while View As / Act As is active) ----
   One transparent button holds BOTH circles: the real user's avatar in the
   normal spot, the target's overlapping toward screen center (left + down,
   covering ~half), plus the mode label to their left. Clicking anywhere on
   the pair opens the stop menu (same ids as the avatar menu, so the footer
   toggle script drives it unchanged). Deliberately a bit "extra" — rare mode. */
.sancom-imp-badge {
    position: absolute; inset: 0;
    background: none; border: 0; padding: 0; cursor: pointer;
}
.sancom-imp-badge .sancom-imp-real   { z-index: 61; }          /* normal spot (top:-6; left:0) */
/* Target circle hangs well BELOW the real one (down 30px vs the real's -6)
   so the pair reads as "someone laid over me", dropping into the page body. */
.sancom-imp-badge .sancom-imp-target { left: -36px; top: 24px; z-index: 62; }
/* "Viewing as Riley" — under the overlapped pair, sitting just into the main
   body window (the target circle's bottom edge is at ~100px). Anchored by its
   RIGHT edge with a small inset so a long name never butts against the content
   sheet's border (the avatar block's right edge aligns with the sheet edge). */
.sancom-imp-label {
    position: absolute; right: 10px; top: 104px;
    z-index: 59;   /* under the opened menu (60) so it never overprints it */
    white-space: nowrap; font-size: 0.78rem; font-weight: 700;
}
.sancom-imp-label.is-view { color: var(--color-primary-dark); }
.sancom-imp-label.is-act  { color: var(--color-danger, #a3352d); }
/* The impersonation menu opens below the lowered target circle (the normal
   avatar menu's 60px top would be half-hidden behind it). */
.sancom-imp-badge ~ .sancom-avatar-menu { top: 108px; }

/* Users-list impersonation control: the double-circle icon + View/Act menu. */
.sancom-imp-wrap { position: relative; display: inline-block; }
.sancom-imp-btn { vertical-align: middle; }
.sancom-imp-btn .sancom-imp-ico { display: inline-block; vertical-align: -4px; }
.sancom-imp-menu {
    position: absolute; right: 0; top: 24px; z-index: 40; min-width: 110px;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 4px 0;
}
.sancom-imp-menu[hidden] { display: none; }
.sancom-imp-menu form { margin: 0; }
.sancom-imp-menu button {
    display: block; width: 100%; text-align: left; padding: 7px 14px;
    background: none; border: 0; cursor: pointer; font-family: inherit;
    font-size: 0.9rem; color: var(--color-text);
}
.sancom-imp-menu button:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* Inert lookalike for controls disabled during impersonation (or otherwise):
   still shows its title tooltip, submits nothing. */
.sancom-mode-off { opacity: 0.55; cursor: default; }

/* Editable-section header suffix while impersonating — "(Jordan Coach)" in
   smaller grey (same treatment as the breadcrumb's .sancom-crumb-note). */
.sancom-imp-note { font-weight: 400; font-size: 0.82em; color: var(--color-text-muted); }

/* Impersonation in the hamburger (≤720px, where the full .sancom-avatar badge is
   hidden): the .sancom-nav-user block swaps its single avatar for the mini
   overlapped pair — target front-left and lower, echoing the big badge — and
   titles itself "Viewing/Acting as {first}" in the mode color. (No media
   query needed: it only renders inside .sancom-nav-user, which shows ≤720px.) */
.sancom-imp-mini-avs { position: relative; width: 54px; height: 42px; flex: none; }
.sancom-imp-mini-av {
    /* Same 36px as the non-impersonating .sancom-nav-user-avatar. */
    position: absolute; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
    background: var(--color-primary); border: 2px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
}
.sancom-imp-mini-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sancom-imp-mini-av .sancom-avatar-initials { font-size: 0.8rem; }
.sancom-imp-mini-av.is-real   { right: 0; top: 0; }
.sancom-imp-mini-av.is-target { left: 0; top: 6px; z-index: 1; }
.sancom-imp-label-mini.is-view { color: var(--color-primary-dark); }
.sancom-imp-label-mini.is-act  { color: var(--color-danger, #a3352d); }

/* Collapsed-header cue (≤720px): text-only "Viewing/Acting as {first}" sits
   beside the hamburger so the mode is visible with the menu CLOSED (the
   avatar pair lives inside the opened menu). To keep the cue + hamburger on
   ONE row at phone widths, the wide wordmark keeps shrinking below 720px
   while impersonating (it has no nav row to share with there), gaps tighten,
   and the label may ellipsize as a last resort. */
.sancom-imp-hdr { display: none; }
@media (max-width: 720px) {
    .sancom-imp-hdr {
        display: block; margin-left: auto; white-space: nowrap;
        font-size: 0.8rem; font-weight: 700;
        flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    }
    .sancom-imp-hdr ~ .sancom-nav-toggle { margin-left: 0; }   /* the cue takes over the auto push */
    .sancom-header.sancom-imp-on .sancom-header-inner { gap: var(--space-sm); }
}

/* In-hamburger impersonation stop row (the full badge is hidden ≤720px). */
.sancom-nav-imp { display: none; margin: 0; }

/* In-hamburger user entries (mirror of the avatar dropdown for narrow screens).
   Hidden at full width; the media query below swaps them in for the circle. */
.sancom-nav-user, .sancom-nav-user-link { display: none; }
.sancom-nav-user-avatar {
    width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none;
    background: var(--color-primary); display: flex; align-items: center; justify-content: center;
}
.sancom-nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sancom-nav-user-avatar .sancom-avatar-initials { font-size: 0.8rem; }
.sancom-nav-user-name { line-height: 1.3; }
.sancom-nav-user-name strong { display: block; color: var(--color-heading); }
.sancom-nav-user-name span { font-size: 0.85rem; }

/* Narrow screens: the avatar collapses INTO the hamburger menu — the header
   circle disappears and the user row + Account/Admin/Log Out entries show
   inside the opened nav. (Must stay after the base rules above; 720px matches
   the hamburger breakpoint, NOT the content pages' 640px.) */
@media (max-width: 720px) {
    .sancom-avatar { display: none; }
    .sancom-nav-user {
        display: flex; align-items: center; gap: 10px;
        padding: 12px 2px; border-top: 1px solid var(--color-border); margin-top: 4px;
    }
    .sancom-nav-user-link { display: block; }
    .sancom-nav-imp { display: block; }   /* stop link inside the user block's name column */
}

/* ---- Client roster avatars (staff_home) ----
   Lives INSIDE the Client cell (no extra table column) so narrow screens lose
   nothing; the circle just shrinks below 640px. */
.sancom-client-cell { display: flex; align-items: center; gap: 10px; }
.sancom-client-avatar {
    width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none;
    background: var(--color-primary); display: flex; align-items: center; justify-content: center;
    /* Crisp ring via box-shadow (no blur = no inner bleed); drop shadow via
       filter so it follows the clipped circle instead of bleeding inside it. */
    box-shadow: 0 0 0 2px var(--color-border);
    filter: drop-shadow(2px 2px 1px rgba(52, 49, 45, 0.3));
}
.sancom-client-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sancom-client-avatar .sancom-avatar-initials { font-size: 0.85rem; }

/* Drill-in view: larger avatar beside the client's name heading. */
.sancom-client-head { display: flex; align-items: center; gap: var(--space-md); }
.sancom-client-head h1 { margin-bottom: 2px; }
.sancom-client-head p { margin: 0; }
.sancom-client-avatar-lg { width: 64px; height: 64px; }
.sancom-client-avatar-lg .sancom-avatar-initials { font-size: 1.3rem; }

@media (max-width: 640px) {
    .sancom-client-avatar { width: 30px; height: 30px; }
    .sancom-client-avatar .sancom-avatar-initials { font-size: 0.7rem; }
    .sancom-client-avatar-lg { width: 48px; height: 48px; }
    .sancom-client-avatar-lg .sancom-avatar-initials { font-size: 1rem; }
}

/* Breadcrumb page heading (Admin / sub-page). */
.sancom-crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35em; }
.sancom-crumbs a { color: var(--color-primary); text-decoration: none; }
.sancom-crumbs a:hover { text-decoration: underline; }
/* Sub-page leaf sits slightly smaller than the blue links — but only when it
   follows one (on the Admin home, "Admin" is the sole crumb: keep it full size). */
.sancom-crumbs > span:last-child { color: var(--color-text); }
.sancom-crumbs > span:last-child:not(:first-child) { font-size: 0.92em; }
.sancom-crumb-sep { color: var(--color-text-muted); font-weight: 400; }
/* Parenthetical qualifier on a leaf crumb (e.g. "Users (coach view)") — lighter
   and smaller than the crumb it trails. */
.sancom-crumb-note { font-weight: 400; font-size: 0.82em; color: var(--color-text-muted); }

/* On-behalf banner: whose schedule an admin is editing. */
.sancom-coach-banner {
    gap: var(--space-md); padding: var(--space-sm) var(--space-md);
    background: var(--color-primary-light); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

/* Inline checkbox + label (e.g. the time-off "All day" toggle). */
.sancom-checkline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sancom-checkline input { margin: 0; }

/* Time-off "From time" / "To time" fields (label + editable input) sit smaller
   than the date fields beside them. */
.sancom-timeoff-time label,
.sancom-timeoff-time input[type=time] { font-size: 0.8em; }

/* ---- Booking calendar (schedule.php): segmented availability ----
   Each day is split into 30-min rows across the month's availability window
   (--rows). Blocks are absolutely positioned buttons inside a lane; the wide
   lane = "any coach" (primary blue), narrow lanes = worked-with coaches
   (--color-lane-N). Row lines come from a repeating gradient so empty rows
   still read as the time grid. */
.sancom-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
/* Header row: month + prev/next centered as a group, List toggle right. */
.sancom-cal-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: var(--space-sm); }
.sancom-cal-head-center { display: flex; align-items: center; justify-content: center; gap: 10px; }
/* Fixed widths sized to the LONGEST content ("September 2026"; "← May") so
   the prev/next buttons never shift as months load. */
.sancom-cal-head-center h2 { min-width: 190px; text-align: center; }
.sancom-cal-head-center .sancom-cal-monthnav { width: 88px; flex: none; }
.sancom-cal-head-center .sancom-cal-monthnav .sancom-btn {
    display: inline-block; width: 100%; text-align: center;
    padding-left: 6px; padding-right: 6px;
}
/* Weekday headers: boxed like the day cells (same surface/border/radius). */
.sancom-cal-dow {
    text-align: center; font-weight: 600; color: var(--color-text-muted); font-size: 0.85rem;
    padding: 4px 0;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.sancom-cal-day2 {
    position: relative;    /* anchor for the .sancom-cal-appt-dots day badge */
    aspect-ratio: 1 / 1;   /* at least as tall as wide; lanes stretch it if needed */
    padding: 4px 5px 5px;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column; min-width: 0;
}
.sancom-cal-day2.is-blank { background: transparent; border: 0; }
.sancom-cal-day2.is-off { opacity: 0.55; }
/* Previous month's trailing days in the leading cells: same low-light grey
   as no-schedule days, but their availability stays fully bookable. */
.sancom-cal-day2.is-outmonth { opacity: 0.55; background: var(--color-bg); }
/* Past days recede further than "no times available" days: even lighter, on
   the page background instead of the white surface. (Declared after .is-off —
   past days carry both classes and this opacity must win.) */
.sancom-cal-day2.is-past { opacity: 0.3; background: var(--color-bg); }
.sancom-week-day.is-off { opacity: 0.55; }
.sancom-week-day.is-past { opacity: 0.4; }   /* after .is-off — past must win */
.sancom-cal-day2.is-today { border-color: var(--color-accent); border-width: 2px; }
.sancom-cal-num2 { font-weight: 600; color: var(--color-heading); font-size: 0.85rem; line-height: 1.2; }
a.sancom-cal-num2:hover { color: var(--color-primary-dark); }
/* Holiday name inline after the day number: truncated (ellipsis) to whatever
   fits the cell; hovering expands the full name IN PLACE, painting over the
   neighboring cell instead of popping up offset. Phones see the name in the
   list view's heading; week labels carry a native title tooltip. */
.sancom-hol {
    /* The day cell is a flex COLUMN: this is its own row under the number.
       align-self keeps the box content-sized (a stretched flex item's box
       stays cell-wide, so hover text would spill past its background). */
    align-self: flex-start;
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.7rem; line-height: 1.5; color: var(--color-heading);
    border-radius: 3px; cursor: help;
}
.sancom-hol:hover {
    max-width: none; position: relative; z-index: 20;
    background: var(--color-surface); box-shadow: var(--shadow-sm);
    padding: 0 4px; margin: 0 -4px;   /* bg breathing room; text stays put */
}
/* Dimmed cells (opacity < 1) form their own stacking context, which would
   trap the expanded name UNDER later cells' availability blocks — so lift
   the whole cell while its holiday is hovered. opacity:1 also un-dims it:
   a child can't escape an ancestor's opacity, so the expanded chip would
   otherwise stay translucent (hard to read over the next day's blocks). */
.sancom-cal-day2:has(.sancom-hol:hover) { position: relative; z-index: 30; opacity: 1; }
.sancom-cal-lanes { flex: 1; display: flex; gap: 2px; margin-top: 2px; min-height: 0; }
.sancom-cal-lane {
    position: relative; flex: 3; border-radius: 3px; min-width: 0;
    background: repeating-linear-gradient(to bottom,
        transparent 0,
        transparent calc(100% / var(--rows) - 1px),
        var(--color-border) calc(100% / var(--rows) - 1px),
        var(--color-border) calc(100% / var(--rows)));
}
.sancom-cal-lane-narrow { flex: 1; }
.sancom-cal-block {
    position: absolute; left: 0; right: 0; width: 100%;
    background: var(--lane-color, var(--color-primary));
    border: 0; border-radius: 2px; padding: 0; cursor: pointer; display: block;
}
.sancom-cal-block:hover { filter: brightness(1.15); }
/* Admin all-coaches calendar: booked slots = darker shade of the coach color;
   blocks are read-only (view only), so no pointer cursor. */
.sancom-cal-block.is-booked { filter: brightness(0.6); }
.sancom-cal-block.is-booked:hover { filter: brightness(0.72); }
.sancom-cal-ro .sancom-cal-block, .sancom-cal-weeks-ro .sancom-cal-block { cursor: default; }
/* Client's OWN booked appointment on the Schedule Coach calendar: the coach's
   solid color + a DARK ring (reads on the white lane, unlike white) + a check,
   sitting above the availability. Deliberately stands out (few per client). */
.sancom-cal-appt {
    position: absolute; left: 0; right: 0; width: 100%; z-index: 7;
    background: var(--lane-color, var(--color-primary));
    border-radius: 2px;
    /* 1px dark ring + a lighter-coach ring behind it, BOTH outset: the light
       spreads from the very edge (0), so it underlaps the dark and there's no
       sub-pixel seam between them on zoom. Outer ring overflows onto neighbors. */
    box-shadow: 0 0 0 1px var(--color-heading), 0 0 0 6px rgba(255, 255, 255, 0.6);
    display: flex; align-items: center; justify-content: center; cursor: default;
}
@supports (color: color-mix(in srgb, red, #fff)) {
    .sancom-cal-appt {
        box-shadow: 0 0 0 1px var(--color-heading),
                    0 0 0 6px color-mix(in srgb, var(--lane-color, var(--color-primary)), #fff 45%);
    }
}
.sancom-cal-appt.is-horiz { top: 0; bottom: 0; left: auto; right: auto; height: 100%; width: auto; }
.sancom-cal-appt:hover, .sancom-cal-appt:focus-visible { outline: none; filter: brightness(1.08); }
.sancom-appt-check { color: #fff; font-size: 15px; font-weight: 700; line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); pointer-events: none; }
/* Day indicator = a coach-colored check badge on the day number (one per coach
   that day) — same color + check language as the in-lane mark. */
.sancom-cal-appt-dots { position: absolute; top: 3px; right: 3px; display: flex; gap: 3px; z-index: 6; }
.sancom-appt-dot {
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
    width: 15px; height: 15px; border-radius: 50%; cursor: default;
    /* same ring language as the in-lane mark: 1px dark + a lighter-coach ring
       behind it, BOTH outset (light underlaps the dark — no sub-pixel seam). */
    box-shadow: 0 0 0 1px var(--color-heading), 0 0 0 6px rgba(255, 255, 255, 0.6);
    color: #fff; font-size: 15px; font-weight: 700; line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
@supports (color: color-mix(in srgb, red, #fff)) {
    .sancom-appt-dot {
        box-shadow: 0 0 0 1px var(--color-heading),
                    0 0 0 6px color-mix(in srgb, var(--dot-color, var(--color-primary)), #fff 45%);
    }
}
.sancom-blk-s, .sancom-blk-e {
    position: absolute; font-size: 9px; line-height: 1; color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); white-space: nowrap; pointer-events: none;
}
.sancom-blk-s { top: 1px; left: 2px; }
.sancom-blk-e { bottom: 1px; right: 2px; }
.sancom-cal-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 2px 0 6px; font-size: 0.85rem; color: var(--color-text-muted); }
.sancom-cal-legend-stack { flex-direction: column; align-items: flex-start; gap: 4px; }
/* Coach calendar-color picker (account.php). One row per color: the name (in
   its own color), an open + a booked (darker) lane tile, and — if taken — the
   owning coach. Radios are visually hidden; the row carries the state (ring
   when current, dimmed when taken). */
.sancom-color-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 480px; }
/* Scoped under .sancom-color-list so it beats `.sancom-form label { display:block }`
   (0,2,0 > 0,1,1) — the rows are <label>s inside a .sancom-form. Without this the
   rows fall back to block and the tiles trail the name text (misaligned). */
.sancom-color-list .sancom-color-row {
    display: flex; align-items: center; gap: 12px; margin: 0; padding: 7px 12px;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: var(--color-surface); cursor: pointer; font-weight: 400;
}
.sancom-color-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
/* Name column is fixed-width (so the tiles align across rows) but RIGHT-aligned,
   so every name ends right next to its tiles — close spacing, still aligned. */
.sancom-color-row-name { flex: 0 0 4.25em; font-weight: 500; text-align: right; }
.sancom-color-tiles { display: inline-flex; gap: 3px; flex: none; }
.sancom-color-tile {
    width: 46px; height: 26px; border-radius: 3px; display: inline-flex;
    align-items: center; justify-content: center; color: #fff; font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.sancom-color-tile.is-booked { filter: brightness(0.6); }
.sancom-color-owner, .sancom-color-current { font-size: 0.82rem; }
.sancom-color-current { color: var(--color-heading); font-weight: 500; }
.sancom-color-row:has(input:checked) { border-color: var(--color-heading); box-shadow: 0 0 0 2px var(--color-heading); }
.sancom-color-row:has(input:checked) .sancom-color-row-name { font-weight: 700; }
.sancom-color-row:focus-within { box-shadow: 0 0 0 3px var(--color-primary-soft); }
/* Taken rows keep the NAME + TILES at full color (identity stays legible); only
   the trailing "in use by …" is lowlighted, plus the grey bg + not-allowed cue. */
.sancom-color-row.is-taken { cursor: not-allowed; background: var(--color-bg); }
.sancom-color-row.is-taken .sancom-color-owner { opacity: 0.7; }
.sancom-lane-chip {
    display: inline-block; width: 12px; height: 12px; border-radius: 3px;
    background: var(--lane-color, var(--color-primary)); margin-right: 5px; vertical-align: -1px;
}
.sancom-cal-tip {
    position: fixed; z-index: 120; pointer-events: none;
    background: var(--color-heading); color: #fff; font-size: 0.75rem;
    padding: 3px 8px; border-radius: 4px; box-shadow: var(--shadow-md);
    /* pre-line honors the \n line breaks in the appointment popup (the single-
       line availability tip is unaffected); center the stacked lines. */
    white-space: pre-line; text-align: center;
}
/* Admin/Schedules all-coaches calendar: per-coach day popup (name + hours + appts). */
.sancom-daypop {
    position: fixed; z-index: 120; pointer-events: none; max-width: 260px;
    background: var(--color-heading); color: #fff; font-size: 0.8rem; line-height: 1.45;
    padding: 8px 12px; border-radius: 6px; box-shadow: var(--shadow-md);
}
.sancom-daypop strong { display: block; margin-bottom: 3px; }

/* Booking popup (block click). Fixed + centered — unlike the term popup,
   which is deliberately document-anchored. */
.sancom-book-overlay {
    position: fixed; inset: 0; z-index: 110; padding: 16px;
    background: rgba(52, 49, 45, 0.45);
    display: flex; align-items: center; justify-content: center;
}
.sancom-book-overlay[hidden] { display: none; }
.sancom-book-modal {
    background: var(--color-surface); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); padding: var(--space-md);
    max-width: 380px; width: 100%; position: relative;
}

/* Week bars: the phone rendering — one week, each day a horizontal track with
   the time axis running left→right. Hidden on desktop; the month grid hides
   on phones. */
/* NB: week-nav must NOT also carry .sancom-row — its display:flex is declared
   later in this file and would defeat the display:none here on desktop. */
.sancom-week, .sancom-week-nav { display: none; }
/* Arrows sit tight around the centered week label (mirrors the month nav);
   empty placeholder spans keep the label centered when an arrow is absent. */
.sancom-week-nav { align-items: center; justify-content: center; gap: 12px; }
.sancom-week-nav > a, .sancom-week-nav > span { min-width: 44px; text-align: center; }
/* Sized to the longest week label ("Nov 29 – Dec 5") so arrows stay put. */
.sancom-week-nav > strong { min-width: 130px; text-align: center; }
.sancom-week-day { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
/* Schedules.php one-day-per-row (narrow) view: a full-width grey rule above each
   day spans the date label AND its coach bars, so day boundaries read clearly.
   Padding/margin rebalanced against the base 8px gap so it adds no real height. */
.sancom-cal-weeks-ro .sancom-week-day { border-top: 1px solid var(--color-border); padding-top: 4px; margin-bottom: 4px; }
.sancom-week-day.is-today .sancom-week-label { color: var(--color-accent-dark); }
.sancom-week-label { width: 62px; flex: none; font-size: 0.8rem; font-weight: 600; color: var(--color-heading); padding-top: 8px; }
.sancom-week-lanes { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sancom-week-track {
    position: relative; height: 34px;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: repeating-linear-gradient(to right,
        transparent 0,
        transparent calc(100% / var(--rows) - 1px),
        var(--color-border) calc(100% / var(--rows) - 1px),
        var(--color-border) calc(100% / var(--rows)));
}
.sancom-week-track-narrow { height: 18px; }
.sancom-cal-block.is-horiz { top: 0; bottom: 0; left: auto; right: auto; height: 100%; width: auto; }
@media (max-width: 640px) {
    .sancom-cal-month, .sancom-cal-monthnav { display: none; }
    .sancom-week { display: block; margin-top: var(--space-sm); }
    .sancom-week-nav { display: flex; margin-top: var(--space-sm); }
}

/* ---- Avatar editor (Account page) ---- */
.sancom-avatar-editor { display: flex; align-items: flex-start; gap: var(--space-lg); flex-wrap: wrap; }
.sancom-avatar-current {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex: none;
    background: var(--color-primary); border: 2px solid var(--color-border);
    box-shadow: 2px 2px 5px rgba(52, 49, 45, 0.35);   /* below-right drop shadow (matches header) */
    display: flex; align-items: center; justify-content: center;
}
.sancom-avatar-current img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sancom-avatar-current .sancom-avatar-initials { font-size: 2rem; }
.sancom-crop-viewport {
    width: 240px; height: 240px; border-radius: 50%; overflow: hidden; position: relative;
    background: var(--color-primary-light); border: 1px solid var(--color-border);
    cursor: grab; touch-action: none;
}
.sancom-crop-viewport.dragging { cursor: grabbing; }
.sancom-crop-viewport img {
    position: absolute; left: 0; top: 0; transform-origin: 0 0;
    user-select: none; -webkit-user-drag: none; pointer-events: none; max-width: none;
}
.sancom-crop-zoom { width: 240px; display: block; margin: var(--space-sm) 0; }

/* ---- Footer (sits on the dark-grey frame, left-justified to the content column) ---- */
.sancom-footer {
    color: rgba(255, 255, 255, 0.55); font-size: 0.85rem;
    padding: var(--space-xs) 0 var(--space-md);   /* small gap up to the content sheet */
}
.sancom-footer-inner { display: flex; align-items: center; gap: 10px; padding: 0 var(--edge-pad); }   /* flush to sheet edge, min 20px from window */
/* The stepping-stones mark, drawn in light lines for the dark footer. */
.sancom-footer-logo { height: 22px; width: auto; display: block; }   /* the stepping stones, about the stone stack's area */
/* Deployed env+version marker — Admin pages only ($show_version). Far right of
   the footer row; subtle. Shows on EVERY tier (the one version readout on prod,
   which has no top band). */
.sancom-ver { margin-left: auto; font-size: 0.78rem; opacity: 0.75; letter-spacing: 0.02em; white-space: nowrap; }
.sancom-ver-env { font-weight: 600; }
.sancom-ver-env-dev  { color: #e5ab00; }
.sancom-ver-env-stg  { color: #d9b93f; }
.sancom-ver-env-prod { color: rgba(255, 255, 255, 0.6); }

/* Checklist version rows — small, light, right-aligned. SHARED by the staff
   drill-in (client behind the current version; hidden when in sync) AND the
   Admin/Checklist editor's version+publish+sync row. */
.sancom-cliver {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 10px;
    margin-top: 6px; font-size: 0.78rem; color: var(--color-text-muted);
}

/* ---- Page help (golden ? icon + post-it popover) ---- */
/* Reusable: .sancom-help wraps a .sancom-help-btn (small gold circle, white ?) and a
   .sancom-help-pop (post-it styling, same palette as .sancom-toast). The popover is
   right-anchored so its TOP-RIGHT corner tucks partially UNDER the icon; the
   icon stays on top (higher z) so clicking it again closes. */
.sancom-help { position: relative; display: inline-flex; }
.sancom-help-btn {
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
    /* Ring AND fill are both INSET shadows over a TRANSPARENT background — the
       gold is layered UNDER the 1.5px grey ring and never reaches the element's
       edge, so its antialiasing physically cannot peek outside the ring (a gold
       background, even with the ring on top, still owns the silhouette pixels).
       NOTE (parked): a faint gold fringe still shows on some displays even so —
       already tried real border / background-clip / this. Next attempt, if ever
       revisited: inline SVG circle (see the CLAUDE.md gold-guides note). */
    border: 0; background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--color-heading), inset 0 0 0 12px #e5ab00;
    color: #fff;
    font-size: 0.95rem; font-weight: 700; line-height: 22px; text-align: center; padding: 0;
    position: relative; z-index: 81;
}
.sancom-help-btn:hover { box-shadow: inset 0 0 0 1.5px var(--color-heading), inset 0 0 0 12px #c99700; }
.sancom-help-pop {
    position: absolute; top: 12px; right: -4px; z-index: 80;
    width: min(640px, calc(100vw - 60px));
    max-height: min(72vh, 640px); overflow-y: auto;
    background: #fdf3cf; color: var(--color-heading);   /* the post-it palette (.sancom-toast) */
    box-shadow: 3px 6px 16px rgba(52, 49, 45, 0.28);    /* square corners = stuck-note look */
    padding: 18px 20px; font-size: 0.9rem; line-height: 1.5; text-align: left;
    white-space: normal;   /* the head's button wrapper sets nowrap — undo it for prose */
}
.sancom-help-pop h3 { margin: 0 0 10px; font-size: 1rem; color: var(--color-heading); }
.sancom-help-pop p { margin: 0 0 1em; }   /* blank line between paragraphs */
.sancom-help-pop p:last-child { margin-bottom: 44px; }   /* extra blank rows so the end can scroll clear of the fade */
/* Bottom FADE — signals more scrollable text below. Sticky to the scrollport's
   bottom edge, ~two text rows tall; JS adds .at-end when scrolled to the bottom
   (or nothing to scroll), which fades it away so the last lines read clean. */
.sancom-help-pop::after {
    content: ""; display: block; position: sticky; bottom: -18px;   /* flush to the box edge (cancels padding) */
    height: 52px; margin-top: -52px; pointer-events: none;
    background: linear-gradient(to bottom, rgba(253, 243, 207, 0), #fdf3cf 80%);
    transition: opacity 0.15s ease;
}
.sancom-help-pop.at-end::after { opacity: 0; }

/* Progress/drill-in gold guide: same perch as the checklist editor's — upper
   right, half off the sheet edge, tucked under the hanging avatar. The anchor
   is a zero-height positioned row placed right under the page <h1>;
   z 41 = above the title band (40), below the pinned header (90). */
.cl-help-anchor { position: relative; z-index: 41; height: 0; }
.cl-help-anchor .sancom-help { position: absolute; top: -50px; right: -30px; }
@media (max-width: 640px) {
    .cl-help-anchor .sancom-help { top: -46px; right: -8px; }
}

/* Checklist editor header row: intro text (left) + "Manage categories" action
   pinned top-right, flush to the content/header right edge. Stacks below the
   intro on narrow windows. */
.sancom-checklist-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.sancom-checklist-head .sancom-checklist-managecats { flex: 0 0 auto; white-space: nowrap; position: relative; }
/* Wide screens: LIFT the button cluster up over the (empty) right side of the
   title band so its top aligns with the page title; the gold guide floats
   higher still and further right (deliberately not aligned with the buttons).
   z 41 = above the title band (40), below the pinned header (90). */
@media (min-width: 641px) {
    .sancom-checklist-head .sancom-checklist-managecats { margin-top: -64px; z-index: 41; }
    .sancom-checklist-head .sancom-help { position: absolute; top: -6px; right: -30px; }
}
@media (max-width: 640px) {
    .sancom-checklist-head { flex-direction: column; }
}

/* ---- Buttons ---- */
.sancom-btn {
    display: inline-block; cursor: pointer; border: 0;
    font: inherit; font-weight: 600; line-height: 1;
    padding: 12px 20px; border-radius: var(--radius-sm);
    background: var(--color-primary); color: #fff; text-decoration: none;
    transition: background 0.15s ease;
}
.sancom-btn:hover { background: var(--color-primary-dark); text-decoration: none; }
.sancom-btn-secondary { background: var(--color-secondary); }
.sancom-btn-secondary:hover { background: var(--color-secondary-dark); }
.sancom-btn-ghost { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }
.sancom-btn-ghost:hover { background: var(--color-primary-light); }
/* Beige variant — matches the page background of the photo/beige look, so the
   button reads as part of the sheet (Progress page Print/Edit). */
.sancom-btn-beige { background: var(--bgimg-beige, #f4eee2); color: var(--color-primary-dark); border: 1px solid var(--color-border); }
.sancom-btn-beige:hover { background: #eae1cd; }
/* Small, subdued variant (version-row actions: Publish / Update all client lists /
   the drill-in Sync). MUST stay AFTER .sancom-btn/.sancom-btn-ghost — equal specificity,
   so source order is what lets its padding override the base 12px/20px. */
.sancom-btn-sm { padding: 6px 12px; font-size: 0.78rem; font-weight: 500; }
/* Borderless text-link button: looks/behaves like an <a>. Bolder on hover via
   in-place text-stroke (same glyph, no reflow, no underline) — the same outline
   technique as `.sancom-nav a.active`, so hover never nudges neighbouring text. */
.sancom-btn-link {
    background: none; border: 0; padding: 0; cursor: pointer;
    font: inherit; color: var(--color-primary);
}
.sancom-btn-link:not(:disabled):hover { -webkit-text-stroke: 0.6px currentColor; text-decoration: none; }
.sancom-btn-link:disabled { opacity: 0.4; cursor: not-allowed; }
/* Toggle-label action links (Activate/Deactivate, Reset/Clear reset): reserve
   the width of the WIDER label so flipping states never reflows the row — the
   ` · ` separators and impersonate icon then hold their column. */
.sancom-btn-toggle { display: inline-block; min-width: 5.5em; text-align: left; }
.sancom-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tabs (e.g. schedule.php: My Appointments | Schedule Coach). A row of links;
   the active one gets an accent underline + bold via the in-place text-stroke
   trick (same glyph, no reflow — matches .sancom-nav a.active). The bar STICKS just
   below the pinned page <h1> (offset = --hdr-h + --pgh1-h, the same anchor the
   Glossary category heads use) with an opaque background so content scrolls
   under it; there's only one bar, so nothing bumps it. */
.sancom-tabs {
    display: flex; gap: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: calc(var(--hdr-h, 67px) + var(--pgh1-h, 45px)); z-index: 30;
    background: var(--color-bg);
}
.sancom-tab {
    padding: 8px 2px; margin-bottom: -1px;
    color: var(--color-text-muted); border-bottom: 2px solid transparent;
}
.sancom-tab:hover { color: var(--color-primary-dark); text-decoration: none; }
.sancom-tab.active {
    color: var(--color-primary-dark); border-bottom-color: var(--color-primary);
    -webkit-text-stroke: 0.6px currentColor;
}

/* ---- Cards ---- */
.sancom-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md);
}
.sancom-card-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sancom-card h3 { color: var(--color-primary-dark); }

/* Instructional cards get an accent edge so they stand out. */
/* Intro/instruction copy (Terms/Links/Build/Progress): a full-bleed green band —
   the negative horizontal margins exactly cancel .sancom-container's --space-md
   padding, so the tint runs sheet-edge to sheet-edge (square corners, no
   off-white gutters) while the text stays left-aligned with the page content.
   No border, shadow, or accent bar. */
.sancom-intro {
    background: var(--color-secondary-light);
    padding: 10px var(--space-md);
    margin: var(--space-sm) calc(-1 * var(--space-md)) var(--space-md);
}

/* Clickable dashboard tiles: the whole card is a link that lifts on hover. */
.sancom-card-link {
    display: block; text-decoration: none; color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.sancom-card-link:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 5px 12px rgba(52, 49, 45, 0.075);
    border-color: var(--color-primary);
    text-decoration: none;
}
.sancom-card-link:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.sancom-card-link :last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .sancom-card-link { transition: none; } .sancom-card-link:hover { transform: none; } }

/* ---- Forms ---- */
.sancom-form label { display: block; font-weight: 600; margin-bottom: var(--space-xs); color: var(--color-heading); }
.sancom-form .sancom-field { margin-bottom: var(--space-md); }
.sancom-form input[type=text], .sancom-form input[type=email], .sancom-form input[type=password],
.sancom-form input[type=tel], .sancom-form input[type=date], .sancom-form input[type=time],
.sancom-form select, .sancom-form textarea {
    /* No font styling on inputs: they use the browser's default input font so the
       browser's autofilled value and the committed value render at the same size
       (avoids the "text grows on click" jump). Trade-off: inputs are the browser
       default size, not the 16px site font. */
    width: 100%; padding: 11px 12px; color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.sancom-form input:focus, .sancom-form select:focus, .sancom-form textarea:focus {
    outline: none; border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}
/* Time inputs keep the styled grey/rounded border but stay compact — auto width
   and tighter padding, so they sit smaller than the full-width date fields. */
.sancom-form input[type=time] { width: auto; padding: 7px 10px; }

/* Password field with a show/hide (eye) toggle inside the input. */
.sancom-pw-wrap { position: relative; }
.sancom-form .sancom-pw-wrap input { padding-right: 44px; }
.sancom-pw-toggle {
    position: absolute; top: 0; right: 0; height: 100%; width: 40px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; cursor: pointer; padding: 0;
    color: var(--color-text-muted);
}
.sancom-pw-toggle:hover, .sancom-pw-toggle:focus-visible { color: var(--color-primary); }
.sancom-pw-toggle svg { width: 20px; height: 20px; }
.sancom-pw-toggle .sancom-pw-icon-hide { display: none; }
.sancom-pw-toggle[aria-pressed="true"] .sancom-pw-icon-show { display: none; }
.sancom-pw-toggle[aria-pressed="true"] .sancom-pw-icon-hide { display: block; }

/* ---- Flash messages ---- */
.sancom-flash { padding: 12px var(--space-md); border-radius: var(--radius-sm); margin-bottom: var(--space-md); }
.sancom-flash-success { background: var(--color-secondary-light); color: var(--color-secondary-dark); }
.sancom-flash-error   { background: var(--color-error-light);     color: var(--color-error); }
.sancom-flash-info    { background: var(--color-info-light);      color: var(--color-info); }
/* Confirmation toast: a light-yellow "post-it" square — centered a third of the
   way down the window, generous padding, offset drop shadow, square corners.
   Dismisses after 3s or on any click (see layout_footer.php). */
.sancom-toast {
    position: fixed; top: 33vh; left: 50%; transform: translateX(-50%);
    z-index: 200;
    width: 220px; height: 200px; padding: 30px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: #fdf3cf; color: var(--color-heading);
    font-size: 1.05rem; line-height: 1.4;
    box-shadow: 3px 6px 16px rgba(52, 49, 45, 0.28);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.sancom-toast > div + div { margin-top: 8px; }
.sancom-toast.sancom-toast-leaving { opacity: 0; transform: translateX(-50%) translateY(-8px); }

/* ---- Progress bar ---- */
.sancom-progress { background: var(--color-border); border-radius: 999px; height: 12px; overflow: hidden; }
.sancom-progress > span { display: block; height: 100%; background: var(--color-primary); border-radius: 999px; transition: width 0.3s ease; }

/* ---- Tables ---- */
.sancom-table { width: 100%; border-collapse: collapse; background: var(--color-surface); }
/* Admin list tables: bare white rows read poorly on the off-white sheet, so
   each list table sits in a white rounded card (like the availability
   sections) — but with the first/last cell padding dropped, so row text
   aligns with the card's content edge instead of sitting 12px further in.
   The last row also loses its rule (no stray underline above the card's
   bottom padding). */
.sancom-card-table { padding: var(--space-sm) var(--space-md); }
.sancom-card-table .sancom-table th:first-child, .sancom-card-table .sancom-table td:first-child { padding-left: 0; }
.sancom-card-table .sancom-table th:last-child,  .sancom-card-table .sancom-table td:last-child  { padding-right: 0; }
/* A short page note set BESIDE the page title, inside the pinned h1 (Clients, Greg 2026-11-28): two
   small rows, muted, with a soft beige glow; it goes once the title shrinks on scroll. */
.sancom-h1-note { display: inline-block; vertical-align: middle; margin-left: var(--space-md);
    position: relative; top: -3.5px;   /* nudged up (Greg, 2026-11-28) */
    font-size: 0.85rem; font-weight: 400; line-height: 1.35; color: var(--color-text-muted); }
.sancom-bgimg .sancom-h1-note { text-shadow: 0 0 3px var(--bgimg-beige), 0 0 6px var(--bgimg-beige), 0 0 12px var(--bgimg-beige); }
html.sancom-scrolled .sancom-h1-note { display: none; }
.sancom-card-table .sancom-table tbody tr:last-child td { border-bottom: 0; }
.sancom-table th, .sancom-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.sancom-table th { color: var(--color-heading); font-family: var(--font-head); font-weight: 600; }
/* Compact variant: smaller line-item text (e.g. the Upcoming time off list). */
.sancom-table-sm th, .sancom-table-sm td { font-size: 0.85rem; padding: 7px 12px; }

/* Clickable appointment rows (Schedules › Appointments → meeting notes). The
   whole row navigates (admin_logs.js); the When cell has a real <a> for keyboard
   + new-tab. Past rows are greyed (muted, still legible/clickable). */
.sancom-table tr[data-href] { cursor: pointer; }
.sancom-table tr[data-href]:hover td { background: var(--color-primary-light); }
.sancom-table tr.is-past td { color: var(--color-text-muted); }
.sancom-appt-open { color: inherit; text-decoration: none; }
.sancom-table tr[data-href]:hover .sancom-appt-open { color: var(--color-primary-dark); }

/* Meeting-notes page (appointment.php): read-only note text, revision history,
   and the previous-meetings look-back. */
.sancom-appt-detail { font-weight: 500; color: var(--color-heading); font-size: 1.05rem; }
.sancom-appt-when { font-size: 0.9em; }
.sancom-note-ro { white-space: pre-wrap; }
.sancom-note-editmeta { font-weight: normal; font-size: 0.78em; color: var(--color-text-muted); }
.sancom-note-rev { padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.sancom-note-rev:last-child { border-bottom: 0; }
/* Change-history categories: a thick 3px rule above each field heading and a
   thin rule under the section (same weights as the Glossary category heads). */
.sancom-hist-cat { border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-sm); }
.sancom-hist-cat-head { margin: 0 0 var(--space-xs); padding-top: var(--space-sm);
    border-top: 3px solid var(--color-border); font-size: 1.05rem; }
.sancom-note-rev-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 2px; }
.sancom-prior-meeting { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.sancom-prior-meeting:last-child { border-bottom: 0; }
.sancom-prior-head { font-weight: 500; color: var(--color-heading); margin-bottom: 4px; }
.sancom-prior-field { margin: 2px 0; }

/* Triangle controls: a stacked up/down pair where each triangle is its own
   click target — admin Users column sort (pick a direction) and admin Links
   reorder (move up / move down). Triangles are 50% grey at rest, full grey on
   hover or when active (the current sort direction). */
.sancom-sortable { display: inline-flex; align-items: center; }
.sancom-tri-stack { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.sancom-sortable .sancom-tri-stack { margin-left: 9px; }    /* Users: gap between header label and arrows */
.sancom-tri-stack-up { transform: translateY(-10%); gap: 6px; }   /* Links: nudge up + a touch more space between arrows */
.sancom-tri-stack form { display: block; line-height: 0; margin: 0; }
.sancom-sort-btn, .sancom-link-arrow {
    background: none; border: 0; padding: 0; cursor: pointer; line-height: 0;
    color: var(--color-text-muted);
}
.sancom-sort-btn  { --tri-w: 4.8px; --tri-h: 6px; }   /* Users: 20% larger than base 4/5 */
.sancom-link-arrow { --tri-w: 8px;  --tri-h: 10px; }  /* Links: twice the base */
.sancom-tri { display: block; width: 0; height: 0; opacity: 0.5;
    border-left: var(--tri-w, 4px) solid transparent; border-right: var(--tri-w, 4px) solid transparent; }
.sancom-tri-up   { border-bottom: var(--tri-h, 5px) solid currentColor; }
.sancom-tri-down { border-top: var(--tri-h, 5px) solid currentColor; }
.sancom-sort-btn:not(:disabled):hover .sancom-tri,
.sancom-link-arrow:not(:disabled):hover .sancom-tri { opacity: 1; }
.sancom-sort-btn.sancom-active .sancom-tri { opacity: 1; }
/* Disabled reorder arrow (first row's up / last row's down): hidden but still
   occupies its slot so the remaining arrow stays put across rows. */
.sancom-sort-btn:disabled .sancom-tri, .sancom-link-arrow:disabled .sancom-tri { visibility: hidden; }
.sancom-sort-btn:disabled, .sancom-link-arrow:disabled { cursor: default; }
.sancom-filter-row th { padding-top: 4px; padding-bottom: 8px; font-weight: 400; }
.sancom-filter {
    width: 100%; font: inherit; font-size: 0.85em; padding: 4px 6px;
    color: var(--color-text); background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}

/* ---- Hero (home page) ---- */
.sancom-hero { padding: var(--space-xl) 0; text-align: center; }
.sancom-hero h1 { font-size: 2.4rem; }
.sancom-hero .sancom-lead { max-width: 720px; margin: 0 auto var(--space-md); color: var(--color-text); }
/* Home page type (2026-11-07, after Greg's mock-up): left-aligned;
   big title, a thin green rule, one bold statement, then the body; cards two across with larger
   bold headings and slightly heavier body text. Our fonts and colours, the mock-up's sizes.
   Every rule is scoped to a .sancom-home-* class, so no other page is affected. */
.sancom-home-hero { text-align: left; }
/* every public page's title: the site's h1 size (2rem, as "Log In"), Greg 2026-11-07 */
.sancom-home-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: var(--space-md); }
.sancom-home-statement { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; line-height: 1.3;
    color: var(--color-heading); margin: 0 0 var(--space-md);
    padding-top: var(--space-md); border-top: 3px solid var(--color-secondary); }
/* the bold statement gets the same soft beige glow as the lead text below it (photo on) */
.sancom-bgimg .sancom-home-statement {
    text-shadow:
        0 0 3px var(--bgimg-beige), 0 0 6px var(--bgimg-beige),
        0 0 12px var(--bgimg-beige);
}
.sancom-home-hero .sancom-lead { max-width: none; margin: 0 0 var(--space-sm); font-size: 1.1rem; }
.sancom-home-hero .sancom-lead.sancom-home-small { font-size: 1rem; margin-bottom: var(--space-md); }
.sancom-home-cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.sancom-home-cards h3 { font-size: 1.45rem; font-weight: 800; margin-bottom: 0.3em; }
.sancom-home-cards p { font-size: 1.05rem; font-weight: 500; line-height: 1.45; margin: 0; }

/* SECTION: PUBLIC INFO PAGES (How It Works / What's Included / About, 2026-11-07, Greg's
   mock-ups). They reuse the home page's classes above (.sancom-home-hero, -statement,
   -cards) so all four pages adjust together; the pieces below are theirs alone. */
.sancom-home-cards p + p { margin-top: 0.5em; }
/* a section heading sitting on the photo (outside the glass): heading size + halo */
.sancom-home-h2 { font-size: 2rem;   /* = the site h1 / home title (Greg 2026-11-07) */ font-weight: 800; margin: var(--space-lg) 0 var(--space-md); }
.sancom-bgimg .sancom-home-h2 { text-shadow: 0 0 3px var(--bgimg-beige), 0 0 8px var(--bgimg-beige), 0 0 16px var(--bgimg-beige); }
/* ...or in a white box of its own (How It Works + About, Greg 2026-11-28): a .sancom-card (so it
   takes the cards' white glass and white text glow), centred, only as wide as the words + padding,
   no glow around the box (Greg, 2026-11-28), the white glow on its words only. */
.sancom-home-h2-box { width: fit-content; max-width: 100%; margin-inline: auto; text-align: center;
    color: var(--color-primary-dark);   /* the dark blue of the card headings below */
    padding-block: calc(var(--space-md) / 2); }   /* half the cards' 20px top and bottom (Greg, 2026-11-28) */
/* h2 version of the bold statement (About: "Why we created Steady Ahead") */
h2.sancom-home-statement { font-size: 1.5rem; }
/* "Does this sound familiar?" — the four quotes, two across */
.sancom-home-quotes { list-style: none; padding: 0; margin: 0 0 var(--space-md);
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm) var(--space-lg); }
@media (max-width: 560px) { .sancom-home-quotes { grid-template-columns: 1fr; } }
.sancom-home-quotes li { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; line-height: 1.3;
    color: var(--color-heading); position: relative; padding-left: 1.1em; }
/* a green bullet before each quote (Greg, 2026-11-28; was a green bar on the left) */
.sancom-home-quotes li::before { content: ""; position: absolute; left: 0.15em; top: 0.45em;
    width: 0.45em; height: 0.45em; border-radius: 50%; background: var(--color-secondary); }
/* numbered steps: the number in a circle beside each card's heading */
ol.sancom-home-steps { list-style: none; padding: 0; margin: 0; }
.sancom-home-step { display: flex; gap: var(--space-sm); align-items: flex-start; }
.sancom-home-num { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-secondary); color: #fff; font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; }
/* plans: the heading with its price on the right */
.sancom-home-plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); margin-bottom: 0.3em; }
.sancom-home-plan-head h3 { margin: 0; }
.sancom-home-price { flex: none; background: var(--color-secondary); color: #fff; border-radius: var(--radius-md);
    padding: 2px 12px; font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
/* The green price badges, step circles and the "Get Started" button get the WHITE glow around their
   shape -- the same layers as --text-glow-white, as a box-shadow (Greg, 2026-11-27). */
.sancom-bgimg :is(.sancom-home-price, .sancom-home-num, .sancom-home-cta .sancom-btn) {
    box-shadow: 0 0 2px #fff, 0 0 4px #fff, 0 0 8px #fff, 0 0 14px #fff;
}
.sancom-home-cards p.sancom-home-note { color: var(--color-secondary-dark); font-weight: 700; }
/* founders: one per row; the role line under the name */
.sancom-home-founders { grid-template-columns: 1fr; }
.sancom-home-cards p.sancom-home-role { color: var(--color-secondary-dark); font-weight: 700; margin: -0.2em 0 0.4em; }
/* the closing "Get Started" button and line */
.sancom-home-cta { text-align: center; margin: var(--space-lg) 0 var(--space-md); }
.sancom-home-cta .sancom-btn { font-size: 1.25rem; padding: 12px 40px; }
.sancom-home-closing { text-align: center; font-family: var(--font-head); font-size: 1.1rem; font-weight: 600;
    color: var(--color-heading); margin: 0 0 var(--space-md); }
.sancom-bgimg .sancom-home-closing {   /* the rail tagline's treatment FLIPPED to beige (Greg, 2026-11-27):
                                          dark-grey words, a beige glow and a beige pool, matching the
                                          photo's own beige fades at the side and bottom */
    color: var(--color-heading); text-shadow: var(--text-glow-beige);
    position: relative; isolation: isolate; width: fit-content; margin-inline: auto; padding: 0 12px;
}
.sancom-bgimg .sancom-home-closing::before {   /* an edgeless beige pool, sized to the line */
    content: ""; position: absolute; inset: -110% -18%; z-index: -1; background: var(--light-pool);
}
/* the button above sits OVER the closing line's pool (which reaches up behind it) */
.sancom-home-cta { position: relative; z-index: 2; }

/* ============================================================================
   GLOSSARY — auto-linked terms + definition modal
   ========================================================================= */
.sancom-term { color: var(--color-primary-dark); text-decoration: underline; cursor: pointer; }

.sancom-modal-overlay {
    position: absolute; top: 0; left: 0; right: 0; background: rgba(52, 49, 45, 0.45);
    /* Absolute (not fixed) so the popup scrolls WITH the page; terms.js sets the
       overlay height + the card's vertical offset (near the clicked link). A tall
       card extends down the page and is reached by scrolling, not clamped. */
    display: none; align-items: flex-start; justify-content: center; padding: 0 var(--space-md) var(--space-md); z-index: 1000;
}
.sancom-modal-overlay.open { display: flex; }
.sancom-modal {
    background: var(--color-surface); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); max-width: 480px; width: 100%;
    padding: var(--space-lg); position: relative;
}
.sancom-modal-close {
    position: absolute; top: 10px; right: 14px; cursor: pointer;
    background: none; border: 0; font-size: 1.4rem; line-height: 1; color: var(--color-primary);
}
.sancom-modal-close:hover { color: var(--color-primary-dark); }
.sancom-modal h3 { margin-top: 0; }
.sancom-modal .sancom-modal-abbr { color: var(--color-text-muted); font-weight: 400; }
.sancom-modal .sancom-modal-section { margin-top: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--color-border); font-size: 0.92rem; }
.sancom-modal .sancom-modal-label { font-weight: 600; color: var(--color-secondary-dark); }

/* ---- Term popup: stacked names, relationship rail, tiers (Layout A) ---- */
.sancom-term-modal { max-width: 640px; }
/* Absolutely positioned to mirror the × (top:10px): aligns horizontally with it
   and keeps the name stack in the same place whether or not Back is shown. The
   1.4rem line-height matches the ×'s box so the smaller text centers with it. */
.sancom-term-back { position: absolute; top: 10px; left: 14px; z-index: 1; background: none; border: 0; color: var(--color-primary); cursor: pointer; margin: 0; padding: 0; font-family: inherit; font-size: 0.85rem; line-height: 1.4rem; font-weight: 600; }
.sancom-term-back:hover { color: var(--color-primary-dark); }
.sancom-term-head { margin-bottom: var(--space-sm); }
.sancom-term-head .sancom-tn { font-family: var(--font-body); font-size: 1.05rem; font-weight: 600; color: var(--color-heading); line-height: 1.45; }
.sancom-tn-sep, .sancom-tn-eq { color: var(--color-text-muted); font-weight: 400; }
.sancom-tn-foot { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }
.sancom-term-def { color: var(--color-text); }
.sancom-term-aside { margin-top: var(--space-md); }
.sancom-rel { margin-bottom: var(--space-sm); }
.sancom-rel-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 5px; }
.sancom-term-chip { display: inline-block; margin: 0 6px 6px 0; padding: 2px 11px 4px; border-radius: var(--radius-md); background: var(--color-primary-light); color: var(--color-primary-dark); font-size: 0.85rem; line-height: 1.3; text-decoration: none; }
.sancom-term-chip:hover { background: var(--color-secondary-light); }
.sancom-term-compare, .sancom-term-more { margin-top: var(--space-sm); border-top: 1px solid var(--color-border); padding-top: var(--space-sm); }
.sancom-term-compare > summary, .sancom-term-more > summary { cursor: pointer; font-weight: 600; color: var(--color-primary-dark); }
.sancom-term-compare > div, .sancom-term-more > div { margin-top: var(--space-xs); color: var(--color-text); }
.sancom-term-modal a[target="_blank"] { word-break: break-word; }

/* Two-column on wider screens: text (definition + detail) left, relationship rail
   right. The left text is one grid cell so "Read more" sits directly under the
   definition and its position never depends on the rail's height (no jump). */
@media (min-width: 560px) {
    .sancom-term-grid.sancom-has-aside {
        display: grid; grid-template-columns: 1fr 190px; gap: 0 var(--space-lg); align-items: start;
        grid-template-areas: "head head" "body aside";
    }
    .sancom-term-grid.sancom-has-aside .sancom-term-head  { grid-area: head; }
    .sancom-term-grid.sancom-has-aside .sancom-term-body  { grid-area: body; }
    .sancom-term-grid.sancom-has-aside .sancom-term-aside { grid-area: aside; margin-top: 0; border-left: 1px solid var(--color-border); padding-left: var(--space-md); }
}

/* ---- Terms page: line-item list ---- */
.sancom-term-list { list-style: none; margin: var(--space-md) 0 0; padding: 0; }
.sancom-term-list li { margin-bottom: var(--space-xs); }
.sancom-term-row {
    display: block; padding: 12px 14px; border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); background: var(--color-surface);
    text-decoration: none; color: var(--color-text);
}
.sancom-term-row:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
/* The clickable part (name + definition) is an <a> INSIDE the white box, so a bucket's
   "All states" list can sit inside the same box without being part of the popup link. */
.sancom-term-row-link { display: block; text-decoration: none; color: inherit; }
.sancom-term-row-name { display: block; font-family: var(--font-body); font-weight: 600; color: var(--color-heading); }
.sancom-term-row-sep { color: var(--color-text-muted); font-weight: 400; }
.sancom-term-row-def { display: block; font-size: 0.92rem; color: var(--color-text-muted); margin-top: 2px; }
/* "Same as:" — a term's other interchangeable names, indented under the
   primary name, one per row (the label sits beside the first). */
.sancom-term-row-same {
    display: flex; gap: 6px;
    padding-left: var(--space-md);
    font-size: 0.82rem; color: var(--color-text-muted); font-weight: 400; margin-top: 1px;
}
.sancom-term-row-same-label { white-space: nowrap; }
.sancom-term-row-same-names { display: flex; flex-direction: column; }

/* Glossary category sections (terms.php). Each heading STICKS just below the
   pinned page <h1> while its own section scrolls (top = the JS-published
   --hdr-h + --pgh1-h, so it tracks the header/title shrink); the THICK rule
   above + hairline below travel with it. Background bleeds sheet-edge to
   sheet-edge (the .sancom-intro negative-margin trick) so rows slide cleanly
   underneath. z-index below the h1's 40. The between-category space is
   PADDING-bottom on the section's LAST CONTENT CHILD (the list / empty note),
   not a margin on the section: a stuck heading is confined to its section's
   CONTENT box, and child padding is part of that box (margins and the
   section's own padding are not), so the sticky range runs right up to the
   next section and the NEXT category heading pushes the previous one away
   directly — no dead gap where neither is pinned. Don't move this space to a
   section margin/padding. */
#sancom-term-groups { margin-top: var(--space-lg); }
.sancom-term-cat .sancom-term-list,
.sancom-term-cat .sancom-term-cat-empty { padding-bottom: var(--space-lg); }
.sancom-term-cat:last-child .sancom-term-list,
.sancom-term-cat:last-child .sancom-term-cat-empty { padding-bottom: 0; }
/* Glossary: FormWatch state names (INTEGRATION.md D26). Our wording is shown in
   square brackets for everyone -- .sancom-ours is the ONLY place the brackets are styled;
   they are typed by includes/formwatch_data.php fw_headline(), never in data. The
   staff picker sits on the right of the pinned Glossary title. */
.sancom-ours { color: var(--color-muted, #5b6470); font-weight: 500; }
/* margin-right keeps the picker clear of the header's avatar (76px slot) once the title is stuck;
   below 720px the avatar is hidden (see the header rules above), so the picker sits flush with the
   right edge of the content -- the h1's own padding is the same --space-md the body's boxes use. */
.sancom-h1-tools { float: right; font-size: 0.5em; font-weight: 400; font-family: var(--font-body); margin-top: 0.55em; margin-right: 76px; }
@media (max-width: 720px) { .sancom-h1-tools { margin-right: 30px; } }   /* room for the gold ? help button at the edge */
.sancom-h1-tools label { margin-right: 6px; }
.sancom-h1-tools select { font: inherit; padding: 3px 6px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); }
html.sancom-scrolled .sancom-h1-tools { font-size: 0.7em; margin-top: 0.2em; }
.sancom-term-row-team { font-weight: 400; font-size: 0.9em; }
.sancom-term-row-fwnote { display: block; font-size: 0.9em; margin: 2px 0; }
/* Glossary search (2026-09-29): a row found through a name that is not the reader's
   own says so on a lightly tinted line; in the staff Buckets view the matching
   state name inside "All states" is highlighted the same way. */
.sancom-term-row-searchnote {
    display: block; font-size: 0.9em; margin: 4px 0 2px; padding: 3px 8px;
    border-radius: 6px; background: rgba(229, 171, 0, 0.14); color: var(--color-text);
}
.sancom-term-row-searchnote[hidden] { display: none; }
.sancom-term-var-hit { background: rgba(229, 171, 0, 0.18); border-radius: 4px; }
.sancom-term-variations { margin: 8px 0 0; padding-top: 6px; border-top: 1px dashed var(--color-border); font-size: 0.92em; }
.sancom-term-variations summary { cursor: pointer; }
.sancom-term-variations ul { list-style: none; margin: 4px 0 0; padding: 0 0 0 12px; }
.sancom-term-variations li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 2px 0; }
.sancom-term-var-name { flex: 1 1 auto; }
/* Shrinkable + wrapping (2026-10-03): a long list (the 45-state "our term applies" line) wraps onto its
   own line inside the card instead of running off the page; a short list stays beside the name. */
.sancom-term-var-states { flex: 0 1 auto; min-width: 0; max-width: 100%; letter-spacing: 0.04em; font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; }
.sancom-tn-fw { font-weight: 700; }
.sancom-term-fwnote { font-size: 0.92em; margin-top: 6px; }

.sancom-term-cat-head {
    position: sticky; top: calc(var(--hdr-h, 67px) + var(--pgh1-h, 45px)); z-index: 30;
    background: var(--color-bg);
    font-size: 1.15rem;
    margin: 0 calc(-1 * var(--space-md));
    padding: var(--space-xs) var(--space-md);
    border-top: 3px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.sancom-term-cat-empty { font-size: 0.92rem; margin: var(--space-xs) 0 0; }
/* Optional "why it matters" intro under a section heading — same size AND same
   muted shade as a term definition (matches .sancom-term-row-def). */
.sancom-term-cat-desc { font-size: 0.92rem; color: var(--color-text-muted); margin: var(--space-sm) 0 var(--space-md); }
#sancom-term-search { padding: 11px 12px; font: inherit; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
#sancom-term-search:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
/* The suggestion text: about half as dark as typed text (Greg, 2026-11-08). */
#sancom-term-search::placeholder { color: var(--color-text); opacity: 0.5; }

/* ---- Links page ---- */
.sancom-link-list { list-style: none; margin: 0; padding: 0; }
.sancom-link-list li { margin-bottom: var(--space-sm); }
.sancom-link-list li:last-child { margin-bottom: 0; }   /* flush with the glass panel's padding (2026-11-28) */
.sancom-link-list li a { font-family: var(--font-head); font-weight: 600; }

/* ---- Utilities ---- */
.sancom-muted { color: var(--color-text-muted); }
.sancom-mt { margin-top: var(--space-md); }
.sancom-center { text-align: center; }
.sancom-row { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }

/* =============================================================================
   SECTION: BACKGROUND IMAGE (beige frame + photo vignette; 2026-08-06)
   =============================================================================
   The page background becomes a fixed, centered, --maxw-capped BEIGE frame
   (this replaces the .sancom-container "sheet" — the container goes transparent)
   with a photo vignette over it on the LEFT (fading rightward into the beige),
   at every width (no top band since 2026-11-22). All geometry is
   anchored against --maxw, so the image is STATIC while the
   window narrows and the CONTENT keeps its full-frame width (--maxw * 0.78) —
   the rail is leftover space and shrinks first (content-first rule: nothing
   the user reads ever shrinks when the window grows). The tagline in the rail
   appears only when the rail can hold it (>= ~200px). The image file carries
   a baked-in bottom alpha fade, and two mirrored copies continue it sideways
   so it never ends on a hard edge.

   KILL SWITCH: everything here is gated on body.sancom-bgimg, set in
   layout_header.php ($sancomBgImage — define('SANCOM_BG_IMAGE', false) in config.php
   to turn the whole system off). Tuning tool: /bg_playground.html (same
   variable model; standalone, not linked from the app).
   ============================================================================= */
body.sancom-bgimg {
    --bgimg-beige: #f4eee2;
    /* The translucency ladder — the ONLY levels in use; add no others.
       glass  = frosted section panels (pairs with blur(7px))
       cell   = static data surfaces on glass (calendar cells, DOW headers)
       chrome = sticky bands content scrolls under (title, tabs, cat heads)
       (fully solid surfaces use --bgimg-beige itself) */
    --surface-glass:  rgba(244, 238, 226, 0.84375);  /* 0.3 until 2026-10-19, then 0.375; 2026-11-11 Greg: half the see-through (62.5% -> 31.25%); 2026-11-12 halved again (-> 15.6%): almost solid, a little see-through */
    --surface-cell:   rgba(255, 255, 255, 0.78);
    --surface-chrome: rgba(244, 238, 226, 0.92);
    /* The soft TEXT GLOW for text sitting on glass (Greg, 2026-11-12): a lighter cream than the
       glass, because a beige glow vanished into the beige glass once it got more opaque (11-11). */
    --glow-cream: #fffdf7;
    --text-glow: 0 0 2px var(--glow-cream), 0 0 4px var(--glow-cream), 0 0 8px var(--glow-cream), 0 0 14px var(--glow-cream);
    /* ...and its WHITE twin for text on the see-through WHITE surfaces (Greg, 2026-11-22): each
       surface's glow matches its own colour -- cream on the beige glass, white on white. */
    --text-glow-white: 0 0 2px #fff, 0 0 4px #fff, 0 0 8px #fff, 0 0 14px #fff;
    /* ...and the DARK glow for white words straight on the photo (the rail tagline; Greg 2026-11-27). Layers STACK: tight, fully dark ones hug the letters, the
       wide ones are doubled so the wide spread stays dark. Pairs with the shade pool (below). */
    --text-glow-dark:
        0 0 2px rgba(22, 20, 18, 1), 0 0 2px rgba(22, 20, 18, 1),
        0 0 5px rgba(22, 20, 18, 1), 0 0 5px rgba(22, 20, 18, 0.9),
        0 0 12px rgba(22, 20, 18, 0.95), 0 0 12px rgba(22, 20, 18, 0.8),
        0 0 24px rgba(22, 20, 18, 0.85), 0 0 24px rgba(22, 20, 18, 0.7),
        0 0 48px rgba(22, 20, 18, 0.7), 0 0 48px rgba(22, 20, 18, 0.5),
        0 0 80px rgba(22, 20, 18, 0.55), 0 0 80px rgba(22, 20, 18, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.8);
    --shade-pool: radial-gradient(closest-side, rgba(28, 26, 23, 0.7), rgba(28, 26, 23, 0.45) 55%, rgba(28, 26, 23, 0) 100%);
    /* the same pair in BEIGE, for DARK words on the photo (the public pages' closing line) */
    --text-glow-beige:
        0 0 2px rgb(244, 238, 226), 0 0 2px rgb(244, 238, 226),
        0 0 5px rgb(244, 238, 226), 0 0 5px rgba(244, 238, 226, 0.9),
        0 0 12px rgba(244, 238, 226, 0.95), 0 0 12px rgba(244, 238, 226, 0.8),
        0 0 24px rgba(244, 238, 226, 0.85), 0 0 24px rgba(244, 238, 226, 0.7),
        0 0 48px rgba(244, 238, 226, 0.7), 0 0 48px rgba(244, 238, 226, 0.5),
        0 0 80px rgba(244, 238, 226, 0.55), 0 0 80px rgba(244, 238, 226, 0.4);
    --light-pool: radial-gradient(closest-side, rgba(244, 238, 226, 0.8), rgba(244, 238, 226, 0.5) 55%, rgba(244, 238, 226, 0) 100%);
}
/* Wide/admin pages have NO glass panel beneath their surfaces, so the cell
   token compensates: roughly half the see-through (11% vs 22%). A straight
   coverage-equivalent alpha (0.846) would still read busier than the glassed
   pages, because the glass also BLURS the photo — sharp detail needs a
   heavier veil than blurred detail. Same token, context-tuned: not a new level. */
body.sancom-bgimg.sancom-bg-wide,
.sancom-bgimg .sancom-cell-solo { --surface-cell: rgba(255, 255, 255, 0.92); }
/* ^ .sancom-cell-solo: the same no-glass tuning for an individual card on an
   otherwise-glassed/rail page (e.g. the staff Clients roster table). */

/* The frame — document-anchored inside <main>, so like the old sheet it ENDS
   just above the footer, with rounded corners — but the IMAGE inside it is
   position: fixed, so it stays put while the page scrolls and the frame
   simply unveils it. That combination works because clip-path (unlike
   overflow) clips fixed descendants — which is also why the frame must NOT
   use transform for centering (a transformed ancestor would capture the
   fixed children and make them scroll), and why the shadow lives on an
   underlay below (the clip would swallow the frame's own shadow). */
body.sancom-bgimg { --bg-frame-left: max(0px, calc((100vw - var(--maxw)) / 2)); }
.sancom-bgimg main.sancom-main { position: relative; }
.sancom-bgimg .sancom-bg {
    position: absolute; top: 0; bottom: 0;
    left: var(--bg-frame-left);
    width: min(100vw, var(--maxw));
    z-index: -1;
    background: var(--bgimg-beige);
    /* flush to the header above; rounded only where the sheet ENDS */
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    clip-path: inset(0 round 0 0 var(--radius-md) var(--radius-md));
}
/* shadow underlay: same bounds as the frame, painted beneath it */
.sancom-bgimg main.sancom-main::before {
    content: ""; position: absolute; top: 0; bottom: 0;
    left: var(--bg-frame-left);
    width: min(100vw, var(--maxw));
    z-index: -2;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
}
/* the sheet look moves off the container onto the frame */
.sancom-bgimg main.sancom-main > .sancom-container { background: transparent; box-shadow: none; }

/* Image strip: main <img> + two scaleX(-1) copies butted on its edges.
   WIDE geometry — % of --maxw, so it's static px while the window narrows.
   The translate is % of the strip itself: that pairing pins image point
   (29%,58%) to frame point (11%, 58% of height).
   ONE PHOTO ON EVERY PAGE (Greg, 2026-11-22; public and logged-in alike):
   assets/bg_main.webp, cut from iStock-1130581290 with Greg's playground values
   (zoom 182% of --maxw, horizontal squeeze 68% and the bottom 15% alpha fade
   BAKED into the file; 2680x2630, WebP quality 65, 780KB = sharp on 2x screens at the
   widest it shows, 1337px. The original JPEG is NOT deployed). 1.2376 = 1.82 x 0.68.
   TOP STOPS AT THE HEADER: the focal pin would leave a beige gap under the
   header on tall windows, so top = the smaller of 58% of the visible height (--bg-vis-h: the window,
   or the frame's bottom on a page shorter than the window -- layout_footer.php) and the header's height
   + 58% of the image's height (0.7045 = 1.2376 x 0.9815 ratio x 0.58). */
.sancom-bg-strip {
    position: fixed;   /* viewport-anchored: static while the page scrolls */
    width: calc(var(--maxw) * 1.2376);
    left: calc(var(--bg-frame-left) + var(--maxw) * 0.11);
    top: min(calc(var(--bg-vis-h, 100vh) * 0.58), calc(var(--hdr-h, 0px) + var(--maxw) * 0.7045));
    transform: translate(-29%, -58%);
    transform-origin: 29% 58%;
    transition: left 0.6s ease, top 0.6s ease, width 0.6s ease, transform 0.6s ease;
}
.sancom-bg-strip img { display: block; width: 100%; height: auto; }
html.sancom-bg-noanim :is(.sancom-bg-strip, .sancom-bg-tagline) { transition: none; }   /* first placement (layout_footer.php) */
.sancom-bg-mir { position: absolute; top: 0; }
.sancom-bg-mir.is-r { left: calc(100% - 1px);  transform: scaleX(-1); }  /* 1px overlap: no sub-pixel seam */
.sancom-bg-mir.is-l { left: calc(-100% + 1px); transform: scaleX(-1); }

/* The fade above the image (fixed like the image it fades; clipped to the frame by its clip-path). */
.sancom-bg::before {
    content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
}
.sancom-bg::before {   /* wide: image -> beige, left to right (static px stops) */
    background: linear-gradient(to right,
        rgba(244, 238, 226, 0) calc(var(--bg-frame-left) + var(--maxw) * 0.64),
        var(--bgimg-beige) calc(var(--bg-frame-left) + var(--maxw) * 0.95));
}

/* Content-first column: content keeps --maxw * 0.78 at every wide size; the
   rail is whatever is left (this calc is CONTINUOUS across the breakpoint —
   it reaches --space-md right around 680px, so nothing jumps). */
.sancom-bgimg main.sancom-main > .sancom-container {
    padding-left: max(var(--space-md), calc(min(100vw, var(--maxw)) - var(--maxw) * 0.78));
    transition: padding-top 0.6s ease, padding-left 0.6s ease;
}

/* Wide opt-out ($bg_wide = true before the header include — admin pages):
   content takes the full sheet width with the standard container padding;
   the rail and its tagline are gone (the photo still peeks at the left
   edge before the fade). */
body.sancom-bg-wide main.sancom-main > .sancom-container { padding-left: var(--space-md); }

/* A page at least 72% of the window high, so the photo has room around a short page (Greg, 2026-11-28;
   the same minimum as the checklist step page, .cl-step-page in checklist.css). Wrap the content in it. */
.sancom-min-tall { min-height: 72vh; }
/* SECTION: CLIENT PAGE LAYOUT ($client_layout = true; Greg, 2026-11-28) -- the default for client pages:
   the page title 100px below the header (a margin on the title, so it still pins when scrolled) and the
   page at least 72% of the window high, so the photo has room around a short page. */
body.sancom-client-layout main.sancom-main > .sancom-container { min-height: 72vh; }
body.sancom-client-layout main.sancom-main > .sancom-container > h1:first-of-type { margin-top: 100px; }
/* Public pages (not login): the same 100px above their first box and the 72% minimum (Greg, 2026-11-28/29). */
body.sancom-public-spaced main.sancom-main > .sancom-container { min-height: 72vh; }
body.sancom-public-spaced main.sancom-main > .sancom-container > :first-child { margin-top: 100px; }
/* ...and its content a little above the middle, like the step page (padding-top 14vh; login.php, 2026-11-28). */
.sancom-min-tall.is-lowered { padding-top: clamp(24px, 14vh, 160px); }
/* The pinned title band sits slightly INSET from the sheet's left edge (half
   the container padding) while its text stays aligned with the body divs:
   half the negative bleed + half the padding = same text position. */
body.sancom-bg-wide main.sancom-main > .sancom-container > h1 {
    margin-left: calc(-0.5 * var(--space-md));
    padding-left: calc(var(--space-md) / 2 - 1px);   /* −1px: the band's border */
}

/* Tagline in the rail — only when the rail can hold it. */
.sancom-bg-tagline {
    position: fixed; z-index: 3; top: calc(var(--bg-vis-h, 100vh) * 0.66667);   /* fixed with the image it sits on; centred a THIRD from the bottom of the window, or of the frame on a page shorter than the window (Greg, 2026-11-28; was the middle) */
    transform: translateY(-50%);
    left: var(--bg-frame-left);
    width: calc(min(100vw, var(--maxw)) - var(--maxw) * 0.78);
    padding: 20px; text-align: center; color: #fff;
    /* Readable over any part of the photo (Greg, 2026-11-27; chosen from four trials): a deep, wide
       dark glow around the letters (twice the spread of the first trial) PLUS a soft pool of shade
       behind the words (::before), feathered into the photo with no edge, so it never reads as a
       card. Tried and dropped: a feathered frost (the browser ignores a fade on a backdrop blur, so it
       read as a box) and dark words in the sky (they landed on the dark hillside). */
    /* Layers STACK (a repeated shadow darkens it): tight, fully dark ones hug the letters, the wide
       ones are doubled so the wider spread is no lighter (Greg, 2026-11-27: twice the spread, at
       least as dark next to the letters). */
    text-shadow: var(--text-glow-dark);
    opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
.sancom-bg-tagline::before {
    content: ""; position: absolute; inset: -30% -25%; z-index: -1;
    background: var(--shade-pool);
}
.sancom-bg-tagline h2 { color: #fff; font-size: clamp(1.25rem, 2.2vw, 1.8rem); margin: 0; }   /* the only line since 2026-11-28 */
.sancom-bg-tagline p { font-size: 0.95rem; margin: 0; }
@media (min-width: 1042px) { .sancom-bgimg .sancom-bg-tagline { opacity: 1; } }

/* Sticky chrome that used to match the sheet color: translucent beige now,
   plus a beige halo on the pinned page title so it reads over the photo. */
.sancom-bgimg main.sancom-main > .sancom-container > h1 {
    background: var(--surface-chrome);
    border: 1px solid var(--color-border);       /* same hairline as glass/buttons */
    border-radius: var(--radius-md) 0 0 var(--radius-md);   /* left corners only —
        the right edge runs to the sheet edge, the left edge floats over the photo */
    text-shadow:
        1px 1px 0 var(--bgimg-beige), -1px -1px 0 var(--bgimg-beige),
        1px -1px 0 var(--bgimg-beige), -1px 1px 0 var(--bgimg-beige),
        0 0 6px var(--bgimg-beige), 0 0 14px var(--bgimg-beige);
}
.sancom-bgimg .sancom-tabs,
.sancom-bgimg .sancom-term-cat-head { background: var(--surface-chrome); }

/* Tab bar INSIDE a glass panel (schedule.php): fills the panel — flush to its
   top and side edges — and the ACTIVE tab is a cut-out "window" showing the
   panel surface (same frosted recipe as .sancom-glass), with no bar tint and no
   hairline under it. The tint + bottom hairline live on the SEGMENTS (leading
   spacer, inactive tabs, trailing filler), so the line simply stops at the
   active tab. */
.sancom-bgimg .sancom-glass > .sancom-tabs {
    --tab-drop: 6px;   /* how far the active tab sits below the bar's top */
    margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-md)) var(--space-md);
    padding: 0; gap: 0;
    /* SOLID beige strip across the very top — covers the gap above the
       lowered active tab; everywhere else the segments paint the bar */
    background: linear-gradient(var(--bgimg-beige), var(--bgimg-beige))
        top / 100% var(--tab-drop) no-repeat;
    border-bottom: 0;
    border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
    overflow: hidden;   /* clip the segment tints to the panel's top corners */
}
.sancom-bgimg .sancom-glass > .sancom-tabs::before,
.sancom-bgimg .sancom-glass > .sancom-tabs::after {
    content: ""; background: var(--bgimg-beige);
    border-bottom: 1px solid var(--color-border);
}
.sancom-bgimg .sancom-glass > .sancom-tabs::before { width: var(--space-md); flex: none; }  /* keeps the space before "My" */
.sancom-bgimg .sancom-glass > .sancom-tabs::after  { flex: 1; }
.sancom-bgimg .sancom-glass > .sancom-tabs .sancom-tab {
    background: var(--bgimg-beige);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0;
    padding: 10px 16px;
}
.sancom-bgimg .sancom-glass > .sancom-tabs .sancom-tab.active {
    /* outline only — no fill — the tab sits --tab-drop below the bar's top */
    --tab-r: calc(var(--radius-md) - 1px);
    position: relative;
    margin-top: var(--tab-drop);
    padding-top: 4px;   /* 6px drop + 4px = the inactive tabs' 10px, so the
                           tab titles stay on one baseline */
    background: transparent;
    border: 1px solid var(--color-border);
    border-bottom: 0;
    border-radius: var(--tab-r) var(--tab-r) 0 0;
}
/* The two pockets OUTSIDE the rounded shoulders: solid beige with a
   quarter-circle of transparency cut out, so they vanish against the
   neighbouring bar segments. Painted with pseudo-elements because the
   tab's own border-radius CLIPS its background exactly there. */
.sancom-bgimg .sancom-glass > .sancom-tabs .sancom-tab.active::before,
.sancom-bgimg .sancom-glass > .sancom-tabs .sancom-tab.active::after {
    content: ""; position: absolute; top: -1px;
    width: var(--tab-r); height: var(--tab-r);
}
.sancom-bgimg .sancom-glass > .sancom-tabs .sancom-tab.active::before {
    left: -1px;
    background: radial-gradient(circle at 100% 100%,
        transparent var(--tab-r), var(--bgimg-beige) var(--tab-r));
}
.sancom-bgimg .sancom-glass > .sancom-tabs .sancom-tab.active::after {
    right: -1px;
    background: radial-gradient(circle at 0 100%,
        transparent var(--tab-r), var(--bgimg-beige) var(--tab-r));
}

/* NARROW (< 680px, phones; Greg 2026-11-28, reversing 2026-11-22's "no narrow mode"): the photo
   moves to a BAND across the top, under the header, and fades DOWNWARD into the beige; the content
   gets headroom above its title so the band shows. The strip is the frame's width, its path (image
   point 29%, 58%) at the band's middle. Below 680px the rail and its tagline are already gone (the
   left padding reaches --space-md there on its own), so nothing jumps; the two fades cross-fade. */
.sancom-bg::after {    /* narrow: image -> beige, top to bottom */
    content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(to bottom,
        rgba(244, 238, 226, 0) calc(var(--hdr-h, 0px) + 9vh), var(--bgimg-beige) calc(var(--hdr-h, 0px) + 19vh));
    opacity: 0; transition: opacity 0.6s ease;
}
.sancom-bg::before { transition: opacity 0.6s ease; }
@media (max-width: 679px) {
    .sancom-bg-strip {
        width: min(100vw, var(--maxw));
        left: var(--bg-frame-left);
        top: calc(var(--hdr-h, 0px) + 11vh);   /* the path at the middle of the band that SHOWS (below the header, above the fade) */
        transform: translate(0, -58%);
    }
    .sancom-bgimg .sancom-bg::before { opacity: 0; }
    .sancom-bgimg .sancom-bg::after  { opacity: 1; }
    .sancom-bgimg main.sancom-main > .sancom-container {
        padding-left: var(--space-md);
        padding-top: calc(16px + 9vh);   /* image-only headroom above the title */
    }
    /* Client pages keep their own 100px above the title instead (Greg, 2026-11-28), so the title sits
       where it does on wider windows; the photo band itself is unchanged. */
    body:is(.sancom-client-layout, .sancom-public-spaced) main.sancom-main > .sancom-container { padding-top: 16px; }
}

/* (The public look's own photo, bg_home.webp, and its .sancom-home-bg placement were retired
   2026-11-22: every page uses bg_main.webp above.) */

/* never print the decorative background */
@media print { .sancom-bgimg .sancom-bg { display: none; } }

/* Frosted glass panel — the reusable readability surface over the photo:
   a light beige tint + blur, so text gets guaranteed contrast while the
   image glows through. Gated on the flag: with the image off, panels
   disappear and content sits on the plain sheet as before. Used by the
   home hero and the progress-page sections; add class="sancom-glass". */
.sancom-bgimg .sancom-glass {
    background: var(--surface-glass);
    border: 1px solid var(--color-border);   /* same hairline as the ghost/beige buttons */
    border-radius: var(--radius-md);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    padding: var(--space-md);
}
/* no backdrop-filter support -> lean on a more opaque panel instead */
@supports not ((backdrop-filter: blur(7px)) or (-webkit-backdrop-filter: blur(7px))) {
    .sancom-bgimg .sancom-glass { background: rgba(244, 238, 226, 0.93); }   /* 0.8 until 2026-10-19, raised with the glass (0.85 until 2026-11-12) */
}
/* Subtle third transparency level: replaces the calendar's FULL-WHITE
   surfaces (day-of-week headers + current-month day cells). The weekend/off
   cells sit at opacity .55 (45% see-through); this is about half that
   see-through, so the photo whispers through the solid cells while the
   coach lanes keep their contrast. */
.sancom-bgimg .sancom-cal-dow,
.sancom-bgimg .sancom-cal-day2,
.sancom-bgimg .sancom-card { background: var(--surface-cell); }   /* incl. .sancom-card-table */
/* CARDS STRAIGHT ON THE PHOTO (Greg, 2026-11-22): a card with no glass panel beneath read far more
   see-through than the glass around it, so it takes the GLASS level and blur, kept white -- the home
   and public pages' cards, the log-in / sign-up / password boxes, Account, Links. Cards inside glass
   keep the cell level (the glass already veils the photo); wide/admin pages and .sancom-cell-solo
   keep their heavier .92. */
.sancom-bgimg:not(.sancom-bg-wide) .sancom-card:not(.sancom-glass .sancom-card):not(.sancom-cell-solo) {
    background: rgba(255, 255, 255, 0.84375);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}
/* the <table> itself paints solid white by default — inside the translucent
   card it must be clear, or every row re-opaques the surface */
.sancom-bgimg .sancom-card-table .sancom-table { background: transparent; }

/* Hero (home page) = a glass panel with its own width/padding; the big
   heading gets the halo, small text its own soft glow (rules below). */
.sancom-bgimg .sancom-hero {
    max-width: 820px; margin: 0 auto;
    padding: var(--space-md);   /* 20px all round like the cards and every other glass panel (Greg, 2026-11-28; was 32px top and bottom) */
}
.sancom-bgimg .sancom-hero > :last-child { margin-bottom: 0; }
/* with the lighter panel, the body text carries its own soft beige glow —
   only the blurred layers (crisp 1px offset copies smudge at small sizes) */
.sancom-bgimg .sancom-hero .sancom-lead {
    text-shadow:
        0 0 3px var(--bgimg-beige), 0 0 6px var(--bgimg-beige),
        0 0 12px var(--bgimg-beige);
}
.sancom-bgimg .sancom-hero h1 {
    text-shadow:
        1px 1px 0 var(--bgimg-beige), -1px -1px 0 var(--bgimg-beige),
        1px -1px 0 var(--bgimg-beige), -1px 1px 0 var(--bgimg-beige),
        0 0 6px var(--bgimg-beige), 0 0 14px var(--bgimg-beige);
}

/* Soft beige glow for dark text that sits on the glass / photo on the
   checklist pages (client Progress + staff drill-in) — same treatment as the
   home hero's lead text: only the blurred layers (crisp 1px offset copies
   smudge at small sizes). Headings get the full halo like the page titles. */
.sancom-bgimg .cl-count-sub,
.sancom-bgimg .cl-jump-sub,
.sancom-bgimg .sancom-tabs .sancom-tab,
.sancom-bgimg .cl-category-head .sancom-muted,
.sancom-bgimg .sancom-cliver,
.sancom-bgimg .sancom-client-head .sancom-muted,
.sancom-bgimg .sancom-term-cat-desc,
.sancom-bgimg main.sancom-main > .sancom-container > .sancom-muted {
    text-shadow: var(--text-glow);
}
.sancom-bgimg .cl-category-head h2,
.sancom-bgimg .sancom-client-head h1,
.sancom-bgimg .sancom-cal-head-center h2,
.sancom-bgimg main.sancom-main > .sancom-container > h2 {
    text-shadow:
        1px 1px 0 var(--bgimg-beige), -1px -1px 0 var(--bgimg-beige),
        1px -1px 0 var(--bgimg-beige), -1px 1px 0 var(--bgimg-beige),
        0 0 6px var(--bgimg-beige), 0 0 14px var(--bgimg-beige);
}
/* ...except a heading in a white box of its own, which glows white like the cards. */
.sancom-bgimg main.sancom-main > .sancom-container > h2.sancom-home-h2-box { text-shadow: var(--text-glow-white); }

/* Text glow pulled back (Greg, 2026-11-07): the site-wide glow added 2026-10-14 (set on <main> and
   inherited by all text) and the heavier stacked glows/halos of 2026-10-17 were too much -- the
   off-white glow looked odd on white surfaces. Back to the 2026-10-13 (v0.27.0) rules: only the
   selected text above carries a glow, at its earlier strength. */

/* TEXT DIRECTLY ON GLASS GLOWS (Greg, 2026-11-12): everything inside a .sancom-glass panel inherits
   the cream glow -- titles, item numbers, descriptions, labels, legends -- EXCEPT text on a surface
   of its own (a white second layer, a cell, a solid chrome band) or a control (buttons, inputs,
   pulldowns), where the surface already gives the contrast. A NEW white surface inside glass
   belongs in the reset list below. */
.sancom-bgimg .sancom-glass { text-shadow: var(--text-glow); }
/* The see-through WHITE surfaces (the --surface-cell family and the cards) glow WHITE, inside glass
   or straight on the photo (Greg, 2026-11-22). */
.sancom-bgimg :is(.sancom-card, .cl-form-dl, .cl-ems, .sancom-cal-dow, .sancom-cal-day2) {
    text-shadow: var(--text-glow-white);
}
/* Surfaces of their own (solid, or coloured with white text) never glow, inside glass or inside
   a glowing white surface. */
.sancom-bgimg :is(.sancom-glass, .sancom-card, .cl-form-dl, .cl-ems, .sancom-cal-day2)
    :is(.sancom-btn, button, input, select, textarea, option,
    .sancom-term-row, .sancom-term-cat-head,
    .cl-item, .cl-state, .cl-ems-tag, .sancom-progress, svg,
    .sancom-cal-block, .sancom-cal-appt, .sancom-lane-chip, .sancom-appt-dot,
    .sancom-help-pop, .cl-dev-box, .sancom-badge, .sancom-home-price, .sancom-home-num,
    .sancom-blk-s, .sancom-blk-e) { text-shadow: none; }
/* BUTTONS GLOW AROUND THEIR SHAPE (Greg, 2026-11-28): a boxed button (.sancom-btn, not the text-link
   kind) on a see-through surface gets that surface's glow as a box-shadow -- cream on the beige
   glass, white on the white surfaces. The white rule comes second, so a button on a white card
   inside glass glows white. (The "Get Started" button sits on the photo; its own rule is above.) */
.sancom-bgimg :is(.sancom-glass, .cs-frame) .sancom-btn:not(.sancom-btn-link) { box-shadow: var(--text-glow); }
.sancom-bgimg :is(.sancom-card, .cl-form-dl, .cl-ems) .sancom-btn:not(.sancom-btn-link) {
    box-shadow: var(--text-glow-white);
}
/* ...but the calendar's DIMMED day numbers (weekends, other months) glow: their cells are faded
   to 55%, so the number sits nearly on the glass. (The phone week bars' date labels have no cell
   of their own, so they glow with the glass already.) */
.sancom-bgimg .sancom-cal-day2:is(.is-off, .is-outmonth) .sancom-cal-num2 { text-shadow: var(--text-glow); }
