/* ==========================================================================
   NASR Smart Tools Hub (smart-tools.html only)
   Hero + search, category filters, tool cards, quick access (favourites and
   recently used), tool assistant, and the shared tool action bar.
   Light mode: navy + gold.  Dark mode: midnight navy with gold text accents.
   Behaviour: assets/js/smart-tools-hub.js
   ========================================================================== */

:root {
    --st-ink: #0F172A;
    --st-text: #334155;
    --st-muted: #5B6B80;            /* 5.3:1 on white */
    --st-gold: #C5A039;             /* decoration, icons, large text */
    --st-gold-text: #7A5D12;        /* small gold text on light: 6.3:1 on white, 5.3:1 on gold tints */
    --st-card: #FFFFFF;
    --st-surface: #F8FAFC;
    --st-line: rgba(15, 23, 42, 0.09);
    --st-line-strong: rgba(15, 23, 42, 0.16);
    --st-gold-soft: rgba(197, 160, 57, 0.12);
    --st-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -16px rgba(15, 23, 42, 0.25);
    --st-shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 18px 36px -18px rgba(15, 23, 42, 0.35);
    --st-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --st-radius: 16px;
}

html.dark-mode,
body.dark-mode {
    --st-ink: #F1F5F9;
    --st-text: #CDD6E2;
    --st-muted: #AAB8CA;
    --st-gold: #C5A039;
    --st-gold-text: #D4B254;        /* 8.6:1 on #080F1C */
    --st-card: #142238;
    --st-surface: #101B2D;
    --st-line: #263B53;
    --st-line-strong: #335070;
    --st-gold-soft: rgba(197, 160, 57, 0.14);
    --st-shadow: 0 1px 2px rgba(2, 6, 14, 0.4), 0 10px 26px -16px rgba(2, 6, 14, 0.8);
    --st-shadow-hover: 0 2px 4px rgba(2, 6, 14, 0.4), 0 20px 40px -18px rgba(2, 6, 14, 0.9);
}

.st-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* the hidden attribute must win over the display values below */
.st-hero [hidden],
.st-hub [hidden],
.st-tool [hidden],
.st-assistant [hidden],
.st-actions [hidden] {
    display: none !important;
}

.st-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.st-svg,
.st-hero svg,
.st-hub svg,
.st-assistant svg,
.st-actions svg,
.st-tool svg {
    width: 1.15em;
    height: 1.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

/* ---------- Hero ---------- */
.st-hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    background:
        radial-gradient(720px 320px at 15% 0%, rgba(197, 160, 57, 0.12), transparent 70%),
        radial-gradient(640px 300px at 90% 100%, rgba(15, 23, 42, 0.06), transparent 70%),
        var(--st-surface);
    border-bottom: 1px solid var(--st-line);
}

html.dark-mode .st-hero,
body.dark-mode .st-hero {
    background:
        radial-gradient(720px 320px at 15% 0%, rgba(197, 160, 57, 0.10), transparent 70%),
        radial-gradient(640px 300px at 90% 100%, rgba(0, 213, 200, 0.07), transparent 70%),
        #0A1424;
}

.st-hero-inner {
    max-width: 780px;
    margin: 0 auto;
}

/* ---------- Hero illustration ----------
   Phones/tablets: centred above the existing hero content (layout unchanged).
   Laptop/desktop (>=1100px): text left, illustration right. */
.st-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
}

.st-hero-art {
    width: min(100%, 360px);
    margin: 0 auto;
    aspect-ratio: 560 / 440;        /* reserves space: no layout shift */

    /* light theme colours */
    --art-panel: #FFFFFF;
    --art-soft: #F1F5F9;
    --art-mute: #CBD5E1;
    --art-ink: #0F172A;
    --art-grid: rgba(15, 23, 42, 0.08);
    --art-blue-hi: #3B5BA9;
    --art-blue-lo: #1E3A8A;
    --art-screen: #0F172A;
    --art-glow-in: rgba(197, 160, 57, 0.22);
    --art-glow-out: rgba(197, 160, 57, 0);
    --art-dot: rgba(15, 23, 42, 0.10);
    --art-shadow: rgba(15, 23, 42, 0.16);
    --art-floor: rgba(15, 23, 42, 0.08);
}

html.dark-mode .st-hero-art,
body.dark-mode .st-hero-art {
    --art-panel: #142238;
    --art-soft: #1C2E4A;
    --art-mute: #335070;
    --art-ink: #F1F5F9;
    --art-grid: rgba(241, 245, 249, 0.08);
    --art-blue-hi: #60A5FA;
    --art-blue-lo: #2563EB;
    --art-screen: #080F1C;
    --art-glow-in: rgba(59, 130, 246, 0.22);
    --art-glow-out: rgba(0, 213, 200, 0);
    --art-dot: rgba(241, 245, 249, 0.08);
    --art-shadow: rgba(0, 0, 0, 0.55);
    --art-floor: rgba(0, 0, 0, 0.35);
}

/* override the generic ".st-hero svg" icon sizing for the illustration */
.st-hero .st-hero-art svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: none;
    stroke-width: 1;
    overflow: visible;
}

