/* tos-app.css */


/* ============================================================
   01 // Tokens
   ============================================================ */

:root {
    --tos-bg:                  #fafaf9;
    --tos-surface:             #ffffff;
    --tos-surface-raised:      #ffffff;
    --tos-surface-sunken:      #f5f4f1;
    --tos-surface-hover:       #f5f4f1;

    --tos-border:              #e5e5e2;
    --tos-border-strong:       #d4d4d0;
    --tos-border-faint:        #f0efec;
    --tos-control-border:      #8c8c88;   /* the only edge of a control: 3.4:1 on surface, 3.2:1 on bg (WCAG 1.4.11) */
    --tos-rule:                #e8e7e3;

    --tos-text:                #0a0612;
    --tos-text-secondary:      #4b5563;
    /* Darkened 2026-09-05 for WCAG AA. #6b7280 measured 4.40:1 on the app ground
       (#f5f4f1) and #9ca3af only 2.54:1 on white - between them they accounted for 83
       of the 92 failing text elements on one page, platform-wide. These values clear
       4.5:1 on BOTH the app ground and white, and keep the text > secondary > muted >
       dim hierarchy intact. */
    --tos-text-muted:          #5f6672;
    --tos-text-dim:            #646b77;
    --tos-text-inverse:        #ffffff;
    /* Label colour for anything filled with the APP accent. Since the accent
       sweep (11 Nov 2026) the default app accent is the ink state colour, so the
       label on it is the inverse of ink: white in light, ink in dark. A sheet that
       still sets its own light accent (Socia's #00b8d6) sets its own label too. */
    --tos-on-accent:           var(--tos-text-inverse);
    /* Label colour for anything filled with ORANGE (primary buttons, the Pallas
       bubble). The orange is light in both themes: white on it is ~2.3:1, ink is
       ~9:1. Mode-stable on purpose. */
    --tos-on-orange:           #0a0612;
    --tos-on-danger:           #ffffff;   /* words on a red fill: white in BOTH themes (no dark override on purpose; head of design 12 Nov) */

    --tos-accent:              #fb923c;
    /* The accent is a FILL colour. As TEXT on a light ground it measures 2.1:1 -
       the mirror of the problem --tos-on-accent solves for filled buttons. Anything
       that writes the accent as words uses this instead. */
    --tos-accent-text:         #c2410c;
    --tos-accent-strong:       #f97316;
    --tos-accent-bg:           rgba(251, 146, 60, 0.08);
    --tos-accent-border:       rgba(251, 146, 60, 0.32);

    --tos-system:              var(--tos-accent);   /* was violet var(--tos-accent) - retired */

    /* STATE: selected, on, here (accent sweep, 11 Nov 2026). Ink, and it turns
       light in dark mode with the text tokens. Orange is kept for "this needs
       you": the one main action, unread dots, waiting counts. Redeclared in the
       dark blocks below, because a var() inside a custom property resolves where
       it is declared, not where it is used. */
    --tos-state:               var(--tos-text);
    --tos-state-bg:            rgba(10, 6, 18, 0.06);
    --tos-state-border:        var(--tos-border-strong);
    --tos-system-bg:           var(--tos-accent-bg);
    --tos-system-border:       var(--tos-accent-border);

    --tos-ok:                  #059669;
    --tos-ok-bg:               rgba(5, 150, 105, 0.08);
    --tos-pending:             #d97706;
    --tos-pending-bg:          rgba(217, 119, 6, 0.08);
    --tos-error:               #dc2626;
    --tos-error-bg:            rgba(220, 38, 38, 0.06);
    --tos-info:                #0284c7;
    --tos-info-bg:             rgba(2, 132, 199, 0.06);
    /* Status colours as TEXT. --tos-ok / -pending / -info / -error are fill and icon colours and
       measure 2.9-4.4:1 as words on their own tints; these clear 4.5:1 on their tint over every
       TOS ground (light 4.55-6.51, dark 4.98-9.62; measured 2026-10-10, DC #693). */
    --tos-ok-text:             #047857;
    --tos-pending-text:        #92400e;
    --tos-info-text:           #0369a1;
    --tos-error-text:          #b91c1c;

    --tos-font-body:           'Montserrat', system-ui, -apple-system, sans-serif;
    --tos-font-mono:           'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --tos-text-xs:             0.72rem;
    --tos-text-sm:             0.82rem;
    --tos-text-base:           0.92rem;
    --tos-text-md:             1.02rem;
    --tos-text-lg:             1.18rem;
    --tos-text-xl:             1.42rem;
    --tos-text-2xl:            1.78rem;
    --tos-text-3xl:            2.4rem;

    --tos-leading-tight:       1.2;
    --tos-leading-snug:        1.45;
    --tos-leading-normal:      1.55;
    --tos-leading-relaxed:     1.7;

    --tos-tracking-mono:       1.4px;
    --tos-tracking-mono-tight: 0.8px;

    --tos-space-1:             4px;
    --tos-space-2:             8px;
    --tos-space-3:             12px;
    --tos-space-4:             16px;
    --tos-space-5:             20px;
    --tos-space-6:             24px;
    --tos-space-8:             32px;
    --tos-space-10:            40px;
    --tos-space-12:            48px;
    --tos-space-16:            64px;

    --tos-radius-sm:           4px;
    --tos-radius:              6px;
    --tos-radius-md:           8px;
    --tos-radius-lg:           10px;
    --tos-radius-full:         999px;

    --tos-shadow-flat:         0 1px 0 var(--tos-border);
    --tos-shadow-card:         0 1px 2px rgba(10, 6, 18, 0.04), 0 1px 1px rgba(10, 6, 18, 0.03);
    --tos-shadow-raised:       0 4px 14px -6px rgba(10, 6, 18, 0.10), 0 2px 4px -2px rgba(10, 6, 18, 0.06);
    --tos-shadow-drawer:       -8px 0 32px -8px rgba(10, 6, 18, 0.12);

    --tos-ease:                cubic-bezier(0.4, 0, 0.2, 1);
    --tos-duration:            0.15s;
    --tos-duration-slow:       0.25s;
    /* The topbar's OWN height. Never overridden anywhere: --tos-chrome-top is derived from
       it, so a subtree that redefined this one would make that a circular reference and CSS
       would drop the property entirely. */
    --tos-topbar-real-h:       52px;
    --tos-topbar-h:            var(--tos-topbar-real-h);
    /* Global alert strip above the topbar (payment failed, or the softer AI-usage advisory).
       0 when there is nothing to say, so every offset below is byte-identical to before
       unless a banner is actually shown. */
    --tos-banner-h:            0px;
    /* WHERE THE FIXED CHROME ENDS. The only correct "top" for anything that has to sit below
       it. Anything that hardcodes the topbar height, or adds banner + topbar by hand, is one
       edit away from disagreeing with the rest - which is exactly what happened: the
       spotlight panel sat at a hardcoded 88px, so the moment the AI-usage advisory appeared
       it opened ON TOP of the topbar's own search bar. */
    --tos-chrome-top:          calc(var(--tos-banner-h) + var(--tos-topbar-real-h));
    --tos-rail-w:              220px;
    --tos-rail-w-collapsed:    56px;

    /* Shared OS backdrop — used by EVERY backdrop in the system
       (spotlight, mobile rail, modals, drawers). Defined once so
       the look of the platform stays unified across pages. App-
       level CSS files must not redeclare these. */
    --tos-backdrop:
        radial-gradient(ellipse at 18% -6%, rgba(251, 146, 60, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 82% 108%, rgba(251, 146, 60, 0.14) 0%, transparent 55%),
        rgba(10, 6, 18, 0.46);
    --tos-backdrop-blur:       4px;

    /* An app without its own accent shows selection in ink, not orange. */
    --tos-app-accent:          var(--tos-state);
    --tos-app-accent-bg:       var(--tos-state-bg);
    --tos-app-accent-border:   var(--tos-state-border);
}


/* ============================================================
   01a // Legacy --timer-* compatibility layer
   Legacy app CSS files (timer-sdr.css, availability.css,
   people.css, companies.css, etc.) reference --timer-* tokens
   that lived in the now-dropped platform-variables.css. Map
   them to TOS tokens at body.tos-app scope so every migrated
   app gets these for free without per-app aliasing.

   Apps that need a different accent override --timer-primary
   themselves (e.g., body.tos-app-sdr sets it to pink).
   ============================================================ */
body.tos-app {
    /* Grays / surfaces */
    --timer-white:         var(--tos-surface);
    --timer-black:         var(--tos-text);
    --timer-gray-50:       var(--tos-bg);
    --timer-gray-100:      var(--tos-surface-sunken);
    --timer-gray-200:      var(--tos-border-faint);
    --timer-gray-300:      var(--tos-border);
    /* Legacy used these as TEXT colors (timer-gray-400 for placeholder copy,
       -500 for muted body, -600 for body text, -700/800 for headings). The
       old "border-strong" / "text-dim" mappings made labels and helper text
       invisible against the surface in many places. These are the correct
       text-axis mappings — fixes dark-mode invisible text app-wide. */
    --timer-gray-400:      var(--tos-text-muted);
    --timer-gray-500:      var(--tos-text-muted);
    --timer-gray-600:      var(--tos-text-secondary);
    --timer-gray-700:      var(--tos-text-secondary);
    --timer-gray-800:      var(--tos-text);
    --timer-gray-900:      var(--tos-text);

    /* Brand — default to the global TOS accent (orange).
       Each app's tos-app-{name}.css overrides --timer-primary
       to its own accent. Keeps brand-themed elements in sync
       with the rest of the OS. */
    --timer-primary:       var(--tos-accent);
    --timer-primary-light: var(--tos-accent-bg);
    --timer-teal:          #14b8a6;

    /* Semantic */
    --timer-error:         var(--tos-error);
    --timer-success:       var(--tos-ok);
    --timer-warning:       var(--tos-pending);
    --timer-info:          var(--tos-info);
    --timer-danger:        var(--tos-error);

    /* Spacing — TOS space scale */
    --timer-space-1:       var(--tos-space-1);
    --timer-space-2:       var(--tos-space-2);
    --timer-space-3:       var(--tos-space-3);
    --timer-space-4:       var(--tos-space-4);
    --timer-space-5:       var(--tos-space-5);
    --timer-space-6:       var(--tos-space-6);
    --timer-space-8:       var(--tos-space-8);
    --timer-space-10:      var(--tos-space-10);
    --timer-space-12:      var(--tos-space-12);
    --timer-space-16:      var(--tos-space-16);
    --timer-layout-gap:    var(--tos-space-3);

    /* Radius */
    --timer-radius-sm:     var(--tos-radius-sm);
    --timer-radius:        var(--tos-radius);
    --timer-radius-md:     var(--tos-radius-md);
    --timer-radius-lg:     var(--tos-radius-lg);
    --timer-radius-xl:     12px;
    --timer-radius-full:   var(--tos-radius-full);

    /* Motion */
    --timer-transition:        var(--tos-duration) var(--tos-ease);
    --timer-transition-fast:   0.1s var(--tos-ease);
    --timer-transition-normal: var(--tos-duration) var(--tos-ease);
    --timer-transition-slow:   var(--tos-duration-slow) var(--tos-ease);

    /* Shadows */
    --timer-shadow-sm:    var(--tos-shadow-card);
    --timer-shadow:       var(--tos-shadow-card);
    --timer-shadow-md:    var(--tos-shadow-card);
    --timer-shadow-lg:    var(--tos-shadow-raised);
    --timer-shadow-card:  var(--tos-shadow-card);

    /* Z-index (legacy modal stacking) */
    --timer-z-modal:           20000;
    --timer-z-modal-backdrop:  19999;
    --timer-z-drawer:          10002;
    --timer-z-topbar:          1000;
}


/* ============================================================
   01b // Dark mode tokens
   Activate with `<body data-theme="dark">` or via the toggle UI
   (Phase 1c of the dark-mode rollout). All chrome (topbar, rail,
   spotlight, hero, stat stack, list cards, drawer + modal chrome,
   Pilot card) recolors instantly because every rule reads from
   the tokens redefined below.

   App accents (--tos-app-accent / -bg / -border) intentionally
   stay at their light-mode values for first pass — they pop
   naturally on dark backgrounds. Per-app accent tuning can be
   added later via:
     body.tos-app-{name}[data-theme="dark"] {
         --tos-app-accent: { lighter-variant };
     }
   if/when a specific accent reads poorly.

   Semantic colors (--tos-ok / -pending / -error / -info) keep
   their hue but pair with darker -bg companions so they don't
   wash out on dark surfaces.

   NOTE: this block is INERT until a Phase 1c commit ships the
   theme toggle that flips body[data-theme]. Sweep work in
   between (SDR, Availability, etc.) uses these tokens as the
   canary — DevTools-toggling data-theme="dark" reveals which
   legacy color literals haven't been swept yet.
   ============================================================ */
html[data-theme="dark"],
body.tos-app[data-theme="dark"],
body.tos-app[data-theme="dark"] :root {
    /* The html[data-theme="dark"] selector lets the pre-paint <head>
       bootstrap (which sets data-theme on <html> before the body exists)
       swap the tokens on the very first frame — no light-then-dark flash.
       Custom properties inherit, so defining them on <html> cascades to
       body and everything below. The body-level selectors stay for the
       runtime toggle + any page without the bootstrap. */
    /* Tells the browser to render native UI chrome (scrollbar
       track + thumb, native form widgets, default focus rings)
       in dark colours. WITHOUT this, the scrollbar gutter stays
       at OS-default light gray and visibly clashes with the dark
       body. */
    color-scheme: dark;

    --tos-bg:                  #0a0a09;
    --tos-surface:             #17171a;
    --tos-surface-raised:      #1f1f23;
    --tos-surface-sunken:      #0f0f12;
    --tos-surface-hover:       #232328;

    --tos-border:              #2a2a30;
    --tos-border-strong:       #3a3a42;
    --tos-border-faint:        #1c1c20;
    --tos-control-border:      #6a6a74;   /* 3.3:1 on surface, 3.7:1 on bg */
    --tos-rule:                #232328;

    --tos-text:                #fafaf7;
    --tos-text-secondary:      #c8c8c4;
    --tos-text-muted:          #98989a;
    /* #66666a failed on every dark surface (2.74-3.46:1). #8a8a90 clears 4.5:1
       on bg, surface, raised and hover alike. */
    --tos-text-dim:            #8a8a90;
    --tos-text-inverse:        #0a0a09;

    /* State tokens again, so they resolve against the dark text tokens. */
    --tos-state:               var(--tos-text);
    --tos-state-bg:            rgba(250, 250, 247, 0.08);
    --tos-state-border:        var(--tos-border-strong);
    --tos-on-accent:           var(--tos-text-inverse);
    --tos-app-accent:          var(--tos-state);
    --tos-app-accent-bg:       var(--tos-state-bg);
    --tos-app-accent-border:   var(--tos-state-border);

    /* Accent backgrounds need higher opacity on dark to stay
       visible at the same perceived tint as 8% on light. */
    --tos-accent-bg:           rgba(251, 146, 60, 0.18);
    --tos-accent-border:       rgba(251, 146, 60, 0.42);

    --tos-system-bg:           rgba(251, 146, 60, 0.18);
    --tos-system-border:       rgba(251, 146, 60, 0.42);

    --tos-ok-bg:               rgba(5, 150, 105, 0.18);
    --tos-pending-bg:          rgba(217, 119, 6, 0.18);
    --tos-error-bg:            rgba(220, 38, 38, 0.18);
    --tos-info-bg:             rgba(2, 132, 199, 0.18);
    --tos-ok-text:             #34d399;
    --tos-pending-text:        #fbbf24;
    --tos-info-text:           #38bdf8;
    --tos-error-text:          #f87171;

    /* Shadows on dark surfaces need to be lighter / less black.
       Otherwise raised cards just look like holes. */
    --tos-shadow-flat:         0 1px 0 var(--tos-border);
    --tos-shadow-card:         0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(0, 0, 0, 0.30);
    --tos-shadow-raised:       0 4px 14px -6px rgba(0, 0, 0, 0.55), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
    --tos-shadow-drawer:       -8px 0 32px -8px rgba(0, 0, 0, 0.55);

    /* Backdrop tint sits over a black wash — keep the brand
       radial bleeds but darken the base layer to avoid washing
       the page out. */
    --tos-backdrop:
        radial-gradient(ellipse at 18% -6%, rgba(251, 146, 60, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 82% 108%, rgba(251, 146, 60, 0.20) 0%, transparent 55%),
        rgba(0, 0, 0, 0.66);
}

/* System-preference fallback — apply dark tokens by default for
   users with prefers-color-scheme: dark UNLESS the page has an
   explicit data-theme attribute set (toggle override). The
   :not([data-theme]) selector guarantees the user's stored
   choice always wins. */
@media (prefers-color-scheme: dark) {
    /* html-level: authoritative from first paint once the <head> bootstrap
       has set data-theme on <html>. */
    html[data-theme="system"],
    /* body-level fallback for legacy / JS-disabled pages, but ONLY when the
       user has made no explicit light/dark choice on <html> — otherwise an
       OS-dark visitor who picked "light" would flash dark before the body
       attribute lands. */
    html:not([data-theme="light"]):not([data-theme="dark"]) body.tos-app:not([data-theme]),
    body.tos-app[data-theme="system"] {
        color-scheme: dark;
        --tos-bg:                  #0a0a09;
        --tos-surface:             #17171a;
        --tos-surface-raised:      #1f1f23;
        --tos-surface-sunken:      #0f0f12;
        --tos-surface-hover:       #232328;

        --tos-border:              #2a2a30;
        --tos-border-strong:       #3a3a42;
        --tos-border-faint:        #1c1c20;
        --tos-control-border:      #6a6a74;
        --tos-rule:                #232328;

        --tos-text:                #fafaf7;
        --tos-text-secondary:      #c8c8c4;
        --tos-text-muted:          #98989a;
        /* #66666a failed on every dark surface (2.74-3.46:1). #8a8a90 clears 4.5:1
       on bg, surface, raised and hover alike. */
    --tos-text-dim:            #8a8a90;
        --tos-text-inverse:        #0a0a09;

        /* State tokens again, so they resolve against the dark text tokens. */
        --tos-state:               var(--tos-text);
        --tos-state-bg:            rgba(250, 250, 247, 0.08);
        --tos-state-border:        var(--tos-border-strong);
        --tos-on-accent:           var(--tos-text-inverse);
        --tos-app-accent:          var(--tos-state);
        --tos-app-accent-bg:       var(--tos-state-bg);
        --tos-app-accent-border:   var(--tos-state-border);

        --tos-accent-bg:           rgba(251, 146, 60, 0.18);
        --tos-accent-border:       rgba(251, 146, 60, 0.42);
        --tos-system-bg:           rgba(251, 146, 60, 0.18);
        --tos-system-border:       rgba(251, 146, 60, 0.42);
        --tos-ok-bg:               rgba(5, 150, 105, 0.18);
        --tos-pending-bg:          rgba(217, 119, 6, 0.18);
        --tos-error-bg:            rgba(220, 38, 38, 0.18);
        --tos-info-bg:             rgba(2, 132, 199, 0.18);
        --tos-ok-text:             #34d399;
        --tos-pending-text:        #fbbf24;
        --tos-info-text:           #38bdf8;
        --tos-error-text:          #f87171;

        --tos-shadow-card:         0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(0, 0, 0, 0.30);
        --tos-shadow-raised:       0 4px 14px -6px rgba(0, 0, 0, 0.55), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
        --tos-shadow-drawer:       -8px 0 32px -8px rgba(0, 0, 0, 0.55);

        --tos-backdrop:
            radial-gradient(ellipse at 18% -6%, rgba(251, 146, 60, 0.22) 0%, transparent 55%),
            radial-gradient(ellipse at 82% 108%, rgba(251, 146, 60, 0.20) 0%, transparent 55%),
            rgba(0, 0, 0, 0.66);
    }
}


/* ============================================================
   02 // Base
   ============================================================ */

html, body {
    margin: 0;
    padding: 0;
}

body.tos-app {
    background: var(--tos-bg);
    color: var(--tos-text);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-base);
    line-height: var(--tos-leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    /* Default light. Dark-mode block + @media query override this
       to color-scheme: dark when applicable. */
    color-scheme: light;
}

body.tos-app *,
body.tos-app *::before,
body.tos-app *::after {
    box-sizing: border-box;
}

/* :where() keeps this at specificity (0,1,0) instead of (0,1,2). At (0,1,2) it beat
   every app's own button rule (e.g. `.cmd-pilot-cta { color: ... }` is (0,1,0)), so
   ANY anchor styled as a filled button had its label repainted in the accent - the
   same tone as its own fill, i.e. an invisible label. That bug has now surfaced on
   the join CTA, the dashboard's Ask Pallas CTA and others. App sheets load after
   this one, so at equal specificity their button colour now wins, while plain links
   still take the accent. */

:where(body.tos-app a) {
    color: var(--tos-app-accent);
    text-decoration: none;
    transition: color var(--tos-duration) var(--tos-ease), text-decoration-color var(--tos-duration) var(--tos-ease);
}
:where(body.tos-app a:hover) { color: var(--tos-app-accent); }
/* Links inside running text are ink like the words around them, so they need a cue that is not
   colour (WCAG 1.4.1): a quiet underline that turns ink on hover. Only class-less links in prose;
   nav rows, buttons, menu items and the rail all carry a class and stay as they are. */
:where(body.tos-app) :where(p, li, dd, td, blockquote, figcaption) a:where(:not([class])) {
    text-decoration: underline;
    text-decoration-color: var(--tos-border-strong);
    text-underline-offset: 2px;
}
:where(body.tos-app) :where(p, li, dd, td, blockquote, figcaption) a:where(:not([class])):hover {
    text-decoration-color: currentColor;
}

body.tos-app h1, body.tos-app h2, body.tos-app h3, body.tos-app h4 {
    margin: 0;
    font-weight: 700;
    color: var(--tos-text);
}

body.tos-app button {
    font-family: inherit;
}


/* ============================================================
   03 // Topbar
   ============================================================ */

.tos-topbar {
    position: fixed;
    top: var(--tos-banner-h); left: 0; right: 0;
    height: var(--tos-topbar-h);
    background: var(--tos-surface);
    border-bottom: 1px solid var(--tos-border);
    display: flex;
    align-items: center;
    padding: 0 var(--tos-space-4);
    gap: var(--tos-space-4);
    z-index: 1000;
}

.tos-topbar-left {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    flex-shrink: 0;
}

.tos-topbar-rail-toggle {
    width: 36px; height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius);
    color: var(--tos-text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tos-duration) var(--tos-ease), border-color var(--tos-duration) var(--tos-ease);
}
.tos-topbar-rail-toggle:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border);
}
.tos-topbar-rail-toggle i { font-size: var(--tos-text-base); }

