/* ==========================================================================
   Roy4d Support — help-centre UI for /support/
   Theme aware: every colour token below reacts to html[data-bs-theme], which
   the platform shell sets from localStorage before this file is applied.
   ========================================================================== */

.spt-app {
    /* ---- tokens -------------------------------------------------------- */
    /* Project palette: primary #0d6efd / #0a58ca, accent indigo #6366f1,
       navy canvas #16213e / #0f3460, Bootstrap neutrals for text and lines. */
    --spt-primary: #0d6efd;
    --spt-primary-deep: #0a58ca;
    --spt-navy: #16213e;
    --spt-navy-deep: #0f3460;
    --spt-indigo: #6366f1;
    --spt-green: #22c55e;
    --spt-accent: var(--spt-primary);
    --spt-accent-deep: var(--spt-primary-deep);
    --spt-accent-ring: rgba(13, 110, 253, .11);
    --spt-surface: #ffffff;
    --spt-field: #f8f9fa;
    --spt-line: #e9ecef;
    --spt-line-strong: #dee2e6;
    --spt-ink: #212529;
    --spt-muted: #6c757d;
    --spt-faint: #8a939b;
    --spt-shadow: 0 12px 30px -20px rgba(15, 52, 96, .45);
    --spt-shadow-lift: 0 22px 44px -24px rgba(15, 52, 96, .4);
    --spt-radius: 22px;
    --spt-radius-md: 16px;
    --spt-radius-sm: 13px;

    /* ---- shell --------------------------------------------------------- */
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.8vw, 16px);
    padding: clamp(14px, 3.4vw, 22px);
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    color: var(--spt-ink);
    -webkit-tap-highlight-color: transparent;
}

[data-bs-theme=dark] .spt-app {
    --spt-surface: #212529;
    --spt-field: #2b3035;
    --spt-line: #343a40;
    --spt-line-strong: #495057;
    --spt-ink: #dee2e6;
    --spt-muted: #a7acb1;
    --spt-faint: #8b939b;
    --spt-accent: #6ea8fe;
    --spt-accent-deep: #8bb9fe;
    --spt-accent-ring: rgba(110, 168, 254, .16);
    --spt-shadow: 0 14px 32px -22px rgba(0, 0, 0, .9);
    --spt-shadow-lift: 0 24px 48px -26px rgba(0, 0, 0, .95);
}

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

.spt-app>* {
    min-width: 0;
}

/* `hidden` must win over the layout rules below (some of them set display). */
.spt-app [hidden] {
    display: none !important;
}

.spt-app :focus-visible {
    outline: 2px solid var(--spt-accent);
    outline-offset: 2px;
    border-radius: 10px;
}

/* The platform tints .icon on hover; inside these cards the surface already
   gives the feedback, so the icons stay their own colour. */
.spt-app .icon:hover {
    opacity: 1;
    color: inherit;
}

/* ---- entrance -------------------------------------------------------- */
.js .spt-rise {
    animation: sptRise .6s cubic-bezier(.22, .82, .28, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes sptRise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Hero
   Project palette: the platform's navy canvas (#16213e -> #0f3460, the same
   pair the platform homepage uses) with the primary blue #0d6efd / #0a58ca
   as the action colour and indigo #6366f1 as the ambient accent.
   ========================================================================== */

.spt-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    flex: 0 0 auto;
    padding: clamp(17px, 4.4vw, 23px);
    border-radius: var(--spt-radius);
    color: #fff;
    background:
        radial-gradient(120% 96% at 92% 0%, rgba(13, 110, 253, .58), transparent 62%),
        radial-gradient(105% 88% at 0% 108%, rgba(99, 102, 241, .32), transparent 64%),
        linear-gradient(152deg, #16213e 0%, #0f3460 100%);
    box-shadow: 0 26px 52px -30px rgba(15, 52, 96, .85);
}

/* Faded engineering grid, brightest where the primary glow sits. */
.spt-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(130% 92% at 88% 0, #000 4%, transparent 70%);
    mask-image: radial-gradient(130% 92% at 88% 0, #000 4%, transparent 70%);
}

/* 1px top highlight so the panel reads as a raised surface. */
.spt-hero::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
}

.spt-miraba:empty {
    display: none;
}

/* ---- eyebrow row ----------------------------------------------------- */

.spt-hero-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: clamp(15px, 4vw, 19px);
}