.st-hero-art .a-panel,
.st-hero-art .a-panel-fill { fill: var(--art-panel); }
.st-hero-art .a-panel { stroke: var(--art-grid); stroke-width: 1; }
.st-hero-art .a-bar,
.st-hero-art .a-soft { fill: var(--art-soft); }
.st-hero-art .a-mute { fill: var(--art-mute); }
.st-hero-art .a-ink { fill: var(--art-ink); }
.st-hero-art .a-blue { fill: var(--art-blue-lo); }
.st-hero-art .a-screen { fill: var(--art-screen); }
.st-hero-art .a-keys rect { fill: var(--art-soft); stroke: var(--art-grid); stroke-width: 1; }
.st-hero-art .a-dot { fill: var(--art-dot); }
.st-hero-art .a-floor { fill: var(--art-floor); }
.st-hero-art .a-glow-in { stop-color: var(--art-glow-in); }
.st-hero-art .a-glow-out { stop-color: var(--art-glow-out); }
.st-hero-art .a-blue-hi { stop-color: var(--art-blue-hi); }
.st-hero-art .a-blue-lo { stop-color: var(--art-blue-lo); }
.st-hero-art .a-shadow { flood-color: var(--art-shadow); flood-opacity: 1; }
.st-hero-art .a-grid { stroke: var(--art-grid); stroke-width: 1.5; }
.st-hero-art .a-trend { fill: none; stroke: #C5A039; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.st-hero-art .a-trend-dot { fill: var(--art-panel); stroke: #C5A039; stroke-width: 3; }
.st-hero-art .a-up { fill: none; stroke: #10B981; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.st-hero-art .a-ring { fill: none; stroke: var(--art-mute); stroke-width: 10; }
.st-hero-art .a-ring-gold { fill: none; stroke: #C5A039; stroke-width: 10; stroke-dasharray: 95 157.08; }
.st-hero-art .a-ring-blue { fill: none; stroke: var(--art-blue-lo); stroke-width: 10; stroke-dasharray: 37 157.08; }
.st-hero-art .a-link { fill: none; stroke: #C5A039; stroke-width: 2; stroke-dasharray: 4 5; stroke-linecap: round; opacity: 0.8; }
.st-hero-art .a-gear-teeth { fill: none; stroke: #C5A039; stroke-width: 8; stroke-dasharray: 6 5.52; }
.st-hero-art .a-check { fill: none; stroke: #FFFFFF; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.st-hero-art .a-swap { fill: none; stroke: var(--art-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.st-hero-art .a-cur { fill: #FFFFFF; font: 700 16px/1 var(--font-body, system-ui, sans-serif); text-anchor: middle; }

/* gentle, GPU-cheap motion (transform only) */
.st-hero-art .a-gear {
    transform-box: fill-box;
    transform-origin: center;
    animation: st-art-spin 24s linear infinite;
}

.st-hero-art .a-float-1 { animation: st-art-float 6s ease-in-out infinite alternate; }
.st-hero-art .a-float-2 { animation: st-art-float 7s ease-in-out -3s infinite alternate; }

@keyframes st-art-spin { to { transform: rotate(360deg); } }
@keyframes st-art-float { from { transform: translateY(0); } to { transform: translateY(-8px); } }

@media (min-width: 1100px) {
    .st-hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        gap: 3rem;
        max-width: 1240px;
        margin: 0 auto;
    }

    .st-hero-art {
        order: 2;
        width: 100%;
        max-width: 540px;
    }

    .st-hero-grid .st-hero-inner {
        order: 1;
        margin: 0;
        text-align: left;
    }

    .st-hero-grid .st-eyebrow,
    .st-hero-grid .st-lead,
    .st-hero-grid .st-search,
    .st-hero-grid .st-suggest,
    .st-hero-grid .st-privacy {
        margin-left: 0;
    }

    .st-hero-grid .st-suggest,
    .st-hero-grid .st-privacy {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .st-hero-art {
        width: min(100%, 300px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-hero-art .a-gear,
    .st-hero-art .a-float-1,
    .st-hero-art .a-float-2 {
        animation: none;
    }
}

.st-eyebrow {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(197, 160, 57, 0.35);
    background: var(--st-gold-soft);
    color: var(--st-gold-text);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

html.dark-mode body.dark-mode .st-eyebrow {
    color: var(--st-gold-text) !important;
}

.st-hero h1.luxury-title {
    margin: 0 0 1rem;
    font-size: clamp(1.9rem, 4.6vw, 3rem);
    line-height: 1.15;
}

.st-lead {
    max-width: 640px;
    margin: 0 auto 1.75rem;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--st-text);
}

/* Search */
.st-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 620px;
    margin: 0 auto;
    padding: 0 0.5rem 0 1.1rem;
    min-height: 58px;
    border-radius: 14px;
    border: 1px solid var(--st-line-strong);
    background: var(--st-card);
    box-shadow: var(--st-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

html.dark-mode .st-search,
body.dark-mode .st-search {
    background: rgba(20, 34, 56, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.st-search:focus-within {
    border-color: var(--st-gold);
    box-shadow: 0 0 0 3px rgba(197, 160, 57, 0.2), var(--st-shadow);
}

.st-search > svg {
    color: var(--st-muted);
    font-size: 1.1rem;
}

.st-search input {
    flex: 1;
    min-width: 0;
    height: 56px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--st-ink);
    font: inherit;
    font-size: 1rem;
}

.st-search input::placeholder {
    color: var(--st-muted);
    opacity: 1;
}

.st-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.st-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--st-muted);
    cursor: pointer;
}

.st-search-clear:hover {
    background: var(--st-gold-soft);
    color: var(--st-ink);
}

.st-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    margin-right: 0.4rem;
    padding: 0 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--st-line-strong);
    color: var(--st-muted);
    font-size: 0.78rem;
    font-family: inherit;
}

.st-suggest {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin: 1rem auto 0;
    font-size: 0.88rem;
    color: var(--st-muted);
}

.st-suggest button {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--st-line-strong);
    background: transparent;
    color: var(--st-text);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.st-suggest button:hover {
    border-color: var(--st-gold);
    background: var(--st-gold-soft);
    color: var(--st-ink);
}

.st-privacy {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem 0.75rem;
    max-width: 640px;
    margin: 1.5rem auto 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--st-text);
}

.st-privacy-text {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.st-privacy-text svg {
    margin-top: 0.15em;
    color: #10B981;
}

.st-privacy-link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--st-gold-text);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* ---------- Hub layout ---------- */
.st-hub {
    padding-top: 2.5rem;
}

.st-hub .container {
    max-width: min(95%, 1240px);
}

/* Category filters */
.st-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0.1rem 0.75rem;
    margin: 0 0 1rem;
    scrollbar-width: thin;
}

.st-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--st-line-strong);
    background: var(--st-card);
    color: var(--st-text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.st-filter:hover {
    border-color: var(--st-gold);
}

.st-filter[aria-pressed="true"] {
    background: var(--st-ink);
    border-color: var(--st-ink);
    color: #FFFFFF;
}

html.dark-mode body.dark-mode .st-filter[aria-pressed="true"] {
    background: var(--st-gold);
    border-color: var(--st-gold);
    color: #04121F;
}

.st-count {
    min-width: 1.5em;
    padding: 0 0.4em;
    border-radius: 999px;
    background: var(--st-gold-soft);
    color: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    font-style: normal;
    line-height: 1.6;
    text-align: center;
}

.st-filter[aria-pressed="true"] .st-count {
    background: rgba(255, 255, 255, 0.2);
}

html.dark-mode body.dark-mode .st-filter[aria-pressed="true"] .st-count {
    background: rgba(4, 18, 31, 0.18);
}

.st-status {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: var(--st-muted);
}

/* Quick access: favourites + recently used */
.st-quick {
    display: grid;
    gap: 0.9rem;
    margin: 0 0 2rem;
    padding: 1rem 1.15rem;
    border-radius: var(--st-radius);
    border: 1px solid var(--st-line);
    background: var(--st-surface);
}

.st-quick-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.st-quick-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 9.5rem;
    margin-right: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--st-muted);
}

.st-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--st-line-strong);
    background: var(--st-card);
    color: var(--st-ink);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.st-chip svg {
    color: var(--st-gold);
}

.st-chip:hover {
    border-color: var(--st-gold);
    transform: translateY(-1px);
}

.st-text-btn {
    margin-left: auto;
    border: 0;
    padding: 0.3rem 0.4rem;
    background: none;
    color: var(--st-muted);
    font: inherit;
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.st-text-btn:hover {
    color: var(--st-ink);
}

/* Section headings */
.st-block {
    margin: 0 0 2.75rem;
}

.st-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin: 0 0 1.1rem;
}

.st-block-head h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2.4vw, 1.6rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--st-ink);
}