.tos-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: 0 var(--tos-space-2);
    color: var(--tos-text) !important;
    text-decoration: none;
}
.tos-topbar-brand:hover { color: var(--tos-text) !important; }
.tos-topbar-mark { width: 22px; height: 22px; }
.tos-topbar-name {
    font-size: var(--tos-text-base);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--tos-text);
}
.tos-topbar-tag {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    font-weight: 600;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    padding-left: var(--tos-space-1);
}

.tos-topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}
.tos-topbar-command {
    width: 100%;
    max-width: 480px;
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: 7px 12px;
    background: var(--tos-surface-sunken);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    color: var(--tos-text-muted);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    cursor: text;
    transition: border-color var(--tos-duration) var(--tos-ease);
}
.tos-topbar-command:hover { border-color: var(--tos-border-strong); }
.tos-topbar-command i { color: var(--tos-text-dim); font-size: 0.78rem; }
.tos-topbar-command-label { flex: 1; text-align: left; }
.tos-topbar-command kbd {
    margin-left: auto;
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    padding: 2px 6px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-dim);
    font-weight: 600;
}

.tos-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    flex-shrink: 0;
}

.tos-topbar-pilot {
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: 5px 10px;
    background: var(--tos-system-bg);
    border: 1px solid var(--tos-system-border);
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--tos-system);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
/* --tos-system aliases the accent, which is a FILL colour: as 11px uppercase text it
   measured 2.26:1. The DOT below keeps the true accent - it is a shape, not words. */
.tos-topbar-pilot { color: var(--tos-accent-text); }
.tos-topbar-pilot .tos-app-meta-dot {
    background: var(--tos-system);
    box-shadow: 0 0 6px var(--tos-system);
    width: 6px; height: 6px;
    border-radius: 50%;
    animation: tos-app-blink 1.8s ease-in-out infinite;
}

.tos-topbar-icon {
    width: 36px; height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius);
    color: var(--tos-text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background var(--tos-duration) var(--tos-ease), border-color var(--tos-duration) var(--tos-ease), color var(--tos-duration) var(--tos-ease);
}
.tos-topbar-icon:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border);
    color: var(--tos-text);
}

.tos-topbar-user-wrap {
    position: relative;
    height: var(--tos-topbar-h);
    display: flex;
    align-items: center;
}
.tos-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: 4px 10px 4px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius-full);
    color: var(--tos-text-secondary);
    cursor: pointer;
    transition: background var(--tos-duration) var(--tos-ease);
}
.tos-topbar-user:hover { background: var(--tos-surface-hover); }
.tos-topbar-avatar {
    width: 28px; height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--tos-state-bg);
    color: var(--tos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tos-text-xs);
    font-weight: 700;
    text-transform: uppercase;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.tos-topbar-avatar > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tos-topbar-avatar.is-fallback i {
    font-size: 0.8rem;
}
.tos-topbar-user i { font-size: 0.7rem; color: var(--tos-text-muted); }

.tos-topbar-user-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    box-shadow: var(--tos-shadow-raised);
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity var(--tos-duration) var(--tos-ease), transform var(--tos-duration) var(--tos-ease);
    z-index: 100;
    overflow: hidden;
}
.tos-topbar-user-menu.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tos-user-menu-identity {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3) var(--tos-space-4);
    background: var(--tos-surface-sunken);
    border-bottom: 1px solid var(--tos-border-faint);
}
.tos-user-menu-avatar {
    width: 36px; height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--tos-state-bg);
    color: var(--tos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tos-text-base);
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.tos-user-menu-avatar > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tos-user-menu-avatar.is-fallback i {
    font-size: 1rem;
}
.tos-user-menu-text {
    min-width: 0;
    flex: 1;
}
.tos-user-menu-name {
    font-size: var(--tos-text-sm);
    font-weight: 700;
    color: var(--tos-text);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tos-user-menu-email {
    margin-top: 2px;
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    color: var(--tos-text-muted);
    letter-spacing: 0.4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tos-user-menu-group {
    padding: var(--tos-space-1) var(--tos-space-1);
}

/* Theme switcher — segmented control sitting in the user menu just
   above Billing. 3 options: Light / Dark / System (the System
   option falls back to prefers-color-scheme). Strategic placement
   per the rule "theme is personal preference, not navigation." */
.tos-user-menu-section-title {
    padding: 6px var(--tos-space-3) 4px;
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-theme-switcher-group {
    padding: 0 var(--tos-space-1) 4px;
}
.tos-theme-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: var(--tos-surface-sunken);
    border: 1px solid var(--tos-border-faint);
    border-radius: var(--tos-radius);
}
.tos-theme-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius-sm);
    cursor: pointer;
    font-family: var(--tos-font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
.tos-theme-option > i {
    font-size: 0.95rem;
    color: var(--tos-text-dim);
    transition: color var(--tos-duration) var(--tos-ease);
}
.tos-theme-option:hover {
    color: var(--tos-text);
    background: var(--tos-surface-hover);
}
.tos-theme-option:hover > i {
    color: var(--tos-text-muted);
}
.tos-theme-option.is-active {
    background: var(--tos-surface);
    border-color: var(--tos-border);
    color: var(--tos-text);
    box-shadow: var(--tos-shadow-card);
}
.tos-theme-option.is-active > i {
    color: var(--tos-app-accent);
}

.tos-user-menu-rule {
    height: 1px;
    background: var(--tos-border-faint);
    margin: 0;
}
.tos-user-menu-item {
    display: flex !important;
    align-items: center;
    gap: var(--tos-space-3);
    padding: 8px var(--tos-space-3);
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-secondary) !important;
    font-size: var(--tos-text-sm);
    font-weight: 500;
    text-decoration: none !important;
    transition: background var(--tos-duration) var(--tos-ease), color var(--tos-duration) var(--tos-ease);
}
.tos-user-menu-item i {
    width: 14px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--tos-text-dim);
    transition: color var(--tos-duration) var(--tos-ease);
}
.tos-user-menu-item:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text) !important;
}
.tos-user-menu-item:hover i { color: var(--tos-text); }
.tos-user-menu-signout {
    color: var(--tos-error) !important;
}
.tos-user-menu-signout i { color: var(--tos-error); }
.tos-user-menu-signout:hover {
    background: var(--tos-error-bg) !important;
    color: var(--tos-error) !important;
}
.tos-user-menu-signout:hover i { color: var(--tos-error); }


/* Notification dropdown */
.tos-topbar-notif-wrap {
    position: relative;
    height: var(--tos-topbar-h);
    display: flex;
    align-items: center;
}
.tos-topbar-icon-dot {
    position: absolute;
    top: 7px; right: 8px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--tos-accent);
    border: 2px solid var(--tos-surface);
}

.tos-topbar-notif-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - var(--tos-space-4) * 2);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    box-shadow: var(--tos-shadow-raised);
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity var(--tos-duration) var(--tos-ease), transform var(--tos-duration) var(--tos-ease);
    z-index: 100;
    overflow: hidden;
}
.tos-topbar-notif-menu.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.tos-notif-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3) var(--tos-space-4);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
}
.tos-notif-menu-title {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-text);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-notif-menu-mark {
    background: transparent;
    border: none;
    color: var(--tos-text-muted);
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--tos-duration) var(--tos-ease);
}
.tos-notif-menu-mark:hover { color: var(--tos-app-accent); }
.tos-notif-menu-list {
    max-height: 380px;
    overflow-y: auto;
}
.tos-notif-menu-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3) var(--tos-space-4);
    border-bottom: 1px solid var(--tos-border-faint);
    text-decoration: none;
    transition: background var(--tos-duration) var(--tos-ease);
}
.tos-notif-menu-item:last-child { border-bottom: none; }
.tos-notif-menu-item:hover { background: var(--tos-surface-hover); }
.tos-notif-menu-item-icon {
    width: 28px; height: 28px;
    background: var(--tos-system-bg);
    color: var(--tos-system);
    border-radius: var(--tos-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}
.tos-notif-menu-item-body { min-width: 0; }
.tos-notif-menu-item-text {
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    line-height: var(--tos-leading-snug);
}
.tos-notif-menu-item-time {
    margin-top: 2px;
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    color: var(--tos-text-dim);
    letter-spacing: 0.4px;
}
.tos-notif-menu-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-8) var(--tos-space-4);
    color: var(--tos-text-muted);
}
.tos-notif-menu-empty i {
    font-size: 1.6rem;
    color: var(--tos-text-dim);
}
.tos-notif-menu-empty span {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-notif-menu-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: var(--tos-space-2) var(--tos-space-4);
    border-top: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
}
/* Two items in plain words: "See all notifications" and a gear with "Settings" (Notifications redesign P2) */
.tos-notif-menu-foot a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--tos-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--tos-text-secondary) !important;
    text-decoration: none;
}
.tos-notif-menu-foot a i { font-size: 0.8rem; }
.tos-notif-menu-foot a:hover { color: var(--tos-text) !important; }

/* Notification item — title + message + unread dot (populated by
   tos-chrome.js initNotifications). Reuses the base .tos-notif-menu-item
   grid (28px 1fr auto): icon / body / dot. */
.tos-notif-menu-item-title {
    display: block;
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    line-height: var(--tos-leading-snug);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tos-notif-menu-item-body .tos-notif-menu-item-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--tos-text-muted);
    font-size: var(--tos-text-xs);
}
.tos-notif-menu-item-dot {
    align-self: center;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
}
.tos-notif-menu-item.is-unread { background: var(--tos-app-accent-soft); }
.tos-notif-menu-item.is-unread .tos-notif-menu-item-dot { background: var(--tos-accent); }
.tos-notif-menu-loading { min-height: 80px; justify-content: center; }
.tos-notif-menu-loading i { color: var(--tos-app-accent); }
/* Type-tinted icons (semantic colors, mirrors the mobile app). */
.tos-notif-menu-item.icon-calendar .tos-notif-menu-item-icon { background: rgba(59,130,246,0.14);  color: #3b82f6; }
.tos-notif-menu-item.icon-message  .tos-notif-menu-item-icon { background: rgba(139,92,246,0.14);  color: #8b5cf6; }
.tos-notif-menu-item.icon-ai       .tos-notif-menu-item-icon { background: var(--tos-app-accent-soft); color: var(--tos-app-accent); }
.tos-notif-menu-item.icon-payment  .tos-notif-menu-item-icon { background: rgba(16,185,129,0.14);  color: #10b981; }
.tos-notif-menu-item.icon-security .tos-notif-menu-item-icon { background: rgba(239,68,68,0.14);   color: #ef4444; }
.tos-notif-menu-item.icon-team     .tos-notif-menu-item-icon { background: rgba(245,158,11,0.14);  color: #f59e0b; }


/* Spotlight (command + search + Pilot ask) */
.tos-spotlight {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}
.tos-spotlight.is-open { display: block; }
.tos-spotlight-backdrop {
    position: absolute;
    inset: 0;
    background: var(--tos-backdrop);
    backdrop-filter: blur(var(--tos-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--tos-backdrop-blur));
    opacity: 0;
    transition: opacity var(--tos-duration) var(--tos-ease);
}
.tos-spotlight.is-open .tos-spotlight-backdrop { opacity: 1; }
.tos-spotlight-panel {
    position: absolute;
    /* 36px below whatever chrome is above it. Was a hardcoded 88px, which equalled
       52 + 36 only while no banner was showing. */
    top: calc(var(--tos-chrome-top) + 36px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: 100%;
    max-width: 640px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-lg);
    box-shadow: 0 24px 64px -16px rgba(10, 6, 18, 0.24), 0 8px 16px -8px rgba(10, 6, 18, 0.12);
    overflow: hidden;
    opacity: 0;
    transition: opacity var(--tos-duration) var(--tos-ease), transform var(--tos-duration) var(--tos-ease);
}
.tos-spotlight.is-open .tos-spotlight-panel {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.tos-spotlight-input-wrap {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: 14px var(--tos-space-5);
    border-bottom: 1px solid var(--tos-border-faint);
}
.tos-spotlight-icon {
    color: var(--tos-text-dim);
    font-size: var(--tos-text-md);
}
.tos-spotlight-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-md);
    color: var(--tos-text);
    letter-spacing: -0.005em;
}
.tos-spotlight-input::placeholder { color: var(--tos-text-dim); }
.tos-spotlight-input-wrap kbd {
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    padding: 3px 7px;
    background: var(--tos-surface-sunken);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-muted);
    font-weight: 600;
    letter-spacing: 1px;
}
.tos-spotlight-body {
    max-height: 50vh;
    overflow-y: auto;
    padding: var(--tos-space-2) 0;
}
.tos-spotlight-section {
    padding: var(--tos-space-2) 0;
}
.tos-spotlight-section-label {
    /* A section heading, so plain words in the body font ("Quick actions"), not a mono tag (accent sweep, Spotlight) */
    padding: 4px var(--tos-space-5);
    font-family: var(--tos-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--tos-text-secondary);
    letter-spacing: normal;
    text-transform: none;
}

/* Grow With You — the dashed "coming as you grow" zone in the spotlight.
   Locked apps live here (dimmed, non-clickable) with the milestone that unlocks
   each. Theme-aware via --tos-* tokens AND platform-aware: the accent defaults to
   the Timer flavour and flips to Socia teal under html[data-platform="socia"], so
   Socia never renders Timer orange. */
.tos-spotlight {
    --gwy-zone-accent: var(--tos-accent-strong, #ea7c1f);
    --gwy-zone-bg:     rgba(251, 146, 60, 0.06);
    --gwy-zone-border: rgba(251, 146, 60, 0.45);
}
html[data-platform="socia"] .tos-spotlight {
    --gwy-zone-accent: #0095ad;
    --gwy-zone-bg:     rgba(0, 184, 214, 0.07);
    --gwy-zone-border: rgba(0, 184, 214, 0.45);
}
.tos-coming-zone {
    margin: var(--tos-space-3) var(--tos-space-5) var(--tos-space-2);
    border: 1.5px dashed var(--gwy-zone-border);
    border-radius: 12px;
    background: var(--gwy-zone-bg);
    padding: var(--tos-space-3);
}
.tos-coming-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--gwy-zone-accent);
    margin-bottom: var(--tos-space-2);
}
.tos-coming-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--tos-space-2);
}
.tos-coming-tile {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2);
    border-radius: var(--tos-radius);
    cursor: default;
    min-width: 0;
    opacity: 0.9;
}
.tos-coming-tile-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: var(--tos-radius);
    background: var(--tos-system-bg);
    color: var(--tos-text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.tos-coming-tile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tos-coming-tile-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tos-text, inherit);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tos-coming-tile-hint {
    font-size: 0.68rem;
    color: var(--gwy-zone-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 540px) {
    .tos-coming-grid { grid-template-columns: 1fr; }
}

/* Grow With You — the locked-apps NOTICE in the spotlight.
   Replaces the dashed grid of dimmed, unclickable tiles: it says how many apps are
   still locked and sends you to the App Store, which is the only action available
   from a spotlight. Brand-aware through the same --gwy-* tokens (Timer orange /
   Socia teal), so it needs no per-flavor copy. */
.tos-coming-notice {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    margin: var(--tos-space-3) var(--tos-space-5) var(--tos-space-2);
    padding: 11px var(--tos-space-3);
    border: 1.5px dashed var(--gwy-zone-border);
    border-radius: 12px;
    background: var(--gwy-zone-bg);
    text-decoration: none !important;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease);
}
.tos-coming-notice:hover,
.tos-coming-notice:focus-visible {
    background: var(--gwy-zone-bg);
    border-color: var(--gwy-zone-accent);
    outline: none;
}
.tos-coming-notice-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--gwy-zone-bg);
    color: var(--gwy-zone-accent);
}
.tos-coming-notice-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}
.tos-coming-notice-title {
    font-family: var(--tos-font-body);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--tos-text);
    line-height: 1.3;
}
.tos-coming-notice-sub {
    font-family: var(--tos-font-body);
    font-size: 0.74rem;
    color: var(--tos-text-dim);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tos-coming-notice-cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--gwy-zone-accent);
}
.tos-coming-notice:hover .tos-coming-notice-cta svg { transform: translateX(2px); }
.tos-coming-notice-cta svg { transition: transform var(--tos-duration) var(--tos-ease); }
@media (prefers-reduced-motion: reduce) {
    .tos-coming-notice, .tos-coming-notice-cta svg { transition: none; }
}
@media (max-width: 540px) {
    .tos-coming-notice-cta span { display: none; }
}
.tos-spotlight-item {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: 9px var(--tos-space-5);
    color: var(--tos-text-secondary) !important;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--tos-duration) var(--tos-ease);
}
.tos-spotlight-item i {
    width: 18px;
    text-align: center;
    color: var(--tos-text-dim);
    font-size: var(--tos-text-sm);
    transition: color var(--tos-duration) var(--tos-ease);
}
.tos-spotlight-item-label {
    flex: 1;
    font-size: var(--tos-text-base);
    color: var(--tos-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tos-spotlight-item-hint {
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    color: var(--tos-text-dim);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.tos-spotlight-item:hover,
.tos-spotlight-item.is-active {
    background: var(--tos-accent-bg);
    color: var(--tos-text) !important;
}
.tos-spotlight-item:hover i,
.tos-spotlight-item.is-active i {
    color: var(--tos-app-accent);
}
.tos-spotlight-empty {
    padding: var(--tos-space-8) var(--tos-space-5);
    text-align: center;
    color: var(--tos-text-muted);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}

/* Spotlight apps grid (default state, empty query) */
/* "Get more apps" under the Spotlight grid: a quiet text link to the store, never a button, never orange */
.tos-spotlight-getapps {
    padding: 0 var(--tos-space-4) var(--tos-space-2);
    text-align: right;
}
.tos-spotlight-getapps a {
    font-family: var(--tos-font-body);
    font-size: 13px;
    color: var(--tos-text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--tos-border-strong);
    text-underline-offset: 2px;
}
.tos-spotlight-getapps a:hover { color: var(--tos-text); text-decoration-color: currentColor; }
.tos-spotlight-getapps a:focus-visible { outline: 2px solid var(--tos-text); outline-offset: 2px; border-radius: 2px; }
.tos-spotlight-grid-wrap {
    padding: var(--tos-space-2) var(--tos-space-2) var(--tos-space-3);
}
.tos-spotlight-grid {
    display: grid;
    /* minmax(0, 1fr) forces strictly equal columns regardless of label
       length — without the min:0 a long label can push its column wider. */
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--tos-space-1);
}
.tos-spotlight-grid-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--tos-space-2);
    padding: var(--tos-space-3) var(--tos-space-2);
    min-width: 0;
    min-height: 86px;
    border: 1px solid transparent;
    border-radius: var(--tos-radius);
    cursor: pointer;
    text-decoration: none !important;
    color: var(--tos-text) !important;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease);
}
.tos-spotlight-grid-tile:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border);
}
/* The selected (keyboard) tile is ink, the same treatment as the rail's current app */
.tos-spotlight-grid-tile.is-active {
    background: var(--tos-state-bg);
    border-color: var(--tos-state-border);
}
.tos-spotlight-grid-tile.is-active .tos-spotlight-grid-tile-icon { color: var(--tos-state); }
.tos-spotlight-grid-tile-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--tos-radius);
    /* Neutral: orange means "needs you", and an app does not (accent sweep, Spotlight) */
    background: var(--tos-surface-sunken);
    color: var(--tos-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tos-text-base);
    transition: transform var(--tos-duration) var(--tos-ease);
}
.tos-spotlight-grid-tile:hover .tos-spotlight-grid-tile-icon,
.tos-spotlight-grid-tile.is-active .tos-spotlight-grid-tile-icon {
    transform: scale(1.08);
}
.tos-spotlight-grid-tile-label {
    width: 100%;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--tos-text);
    line-height: 1.2;
    text-align: center;
    /* Up to 2 lines; long words break instead of overflowing. */
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pilot intelligence section */
.tos-spotlight-pilot {
    border-top: 1px solid var(--tos-border-faint);
    background: linear-gradient(to bottom, rgba(251, 146, 60, 0.04), transparent);
}
.tos-spotlight-pilot-head {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2) var(--tos-space-5);
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--tos-system);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-spotlight-pilot-head i { font-size: 0.7rem; }
.tos-spotlight-thinking {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-3) var(--tos-space-5);
    color: var(--tos-system);
    font-size: var(--tos-text-sm);
    font-style: italic;
}
.tos-spotlight-thinking-dots {
    display: inline-flex;
    gap: 2px;
}
.tos-spotlight-thinking-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--tos-system);
    animation: tos-spotlight-dot 1.2s ease-in-out infinite;
}
.tos-spotlight-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.tos-spotlight-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tos-spotlight-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40%           { opacity: 1;    transform: translateY(-2px); }
}
.tos-spotlight-item-ai {
    margin-left: var(--tos-space-2);
    padding: 1px 6px;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-system-bg);
    color: var(--tos-system);
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.tos-spotlight-item.is-pilot .tos-spotlight-item-label {
    color: var(--tos-text);
}