.spt-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 10px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.spt-pip {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--spt-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
}

.spt-hero-mark {
    margin-left: auto;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .24em;
    color: rgba(255, 255, 255, .45);
}

/* ---- identity -------------------------------------------------------- */

.spt-hero-id {
    display: flex;
    align-items: center;
    gap: 14px;
}

.spt-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, rgba(13, 110, 253, .62), rgba(99, 102, 241, .4));
    border: 1px solid rgba(255, 255, 255, .26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 14px 26px -14px rgba(0, 0, 0, .7);
}

.spt-avatar::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 26px;
    border: 1px solid rgba(110, 168, 254, .5);
    animation: sptPulse 2.8s ease-out infinite;
    pointer-events: none;
}

@keyframes sptPulse {
    0% {
        transform: scale(.94);
        opacity: .9;
    }

    70% {
        transform: scale(1.12);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

.spt-avatar .icon {
    font-size: 1.55rem;
    line-height: 0;
    color: #fff;
}

.spt-online {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 17px;
    height: 17px;
    border: 3px solid var(--spt-navy);
    border-radius: 50%;
    background: var(--spt-green);
    box-shadow: 0 0 10px rgba(34, 197, 94, .8);
}

.spt-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: clamp(1.42rem, 5.6vw, 1.78rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -.02em;
    color: #fff;
}

.spt-title-accent {
    color: #8bb9fe;
}

.spt-tag {
    margin: 15px 0 0;
    font-size: .92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, .82);
}

/* ---- response facts (mirrors the project's stats strip) --------------- */

.spt-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .75rem;
    color: rgba(255, 255, 255, .76);
}

.spt-fact {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 13px;
    padding-right: 13px;
    border-right: 1px solid rgba(255, 255, 255, .16);
}

.spt-fact:last-child {
    margin-right: 0;
    padding-right: 0;
    border-right: 0;
}

.spt-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--spt-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
    animation: sptBlink 2s ease-in-out infinite;
}

@keyframes sptBlink {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, .08);
    }
}

/* ---- primary action (project primary gradient) ----------------------- */

.spt-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 17px;
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--spt-radius-md);
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    font: inherit;
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: .005em;
    cursor: pointer;
    box-shadow: 0 16px 30px -14px rgba(13, 110, 253, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.spt-cta:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 22px 38px -16px rgba(13, 110, 253, .95), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.spt-cta:active {
    transform: translateY(0) scale(.985);
}

.spt-cta .icon {
    font-size: .95rem;
    line-height: 0;
    color: #fff;
}

.spt-cta--soft {
    margin-top: 0;
    border: 1px solid var(--spt-line-strong);
    background: var(--spt-field);
    color: var(--spt-ink);
    box-shadow: none;
}

.spt-cta--soft:hover {
    filter: none;
    box-shadow: none;
}

.spt-cta--soft .icon {
    color: currentColor;
}

/* ==========================================================================
   Quick links
   ========================================================================== */

.spt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.spt-tile {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px 15px 14px;
    border: 1px solid var(--spt-line);
    border-radius: var(--spt-radius-md);
    background: var(--spt-surface);
    box-shadow: var(--spt-shadow);
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.spt-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    background: radial-gradient(120% 90% at 100% 0, var(--tile-tint, var(--spt-accent-ring)), transparent 62%);
}

.spt-tile:hover {
    transform: translateY(-3px);
    border-color: var(--spt-line-strong);
    box-shadow: var(--spt-shadow-lift);
}

.spt-tile:hover::after {
    opacity: 1;
}

.spt-tile:active {
    transform: translateY(-1px) scale(.99);
}

.spt-tile-ico {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: .9rem;
    line-height: 0;
    background: var(--tile-tint, var(--spt-accent-ring));
    color: var(--tile-ink, var(--spt-accent));
}

.spt-tile-label {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.spt-tile-hint {
    font-size: .78rem;
    line-height: 1.4;
    color: var(--spt-muted);
    overflow-wrap: anywhere;
}

/* tones — Bootstrap/project theme colours, tinted for the icon chip and the
   hover sheen of the container. Dark mode uses Bootstrap's lightened
   `*-text-emphasis` variants of the same colours. */
.tone-blue {
    --tile-tint: rgba(13, 110, 253, .11);
    --tile-ink: #0d6efd;
}

.tone-cyan {
    --tile-tint: rgba(13, 202, 240, .16);
    --tile-ink: #0a9dbd;
}

.tone-amber {
    --tile-tint: rgba(255, 193, 7, .18);
    --tile-ink: #b8860b;
}

.tone-indigo {
    --tile-tint: rgba(99, 102, 241, .12);
    --tile-ink: #6366f1;
}

.tone-red {
    --tile-tint: rgba(220, 53, 69, .12);
    --tile-ink: #dc3545;
}

[data-bs-theme=dark] .tone-blue {
    --tile-ink: #6ea8fe;
}

[data-bs-theme=dark] .tone-cyan {
    --tile-ink: #6edff6;
}

[data-bs-theme=dark] .tone-amber {
    --tile-ink: #ffda6a;
}

[data-bs-theme=dark] .tone-indigo {
    --tile-ink: #818cf8;
}

[data-bs-theme=dark] .tone-red {
    --tile-ink: #ea868f;
}

/* ==========================================================================
   Panels
   ========================================================================== */

.spt-panel {
    flex: 0 0 auto;
    padding: 16px clamp(14px, 3.6vw, 18px);
    border: 1px solid var(--spt-line);
    border-radius: var(--spt-radius);
    background: var(--spt-surface);
    box-shadow: var(--spt-shadow);
}

.spt-panel-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 13px;
}

.spt-panel-ico {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: .76rem;
    line-height: 0;
    background: var(--spt-accent-ring);
    color: var(--spt-accent);
}

.spt-panel-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.spt-panel-sub {
    margin: 3px 0 0;
    font-size: .78rem;
    line-height: 1.4;
    color: var(--spt-muted);
}

.spt-count {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--spt-field);
    font-size: .74rem;
    font-weight: 700;
    color: var(--spt-muted);
}