.st-block-head p {
    margin: 0;
    font-size: 0.93rem;
    color: var(--st-muted);
}

/* Featured tiles */
.st-featured {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 1.1rem;
}

.st-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.4rem;
    border-radius: var(--st-radius);
    border: 1px solid var(--st-line);
    background:
        linear-gradient(160deg, rgba(197, 160, 57, 0.10), transparent 55%),
        var(--st-card);
    box-shadow: var(--st-shadow);
    color: inherit;
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    transition: transform 0.25s var(--st-ease), box-shadow 0.25s ease, border-color 0.25s ease;
}

.st-feature:hover {
    transform: translateY(-3px);
    border-color: rgba(197, 160, 57, 0.55);
    box-shadow: var(--st-shadow-hover);
}

.st-feature h3 {
    margin: 0.25rem 0 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--st-ink);
}

.st-feature p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--st-muted);
}

.st-feature-cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.35rem;
    margin-top: auto;
    padding: 0.4rem 0 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--st-gold-text);
    cursor: pointer;
    transition: gap 0.2s ease;
}

.st-feature:hover .st-feature-cta {
    gap: 0.55rem;
}

html.dark-mode body.dark-mode .st-feature-cta {
    color: var(--st-gold-text) !important;
}

/* Tool grid + cards */
.st-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 1.1rem;
}