/* Pallas's answer: a question typed into search is answered as its own section, above the matches */
.tos-spotlight-answer {
    border-bottom: 1px solid var(--tos-border-faint);
    background: linear-gradient(to bottom, rgba(251, 146, 60, 0.04), transparent);
}
.tos-spotlight-answer-body {
    max-height: 320px;
    overflow-y: auto;
    padding: 0 var(--tos-space-5) var(--tos-space-2);
    font-size: var(--tos-text-sm);
    line-height: 1.55;
    color: var(--tos-text);
}
.tos-spotlight-answer-body p { margin: 0 0 var(--tos-space-2); }
.tos-spotlight-answer-body ul,
.tos-spotlight-answer-body ol { margin: 0 0 var(--tos-space-2); padding-left: 1.25rem; }
.tos-spotlight-answer-body li { margin: 2px 0; }
.tos-spotlight-answer-body code {
    font-family: var(--tos-font-mono);
    font-size: 0.85em;
    color: var(--tos-text-muted);
}
.tos-spotlight-answer-h {
    margin: var(--tos-space-2) 0 var(--tos-space-1);
    font-size: var(--tos-text-sm);
    font-weight: 700;
}
.tos-spotlight-answer-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tos-space-3);
    padding: 0 var(--tos-space-5) var(--tos-space-3);
    font-size: 0.72rem;
}
.tos-spotlight-answer-open {
    color: var(--tos-system);
    font-weight: 600;
    text-decoration: none;
}
.tos-spotlight-answer-open:hover { text-decoration: underline; }
.tos-spotlight-answer-note { color: var(--tos-text-muted); }
/* The cursor while the answer is still being written. It stops when the finished answer replaces the draft. */
.tos-spotlight-answer-caret {
    display: inline-block;
    width: 2px;
    height: 0.95em;
    margin-left: 1px;
    vertical-align: -0.12em;
    background: var(--tos-system);
    animation: tos-answer-caret 1s steps(2, start) infinite;
}
@keyframes tos-answer-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* A record's second line: the company, the date, whatever tells two people of the same name apart */
.tos-spotlight-item-sub {
    display: block;
    margin-top: 1px;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--tos-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 760px) {
    .tos-spotlight-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 420px) {
    .tos-spotlight-grid { grid-template-columns: repeat(3, 1fr); }
}
.tos-spotlight-foot {
    display: flex;
    align-items: center;
    gap: var(--tos-space-4);
    padding: var(--tos-space-2) var(--tos-space-5);
    border-top: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    color: var(--tos-text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.tos-spotlight-foot kbd {
    font-family: var(--tos-font-mono);
    font-size: 0.6rem;
    padding: 1px 5px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: 3px;
    color: var(--tos-text-muted);
    font-weight: 600;
    margin-right: 3px;
}
.tos-spotlight-foot-spacer { flex: 1; }
.tos-spotlight-pilot-hint {
    /* A sentence, not a tag: body font, sentence case, never orange. The kbd hints beside it stay mono tags. */
    color: var(--tos-text-secondary);
    font-family: var(--tos-font-body);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}

@media (max-width: 760px) {
    .tos-spotlight-panel {
        /* Tighter gap on narrow screens, but still measured FROM the chrome. Was a second
           hardcoded 64px, and it is the one that actually bit: at this width the panel
           opened on top of the topbar's own search bar the moment a banner appeared. */
        top: calc(var(--tos-chrome-top) + 12px);
        max-width: calc(100vw - var(--tos-space-4) * 2);
    }
    .tos-spotlight-foot { gap: var(--tos-space-2); font-size: 0.58rem; }
    .tos-spotlight-foot .tos-spotlight-foot-mobile-hide { display: none; }
    .tos-topbar-user-menu,
    .tos-topbar-notif-menu {
        width: calc(100vw - var(--tos-space-4) * 2);
        right: 0;
    }
}


/* ============================================================
   04 // Left rail
   ============================================================ */

.tos-rail {
    position: fixed;
    top: var(--tos-chrome-top);
    left: 0;
    bottom: 0;
    width: var(--tos-rail-w);
    background: var(--tos-surface);
    border-right: 1px solid var(--tos-border);
    z-index: 40;
    display: flex;
    flex-direction: column;
    transition: width 0.2s var(--tos-ease), transform 0.2s var(--tos-ease);
    overflow: hidden;
}
.tos-rail.is-collapsed {
    width: var(--tos-rail-w-collapsed);
}
.tos-rail-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--tos-space-3) var(--tos-space-2);
}
.tos-rail-scroll::-webkit-scrollbar { width: 4px; }
.tos-rail-scroll::-webkit-scrollbar-thumb { background: var(--tos-border-strong); border-radius: 2px; }

.tos-rail-section { margin-bottom: var(--tos-space-3); }
.tos-rail-section:last-child { margin-bottom: 0; }
.tos-rail-section-label {
    padding: var(--tos-space-2) var(--tos-space-3);
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--tos-text-dim);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-rail.is-collapsed .tos-rail-section-label {
    visibility: hidden;
    height: 12px;
    padding: 2px 0;
}

.tos-rail-item {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: 7px 10px;
    border-radius: var(--tos-radius);
    color: var(--tos-text-secondary) !important;
    text-decoration: none;
    font-size: var(--tos-text-sm);
    font-weight: 500;
    position: relative;
    transition: background var(--tos-duration) var(--tos-ease), color var(--tos-duration) var(--tos-ease);
    white-space: nowrap;
}
.tos-rail-item:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text) !important;
}
.tos-rail-item.is-active {
    background: var(--tos-state-bg);
    color: var(--tos-state) !important;
    font-weight: 600;
}
/* The current item is ink, in place: never the page's own accent, never a coloured edge bar (house rule).
   ::before stays off so an older page rule cannot bring the bar back. */
.tos-rail-item.is-active::before { content: none; }
.tos-rail-item i {
    width: 18px;
    text-align: center;
    font-size: var(--tos-text-sm);
    flex-shrink: 0;
}
/* Lucide (inline SVG from TimerIcon.RenderIcon) sits in the same 18px slot
   as the legacy FA <i>. stroke=currentColor inherits the item colour. */
.tos-rail-item > .timer-icon:not(.tos-rail-pin-mark) {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.tos-rail-item.is-active > .timer-icon:not(.tos-rail-pin-mark),
.tos-rail-item.is-active > i { color: var(--tos-state); }
/* Pin mark keeps its 9px slot (svg width/height = 1em = font-size). */
.tos-rail-pin-mark.timer-icon { width: 9px; height: 9px; }
/* Loading spinner shown on a rail app item while its page loads. Sits in the
   icon's 18px slot (14px ring + 2px each side) so the label never shifts. */
.tos-rail-spin {
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    margin: 0 2px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--tos-accent-bg, rgba(251, 146, 60, 0.22));
    border-top-color: var(--tos-app-accent, #fb923c);
    animation: tosRailSpin 0.6s linear infinite;
}
.tos-rail-item.is-loading > i,
.tos-rail-item.is-loading > .timer-icon { display: none; }
.tos-rail-item.is-loading { color: var(--tos-app-accent) !important; }
@keyframes tosRailSpin { to { transform: rotate(360deg); } }
.tos-rail-label {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tos-rail.is-collapsed .tos-rail-label { display: none; }
.tos-rail.is-collapsed .tos-rail-item {
    justify-content: center;
    padding: 9px 0;
}

/* "Get the mobile app" — the quiet last line of the rail.
   Deliberately not a .tos-rail-item: smaller type, muted, above a hairline, so it reads as
   chrome and never competes with the user's actual apps. The scroll container is a flex
   column, so margin-top:auto parks it at the bottom when the list is short and lets it sit
   naturally after the apps when the list is long — no absolute positioning to fight the
   scroll. Hidden entirely when the rail is collapsed to the 56px icon column: a muted 11px
   label cropped to an icon is noise, and the offer is not urgent enough to earn that slot. */
.tos-rail-scroll { display: flex; flex-direction: column; }
.tos-rail-getapp {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    margin-top: auto;
    padding: 8px 10px 4px;
    border-top: 1px solid var(--tos-border);
    font-size: 0.74rem;
    color: var(--tos-text-dim);
    text-decoration: none;
    transition: color 0.12s ease;
}
.tos-rail-getapp:hover { color: var(--tos-text); }
.tos-rail-getapp .timer-icon { width: 15px; height: 15px; flex-shrink: 0; }
.tos-rail.is-collapsed .tos-rail-getapp { display: none; }

/* Rail item adornments — TimerRailRenderer may emit a Tag badge
   (frequent/recent) and/or a pin-mark on the Yours section. Without
   styling they render as raw text/icons inline beside the label, and
   when the rail collapses they bleed into the 56px column showing as
   "some icons some cropped text". */
.tos-rail-badge {
    margin-left: auto;
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tos-tracking-mono);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--tos-text-dim);
    background: var(--tos-surface-hover);
    line-height: 1;
}
.tos-rail-badge-frequent { color: var(--tos-app-accent); background: var(--tos-accent-bg); }
.tos-rail-badge-recent   { color: var(--tos-text-secondary); background: var(--tos-surface-hover); }
.tos-rail-pin-mark {
    margin-left: auto;
    font-size: 9px;
    color: var(--tos-text-dim);
    opacity: 0.7;
    transform: rotate(45deg);
}
.tos-rail-item.is-pinned .tos-rail-pin-mark { opacity: 1; color: var(--tos-app-accent); }
.tos-rail.is-collapsed .tos-rail-badge,
.tos-rail.is-collapsed .tos-rail-pin-mark { display: none; }

.tos-rail-bottom {
    border-top: 1px solid var(--tos-border-faint);
    padding: var(--tos-space-2);
}


/* ============================================================
   05 // Main content
   ============================================================ */

.tos-main {
    /* INSIDE main, "--tos-topbar-h" means "how much fixed chrome is above me", and with a
       banner up that is banner + topbar. 35 rules across 17 page stylesheets write
       calc(100vh - var(--tos-topbar-h) ...) meaning exactly that, and every one of them was
       short by the banner's height - which is why a pane grew taller than the viewport and
       put a scrollbar on a page that had none. Redefining the token for this subtree fixes
       all of them at once and keeps the next one correct without anyone having to know.
       The topbar's own height is untouched: .tos-topbar is a sibling, not a descendant, and
       --tos-chrome-top is derived from --tos-topbar-real-h so there is no cycle. */
    --tos-topbar-h: var(--tos-chrome-top);
    margin-top: var(--tos-chrome-top);
    margin-left: var(--tos-rail-w);
    min-height: calc(100vh - var(--tos-chrome-top));
    background: var(--tos-bg);
    transition: margin-left 0.2s var(--tos-ease);
}
body.tos-rail-collapsed .tos-main {
    margin-left: var(--tos-rail-w-collapsed);
}
.tos-main-inner {
    max-width: 1560px;
    margin: 0 auto;
    padding: var(--tos-space-6);
}


/* ============================================================
   06a // Suppress framework-injected legacy chrome
   Targets specific framework-injected IDs only. Page-owned
   drawers/modals/toasts (which use generic .timer-drawer-* /
   .timer-modal-* classes) are NOT suppressed — they get TOS
   styling via the override layer below.
   ============================================================ */

body.tos-app #helpDrawer,
body.tos-app #helpDrawerBackdrop,
body.tos-app #accessGateDrawer,
body.tos-app #accessGateBackdrop,
body.tos-app #timerFeedbackWidget,
body.tos-app .timer-feedback-widget,
body.tos-app .timer-language-switch-overlay,
body.tos-app #commandPinPicker {
    display: none !important;
}

/* ------------------------------------------------------------
   06a-1 // Toasts (Timer.Notifications) — TOS-native styling

   .timer-notifications-container used to sit in the suppression
   list above, which contradicted this section's own comment
   ("Page-owned ... toasts are NOT suppressed"). The effect was
   that EVERY showNotification() on a tos-app page rendered its
   markup into the DOM and was then hidden by CSS — a silent
   failure with no console trace. The Drive upload's "file too
   large" error was one of its casualties.

   framework.css is NOT loaded on tos-app pages, so unhiding is
   not enough: .timer-notification* has zero rules here. The
   styling below is what makes the toast actually visible.
   ------------------------------------------------------------ */

body.tos-app .timer-notifications-container {
    position: fixed;
    top: calc(var(--tos-topbar-h, 56px) + 12px);
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

body.tos-app .timer-notification {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    background: var(--tos-surface, #fff);
    border: 1px solid var(--tos-border, #e5e7eb);
    border-radius: var(--tos-radius-md, 10px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
    animation: tosToastIn .22s ease-out both;
}

body.tos-app .timer-notification.timer-notification-hide {
    animation: tosToastOut .18s ease-in both;
}

@keyframes tosToastIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes tosToastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(16px); }
}

body.tos-app .timer-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
}

body.tos-app .timer-notification-icon {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 1.35;
    color: var(--tos-text-muted, #9ca3af);
}

body.tos-app .timer-notification-body {
    flex: 1 1 auto;
    min-width: 0;
}

body.tos-app .timer-notification-message {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--tos-text, #111827);
    word-wrap: break-word;
}

body.tos-app .timer-notification-time {
    margin-top: 2px;
    font-size: 11px;
    color: var(--tos-text-muted, #9ca3af);
}

body.tos-app .timer-notification-close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 2px 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--tos-text-muted, #9ca3af);
    border-radius: 4px;
}

body.tos-app .timer-notification-close:hover {
    background: var(--tos-surface-hover, #f3f4f6);
    color: var(--tos-text, #111827);
}

body.tos-app .timer-notification-progress {
    height: 2px;
    background: var(--tos-app-accent, #6366f1);
    transform-origin: left center;
    transform: scaleX(1);
}

/* The framework sets `animation: timerProgressBar <duration> linear forwards`
   on the bar. The keyframes were defined nowhere (not even framework.css), so
   the countdown bar was inert on every page. Defined here for tos-app. */
@keyframes timerProgressBar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Severity is carried by the ICON only. Coloured edge bars (left, top, right or
   bottom) are banned platform-wide - they read as generic AI UI, not Timer. */
body.tos-app .timer-notification-success .timer-notification-icon { color: #16a34a; }
body.tos-app .timer-notification-error .timer-notification-icon   { color: #dc2626; }
body.tos-app .timer-notification-warning .timer-notification-icon { color: #d97706; }
body.tos-app .timer-notification-info .timer-notification-icon    { color: var(--tos-app-accent, #6366f1); }


/* ============================================================
   06 // Rail backdrop (mobile drawer overlay)
   ============================================================ */

.tos-rail-backdrop {
    position: fixed;
    inset: 0;
    background: var(--tos-backdrop);
    backdrop-filter: blur(var(--tos-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--tos-backdrop-blur));
    opacity: 0;
    pointer-events: none;
    z-index: 35;
    transition: opacity 0.2s var(--tos-ease);
}
.tos-rail-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}


/* ============================================================
   07 // Page section archetype
   ============================================================ */

.tos-app-section {
    margin: 0 0 var(--tos-space-10);
}
.tos-app-section + .tos-app-section {
    padding-top: var(--tos-space-10);
    border-top: 1px solid var(--tos-rule);
}
.tos-app-section-head {
    display: flex;
    align-items: baseline;
    gap: var(--tos-space-3);
    margin-bottom: var(--tos-space-5);
}
.tos-app-section-num {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    color: var(--tos-app-accent);
    text-transform: uppercase;
}
.tos-app-section-label {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 600;
    letter-spacing: var(--tos-tracking-mono);
    color: var(--tos-text-muted);
    text-transform: uppercase;
}
.tos-app-section-rule {
    flex: 1;
    height: 1px;
    background: var(--tos-rule);
    align-self: center;
}
.tos-app-section-action {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 600;
    letter-spacing: var(--tos-tracking-mono);
    color: var(--tos-text-muted) !important;
    text-transform: uppercase;
    text-decoration: none;
    transition: color var(--tos-duration) var(--tos-ease);
}
.tos-app-section-action:hover { color: var(--tos-app-accent) !important; }


/* ============================================================
   08 // Meta strip + dot
   ============================================================ */

.tos-app-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--tos-space-2) var(--tos-space-5);
    padding: var(--tos-space-3) 0;
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    letter-spacing: var(--tos-tracking-mono);
    color: var(--tos-text-muted);
    text-transform: uppercase;
}
.tos-app-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: var(--tos-space-2);
}
.tos-app-meta-label { color: var(--tos-text-dim); font-weight: 600; }
.tos-app-meta-value { color: var(--tos-text); font-weight: 600; }
.tos-app-meta-sep { color: var(--tos-border-strong); user-select: none; }
.tos-app-meta-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--tos-accent);
    box-shadow: 0 0 6px var(--tos-accent);
    align-self: center;
    animation: tos-app-blink 1.8s ease-in-out infinite;
}
@keyframes tos-app-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}


/* ============================================================
   09 // Activity thread (cross-functional log)
   ============================================================ */

.tos-app-thread {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    overflow: hidden;
}
.tos-app-thread-item {
    display: grid;
    grid-template-columns: 56px 18px auto 1fr auto;
    gap: var(--tos-space-3) var(--tos-space-4);
    align-items: center;
    padding: var(--tos-space-3) var(--tos-space-5);
    border-bottom: 1px solid var(--tos-border-faint);
    position: relative;
    transition: background var(--tos-duration) var(--tos-ease);
}
.tos-app-thread-item:last-child { border-bottom: none; }
.tos-app-thread-item:hover { background: var(--tos-surface-hover); }
.tos-app-thread-item::before {
    content: '';
    position: absolute;
    left: 90px;
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
    background: var(--tos-border-strong);
    opacity: 0.30;
    z-index: 0;
}
.tos-app-thread-item:first-child::before { top: 50%; }
.tos-app-thread-item:last-child::before  { bottom: 50%; }

.tos-app-thread-time {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-dim);
    font-weight: 500;
    text-align: right;
    letter-spacing: 0.2px;
}
.tos-app-thread-glyph {
    width: 18px; height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tos-bg);
    border-radius: 50%;
    position: relative;
    z-index: 1;
    font-size: 0.6rem;
    color: var(--tos-ok);
}
.tos-app-thread-glyph.is-pending { color: var(--tos-pending); }
.tos-app-thread-glyph.is-active  {
    color: var(--tos-app-accent);
    animation: tos-app-pulse-ring 1.8s ease-out infinite;
}
.tos-app-thread-glyph.is-error   { color: var(--tos-error); }
@keyframes tos-app-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.45); }
    70%  { box-shadow: 0 0 0 8px rgba(251, 146, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0); }
}
.tos-app-thread-tag {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 600;
    color: var(--tos-system);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    white-space: nowrap;
}
.tos-app-thread-tag::before { content: '['; color: var(--tos-system); opacity: 0.45; margin-right: 1px; }
.tos-app-thread-tag::after  { content: ']'; color: var(--tos-system); opacity: 0.45; margin-left: 1px; }
.tos-app-thread-title {
    font-size: var(--tos-text-base);
    color: var(--tos-text);
    font-weight: 500;
    line-height: var(--tos-leading-snug);
    min-width: 0;
}
.tos-app-thread-meta {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-dim);
    letter-spacing: 0.4px;
    white-space: nowrap;
    text-transform: uppercase;
}


/* ============================================================
   10 // Cards
   ============================================================ */

.tos-app-card {
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    overflow: hidden;
    transition: border-color var(--tos-duration) var(--tos-ease);
}
.tos-app-card:hover { border-color: var(--tos-border-strong); }
.tos-app-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3) var(--tos-space-5);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
}
.tos-app-card-title {
    margin: 0;
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-text);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
}
.tos-app-card-title i {
    color: var(--tos-app-accent);
    font-size: var(--tos-text-sm);
}
.tos-app-card-body { padding: var(--tos-space-5); }
.tos-app-card-body.is-flush { padding: 0; }


/* ============================================================
   11 // Buttons
   ============================================================ */

.tos-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--tos-space-2);
    padding: 9px 14px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
    white-space: nowrap;
}
.tos-app-btn:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border-strong);
}
.tos-app-btn-primary {
    background: var(--tos-accent);
    border-color: var(--tos-accent);
    color: var(--tos-on-orange);
}
.tos-app-btn-primary:hover {
    background: var(--tos-accent-strong);
    border-color: var(--tos-accent-strong);
    color: var(--tos-on-orange);
}


/* ============================================================
   12 // Mobile chrome
   ============================================================ */

@media (max-width: 1024px) {
    .tos-topbar {
        padding: 0 var(--tos-space-3);
        gap: var(--tos-space-3);
    }
    .tos-topbar-tag { display: none; }
    .tos-topbar-center { max-width: none; }
    .tos-topbar-command-label { display: none; }
    .tos-topbar-command kbd { display: none; }
    .tos-topbar-command {
        width: 36px;
        max-width: 36px;
        padding: 0;
        justify-content: center;
        background: transparent;
        border-color: transparent;
        height: 36px;
    }
    .tos-topbar-command:hover { background: var(--tos-surface-hover); border-color: var(--tos-border); }
    .tos-topbar-pilot { display: none; }
    .tos-topbar-icon { display: none; }

    .tos-rail {
        transform: translateX(-100%);
        transition: transform 0.2s var(--tos-ease);
        width: 280px;
    }
    .tos-rail.is-mobile-open { transform: translateX(0); }
    body.tos-rail-locked { overflow: hidden; }

    .tos-main { margin-left: 0; }
    .tos-main-inner { padding: var(--tos-space-5) var(--tos-space-4) var(--tos-space-12); }

    body.tos-rail-collapsed .tos-main { margin-left: 0; }
}
@media (max-width: 760px) {
    .tos-topbar { gap: var(--tos-space-2); }
    .tos-topbar-name { display: none; }
    .tos-app-section { margin-bottom: var(--tos-space-8); }
    .tos-app-section + .tos-app-section { padding-top: var(--tos-space-8); }

    .tos-app-thread-item {
        grid-template-columns: 44px 16px auto 1fr;
        gap: var(--tos-space-2) var(--tos-space-3);
        padding: var(--tos-space-3) var(--tos-space-4);
    }
    .tos-app-thread-item::before { left: 74px; }
    .tos-app-thread-meta { display: none; }
}
@media (max-width: 420px) {
    .tos-topbar { padding: 0 var(--tos-space-2); }
    .tos-topbar-brand { padding: 0; }
    .tos-main-inner { padding: var(--tos-space-4) var(--tos-space-3) var(--tos-space-10); }
    .tos-app-thread-item {
        grid-template-columns: 38px 14px 1fr;
        grid-template-rows: auto auto;
        gap: var(--tos-space-2);
    }
    .tos-app-thread-time  { grid-column: 1; grid-row: 1; }
    .tos-app-thread-glyph { grid-column: 2; grid-row: 1; }
    .tos-app-thread-tag   { grid-column: 3; grid-row: 1; }
    .tos-app-thread-title { grid-column: 1 / -1; grid-row: 2; padding-left: 60px; }
    .tos-app-thread-item::before { left: 62px; }
}