/* ---- search ---------------------------------------------------------- */

.spt-search {
    position: relative;
    display: block;
    margin-bottom: 8px;
}

.spt-search-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .72rem;
    line-height: 0;
    color: var(--spt-faint);
    pointer-events: none;
}

.spt-search input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    border: 1px solid var(--spt-line-strong);
    border-radius: var(--spt-radius-sm);
    background: var(--spt-field);
    color: inherit;
    font: inherit;
    font-size: .92rem;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.spt-search input::placeholder {
    color: var(--spt-faint);
}

.spt-search input:focus {
    outline: none;
    border-color: var(--spt-accent);
    background: var(--spt-surface);
    box-shadow: 0 0 0 4px var(--spt-accent-ring);
}

/* ---- topics ---------------------------------------------------------- */

.spt-topics {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--spt-line);
}

.spt-topic {
    border-bottom: 1px solid var(--spt-line);
}

.spt-topic>summary {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 2px;
    list-style: none;
    cursor: pointer;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.45;
}

.spt-topic>summary::-webkit-details-marker {
    display: none;
}

.spt-topic>summary:hover .spt-t-q {
    color: var(--spt-accent);
}

.spt-t-ico {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    margin-top: -3px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: .72rem;
    line-height: 0;
    background: var(--spt-field);
    color: var(--spt-muted);
    transition: background-color .18s ease, color .18s ease;
}

.spt-topic[open] .spt-t-ico {
    background: var(--spt-accent-ring);
    color: var(--spt-accent);
}

.spt-t-q {
    flex: 1 1 auto;
    min-width: 0;
    transition: color .16s ease;
}

.spt-t-chev {
    flex: 0 0 auto;
    margin-top: 5px;
    font-size: .6rem;
    line-height: 0;
    color: var(--spt-faint);
    transition: transform .22s ease;
}

.spt-topic[open] .spt-t-chev {
    transform: rotate(90deg);
}

.spt-t-body {
    padding: 0 2px 16px 43px;
    font-size: .875rem;
    line-height: 1.62;
    color: var(--spt-muted);
}

.spt-t-body strong {
    color: var(--spt-ink);
    font-weight: 650;
}

.spt-t-body a {
    color: var(--spt-accent);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

.spt-t-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 11px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--spt-accent);
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.spt-t-link .icon {
    font-size: .58rem;
    line-height: 0;
}

.spt-t-link:hover {
    color: var(--spt-accent-deep);
}

/* ---- empty state ----------------------------------------------------- */