.st-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.3rem 1.3rem 1.2rem;
    border-radius: var(--st-radius);
    border: 1px solid var(--st-line);
    background: var(--st-card);
    box-shadow: var(--st-shadow);
    cursor: pointer;
    transition: transform 0.25s var(--st-ease), box-shadow 0.25s ease, border-color 0.25s ease;
}

.st-card:hover {
    transform: translateY(-3px);
    border-color: rgba(197, 160, 57, 0.5);
    box-shadow: var(--st-shadow-hover);
}

.st-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.st-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--st-gold-soft);
    color: var(--st-gold);
    font-size: 1.3rem;
}

html.dark-mode .st-icon,
body.dark-mode .st-icon {
    box-shadow: inset 0 0 0 1px rgba(197, 160, 57, 0.22);
}

.st-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
    padding-top: 0.2rem;
}

.st-badge {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--st-line-strong);
    color: var(--st-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.6;
}

.st-badge-new {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.10);
    color: #047857;
}

.st-badge-beta {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
    color: #1D4ED8;
}

.st-badge-hot {
    border-color: rgba(197, 160, 57, 0.5);
    background: var(--st-gold-soft);
    color: var(--st-gold-text);
}

html.dark-mode body.dark-mode .st-badge { color: var(--st-muted) !important; }
html.dark-mode body.dark-mode .st-badge-new { color: #6EE7B7 !important; }
html.dark-mode body.dark-mode .st-badge-beta { color: #93C5FD !important; }
html.dark-mode body.dark-mode .st-badge-hot { color: var(--st-gold-text) !important; }

.st-fav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: -0.2rem -0.35rem 0 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--st-muted);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.st-fav:hover {
    background: var(--st-gold-soft);
    color: var(--st-gold);
}

.st-fav[aria-pressed="true"] {
    color: var(--st-gold);
}

.st-fav[aria-pressed="true"] svg {
    fill: currentColor;
}

.st-card h3 {
    margin: 0.2rem 0 0;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--st-ink);
}

.st-card p {
    flex: 1;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--st-muted);
}

.st-open {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.45rem;
    margin-top: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--st-ink);
    color: #FFFFFF;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, gap 0.2s ease;
}

.st-open:hover {
    background: var(--st-gold);
    color: #0F172A;
    gap: 0.65rem;
}

html.dark-mode body.dark-mode .st-open {
    background: var(--st-gold-soft);
    border-color: rgba(197, 160, 57, 0.45);
    color: var(--st-gold-text) !important;
}

html.dark-mode body.dark-mode .st-open:hover {
    background: var(--st-gold);
    border-color: var(--st-gold);
    color: #04121F !important;
}

/* "Open tool" + "Watch how" (video tutorial) side by side */
.st-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.st-card-actions .st-open {
    margin-top: 0;
}

.st-watch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem 0.5rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--st-line-strong);
    background: transparent;
    color: var(--st-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.st-watch:hover,
.st-watch:focus-visible {
    border-color: var(--st-gold);
    background: var(--st-gold-soft);
}

.st-watch-play {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--st-gold);
    flex: none;
}

.st-watch-play::after {
    content: "";
    position: absolute;
    left: 55%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-left: 7px solid #0F172A;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.st-watch-len {
    color: var(--st-muted);
    font-weight: 500;
    font-size: 0.82rem;
}

/* Video pop-up player */
.st-video-dialog {
    width: min(960px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #0F172A;
    color: #F1F5F9;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
    overflow: auto;
}

.st-video-dialog::backdrop {
    background: rgba(4, 10, 22, 0.78);
    backdrop-filter: blur(3px);
}

html.st-video-open {
    overflow: hidden;
}

.st-video-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.9rem 0.85rem 1.25rem;
}

.st-video-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #F1F5F9;
}

.st-video-close {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #F1F5F9;
    cursor: pointer;
}

.st-video-close:hover,
.st-video-close:focus-visible {
    background: var(--st-gold);
    color: #0F172A;
}

.st-video-close svg {
    width: 1.2rem;
    height: 1.2rem;
}

.st-video-frame {
    background: #000;
    aspect-ratio: 16 / 9;
}

.st-video-frame video {
    display: block;
    width: 100%;
    height: 100%;
}

.st-video-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    padding: 0.6rem 1.25rem 0.8rem;
}

.st-video-note {
    margin: 0;
    flex: 1 1 260px;
    font-size: 0.8rem;
    color: #AAB8CA;
}

/* background music: on/off + volume (st-video-music.js) */
.st-video-music {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: none;
}

.st-music-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    padding: 0 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #E2E8F0;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.st-music-toggle:hover,
.st-music-toggle:focus-visible {
    border-color: var(--st-gold);
    color: #fff;
}

.st-music-toggle:focus-visible {
    outline: 2px solid var(--st-gold);
    outline-offset: 2px;
}

.st-music-toggle svg {
    width: 1rem;
    height: 1rem;
    color: var(--st-gold);
}

