/* ============================================================================
   Common action buttons — GstActionButton / GstActionBar
   (MainApp.Razor.SharedUILib/Shared/GstActionButtons). #region Himanshu (09-Oct-2026)

   One button, eight looks. The LOOK is chosen by the user (Appearance → Other themes → Action
   buttons) and arrives as body[data-actbtn="tile|outline|soft|raised|pill|stacked"]; the ICON
   treatment arrives as body[data-actico="colorful|mono|none"]. A GstActionBar may force its own
   look with the same data-actbtn attribute (showcase previews).

   HOW THE VARIABLES WORK — read before editing. A custom property is resolved on the element it
   is declared on. The looks are declared on the SCOPE (body / .spq-abar), where no button tone
   exists, so a look may only set TONE-FREE values: percentages, sizes, keywords, neutral colours.
   The button (.spq-ab), which knows its tone, mixes those percentages with its tone colour:
       color = color-mix(tone-text  <fg-tone>%,  fg-base)
   Never write var(--ab-tone…) inside a look block — it resolves to nothing and paints black.

   TONE (neutral / primary / portal / success / danger / warning / info) is fixed per action and
   never changes with the look: red is always destructive, green always means GST-portal traffic
   (label green, caption / timestamp dark green in every look — see section 6).
   ============================================================================ */