.spt-empty {
    padding: 22px 16px;
    border: 1px dashed var(--spt-line-strong);
    border-radius: var(--spt-radius-md);
    background: var(--spt-field);
    text-align: center;
}

.spt-empty p {
    margin: 0 0 13px;
    font-size: .87rem;
    line-height: 1.55;
    color: var(--spt-muted);
}

.spt-empty strong {
    color: var(--spt-ink);
    overflow-wrap: anywhere;
}

/* ==========================================================================
   Staff
   ========================================================================== */

.spt-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 2px -2px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--spt-faint);
}

.spt-divider::before,
.spt-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--spt-line-strong);
}

.spt-row {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--spt-line);
    border-radius: var(--spt-radius-md);
    background: var(--spt-surface);
    box-shadow: var(--spt-shadow);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.spt-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--spt-shadow-lift);
}

.spt-row:active {
    transform: translateY(-1px) scale(.99);
}

.spt-row-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.spt-row .spt-t-chev {
    margin-top: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.spt-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 6px 2px 0;
    text-align: center;
}

.spt-foot-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    font-size: .78rem;
}

.spt-foot-links a {
    color: var(--spt-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .16s ease, border-color .16s ease;
}

.spt-foot-links a:hover {
    color: var(--spt-accent);
    border-bottom-color: currentColor;
}

.spt-copy {
    margin: 0;
    font-size: .72rem;
    color: var(--spt-faint);
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 359px) {
    .spt-grid {
        gap: 10px;
    }

    .spt-tile {
        padding: 13px;
    }

    .spt-t-body {
        padding-left: 2px;
    }
}

/* Below ~400px the two hero facts no longer fit on one line, so stack them
   instead of letting the hairline divider dangle at the end of a row. */
@media (max-width: 399px) {
    .spt-facts {
        flex-direction: column;
        align-items: flex-start;
        gap: 7px;
    }

    .spt-fact {
        margin-right: 0;
        padding-right: 0;
        border-right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .js .spt-rise,
    .spt-avatar::after,
    .spt-dot {
        animation: none;
    }

    .spt-avatar::after {
        display: none;
    }

    .spt-tile,
    .spt-row,
    .spt-cta,
    .spt-t-chev {
        transition: none;
    }

    .spt-tile:hover,
    .spt-row:hover,
    .spt-cta:hover {
        transform: none;
    }
}

/* ==========================================================================
   Staff console — support/apps/dash
   The dash has no head of its own: `$('main').load('apps/dash/')` injects it
   into `main.spt-app` on this page, so it inherits the tokens above.
   ========================================================================== */

.sptd {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

/* ---- toolbar --------------------------------------------------------- */

.sptd-bar {
    position: sticky;
    top: 8px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--spt-line);
    border-radius: var(--spt-radius);
    background: var(--spt-surface);
    box-shadow: var(--spt-shadow-lift);
}

.sptd-bar-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sptd-back {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    border: 1px solid var(--spt-line-strong);
    background: var(--spt-field);
    color: var(--spt-ink);
    text-decoration: none;
    font-size: .8rem;
    line-height: 0;
}

.sptd-back:hover {
    border-color: var(--spt-accent);
    color: var(--spt-accent);
}

.sptd-bar-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sptd-staff {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid var(--spt-line-strong);
    border-radius: 999px;
    background: var(--spt-field);
    color: var(--spt-ink);
    font-size: .74rem;
    font-weight: 700;
    text-decoration: none;
}

.sptd-staff .icon {
    font-size: .8rem;
}

.sptd-staff:hover {
    border-color: var(--spt-accent);
    color: var(--spt-accent);
}

/* ---- search ---------------------------------------------------------- */

.sptd-search {
    position: relative;
}

.sptd-search-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .72rem;
    line-height: 0;
    color: var(--spt-faint);
    pointer-events: none;
}

.sptd-input {
    width: 100%;
    padding: 13px 46px 13px 41px;
    border: 1px solid var(--spt-line-strong);
    border-radius: var(--spt-radius-sm);
    background: var(--spt-field);
    color: inherit;
    font: inherit;
    font-size: .95rem;
    -webkit-appearance: none;
    appearance: none;
}

.sptd-input::placeholder {
    color: var(--spt-faint);
}

.sptd-input:focus {
    outline: none;
    border-color: var(--spt-accent);
    background: var(--spt-surface);
    box-shadow: 0 0 0 4px var(--spt-accent-ring);
}

.sptd-spin {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 0;
}

/* ---- key selector ---------------------------------------------------- */

.sptd-segs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--spt-line);
    border-radius: 999px;
    background: var(--spt-field);
}