/* ============================================================
   14 // Page archetype — context-rail + main
   ============================================================ */

.tos-app-page {
    display: block;
    width: 100%;
}
.tos-app-page.is-split {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: var(--tos-space-5);
    align-items: start;
}
.tos-app-page-context {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-3);
    position: sticky;
    top: calc(var(--tos-chrome-top) + var(--tos-space-5));
    min-width: 0;
}
.tos-app-page-content {
    min-width: 0;
}
@media (max-width: 1100px) {
    .tos-app-page.is-split {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: var(--tos-space-4);
    }
}
@media (max-width: 900px) {
    .tos-app-page.is-split {
        grid-template-columns: 1fr;
    }
    .tos-app-page-context {
        position: static;
    }
}


/* ============================================================
   14b // Two-pane shell — mailbox / chat / dispatch
   For apps shaped like Gmail / Outlook / chat: a left LIST
   pane (queue of items) and a right DETAIL pane (selected
   item). Lives directly under .tos-main-inner — no .tos-app-
   page wrapper, no hero memory band (those belong to list +
   drawer apps like People / Companies).

   Each pane is a flex-column with internal scroll. Optional
   structural slots (-head, -body, -foot) let apps carve out
   sticky-top headers / sticky-bottom action bars without per-
   app CSS. The pane container itself is the scroll element —
   if an app needs sticky slots, position them via the slot
   classes.

   First consumer: dispatch. Future: chat, mailroom, any other
   item-list + item-detail app.
   ============================================================ */

.tos-app-pane-split {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: var(--tos-space-4);
    align-items: stretch;
    min-height: calc(100vh - var(--tos-chrome-top) - (var(--tos-space-6) * 2));
}
.tos-app-pane-list,
.tos-app-pane-view {
    display: flex;
    flex-direction: column;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
/* The pane IS the scroll container so head/body/foot all
   share one scroll surface. Apps that want a sticky head can
   add `position: sticky; top: 0;` on .tos-app-pane-{list|view}-head. */
.tos-app-pane-list { overflow-y: auto; }
.tos-app-pane-view { overflow-y: auto; }

.tos-app-pane-list-head,
.tos-app-pane-view-head {
    flex: 0 0 auto;
    padding: var(--tos-space-3) var(--tos-space-4);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface);
}
.tos-app-pane-list-body,
.tos-app-pane-view-body {
    flex: 1 1 auto;
    min-height: 0;
}
.tos-app-pane-view-body { padding: var(--tos-space-4); }
.tos-app-pane-list-foot,
.tos-app-pane-view-foot {
    flex: 0 0 auto;
    padding: var(--tos-space-2) var(--tos-space-3);
    border-top: 1px solid var(--tos-border-faint);
    background: var(--tos-surface);
}

@media (max-width: 1100px) {
    .tos-app-pane-split {
        grid-template-columns: 340px minmax(0, 1fr);
        gap: var(--tos-space-3);
    }
}
@media (max-width: 900px) {
    .tos-app-pane-split {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    /* Mobile is one-pane-at-a-time. App toggles .is-detail-open
       on the split container when a row is selected; CSS swaps
       which pane is shown. No JS needed for layout — only the
       class toggle. */
    .tos-app-pane-split.is-detail-open .tos-app-pane-list { display: none; }
    .tos-app-pane-split:not(.is-detail-open) .tos-app-pane-view { display: none; }
}


/* ============================================================
   15 // Page bar — memory recall (left) + actions (right)
   The left side shows operational context (what's recent,
   what's pending, sync state) — temporal anchors that
   complement the stat cards in the context rail. Page
   identity is NOT repeated here (the topbar / app tag
   already does wayfinding).
   ============================================================ */

.tos-app-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    margin-bottom: var(--tos-space-5);
}

/* Memory band — flex:1 absorbs all slack so the action
   cluster pins to the right edge. */
.tos-app-hero-memory {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--tos-font-mono);
    font-size: 0.72rem;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    line-height: 1.4;
}
.tos-app-hero-memory > .tos-app-meta-dot {
    background: var(--tos-ok);
    box-shadow: 0 0 6px var(--tos-ok);
}
.tos-app-hero-memory-label {
    color: var(--tos-app-accent);
    font-weight: 700;
}
.tos-app-hero-memory-item {
    color: var(--tos-text-muted);
    white-space: nowrap;
}
.tos-app-hero-memory-item strong {
    color: var(--tos-text);
    font-weight: 700;
}
.tos-app-hero-memory-sep {
    color: var(--tos-border-strong);
    user-select: none;
}

/* Pilot-applied filter chip — distinct from user role chips.
   Sits in .tos-app-list-head-start when a preset is active.
   Click × to clear. Same shape for every app. */
.tos-app-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 10px;
    background: var(--tos-system-bg);
    border: 1px solid var(--tos-system-border);
    border-radius: var(--tos-radius-full);
    color: var(--tos-system);
    font-family: var(--tos-font-body);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.tos-app-filter-chip > i { font-size: 0.72rem; }
.tos-app-filter-chip-label {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.tos-app-filter-chip-label::before {
    content: 'PILOT';
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    opacity: 0.75;
}
.tos-app-filter-chip-clear {
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--tos-system);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tos-duration) var(--tos-ease), color var(--tos-duration) var(--tos-ease);
}
.tos-app-filter-chip-clear:hover {
    background: var(--tos-system);
    color: var(--tos-text-inverse);
}

/* Pilot drawer — quick-ask scoped to the current app.
   Same TOS drawer chrome with a purple (system) accent so
   it reads as Pilot, not as edit/add (orange) or delete (red). */
/* No coloured edge bar (house rule, D.1): Pilot is carried by its system-toned icon. */
body.tos-app .timer-drawer-panel.timer-drawer-pilot::before { content: none; }
body.tos-app .timer-drawer-panel.timer-drawer-pilot .timer-drawer-icon {
    /* Same contrast trap as the generic drawer icon: the glyph sat on an 8% tint of its
       own colour (1.94:1). Darken the glyph so it clears the 3:1 AA floor for graphics
       (#fb923c -> ~#b5692b on #fef6ef = 3.95:1) while keeping the soft plate. */
    background: var(--tos-system-bg);
    color: color-mix(in srgb, var(--tos-system) 72%, #000);
}
body.tos-app .timer-drawer-panel.timer-drawer-pilot .timer-drawer-titles h2 {
    color: var(--tos-system);
}

/* Assign-to-Pilot context tray (OS-level — sits at the top of the Pilot drawer body) */
.tos-pilot-tray {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
    padding-bottom: var(--tos-space-3);
    margin-bottom: var(--tos-space-3);
    border-bottom: 1px solid var(--tos-system-border);
}
.tos-pilot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tos-space-2);
}
.tos-pilot-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    max-width: 100%;
    padding: 4px var(--tos-space-2) 4px var(--tos-space-3);
    border-radius: var(--tos-radius-pill, 999px);
    background: color-mix(in srgb, var(--tos-system-purple, var(--tos-accent)) 12%, var(--tos-surface));
    border: 1px solid color-mix(in srgb, var(--tos-system-purple, var(--tos-accent)) 35%, transparent);
    color: var(--tos-text);
    font-size: var(--tos-text-xs);
    line-height: 1.3;
}
.tos-pilot-chip > i { color: var(--tos-system-purple, var(--tos-accent)); font-size: 11px; }
.tos-pilot-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.tos-pilot-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    padding: 0;
    border: none; background: transparent;
    color: var(--tos-text-muted);
    cursor: pointer;
    border-radius: 50%;
}
.tos-pilot-chip-x:hover { background: var(--tos-system-border); color: var(--tos-text); }
.tos-pilot-qps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tos-space-2);
}
.tos-pilot-qp {
    padding: 4px var(--tos-space-3);
    border-radius: var(--tos-radius-pill, 999px);
    border: 1px solid var(--tos-system-border);
    background: var(--tos-surface);
    color: var(--tos-text-secondary, var(--tos-text));
    font-size: var(--tos-text-xs);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tos-pilot-qp:hover {
    background: color-mix(in srgb, var(--tos-system-purple, var(--tos-accent)) 10%, var(--tos-surface));
    border-color: color-mix(in srgb, var(--tos-system-purple, var(--tos-accent)) 40%, transparent);
    color: var(--tos-text);
}
/* "Assign to Pilot" row action — purple tint to match Pilot */
.timer-task-action-btn.assign-pilot:hover {
    color: var(--tos-system-purple, var(--tos-accent));
    border-color: color-mix(in srgb, var(--tos-system-purple, var(--tos-accent)) 40%, transparent);
}

.tos-pilot-msgs {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-3);
    padding-bottom: var(--tos-space-2);
}
.tos-pilot-msg {
    max-width: 88%;
    padding: var(--tos-space-2) var(--tos-space-3);
    border-radius: var(--tos-radius-md);
    font-size: var(--tos-text-sm);
    line-height: var(--tos-leading-snug);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.tos-pilot-msg.is-user {
    align-self: flex-end;
    background: var(--tos-accent);
    color: var(--tos-on-orange);
    border-bottom-right-radius: var(--tos-radius-sm);
}
.tos-pilot-msg.is-pilot {
    align-self: flex-start;
    background: var(--tos-surface);
    border: 1px solid var(--tos-system-border);
    color: var(--tos-text);
    border-bottom-left-radius: var(--tos-radius-sm);
}
.tos-pilot-msg.is-error {
    align-self: flex-start;
    background: var(--tos-error-bg);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: var(--tos-error);
}
.tos-pilot-thinking {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2) var(--tos-space-3);
    background: var(--tos-system-bg);
    border-radius: var(--tos-radius-md);
    color: var(--tos-system);
    font-size: var(--tos-text-sm);
    font-style: italic;
}
.tos-pilot-thinking-dots {
    display: inline-flex;
    gap: 2px;
}
.tos-pilot-thinking-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--tos-system);
    animation: tos-pilot-dot 1.2s ease-in-out infinite;
}
.tos-pilot-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.tos-pilot-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tos-pilot-dot {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40%           { opacity: 1;   transform: translateY(-2px); }
}
.tos-pilot-empty {
    padding: var(--tos-space-8) var(--tos-space-3);
    text-align: center;
    color: var(--tos-text-muted);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    line-height: 1.6;
}
.tos-pilot-empty i {
    display: block;
    font-size: 1.6rem;
    color: var(--tos-system);
    margin-bottom: var(--tos-space-2);
}

body.tos-app .timer-drawer-pilot .timer-drawer-footer {
    flex-direction: column;
    align-items: stretch;
    gap: var(--tos-space-2);
    padding: var(--tos-space-3) var(--tos-space-4);
}
.tos-pilot-input-row {
    display: flex;
    gap: var(--tos-space-2);
    align-items: flex-end;
}
.tos-pilot-input {
    flex: 1;
    height: 38px;
    min-height: 38px;
    max-height: 240px;
    padding: 8px 10px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-control-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    line-height: 1.45;
    outline: none;
    resize: none;
    overflow-y: hidden;
    transition: border-color var(--tos-duration) var(--tos-ease),
                box-shadow var(--tos-duration) var(--tos-ease);
}
.tos-pilot-input.is-scrolling {
    overflow-y: auto;
}
.tos-pilot-input:focus {
    border-color: var(--tos-system);
    box-shadow: 0 0 0 3px var(--tos-system-bg);
}
.tos-pilot-send {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--tos-system);
    border: 1px solid var(--tos-system);
    border-radius: var(--tos-radius);
    color: var(--tos-text-inverse);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tos-duration) var(--tos-ease);
}
/* Was #6d28d9 — the button sat on --tos-system (orange) at rest and flipped
   to violet on hover. Pallas is orange in both states. */
.tos-pilot-send:hover { background: var(--tos-accent-strong); border-color: var(--tos-accent-strong); }
.tos-pilot-send:disabled { opacity: 0.5; cursor: not-allowed; }
.tos-pilot-footnote {
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    color: var(--tos-text-dim);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    text-align: right;
}

/* Topbar Pilot pill as a clickable button */
body.tos-app button.tos-topbar-pilot {
    border: 1px solid var(--tos-system-border);
    cursor: pointer;
    font-family: var(--tos-font-mono);
}
body.tos-app button.tos-topbar-pilot:hover {
    background: var(--tos-system);
    color: var(--tos-text-inverse);
}
body.tos-app button.tos-topbar-pilot:hover .tos-app-meta-dot {
    background: var(--tos-text-inverse);
    box-shadow: 0 0 6px var(--tos-text-inverse);
}


/* Pilot observations card — actionable suggestions in the
   context rail. Used by every app's Pilot card. Skeleton
   shimmer during load, staggered fade-in on data arrival,
   subtle hover, severity-coded left border. */
.tos-pilot-card {
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.tos-pilot-card-head {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2) var(--tos-space-3);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-system);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-pilot-card-head i { color: var(--tos-system); }
.tos-pilot-card-body {
    display: flex;
    flex-direction: column;
}
.tos-pilot-obs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: var(--tos-space-2) var(--tos-space-3);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--tos-border-faint);
    border-left: 2px solid transparent;
    text-align: left;
    color: var(--tos-text);
    text-decoration: none !important;
    cursor: pointer;
    font: inherit;
    opacity: 0;
    transform: translateY(4px);
    animation: tos-pilot-obs-in 0.35s var(--tos-ease) forwards;
    transition: background var(--tos-duration) var(--tos-ease),
                border-left-color var(--tos-duration) var(--tos-ease),
                transform 0.12s var(--tos-ease);
}
.tos-pilot-obs:active {
    transform: translateY(0) scale(0.99);
}
@keyframes tos-pilot-obs-in {
    to { opacity: 1; transform: translateY(0); }
}
.tos-pilot-obs:hover {
    background: var(--tos-surface-hover);
}
.tos-pilot-obs:last-child { border-bottom: none; }
.tos-pilot-obs.is-info   { border-left-color: var(--tos-system); }
.tos-pilot-obs.is-warn   { border-left-color: var(--tos-pending); }
.tos-pilot-obs.is-urgent { border-left-color: var(--tos-error); }
.tos-pilot-obs-head {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
}
.tos-pilot-obs-icon {
    width: 22px;
    height: 22px;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-system-bg);
    color: var(--tos-system);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.tos-pilot-obs.is-warn .tos-pilot-obs-icon {
    background: var(--tos-pending-bg);
    color: var(--tos-pending);
}
.tos-pilot-obs.is-urgent .tos-pilot-obs-icon {
    background: var(--tos-error-bg);
    color: var(--tos-error);
}
.tos-pilot-obs-title {
    flex: 1;
    min-width: 0;
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.tos-pilot-obs-action {
    flex-shrink: 0;
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--tos-radius-sm);
    border: 1px solid var(--tos-border);
    background: var(--tos-surface);
    transition: background var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease);
}
.tos-pilot-obs:hover .tos-pilot-obs-action {
    background: var(--tos-system);
    border-color: var(--tos-system);
    color: var(--tos-text-inverse);
}
.tos-pilot-obs-detail {
    margin: 4px 0 0 30px;
    font-size: 0.72rem;
    color: var(--tos-text-muted);
    line-height: 1.4;
}
.tos-pilot-obs-empty {
    padding: var(--tos-space-4) var(--tos-space-3);
    text-align: center;
    color: var(--tos-text-muted);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}

/* Skeleton shimmer rows while loading */
.tos-pilot-obs-skel {
    padding: var(--tos-space-3);
    border-bottom: 1px solid var(--tos-border-faint);
    border-left: 2px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tos-pilot-obs-skel:last-child { border-bottom: none; }
.tos-pilot-obs-skel-bar {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg,
        var(--tos-surface-sunken) 0%,
        var(--tos-border-faint) 50%,
        var(--tos-surface-sunken) 100%);
    background-size: 200% 100%;
    animation: tos-pilot-obs-shimmer 1.3s linear infinite;
}
.tos-pilot-obs-skel-bar.is-short { width: 60%; }
.tos-pilot-obs-skel-bar.is-mid   { width: 85%; }
@keyframes tos-pilot-obs-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* Marquee — one line, vertical flip cycling through recalls.
   Used by every app's memory band. The frontend feeds it
   sentences from api/TimerMemoryRecallAPI.asmx/GetRecalls. */
.tos-app-hero-memory-marquee {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 1.4em;
    overflow: hidden;
}
.tos-app-hero-memory-line {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    color: var(--tos-text);
    font-family: var(--tos-font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateY(0.9em);
    opacity: 0;
    transition: transform 0.45s var(--tos-ease), opacity 0.4s var(--tos-ease);
}
.tos-app-hero-memory-line.is-active {
    transform: translateY(0);
    opacity: 1;
}
.tos-app-hero-memory-line.is-leaving {
    transform: translateY(-0.9em);
    opacity: 0;
}

/* Legacy title row — kept as opt-in only. Apps that genuinely
   need a title (a sub-page detail, a settings page) can still
   use .tos-app-hero-title-row. Default list/app pages use
   .tos-app-hero-memory instead. */
.tos-app-hero-title-row {
    display: inline-flex;
    align-items: baseline;
    gap: var(--tos-space-3);
    min-width: 0;
    flex: 1 1 auto;
}
.tos-app-hero-tag {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-app-accent);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    flex-shrink: 0;
}
.tos-app-hero-title {
    margin: 0;
    font-size: var(--tos-text-xl);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--tos-text);
}
.tos-app-hero-sub {
    margin: 0 0 0 var(--tos-space-2);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-app-hero-actions {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    flex-wrap: wrap;
    flex-shrink: 0;
}


/* ============================================================
   16 // OS-level overrides for legacy chrome classes
   Drawers, modals, toasts, forms, buttons used across the
   product — restyled to TOS aesthetic under body.tos-app
   scope. JS still emits legacy class names per the
   Strangler-Fig rule; these overrides reskin them.
   ============================================================ */

/* --- DRAWERS --- */
body.tos-app .timer-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: var(--tos-backdrop);
    backdrop-filter: blur(var(--tos-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--tos-backdrop-blur));
    opacity: 0;
    pointer-events: none;
    z-index: 10001;
    transition: opacity var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-drawer-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Lock background scroll while ANY drawer is open. */
body.tos-app:has(.timer-drawer-panel.open) {
    overflow: hidden;
}

/* DANGER drawer variant — used for any destructive confirmation
   (row delete, group delete, bulk delete, etc.). Red accent
   stripe, red icon, red title, red Save button. */
body.tos-app .timer-drawer-panel.timer-drawer-danger { position: fixed; }
/* No coloured edge bar (house rule, D.1): danger is carried by the icon's error tone and the red confirm button. */
body.tos-app .timer-drawer-panel.timer-drawer-danger::before { content: none; }
body.tos-app .timer-drawer-panel.timer-drawer-danger .timer-drawer-icon {
    background: var(--tos-error-bg);
    color: var(--tos-error);
}
body.tos-app .timer-drawer-panel.timer-drawer-danger .timer-drawer-titles h2 {
    color: var(--tos-error);
}
body.tos-app .timer-drawer-panel.timer-drawer-danger .timer-drawer-subtitle {
    color: var(--tos-error);
    opacity: 0.85;
}

/* Subject card at the top of a danger drawer */
.tos-danger-subject {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3) var(--tos-space-4);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    margin-bottom: var(--tos-space-3);
}
.tos-danger-subject-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tos-state-bg);
    color: var(--tos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tos-text-base);
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}
.tos-danger-subject-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tos-danger-subject-name {
    font-size: var(--tos-text-md);
    font-weight: 700;
    color: var(--tos-text);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tos-danger-subject-meta {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Impact list — what's being deleted */
.tos-danger-impact-label {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-error);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    margin: 0 0 var(--tos-space-2);
}
.tos-danger-impact {
    list-style: none;
    margin: 0 0 var(--tos-space-3);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tos-danger-impact li {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: 8px var(--tos-space-3);
    background: var(--tos-error-bg);
    border-left: 2px solid var(--tos-error);
    border-radius: 0 var(--tos-radius-sm) var(--tos-radius-sm) 0;
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
}
.tos-danger-impact-count {
    font-family: var(--tos-font-body);
    font-weight: 700;
    color: var(--tos-error);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.tos-danger-impact-key {
    color: var(--tos-text-secondary);
    font-weight: 500;
}

/* Note: this action cannot be undone */
.tos-danger-note {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-3);
    background: var(--tos-error-bg);
    border: 1px dashed rgba(220, 38, 38, 0.4);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-error);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    font-weight: 600;
}
.tos-danger-note i {
    font-size: var(--tos-text-sm);
    flex-shrink: 0;
}

/* Simple paragraph for danger drawer body (no subject) */
.tos-danger-body {
    margin: 0 0 var(--tos-space-3);
    color: var(--tos-text);
    font-size: var(--tos-text-sm);
    line-height: var(--tos-leading-snug);
}
body.tos-app .timer-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    /* Full-height flush-right TOS drawer — explicitly neutralise framework.css's
       floating-card geometry (border-radius:2xl + max-height:calc(100vh-104px)),
       which leaks on pages that co-load framework.css for legacy components
       (e.g. signature-prepare) and made the panel look rounded + short. */
    border-radius: 0;
    max-height: none;
    width: 520px;
    max-width: 100vw;
    background: var(--tos-surface);
    /* Box-shadow only applies when the drawer is .open. The shadow's
       blur extends 24px to the LEFT of the panel, which (when the
       panel is translated 100% off-screen) bleeds back into the
       viewport — visible as a dark band on the right edge in dark
       mode. Page with N drawers stacks N shadows. Fix: shadow lives
       on the .open variant only. */
    box-shadow: none;
    transform: translateX(100%);
    transition: transform var(--tos-duration-slow) var(--tos-ease),
                box-shadow var(--tos-duration-slow) var(--tos-ease);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.tos-app .timer-drawer-panel.open {
    transform: translateX(0);
    box-shadow: var(--tos-shadow-drawer);
}
body.tos-app .timer-drawer-panel.closing { transform: translateX(100%); }
body.tos-app .timer-drawer-wide { width: 720px; }

body.tos-app .timer-drawer-accent {
    display: none;
}

body.tos-app .timer-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: var(--tos-space-4) var(--tos-space-5);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
    flex-shrink: 0;
}
body.tos-app .timer-drawer-header-content {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    min-width: 0;
}
body.tos-app .timer-drawer-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--tos-radius);
    /* The glyph sits on an 8% tint of ITS OWN colour, so accent-on-accent-bg measured
       2.39:1 - below the 3:1 WCAG AA floor for graphical objects, which is why the
       drawer's top-left icon read as washed out. Use the STRONG accent for the glyph
       (documents: #059669 on #EDF9F5 = 3.51:1) and keep the soft plate. Falls back to
       the plain accent, so an app that defines no strong accent is unchanged. */
    /* A neutral tile, never the app accent (house drawer, D.1): the drawer's purpose is in its title.
       The danger and pilot drawers keep their own tones below. The header is already sunken, so the tile
       is the surface with a faint border, or it would vanish into the header. */
    background: var(--tos-surface);
    border: 1px solid var(--tos-border-faint);
    color: var(--tos-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tos-text-base);
    flex-shrink: 0;
}
/* Dark keeps the plain accent. The strong accent is a DARKER shade, and 31 apps define it for
   light only, so the light-mode fix above turned the glyph dark-on-dark on a dark plate. The
   same goes for the pilot drawer's darkened glyph. (Found reviewing DC #693, 2026-10-10.) */