.st-music-toggle .st-music-off {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.st-music-toggle.is-off {
    color: #94A3B8;
}

.st-music-toggle.is-off svg {
    color: #94A3B8;
}

.st-music-toggle.is-off .st-music-off {
    opacity: 1;
}

.st-music-vol {
    display: inline-flex;
    align-items: center;
}

.st-music-vol input {
    width: 6.5rem;
    accent-color: var(--st-gold);
    cursor: pointer;
}

.st-music-vol input:disabled {
    opacity: 0.4;
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .st-music-toggle,
    .st-music-toggle .st-music-off {
        transition: none;
    }
}

/* Empty state */
.st-empty {
    max-width: 560px;
    margin: 1rem auto 3rem;
    padding: 2.25rem 1.5rem;
    border-radius: var(--st-radius);
    border: 1px dashed var(--st-line-strong);
    background: var(--st-surface);
    text-align: center;
}

.st-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    background: var(--st-gold-soft);
    color: var(--st-gold);
    font-size: 1.5rem;
}

.st-empty h2 {
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
    color: var(--st-ink);
}

.st-empty p {
    margin: 0 0 1.25rem;
    color: var(--st-muted);
}

.st-btn-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.st-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--st-line-strong);
    background: var(--st-card);
    color: var(--st-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.st-btn:hover {
    border-color: var(--st-gold);
    background: var(--st-gold-soft);
}

.st-btn-solid {
    background: var(--st-ink);
    border-color: var(--st-ink);
    color: #FFFFFF;
}

.st-btn-solid:hover {
    background: var(--st-gold);
    border-color: var(--st-gold);
    color: #0F172A;
}

html.dark-mode body.dark-mode .st-btn-solid {
    background: var(--st-gold);
    border-color: var(--st-gold);
    color: #04121F !important;
}

html.dark-mode body.dark-mode .st-btn-solid:hover {
    background: #D4B254;
}

/* ---------- Assistant ---------- */
.st-assistant {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 2rem;
    align-items: start;
    margin: 0 0 3rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: 20px;
    border: 1px solid var(--st-line);
    background:
        radial-gradient(600px 220px at 0% 0%, rgba(197, 160, 57, 0.10), transparent 70%),
        var(--st-surface);
}

.st-assistant .st-eyebrow {
    margin-left: 0;
}

.st-assistant h2 {
    margin: 0.5rem 0 0.6rem;
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2.4vw, 1.6rem);
    color: var(--st-ink);
}

.st-assistant-intro p {
    margin: 0 0 0.75rem;
    color: var(--st-text);
    line-height: 1.6;
}

.st-assistant-note {
    font-size: 0.85rem;
    color: var(--st-muted) !important;
}

.st-chat {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    border-radius: var(--st-radius);
    border: 1px solid var(--st-line);
    background: var(--st-card);
    box-shadow: var(--st-shadow);
    overflow: hidden;
}

.st-chat-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 340px;
    min-height: 180px;
    padding: 1.1rem;
    overflow-y: auto;
}

.st-msg {
    max-width: 88%;
    padding: 0.7rem 0.95rem;
    border-radius: 14px;
    font-size: 0.93rem;
    line-height: 1.55;
}

.st-msg-bot {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    color: var(--st-text);
}

.st-msg-user {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    background: var(--st-ink);
    color: #FFFFFF;
}

html.dark-mode body.dark-mode .st-msg-user {
    background: rgba(197, 160, 57, 0.18);
    border: 1px solid rgba(197, 160, 57, 0.4);
    color: #F1F5F9;
}

.st-msg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.st-msg a {
    color: var(--st-gold-text);
    font-weight: 600;
}

.st-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--st-line);
}

.st-chat-form input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--st-line-strong);
    background: var(--st-surface);
    color: var(--st-ink);
    font: inherit;
    font-size: 0.95rem;
}

.st-chat-form input:focus {
    outline: none;
    border-color: var(--st-gold);
    box-shadow: 0 0 0 3px rgba(197, 160, 57, 0.2);
}

.st-chat-form button[type="submit"] {
    height: 44px;
    border-radius: 10px;
    padding: 0 1rem;
}

/* ---------- Inside tool modals ---------- */
.st-tool-intro {
    margin: 0 0 1.25rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border-left: 3px solid var(--st-gold);
    background: var(--st-gold-soft);
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--st-text);
}

.st-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--st-line);
}

.st-actions .st-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}

.st-actions .st-report {
    margin-left: auto;
}

.st-toast {
    font-size: 0.85rem;
    font-weight: 600;
    color: #047857;
}

html.dark-mode body.dark-mode .st-toast {
    color: #6EE7B7 !important;
}

.st-error {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: #B91C1C;
    font-size: 0.9rem;
}

html.dark-mode body.dark-mode .st-error {
    color: #FCA5A5 !important;
}

.st-tool .form-group + .form-group {
    margin-top: 1rem;
}

.st-row {
    display: flex;
    gap: 1rem;
}

.st-row > .form-group {
    flex: 1;
    min-width: 0;
    margin-top: 0 !important;
}

.st-tool .form-input {
    width: 100%;
}