.sptd-seg {
    position: relative;
    display: block;
    min-width: 0;
}

.sptd-seg input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.sptd-seg span {
    display: block;
    padding: 8px 6px;
    border-radius: 999px;
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    color: var(--spt-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease;
}

.sptd-seg:hover span {
    color: var(--spt-ink);
}

.sptd-seg input:checked+span {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    box-shadow: 0 8px 16px -10px rgba(13, 110, 253, .9);
}

.sptd-seg input:focus-visible+span {
    outline: 2px solid var(--spt-accent);
    outline-offset: 2px;
}

/* ---- results --------------------------------------------------------- */

.sptd-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sptd-resulthead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 3px;
}

.sptd-resulttitle {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--spt-faint);
}

.sptd-pill {
    margin-left: auto;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--spt-field);
    font-size: .72rem;
    font-weight: 700;
    color: var(--spt-muted);
    font-variant-numeric: tabular-nums;
}

.sptd-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sptd-hint,
.sptd-empty {
    padding: 18px 16px;
    border: 1px dashed var(--spt-line-strong);
    border-radius: var(--spt-radius-md);
    background: var(--spt-field);
    text-align: center;
    font-size: .84rem;
    line-height: 1.55;
    color: var(--spt-muted);
}

.sptd-empty {
    text-align: left;
    font-size: .8rem;
}

.sptd-empty strong {
    display: block;
    margin-bottom: 3px;
    color: var(--spt-ink);
    font-size: .86rem;
}

.sptd-empty code {
    display: block;
    margin-top: 6px;
    color: var(--spt-faint);
    font-size: .74rem;
    overflow-wrap: anywhere;
}

/* ---- account card ---------------------------------------------------- */

.sptd-user {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--spt-line);
    border-radius: var(--spt-radius-md);
    background: var(--spt-surface);
    box-shadow: var(--spt-shadow);
    min-width: 0;
}

.sptd-user-head {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.sptd-ava {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: var(--spt-accent-ring);
    color: var(--spt-accent);
    font-size: .95rem;
    font-weight: 800;
    text-transform: uppercase;
}

.sptd-user-id {
    flex: 1 1 auto;
    min-width: 0;
}

.sptd-name {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sptd-meta {
    display: block;
    margin-top: 3px;
    font-size: .73rem;
    color: var(--spt-muted);
    overflow-wrap: anywhere;
}

.sptd-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    margin: 0;
}

.sptd-facts dt {
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--spt-faint);
}

.sptd-facts dd {
    margin: 3px 0 0;
    font-size: .82rem;
    color: var(--spt-ink);
    overflow-wrap: anywhere;
}

.sptd-facts a {
    color: var(--spt-accent);
    text-decoration: none;
}

.sptd-facts a:hover {
    text-decoration: underline;
}

.sptd-mini {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--spt-faint);
    font-size: .74rem;
    line-height: 0;
    cursor: pointer;
    vertical-align: middle;
}

.sptd-mini:hover {
    color: var(--spt-accent);
}

.sptd-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--spt-accent);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.sptd-link:hover {
    text-decoration: underline;
}

/* ---- buttons --------------------------------------------------------- */

.sptd-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border: 1px solid var(--spt-line-strong, var(--bs-border-color, #dee2e6));
    border-radius: 12px;
    background: var(--spt-field, var(--bs-secondary-bg, #f8f9fa));
    color: inherit;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, filter .16s ease;
}

.sptd-btn .icon {
    font-size: .78rem;
}

.sptd-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.sptd-btn--primary {
    border-color: transparent;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    box-shadow: 0 12px 22px -14px rgba(13, 110, 253, .95);
}

.sptd-btn--primary:hover {
    color: #fff;
    filter: brightness(1.07);
}

/* ---- trace dock ------------------------------------------------------ */

.sptd-dock {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--spt-line);
}

.sptd-dock[hidden] {
    display: none;
}

.sptd-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.sptd-tabs::-webkit-scrollbar {
    display: none;
}

.sptd-tab {
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid var(--spt-line);
    border-radius: 999px;
    background: var(--spt-field);
    color: var(--spt-muted);
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.sptd-tab:hover {
    color: var(--spt-ink);
}

.sptd-tab.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
}

.sptd-tab--soon {
    border-style: dashed;
    color: var(--spt-faint);
}

.sptd-ground {
    min-width: 0;
    font-size: .84rem;
}

.sptd-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 0;
    color: var(--spt-muted);
    font-size: .8rem;
}

.sptd-scroll {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--spt-line);
    border-radius: var(--spt-radius-sm);
}