html[data-theme="dark"] body.tos-app .timer-drawer-icon,
body.tos-app[data-theme="dark"] .timer-drawer-icon { color: var(--tos-text-secondary); }
html[data-theme="dark"] body.tos-app .timer-drawer-panel.timer-drawer-pilot .timer-drawer-icon,
body.tos-app[data-theme="dark"] .timer-drawer-panel.timer-drawer-pilot .timer-drawer-icon { color: var(--tos-system); }
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body.tos-app .timer-drawer-icon,
    html:not([data-theme="light"]):not([data-theme="dark"]) body.tos-app:not([data-theme]) .timer-drawer-icon,
    body.tos-app[data-theme="system"] .timer-drawer-icon { color: var(--tos-text-secondary); }
    html[data-theme="system"] body.tos-app .timer-drawer-panel.timer-drawer-pilot .timer-drawer-icon,
    html:not([data-theme="light"]):not([data-theme="dark"]) body.tos-app:not([data-theme]) .timer-drawer-panel.timer-drawer-pilot .timer-drawer-icon,
    body.tos-app[data-theme="system"] .timer-drawer-panel.timer-drawer-pilot .timer-drawer-icon { color: var(--tos-system); }
}

/* Premium drawers: the house tile, not a coloured square. Legacy components.css, which timer-fw.js injects on
   every page with the bug-report button, paints .timer-drawer-premium .timer-drawer-icon as a 52px gradient
   square (0,3,0) and its .icon-blue/-teal/-purple... variants (0,4,0). Appended last, it beat the generic tile
   above (0,2,1) on every premium drawer. These rules out-rank it on specificity alone (no !important):
   geometry for every premium drawer, ink for the ordinary ones, and the danger and pilot drawers keep their
   own tones (head designer, 23 Nov; one rule in shared chrome instead of per-page hides). */
body.tos-app .timer-drawer-panel.timer-drawer-premium .timer-drawer-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--tos-radius);
    border: 1px solid var(--tos-border-faint);
    box-shadow: none;
    font-size: var(--tos-text-base);
}
body.tos-app .timer-drawer-panel.timer-drawer-premium:not(.timer-drawer-danger):not(.timer-drawer-pilot) .timer-drawer-icon {
    background: var(--tos-surface);
    color: var(--tos-text-secondary);
}
body.tos-app .timer-drawer-panel.timer-drawer-premium.timer-drawer-danger .timer-drawer-icon {
    background: var(--tos-error-bg);
    color: var(--tos-error);
}
body.tos-app .timer-drawer-panel.timer-drawer-premium.timer-drawer-pilot .timer-drawer-icon {
    background: var(--tos-system-bg);
    color: color-mix(in srgb, var(--tos-system) 72%, #000);
}
html[data-theme="dark"] body.tos-app .timer-drawer-panel.timer-drawer-premium.timer-drawer-pilot .timer-drawer-icon,
body.tos-app[data-theme="dark"] .timer-drawer-panel.timer-drawer-premium.timer-drawer-pilot .timer-drawer-icon { color: var(--tos-system); }
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body.tos-app .timer-drawer-panel.timer-drawer-premium.timer-drawer-pilot .timer-drawer-icon,
    html:not([data-theme="light"]):not([data-theme="dark"]) body.tos-app:not([data-theme]) .timer-drawer-panel.timer-drawer-premium.timer-drawer-pilot .timer-drawer-icon,
    body.tos-app[data-theme="system"] .timer-drawer-panel.timer-drawer-premium.timer-drawer-pilot .timer-drawer-icon { color: var(--tos-system); }
}
body.tos-app .timer-drawer-titles { min-width: 0; }
body.tos-app .timer-drawer-titles h2 {
    margin: 0;
    font-size: var(--tos-text-lg);
    font-weight: 700;
    color: var(--tos-text);
    letter-spacing: -0.01em;
}
body.tos-app .timer-drawer-subtitle {
    display: block;
    margin-top: 2px;
    font-family: var(--tos-font-body);
    font-size: 13px;
    color: var(--tos-text-muted);
    letter-spacing: normal;
    text-transform: none;
}
body.tos-app .timer-drawer-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius);
    color: var(--tos-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-drawer-close:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border);
    color: var(--tos-text);
}
body.tos-app .timer-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--tos-space-4);
    background: var(--tos-bg);
    text-align: left; /* a page rule cannot centre a whole drawer by accident; a more specific rule inside still can */
}
body.tos-app .timer-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--tos-space-2);
    padding: var(--tos-space-3) var(--tos-space-4);
    border-top: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
    flex-shrink: 0;
}

/* Section heads inside a drawer (house drawer, D.1): sentence case in the body font, and a neutral icon.
   A section heading needs nothing from the person, so it never carries orange or any other tone; the
   .icon-* tone classes still colour section icons outside drawers. Danger drawers keep the error tone. */
body.tos-app .timer-drawer-panel .timer-section-title,
body.tos-app .timer-drawer-panel .timer-section-header h4 {
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-base);
    font-weight: 600;
    color: var(--tos-text);
    letter-spacing: normal;
    text-transform: none;
}
body.tos-app .timer-drawer-panel .timer-section-icon,
body.tos-app .timer-drawer-panel .timer-section-icon[class*="icon-"] {
    background: transparent;
    color: var(--tos-text-secondary);
}
body.tos-app .timer-drawer-panel.timer-drawer-danger .timer-section-icon,
body.tos-app .timer-drawer-panel.timer-drawer-danger .timer-section-icon[class*="icon-"] {
    color: var(--tos-error);
}

/* Premium sections inside drawers — dense */
body.tos-app .timer-premium-section {
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    margin-bottom: var(--tos-space-3);
    overflow: hidden;
}
body.tos-app .timer-premium-section:last-child { margin-bottom: 0; }
body.tos-app .timer-section-header {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2) var(--tos-space-3);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
}
body.tos-app .timer-section-header h4 {
    margin: 0;
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-text);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .timer-section-icon {
    width: 22px;
    height: 22px;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-app-accent-bg);
    color: var(--tos-app-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}
body.tos-app .timer-section-icon.icon-purple,
body.tos-app .timer-section-icon.icon-indigo { background: var(--tos-system-bg); /* --tos-system aliases the accent, a FILL colour, and this tile's ground is a 10% tint
       of that same accent - so the glyph sat at 1.9:1 on its own wash. Text-safe variant. */
    color: var(--tos-accent-text); }
body.tos-app .timer-section-icon.icon-orange { background: var(--tos-accent-bg); color: var(--tos-accent-text); }
body.tos-app .timer-section-icon.icon-teal,
body.tos-app .timer-section-icon.icon-green { background: var(--tos-ok-bg); color: var(--tos-ok); }
body.tos-app .timer-section-icon.icon-amber { background: rgba(245, 158, 11, 0.10); color: #d97706; }

/* ---- Drawer: Audio section -------------------------------------------------
   Drawer CONTENT, so it lives in the OS sheet - tos-app-agenda.css states that a
   drawer rule below its header fails the audit. Uses the app accent, so it takes
   each app's colour rather than pinning one.
   ------------------------------------------------------------------------- */
body.tos-app .audio-kind-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
body.tos-app .audio-kind-pill {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-sm);
    background: transparent;
    color: var(--tos-text-secondary);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .audio-kind-pill:hover:not(:disabled) {
    border-color: var(--tos-border-strong);
    color: var(--tos-text);
}
body.tos-app .audio-kind-pill.is-selected {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent-border);
    color: var(--tos-app-accent);
}
body.tos-app .audio-kind-pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* SEGMENTED CONTROL (.tos-seg) - the house answer to a two-or-three-way choice.

   A <select> is the wrong element for a small, fixed set of options: it hides the
   choices behind a tap, renders as the operating system's own widget, and on a phone
   opens a full-screen wheel to pick between two words. The founder's verdict on the
   digests panel was exact - "dropdowns are so 1990 when they are not the right element
   for the data". Where every option can simply be SHOWN, show them.

   Use for 2-4 short options. Beyond that a select is honest again.

   Markup: a container with role="radiogroup" and one <button role="radio"> per option;
   the selected one carries .is-selected and aria-checked="true". Buttons, not inputs,
   so the caller keeps its own state and the styling has no browser chrome to fight.

   .audio-kind-pill predates this and is the same idea scoped to one surface; it stays
   where it is. New surfaces use .tos-seg. */
body.tos-app .tos-seg {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--tos-surface-sunken);
    border: 1px solid var(--tos-border-faint);
    border-radius: var(--tos-radius);
}
body.tos-app .tos-seg-opt {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-secondary);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-xs);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .tos-seg-opt:hover:not(.is-selected):not(:disabled) {
    background: var(--tos-surface-hover);
    color: var(--tos-text);
}
body.tos-app .tos-seg-opt.is-selected {
    background: var(--tos-surface);
    border-color: var(--tos-app-accent-border);
    color: var(--tos-app-accent);
    font-weight: 600;
}
body.tos-app .tos-seg-opt:focus-visible {
    outline: 2px solid var(--tos-app-accent);
    outline-offset: 1px;
}
body.tos-app .tos-seg-opt:disabled { opacity: .5; cursor: not-allowed; }

body.tos-app .audio-kind-hint {
    margin: 0 0 10px;
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    line-height: 1.45;
}
body.tos-app .audio-choose-btn,
body.tos-app .audio-upload-btn {
    width: 100%;
    justify-content: center;
}
body.tos-app .audio-upload-btn {
    margin-top: 8px;
}
body.tos-app .audio-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--tos-border-faint);
    border-radius: var(--tos-radius-sm);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-secondary);
}
body.tos-app .audio-selected-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tos-text);
}
body.tos-app .audio-selected-size {
    font-family: var(--tos-font-mono);
    color: var(--tos-text-muted);
    flex-shrink: 0;
}
body.tos-app .audio-clear-btn {
    background: none;
    border: none;
    color: var(--tos-text-muted);
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
}
body.tos-app .audio-clear-btn:hover { color: var(--tos-error); }
body.tos-app .audio-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
body.tos-app .audio-progress-bar {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--tos-border-faint);
    overflow: hidden;
}
body.tos-app .audio-progress-fill {
    height: 100%;
    width: 0;
    background: var(--tos-app-accent);
    transition: width 120ms linear;
}
body.tos-app .audio-progress-text {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    min-width: 3.5em;
    text-align: right;
}
body.tos-app .audio-status {
    margin-top: 8px;
    font-size: var(--tos-text-xs);
    line-height: 1.45;
    color: var(--tos-ok);
}
body.tos-app .audio-status.is-error { color: var(--tos-error); }
/* A section head outranks the 14px field labels under it: one type step up, body font, sentence case (head of design, 23 Nov). */
body.tos-app .timer-section-title {
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-base);
    font-weight: 600;
    color: var(--tos-text);
    letter-spacing: normal;
    text-transform: none;
    flex: 1;
}
body.tos-app .timer-section-desc {
    padding: var(--tos-space-2) var(--tos-space-3) 0;
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
}
body.tos-app .timer-section-content {
    padding: var(--tos-space-3);
}

/* Premium form fields — dense */
body.tos-app .timer-premium-field {
    margin-bottom: var(--tos-space-2);
}
body.tos-app .timer-premium-field:last-child { margin-bottom: 0; }
body.tos-app .timer-premium-label .required { color: var(--tos-error); margin-left: 2px; }
body.tos-app .timer-premium-input,
body.tos-app .timer-premium-select,
body.tos-app .timer-premium-textarea,
body.tos-app .timer-form-input,
body.tos-app .timer-form-select {
    width: 100%;
    padding: 7px 10px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-control-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    line-height: 1.4;
    outline: none;
    transition: border-color var(--tos-duration) var(--tos-ease),
                box-shadow var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-premium-input:focus,
body.tos-app .timer-premium-select:focus,
body.tos-app .timer-premium-textarea:focus,
body.tos-app .timer-form-input:focus,
body.tos-app .timer-form-select:focus {
    border-color: var(--tos-app-accent);
    box-shadow: 0 0 0 3px var(--tos-accent-bg);
}
body.tos-app .timer-premium-input.is-invalid,
body.tos-app .timer-premium-input.has-error {
    border-color: var(--tos-error);
    background: var(--tos-error-bg);
}
body.tos-app .timer-premium-textarea { resize: vertical; min-height: 80px; }
body.tos-app .timer-checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    cursor: pointer;
}
/* A ticked box is ink in every app (selected state, never orange, never a per-app accent). The browser
   picks a contrasting tick from the accent's brightness, so it stays legible in dark too. */
body.tos-app .timer-checkbox-field input[type="checkbox"] {
    accent-color: var(--tos-text);
}

/* Checkbox-card grid used by add/edit drawers (Roles section,
   tag pickers, anywhere a form needs multi-select chips). JS
   renders labels with input + icon + name; we lay them out
   as a responsive grid of chip-sized toggleable cards. */
body.tos-app .timer-role-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--tos-space-2);
}
body.tos-app .timer-role-checkbox {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: 8px 10px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-control-border);
    border-radius: var(--tos-radius);
    cursor: pointer;
    user-select: none;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-role-checkbox:hover {
    background: var(--tos-surface-hover);
}
/* Selected is ink, never a per-app colour (accent sweep, head of design 12 Nov). The role's own
   colour stays only on the unticked icon, as data. */
body.tos-app .timer-role-checkbox:has(input:checked) {
    background: var(--tos-state-bg);
    border-color: var(--tos-state);
}
body.tos-app .timer-role-checkbox:has(input:checked) i {
    color: var(--tos-text);
}
body.tos-app .timer-role-checkbox input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--tos-text);
    flex-shrink: 0;
}
body.tos-app .timer-role-checkbox i {
    color: var(--role-color, var(--tos-text-muted));
    font-size: 0.85rem;
    flex-shrink: 0;
}
body.tos-app .timer-role-checkbox span {
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Validation summary block at top of drawer body */
body.tos-app .timer-form-errors {
    margin: 0 0 var(--tos-space-3);
    padding: var(--tos-space-3);
    background: var(--tos-error-bg);
    border: 1px solid rgba(220, 38, 38, 0.28);
    border-radius: var(--tos-radius-md);
}
body.tos-app .timer-form-errors-header {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    margin-bottom: var(--tos-space-2);
}
body.tos-app .timer-form-errors-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.14);
    color: var(--tos-error);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
}
body.tos-app .timer-form-errors-title {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-error);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .timer-form-errors-list {
    margin: 0;
    padding: 0 0 0 38px;
    list-style: none;
}
body.tos-app .timer-form-errors-list li {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: 3px 0;
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    line-height: 1.4;
}
body.tos-app .timer-form-errors-list i {
    color: var(--tos-error);
    font-size: 0.4rem;
    flex-shrink: 0;
}

/* Settings inline edit form (per-section) — opens in place
   below the section header instead of opening a modal. */
body.tos-app .tos-inline-form {
    margin-top: var(--tos-space-2);
    padding: var(--tos-space-3);
    background: var(--tos-bg);
    border: 1px solid var(--tos-app-accent);
    border-radius: var(--tos-radius);
    display: none;
    flex-direction: column;
    gap: var(--tos-space-2);
}
body.tos-app .tos-inline-form.is-open {
    display: flex;
}
body.tos-app .tos-inline-form-head {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    margin: 0 0 4px;
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-app-accent);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .tos-inline-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
body.tos-app .tos-inline-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--tos-space-2);
    margin-top: 4px;
    padding-top: var(--tos-space-2);
    border-top: 1px solid var(--tos-border-faint);
}

/* Settings empty state + system badge */
body.tos-app .timer-settings-empty {
    margin: 0;
    padding: var(--tos-space-4);
    text-align: center;
    color: var(--tos-text-muted);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .timer-settings-item-info {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    flex: 1;
    min-width: 0;
}
body.tos-app .timer-settings-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
body.tos-app .timer-settings-item-badge {
    padding: 2px 8px;
    background: var(--tos-system-bg);
    color: var(--tos-system);
    border: 1px solid var(--tos-system-border);
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}

/* Color picker / icon picker */
body.tos-app .timer-color-picker,
body.tos-app .timer-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tos-space-2);
}
body.tos-app .timer-color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--tos-border);
    cursor: pointer;
    transition: transform var(--tos-duration) var(--tos-ease), border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-color-option:hover { transform: scale(1.08); }
body.tos-app .timer-color-option.selected { border-color: var(--tos-text); transform: scale(1.08); }
body.tos-app .timer-icon-option {
    width: 36px;
    height: 36px;
    border-radius: var(--tos-radius-sm);
    border: 1px solid var(--tos-border);
    background: var(--tos-surface);
    color: var(--tos-text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tos-duration) var(--tos-ease), border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-icon-option:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border-strong);
}
body.tos-app .timer-icon-option.selected {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent);
    color: var(--tos-app-accent);
}
body.tos-app .timer-form-group { margin-bottom: var(--tos-space-3); }
body.tos-app .timer-form-group:last-child { margin-bottom: 0; }
/* ONE definition for every field label (D.1b, head of design 12 Nov): .timer-premium-label joined this rule
   and its own mono, uppercase block was deleted, so no second label style can drift from this one. */
body.tos-app .timer-form-label,
body.tos-app .timer-label,
body.tos-app .timer-premium-label {
    display: block;
    margin-bottom: var(--tos-space-1);
    font-family: var(--tos-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--tos-text);
    letter-spacing: normal;
    text-transform: none;
}

/* Plain textarea (not wrapped in .timer-premium-field) — same look
   as .timer-premium-textarea so a `.timer-form-group > textarea
   .timer-textarea` markup pattern picks up the canonical chrome. */
body.tos-app .timer-textarea,
body.tos-app .timer-input {
    width: 100%;
    padding: 7px 10px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-control-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    line-height: 1.4;
    outline: none;
    transition: border-color var(--tos-duration) var(--tos-ease),
                box-shadow var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-textarea { resize: vertical; min-height: 80px; }
body.tos-app .timer-textarea:focus,
body.tos-app .timer-input:focus {
    border-color: var(--tos-app-accent);
    box-shadow: 0 0 0 3px var(--tos-app-accent-bg);
}

/* ============================================================
   06i // Info rows — generic label/value pair inside any
   summary panel, drawer section, or info card. ONE rule for
   every app that needs to display "Label  ──  Value".
   ============================================================ */
body.tos-app .timer-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: 8px 0;
    border-bottom: 1px solid var(--tos-border-faint);
    min-width: 0;
}
body.tos-app .timer-info-row:last-child { border-bottom: 0; padding-bottom: 0; }
body.tos-app .timer-info-row:first-child { padding-top: 0; }
body.tos-app .timer-info-label {
    flex-shrink: 0;
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tos-tracking-mono);
}
body.tos-app .timer-info-value {
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ============================================================
   06j // Alert callout — generic notice banner used inside
   drawers, modals, sections. Variants: info / warning / danger
   / success. Leading icon, text wraps freely.
   ============================================================ */
body.tos-app .timer-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--tos-space-2);
    padding: 10px var(--tos-space-3);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    background: var(--tos-surface-sunken);
    color: var(--tos-text);
    font-size: var(--tos-text-sm);
    line-height: 1.45;
}
body.tos-app .timer-alert > i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 14px;
}
body.tos-app .timer-alert > div { flex: 1 1 auto; min-width: 0; }
body.tos-app .timer-alert strong { font-weight: 700; }
body.tos-app .timer-alert p { margin: 4px 0 0 0; font-size: var(--tos-text-xs); color: var(--tos-text-secondary); }