.st-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--st-muted);
}

.st-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
}

.st-mode label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--st-line-strong);
    font-size: 0.88rem;
    cursor: pointer;
}

.st-mode label:has(input:checked) {
    border-color: var(--st-gold);
    background: var(--st-gold-soft);
}

.st-results {
    margin-top: 1.5rem;
    padding: 1.25rem 1.4rem;
    border-radius: 12px;
    background: var(--color-bg-light);
}

html.dark-mode body.dark-mode .st-results {
    background: rgba(16, 27, 45, 0.85);
    border: 1px solid var(--st-line);
}

.st-results > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.st-results > div:last-child {
    margin-bottom: 0;
}

.st-results .st-total {
    padding-top: 0.6rem;
    border-top: 1px solid var(--st-line-strong);
    font-size: 1.1rem;
}

.st-results .st-total strong {
    color: var(--st-gold-text);
}

html.dark-mode body.dark-mode .st-results .st-total strong {
    color: var(--st-gold-text) !important;
}

/* Expense rows */
.st-exp-head,
.st-exp-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr) 40px;
    gap: 0.5rem;
    align-items: center;
}

.st-exp-head {
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--st-muted);
}

.st-exp-row + .st-exp-row {
    margin-top: 0.5rem;
}

.st-exp-row .form-input {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.st-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--st-line-strong);
    background: transparent;
    color: var(--st-muted);
    cursor: pointer;
}

.st-icon-btn:hover {
    border-color: rgba(239, 68, 68, 0.5);
    color: #DC2626;
}

/* PDF to Word */
.st-drop {
    display: block;
    padding: 2.5rem 1.25rem;
    border-radius: 14px;
    border: 2px dashed var(--st-line-strong);
    background: var(--st-surface);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.st-drop:hover,
.st-drop.is-over,
.st-drop:focus-within {
    border-color: var(--st-gold);
    background: var(--st-gold-soft);
}

.st-drop-icon {
    display: inline-flex;
    margin-bottom: 0.75rem;
    color: var(--st-gold);
    font-size: 2.4rem;
}

.st-drop strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    color: var(--st-ink);
}

.st-drop small {
    color: var(--st-muted);
}

.st-progress {
    height: 8px;
    margin: 1.5rem 0 0.75rem;
    border-radius: 4px;
    background: var(--st-line);
    overflow: hidden;
}

.st-progress > div {
    width: 0;
    height: 100%;
    background: var(--st-gold);
    transition: width 0.3s ease;
}

.st-done {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    text-align: center;
}

.st-done h4 {
    margin: 0 0 0.4rem;
    color: var(--st-ink);
}

.st-done p {
    margin: 0 0 1rem;
    color: var(--st-text);
}

/* ---------- PDF to Word converter (assets/js/pdf-converter.js) ---------- */
.p2w {
    --p2w-navy: #1B2A4A;
    --p2w-navy-hi: #24375F;
    color: var(--st-text);
}

.p2w-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.p2w-drop {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    padding: 2.4rem 1.25rem 2rem;
    border: 2px dashed var(--st-line-strong);
    border-radius: 14px;
    background: var(--st-surface);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, padding 0.2s ease;
}

.p2w-drop:hover,
.p2w-drop.is-over {
    border-color: var(--st-gold);
    background: var(--st-gold-soft);
}

.p2w-drop.is-compact {
    padding: 1.1rem 1rem;
}

.p2w-drop.is-compact .p2w-drop-icon,
.p2w-drop.is-compact .p2w-drop-or {
    display: none;
}

.p2w-drop-icon svg {
    width: 52px;
    height: 62px;
    color: #94A3B8;
}

.p2w-drop-title {
    margin: 0.4rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--st-ink);
}

.p2w-drop-or {
    margin: 0;
    font-size: 0.85rem;
    color: var(--st-muted);
}

.p2w-drop-help {
    max-width: 30rem;
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--st-muted);
}

.p2w-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.6rem;
    padding: 0 1.15rem;
    border: 1px solid var(--st-line-strong);
    border-radius: 10px;
    background: var(--st-card);
    color: var(--st-ink);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.p2w-btn svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
}

.p2w-btn-primary {
    border-color: var(--p2w-navy);
    background: var(--p2w-navy);
    color: #fff !important;
}

.p2w-btn-primary:hover {
    background: var(--p2w-navy-hi);
    border-color: var(--st-gold);
}

.p2w-btn-primary svg {
    color: var(--st-gold);
}

.p2w-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: var(--p2w-navy);
}

.p2w-btn-lg {
    min-height: 3rem;
    padding: 0 1.5rem;
    font-size: 1rem;
}

.p2w-btn-lg svg {
    width: 1.4rem;
    height: 1.7rem;
    color: inherit;
}

.p2w-btn-ghost:hover {
    border-color: var(--st-gold);
}

.p2w-btn-small {
    min-height: 2.1rem;
    padding: 0 0.8rem;
    font-size: 0.82rem;
}