.sptd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.sptd-table th,
.sptd-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--spt-line);
    white-space: nowrap;
}

.sptd-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--spt-surface);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--spt-faint);
}

.sptd-table tbody tr:last-child td {
    border-bottom: 0;
}

.sptd-table tbody tr:hover td {
    background: var(--spt-field);
}

.sptd-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---- account balances ------------------------------------------------ */

.sptd-accs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sptd-acc {
    padding: 10px 12px;
    border: 1px solid var(--spt-line);
    border-radius: var(--spt-radius-sm);
    background: var(--spt-field);
}

.sptd-acc-name {
    display: block;
    margin-bottom: 7px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--spt-accent);
}

.sptd-acc-vals {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.sptd-acc-vals span {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: .78rem;
}

.sptd-acc-vals i {
    font-style: normal;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--spt-faint);
}

.sptd-acc-vals b {
    color: var(--spt-ink);
    font-variant-numeric: tabular-nums;
}

/* ---- composer (rendered by ActionCentre inside a platform modal, i.e.
   OUTSIDE .spt-app — every token needs a fallback here) ------------------ */

.sptd-compose {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sptd-compose-to {
    margin: 0;
    font-size: .78rem;
    color: var(--spt-muted, var(--bs-secondary-color, #6c757d));
}

.sptd-compose-to strong {
    color: var(--spt-ink, var(--bs-body-color, #212529));
}

.sptd-ta {
    width: 100%;
    min-height: 96px;
    padding: 12px;
    border: 1px solid var(--spt-line-strong, var(--bs-border-color, #dee2e6));
    border-radius: 13px;
    background: var(--spt-surface, var(--bs-body-bg, #fff));
    color: inherit;
    font: inherit;
    font-size: .88rem;
    resize: vertical;
}

.sptd-ta:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, .12);
}

.sptd-compose-row {
    display: flex;
    gap: 8px;
}

.sptd-select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--spt-line-strong, var(--bs-border-color, #dee2e6));
    border-radius: 12px;
    background: var(--spt-field, var(--bs-secondary-bg, #f8f9fa));
    color: inherit;
    font: inherit;
    font-size: .82rem;
}

.sptd-sts {
    margin: 0;
    min-height: 1.1em;
    font-size: .76rem;
    color: var(--spt-muted, var(--bs-secondary-color, #6c757d));
    overflow-wrap: anywhere;
}

/* ---- footer ---------------------------------------------------------- */

.sptd-foot {
    position: sticky;
    bottom: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 1px solid var(--spt-line);
    border-radius: 999px;
    background: var(--spt-surface);
    box-shadow: var(--spt-shadow);
    font-size: .74rem;
    color: var(--spt-muted);
}

.sptd-foot strong {
    color: var(--spt-ink);
    font-variant-numeric: tabular-nums;
}

.sptd-foot-note {
    margin-left: auto;
    font-size: .7rem;
    color: var(--spt-faint);
}

@media (max-width: 399px) {
    .sptd-staff-lbl {
        display: none;
    }

    .sptd-staff {
        padding: 8px;
    }

    .sptd-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .sptd-foot-note {
        display: none;
    }
}

/* ---- room to work on wide screens ------------------------------------ */
/* The help centre is a phone-width column on purpose. The staff console is a
   data tool, so it borrows the extra room whenever it is the thing on screen
   (`:has` simply never matches on the landing page, which keeps 600px). */
@media (min-width: 721px) {
    .spt-app:has(.sptd) {
        max-width: 1060px;
    }

    .sptd-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sptd-accs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 10px;
    }

    .sptd-scroll {
        max-height: 420px;
    }
}

@media (min-width: 1081px) {
    .sptd-accs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {

    .sptd-seg span,
    .sptd-btn {
        transition: none;
    }
}