body.tos-app .timer-alert.timer-alert-info {
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.28);
    color: #1d4ed8;
}
body.tos-app .timer-alert.timer-alert-info > i { color: #2563eb; }
body.tos-app .timer-alert.timer-alert-warning {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.28);
    color: #92400e;
}
body.tos-app .timer-alert.timer-alert-warning > i { color: #d97706; }
body.tos-app .timer-alert.timer-alert-danger {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.28);
    color: #991b1b;
}
body.tos-app .timer-alert.timer-alert-danger > i { color: #b91c1c; }
body.tos-app .timer-alert.timer-alert-success {
    background: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.28);
    color: #166534;
}
body.tos-app .timer-alert.timer-alert-success > i { color: #15803d; }

/* Drawer width variant — narrow (companion to existing
   .timer-drawer-wide). 420px is the canonical confirmation /
   action-prompt size. */
body.tos-app .timer-drawer-narrow { width: 420px; }

/* --- BUTTONS (legacy → TOS) --- */
body.tos-app .timer-btn,
body.tos-app .timer-btn-secondary,
body.tos-app .timer-btn-ghost,
body.tos-app .timer-btn-premium,
body.tos-app .timer-btn-primary,
body.tos-app .timer-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--tos-space-2);
    padding: 8px 14px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
    white-space: nowrap;
}
body.tos-app .timer-btn:hover,
body.tos-app .timer-btn-secondary:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border-strong);
}
body.tos-app .timer-btn-primary,
body.tos-app .timer-btn-premium {
    background: var(--tos-accent);
    border-color: var(--tos-accent);
    color: var(--tos-on-orange);
}
body.tos-app .timer-btn-primary:hover,
body.tos-app .timer-btn-premium:hover {
    background: var(--tos-accent-strong);
    border-color: var(--tos-accent-strong);
    color: var(--tos-on-orange);
}
body.tos-app .timer-btn-danger {
    background: var(--tos-error);
    border-color: var(--tos-error);
    color: var(--tos-on-danger);
}
body.tos-app .timer-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: var(--tos-on-danger); }
/* No warning or success variants: a button's colour says its rank (primary, danger), not the mood of the
   outcome (accent sweep 1w, head of design 12 Nov). They also failed contrast in one theme each. */
body.tos-app .timer-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--tos-text-secondary);
}
body.tos-app .timer-btn-ghost:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text);
}
body.tos-app .timer-btn-sm {
    padding: 5px 10px;
    font-size: var(--tos-text-xs);
}
body.tos-app .timer-btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius);
    color: var(--tos-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-btn-icon:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border);
    color: var(--tos-text);
}

/* One disabled state for every button (head of design, 12 Nov): muted words, a faint edge, no fill,
   and no hover. A disabled primary loses its orange too, because orange still says "press me".
   The :hover line outranks each variant's own hover, so nothing lights up under the pointer.
   Page sheets that carry their own copy are removed in their own sweep batch, page by page. */
body.tos-app :is(.timer-btn, .timer-btn-secondary, .timer-btn-ghost, .timer-btn-premium, .timer-btn-primary,
                 .timer-btn-danger, .timer-btn-icon,
                 .tos-app-btn, .tos-app-btn-primary):is(:disabled, [aria-disabled="true"]),
body.tos-app :is(.timer-btn, .timer-btn-secondary, .timer-btn-ghost, .timer-btn-premium, .timer-btn-primary,
                 .timer-btn-danger, .timer-btn-icon,
                 .tos-app-btn, .tos-app-btn-primary):is(:disabled, [aria-disabled="true"]):hover {
    background: transparent;
    border-color: var(--tos-border);
    color: var(--tos-text-muted);
    cursor: not-allowed;
    box-shadow: none;
}
/* A ghost or icon button has no edge when enabled, so it gains none when disabled. Muted words alone
   read the same as enabled in light, so these two (only) also fade. */
body.tos-app :is(.timer-btn-ghost, .timer-btn-icon):is(:disabled, [aria-disabled="true"]),
body.tos-app :is(.timer-btn-ghost, .timer-btn-icon):is(:disabled, [aria-disabled="true"]):hover {
    border-color: transparent;
    opacity: .45;
}

/* --- MODALS --- */
body.tos-app .timer-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
}
body.tos-app .timer-modal.timer-modal-show { display: flex; }
body.tos-app .timer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--tos-backdrop);
    backdrop-filter: blur(var(--tos-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--tos-backdrop-blur));
}
body.tos-app .timer-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: var(--tos-space-4);
    z-index: 1;
}
body.tos-app .timer-modal-small { max-width: 420px; }
body.tos-app .timer-modal-content {
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    box-shadow: var(--tos-shadow-raised);
    overflow: hidden;
}
body.tos-app .timer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3) var(--tos-space-4);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
}
body.tos-app .timer-modal-title {
    margin: 0;
    font-size: var(--tos-text-md);
    font-weight: 700;
    color: var(--tos-text);
}
body.tos-app .timer-modal-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.tos-app .timer-modal-close:hover { background: var(--tos-surface-hover); color: var(--tos-text); }
body.tos-app .timer-modal-body {
    padding: var(--tos-space-4);
    max-height: 70vh;
    overflow-y: auto;
}
body.tos-app .timer-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--tos-space-2);
    padding: var(--tos-space-3) var(--tos-space-4);
    border-top: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
}

/* --- TOAST CONTAINER --- */
body.tos-app .timer-toast-container {
    position: fixed;
    top: calc(var(--tos-chrome-top) + var(--tos-space-3));
    right: var(--tos-space-4);
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
    pointer-events: none;
    max-width: 380px;
}
body.tos-app .timer-toast-container > * {
    pointer-events: auto;
    padding: var(--tos-space-3) var(--tos-space-4);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    box-shadow: var(--tos-shadow-raised);
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
}

/* --- UPLOAD DROPZONE --- */
body.tos-app .timer-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-6) var(--tos-space-4);
    background: var(--tos-surface-sunken);
    border: 2px dashed var(--tos-control-border);
    border-radius: var(--tos-radius-md);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--tos-duration) var(--tos-ease),
                background var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-upload-dropzone:hover,
body.tos-app .timer-upload-dropzone.dragover {
    border-color: var(--tos-app-accent);
    background: var(--tos-app-accent-bg);
}
body.tos-app .timer-upload-dropzone i {
    font-size: 1.6rem;
    color: var(--tos-text-dim);
}
body.tos-app .timer-upload-dropzone p {
    margin: 0;
    font-size: var(--tos-text-sm);
    color: var(--tos-text-secondary);
    font-weight: 600;
}
body.tos-app .timer-upload-hint {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .timer-upload-preview {
    margin-top: var(--tos-space-3);
}
body.tos-app .timer-upload-file-info {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
}
body.tos-app .timer-upload-file-info > i {
    font-size: var(--tos-text-lg);
    color: var(--tos-app-accent);
}
body.tos-app .timer-upload-file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}
body.tos-app .timer-upload-file-details span:first-child {
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
}
body.tos-app .timer-upload-file-details span:last-child {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    letter-spacing: 0.4px;
    margin-top: 2px;
}
body.tos-app .timer-import-instructions ol {
    margin: 0 0 var(--tos-space-3);
    padding-left: var(--tos-space-4);
    font-size: var(--tos-text-sm);
    color: var(--tos-text-secondary);
    line-height: var(--tos-leading-snug);
}
body.tos-app .timer-import-instructions li { margin-bottom: var(--tos-space-1); }
body.tos-app .timer-import-instructions strong { color: var(--tos-text); }
body.tos-app .timer-progress-bar {
    height: 6px;
    background: var(--tos-surface-sunken);
    border-radius: var(--tos-radius-full);
    overflow: hidden;
}
body.tos-app .timer-progress-fill {
    height: 100%;
    background: var(--tos-app-accent);
    transition: width 0.3s ease;
}
body.tos-app .timer-progress-stats {
    margin-top: var(--tos-space-2);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    letter-spacing: 0.4px;
    text-align: center;
}

/* --- DROPDOWN MENU (legacy → TOS) --- */
body.tos-app .timer-dropdown { position: relative; }
body.tos-app .timer-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: 7px 12px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    cursor: pointer;
    transition: background var(--tos-duration) var(--tos-ease), border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-dropdown-trigger:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border-strong);
}
body.tos-app .timer-dropdown-trigger i { color: var(--tos-text-muted); font-size: 0.78rem; }
body.tos-app .timer-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    box-shadow: var(--tos-shadow-raised);
    padding: var(--tos-space-1);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity var(--tos-duration) var(--tos-ease), transform var(--tos-duration) var(--tos-ease);
    z-index: 100;
}
body.tos-app .timer-dropdown.open .timer-dropdown-menu,
body.tos-app .timer-dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
body.tos-app .timer-dropdown-item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-radius: var(--tos-radius-sm);
    text-align: left;
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    color: var(--tos-text-secondary);
    cursor: pointer;
}
body.tos-app .timer-dropdown-item:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text);
}
body.tos-app .timer-dropdown-item.active {
    background: var(--tos-app-accent-bg);
    color: var(--tos-app-accent);
    font-weight: 600;
}

/* --- EMPTY / NO RESULTS / LOADING STATES --- */
body.tos-app .timer-empty-state,
body.tos-app .timer-no-results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-12) var(--tos-space-5);
    text-align: center;
    background: var(--tos-surface);
    border: 1px dashed var(--tos-border-strong);
    border-radius: var(--tos-radius-md);
}
body.tos-app .timer-empty-icon,
body.tos-app .timer-no-results-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tos-surface-sunken);
    color: var(--tos-text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
body.tos-app .timer-empty-state h3,
body.tos-app .timer-no-results-state h3 {
    margin: 0;
    font-size: var(--tos-text-md);
    font-weight: 700;
    color: var(--tos-text);
}
body.tos-app .timer-empty-state p,
body.tos-app .timer-no-results-state p {
    margin: 0;
    font-size: var(--tos-text-sm);
    color: var(--tos-text-muted);
}
body.tos-app .timer-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-10);
    color: var(--tos-text-muted);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .timer-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--tos-border);
    border-top-color: var(--tos-app-accent);
    border-radius: 50%;
    animation: tos-spin 0.8s linear infinite;
}
@keyframes tos-spin { to { transform: rotate(360deg); } }
body.tos-app .timer-empty-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-6) var(--tos-space-4);
    text-align: center;
    color: var(--tos-text-muted);
    font-size: var(--tos-text-sm);
}
body.tos-app .timer-empty-mini i {
    font-size: var(--tos-text-lg);
    color: var(--tos-text-dim);
}


/* ============================================================
   16b // OS-level chrome — drawer / modal interior controls
   These are shared shapes every app uses INSIDE drawers and
   modals. Defined ONCE here so apps never define them in
   tos-app-{name}.css.
   ============================================================ */

/* Section icon — blue tone (info-blue) for "contact info" style
   sections. Pairs with .icon-purple / .icon-indigo / .icon-orange /
   .icon-teal / .icon-green already defined at section 11. */
body.tos-app .timer-section-icon.icon-blue {
    background: var(--tos-info-bg);
    color: var(--tos-info);
}

/* Form row — two fields side by side inside a modal/drawer body. */
body.tos-app .timer-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--tos-space-3);
}
@media (max-width: 560px) {
    body.tos-app .timer-form-row { grid-template-columns: 1fr; }
}

/* Form textarea — multi-line variant of .timer-form-input. */
body.tos-app .timer-form-textarea {
    width: 100%;
    min-height: 84px;
    padding: 8px 10px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-control-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    line-height: var(--tos-leading-snug);
    outline: none;
    resize: vertical;
    transition: border-color var(--tos-duration) var(--tos-ease),
                box-shadow var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-form-textarea:focus {
    border-color: var(--tos-app-accent);
    box-shadow: 0 0 0 3px var(--tos-accent-bg);
}

/* Color picker — native <input type="color"> dressed for TOS. */
body.tos-app .timer-color-input {
    width: 100%;
    height: 36px;
    padding: 2px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-control-border);
    border-radius: var(--tos-radius);
    cursor: pointer;
}
body.tos-app .timer-color-input::-webkit-color-swatch-wrapper { padding: 0; }
body.tos-app .timer-color-input::-webkit-color-swatch { border: none; border-radius: 3px; }

/* Required-asterisk marker for form labels. */
body.tos-app .required {
    color: var(--tos-error);
    margin-left: 2px;
    font-weight: 700;
}

/* Generic badge / pill — used inline in details drawers, headers,
   and chip groups. Tone variants pull from semantic colors. */
body.tos-app .timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--tos-surface-sunken);
    color: var(--tos-text-secondary);
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    line-height: 1.4;
}
body.tos-app .timer-badge.is-info,
body.tos-app .timer-badge-info { background: var(--tos-info-bg); color: var(--tos-info); }
body.tos-app .timer-badge.is-ok,
body.tos-app .timer-badge-ok { background: var(--tos-ok-bg); color: var(--tos-ok); }
body.tos-app .timer-badge.is-warn,
body.tos-app .timer-badge-warn { background: var(--tos-warn-bg, rgba(245, 158, 11, 0.10)); color: var(--tos-warn, #d97706); }
body.tos-app .timer-badge.is-error,
body.tos-app .timer-badge-error { background: var(--tos-error-bg); color: var(--tos-error); }

/* Badges row — flex group of .timer-badge in a details header. */
body.tos-app .timer-roles-badges,
body.tos-app .timer-badges-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Checkbox grid — generic multi-select chip layout. Used by Add
   Company > Role checkboxes and any future drawer that needs
   the same. Distinct from .timer-role-checkboxes which is the
   People-flavored variant (semantically identical). */
body.tos-app .timer-checkbox-grid,
body.tos-app .timer-role-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--tos-space-2);
}

/* Search results inside a drawer body — used by Link Contact and
   any similar "find an existing X to attach" flow. */
body.tos-app .timer-search-results {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-1);
    margin-top: var(--tos-space-2);
    max-height: 320px;
    overflow-y: auto;
}
body.tos-app .timer-search-result-item,
body.tos-app .timer-search-results > .item,
body.tos-app .timer-search-results > a,
body.tos-app .timer-search-results > button {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2) var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    color: var(--tos-text);
    font-size: var(--tos-text-sm);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--tos-duration) var(--tos-ease),
                background var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-search-result-item:hover,
body.tos-app .timer-search-results > .item:hover,
body.tos-app .timer-search-results > a:hover,
body.tos-app .timer-search-results > button:hover {
    border-color: var(--tos-app-accent);
    background: var(--tos-surface-hover);
}

/* Utility: muted text inside drawers / details cells. */
body.tos-app .timer-text-muted {
    color: var(--tos-text-muted);
    font-size: var(--tos-text-sm);
}


/* ============================================================
   16c // OS-level details drawer interior
   Every "view details" drawer in the system uses these
   canonical classes. Header (logo + name + badges + actions),
   quick stats grid (3 cols), section panels with h4 headers,
   detail link rows, address/notes blocks. Apps use them by
   class name directly — never declare per-app duplicates.
   The accent gradient on .tos-app-details-logo automatically
   picks up each app's --tos-app-accent.
   ============================================================ */

body.tos-app .tos-app-details-header {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-4);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    margin-bottom: var(--tos-space-4);
}
body.tos-app .tos-app-details-logo,
body.tos-app .tos-app-details-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--tos-radius);
    background: var(--tos-state-bg);
    color: var(--tos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--tos-text-lg);
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}
/* Avatar variant for People uses circular shape; logo for Companies
   uses rounded-square (default above). */
body.tos-app .tos-app-details-avatar { border-radius: 50%; }
/* When the bundle replaces the avatar's text with an <img> (profile
   photo), let it fill the avatar circle cleanly. */
body.tos-app .tos-app-details-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}
body.tos-app .tos-app-details-info {
    min-width: 0;
    flex: 1;
}
body.tos-app .tos-app-details-info h3 {
    margin: 0;
    font-size: var(--tos-text-lg);
    font-weight: 700;
    color: var(--tos-text);
}
body.tos-app .tos-app-details-subtitle {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    letter-spacing: 0.4px;
    margin-top: 4px;
}
body.tos-app .tos-app-details-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--tos-space-2);
}
body.tos-app .tos-app-details-actions {
    flex-shrink: 0;
}

body.tos-app .tos-app-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--tos-space-3);
    margin-bottom: var(--tos-space-4);
}
body.tos-app .tos-app-quick-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
}
body.tos-app .tos-app-quick-stat-value {
    font-size: var(--tos-text-md);
    font-weight: 700;
    color: var(--tos-text);
}
body.tos-app .tos-app-quick-stat-label {
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}

body.tos-app .tos-app-details-section {
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    padding: var(--tos-space-4);
    margin-bottom: var(--tos-space-3);
}
body.tos-app .tos-app-details-section h4 {
    margin: 0 0 var(--tos-space-3);
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-text);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.tos-app .tos-app-details-section .timer-section-header h4 {
    margin-bottom: 0;
}

body.tos-app .tos-app-details-links {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
}
body.tos-app .tos-app-details-link {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2) var(--tos-space-3);
    background: var(--tos-bg);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    color: var(--tos-text-secondary) !important;
    text-decoration: none !important;
    font-size: var(--tos-text-sm);
}
body.tos-app .tos-app-details-link:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text) !important;
}
body.tos-app .tos-app-details-link i {
    width: 16px;
    text-align: center;
    color: var(--tos-text-dim);
}
/* Copy-to-clipboard confirmation state (email/phone links). Brief accent
   while the icon shows a check — see people.js copyContactValue(). */
body.tos-app .tos-app-details-link.is-copied {
    border-color: var(--tos-ok);
    color: var(--tos-ok) !important;
}
body.tos-app .tos-app-details-link.is-copied i {
    color: var(--tos-ok);
}
body.tos-app .tos-app-details-address {
    margin-top: var(--tos-space-2);
    font-size: var(--tos-text-sm);
    color: var(--tos-text-secondary);
    line-height: var(--tos-leading-snug);
}
body.tos-app .tos-app-details-notes {
    font-size: var(--tos-text-sm);
    color: var(--tos-text-secondary);
    line-height: var(--tos-leading-snug);
    white-space: pre-wrap;
}
body.tos-app .tos-app-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--tos-space-3);
}
body.tos-app .tos-app-details-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
body.tos-app .tos-app-details-item label {
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .tos-app-details-item span {
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    font-weight: 600;
}

/* Contact lists + activity timelines that live inside details
   sections — generic flex stacks. */
body.tos-app .timer-contacts-list,
body.tos-app .timer-activity-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
}


/* ============================================================
   16d // Activity timeline rows — used by every app's details
   drawer. JS renders .timer-activity-item with a 32px icon
   gutter + content stack (type / subject / date / desc).
   ============================================================ */

body.tos-app .timer-activity-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: var(--tos-space-3);
    padding: var(--tos-space-2) var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border-faint);
    border-radius: var(--tos-radius-sm);
    transition: border-color var(--tos-duration) var(--tos-ease),
                background var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-activity-item:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border);
}
body.tos-app .timer-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-system-bg);
    color: var(--tos-system);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
body.tos-app .timer-activity-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
body.tos-app .timer-activity-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--tos-space-2);
}
body.tos-app .timer-activity-type {
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    color: var(--tos-system);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .timer-activity-date {
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    color: var(--tos-text-dim);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
body.tos-app .timer-activity-subject {
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    line-height: var(--tos-leading-snug);
}
body.tos-app .timer-activity-desc {
    font-size: var(--tos-text-xs);
    color: var(--tos-text-secondary);
    line-height: var(--tos-leading-snug);
}

/* Notes block — used inside details drawers for free-text notes. */
body.tos-app .timer-notes-content,
body.tos-app .timer-details-notes,
body.tos-app .tos-app-details-notes {
    font-size: var(--tos-text-sm);
    color: var(--tos-text-secondary);
    line-height: var(--tos-leading-snug);
    white-space: pre-wrap;
}


/* ============================================================
   16d2 // Pipeline item rows — used inside details drawers
   to show "pipeline items attached to this person/company".
   JS renders .timer-pipeline-item-card (with optional
   .timer-outcome-won / .timer-outcome-lost) → icon gutter,
   content stack (title + meta line), chevron arrow.
   Future apps with pipeline concepts (Deals, Leads, Sales)
   will reuse this shape — defined ONCE at OS level.
   ============================================================ */

body.tos-app .timer-pipeline-items-list {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
}
body.tos-app .timer-pipeline-item-card {
    display: grid;
    grid-template-columns: 32px 1fr 16px;
    gap: var(--tos-space-3);
    align-items: center;
    padding: var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    text-decoration: none !important;
    color: inherit !important;
    transition: border-color var(--tos-duration) var(--tos-ease),
                background var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-pipeline-item-card:hover {
    border-color: var(--tos-app-accent);
    background: var(--tos-surface-hover);
}
body.tos-app .timer-pipeline-item-card.timer-outcome-won {
    border-left: 3px solid var(--tos-ok);
    padding-left: calc(var(--tos-space-3) - 3px);
}
body.tos-app .timer-pipeline-item-card.timer-outcome-lost {
    opacity: 0.7;
    border-left: 3px solid var(--tos-text-dim);
    padding-left: calc(var(--tos-space-3) - 3px);
}
body.tos-app .timer-pipeline-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--tos-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    /* Background + color set inline by JS from pipelineColor */
}
body.tos-app .timer-pipeline-item-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
body.tos-app .timer-pipeline-item-title {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    line-height: var(--tos-leading-snug);
    flex-wrap: wrap;
}
body.tos-app .timer-pipeline-item-ref {
    font-family: var(--tos-font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--tos-text-muted);
    background: var(--tos-surface-sunken);
    padding: 2px 6px;
    border-radius: var(--tos-radius-sm);
    letter-spacing: 0.4px;
}
body.tos-app .timer-pipeline-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--tos-space-2);
}
body.tos-app .timer-pipeline-item-pipeline {
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--tos-text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
body.tos-app .timer-pipeline-item-stage {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    /* Background + color set inline by JS from stageColor */
}
body.tos-app .timer-pipeline-item-value {
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--tos-app-accent);
    letter-spacing: 0.4px;
}
body.tos-app .timer-pipeline-item-arrow {
    color: var(--tos-text-dim);
    font-size: 0.8rem;
    transition: transform var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-pipeline-item-card:hover .timer-pipeline-item-arrow {
    color: var(--tos-app-accent);
    transform: translateX(2px);
}


/* ============================================================
   16e // Settings drawer rows — list of roles / statuses /
   stages / types. Same shape across every app's settings.
   ============================================================ */

body.tos-app .timer-settings-list {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
}
body.tos-app .timer-settings-item {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-3);
    background: var(--tos-bg);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
}
body.tos-app .timer-settings-item-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--tos-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tos-text-inverse);
    flex-shrink: 0;
}
body.tos-app .timer-settings-item-name {
    margin: 0;
    flex: 1;
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
}
body.tos-app .timer-settings-item-actions {
    display: flex;
    gap: var(--tos-space-1);
}