.p2w-files,
.p2w-results {
    display: grid;
    gap: 0.6rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.p2w-files:empty {
    display: none;
}

/* the tool windows tick every list item (.modal-body li::before); the converter's lists carry
   their own status marks, so not here */
.modal-body .p2w li::before {
    content: none;
}

.modal-body .p2w-files > li,
.modal-body .p2w-results > li {
    margin-bottom: 0;
    padding-left: 0.9rem;
}

.modal-body .p2w-stages > li {
    margin-bottom: 0;
    padding-left: 0;
}

.p2w-file,
.p2w-result {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--st-line);
    border-radius: 12px;
    background: var(--st-card);
}

.p2w-file-icon svg {
    display: block;
    width: 30px;
    height: 36px;
    color: #94A3B8;
}

.p2w-file-info {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.1rem;
}

.p2w-file-name {
    overflow: hidden;
    color: var(--st-ink);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p2w-file-meta {
    font-size: 0.8rem;
    color: var(--st-muted);
}

.p2w-file-status {
    font-size: 0.8rem;
    color: var(--st-muted);
}

.p2w-file.is-ready .p2w-file-status {
    color: #15803D;
}

.p2w-file.is-invalid {
    border-color: rgba(220, 38, 38, 0.35);
}

.p2w-file.is-invalid .p2w-file-status,
.p2w-file.is-locked .p2w-file-status {
    color: #B42318;
}

html.dark-mode .p2w-file.is-invalid .p2w-file-status,
html.dark-mode .p2w-file.is-locked .p2w-file-status {
    color: #FCA5A5;
}

html.dark-mode .p2w-file.is-ready .p2w-file-status {
    color: #4ADE80;
}

.p2w-file-btns {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: none;
}

.p2w-link {
    padding: 0.3rem 0.4rem;
    border: 0;
    background: none;
    color: var(--st-gold-text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.p2w-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--st-line);
    border-radius: 8px;
    background: none;
    color: var(--st-muted);
    cursor: pointer;
}

.p2w-icon-btn:hover {
    border-color: rgba(239, 68, 68, 0.5);
    color: #DC2626;
}

.p2w-icon-btn svg {
    width: 1rem;
    height: 1rem;
}

.p2w-unlock {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.p2w-unlock input {
    flex: 1 1 10rem;
    min-height: 2.1rem;
    padding: 0 0.7rem;
    border: 1px solid var(--st-line-strong);
    border-radius: 8px;
    background: var(--st-surface);
    color: var(--st-ink);
    font: inherit;
    font-size: 0.85rem;
}

.p2w-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1.25rem;
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: var(--st-surface);
    font-size: 0.88rem;
}

.p2w-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.p2w-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--p2w-navy);
}

.p2w-lang {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.p2w-lang select {
    min-height: 2.1rem;
    padding: 0 0.5rem;
    border: 1px solid var(--st-line-strong);
    border-radius: 8px;
    background: var(--st-card);
    color: var(--st-ink);
    font: inherit;
}

.p2w-error {
    margin: 0.9rem 0 0;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    background: rgba(220, 38, 38, 0.08);
    color: #B42318;
    font-size: 0.88rem;
}

.p2w-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

.p2w-progress {
    padding: 1.25rem;
    border: 1px solid var(--st-line);
    border-radius: 14px;
    background: var(--st-card);
}

.p2w-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--st-ink);
}

.p2w-progress-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p2w-bar {
    height: 8px;
    margin: 0.75rem 0 0.5rem;
    border-radius: 4px;
    background: var(--st-line);
    overflow: hidden;
}

.p2w-bar > div {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--p2w-navy), var(--st-gold));
    transition: width 0.25s ease;
}

.p2w-progress-detail {
    min-height: 1.2em;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--st-muted);
}

.p2w-stages {
    display: grid;
    gap: 0.35rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 0.88rem;
}

.p2w-stages li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.p2w-stage-dot {
    width: 0.75rem;
    height: 0.75rem;
    flex: none;
    border: 2px solid var(--st-line-strong);
    border-radius: 50%;
}

.p2w-stage-label {
    flex: 1 1 auto;
}

.p2w-stage-state {
    font-size: 0.78rem;
    color: var(--st-muted);
}

.p2w-stages .is-wait {
    color: var(--st-muted);
}

.p2w-stages .is-active {
    color: var(--st-ink);
    font-weight: 600;
}

.p2w-stages .is-active .p2w-stage-dot {
    border-color: var(--st-gold);
    background: var(--st-gold);
    box-shadow: 0 0 0 3px var(--st-gold-soft);
}

.p2w-stages .is-done .p2w-stage-dot {
    border-color: #15803D;
    background: #15803D;
}

.p2w-stages .is-skipped {
    color: var(--st-muted);
}

.p2w-stages .is-skipped .p2w-stage-label {
    text-decoration: line-through;
    text-decoration-color: var(--st-line-strong);
}

.p2w-done {
    padding: 1.25rem;
    border: 1px solid rgba(21, 128, 61, 0.3);
    border-radius: 14px;
    background: rgba(21, 128, 61, 0.05);
}