/* ---- 1. Tones — the semantic colour of the action (declared ON the button) ---- */
.spq-ab, .spq-abar__tab, .spq-abar__srow {
    --ab-tone: var(--tc-muted, #6b7280);
    --ab-tone-text: var(--tc-text, #4b5563);
}
.spq-ab--primary { --ab-tone: var(--theme-default, #3949AB); --ab-tone-text: var(--theme-text, var(--theme-default, #3949AB)); }
.spq-ab--portal  { --ab-tone: #16a34a; --ab-tone-text: #15803d; --ab-portal-cap: #14532d; }
.spq-ab--success { --ab-tone: #16a34a; --ab-tone-text: #15803d; }
.spq-ab--danger  { --ab-tone: #dc2626; --ab-tone-text: #b91c1c; }
.spq-ab--warning { --ab-tone: #ca8a04; --ab-tone-text: #a16207; }
.spq-ab--info    { --ab-tone: #0284c7; --ab-tone-text: #0369a1; }

body.dark-only .spq-ab, body.dark-only .spq-abar__tab, body.dark-only .spq-abar__srow {
    --ab-tone: var(--tcd-muted, #94a3b8);
    --ab-tone-text: var(--tcd-text, #cbd5e1);
}
body.dark-only .spq-ab--primary { --ab-tone: var(--theme-default, #4C5BD4); --ab-tone-text: var(--theme-text, #b4bcff); }
body.dark-only .spq-ab--portal  { --ab-tone: #22c55e; --ab-tone-text: #4ade80; --ab-portal-cap: #22c55e; }
body.dark-only .spq-ab--success { --ab-tone: #22c55e; --ab-tone-text: #4ade80; }
body.dark-only .spq-ab--danger  { --ab-tone: #ef4444; --ab-tone-text: #f87171; }
body.dark-only .spq-ab--warning { --ab-tone: #eab308; --ab-tone-text: #facc15; }
body.dark-only .spq-ab--info    { --ab-tone: #38bdf8; --ab-tone-text: #7dd3fc; }

/* ---- 2. The eight looks — TONE-FREE custom properties only ------------------- */
/* Defaults = "tile" (the GSTR-3B / GSTR-1 house style), so a body with no attribute, or an
   unknown value, still renders correctly. */
body, .spq-abar[data-actbtn="tile"] {
    --ab-surface: var(--sf-card, #fff);
    --ab-tint: 0%;              --ab-tint-main: 0%;           --ab-tint-danger: 0%;        /* % of tone in the background */
    --ab-fg-base: var(--tc-strong, #1f2937); --ab-fg-base-main: var(--tc-strong, #1f2937); --ab-fg-base-danger: var(--tc-strong, #1f2937);
    --ab-fg-tone: 0%;           --ab-fg-tone-main: 0%;        --ab-fg-tone-danger: 0%;     /* % of tone in the label colour */
    --ab-ico-tone: 100%;        --ab-ico-tone-main: 100%;     --ab-ico-tone-danger: 100%;  /* % of tone in the icon colour */
    --ab-cap-tone: 100%;        --ab-cap-base: var(--tc-muted, #6b7280);                   /* caption */
    --ab-bd-base: var(--bd, #d9dee7);
    --ab-bd-mix: 55%;           --ab-bd-mix-main: 100%;       --ab-bd-mix-danger: 100%;    /* % of tone in the border — tile: border wears the action colour */
    --ab-hover-tint: 0%;        --ab-hover-bd-mix: 100%;
    --ab-radius: .5rem;         --ab-radius-mid: .5rem;       --ab-bdl: 1px;
    --ab-gap: .35rem;           --ab-minh: 2.55rem;           --ab-minw: 0;                --ab-pad: .06rem .5rem;   /* density rule: compact — GSTR-1 Summary cards, tightened top/bottom */
    --ab-main-dir: row;         --ab-main-gap: .4rem;         --ab-cap: block;         --ab-eyebrow: block;
    --ab-ico-size: .85rem;      --ab-ico-box: 1.1em;          --ab-ico-bg: 0%;             --ab-ico-radius: 0;
    --ab-lbl-size: .78rem;      --ab-cap-size: .54rem;        --ab-eyebrow-size: .54rem;   --ab-accent-w: 0px;
    --ab-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    --ab-hover-shadow: 0 1px 4px rgba(16, 24, 40, .12);
}
body.dark-only, body.dark-only .spq-abar[data-actbtn="tile"] {
    --ab-fg-base: var(--tcd-strong, #e5e7eb); --ab-fg-base-main: var(--tcd-strong, #e5e7eb); --ab-fg-base-danger: var(--tcd-strong, #e5e7eb);
    --ab-cap-base: var(--tcd-muted, #94a3b8);
}

/* Outline — Fluent / Bootstrap outline: tone on border, icon and label; tiny qualifier above, caption below. */
body[data-actbtn="outline"], .spq-abar[data-actbtn="outline"] {
    --ab-eyebrow: block;        --ab-eyebrow-size: .5rem;     --ab-cap-size: .56rem;
    --ab-tint: 0%;              --ab-tint-main: 0%;           --ab-tint-danger: 0%;
    --ab-fg-tone: 100%;         --ab-fg-tone-main: 100%;      --ab-fg-tone-danger: 100%;
    --ab-cap-tone: 0%;
    --ab-bd-mix: 60%;           --ab-bd-mix-main: 100%;       --ab-bd-mix-danger: 100%;
    --ab-hover-tint: 8%;        --ab-hover-bd-mix: 100%;
    --ab-radius: .4rem;         --ab-radius-mid: .4rem;
    --ab-minh: 34px;            --ab-minw: 0;                 --ab-pad: .1rem .65rem;
    --ab-shadow: none;          --ab-hover-shadow: none;
}

/* Tonal — Material 3 / Atlassian: soft tinted surface in the action's tone, no border. */
body[data-actbtn="soft"], .spq-abar[data-actbtn="soft"] {
    --ab-eyebrow: none;
    --ab-tint: 12%;             --ab-tint-main: 18%;          --ab-tint-danger: 12%;
    --ab-fg-tone: 100%;         --ab-fg-tone-main: 100%;      --ab-fg-tone-danger: 100%;
    --ab-bd-base: transparent;
    --ab-bd-mix: 0%;            --ab-bd-mix-main: 0%;         --ab-bd-mix-danger: 0%;
    --ab-hover-tint: 10%;       --ab-hover-bd-mix: 0%;
    --ab-radius: .55rem;        --ab-radius-mid: .55rem;
    --ab-minh: 34px;            --ab-minw: 0;                 --ab-pad: .1rem .7rem;
    --ab-shadow: none;          --ab-hover-shadow: none;
}

/* Raised cards — Salesforce / ServiceNow: elevated white card, icon in a tinted rounded box. */
body[data-actbtn="raised"], .spq-abar[data-actbtn="raised"] {
    --ab-tint: 0%;              --ab-tint-main: 0%;           --ab-tint-danger: 0%;
    --ab-fg-tone: 0%;           --ab-fg-tone-main: 0%;        --ab-fg-tone-danger: 0%;
    --ab-bd-base: transparent;
    --ab-bd-mix: 0%;            --ab-bd-mix-main: 0%;         --ab-bd-mix-danger: 0%;
    --ab-hover-tint: 4%;        --ab-hover-bd-mix: 0%;
    --ab-radius: .55rem;        --ab-radius-mid: .55rem;
    --ab-minh: 36px;            --ab-minw: 0;                 --ab-pad: .08rem .55rem .08rem .4rem;
    --ab-main-gap: .4rem;       --ab-cap-size: .54rem;        --ab-eyebrow-size: .5rem;
    --ab-ico-size: .8rem;       --ab-ico-box: 1.45rem;        --ab-ico-bg: 14%;            --ab-ico-radius: .4rem;
    --ab-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .05);
    --ab-hover-shadow: 0 2px 5px rgba(16, 24, 40, .12), 0 6px 14px rgba(16, 24, 40, .08);
}

/* Pill chips — Stripe / Google Workspace: fully rounded chip, icon in a tinted dot. */
body[data-actbtn="pill"], .spq-abar[data-actbtn="pill"] {
    --ab-eyebrow: none;
    --ab-tint: 0%;              --ab-tint-main: 10%;          --ab-tint-danger: 0%;
    --ab-fg-tone: 100%;         --ab-fg-tone-main: 100%;      --ab-fg-tone-danger: 100%;
    --ab-cap-tone: 0%;
    --ab-bd-mix: 40%;           --ab-bd-mix-main: 100%;       --ab-bd-mix-danger: 70%;
    --ab-hover-tint: 8%;        --ab-hover-bd-mix: 100%;
    --ab-radius: 999px;         --ab-radius-mid: 999px;
    --ab-minh: 34px;            --ab-minw: 0;                 --ab-pad: .08rem .8rem .08rem .4rem;
    --ab-ico-size: .8rem;       --ab-ico-box: 1.6rem;         --ab-ico-bg: 16%;            --ab-ico-radius: 999px;
    --ab-shadow: none;          --ab-hover-shadow: none;
}

/* Ribbon — Office ribbon / desktop toolbars: large icon ABOVE the label, flat until hovered. */
body[data-actbtn="stacked"], .spq-abar[data-actbtn="stacked"] {
    --ab-eyebrow: none;
    --ab-surface: transparent;
    --ab-tint: 0%;              --ab-tint-main: 0%;           --ab-tint-danger: 0%;
    --ab-fg-tone: 0%;           --ab-fg-tone-main: 0%;        --ab-fg-tone-danger: 0%;
    --ab-bd-base: transparent;
    --ab-bd-mix: 0%;            --ab-bd-mix-main: 0%;         --ab-bd-mix-danger: 0%;
    --ab-hover-tint: 0%;        --ab-hover-bd-mix: 0%;
    --ab-radius: .5rem;         --ab-radius-mid: .5rem;
    --ab-gap: .15rem;           --ab-minh: 52px;              --ab-minw: 4.2rem;           --ab-pad: .15rem .45rem;
    --ab-main-dir: column;      --ab-main-gap: .25rem;
    --ab-ico-size: 1.15rem;     --ab-ico-box: 2.1rem;         --ab-ico-bg: 12%;            --ab-ico-radius: .55rem;
    --ab-lbl-size: .72rem;
    --ab-shadow: none;          --ab-hover-shadow: none;
}
body[data-actbtn="stacked"] .spq-ab:hover:not(:disabled),
.spq-abar[data-actbtn="stacked"] .spq-ab:hover:not(:disabled) { background: var(--sf-subtle, #f1f3f7); }

/* Frosted glass — Fluent 2 / Windows 11 acrylic: translucent blurred surface, hairline border, soft lift. */
body[data-actbtn="glass"], .spq-abar[data-actbtn="glass"] {
    --ab-surface: color-mix(in srgb, var(--sf-card, #fff) 72%, transparent);
    --ab-tint: 0%;              --ab-tint-main: 10%;          --ab-tint-danger: 0%;
    --ab-fg-tone: 0%;           --ab-fg-tone-main: 100%;      --ab-fg-tone-danger: 100%;
    --ab-bd-base: color-mix(in srgb, var(--bd, #d9dee7) 70%, transparent);
    --ab-bd-mix: 0%;            --ab-bd-mix-main: 40%;        --ab-bd-mix-danger: 40%;
    --ab-hover-tint: 8%;        --ab-hover-bd-mix: 60%;
    --ab-radius: .6rem;         --ab-radius-mid: .6rem;
    --ab-minh: 36px;            --ab-minw: 0;                 --ab-pad: .08rem .6rem .08rem .4rem;
    --ab-eyebrow: none;         --ab-cap-size: .54rem;
    --ab-ico-size: .8rem;       --ab-ico-box: 1.45rem;        --ab-ico-bg: 12%;            --ab-ico-radius: .4rem;
    --ab-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 16px rgba(16, 24, 40, .06);
    --ab-hover-shadow: 0 2px 4px rgba(16, 24, 40, .08), 0 10px 24px rgba(16, 24, 40, .10);
}
body[data-actbtn="glass"] .spq-ab, .spq-abar[data-actbtn="glass"] .spq-ab { backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }

/* Accent bar — Oracle Redwood / SAP Horizon: quiet card with a coloured bar on the left edge. */
body[data-actbtn="accent"], .spq-abar[data-actbtn="accent"] {
    --ab-tint: 0%;              --ab-tint-main: 6%;           --ab-tint-danger: 0%;
    --ab-fg-tone: 0%;           --ab-fg-tone-main: 100%;      --ab-fg-tone-danger: 100%;
    --ab-bd-base: var(--bd, #d9dee7);
    --ab-bd-mix: 0%;            --ab-bd-mix-main: 0%;         --ab-bd-mix-danger: 0%;
    --ab-hover-tint: 5%;        --ab-hover-bd-mix: 50%;
    --ab-radius: .35rem;        --ab-radius-mid: .35rem;      --ab-accent-w: 3px;
    --ab-minh: 36px;            --ab-minw: 0;                 --ab-pad: .08rem .6rem .08rem .55rem;
    --ab-eyebrow: none;         --ab-cap-size: .54rem;        --ab-cap-tone: 0%;
    --ab-shadow: none;          --ab-hover-shadow: 0 1px 4px rgba(16, 24, 40, .10);
}

/* Density rule (Docs/GstActionButtons.md): nothing outside this file may restyle .spq-ab padding,
   min-height or min-width — the GSTR-1 Summary cards are the reference. */

/* ---- 3. Icon treatment — body[data-actico] ------------------------------- */
/* colorful (default): the icon takes the action's tone as the look prescribes.
   mono: icon = label colour.  none: no icon on desktop (the phone bar always keeps icons). */
.spq-ab { --ab-ico-eff: var(--ab-ico-tone); --ab-ico-bg-eff: var(--ab-ico-bg); }
.spq-ab--main   { --ab-ico-eff: var(--ab-ico-tone-main); }
.spq-ab--danger { --ab-ico-eff: var(--ab-ico-tone-danger); }
body[data-actico="mono"] .spq-ab { --ab-ico-eff: 0%; --ab-ico-bg-eff: 0%; }
body[data-actico="none"] .spq-ab .spq-ab__ico { display: none; }
body[data-actico="mono"] .spq-abar__tabico, body[data-actico="mono"] .spq-abar__sico { color: inherit; }

/* ---- 3b. Icon position + alignment — body[data-actipos] / body[data-actalign] ----- */
/* Icon position: the look's --ab-main-dir (Ribbon = column) is the default; the user may force one. */
body[data-actipos="right"] .spq-ab { --ab-main-dir: row-reverse; }
body[data-actipos="top"]   .spq-ab { --ab-main-dir: column; --ab-main-gap: .2rem; --ab-ico-size: 1.05rem; }
body[data-actipos="left"]:not([data-actbtn="stacked"]) .spq-ab { --ab-main-dir: row; }
/* Alignment: default centred. Vertical centring is always on, so a button with only a label, or a
   label + one small line, sits with equal space above and below — no blank placeholder lines. */
body[data-actalign="left"]  .spq-ab { align-items: flex-start; text-align: left; }
body[data-actalign="right"] .spq-ab { align-items: flex-end;   text-align: right; }
body[data-actalign="left"]  .spq-ab .spq-ab__main { justify-content: flex-start; }
body[data-actalign="right"] .spq-ab .spq-ab__main { justify-content: flex-end; }

/* ---- 4. The button — consumes the properties above ------------------------- */
.spq-abar__row {
    display: flex; flex-wrap: wrap; align-items: stretch;
    gap: var(--ab-gap);
}

.spq-ab {
    position: relative;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; white-space: nowrap; cursor: pointer;
    min-height: var(--ab-minh); min-width: var(--ab-minw);
    padding: var(--ab-pad);
    font: inherit; line-height: 1.15;
    border: 1px solid color-mix(in srgb, var(--ab-tone) var(--ab-bd-mix), var(--ab-bd-base));
    border-radius: var(--ab-radius-mid);
    background: color-mix(in srgb, var(--ab-tone) var(--ab-tint), var(--ab-surface));
    color: color-mix(in srgb, var(--ab-tone-text) var(--ab-fg-tone), var(--ab-fg-base));
    box-shadow: inset var(--ab-accent-w) 0 0 0 var(--ab-tone), var(--ab-shadow);
    -webkit-tap-highlight-color: transparent;
    transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease, transform .08s ease;
}
.spq-ab:first-child { border-start-start-radius: var(--ab-radius); border-end-start-radius: var(--ab-radius); }
.spq-ab:last-child  { border-start-end-radius: var(--ab-radius);   border-end-end-radius: var(--ab-radius); }
.spq-ab:not(:first-child) { border-inline-start-width: var(--ab-bdl); }

.spq-ab--main   { --ab-tint: var(--ab-tint-main);   --ab-fg-tone: var(--ab-fg-tone-main);   --ab-fg-base: var(--ab-fg-base-main);   --ab-bd-mix: var(--ab-bd-mix-main); }
.spq-ab--danger { --ab-tint: var(--ab-tint-danger); --ab-fg-tone: var(--ab-fg-tone-danger); --ab-fg-base: var(--ab-fg-base-danger); --ab-bd-mix: var(--ab-bd-mix-danger); }

.spq-ab__main {
    display: inline-flex; flex-direction: var(--ab-main-dir); align-items: center; justify-content: center;
    gap: var(--ab-main-gap);
    font-size: var(--ab-lbl-size);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
    color: inherit;
}
.spq-ab__ico {
    display: inline-grid; place-items: center;
    width: var(--ab-ico-box); height: var(--ab-ico-box); flex: 0 0 auto;
    font-size: var(--ab-ico-size); line-height: 1;
    border-radius: var(--ab-ico-radius);
    background: color-mix(in srgb, var(--ab-tone) var(--ab-ico-bg-eff), transparent);
    color: color-mix(in srgb, var(--ab-tone-text) var(--ab-ico-eff), currentColor);
}
/* Icons handed in as a RenderFragment (LabeledButton adapter) get the same treatment as the catalogue icon. */
.spq-ab__main > i:not(.spq-ab__ico):not(.spq-ab__caret) {
    display: inline-grid; place-items: center;
    width: var(--ab-ico-box); height: var(--ab-ico-box); margin: 0 !important;
    font-size: var(--ab-ico-size); line-height: 1;
    border-radius: var(--ab-ico-radius);
    background: color-mix(in srgb, var(--ab-tone) var(--ab-ico-bg-eff), transparent);
    color: color-mix(in srgb, var(--ab-tone-text) var(--ab-ico-eff), currentColor);
}
body[data-actico="none"] .spq-ab .spq-ab__main > i:not(.spq-ab__caret) { display: none; }
.spq-ab__caret { font-size: .6rem; opacity: .7; margin-left: .1rem; }
.spq-ab__eyebrow {
    display: var(--ab-eyebrow);
    font-style: normal; font-size: var(--ab-eyebrow-size); line-height: 1.1;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
    letter-spacing: .05em; text-transform: uppercase;
    color: var(--ab-cap-base);
    margin-bottom: 0;
}
/* Step-card states (GSTR-3B / GSTR-9 strips): done = green, next = the one to press, blocked = dimmed. */
.spq-ab.is-done { border-color: color-mix(in srgb, #16a34a 60%, var(--ab-bd-base)); }
.spq-ab.is-done .spq-ab__eyebrow, .spq-ab.is-done .spq-ab__cap { color: color-mix(in srgb, #15803d var(--ink-keep, 100%), var(--ink-flip, #15803d)); }
body.dark-only .spq-ab.is-done .spq-ab__eyebrow, body.dark-only .spq-ab.is-done .spq-ab__cap { color: #4ade80; }
.spq-ab.is-next {
    border-color: var(--theme-default, #3949AB);
    background: color-mix(in srgb, var(--theme-default, #3949AB) 8%, var(--ab-surface));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-default, #3949AB) 18%, transparent);
}
.spq-ab.is-next .spq-ab__eyebrow { color: var(--theme-text, var(--theme-default, #3949AB)); }
.spq-ab.is-blocked { opacity: .6; }
.spq-abar__sbtn.is-done .spq-abar__sbico, .spq-abar__tab.is-done .spq-abar__tabico { color: color-mix(in srgb, #15803d var(--ink-keep, 100%), var(--ink-flip, #15803d)); }
.spq-abar__sbtn.is-next .spq-abar__sbico, .spq-abar__tab.is-next .spq-abar__tabico { color: var(--theme-text, var(--theme-default, #3949AB)); }
.spq-abar__sbtn.is-blocked, .spq-abar__tab.is-blocked { opacity: .55; }
/* Dropdown-bearing button: Bootstrap's own caret is suppressed (we draw ours), the group stretches. */
.spq-ab-group { align-items: stretch; }
.spq-ab.spq-ab--dd.dropdown-toggle::after, .spq-ab--dd::after { display: none; }
.spq-ab-menu { min-width: 14rem; }
/* ActionButton split caret half (shared component adapter). */
.spq-ab--split { --ab-minw: 0; padding-inline: .35rem; border-inline-start-width: 0; }
.spq-ab--lg { --ab-minh: 48px; --ab-lbl-size: .9rem; }
.spq-ab .spinner-border.spinner-xs { width: .9em; height: .9em; border-width: .14em; }
.spq-ab-menu__item { display: flex; align-items: center; gap: .1rem; }
.spq-ab-menu__cap { margin-left: auto; padding-left: .75rem; font-size: .68rem; color: var(--tc-muted, #667085); }
.spq-abar__sdiv { margin: 4px 8px; border: 0; border-top: 1px solid var(--bd, #e7ecf3); }
.spq-ab-menu__hdr { font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; }
.spq-abar__sheettitle--sub { padding-top: 8px; }
.spq-ab__cap {
    display: var(--ab-cap);
    font-style: normal; font-size: var(--ab-cap-size);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
    letter-spacing: .04em; text-transform: uppercase;
    color: color-mix(in srgb, var(--ab-tone-text) var(--ab-cap-tone), var(--ab-cap-base));
    font-variant-numeric: tabular-nums;
    margin-top: 0;
}
.spq-ab--neutral .spq-ab__cap { color: var(--ab-cap-base); }
.spq-ab__cap--blank, .spq-ab__eyebrow--blank { visibility: hidden; }
.spq-ab__cap--ts { text-transform: none; letter-spacing: 0; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.spq-ab__badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem;
    border-radius: .55rem;
    background: var(--ab-tone); color: #fff;
    font-size: .6rem; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); line-height: 1;
}

.spq-ab:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--ab-tone) var(--ab-hover-bd-mix), color-mix(in srgb, var(--ab-tone) var(--ab-bd-mix), var(--ab-bd-base)));
    background: color-mix(in srgb, var(--ab-tone) calc(var(--ab-tint) + var(--ab-hover-tint)), var(--ab-surface));
    box-shadow: inset var(--ab-accent-w) 0 0 0 var(--ab-tone), var(--ab-hover-shadow);
    z-index: 1;
}
.spq-ab:active:not(:disabled) { transform: translateY(1px); }
.spq-ab:focus-visible { outline: 2px solid var(--ab-tone); outline-offset: 2px; z-index: 1; }
.spq-ab:disabled { opacity: .55; cursor: not-allowed; }
.spq-ab.is-busy { cursor: progress; }
.spq-ab.is-active {
    border-color: var(--ab-tone);
    background: color-mix(in srgb, var(--ab-tone) 14%, var(--ab-surface));
    box-shadow: inset 0 0 0 1px var(--ab-tone);
}

.spq-abar.is-dense .spq-ab { --ab-minh: 32px; --ab-pad: .08rem .55rem; --ab-minw: 0; }
.spq-abar.is-dense[data-actbtn="stacked"] .spq-ab { --ab-minh: 48px; --ab-minw: 3.8rem; }
.spq-abar.is-dense[data-actbtn="raised"] .spq-ab { --ab-minh: 34px; --ab-minw: 0; }

/* ---- 5. Phone presentation (GstActionBar.is-mobile) ------------------------ */
/* Native-app bottom bar: icon above a short label, >=56px targets, primary action highlighted,
   overflow in a bottom sheet. Sits above the app's own bottom navigation (56px) and clears the
   iOS home indicator. */
.spq-abar { --spq-abar-offset: 56px; }
.spq-abar.is-mobile .spq-abar__row { display: none; }
.spq-abar__spacer { height: calc(60px + env(safe-area-inset-bottom, 0px)); }

.spq-abar__mobile {
    position: fixed; left: 0; right: 0;
    bottom: calc(var(--spq-abar-offset) + env(safe-area-inset-bottom, 0px));
    z-index: 1041;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--sf-card, #fff);
    border-top: 1px solid var(--bd, #e7ecf3);
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .08);
    padding: 2px 2px 2px;
}
.spq-abar__tab {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 58px; min-width: 0; padding: 5px 2px;
    border: 0; background: transparent; font: inherit; cursor: pointer;
    color: var(--tc-muted, #667085);
    -webkit-tap-highlight-color: transparent;
    border-radius: .6rem;
    transition: background-color .12s ease, transform .08s ease;
}
.spq-abar__tabico {
    position: relative;
    display: grid; place-items: center;
    width: 36px; height: 30px; border-radius: 10px;
    font-size: 1.15rem; line-height: 1;
    color: var(--ab-tone-text);
    transition: background-color .12s ease;
}
.spq-abar__tab--main .spq-abar__tabico { background: var(--ab-tone); color: #fff; }
.spq-abar__tab--main.spq-ab--neutral .spq-abar__tabico { background: var(--theme-default, #3949AB); }
.spq-abar__tablbl {
    font-size: .62rem; line-height: 1.1;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--tc-text, #374151);
}
.spq-abar__tab:active:not(:disabled) { background: var(--sf-subtle, #f1f3f7); transform: scale(.96); }
.spq-abar__tab.is-open .spq-abar__tabico { background: var(--sf-subtle, #f1f3f7); }
.spq-abar__tab:disabled { opacity: .45; cursor: not-allowed; }
.spq-abar__badge {
    position: absolute; top: -4px; right: -6px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px;
    background: #dc2626; color: #fff;
    font-size: .58rem; line-height: 16px; text-align: center;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.spq-abar__dot { position: absolute; top: 2px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #dc2626; }

.spq-abar__backdrop {
    position: fixed; inset: 0; z-index: 1042;
    background: rgba(16, 24, 40, .45);
    animation: spqAbFade .18s ease;
}
.spq-abar__sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1043;
    max-height: 72vh; overflow-y: auto;
    background: var(--sf-card, #fff);
    border-radius: 16px 16px 0 0;
    padding: 6px 10px calc(14px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(16, 24, 40, .22);
    animation: spqAbUp .22s cubic-bezier(.2, .8, .2, 1);
}
.spq-abar__handle { width: 38px; height: 4px; border-radius: 2px; margin: 4px auto 8px; background: var(--bd, #d9dee7); }
.spq-abar__sheettitle {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--tc-muted, #667085);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
    padding: 0 6px 6px;
}
.spq-abar__srow {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 52px; padding: 6px 8px;
    border: 0; border-radius: 12px; background: transparent;
    font: inherit; text-align: left; cursor: pointer;
    color: var(--tc-strong, #1f2937);
    -webkit-tap-highlight-color: transparent;
}
.spq-abar__srow:active:not(:disabled) { background: var(--sf-subtle, #f1f3f7); }
.spq-abar__srow:disabled { opacity: .45; cursor: not-allowed; }
.spq-abar__sico {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 11px;
    background: color-mix(in srgb, var(--ab-tone) 14%, var(--sf-card, #fff));
    color: var(--ab-tone-text);
    font-size: 1.05rem;
}
.spq-abar__stext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spq-abar__slbl { font-size: .9rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.spq-abar__scap { font-size: .7rem; color: var(--tc-muted, #667085); font-variant-numeric: tabular-nums; }
.spq-abar__badge--row { position: static; }
.spq-abar__schev { font-size: .7rem; color: var(--tc-faint, #98a2b3); }

body.dark-only .spq-abar__tab { color: var(--tcd-muted, #94a3b8); }
body.dark-only .spq-abar__tablbl { color: var(--tcd-text, #cbd5e1); }
body.dark-only .spq-abar__srow { color: var(--tcd-strong, #e5e7eb); }
body.dark-only .spq-abar__scap, body.dark-only .spq-abar__sheettitle { color: var(--tcd-muted, #94a3b8); }
body.dark-only .spq-abar__schev { color: var(--tcd-faint, #64748b); }
body.dark-only .spq-abar__mobile, body.dark-only .spq-abar__sheet { box-shadow: 0 -4px 16px rgba(0, 0, 0, .45); }

/* ---- 6. Phone on-screen strip (MobileMode Strip / Both) --------------------- */
/* The Notice detail pattern, made reusable: ONE slim row where the desktop row stood. Icon over
   a two-word label, no borders, no captions (they move to the tooltip and the More sheet), equal
   widths, >=56px tall. Six fit a 360px phone; the rest fold into the sheet. ~64px of screen, so
   the page content stays in view. */
.spq-abar__strip {
    display: flex; align-items: stretch; gap: 2px;
    padding: 4px 0 4px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--bd, #e7ecf3);
}
.spq-abar__sbtn {
    position: relative;
    flex: 1 1 0; min-width: 0; min-height: 56px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 5px 2px 4px;
    border: 0; border-radius: 10px; background: transparent;
    font: inherit; cursor: pointer; color: var(--tc-text, #374151);
    -webkit-tap-highlight-color: transparent;
    transition: background-color .12s ease, transform .08s ease;
}
.spq-abar__sbtn:active:not(:disabled) { background: var(--sf-subtle, #f1f3f7); transform: scale(.96); }
.spq-abar__sbtn.is-open { background: var(--sf-subtle, #f1f3f7); }
.spq-abar__sbtn:disabled { opacity: .45; cursor: not-allowed; }
.spq-abar__sbico {
    position: relative;
    display: grid; place-items: center;
    width: 34px; height: 26px;
    font-size: 1.25rem; line-height: 1;
    color: var(--ab-tone-text);
}
.spq-abar__sbtn--main .spq-abar__sbico { color: var(--ab-tone-text); }
.spq-abar__sbtn--main::after {
    content: ""; position: absolute; left: 50%; bottom: 1px; width: 16px; height: 3px;
    border-radius: 2px; transform: translateX(-50%);
    background: var(--ab-tone);
}
.spq-abar__sbtn--main.spq-ab--neutral::after { background: var(--theme-default, #3949AB); }
.spq-abar__sblbl {
    font-size: .62rem; line-height: 1.1; text-align: center;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
    max-width: 100%; max-height: 2.2em; overflow: hidden;
    color: var(--tc-strong, #1f2937);
}
.spq-abar__sbtn .spq-abar__badge { top: -5px; right: -4px; }
body[data-actico="mono"] .spq-abar__sbico { color: inherit; }
body.dark-only .spq-abar__sbtn { color: var(--tcd-text, #cbd5e1); }
body.dark-only .spq-abar__sblbl { color: var(--tcd-strong, #e5e7eb); }
@media (max-width: 359.98px) { .spq-abar__sblbl { font-size: .58rem; } }

/* Showcase frames: the bar and sheet are positioned inside the phone frame, not the viewport. */
.spq-abar.is-frame { --spq-abar-offset: 0px; }
.spq-abar.is-frame .spq-abar__mobile,
.spq-abar.is-frame .spq-abar__backdrop,
.spq-abar.is-frame .spq-abar__sheet { position: absolute; }
.spq-abar.is-frame .spq-abar__spacer { display: none; }

@keyframes spqAbUp   { from { transform: translateY(100%); } to { transform: none; } }
@keyframes spqAbFade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .spq-abar__sheet, .spq-abar__backdrop { animation: none; }
    .spq-ab, .spq-abar__tab { transition: none; }
}

/* On narrow screens a desktop row that is NOT wrapped in a GstActionBar (or that forced the
   desktop presentation) still has to be usable one-handed: full tap height, no caption squeeze. */
@media (max-width: 767.98px) {
    .spq-abar:not(.is-mobile) .spq-ab { --ab-minh: 44px; --ab-minw: 0; flex: 1 1 auto; }
}
/* #endregion */

/* ---- 6. Portal tone — vivid in every look ----------------------------------- */
/* #region Himanshu (09-Oct-2026): the amber portal tone read as dull. Portal buttons now always
   show the label in green and the caption / eyebrow / timestamp in dark green, whatever look is
   chosen (looks that paint labels neutral would otherwise hide the tone). Icon + border follow
   --ab-tone (green) through the normal mixing above. */
.spq-ab.spq-ab--portal { color: var(--ab-tone-text); }
.spq-ab.spq-ab--portal .spq-ab__cap,
.spq-ab.spq-ab--portal .spq-ab__eyebrow { color: var(--ab-portal-cap); }
.spq-ab.spq-ab--portal .spq-ab__ico { color: var(--ab-tone); }
body[data-actico="mono"] .spq-ab.spq-ab--portal .spq-ab__ico { color: inherit; }
/* #endregion */