/* ============================================================
   16g // Role-checkbox selected state — the icon+name layout
   inside .timer-role-checkbox is handled by the existing rules
   at section 11 ( i { color: var(--role-color, ...); } and
   span { font-weight: 600; ... }). Only the selected state
   needs an OS rule that wins over the default border.
   ============================================================ */

body.tos-app .timer-role-checkbox.selected {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent);
}


/* ============================================================
   16h // Contact-item rows — used by Companies details drawer
   to list linked people, and by any "linked items" pattern.
   ============================================================ */

body.tos-app .timer-contact-item {
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: var(--tos-space-2) var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    transition: border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-contact-item:hover {
    border-color: var(--tos-border-strong);
}
body.tos-app .timer-contact-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tos-state-bg);
    color: var(--tos-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}
body.tos-app .timer-contact-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
body.tos-app .timer-contact-name {
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    line-height: 1.3;
}
body.tos-app .timer-contact-role {
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    color: var(--tos-text-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
body.tos-app .timer-contact-primary {
    padding: 2px 8px;
    background: var(--tos-app-accent-bg);
    color: var(--tos-app-accent);
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    flex-shrink: 0;
}
body.tos-app .timer-contact-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}


/* ============================================================
   16i // Activity meta — date + outcome line (Companies render
   pattern). Pairs with .timer-activity-header used by People.
   ============================================================ */

body.tos-app .timer-activity-meta {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    margin-top: 2px;
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    color: var(--tos-text-dim);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
body.tos-app .timer-activity-meta span:not(:first-child)::before {
    content: '·';
    margin-right: var(--tos-space-2);
}


/* ============================================================
   16f // Mobile — list-card responsive collapses
   Tables become a vertical card list. Quick-stats grid drops
   to a single column. Activity type grid drops to 3 columns.
   Applies in every app, no per-app override needed.
   ============================================================ */

@media (max-width: 760px) {
    body.tos-app .timer-table thead { display: none; }
    body.tos-app .timer-table,
    body.tos-app .timer-table tbody,
    body.tos-app .timer-table tr,
    body.tos-app .timer-table td {
        display: block;
        width: 100%;
    }
    body.tos-app .timer-table tbody tr {
        padding: var(--tos-space-3);
        border-bottom: 1px solid var(--tos-border-faint);
    }
    body.tos-app .timer-table tbody td {
        padding: 4px 0;
    }
    body.tos-app .timer-th-checkbox,
    body.tos-app .timer-table tbody td:first-child {
        display: none;
    }
    body.tos-app .tos-app-quick-stats { grid-template-columns: 1fr; }
}


/* ============================================================
   17 // OS-level table — shared by every app's list view
   Dense, operational. Row height ~40px. Small avatar (28px),
   tight cell padding, hairline row separators.
   ============================================================ */

body.tos-app .timer-table-container {
    width: 100%;
    overflow-x: auto;
}
body.tos-app .timer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--tos-text-sm);
}
body.tos-app .timer-table thead th {
    padding: 8px var(--tos-space-3);
    text-align: left;
    background: var(--tos-surface-sunken);
    border-bottom: 1px solid var(--tos-border);
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    white-space: nowrap;
}
body.tos-app .timer-table thead th:first-child { padding-left: var(--tos-space-4); }
body.tos-app .timer-table thead th:last-child  { padding-right: var(--tos-space-4); }

/* Sortable header columns — TOS-level pattern */
body.tos-app .timer-table thead th.is-sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--tos-duration) var(--tos-ease), color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-table thead th.is-sortable:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text);
}
body.tos-app .timer-table thead th.is-sortable::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 6px;
    opacity: 0.35;
    font-size: 0.62rem;
    vertical-align: middle;
}
body.tos-app .timer-table thead th.is-sort-asc::after {
    content: '\f0de';
    opacity: 1;
    color: var(--tos-app-accent);
}
body.tos-app .timer-table thead th.is-sort-desc::after {
    content: '\f0dd';
    opacity: 1;
    color: var(--tos-app-accent);
}
body.tos-app .timer-table thead th.is-sortable.is-sort-active {
    color: var(--tos-text);
}
body.tos-app .timer-th-checkbox {
    width: 36px;
    padding-right: 0 !important;
}
body.tos-app .timer-table tbody tr {
    border-bottom: 1px solid var(--tos-border-faint);
    transition: background var(--tos-duration) var(--tos-ease);
    cursor: pointer;
}
body.tos-app .timer-table tbody tr:hover { background: var(--tos-surface-hover); }
body.tos-app .timer-table tbody tr:last-child { border-bottom: none; }
body.tos-app .timer-table tbody td {
    padding: 7px var(--tos-space-3);
    color: var(--tos-text);
    vertical-align: middle;
    line-height: 1.35;
}
body.tos-app .timer-table tbody td:first-child { padding-left: var(--tos-space-4); }
body.tos-app .timer-table tbody td:last-child  { padding-right: var(--tos-space-4); }
body.tos-app .timer-table input[type="checkbox"] { cursor: pointer; }

/* Row selection state */
body.tos-app .timer-table-row.selected,
body.tos-app .timer-table tbody tr.selected {
    background: var(--tos-app-accent-bg);
}
body.tos-app .timer-table-row.selected:hover {
    background: var(--tos-app-accent-bg);
}

/* Checkbox cell — JS renders <td class="timer-td-checkbox"> not "timer-th-checkbox" */
body.tos-app .timer-td-checkbox {
    width: 36px;
    padding-right: 0 !important;
}

/* Row content wrappers JS emits */
body.tos-app .timer-roles-cell,
body.tos-app .timer-lead-stage-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

/* Inline action buttons (edit / delete in table rows) */
body.tos-app .timer-table-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
body.tos-app .timer-action-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-action-btn:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border);
    color: var(--tos-text);
}
body.tos-app .timer-action-btn.timer-action-danger:hover {
    background: var(--tos-error-bg);
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--tos-error);
}

/* Photo-avatar variant (when JS renders an <img> instead of initials) */
body.tos-app .timer-person-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Priority / temperature badges (Hot/Warm/Cold) — reusable in
   any row meta cell, list, or details panel. */
body.tos-app .timer-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
body.tos-app .timer-priority-hot {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
body.tos-app .timer-priority-warm {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}
body.tos-app .timer-priority-cold {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}


/* ============================================================
   18 // List control — unified wrapper for list-view apps
   The head is the filter strip (chips + count + search + sort).
   Body holds list/grid/kanban. Pipeline filters appear as a
   sub-band between head and body. Bulk actions and pagination
   slot in as bands above/below the body. One coherent card.
   ============================================================ */

.tos-app-list {
    position: relative;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* In-place loading state — used by pagination, sort, filter
   reloads. Body dims slightly, a thin progress bar sweeps at
   the top of the card. NO content disappears — only the list
   itself changes when the new data arrives. */
.tos-app-list.is-loading .tos-app-list-body {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.18s var(--tos-ease);
}
.tos-app-list.is-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--tos-app-accent) 30%,
        var(--tos-app-accent) 70%,
        transparent 100%);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    background-position: -50% 0;
    animation: tos-app-list-loading 1.1s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}
@keyframes tos-app-list-loading {
    0%   { background-position: -50% 0; }
    100% { background-position: 150% 0; }
}

.tos-app-list-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: var(--tos-space-2) var(--tos-space-3);
    border-bottom: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
    flex-wrap: wrap;
}
/* Animated accent loading line at the top of the head. Apps
   add `.is-loading` to the head element during async data
   reloads so the user gets a visible refresh cue without
   replacing rendered content. Same animation that
   .tos-app-list.is-loading uses — promoted so standalone
   heads (dispatch, future pane-split apps) benefit too. */
.tos-app-list-head.is-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--tos-app-accent) 30%,
        var(--tos-app-accent) 70%,
        transparent 100%);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    background-position: -50% 0;
    animation: tos-app-list-loading 1.1s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
}
.tos-app-list-head-start {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    /* Hug content — don't grow. Two `flex: 1` siblings + space-between left
       the count chip in head-end orphaned at ~50% across the row, making
       it read as disconnected from its title. With head-start fixed to its
       content and head-end absorbing the rest, the count sits immediately
       after the title (or filter chips). 2026-05-25. */
    flex: 0 1 auto;
    min-width: 0;
}
.tos-app-list-head-end {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    flex: 1 1 auto;
    min-width: 240px;
}
.tos-app-list-count {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 10px;
    height: 32px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Search input that grows to fill ALL remaining space between
   the count chip on its left and the sort button on its right.
   ONE canonical class for every app — no per-app paired aliases.
   Apps use <div class="tos-app-search"> directly in markup. */
.tos-app-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 200px;
    min-width: 0;
}
.tos-app-search > i {
    position: absolute;
    left: 10px;
    color: var(--tos-text-dim);
    font-size: 0.78rem;
    pointer-events: none;
}
.tos-app-search input {
    width: 100%;
    height: 32px;
    padding: 0 30px 0 30px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    font-family: var(--tos-font-body);
    font-size: var(--tos-text-sm);
    color: var(--tos-text);
    outline: none;
    transition: border-color var(--tos-duration) var(--tos-ease),
                box-shadow var(--tos-duration) var(--tos-ease);
}
.tos-app-search input::placeholder {
    color: var(--tos-text-dim);
}
.tos-app-search input:focus {
    border-color: var(--tos-app-accent);
    box-shadow: 0 0 0 3px var(--tos-accent-bg);
}
.tos-app-search-clear {
    position: absolute;
    right: 6px;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.tos-app-search-clear:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text);
}

/* Sort dropdown trigger inside head-end gets matched height */
.tos-app-list-head-end .timer-dropdown-trigger {
    height: 32px;
    flex-shrink: 0;
}
.tos-app-list-band {
    padding: var(--tos-space-2) var(--tos-space-3);
    background: var(--tos-bg);
    border-bottom: 1px solid var(--tos-border-faint);
}
.tos-app-list-band:last-child { border-bottom: none; }
.tos-app-list-body {
    flex: 1;
    min-height: 0;
}
.tos-app-list-foot {
    padding: var(--tos-space-2) var(--tos-space-3);
    border-top: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--tos-space-3);
}


/* ============================================================
   18b // Table wrap — transparent passthrough for views
   The legacy bundles each render their own .timer-{app}-views
   wrapper. The OS-level marker is .tos-app-table-wrap — it
   strips all default chrome so the .tos-app-list card frame
   owns the visual container. Apps slap this class onto the
   outer views wrapper and that's the contract.
   ============================================================ */

.tos-app-table-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}
.tos-app-table-wrap > .timer-people-list-view,
.tos-app-table-wrap > .timer-companies-list-view,
.tos-app-table-wrap > [class*="-list-view"] {
    padding: 0;
}


/* ============================================================
   18c // Stat stack — unified context-rail stats card
   ONE control for every app's left-column stats. Apps render
   <div class="tos-app-stat-stack"> with N children of
   <div class="tos-app-stat is-{tone}"> — tones are semantic
   not per-app: .is-prospects (info blue), .is-customers /
   .is-leads / .is-guests (ok green / accent / info), .is-value
   (app accent). Default tone uses system purple.
   ============================================================ */

.tos-app-stat-stack {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
}
.tos-app-stat {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: var(--tos-space-3);
    align-items: center;
    padding: var(--tos-space-3) var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    transition: border-color var(--tos-duration) var(--tos-ease);
}
.tos-app-stat:hover { border-color: var(--tos-border-strong); }
/* A stat tile's icon is the house tile in every app and on every variant (head of design, 23 Nov): the label and the
   glyph say what is counted, never a tint, so orange keeps meaning "this needs you". The is-* classes stay in the
   markup and draw nothing. */
.tos-app-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--tos-radius);
    border: 1px solid var(--tos-border-faint);
    background: var(--tos-surface-sunken);
    color: var(--tos-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tos-app-stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tos-app-stat-label {
    font-family: var(--tos-font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--tos-text-muted);
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
}
.tos-app-stat-value {
    margin-top: 2px;
    font-size: var(--tos-text-lg);
    font-weight: 700;
    color: var(--tos-text);
    letter-spacing: -0.01em;
    line-height: 1;
}


/* ============================================================
   19 // Chip — unified filter / tag system
   One class for any filter button across every app. Variants
   for accent color via inline --chip-color.
   ============================================================ */

.tos-chip,
body.tos-app .timer-role-tab,
body.tos-app .timer-pipeline-tab,
body.tos-app .timer-temperature-tab,
body.tos-app .timer-type-tab,
body.tos-app .timer-status-tab,
body.tos-app .task-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tos-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
.tos-chip i,
body.tos-app .timer-role-tab i,
body.tos-app .timer-pipeline-tab i,
body.tos-app .timer-temperature-tab i,
body.tos-app .timer-type-tab i,
body.tos-app .timer-status-tab i,
body.tos-app .task-filter-tab i {
    font-size: 0.72rem;
}
.tos-chip:hover,
body.tos-app .timer-role-tab:hover,
body.tos-app .timer-pipeline-tab:hover,
body.tos-app .timer-temperature-tab:hover,
body.tos-app .timer-type-tab:hover,
body.tos-app .timer-status-tab:hover,
body.tos-app .task-filter-tab:hover {
    background: var(--tos-surface-hover);
    border-color: var(--tos-border-strong);
    color: var(--tos-text);
}
.tos-chip.active,
body.tos-app .timer-role-tab.active,
body.tos-app .timer-pipeline-tab.active,
body.tos-app .timer-type-tab.active,
body.tos-app .timer-status-tab.active,
body.tos-app .task-filter-tab.active {
    background: var(--tos-text);
    border-color: var(--tos-text);
    color: var(--tos-text-inverse);
}
body.tos-app .timer-temperature-tab.active {
    background: var(--temp-color, var(--tos-text));
    border-color: var(--temp-color, var(--tos-text));
    color: var(--tos-text-inverse);
}

/* Chip groups — any wrapper that holds chip-aliased buttons in a
   row of filters. Unified spacing across every list view. */
body.tos-app .timer-role-tabs,
body.tos-app .timer-pipeline-tabs,
body.tos-app .timer-temperature-tabs,
body.tos-app .timer-type-tabs,
body.tos-app .timer-status-tabs,
body.tos-app .task-filter-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.tos-chip-count,
body.tos-app .timer-role-count,
body.tos-app .timer-pipeline-count,
body.tos-app .timer-temperature-count,
body.tos-app .timer-type-count,
body.tos-app .timer-status-count,
body.tos-app .task-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    background: var(--tos-surface-sunken);
    color: var(--tos-text-muted);
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0;
}
.tos-chip.active .tos-chip-count,
body.tos-app .timer-role-tab.active .timer-role-count,
body.tos-app .timer-pipeline-tab.active .timer-pipeline-count,
body.tos-app .timer-temperature-tab.active .timer-temperature-count,
body.tos-app .timer-type-tab.active .timer-type-count,
body.tos-app .timer-status-tab.active .timer-status-count,
body.tos-app .task-filter-tab.active .task-filter-count {
    background: rgba(255, 255, 255, 0.22);
    color: var(--tos-text-inverse);
}

/* Tiny semantic dot used inside chips for status (.timer-status-dot
   in invoices, payments). Shared so every list filter can use it. */
body.tos-app .timer-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}


/* ============================================================
   K-toggle // Toggle switch — OS-level
   Canonical definition for any TOS app that needs an on/off
   switch. Used by event-types, settings, availability, etc.
   Markup:
     <label class="timer-toggle-switch">
         <input type="checkbox">
         <span class="timer-toggle-slider"></span>
     </label>
   Class names kept as timer-toggle-switch / timer-toggle-slider
   so existing JS bindings (meeting-types.js etc) keep working
   without churn.
   ============================================================ */
body.tos-app .timer-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 34px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
}
body.tos-app .timer-toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
body.tos-app .timer-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--tos-control-border);
    border-radius: 999px;
    transition:
        background var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
    transition:
        transform var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-toggle-switch input:checked + .timer-toggle-slider {
    background: var(--tos-app-accent, var(--tos-accent));
}
body.tos-app .timer-toggle-switch input:checked + .timer-toggle-slider::after {
    transform: translateX(14px);
    background: var(--tos-on-accent);
}
body.tos-app .timer-toggle-switch input:focus-visible + .timer-toggle-slider {
    outline: 2px solid var(--tos-app-accent, var(--tos-accent));
    outline-offset: 2px;
}
body.tos-app .timer-toggle-switch input:disabled + .timer-toggle-slider {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ============================================================
   K-loader // Top accent loading bar — OS-level
   Reusable indeterminate progress bar for any TOS page.
   Drop <div class="tos-loading-bar"></div> at the top of body
   (or anywhere) and toggle it via the .is-loading class on body
   OR by adding/removing the bar from the DOM. The bar is fixed
   to the very top of the viewport (above the topbar), 2px tall,
   sliding gradient in the page's accent color.

   Also: legacy .timer-loading-fullpage spinner -> mapped to the
   same bar visual so pages that still use the old full-page
   spinner element automatically get the new bar look (their
   show/hide logic still works).
   ============================================================ */
.tos-loading-bar,
body.tos-app .timer-loading-fullpage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--tos-border-faint);
    z-index: 99999;
    pointer-events: none;
    overflow: hidden;
}
.tos-loading-bar::before,
body.tos-app .timer-loading-fullpage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--tos-app-accent, var(--tos-accent)) 50%,
        transparent 100%
    );
    background-size: 40% 100%;
    background-repeat: no-repeat;
    background-position: -50% 0;
    animation: tosLoadingSlide 1.1s infinite cubic-bezier(0.4, 0.0, 0.2, 1);
}
@keyframes tosLoadingSlide {
    0%   { background-position: -40% 0; }
    100% { background-position: 140% 0; }
}
/* Suppress any legacy spinner icon inside the converted full-page element */
body.tos-app .timer-loading-fullpage .timer-loading-spinner,
body.tos-app .timer-loading-fullpage i,
body.tos-app .timer-loading-fullpage > * { display: none !important; }

/* Hide the bar variant when not loading. The legacy .timer-loading-
   fullpage variant is controlled by JS .style.display already, so
   no extra rule needed there. */
.tos-loading-bar { display: none; }
body.is-loading .tos-loading-bar { display: block; }


/* ============================================================
   Section 26 // CANONICAL PRIMITIVES PROMOTED 2026-05-26
   Patterns that lived as per-app rules across multiple apps,
   promoted to OS-level so JS-emitted HTML uses canonical chrome
   end-to-end (per howto rule "Every TOS element MUST be canonical
   chrome — promote, don't reinvent").
   ============================================================ */


/* ============================================================
   26a // FILE ROW — generic file row used by drive, project-
   details, gallery, atlas, anywhere files render in a list.
   ============================================================ */

body.tos-app .timer-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--tos-surface-sunken);
    border: 1px solid transparent;
    border-radius: var(--tos-radius-sm);
    margin-bottom: 4px;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-file-row:hover {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent-soft);
}
body.tos-app .timer-file-row.is-selected {
    background: var(--tos-app-accent-soft);
    border-color: var(--tos-app-accent);
}
body.tos-app .timer-file-row-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tos-app-accent-soft);
    color: var(--tos-app-accent-strong);
    border-radius: var(--tos-radius-sm);
    font-size: 13px;
}
body.tos-app .timer-file-row-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
body.tos-app .timer-file-row-name {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--tos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.tos-app .timer-file-row-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--tos-text-muted);
}
body.tos-app .timer-file-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}


/* ============================================================
   26b // TASK CARD — used by tasks, project-details, dashboards.
   ============================================================ */

body.tos-app .timer-task-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--tos-surface-sunken);
    border: 1px solid transparent;
    border-radius: var(--tos-radius-sm);
    margin-bottom: 4px;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-task-card:hover {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent-soft);
}
body.tos-app .timer-task-card.is-completed {
    opacity: 0.65;
}
body.tos-app .timer-task-card.is-completed .timer-task-card-text {
    text-decoration: line-through;
    color: var(--tos-text-muted);
}
body.tos-app .timer-task-card.is-overdue {
    border-color: rgba(239, 68, 68, 0.30);
}
body.tos-app .timer-task-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
body.tos-app .timer-task-card-text {
    margin: 0;
    font-size: 13px;
    color: var(--tos-text);
    line-height: 1.45;
}
body.tos-app .timer-task-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--tos-text-muted);
}
body.tos-app .timer-task-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}


/* ============================================================
   26c // MEDIA GRID — used by gallery, atlas, project-details.
   Thumbnail tile with overlay actions on hover.
   ============================================================ */

body.tos-app .timer-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
body.tos-app .timer-media-grid-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--tos-surface-sunken);
    border: 1px solid var(--tos-border-faint);
    border-radius: var(--tos-radius-sm);
    overflow: hidden;
    cursor: pointer;
}
body.tos-app .timer-media-grid-item img,
body.tos-app .timer-media-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
body.tos-app .timer-media-grid-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 8px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.65) 0%, transparent 50%);
    color: #ffffff;
    opacity: 0;
    transition: opacity var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-media-grid-item:hover .timer-media-grid-item-overlay {
    opacity: 1;
}
body.tos-app .timer-media-grid-item-name {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
body.tos-app .timer-media-grid-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
body.tos-app .timer-media-grid-item-action {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 0;
    border-radius: var(--tos-radius-sm);
    cursor: pointer;
    font-size: 10px;
}
body.tos-app .timer-media-grid-item-action:hover {
    background: rgba(255, 255, 255, 0.28);
}


/* ============================================================
   26d // PILOT CHAT MESSAGE — used by chat.aspx, pilot Pilot
   drawer, project-details Pilot drawer, pilot-memory Pilot
   drawer. Generic chat bubble pattern.
   Variants: .is-user / .is-assistant
   ============================================================ */

body.tos-app .timer-pilot-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    max-width: 88%;
}
body.tos-app .timer-pilot-msg.is-user {
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-left: auto;
}
body.tos-app .timer-pilot-msg-avatar {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tos-system-bg);
    color: var(--tos-system);
    border-radius: 50%;
    font-size: 11px;
}
body.tos-app .timer-pilot-msg.is-user .timer-pilot-msg-avatar {
    background: var(--tos-app-accent-soft);
    color: var(--tos-app-accent-strong);
}
body.tos-app .timer-pilot-msg-content {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: var(--tos-surface-sunken);
    border-radius: var(--tos-radius-md);
}
body.tos-app .timer-pilot-msg.is-user .timer-pilot-msg-content {
    background: var(--tos-app-accent-soft);
}
body.tos-app .timer-pilot-msg-text {
    font-size: 13px;
    color: var(--tos-text);
    line-height: 1.5;
    word-wrap: break-word;
}
body.tos-app .timer-pilot-msg-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
body.tos-app .timer-pilot-msg-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: 999px;
    color: var(--tos-text);
    font-size: 11px;
    cursor: pointer;
    transition: background-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-pilot-msg-suggestion:hover {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent);
    color: var(--tos-app-accent-strong);
}