.p2w-done-head {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.p2w-done-tick {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: none;
    border-radius: 50%;
    background: #15803D;
    color: #fff;
    font-weight: 700;
}

.p2w-done h4 {
    margin: 0 0 0.2rem;
    color: var(--st-ink);
}

.p2w-done p {
    margin: 0;
    font-size: 0.88rem;
}

.p2w-result .p2w-file-icon svg {
    color: #94A3B8;
}

.p2w-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 1.1rem 0 0;
    font-size: 0.8rem;
    color: var(--st-muted);
}

.p2w-privacy svg {
    width: 0.95rem;
    height: 0.95rem;
    flex: none;
    color: var(--st-gold);
}

@media (max-width: 560px) {
    .p2w-drop {
        padding: 1.75rem 1rem 1.5rem;
    }

    .p2w-file,
    .p2w-result {
        flex-wrap: wrap;
    }

    .p2w-result .p2w-btn {
        width: 100%;
    }

    .p2w-actions .p2w-btn {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .p2w-drop,
    .p2w-btn,
    .p2w-bar > div {
        transition: none;
    }
}

/* Keyboard focus */
.st-hero :focus-visible,
.st-hub :focus-visible,
.st-assistant :focus-visible,
.st-tool :focus-visible,
.st-actions :focus-visible {
    outline: 2px solid var(--st-gold);
    outline-offset: 2px;
}

/* ---------- Smart Tools FAQ accordion ----------
   Behaviour in smart-tools-hub.js. Answers collapse only once the script adds
   .is-ready, so without JavaScript every answer stays readable. */
.st-faq {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

/* The 500px animation box was forcing the single mobile grid column to
   500px wide, pushing the FAQ off-screen on phones. Let both columns shrink. */
.faq-image,
.faq-content {
    min-width: 0;
}

.st-faq-item {
    border: 1px solid var(--st-line);
    border-radius: 14px;
    background: var(--st-card);
    box-shadow: var(--st-shadow);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.st-faq-item.is-open {
    border-color: rgba(197, 160, 57, 0.55);
}

.st-faq-h {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
}

.st-faq-q {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    padding: 0.9rem 1.1rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--color-primary);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.st-faq-text {
    font-weight: inherit;
    color: inherit;
}

.st-faq-q:hover .st-faq-text {
    color: var(--st-gold-text);
}

.st-faq-q:focus-visible {
    outline: 2px solid var(--st-gold);
    outline-offset: 2px;
}

/* plus that turns into a minus */
.st-faq-icon {
    position: relative;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--st-gold-soft);
    border: 1px solid rgba(197, 160, 57, 0.4);
    transition: background-color 0.25s ease, transform 0.3s var(--st-ease);
}

.st-faq-icon::before,
.st-faq-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    margin: -1px 0 0 -6px;
    border-radius: 2px;
    background: var(--st-gold-text);
    transition: transform 0.3s var(--st-ease), opacity 0.2s ease;
}

.st-faq-icon::after {
    transform: rotate(90deg);
}

.st-faq-q[aria-expanded="true"] .st-faq-icon {
    background: var(--st-gold);
    transform: rotate(180deg);
}

.st-faq-q[aria-expanded="true"] .st-faq-icon::before,
.st-faq-q[aria-expanded="true"] .st-faq-icon::after {
    background: #FFFFFF;
}

.st-faq-q[aria-expanded="true"] .st-faq-icon::after {
    transform: rotate(0deg);
    opacity: 0;
}

.st-faq-a-inner p {
    margin: 0;
    padding: 0 1.1rem 1.1rem;
    color: var(--color-text);
    line-height: 1.6;
}

/* collapsed state (JS ready): animate the row height 0fr -> 1fr */
.st-faq.is-ready .st-faq-a {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.3s var(--st-ease), visibility 0s linear 0.3s;
}

.st-faq.is-ready .st-faq-a-inner {
    min-height: 0;
    overflow: hidden;
}

.st-faq.is-ready .st-faq-item.is-open .st-faq-a {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows 0.3s var(--st-ease), visibility 0s;
}

@media (max-width: 600px) {
    .st-faq-h {
        font-size: 1rem;
    }

    .st-faq-q {
        padding: 0.85rem 0.95rem;
    }

    .st-faq-a-inner p {
        padding: 0 0.95rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-faq.is-ready .st-faq-a,
    .st-faq-icon,
    .st-faq-icon::before,
    .st-faq-icon::after {
        transition: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .st-assistant {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 600px) {
    .st-kbd {
        display: none;
    }

    .st-quick-label {
        min-width: 0;
        width: 100%;
    }

    .st-row {
        flex-direction: column;
        gap: 0;
    }

    .st-row > .form-group + .form-group {
        margin-top: 1rem !important;
    }

    .st-exp-head {
        display: none;
    }

    .st-exp-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--st-line);
    }

    .st-exp-row .st-exp-desc {
        grid-column: 1 / -1;
    }

    .st-actions .st-report {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-card,
    .st-feature,
    .st-chip,
    .st-open,
    .st-progress > div {
        transition: none;
    }

    .st-card:hover,
    .st-feature:hover,
    .st-chip:hover {
        transform: none;
    }
}