/* ============================================================
   26e // UPLOAD QUEUE ITEM — used by all upload flows.
   ============================================================ */

body.tos-app .timer-upload-queue {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
body.tos-app .timer-upload-queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--tos-surface-sunken);
    border-radius: var(--tos-radius-sm);
}
body.tos-app .timer-upload-queue-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tos-app-accent-soft);
    color: var(--tos-app-accent-strong);
    border-radius: var(--tos-radius-sm);
    font-size: 12px;
}
body.tos-app .timer-upload-queue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
body.tos-app .timer-upload-queue-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--tos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.tos-app .timer-upload-queue-size {
    font-family: var(--tos-font-mono);
    font-size: 10px;
    color: var(--tos-text-muted);
}
body.tos-app .timer-upload-queue-progress {
    width: 100%;
    height: 3px;
    background: var(--tos-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}
body.tos-app .timer-upload-queue-progress-bar {
    height: 100%;
    background: var(--tos-app-accent);
    border-radius: 2px;
    transition: width 240ms ease;
}
body.tos-app .timer-upload-queue-remove {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--tos-text-dim);
    border-radius: var(--tos-radius-sm);
    cursor: pointer;
    font-size: 10px;
}
body.tos-app .timer-upload-queue-remove:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}


/* ============================================================
   26f // PAGINATION — used by pilot-admin, project-details,
   any paginated list.
   ============================================================ */

body.tos-app .timer-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--tos-space-3);
    padding: var(--tos-space-2) 0;
}
body.tos-app .timer-pagination-info {
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--tos-text-muted);
}
body.tos-app .timer-pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
body.tos-app .timer-pagination-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text);
    font-family: var(--tos-font-mono);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-pagination-btn:hover:not(:disabled):not(.active) {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent);
    color: var(--tos-app-accent-strong);
}
body.tos-app .timer-pagination-btn.active {
    background: var(--tos-app-accent);
    border-color: var(--tos-app-accent);
    color: var(--tos-on-accent);
}
body.tos-app .timer-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ============================================================
   Section 27 // CANONICAL PRIMITIVES PROMOTED 2026-05-26 (round 2)
   Fills gaps found by the project-details audit: icon-only button,
   settings-item subtitle line, drawer picker rows. Each had multiple
   consumers in the codebase but no canonical paint.
   ============================================================ */


/* ============================================================
   27a // ICON BUTTON — square, icon-only, generic. Used for
   view/unlink/copy actions in settings-item rows and elsewhere.
   Variants: .danger (rose hover)
   ============================================================ */

body.tos-app .timer-icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-muted);
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-icon-btn:hover {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent);
    color: var(--tos-app-accent-strong);
}
body.tos-app .timer-icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.40);
    color: #b91c1c;
}
body.tos-app[data-theme="dark"] .timer-icon-btn.danger:hover,
body.tos-app-project-details[data-theme="dark"] .timer-icon-btn.danger:hover {
    color: #fca5a5;
}


/* ============================================================
   27b // SETTINGS-ITEM META — subtitle line inside the row's
   .timer-settings-item-info wrapper. When -meta is present, the
   info wrapper stacks vertically (name top, meta bottom).
   Already used by Companies (in legacy companies.css); promoted
   here so every TOS-scoped page renders it consistently.
   ============================================================ */

body.tos-app .timer-settings-item-info:has(> .timer-settings-item-meta) {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
body.tos-app .timer-settings-item-meta {
    margin: 0;
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
    line-height: 1.4;
}
body.tos-app .timer-settings-item-meta i {
    font-size: 10px;
    opacity: 0.7;
    margin-right: 2px;
}


/* ============================================================
   27c // DRAWER PICKER ROW — list row inside a drawer body used
   to select / link an entity. Structure: avatar + info (title +
   subtitle) + action toggle. The avatar type colors (meeting,
   contact, signature, form, property, etc.) are per-app — paint
   .timer-drawer-item-avatar.your-type in the per-app CSS.
   ============================================================ */

body.tos-app .timer-drawer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--tos-surface-sunken);
    border: 1px solid transparent;
    border-radius: var(--tos-radius-sm);
    margin-bottom: 4px;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-drawer-item:hover {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent-soft);
}
body.tos-app .timer-drawer-item-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-app-accent-soft);
    color: var(--tos-app-accent-strong);
    font-size: 13px;
}
body.tos-app .timer-drawer-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
body.tos-app .timer-drawer-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.tos-app .timer-drawer-item-subtitle {
    font-size: 11px;
    color: var(--tos-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.tos-app .timer-drawer-item-action {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .timer-drawer-item-action:hover {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent);
    color: var(--tos-app-accent-strong);
}
body.tos-app .timer-drawer-item-action.is-linked {
    background: var(--tos-app-accent);
    border-color: var(--tos-app-accent);
    color: var(--tos-on-accent, #0a0612);
}
body.tos-app .timer-drawer-item-action.is-linked:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.40);
    color: #b91c1c;
}


/* ============================================================
   Section 28 // PAGE ARCHETYPE — focus / detail hub
   Promoted 2026-05-26 for project-details. Third archetype
   alongside `.tos-app-list` (companies/drive/etc.) and
   `.tos-app-pane-split` (dispatch). Used for any page that
   shows ONE record with N stacked sub-sections + a context
   rail. First consumer: project-details. Next consumers:
   deal-details, company-details, signature-details,
   property-details, gallery-details — all on the backlog.

   Partition: this file owns ONLY the archetype shell + the
   rail-internal patterns (mini hero card + section anchor-
   jump nav). Every sub-section inside uses canonical
   `.timer-premium-section` (Section 16). Every row inside
   each section uses canonical row primitives (file-row,
   task-card, settings-item, activity-item, media-grid,
   pilot-msg, upload-queue). Per-app CSS only paints the
   accent, semantic-color status pills, and content not
   covered by canonical primitives.
   ============================================================ */


/* ============================================================
   28a // FOCUS PAGE — vertical stack of premium sections
   Used inside `.tos-app-page-content` (the right side of a
   `.tos-app-page.is-split`). Each direct child is a
   `.timer-premium-section`.
   ============================================================ */

body.tos-app .tos-app-focus {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-4);
}

body.tos-app .tos-app-focus > .timer-premium-section {
    margin-bottom: 0;
}

/* Anchor-jump offset so rail-nav clicks land below the sticky
   topbar (52px) plus breathing room (20px). */
body.tos-app .tos-app-focus [id^="section-"] {
    scroll-margin-top: 72px;
}


/* ============================================================
   28b // FOCUS RAIL — entity hero mini-card
   Lives at the top of `.tos-app-page-context`. Shows the
   focused entity's identity (icon + name + status badge +
   sub-line of meta). Replaces the legacy top-of-page hero
   block on focus pages — the OS-level hero band only holds
   the memory marquee + actions.
   ============================================================ */

body.tos-app .tos-app-focus-rail-card {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-2);
    padding: var(--tos-space-3);
    background: var(--tos-bg);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius);
    margin-bottom: var(--tos-space-3);
}

body.tos-app .tos-app-focus-rail-card-head {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
}

body.tos-app .tos-app-focus-rail-card-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-app-accent-soft, var(--tos-accent-bg));
    color: var(--tos-app-accent-strong, var(--tos-app-accent));
    font-size: 14px;
}

body.tos-app .tos-app-focus-rail-card-title {
    flex: 1;
    min-width: 0;
    font-size: var(--tos-text-sm);
    font-weight: 600;
    color: var(--tos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.tos-app .tos-app-focus-rail-card-edit {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--tos-text-dim);
    border-radius: var(--tos-radius-sm);
    cursor: pointer;
    font-size: 10px;
    transition: background var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
}
body.tos-app .tos-app-focus-rail-card-edit:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text);
}

body.tos-app .tos-app-focus-rail-card-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--tos-radius-full);
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    line-height: 1.4;
    align-self: flex-start;
}
body.tos-app .tos-app-focus-rail-card-status.is-active {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}
body.tos-app .tos-app-focus-rail-card-status.is-completed {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}
body.tos-app .tos-app-focus-rail-card-status.is-archived {
    background: var(--tos-surface-sunken);
    color: var(--tos-text-muted);
}

body.tos-app .tos-app-focus-rail-card-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: var(--tos-text-xs);
    color: var(--tos-text-muted);
}
body.tos-app .tos-app-focus-rail-card-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
body.tos-app .tos-app-focus-rail-card-meta-row i {
    width: 11px;
    text-align: center;
    font-size: 10px;
    opacity: 0.7;
}


/* ============================================================
   28c // FOCUS RAIL — section anchor-jump nav
   Vertical list of section names. Click smooth-scrolls to
   the matching `#section-X` anchor on the page. The currently
   visible section gets `.is-active` (toggled by JS via
   IntersectionObserver).
   ============================================================ */

body.tos-app .tos-app-focus-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: var(--tos-space-3);
}

body.tos-app .tos-app-focus-rail-nav-label {
    padding: 0 var(--tos-space-2) var(--tos-space-2);
    font-family: var(--tos-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--tos-text-dim);
}

body.tos-app .tos-app-focus-rail-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--tos-radius-sm);
    color: var(--tos-text-muted);
    font-size: var(--tos-text-xs);
    font-weight: 500;
    text-decoration: none;
    transition: background var(--tos-duration) var(--tos-ease),
                color var(--tos-duration) var(--tos-ease);
    border-left: 2px solid transparent;
}
body.tos-app .tos-app-focus-rail-nav a:hover {
    background: var(--tos-surface-hover);
    color: var(--tos-text);
}
body.tos-app .tos-app-focus-rail-nav a.is-active {
    background: var(--tos-app-accent-soft, var(--tos-accent-bg));
    color: var(--tos-app-accent-strong, var(--tos-app-accent));
    border-left-color: var(--tos-app-accent);
    font-weight: 600;
}
body.tos-app .tos-app-focus-rail-nav a i {
    width: 12px;
    text-align: center;
    font-size: 10px;
    opacity: 0.8;
    flex-shrink: 0;
}
body.tos-app .tos-app-focus-rail-nav a .tos-app-focus-rail-nav-count {
    margin-left: auto;
    padding: 1px 6px;
    border-radius: var(--tos-radius-full);
    background: var(--tos-surface-sunken);
    color: var(--tos-text-muted);
    font-family: var(--tos-font-mono);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    line-height: 1.4;
}
body.tos-app .tos-app-focus-rail-nav a.is-active .tos-app-focus-rail-nav-count {
    background: var(--tos-bg);
    color: var(--tos-app-accent-strong, var(--tos-app-accent));
}


/* ============================================================
   Section 29 // PAGE ARCHETYPE — pitch / interstitial landing
   Promoted 2026-05-27 for access-gate. Fourth archetype alongside
   .tos-app-list (companies/drive), .tos-app-pane-split (dispatch),
   .tos-app-focus (project-details).

   Used for any page that shows ONE centered marketing / decision
   layout (paywall, retention flow, app discovery deep-link, signup
   tier picker). Narrow column, single-action surface — not a list,
   not a hub, not a mailbox. Topbar + rail stay visible so the user
   can navigate away, but there's nothing in the rail (no marquee,
   no Pilot card by default — the page is a billing decision, not an
   app context).

   First consumer: access-gate.aspx. Likely future consumers:
   subscription-cancel-retention, app-store deep-link page.
   ============================================================ */


/* ============================================================
   29a // OUTER WRAPPER — centered narrow column inside .tos-main-inner
   ============================================================ */

body.tos-app .tos-app-pitch {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--tos-space-6) var(--tos-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-6);
}


/* ============================================================
   29b // HERO BLOCK — app badge + title + description + status
   alert + action buttons. Centered text, single column.
   ============================================================ */

body.tos-app .tos-app-pitch-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--tos-space-3);
    text-align: left;
}

body.tos-app .tos-app-pitch-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--tos-bg);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-full);
}
body.tos-app .tos-app-pitch-badge-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--tos-radius-full);
    background: var(--tos-app-accent-soft);
    color: var(--tos-app-accent-strong);
    font-size: 14px;
}
body.tos-app .tos-app-pitch-badge-name {
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--tos-text);
}

body.tos-app .tos-app-pitch-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--tos-text);
    line-height: 1.2;
}
body.tos-app .tos-app-pitch-title-accent {
    color: var(--tos-app-accent-strong);
}

body.tos-app .tos-app-pitch-desc {
    margin: 0;
    font-size: 14px;
    color: var(--tos-text-muted);
    line-height: 1.55;
}

body.tos-app .tos-app-pitch-alert {
    width: 100%;
}

body.tos-app .tos-app-pitch-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--tos-space-2);
    margin-top: var(--tos-space-2);
}


/* ============================================================
   29c // INFO TRIO — 3 dense stat-shaped cards (Current Plan,
   Required, A-la-carte cost). Each card uses canonical .tos-app-
   stat chrome inside; this just lays them out as a 3-col grid.
   ============================================================ */

body.tos-app .tos-app-pitch-info {
    /* auto-fit so the row fills symmetrically regardless of how many
       cards are visible. 2 cards -> each 50%, 3 cards -> each ~33%.
       Avoids the "everything jammed to the left" look when the
       optional A-la-carte card is hidden (cost == 0). */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--tos-space-3);
}
@media (max-width: 720px) {
    body.tos-app .tos-app-pitch-info { grid-template-columns: 1fr; }
}


/* ============================================================
   29d // FEATURES GRID — 2-column responsive grid of .timer-
   settings-item rows. Each row carries a feature title + 1-line
   muted desc. Canonical settings-item chrome handles the row
   shape; this is just the grid container.
   ============================================================ */

body.tos-app .tos-app-pitch-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--tos-space-2);
}
@media (max-width: 720px) {
    body.tos-app .tos-app-pitch-features { grid-template-columns: 1fr; }
}


/* ============================================================
   29e // SECTION TITLE LABEL — small mono uppercase header above
   each block ("ACCESS DETAILS" / "WHAT YOU'LL GET").
   ============================================================ */

body.tos-app .tos-app-pitch-section-title {
    margin: 0 0 var(--tos-space-3) 0;
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--tos-text-muted);
    text-align: left;
}


/* ============================================================
   Section 30 // PAGE ARCHETYPE — widget board / dashboard
   Promoted 2026-05-27 for socia-dashboard. Fifth archetype
   alongside .tos-app-list, .tos-app-pane-split, .tos-app-focus,
   .tos-app-pitch.

   Used for any page that shows a HETEROGENEOUS COLLECTION OF
   WIDGETS in a single full-width canvas — dashboards, agent
   home, command centers. Mixed shapes (one big hero widget +
   a row of metric tiles + a pipeline strip + a 2-col split
   of secondary widgets), not a uniform list.

   First consumer: socia-dashboard.aspx. Future consumers:
   dashboard-coach / -consultant / -founder / -general /
   -sales / -student — all 6 Timer dashboards have the same
   widget-board shape.

   Partition: this file owns the OUTER stack + 4 widget-slot
   shapes (hero / metrics / section / split). Per-app paints
   the WIDGET INTERIORS (gauges, pipeline track, drill-down
   sub-shapes, metric tile content). The board itself doesn't
   constrain widget interiors — it just provides consistent
   gap + slot containers.
   ============================================================ */


/* ============================================================
   30a // OUTER BOARD — vertical stack of widget slots.
   Lives inside .tos-main-inner. No max-width cap (dashboards
   want the full canonical canvas).
   ============================================================ */

body.tos-app .tos-app-board {
    display: flex;
    flex-direction: column;
    gap: var(--tos-space-4);
}


/* ============================================================
   30b // HERO SLOT — wide single-card hero widget
   Used for the "primary signal" widget: revenue gauge, big
   chart, master KPI, etc. Card chrome (surface bg + border +
   radius); per-app paints the inside.
   ============================================================ */

body.tos-app .tos-app-board-hero {
    padding: var(--tos-space-4);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
}


/* ============================================================
   30c // METRICS SLOT — n-col responsive grid of compact tiles
   auto-fit so 6 tiles -> 6 col on wide, fewer cols on narrow,
   one column on mobile. Each tile = .tos-app-board-tile (next).
   ============================================================ */

body.tos-app .tos-app-board-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--tos-space-2);
}


/* ============================================================
   30d // METRIC TILE — generic compact tile used inside .tos-app-
   board-metrics. Icon + big value + small label, all stacked.
   Clickable variant (data-clickable / [role="button"]) flips
   on hover with accent ring. Active state = data-state="active"
   for the currently-drilled tile.
   ============================================================ */

body.tos-app .tos-app-board-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: var(--tos-space-3);
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    cursor: default;
    transition: background var(--tos-duration) var(--tos-ease),
                border-color var(--tos-duration) var(--tos-ease);
}
body.tos-app .tos-app-board-tile[role="button"],
body.tos-app .tos-app-board-tile[data-clickable] {
    cursor: pointer;
}
body.tos-app .tos-app-board-tile[role="button"]:hover,
body.tos-app .tos-app-board-tile[data-clickable]:hover {
    background: var(--tos-app-accent-bg);
    border-color: var(--tos-app-accent-soft);
}
body.tos-app .tos-app-board-tile[data-state="active"] {
    background: var(--tos-app-accent-soft);
    border-color: var(--tos-app-accent);
}
body.tos-app .tos-app-board-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-app-accent-soft);
    color: var(--tos-app-accent-strong);
    font-size: 12px;
}
body.tos-app .tos-app-board-tile-value {
    font-family: var(--tos-font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--tos-text);
    line-height: 1;
}
body.tos-app .tos-app-board-tile-label {
    font-family: var(--tos-font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--tos-text-muted);
}


/* ============================================================
   30e // SECTION SLOT — full-width widget with header strip +
   body. Same chrome as .timer-premium-section but board-scoped.
   ============================================================ */

body.tos-app .tos-app-board-section {
    background: var(--tos-surface);
    border: 1px solid var(--tos-border);
    border-radius: var(--tos-radius-md);
    overflow: hidden;
}
body.tos-app .tos-app-board-section-header {
    display: flex;
    align-items: center;
    gap: var(--tos-space-2);
    padding: var(--tos-space-2) var(--tos-space-3);
    background: var(--tos-surface-sunken);
    border-bottom: 1px solid var(--tos-border-faint);
}
body.tos-app .tos-app-board-section-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--tos-radius-sm);
    background: var(--tos-app-accent-bg);
    color: var(--tos-app-accent);
    font-size: 0.72rem;
    flex-shrink: 0;
}
body.tos-app .tos-app-board-section-title {
    flex: 1;
    font-family: var(--tos-font-mono);
    font-size: var(--tos-text-xs);
    font-weight: 700;
    letter-spacing: var(--tos-tracking-mono);
    text-transform: uppercase;
    color: var(--tos-text);
}
body.tos-app .tos-app-board-section-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--tos-space-1);
}
body.tos-app .tos-app-board-section-body {
    padding: var(--tos-space-3);
}


/* ============================================================
   30f // SPLIT SLOT — 2-col responsive split for secondary
   widgets (left + right). Collapses to single column on
   narrow viewports.
   ============================================================ */

body.tos-app .tos-app-board-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--tos-space-4);
}
@media (max-width: 860px) {
    body.tos-app .tos-app-board-split {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Global billing alert strip — payment failed, shown until the money is collected.
   Sits ABOVE the topbar (z-index 1001 > topbar's 1000) and is position:fixed so it
   survives scrolling on every page. Height is published back through --tos-banner-h
   by tos-chrome.js, which is what pushes the topbar/rail/main down; when no banner is
   present that variable stays 0px and every offset is unchanged.
   ========================================================================== */
.tos-billing-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: var(--tos-space-3);
    padding: 10px var(--tos-space-4);
    background: #b91c1c;
    color: #fff;
    font-size: 13px;
    line-height: 1.35;
    box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.tos-billing-banner-icon { flex: 0 0 auto; font-size: 15px; opacity: .95; }
.tos-billing-banner-text { flex: 1 1 auto; min-width: 0; }
.tos-billing-banner-text strong { font-weight: 700; }
.tos-billing-banner-sub { display: block; opacity: .85; font-size: 12px; margin-top: 1px; }
.tos-billing-banner-cta {
    flex: 0 0 auto;
    background: #fff;
    color: #b91c1c;
    font-weight: 700;
    font-size: 12px;
    padding: 7px 14px;
    border-radius: var(--tos-radius-sm, 6px);
    white-space: nowrap;
    text-decoration: none;
}
.tos-billing-banner-cta:hover { background: #fee2e2; }
/* Deliberately NOT dismissible: it disappears when the payment succeeds, not when
   the user closes it — the state is the source of truth, not a UI preference. */
@media (max-width: 640px) {
    .tos-billing-banner { align-items: flex-start; padding: 9px 12px; gap: 10px; }
    .tos-billing-banner-sub { display: none; }
    .tos-billing-banner-cta { padding: 6px 10px; }
}

/* Advisory variant of the global strip (severity 'info'): heavy AI use today, nothing broken.
   Amber rather than the red payment-failure state — a soft notice must not read as an outage. */
.tos-billing-banner.is-info {
    background: #b45309;
    box-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.tos-billing-banner.is-info .tos-billing-banner-cta { color: #b45309; }
.tos-billing-banner.is-info .tos-billing-banner-cta:hover { background: #fef3c7; }
