/* ==========================================================================
   Skylearn Design System — Mauqe
   White-label: set --brand-color on :root (injected per tenant in head_assets)
   ========================================================================== */

:root {
    /* Brand — maps to Sky palette; overridden per tenant via --brand-color */
    --brand-color: #3B82F6;
    --brand: var(--brand-color);
    --brand-hover: color-mix(in srgb, var(--brand-color) 85%, #0F172A);
    --brand-active: color-mix(in srgb, var(--brand-color) 75%, #0F172A);
    --brand-soft: color-mix(in srgb, var(--brand-color) 12%, white);
    --brand-ring: color-mix(in srgb, var(--brand-color) 25%, transparent);

    /* Sky */
    --sky: #3B82F6;
    --sky-bright: #60A5FA;
    --sky-deep: #1D4ED8;
    --sky-soft: #DBEAFE;

    /* Sun */
    --sun: #FBBF24;
    --sun-bright: #FCD34D;
    --sun-deep: #D97706;

    /* Leaf */
    --leaf: #22C55E;
    --leaf-soft: #DCFCE7;
    --leaf-deep: #16A34A;

    /* Coral */
    --coral: #F87171;
    --coral-soft: #FEE2E2;

    /* Berry */
    --berry: #A855F7;
    --berry-soft: #F3E8FF;

    /* Surfaces & ink */
    --background: #FFFFFF;
    --surface: #F8FAFC;
    --surface-sunken: #F1F5F9;
    --surface-elevated: #FFFFFF;

    --ink: #0F172A;
    --ink-muted: #475569;
    --ink-subtle: #94A3B8;
    --ink-faint: #CBD5E1;

    --outline: #E2E8F0;
    --outline-strong: #94A3B8;

    /* Semantic aliases */
    --text: var(--ink);
    --text-secondary: var(--ink-muted);
    --text-muted: var(--ink-muted);
    --text-subtle: var(--ink-subtle);
    --text-placeholder: var(--ink-faint);
    --text-inverse: #FFFFFF;
    --text-on-brand: #FFFFFF;

    --border: var(--outline);
    --border-strong: var(--outline-strong);
    --border-focus: var(--brand-color);

    --surface-page: var(--surface);
    --surface-muted: var(--surface-sunken);
    --surface-raised: var(--surface-elevated);

    --color-success: var(--leaf-deep);
    --color-success-bg: var(--leaf-soft);
    --color-info: var(--sky-deep);
    --color-info-bg: var(--sky-soft);
    --color-warning: var(--sun-deep);
    --color-warning-bg: color-mix(in srgb, var(--sun) 15%, white);
    --color-danger: #B91C1C;
    --color-danger-bg: var(--coral-soft);
    --color-purple: var(--berry);
    --color-purple-bg: var(--berry-soft);
    --color-amber: var(--sun-deep);
    --color-amber-bg: color-mix(in srgb, var(--sun) 15%, white);
    --color-blue: var(--sky-deep);
    --color-blue-bg: var(--sky-soft);

    /* Elevation */
    --shadow-card: 0 0 0 1px var(--outline), 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
    --shadow-card-hover: 0 0 0 1px color-mix(in srgb, var(--brand-color) 22%, var(--outline)), 0 12px 32px -8px rgba(15, 23, 42, 0.16);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.1);

    /* Radius */
    --radius-input: 12px;
    --radius-btn: 16px;
    --radius-card: 20px;
    --radius-modal: 28px;
    --radius-pill: 999px;

    /* Legacy radius aliases */
    --radius-sm: var(--radius-input);
    --radius-md: var(--radius-input);
    --radius-lg: var(--radius-btn);
    --radius-xl: var(--radius-card);
    --radius-2xl: var(--radius-modal);
    --radius-full: var(--radius-pill);

    /* Typography */
    --font-sans: 'Atkinson Hyperlegible', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
    --font-display: 'Nunito', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

    /* Layout */
    --nav-height: 3.5rem;
    --main-max-width: 80rem;
    --main-wide-max-width: 120rem;

    /* Motion */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 150ms var(--ease-bounce);
    --transition-base: 240ms var(--ease-bounce);
}


/* ==========================================================================
   Base & Typography
   ========================================================================== */

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

body.t-app {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 639px) {
    body.t-app {
        font-size: 1rem;
    }
}

body.t-app h1,
body.t-app h2,
body.t-app h3,
body.t-app h4 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}

body.t-app a:not(.t-btn) {
    color: var(--brand-color);
    text-decoration: none;
}

body.t-app a:not(.t-btn):hover {
    text-decoration: underline;
}

/* Anchor buttons must keep variant text colors (global link rule is more specific than .t-btn-*) */
body.t-app a.t-btn {
    text-decoration: none;
}

body.t-app a.t-btn-primary,
body.t-app a.t-btn-nav {
    color: var(--text-on-brand);
}

body.t-app a.t-btn-primary:hover:not(:disabled):not([disabled]),
body.t-app a.t-btn-nav:hover {
    color: var(--text-on-brand);
}

body.t-app a.t-btn-secondary {
    color: var(--ink-muted);
}

body.t-app a.t-btn-secondary:hover:not(:disabled):not([disabled]) {
    color: var(--ink);
}

body.t-app a.t-btn-ghost {
    color: var(--ink-muted);
}

body.t-app a.t-btn-ghost:hover:not(:disabled):not([disabled]) {
    color: var(--ink);
}

body.t-app img,
body.t-app svg {
    display: block;
    max-width: 100%;
}

body.t-app code,
body.t-app pre,
body.t-app .font-mono {
    font-family: var(--font-mono);
}

body.t-app-builder,
body.builder-mode.t-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

[dir="rtl"] body.t-app,
[dir="rtl"] .t-login-page,
[dir="rtl"] .t-share-page {
    font-family: 'IBM Plex Sans Arabic', 'Atkinson Hyperlegible', system-ui, sans-serif;
}

[dir="rtl"] body.t-app h1,
[dir="rtl"] body.t-app h2,
[dir="rtl"] body.t-app h3,
[dir="rtl"] body.t-app h4 {
    font-family: 'IBM Plex Sans Arabic', 'Nunito', system-ui, sans-serif;
}

[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
    text-align: right;
}

[dir="rtl"] .t-nav-end,
[dir="rtl"] .t-nav-start {
    flex-direction: row-reverse;
}

[dir="rtl"] .t-nav-links {
    direction: rtl;
}

[dir="rtl"] .t-lang-toggle {
    direction: ltr;
}

[dir="rtl"] .t-table th,
[dir="rtl"] .t-table td,
[dir="rtl"] .t-data-table th,
[dir="rtl"] .t-data-table td {
    text-align: right;
}

[dir="rtl"] .t-modal-header,
[dir="rtl"] .t-card-title,
[dir="rtl"] .t-page-title {
    text-align: right;
}

[dir="rtl"] #mauqe-landing .fluent-btn svg {
    transform: scaleX(-1);
}

.t-lang-toggle .t-lang-link {
    color: var(--ink-muted);
    text-decoration: none;
}

.t-lang-toggle .t-lang-link:hover {
    color: var(--brand-color, #3B82F6);
}

.t-lang-toggle .t-lang-active {
    color: var(--ink);
}

.t-text-small {
    font-size: 0.875rem;
    color: var(--ink-muted);
    line-height: 1.45;
}


/* ==========================================================================
   Navigation — Skylearn surface bar with sky pill active states
   ========================================================================== */

.t-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--background);
    color: var(--ink);
    border-bottom: 1px solid var(--outline);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.t-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: var(--main-wide-max-width);
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 4rem;
    position: relative;
}

@media (min-width: 1024px) {
    .t-nav-inner {
        padding: 0 1.25rem;
    }
}

.t-nav-start,
.t-nav-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.t-nav-start {
    flex: 1;
    min-width: 0;
}

.t-nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    position: absolute;
    top: calc(100% + 1px);
    inset-inline: 0;
    /* Sit above the header's own controls (theme/lang toggles, account chip) which
       are later DOM siblings — without this the open menu paints behind them. */
    z-index: 30;
    padding: 0.75rem 1rem 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--outline);
    box-shadow: var(--shadow-card-hover);
}

.t-nav-links.is-open {
    display: flex;
}

@media (min-width: 1024px) {
    .t-nav-links {
        display: flex;
        flex-direction: row;
        align-items: center;
        position: static;
        inset: auto;
        padding: 0;
        margin-inline-start: 0.75rem;
        border: none;
        box-shadow: none;
        background: transparent;
        gap: 0.25rem;
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .t-nav-links::-webkit-scrollbar {
        display: none;
    }
}

.t-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.75rem;
    height: 2.75rem;
    margin-inline-start: auto;
    padding: 0;
    border: 1px solid var(--outline);
    border-radius: var(--radius-btn);
    background: var(--surface);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.t-nav-toggle:hover {
    background: var(--sky-soft);
    border-color: var(--sky-bright);
}

.t-nav-toggle-bar {
    display: block;
    width: 1.125rem;
    height: 2px;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--ink);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.t-nav-toggle[aria-expanded="true"] .t-nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.t-nav-toggle[aria-expanded="true"] .t-nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.t-nav-toggle[aria-expanded="true"] .t-nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 1024px) {
    .t-nav-toggle {
        display: none;
    }
}

.t-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.125rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.t-brand:hover {
    text-decoration: none;
    color: var(--sky-deep);
}

.t-brand-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-btn);
    object-fit: contain;
    flex-shrink: 0;
}

.t-brand-text {
    letter-spacing: -0.01em;
}

.t-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-btn);
    color: var(--ink-muted);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}

.t-nav-link:hover {
    background: var(--surface-sunken);
    color: var(--ink);
    text-decoration: none;
}

.t-nav-link-active,
.t-nav-link[aria-current="page"] {
    background: var(--sky-soft);
    color: var(--sky-deep);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sky) 18%, transparent);
}

.t-nav-ghost {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-pill);
    color: var(--ink-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--outline);
    background: var(--surface);
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.t-nav-ghost:hover {
    background: var(--sky-soft);
    border-color: var(--sky-bright);
    color: var(--sky-deep);
    text-decoration: none;
}

.t-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    font-size: 0.8125rem;
    color: var(--ink-muted);
    border: 1px solid var(--outline);
}

.t-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-pill);
    background: var(--sky-soft);
    color: var(--sky-deep);
    font-size: 0.5rem;
    line-height: 1;
}

.t-user-name {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* User account dropdown: profile chip is the trigger, logout lives inside. */
.t-user-menu {
    position: relative;
    display: inline-block;
}

.t-user-chip-trigger {
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.t-user-chip-trigger::-webkit-details-marker {
    display: none;
}

.t-user-chip-trigger:hover,
.t-user-menu[open] > .t-user-chip-trigger {
    background: var(--surface-muted);
    border-color: var(--outline-strong);
    color: var(--ink);
}

.t-user-caret {
    color: var(--ink-subtle);
    transition: transform .2s ease;
}

.t-user-menu[open] > .t-user-chip-trigger .t-user-caret {
    transform: rotate(180deg);
}

.t-user-menu-panel {
    /* Fallback placement for before the JS "portal" pins it to <body>: drop it
       below the chip and above the header's other controls so it never renders
       behind the theme / language toggles. */
    position: absolute;
    top: calc(100% + 0.4rem);
    inset-inline-end: 0;
    z-index: 60;
    min-width: 13rem;
    padding: 0.35rem;
    border-radius: var(--radius-btn);
    background: var(--surface-raised);
    border: 1px solid var(--outline);
    box-shadow: var(--shadow-lg);
}

.t-user-menu-header {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.6rem 0.6rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid var(--outline);
}

.t-user-menu-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-user-menu-email {
    font-size: 0.75rem;
    color: var(--ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.t-app a.t-user-menu-item {
    display: block;
    padding: 0.5rem 0.6rem;
    border-radius: calc(var(--radius-btn) - 2px);
    font-size: 0.85rem;
    color: var(--ink);
    text-decoration: none;
}

body.t-app a.t-user-menu-item:hover {
    background: var(--surface-muted);
    text-decoration: none;
    color: var(--ink);
}

body.t-app a.t-user-menu-item-danger,
body.t-app a.t-user-menu-item-danger:hover {
    color: var(--color-danger);
    font-weight: 600;
}

body.t-app a.t-user-menu-item-danger:hover {
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
}


/* ==========================================================================
   Main Layout
   ========================================================================== */

.t-main {
    flex: 1;
    width: 100%;
    max-width: var(--main-wide-max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.t-main-wide {
    max-width: var(--main-wide-max-width);
    padding: 0.75rem 0.75rem;
}

.t-main-full {
    max-width: none;
    width: 100%;
    padding: 0;
}

@media (min-width: 1024px) {
    .t-main-wide {
        padding: 0.75rem 1.25rem;
    }
}

.t-main-builder {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: var(--main-wide-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem;
    min-height: 0;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .t-main-builder {
        padding: 0.75rem 1.25rem;
    }
}


/* ==========================================================================
   Page Headers
   ========================================================================== */

.t-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.t-page-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.t-page-subtitle {
    margin-top: 0.25rem;
    font-size: 1rem;
    color: var(--ink-muted);
    font-weight: 400;
}

.t-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.t-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-color);
}

.t-hero-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid color-mix(in srgb, var(--brand-color) 20%, var(--outline));
    border-radius: var(--radius-modal);
    background:
        radial-gradient(120% 140% at top left, var(--brand-soft), transparent 55%),
        var(--background);
    box-shadow: var(--shadow-card);
}

[dir="rtl"] .t-hero-panel {
    background:
        radial-gradient(120% 140% at top right, var(--brand-soft), transparent 55%),
        var(--background);
}

.t-hero-title {
    max-width: 44rem;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    letter-spacing: -0.04em;
}

.t-hero-copy {
    max-width: 42rem;
    margin: 0.65rem 0 0;
    color: var(--ink-muted);
    font-size: 1rem;
}

.t-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.t-card-subtitle {
    margin: 0.25rem 0 0;
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.t-stat-helper {
    margin: 0.4rem 0 0;
    color: var(--ink-muted);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.t-business-stat-grid .t-stat {
    min-height: 9rem;
}


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

.t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 48px;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base),
                color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
    white-space: nowrap;
}

.t-btn:hover {
    text-decoration: none;
}

.t-btn:active {
    transform: scale(0.98);
}

.t-btn:disabled,
.t-btn[disabled] {
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    background: var(--ink-faint);
    border-color: var(--outline-strong);
    color: var(--ink-muted);
}

.t-btn-primary:disabled,
.t-btn-primary[disabled] {
    background: var(--ink-faint);
    border-color: var(--outline-strong);
    color: var(--ink-muted);
}

.t-btn-primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand-color) 90%, white), var(--brand-color));
    color: var(--text-on-brand);
    border-color: var(--brand-color);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -6px var(--brand-ring);
}

.t-btn-primary:hover:not(:disabled):not([disabled]) {
    background: linear-gradient(180deg, var(--brand-color), var(--brand-hover));
    border-color: var(--brand-hover);
    color: var(--text-on-brand);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.14), 0 10px 24px -6px var(--brand-ring);
    transform: translateY(-1px);
}

.t-btn-primary:active:not(:disabled):not([disabled]) {
    background: var(--brand-active);
    border-color: var(--brand-active);
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.t-btn-lg {
    min-height: 56px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .t-btn-lg {
        min-height: 64px;
        padding: 0.875rem 1.75rem;
        font-size: 1.0625rem;
    }
}

.t-btn-secondary {
    background: var(--background);
    color: var(--ink-muted);
    border-color: var(--outline-strong);
}

.t-btn-secondary:hover:not(:disabled):not([disabled]) {
    background: var(--surface-sunken);
    border-color: var(--outline);
    color: var(--ink);
}

/* Toolbar icon (vendored SVG as a currentColor mask) + group separator */
.t-btn-ico {
    width: 16px;
    height: 16px;
    flex: none;
    background-color: currentColor;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.t-bar-sep {
    width: 1px;
    align-self: center;
    height: 1.6rem;
    background: var(--outline, #e2e8f0);
    margin: 0 2px;
}

/* Standout Publish button — draft (filled gradient) → live (calm green) */
.t-btn-publish {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-color, #3B82F6), #6366F1);
    box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand-color, #3B82F6) 70%, transparent);
    transition: filter .15s, box-shadow .15s, transform .05s;
}
.t-btn-publish:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--brand-color, #3B82F6) 80%, transparent);
}
.t-btn-publish:active { transform: translateY(1px); }
.t-publish-icon { width: 16px; height: 16px; flex: none; }
.t-publish-live-dot {
    width: 8px; height: 8px; border-radius: 999px; flex: none; display: none;
    background: #34D399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .25);
}
/* live state */
.t-btn-publish.is-live {
    background: #fff;
    color: var(--leaf-deep, #15803D);
    border: 1.5px solid #A7F3D0;
    box-shadow: none;
}
.t-btn-publish.is-live:hover:not(:disabled) { background: #ECFDF5; filter: none; }
.t-btn-publish.is-live .t-publish-live-dot { display: inline-block; }
.t-btn-publish.is-live .t-publish-icon { display: none; }
/* label swap (toolbar button has both labels) */
.t-publish-label-live { display: none; }
.t-btn-publish.is-live .t-publish-label-draft { display: none; }
.t-btn-publish.is-live .t-publish-label-live { display: inline; }

.t-btn-ghost {
    background: transparent;
    color: var(--ink-muted);
    border-color: transparent;
}

.t-btn-ghost:hover:not(:disabled):not([disabled]) {
    background: var(--surface-sunken);
    color: var(--ink);
}

.t-btn-sm {
    min-height: 40px;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-btn);
}

.t-btn-link {
    min-height: auto;
    padding: 0;
    background: none;
    border: none;
    color: var(--brand-color);
    font-weight: 600;
}

.t-btn-link:hover {
    text-decoration: underline;
    background: none;
}

.t-btn-link-danger {
    min-height: auto;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-danger);
    font-weight: 600;
}

.t-btn-link-danger:hover:not(:disabled):not([disabled]) {
    text-decoration: underline;
    background: none;
    color: color-mix(in srgb, var(--color-danger) 80%, #000);
}

.t-btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--color-danger) 22%, transparent);
    border-radius: var(--radius-btn);
    background: transparent;
    color: var(--color-danger);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.t-btn-icon-danger:hover:not(:disabled):not([disabled]) {
    background: var(--color-danger-bg);
    border-color: color-mix(in srgb, var(--color-danger) 35%, transparent);
    color: color-mix(in srgb, var(--color-danger) 85%, #000);
}

.t-table-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.t-table-actions form {
    display: inline-flex;
    margin: 0;
}

/* Row actions rendered as compact, tactile chip buttons */
body.t-app .t-table-actions .t-btn-link,
body.t-app .t-table-actions .t-btn-link-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 32px;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-btn);
    background: var(--surface-elevated);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

body.t-app .t-table-actions .t-btn-link {
    color: var(--ink-muted);
}

body.t-app .t-table-actions .t-btn-link:hover {
    color: var(--brand-color);
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand-color) 40%, var(--outline));
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

body.t-app .t-table-actions .t-btn-link-danger {
    color: var(--color-danger);
}

body.t-app .t-table-actions .t-btn-link-danger:hover:not(:disabled):not([disabled]) {
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border-color: color-mix(in srgb, var(--color-danger) 40%, var(--outline));
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.t-btn-nav {
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    background: var(--brand-color);
    color: var(--text-on-brand);
    border-color: transparent;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-color) 35%, transparent);
}

.t-btn-nav:hover {
    background: var(--brand-hover);
    color: var(--text-on-brand);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-color) 40%, transparent);
}


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

.t-card {
    background: var(--background);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

.t-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.t-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--outline);
    font-weight: 600;
    font-size: 0.9375rem;
}

.t-card-body {
    padding: 1rem 1.25rem;
}

.t-card-title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.t-lesson-card {
    border-radius: var(--radius-card);
}

.t-lesson-card.is-active,
.t-grid-card.is-active {
    border: 3px solid var(--brand-color);
    box-shadow: var(--shadow-card-hover);
}

/* Legacy Tailwind card upgrade */
body.t-app main .bg-white.rounded-xl.shadow {
    background: var(--background) !important;
    border: 1px solid var(--outline) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-card) !important;
    transition: box-shadow var(--transition-base);
}

body.t-app main .bg-white.rounded-xl.shadow:hover {
    box-shadow: var(--shadow-card-hover) !important;
}


/* ==========================================================================
   Stats
   ========================================================================== */

.t-stat-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .t-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .t-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.t-stat {
    background: var(--background);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    border-inline-end-width: 4px;
    border-inline-end-style: solid;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.t-stat:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.t-stat-label {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.t-stat-value {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.1;
}

/* Skylearn stat variants */
.t-stat--sky,
.t-stat-brand,
.t-stat-info,
.t-stat-blue {
    border-inline-end-color: var(--sky);
}

.t-stat--sky .t-stat-value,
.t-stat-brand .t-stat-value,
.t-stat-info .t-stat-value,
.t-stat-blue .t-stat-value {
    color: var(--sky-deep);
}

.t-stat--leaf,
.t-stat-success {
    border-inline-end-color: var(--leaf);
}

.t-stat--leaf .t-stat-value,
.t-stat-success .t-stat-value {
    color: var(--leaf-deep);
}

.t-stat--sun,
.t-stat-warning,
.t-stat-amber {
    border-inline-end-color: var(--sun);
}

.t-stat--sun .t-stat-value,
.t-stat-warning .t-stat-value,
.t-stat-amber .t-stat-value {
    color: var(--sun-deep);
}

.t-stat--berry,
.t-stat-purple {
    border-inline-end-color: var(--berry);
}

.t-stat--berry .t-stat-value,
.t-stat-purple .t-stat-value {
    color: var(--berry);
}

.t-stat--coral {
    border-inline-end-color: var(--coral);
}

.t-stat--coral .t-stat-value {
    color: #DC2626;
}


/* ==========================================================================
   Tables
   ========================================================================== */

.t-table-wrap {
    background: var(--background);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.t-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.t-table thead {
    background: var(--surface-sunken);
}

.t-table th {
    padding: 0.75rem 1rem;
    text-align: inherit;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-subtle);
    border-bottom: 1px solid var(--outline);
}

.t-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--outline);
    color: var(--ink-muted);
    vertical-align: middle;
}

.t-table tbody tr:last-child td {
    border-bottom: none;
}

.t-table tbody tr:hover {
    background: var(--surface);
}

.t-table-title {
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

.t-table-meta {
    font-size: 0.8125rem;
    color: var(--ink-subtle);
    margin: 0.125rem 0 0;
}

.t-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--outline);
    background: var(--surface);
}

.t-table-toolbar-start {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.t-table-toolbar-grid {
    margin-bottom: 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
}

.t-table-search {
    min-width: min(100%, 14rem);
    max-width: 20rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.t-table-col-filter,
.t-grid-sort {
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    max-width: 12rem;
}

.t-table-count {
    color: var(--ink-subtle);
    white-space: nowrap;
}

.t-table-sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.t-table-sortable:hover {
    color: var(--ink);
    background: color-mix(in srgb, var(--sky-soft) 50%, transparent);
}

.t-table-sortable::after {
    content: '↕';
    display: inline-block;
    margin-inline-start: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.35;
}

.t-table-sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--sky-deep);
}

.t-table-sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--sky-deep);
}

.t-table-row-hidden {
    display: none !important;
}

[data-enhance-grid] .t-table-row-hidden {
    display: none !important;
}


/* ==========================================================================
   Badges
   ========================================================================== */

.t-badge,
[class*="t-badge-"] {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.t-badge-success {
    background: var(--leaf-soft);
    color: var(--leaf-deep);
}

.t-badge-muted {
    background: var(--surface-sunken);
    color: var(--ink-muted);
}

.t-badge-info {
    background: var(--sky-soft);
    color: var(--sky-deep);
}

.t-badge-purple {
    background: var(--berry-soft);
    color: #7E22CE;
}

.t-badge-sun {
    background: color-mix(in srgb, var(--sun) 18%, white);
    color: var(--sun-deep);
}


/* ==========================================================================
   Inputs & Forms
   ========================================================================== */

.t-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 0.375rem;
}

.t-input,
body.t-app input[type="text"]:not([class*="border-0"]),
body.t-app input[type="email"]:not([class*="border-0"]),
body.t-app input[type="password"]:not([class*="border-0"]),
body.t-app input[type="number"]:not([class*="border-0"]),
body.t-app input[type="tel"]:not([class*="border-0"]),
body.t-app input[type="url"]:not([class*="border-0"]),
body.t-app input[type="date"]:not([class*="border-0"]),
body.t-app input[type="time"]:not([class*="border-0"]),
body.t-app input[type="datetime-local"]:not([class*="border-0"]),
body.t-app input[type="search"]:not([class*="border-0"]),
body.t-app select:not([class*="border-0"]),
body.t-app textarea:not([class*="border-0"]) {
    width: 100%;
    min-height: 48px;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius-input);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--background);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.t-input:focus,
body.t-app input:focus:not([class*="border-0"]),
body.t-app select:focus:not([class*="border-0"]),
body.t-app textarea:focus:not([class*="border-0"]) {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.t-input::placeholder,
body.t-app input::placeholder,
body.t-app textarea::placeholder {
    color: var(--ink-faint);
    opacity: 1;
}

.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 0.375rem;
}

.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]):not([type="range"]),
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-input);
    font-family: inherit;
    font-size: 1.125rem;
    color: var(--ink);
    background: var(--background);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.form-field .text-sm {
    font-size: 0.8125rem;
}

.form-field input.form-calculated {
    background: var(--sky-soft);
    border-color: var(--sky-mid);
    color: var(--sky-deep);
    font-weight: 600;
    cursor: default;
}

.form-field input.form-calculated[data-calculated-manual="1"] {
    cursor: text;
}

.form-field input.form-calculated-updated {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* QR code generator element */
.form-qr-generator {
    display: flex;
    justify-content: center;
}
.form-qr-generator img.form-qr-image {
    image-rendering: pixelated;
    max-width: 100%;
    height: auto;
}

/* Editable data grid element */
.form-data-grid-scroll {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}
.form-data-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.form-data-grid-table th {
    text-align: start;
    font-weight: 600;
    font-size: 0.75rem;
    color: #64748b;
    padding: 0.5rem 0.625rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.form-data-grid-table td {
    padding: 0.25rem 0.375rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.form-data-grid-table tbody tr:last-child td {
    border-bottom: 0;
}
.form-data-grid-input {
    width: 100%;
    min-width: 6rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    background: transparent;
}
.form-data-grid-input:hover {
    border-color: #e2e8f0;
}
.form-data-grid-input:focus {
    outline: none;
    border-color: #38bdf8;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
.form-data-grid-check {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #0284c7;
}
.form-data-grid-actions {
    width: 2rem;
    text-align: center;
}
.form-data-grid-del {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    border-radius: 0.375rem;
}
.form-data-grid-del:hover {
    color: #ef4444;
    background: #fef2f2;
}
.form-data-grid-add {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0284c7;
    padding: 0.375rem 0.75rem;
    border: 1px dashed #bae6fd;
    border-radius: 0.5rem;
    background: #f0f9ff;
}
.form-data-grid-add:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}
.form-data-grid-readonly td {
    color: #334155;
    padding: 0.375rem 0.625rem;
}

/* QR code scanner element */
.form-qr-scanner .form-qr-scanner-btn {
    white-space: nowrap;
}

/* Camera scan modal overlay */
.form-qr-scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    padding: 1rem;
}
.form-qr-scan-modal {
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.75rem;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.form-qr-scan-video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.5rem;
    background: #000;
}
.form-qr-scan-actions {
    display: flex;
    justify-content: flex-end;
}

/* Read-only submission rendered inside the original form layout (e.g. the
   approvals task view). Strips default fieldset chrome and keeps disabled
   fields fully legible instead of the browser's grayed-out look. */
.t-readonly-form {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.t-readonly-form input,
.t-readonly-form select,
.t-readonly-form textarea {
    opacity: 1 !important;
    color: var(--ink) !important;
    background: var(--surface-sunken) !important;
    cursor: default;
}


/* ==========================================================================
   Lists & Action Tiles
   ========================================================================== */

.t-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--outline);
}

.t-list-item:last-child {
    border-bottom: none;
}

.t-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.t-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 56px;
    padding: 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    color: var(--ink-muted);
    text-decoration: none;
    text-align: center;
    transition: background var(--transition-base), border-color var(--transition-base),
                box-shadow var(--transition-base), transform var(--transition-base);
}

.t-action-tile:hover {
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand-color) 35%, var(--outline));
    box-shadow: var(--shadow-card-hover);
    text-decoration: none;
    color: var(--ink);
    transform: translateY(-2px);
}

.t-action-tile-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.t-action-tile-label {
    font-size: 0.8125rem;
    font-weight: 600;
}

.t-guided-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(14rem, 0.8fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.t-guided-intro-title {
    font-size: 1rem;
    font-weight: 800;
}

.t-guided-intro-copy {
    margin: 0.35rem 0 0;
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.t-step-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: guided-step;
}

.t-step-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-muted);
    font-size: 0.8125rem;
}

.t-step-list li::before {
    counter-increment: guided-step;
    content: counter(guided-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    color: var(--brand-color);
    font-weight: 800;
    flex: 0 0 auto;
}

.t-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.t-choice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-height: 10rem;
    padding: 1.25rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

button.t-choice-card {
    width: 100%;
    font: inherit;
    cursor: pointer;
}

.t-choice-card:hover {
    border-color: color-mix(in srgb, var(--brand-color) 40%, var(--outline));
    box-shadow: var(--shadow-card-hover);
    text-decoration: none;
    transform: translateY(-2px);
}

.t-choice-card-primary {
    border-color: color-mix(in srgb, var(--brand-color) 45%, var(--outline));
    background: linear-gradient(180deg, var(--brand-soft), var(--background));
}

.t-choice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-input);
    background: var(--surface-sunken);
    color: var(--brand-color);
    font-size: 0.8125rem;
    font-weight: 800;
}

.t-choice-title {
    font-weight: 800;
    color: var(--ink);
}

.t-choice-desc {
    color: var(--ink-muted);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* ---- Data connector picker (modal) ---------------------------------- */
.t-connector-group + .t-connector-group {
    margin-top: 1.5rem;
}

.t-connector-group__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.6rem;
}

.t-connector-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.t-connector-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    color: inherit;
    text-align: start;
    font: inherit;
    cursor: pointer;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.t-connector-card:hover {
    border-color: color-mix(in srgb, var(--brand-color) 45%, var(--outline));
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.t-connector-card__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-input);
    background: var(--surface-sunken);
    font-size: 1.35rem;
    line-height: 1;
}

.t-connector-card__text {
    min-width: 0;
}

.t-connector-card__name {
    font-weight: 700;
    color: var(--ink);
    display: block;
}

.t-connector-card__desc {
    color: var(--ink-muted);
    font-size: 0.8125rem;
    line-height: 1.35;
    display: block;
    margin-top: 0.15rem;
}

.t-connector-search-wrap {
    margin-bottom: 1.25rem;
}

/* Setup step header inside the modal / editor page */
.t-connector-setup-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.t-connector-setup-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-input);
    background: var(--surface-sunken);
    font-size: 1.6rem;
    line-height: 1;
}

.t-connector-setup-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
}

.t-connector-setup-blurb {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin-top: 0.15rem;
}

@media (max-width: 768px) {
    .t-connector-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

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

/* File picker drop zone */
.t-file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1.75rem 1rem;
    border: 1.5px dashed var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface-sunken);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-base), background var(--transition-base);
}

.t-file-drop:hover {
    border-color: color-mix(in srgb, var(--brand-color) 50%, var(--outline));
    background: color-mix(in srgb, var(--brand-color) 6%, var(--surface-sunken));
}

.t-file-drop__icon {
    font-size: 1.75rem;
    line-height: 1;
}

.t-connector-card__icon img,
.t-connector-setup-icon img,
.t-file-drop__icon img {
    display: block;
}

.t-connector-list-icon {
    width: 1.1rem;
    height: 1.1rem;
    vertical-align: -0.2rem;
    margin-inline-end: 0.4rem;
}

.t-file-drop__main {
    font-weight: 700;
    color: var(--ink);
}

.t-file-drop__hint {
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.t-choice-badge {
    position: absolute;
    top: 0.85rem;
    inset-inline-end: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--brand-color);
    color: var(--text-on-brand);
    font-size: 0.6875rem;
    font-weight: 800;
}

.t-template-hero {
    margin-bottom: 1.25rem;
}

.t-template-hero-header .t-page-subtitle {
    margin-top: 0.35rem;
    color: var(--ink-muted);
    font-size: 0.9375rem;
    max-width: 42rem;
}

.t-template-gallery {
    padding: 1.25rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: color-mix(in srgb, var(--surface-sunken) 55%, var(--background));
}

.t-template-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.t-template-search-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: none;
}

.t-template-search-icon {
    position: absolute;
    inset-inline-start: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--ink-muted);
    pointer-events: none;
}

.t-template-search {
    width: 100%;
    padding-inline-start: 2.5rem;
    min-height: 2.75rem;
    border-color: var(--outline);
    background: var(--background);
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent);
}

.t-template-search:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Category tabs (picker + marketplace filter) */
.t-cat-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.t-cat-tabs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.t-cat-tabs--filter .t-cat-tabs__list,
.t-cat-tabs--inline .t-cat-tabs__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    gap: 0.75rem 1.25rem;
    padding-bottom: 0.15rem;
}

.t-cat-tabs__tab {
    display: inline-flex;
    align-items: center;
    min-height: 2.125rem;
    padding: 0.35rem 0.15rem;
    border: none;
    border-radius: var(--radius-input);
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

.t-cat-tabs--filter .t-cat-tabs__tab,
.t-marketplace-type-tabs .t-cat-tabs__tab,
.t-cat-tabs:not(.t-cat-tabs--inline) .t-cat-tabs__tab {
    padding: 0.45rem 1rem;
}

.t-cat-tabs__tab:hover {
    color: var(--ink);
}

.t-cat-tabs--filter .t-cat-tabs__tab:hover,
.t-marketplace-type-tabs .t-cat-tabs__tab:hover {
    background: transparent;
}

.t-cat-tabs__tab--active {
    background: var(--brand-color);
    color: var(--text-on-brand);
    font-weight: 700;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-color) 35%, transparent);
}

.t-cat-tabs--filter .t-cat-tabs__tab--active:hover,
.t-marketplace-type-tabs .t-cat-tabs__tab--active:hover {
    color: var(--text-on-brand);
}

.t-cat-tabs__panels {
    min-height: 0;
}

.t-cat-tabs__panel {
    display: none;
    padding: 0.85rem 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-input);
    background: var(--background);
}

.t-cat-tabs__panel--active {
    display: block;
}

.t-cat-tabs__panel-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-muted);
}

.t-cat-tabs--filter .t-cat-tabs__panel-text {
    padding: 0 0.125rem;
    border: none;
    background: transparent;
}

.t-category-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0;
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.t-template-card-pages-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.t-template-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
    /* Size rows to card content. Without this, a fixed-height grid (e.g. the
       app-create modal) stretches auto rows to fill, squashing each card and
       clipping its tags + action buttons under overflow:hidden. */
    grid-auto-rows: max-content;
}

@media (min-width: 640px) {
    .t-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.t-template-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.t-template-card:hover {
    border-color: color-mix(in srgb, var(--brand-color) 28%, var(--outline));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 8%, transparent);
    transform: translateY(-2px);
}

.t-template-card-featured {
    border-color: color-mix(in srgb, #f59e0b 35%, var(--outline));
}

.t-template-card-accent {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0;
    height: 6.75rem;
    padding: 0.65rem 0.75rem 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface-sunken) 70%, var(--background));
}

.t-template-card-accent[data-category="hr"] {
    background: linear-gradient(180deg, #eff6ff 0%, color-mix(in srgb, var(--surface-sunken) 70%, var(--background)) 100%);
}

.t-template-card-accent[data-category="finance"] {
    background: linear-gradient(180deg, #ecfdf5 0%, color-mix(in srgb, var(--surface-sunken) 70%, var(--background)) 100%);
}

.t-template-card-accent[data-category="construction"],
.t-template-card-accent[data-category="safety"] {
    background: linear-gradient(180deg, #fff7ed 0%, color-mix(in srgb, var(--surface-sunken) 70%, var(--background)) 100%);
}

.t-template-card-accent[data-category="sales"],
.t-template-card-accent[data-category="customer-service"] {
    background: linear-gradient(180deg, #fdf4ff 0%, color-mix(in srgb, var(--surface-sunken) 70%, var(--background)) 100%);
}

.t-template-card-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.t-template-card-preview__frame {
    width: 72%;
    max-width: 9.5rem;
    height: 4.75rem;
    padding: 0.45rem;
    border-radius: 0.55rem 0.55rem 0 0;
    background: var(--background);
    box-shadow: 0 -2px 12px color-mix(in srgb, var(--ink) 6%, transparent), 0 8px 20px color-mix(in srgb, var(--ink) 10%, transparent);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: hidden;
}

.t-template-card-preview__bar {
    display: block;
    height: 0.45rem;
    width: 42%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-color) 75%, #fff);
}

.t-template-card-preview__bar--sm {
    width: 55%;
    height: 0.35rem;
}

.t-template-card-preview__hero {
    display: block;
    height: 1.65rem;
    flex-shrink: 0;
    border-radius: 0.35rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-color) 18%, #fff), color-mix(in srgb, var(--brand-color) 8%, var(--surface-sunken)));
}

.t-template-card-preview__line {
    display: block;
    height: 0.3rem;
    width: 100%;
    border-radius: 999px;
    background: var(--surface-sunken);
}

.t-template-card-preview__line--short {
    width: 68%;
}

.t-template-card-preview__split {
    display: grid;
    grid-template-columns: 0.85fr 1.65fr;
    gap: 0.3rem;
    height: 2.35rem;
    flex-shrink: 0;
}

.t-template-card-preview__side {
    border-radius: 0.35rem;
    background: color-mix(in srgb, var(--brand-color) 12%, var(--surface-sunken));
}

.t-template-card-preview__main {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.t-template-card-preview__dash {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0.3rem;
    height: 2.35rem;
    flex-shrink: 0;
}

.t-template-card-preview__chart {
    border-radius: 0.35rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand-color) 22%, #fff), color-mix(in srgb, var(--brand-color) 8%, var(--surface-sunken)));
}

.t-template-card-preview__stats {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.t-template-card-preview__stat {
    flex: 1;
    border-radius: 0.3rem;
    background: var(--surface-sunken);
}

.t-template-card-preview__field {
    display: block;
    height: 0.55rem;
    border-radius: 0.25rem;
    background: var(--surface-sunken);
}

.t-template-card-preview__btn {
    display: block;
    width: 42%;
    height: 0.55rem;
    margin-top: 0.1rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-color) 70%, #fff);
}

.t-template-card-category {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--ink) 55%, transparent);
}

.t-template-card-featured-badge {
    position: absolute;
    top: 0.65rem;
    inset-inline-end: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.9);
    color: #b45309;
    font-size: 0.6875rem;
    font-weight: 800;
}

.t-template-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.85rem 1rem 1rem;
    flex: 1;
    min-height: 0;
}

.t-template-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.125rem;
}

.t-template-card-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(2 * 1.35 * 0.9375rem);
}

.t-template-card-desc {
    color: var(--ink-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(2 * 1.45 * 0.8125rem);
}

.t-template-card-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.t-template-page-pill {
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    font-size: 0.6875rem;
    font-weight: 700;
}

.t-template-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid var(--outline);
}

.t-template-installs {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.t-template-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-inline-start: auto;
}

.t-template-delete-btn {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.t-template-delete-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.t-template-edit-details summary {
    list-style: none;
}

.t-template-edit-details summary::-webkit-details-marker {
    display: none;
}

.t-template-empty {
    grid-column: 1 / -1;
}

/* Sidebar category layout (create app modal) */
.t-template-gallery--sidebar {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.t-template-sidebar {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 11.5rem;
    padding: 0.75rem 0.75rem 0.75rem 0;
    border-inline-end: 1px solid var(--outline);
    overflow-y: auto;
}

.t-template-sidebar__label {
    margin: 0 0 0.65rem;
    padding: 0 0.65rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.t-cat-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.t-cat-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.375rem;
    padding: 0.45rem 0.75rem;
    border: none;
    border-radius: var(--radius-input);
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}

.t-cat-sidebar__item:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.t-cat-sidebar__item--active {
    background: var(--brand-color);
    color: var(--text-on-brand);
    font-weight: 700;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-color) 30%, transparent);
}

.t-cat-sidebar__item--active:hover {
    color: var(--text-on-brand);
}

.t-cat-sidebar__icon {
    flex-shrink: 0;
    width: 1.25rem;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
}

.t-cat-sidebar__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-cat-sidebar__desc {
    margin: 0.75rem 0 0;
    padding: 0 0.65rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--ink-muted);
}

@media (max-width: 720px) {
    .t-template-gallery--sidebar {
        flex-direction: column;
    }

    .t-template-sidebar {
        width: 100%;
        padding: 0 0 0.75rem;
        border-inline-end: none;
        border-bottom: 1px solid var(--outline);
    }

    .t-cat-sidebar__list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
        padding-bottom: 0.15rem;
    }

    .t-cat-sidebar__item {
        width: auto;
        flex-shrink: 0;
    }

    .t-template-main {
        padding: 0.75rem 0 0;
    }

    .Mauqe-modal-panel--app-create {
        height: min(820px, 96vh);
    }

    .t-template-browser-modal--sidebar .t-template-grid {
        grid-template-columns: 1fr;
    }
}

.t-template-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0 0 0 1rem;
}

.t-template-browser-modal .t-template-gallery {
    padding: 0;
    border: none;
    background: transparent;
}

.t-template-browser-modal .t-template-toolbar {
    margin-bottom: 0.75rem;
}

.t-template-browser-modal--sidebar {
    display: flex;
    flex: 1;
    min-height: 0;
}

.t-template-browser-modal--sidebar .t-template-gallery--sidebar {
    width: 100%;
}

.t-template-browser-modal--sidebar .t-template-grid {
    max-height: none;
    flex: 1;
    overflow-y: auto;
    padding-inline-end: 0.25rem;
    grid-template-columns: repeat(2, minmax(11.5rem, 1fr));
}

@media (min-width: 1280px) {
    .t-template-browser-modal--sidebar .t-template-grid {
        grid-template-columns: repeat(3, minmax(11.5rem, 1fr));
    }
}

.t-template-browser-modal:not(.t-template-browser-modal--sidebar) .t-template-grid {
    max-height: 22rem;
    overflow-y: auto;
    padding-inline-end: 0.15rem;
}

/* Admin edit panel expands card — keep preview/body sizing stable */
.t-template-card .t-template-edit-details {
    margin-top: 0.25rem;
}

.t-template-preview-pages {
    padding: 0.85rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface-sunken);
}

.t-template-preview-page-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-input);
    background: var(--background);
    border: 1px solid var(--outline);
}

.t-template-preview-page-kind {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-color);
}

.t-template-preview-page-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ink);
}

.t-guidance-card,
.t-advanced-details {
    padding: 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.t-advanced-details summary {
    cursor: pointer;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.875rem;
}

@media (max-width: 767px) {
    .t-guided-intro,
    .t-choice-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   Grid Cards
   ========================================================================== */

.t-grid-cards {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .t-grid-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .t-grid-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.t-grid-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--background);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    color: inherit;
    text-decoration: none;
    transition: box-shadow var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

.t-grid-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: color-mix(in srgb, var(--brand-color) 30%, var(--outline));
    text-decoration: none;
    transform: translateY(-3px);
}

.t-grid-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--ink);
}

.t-grid-card-desc {
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.t-grid-card-meta {
    font-size: 0.8125rem;
    color: var(--ink-subtle);
    margin: 0.25rem 0 0.75rem;
}

.t-grid-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}


/* ==========================================================================
   Filter Pills
   ========================================================================== */

.t-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.t-filter-pill {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius-pill);
    background: var(--background);
    color: var(--ink-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.t-filter-pill:hover {
    background: var(--surface-sunken);
    color: var(--ink);
    text-decoration: none;
}

.t-filter-pill-active {
    background: var(--sky-soft);
    border-color: var(--brand-color);
    color: var(--sky-deep);
    font-weight: 700;
}


/* ==========================================================================
   Empty States & Alerts
   ========================================================================== */

.t-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.9375rem;
}

.t-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.t-empty-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 0.25rem;
}

/* Illustrated empty state with an optional primary action */
.t-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(2rem, 5vw, 3.25rem) 1.5rem;
    gap: 0.3rem;
}
.t-empty-illus {
    width: 92px;
    height: 92px;
    margin-bottom: 0.85rem;
    color: var(--brand-color);
}
.t-empty-illus svg { width: 100%; height: 100%; display: block; }
.t-empty-heading {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--ink);
    text-wrap: balance;
}
.t-empty-text {
    margin: 0.15rem 0 0;
    max-width: 34ch;
    color: var(--ink-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.t-empty-action { margin-top: 1.1rem; }

.t-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-btn);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.t-alert-error {
    background: var(--coral-soft);
    color: #9A3412;
    border: 1px solid color-mix(in srgb, var(--coral) 45%, white);
}

.t-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.t-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}

[dir="rtl"] .t-toast-stack {
    right: auto;
    left: 1rem;
}

.t-toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.75rem;
    padding: 0.875rem 0.95rem;
    border-radius: var(--radius-btn);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    font-size: 0.875rem;
    line-height: 1.45;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity var(--transition-base), transform var(--transition-base);
    backdrop-filter: blur(14px);
}

[dir="rtl"] .t-toast {
    transform: translateX(-1rem);
}

.t-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.t-toast-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
}

.t-toast-success .t-toast-icon {
    background: #dcfce7;
    color: #15803d;
}

.t-toast-error .t-toast-icon {
    background: var(--coral-soft);
    color: #b91c1c;
}

.t-toast-info .t-toast-icon {
    background: var(--sky-soft);
    color: var(--sky-deep);
}

.t-toast-close {
    color: var(--ink-subtle);
    font-size: 1.2rem;
    line-height: 1;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.t-toast-close:hover {
    color: var(--ink);
}

@media (max-width: 640px) {
    .t-toast-stack {
        top: auto;
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        width: auto;
    }

    [dir="rtl"] .t-toast-stack {
        right: 1rem;
        left: 1rem;
    }
}


/* ==========================================================================
   Progress Bar
   ========================================================================== */

.t-progress {
    width: 100%;
}

.t-progress-track {
    width: 100%;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--sky-soft);
    overflow: hidden;
}

.t-progress-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--leaf);
    transition: width var(--transition-base);
}


/* ==========================================================================
   Tag Pills
   ========================================================================== */

.t-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.t-tag-pill--sky {
    background: var(--sky-soft);
    color: var(--sky-deep);
}

.t-tag-pill--sun {
    background: color-mix(in srgb, var(--sun) 18%, white);
    color: var(--sun-deep);
}

.t-tag-pill--leaf {
    background: var(--leaf-soft);
    color: var(--leaf-deep);
}

.t-tag-pill--berry {
    background: var(--berry-soft);
    color: #7E22CE;
}


/* ==========================================================================
   Login Page
   ========================================================================== */

.t-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--sky-deep) 0%, var(--brand-color) 45%, var(--sky-bright) 100%);
    font-family: var(--font-sans);
}

.t-login-card {
    width: 100%;
    max-width: 28rem;
    background: var(--background);
    border-radius: var(--radius-modal);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
}

.t-login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.t-login-logo-img {
    display: block;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}

.t-login-title,
.t-login-card h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-color);
    text-align: center;
    margin: 0;
}

.t-login-tagline,
.t-login-card .t-login-tagline {
    text-align: center;
    color: var(--ink-muted);
    margin-top: 0.25rem;
    font-size: 0.9375rem;
}

.t-login-demo {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--outline);
}

.t-login-demo-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.t-demo-account,
.demo-account {
    display: block;
    width: 100%;
    text-align: start;
    padding: 0.375rem 0.5rem;
    border: none;
    border-radius: var(--radius-input);
    background: transparent;
    color: var(--ink-muted);
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}

.t-demo-account:hover,
.demo-account:hover {
    background: var(--brand-soft);
    color: var(--brand-color);
}


/* ==========================================================================
   Public Share
   ========================================================================== */

.t-share-page {
    min-height: 100vh;
    background: var(--surface);
    padding: 2rem 1rem;
    font-family: var(--font-sans);
}

.t-share-page.t-share-iframe {
    padding: 1rem;
}

/* Default (non-customized) public form: a branded, premium first impression */
.t-share-page:not(.t-share-designed) {
    background:
        radial-gradient(125% 80% at 50% -10%, var(--brand-soft), transparent 55%),
        var(--surface);
}

.t-share-card {
    max-width: 42rem;
    margin: 0 auto;
    background: var(--background);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.t-share-page:not(.t-share-designed) .t-share-card {
    border-radius: var(--radius-modal);
    box-shadow: var(--shadow-lg);
}

.t-share-card-header {
    padding: 1.25rem 1.5rem 0.5rem;
}

.t-share-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-color);
}

.t-share-tabs {
    display: flex;
    border-bottom: 1px solid var(--outline);
    padding: 0 1rem;
}

.share-tab,
.t-share-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-muted);
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.share-tab:hover,
.t-share-tab:hover {
    color: var(--ink);
}

.share-tab-active,
.t-share-tab-active {
    color: var(--brand-color);
    border-bottom-color: var(--brand-color);
    background: var(--sky-soft);
}

.t-share-panel {
    padding: 1.5rem;
}

.t-share-submit {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 1rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: var(--radius-btn);
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand-color) 90%, white), var(--brand-color));
    color: var(--text-on-brand);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -6px var(--brand-ring);
    transition: background var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.t-share-submit:hover {
    background: linear-gradient(180deg, var(--brand-color), var(--brand-hover));
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.14), 0 10px 24px -6px var(--brand-ring);
    transform: translateY(-1px);
}

.t-share-submit:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

/* Share page designer — per-form public page theming */
.t-share-page.t-share-designed .t-share-shell {
    width: 100%;
    margin-inline: auto;
    padding-inline: 1rem;
}

.t-share-page.t-share-designed .t-share-card {
    max-width: none;
    width: 100%;
}

.t-share-page.t-share-designed.t-share-w-narrow .t-share-shell { max-width: 28rem; }
.t-share-page.t-share-designed.t-share-w-medium .t-share-shell { max-width: 42rem; }
.t-share-page.t-share-designed.t-share-w-wide .t-share-shell { max-width: 72rem; }

.t-share-page.t-share-designed:not(.t-share-w-full) {
    margin-inline: auto;
    padding-left: 0;
    padding-right: 0;
}

.t-share-page.t-share-designed.t-share-w-full:not(.t-share-iframe) {
    padding: 0;
}

.t-share-page.t-share-designed.t-share-w-full.t-share-iframe {
    padding-left: 0;
    padding-right: 0;
}

.t-share-page.t-share-designed.t-share-w-full .t-share-shell {
    max-width: none;
    padding-inline: 0;
}

.t-share-page.t-share-designed.t-share-w-full:not(.t-share-iframe) .t-share-shell {
    min-height: 100vh;
}

.t-share-page.t-share-designed.t-share-w-full .t-showcase-panel {
    padding: 0;
}

.t-share-page.t-share-designed.t-share-w-full .t-share-card {
    min-height: inherit;
    border-left: none;
    border-right: none;
}

.t-share-page.t-share-iframe.t-share-designed.t-share-w-full .t-share-shell {
    min-height: 100%;
}

/* Legacy width helpers (preview / fallback) */
.t-share-w-narrow { max-width: 28rem; }
.t-share-w-medium { max-width: 42rem; }
.t-share-w-wide { max-width: 72rem; }
.t-share-w-full { max-width: none; width: 100%; }

.t-share-designed .t-share-logo {
    height: var(--share-logo-h, 40px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.t-share-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.t-share-header-centered .t-share-header-brand,
.t-share-header-banner .t-share-header-brand {
    justify-content: center;
}

.t-share-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-color);
    line-height: 1.2;
}

.t-share-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 0.5rem;
}

.t-share-header-centered {
    flex-direction: column;
    text-align: center;
    justify-content: center;
}

.t-share-header-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 1.5rem;
    margin: 0;
    background: color-mix(in srgb, var(--brand-color) 10%, var(--share-card, white));
    border-bottom: 1px solid color-mix(in srgb, var(--brand-color) 15%, var(--outline));
}

.t-share-hide-title .t-share-card-title { display: none !important; }

.t-share-radius-none .t-share-card { border-radius: 0; }
.t-share-radius-sm .t-share-card { border-radius: 0.375rem; }
.t-share-radius-md .t-share-card { border-radius: 0.5rem; }
.t-share-radius-lg .t-share-card { border-radius: var(--radius-card); }
.t-share-radius-xl .t-share-card { border-radius: 1rem; }

.t-share-shadow-none .t-share-card { box-shadow: none; }
.t-share-shadow-sm .t-share-card { box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }
.t-share-shadow-md .t-share-card { box-shadow: var(--shadow-card); }
.t-share-shadow-lg .t-share-card { box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); }

.t-share-pad-compact .t-share-panel { padding: 1rem; }
.t-share-pad-normal .t-share-panel { padding: 1.5rem; }
.t-share-pad-spacious .t-share-panel { padding: 2rem; }

/* --- Published apps: collapse nested cards to a single card ---
   The share view stacked 3 cards (share card > page-design card > form card).
   Always flatten the redundant middle page-design wrapper. The outer app card is
   a toggle (card_container / .t-share-card-on): OFF (default) = flush shell so the
   inner content is the only card; ON = the app card is the single card, content flush. */
.t-share-page .form-page-design {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
/* Container OFF (default): outer app card is a transparent wrapper; content card stays */
.t-share-page:not(.t-share-card-on) .t-share-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}
/* Container ON: the app card is the single card — flatten the inner form container */
.t-share-page.t-share-card-on .Mauqe-form {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

.share-submissions-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.share-submissions-table .t-table th,
.share-submissions-table .t-table td {
    white-space: nowrap;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.share-submissions-table .t-table td:hover {
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.submissions-data-table {
    overflow-x: auto;
}

.submissions-data-table .t-table th,
.submissions-data-table .t-table td {
    white-space: nowrap;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.submissions-data-table .t-table td:hover {
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.field-readonly {
    opacity: 0.85;
}

.field-readonly input,
.field-readonly select,
.field-readonly textarea {
    background: var(--surface-sunken);
    cursor: not-allowed;
}

.field-rules-panel {
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    padding: 0.625rem;
}

.field-rules-section {
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    background: var(--surface);
}

.field-rules-summary {
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink);
    padding: 0.5rem 0.625rem;
    list-style: none;
}

.field-rules-summary::-webkit-details-marker {
    display: none;
}

.field-rules-body {
    padding: 0 0.625rem 0.625rem;
}

.field-access-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.field-access-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    cursor: pointer;
}

.field-access-chip--builtin {
    border-color: var(--sky-mid);
    background: var(--sky-soft);
}

.field-access-chip input {
    margin: 0;
}

.t-share-font-system { font-family: var(--font-sans); }
.t-share-font-serif { font-family: Georgia, 'Times New Roman', serif; }
.t-share-font-rounded { font-family: 'Segoe UI', system-ui, sans-serif; }

.t-share-btn-radius-sm .t-share-submit { border-radius: 0.25rem; }
.t-share-btn-radius-md .t-share-submit { border-radius: var(--radius-btn); }
.t-share-btn-radius-lg .t-share-submit { border-radius: 0.75rem; }
.t-share-btn-radius-full .t-share-submit { border-radius: 9999px; }

.t-share-btn-outline .t-share-submit {
    background: transparent;
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
}
.t-share-btn-outline .t-share-submit:hover {
    background: var(--brand-soft);
}

.t-share-btn-soft .t-share-submit {
    background: color-mix(in srgb, var(--brand-color) 14%, white);
    color: var(--brand-color);
}
.t-share-btn-soft .t-share-submit:hover {
    background: color-mix(in srgb, var(--brand-color) 22%, white);
}

.t-share-menu-none .t-share-tabs { display: none; }

.t-share-tabs-pills {
    display: flex;
    gap: 0.35rem;
    padding: 0.75rem 1rem 0;
    border-bottom: none;
}
.t-share-menu-pills .t-share-tab,
.t-share-tabs-pills .t-share-tab {
    border-radius: 9999px;
    border-bottom: none;
    padding: 0.4rem 0.9rem;
    background: var(--surface);
}
.t-share-menu-pills .share-tab-active,
.t-share-tabs-pills .share-tab-active {
    background: var(--brand-color);
    color: var(--text-on-brand);
}

.t-share-tabs-underline { border-bottom: 1px solid var(--outline); }
.t-share-menu-underline .t-share-tab { border-bottom-width: 3px; }

/* Default share menu (MenuStyle = tabs) — a polished, theme-aware segmented pill
   bar. Uses the share design variables (--share-text / --share-card / --share-accent)
   so it looks right on light, dark, and colored share themes. */
.t-share-tabs.t-share-tabs-tabs {
    display: flex;
    width: max-content;
    max-width: calc(100% - 2rem);
    margin: 0.9rem auto 0.35rem;
    gap: 4px;
    padding: 5px;
    border: 1px solid color-mix(in srgb, var(--share-text, #0f172a) 14%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--share-text, #0f172a) 6%, transparent);
}
/* .t-share-page prefix keeps specificity above the global `body.t-app a:not(.t-btn)`
   link rule, which would otherwise paint every tab brand-blue like a hyperlink. */
.t-share-page .t-share-tabs-tabs .t-share-tab {
    flex: 0 0 auto;
    border: 0;
    border-bottom: 0;
    border-radius: 999px;
    padding: 0.45rem 1.05rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.1;
    color: color-mix(in srgb, var(--share-text, #334155) 58%, transparent);
    background: transparent;
    text-decoration: none;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.t-share-page .t-share-tabs-tabs .t-share-tab:hover {
    color: var(--share-text, #0f172a);
    background: color-mix(in srgb, var(--share-text, #0f172a) 8%, transparent);
    text-decoration: none;
}
.t-share-page .t-share-tabs-tabs .share-tab-active,
.t-share-page .t-share-tabs-tabs .t-share-tab-active {
    color: #fff;
    background: var(--share-accent, var(--brand-color, #3b82f6));
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12),
                0 6px 16px -6px color-mix(in srgb, var(--share-accent, var(--brand-color, #3b82f6)) 60%, transparent);
}
.t-share-tabs-tabs .t-share-tab .t-menu-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.9;
}

/* Share settings — page designer sidebar */
.share-design-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}
.share-design-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
}
.share-design-preview-wrap {
    background: #f1f5f9;
    min-height: 280px;
}
.share-preview-root {
    border-radius: 0.5rem;
    transform: scale(0.92);
    transform-origin: top center;
}
.share-preview-root:not(.t-share-w-full) {
    margin-inline: auto;
}
.share-designer-scroll {
    scrollbar-width: thin;
}

/* --- Style presets gallery --- */
.share-preset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
}
@media (min-width: 1280px) {
    .share-preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.share-preset-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    text-align: start;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.share-preset-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
.share-preset-card.is-active {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}
.share-preset-swatch {
    position: relative;
    display: block;
    height: 74px;
    border-radius: 0.5rem;
    padding: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.06);
}
.share-preset-swatch-card {
    position: relative;
    display: block;
    height: 100%;
    padding: 0.5rem;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}
.share-preset-swatch-bar {
    display: block;
    width: 42%;
    height: 6px;
    border-radius: 999px;
    margin-bottom: 0.4rem;
}
.share-preset-swatch-line {
    display: block;
    width: 88%;
    height: 5px;
    border-radius: 999px;
    margin-bottom: 0.3rem;
}
.share-preset-swatch-line.short { width: 60%; }
.share-preset-swatch-btn {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    width: 30%;
    height: 12px;
    border-radius: 999px;
}
[dir="rtl"] .share-preset-swatch-btn { right: auto; left: 0.5rem; }
.share-preset-meta {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0 0.125rem 0.125rem;
}
.share-preset-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
}
.share-preset-desc {
    font-size: 0.6875rem;
    color: #94a3b8;
    line-height: 1.3;
}

/* --- Custom design (collapsible) --- */
.share-style-custom {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}
.share-style-custom-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    cursor: pointer;
    list-style: none;
    background: #f8fafc;
    user-select: none;
}
.share-style-custom-summary::-webkit-details-marker { display: none; }
.share-style-custom-summary::after {
    content: "⌄";
    font-size: 1rem;
    line-height: 1;
    color: #94a3b8;
    transition: transform 0.15s ease;
}
.share-style-custom[open] .share-style-custom-summary::after { transform: rotate(180deg); }
.share-style-custom-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    flex: 1;
}
.share-style-custom-hint {
    font-size: 0.6875rem;
    color: #94a3b8;
}
.share-style-custom-body { padding: 0 0.875rem 0.875rem; }

.t-share-settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--outline);
    background: var(--surface-muted, #F8FAFC);
}

.t-share-settings-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-muted, #64748B);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.t-share-settings-tab:hover {
    color: var(--ink, #0F172A);
    background: color-mix(in srgb, var(--brand-color) 6%, white);
}

.t-share-settings-tab.share-settings-tab-active {
    color: var(--brand-color);
    border-bottom-color: var(--brand-color);
    background: white;
}

.share-menu-item .hidden {
    display: none;
}

.t-share-tab-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.t-share-html-content {
    line-height: 1.6;
}

.t-share-html-content img {
    max-width: 100%;
    height: auto;
}

.t-share-tools {
    padding: 0 0 0.25rem;
}

.t-share-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.t-share-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid color-mix(in srgb, var(--brand-color) 25%, var(--outline, #E2E8F0));
    border-radius: 0.5rem;
    background: var(--share-card, #fff);
    color: var(--brand-color);
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.t-share-tool-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--brand-color) 8%, var(--share-card, #fff));
}

.t-share-tool-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.t-share-tool-btn.t-share-tool-primary {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
}

.t-share-tool-btn.t-share-tool-primary:hover:not(:disabled) {
    filter: brightness(1.05);
}

.t-share-tool-upload {
    cursor: pointer;
}

.t-share-tool-meta {
    font-size: 0.8125rem;
    color: var(--ink-muted, #64748B);
    min-width: 5rem;
    text-align: center;
}

.t-share-tool-hint {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--ink-muted, #64748B);
}

.t-share-tool-hint.t-share-tool-error {
    color: #DC2626;
}

@media print {
    body.t-share-printing > *:not(.t-share-shell),
    body.t-share-printing .t-share-header,
    body.t-share-printing .t-share-tabs,
    body.t-share-printing .t-share-tools,
    body.t-share-printing .t-share-submit,
    body.t-share-printing [role="tabpanel"]:not(.t-share-print-target) {
        display: none !important;
    }

    body.t-share-printing .t-share-print-target {
        display: block !important;
    }

    body.t-share-printing .t-share-card {
        box-shadow: none;
        border: none;
    }
}

.share-menu-sort {
    display: inline-flex;
    gap: 0.25rem;
}

.share-menu-sort button {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--outline, #E2E8F0);
    border-radius: 0.375rem;
    background: white;
    color: var(--ink-muted, #64748B);
}

.share-menu-sort button:hover:not(:disabled) {
    background: #F8FAFC;
    color: var(--ink, #0F172A);
}

.share-menu-sort button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ==========================================================================
   Modals
   ========================================================================== */

.Mauqe-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: modal-overlay-in 0.2s ease;
}

.Mauqe-modal.hidden {
    display: none;
}

.Mauqe-modal-panel {
    background: var(--background);
    border-radius: var(--radius-modal);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modal-panel-in 0.26s var(--ease-bounce);
}

@keyframes modal-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modal-panel-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.Mauqe-modal-panel--app-create {
    max-width: min(72rem, 96vw);
    height: min(820px, 92vh);
}

.Mauqe-modal-panel--app-create.Mauqe-modal-panel--data {
    height: min(900px, 95vh);
    height: min(900px, 95dvh);
}

.Mauqe-modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.full-table-modal-panel {
    width: min(96vw, 96rem);
    height: min(92vh, 900px);
}

.full-table-modal-body {
    overflow: hidden;
}

.full-table-modal-content,
.full-table-modal-table-wrap {
    height: 100%;
    min-height: 0;
}

.full-table-modal-table-wrap {
    overflow: auto;
}

.Mauqe-modal-body--app-create {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.Mauqe-modal-tab-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.Mauqe-modal-tab-panel--templates {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 1.25rem;
    overflow: hidden;
}

.t-app-templates-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
}

.t-app-templates-header__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ink);
}

.t-app-templates-header__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.Mauqe-modal-footer {
    background: var(--background);
    border-top: 1px solid var(--outline);
}

@supports (height: 100dvh) {
    .Mauqe-modal-panel {
        max-height: calc(100dvh - 2rem);
    }

    .Mauqe-modal-panel--app-create {
        height: min(820px, 92dvh);
    }
}

.modal-tab-active {
    color: var(--brand-color);
    border-color: var(--brand-color);
    font-weight: 700;
}


/* ==========================================================================
   Form Builder
   ========================================================================== */

.form-builder-page {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.form-builder-grid {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.form-builder-panel,
.form-builder-canvas {
    min-height: 0;
}

/* Collapse the right properties panel by default and give the canvas the extra
   space; it auto-expands (fb-props-open, toggled in JS) when a component is
   selected. Desktop only — on small screens the columns stack as normal. */
@media (min-width: 1024px) {
    .form-builder-grid:not(.fb-props-open) .fb-right {
        display: none;
    }
    .form-builder-grid:not(.fb-props-open) .fb-center {
        grid-column: span 9 / span 9;
    }
}

/* The collapse (×) button only makes sense while the panel is open. */
.fb-props-collapse {
    display: none;
}
.form-builder-grid.fb-props-open .fb-props-collapse {
    display: inline;
}

.builder-mode .form-builder-scroll {
    scrollbar-width: thin;
}

#form-canvas.drag-over {
    border-color: var(--brand-color) !important;
    background: var(--surface-sunken) !important;
}

.palette-section-title {
    margin-bottom: 0.5rem;
    color: var(--ink-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.palette-field-btn {
    padding: 0.75rem 0.625rem;
    min-height: 3rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border-radius: var(--radius-input);
    position: relative;
    transition: background var(--transition-base), border-color var(--transition-base);
}

/* Theme-aware masked icons (inherit currentColor, so they flip with the theme) */
.palette-icon,
.t-mask-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    vertical-align: -0.2em;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.palette-icon {
    color: var(--brand-color);
    opacity: 0.9;
}

/* Palette item descriptions render through JS-positioned .t-floating-tip (in the
   top layer on <body>) so they are never clipped by the scrollable palette. */
.t-floating-tip {
    position: fixed;
    z-index: 1000;
    display: none;
    width: max-content;
    max-width: min(20rem, calc(100vw - 2rem));
    padding: 0.45rem 0.6rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-0.15rem);
    transition: opacity var(--transition-base), transform var(--transition-base);
    white-space: normal;
}

.t-floating-tip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.palette-field-btn:active {
    transform: scale(0.98);
}

.palette-tab {
    color: var(--ink-subtle);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}

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

.palette-tab.active {
    background: var(--brand-color);
    color: #fff;
}

/* Preview tab of the central canvas: the live rendered page as an editing surface. */
.canvas-preview {
    background: var(--surface-sunken);
    border-radius: var(--radius-btn);
    padding: 0.5rem;
}

/* The Preview tab is an editing surface: always full width, ignore the page's
   configured max-width/centering so it fills the panel. */
.canvas-preview .form-page-design {
    max-width: 100% !important;
    margin-inline: 0 !important;
}

.canvas-preview [data-field-id],
.canvas-preview [data-fb-node] {
    cursor: pointer;
}

/* Drop-between indicators for the Preview tab (mirrors the block editor). */
.canvas-preview [data-field-id].preview-drop-before,
.canvas-preview .preview-drop-before {
    box-shadow: inset 0 3px 0 0 var(--brand-color);
}

.canvas-preview [data-field-id].preview-drop-after,
.canvas-preview .preview-drop-after {
    box-shadow: inset 0 -3px 0 0 var(--brand-color);
}

/* Dropping into an (empty) container: outline the whole container. */
.canvas-preview .preview-drop-inside {
    outline: 2px dashed var(--brand-color);
    outline-offset: -2px;
    border-radius: 4px;
}

.canvas-preview [data-field-id]:hover {
    outline: 1px dashed color-mix(in srgb, var(--brand-color) 55%, transparent);
    outline-offset: 2px;
    border-radius: 4px;
}

.canvas-preview-selected,
.canvas-preview [data-field-id].canvas-preview-selected {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* "Real app" preview modal (opened from the toolbar Preview button). Inset a bit
   from the edges with a dimmed backdrop so it clearly reads as a modal panel. */
.app-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 2.5vh 3vw;
    background: rgba(15, 23, 42, 0.55);
}

.app-preview-modal.hidden {
    display: none;
}

.app-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    height: 3rem;
    padding: 0 0.75rem 0 1rem;
    background: var(--surface-raised, #fff);
    border-bottom: 1px solid var(--outline);
    border-top-left-radius: var(--radius-card, 0.75rem);
    border-top-right-radius: var(--radius-card, 0.75rem);
}

.app-preview-bar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.app-preview-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-preview-bar-link {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    text-decoration: none;
}

.app-preview-bar-link:hover {
    color: var(--ink);
    text-decoration: underline;
}

.app-preview-bar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius-btn);
    background: transparent;
    color: var(--ink-muted);
    font-size: 1rem;
    cursor: pointer;
}

.app-preview-bar-close:hover {
    background: var(--surface-muted);
    color: var(--ink);
}

.app-preview-body {
    flex: 1 1 auto;
    min-height: 0;
    border-bottom-left-radius: var(--radius-card, 0.75rem);
    border-bottom-right-radius: var(--radius-card, 0.75rem);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.app-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

/* App header shown inside the preview (logo + page menu), styled like the real app. */
.app-preview-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--outline, #e2e8f0);
}

.app-preview-shell-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.app-preview-shell-logo {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

.app-preview-shell-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--preview-accent, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-preview-shell-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.app-preview-shell-tab {
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
}

.app-preview-shell-tab:hover {
    background: rgba(100, 116, 139, 0.12);
}

.app-preview-shell-tab.active {
    background: var(--preview-accent, #3b82f6);
    color: #fff;
}

body.app-preview-open {
    overflow: hidden;
}

/* Bare page render (?preview=1): no dashboard chrome, full-bleed content. */
.t-bare-preview .t-main.t-main-bare {
    max-width: none;
    margin: 0;
    padding: 0;
}

.field-item {
    border: 1px solid var(--outline);
    border-radius: var(--radius-input);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: border-color var(--transition-base), box-shadow var(--transition-base),
                opacity var(--transition-base), background var(--transition-base);
}

.field-item:active {
    cursor: grabbing;
}

.field-item.dragging {
    opacity: 0.45;
}

.field-item.drag-over-top {
    box-shadow: inset 0 3px 0 var(--brand-color);
}

.field-item.drag-over-bottom {
    box-shadow: inset 0 -3px 0 var(--brand-color);
}

.field-drag-handle {
    color: var(--ink-subtle);
    font-size: 1rem;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
}

.field-item:hover,
.field-item.selected {
    border-color: var(--brand-color);
    background: var(--brand-soft);
}

/* Container head (start marker): reads as the header of the block below it. */
.field-item.field-item-head {
    font-weight: 600;
}

/* Container end marker: a boundary label, de-emphasized and not deletable. */
.field-item.field-item-end {
    opacity: 0.6;
    border-style: dashed;
    background: transparent;
}

.field-item.field-item-end .field-drag-handle {
    visibility: hidden;
}

.field-item-end-note {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-inline: 0.35rem;
}

.field-row-group .field-item-in-row,
.field-row-cols .field-item {
    margin-bottom: 0;
}

.field-row-cols.field-row-sep-dashed > .field-item + .field-item {
    border-inline-start: 1px dashed var(--outline);
    padding-inline-start: 0.5rem;
}

.field-row-cols.field-row-sep-solid > .field-item + .field-item {
    border-inline-start: 1px solid var(--outline);
    padding-inline-start: 0.5rem;
}

.field-row-cols.field-row-sep-dotted > .field-item + .field-item {
    border-inline-start: 1px dotted var(--outline);
    padding-inline-start: 0.5rem;
}

.field-repeat-group .field-item {
    margin-bottom: 0;
}

.field-repeat-children {
    min-height: 2rem;
}

.form-repeat-group {
    padding: 0.75rem;
    border-radius: var(--radius-card);
    border: 1px dashed var(--outline-subtle);
    background: var(--surface-sunken);
}

.form-repeat-group:has(.form-card-container):not(.form-repeat-list):not(.form-repeat-grid) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1rem;
    padding: 0;
    border: none;
    background: transparent;
}

.form-repeat-group:has(.form-card-container):not(.form-repeat-list):not(.form-repeat-grid) .form-repeat-heading {
    grid-column: 1 / -1;
}

.form-repeat-group:has(.form-card-container):not(.form-repeat-list):not(.form-repeat-grid) .form-repeat-item {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.form-repeat-group:has(.form-card-container):not(.form-repeat-list):not(.form-repeat-grid) .form-card-container {
    height: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.form-repeat-group:has(.form-card-container):not(.form-repeat-list):not(.form-repeat-grid) .form-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-repeat-group:has(.form-card-container):not(.form-repeat-list):not(.form-repeat-grid) .form-card-body .web-cta {
    margin-top: auto;
    padding-top: 0.75rem;
}

.form-repeat-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.form-repeat-list .form-repeat-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

@media (min-width: 768px) {
    .form-repeat-grid {
        display: grid;
        gap: 1rem;
    }

    .form-repeat-grid .form-repeat-heading {
        grid-column: 1 / -1;
    }

    .form-repeat-grid .form-repeat-empty {
        grid-column: 1 / -1;
    }

    .form-repeat-grid .form-repeat-item {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .form-repeat-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-repeat-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .form-repeat-grid .form-card-container {
        height: 100%;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }

    .form-repeat-grid .form-card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .form-repeat-grid .form-card-body .web-cta {
        margin-top: auto;
        padding-top: 0.75rem;
    }
}

.form-duplicate-group {
    padding: 0.75rem;
    border-radius: var(--radius-card);
    border: 1px dashed var(--outline-subtle);
    background: var(--surface-sunken);
}

.form-duplicate-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.field-duplicate-group {
    min-height: 2rem;
}

.field-duplicate-children {
    min-height: 2rem;
}

/* Form multi-column layout (used by renderer) */
.form-grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem 1rem;
}

.form-col-full {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .form-col-half {
        grid-column: span 6 / span 6;
    }

    .form-col-third {
        grid-column: span 4 / span 4;
    }

    .form-col-quarter {
        grid-column: span 3 / span 3;
    }

    .form-row-2 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .form-row-3 {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .form-row-4 {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }

    .form-row-has-bg {
        padding: 0.75rem;
        border-radius: var(--radius-card);
        background: var(--surface-sunken);
    }

    .form-row-sep-dashed > .form-field + .form-field {
        border-inline-start: 1px dashed var(--outline);
        padding-inline-start: 1rem;
    }

    .form-row-sep-solid > .form-field + .form-field {
        border-inline-start: 1px solid var(--outline);
        padding-inline-start: 1rem;
    }

    .form-row-sep-dotted > .form-field + .form-field {
        border-inline-start: 1px dotted var(--outline);
        padding-inline-start: 1rem;
    }
}

@media (max-width: 767px) {
    .form-col-half,
    .form-col-third,
    .form-col-quarter {
        grid-column: 1 / -1;
    }

    .form-row-2,
    .form-row-3,
    .form-row-4 {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-row-sep-dashed > .form-field + .form-field,
    .form-row-sep-solid > .form-field + .form-field,
    .form-row-sep-dotted > .form-field + .form-field {
        border-inline-start: none;
        padding-inline-start: 0;
    }
}


/* Public website blocks (form builder website tab) */
.web-block {
    grid-column: 1 / -1;
}

.web-hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 5vw, 3rem);
    border-radius: var(--radius-modal);
    border: 1px solid color-mix(in srgb, var(--brand-color) 14%, var(--outline));
    background:
        radial-gradient(115% 115% at 50% -25%, var(--brand-soft), transparent 62%),
        radial-gradient(90% 90% at 108% 130%, color-mix(in srgb, var(--berry) 9%, transparent), transparent 55%),
        var(--background);
    box-shadow: var(--shadow-md);
}

.web-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--ink);
    margin: 0 auto 0.9rem;
    max-width: 20ch;
    text-wrap: balance;
}

.web-hero-subtitle {
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    color: var(--ink-muted);
    max-width: 44ch;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.web-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.web-btn-primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand-color) 90%, white), var(--brand-color));
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 8px 20px -6px var(--brand-ring);
}

.web-btn-secondary {
    background: var(--surface-elevated);
    color: var(--brand-color);
    border: 1.5px solid color-mix(in srgb, var(--brand-color) 32%, var(--outline));
}

.web-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

body.t-app a.web-btn-secondary,
body.t-app a.web-btn-secondary:hover {
    color: var(--brand-color);
}

.web-btn-secondary:hover {
    background: var(--brand-soft);
    border-color: var(--brand-color);
    transform: translateY(-2px);
    opacity: 1;
}

/* Global body.t-app a:not(.t-btn) link color overrides filled website buttons. */
body.t-app a.web-btn,
body.t-app a.web-btn:hover {
    text-decoration: none;
}

body.t-app a.web-btn-primary,
body.t-app a.web-btn-primary:hover {
    color: #fff;
}

body.t-app a.web-btn-banner,
body.t-app a.web-btn-banner:hover {
    color: var(--text-on-brand);
}

.form-field .web-btn-primary {
    color: #fff;
}

.form-field.elem-btn-outline .web-btn-primary,
.form-field.elem-btn-ghost .web-btn-primary {
    color: var(--elem-accent, var(--brand-color));
}

.form-field[style*="--elem-text"] .web-hero-title,
.form-field[style*="--elem-text"] .web-hero-subtitle,
.form-field[style*="--elem-text"] .web-nav-brand,
.form-field[style*="--elem-text"] .web-newsletter-title,
.form-field[style*="--elem-text"] .web-newsletter-sub,
.form-field[style*="--elem-text"] .web-banner-text,
.form-field[style*="--elem-text"] .web-section-title,
.form-field[style*="--elem-text"] > label,
.form-field[style*="--elem-text"] .dash-heading-title,
.form-field[style*="--elem-text"] .dash-info {
    color: var(--elem-text);
}

.web-btn-primary:hover {
    background: linear-gradient(180deg, var(--brand-color), var(--brand-hover));
    box-shadow: 0 3px 6px rgba(15, 23, 42, 0.16), 0 14px 30px -6px var(--brand-ring);
    transform: translateY(-2px);
}

.web-paragraph p {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ink-muted);
}

/* Rendered rich-text (WYSIWYG) content. The global reset strips list markers,
   so restore them here or bullet/numbered lists render invisibly. */
.web-rich {
    font-size: 1.0625rem;
    line-height: 1.7;
    /* Honour the element design-panel text color; inline WYSIWYG colors (higher
       specificity via the style attribute) still override this. */
    color: var(--elem-text, var(--ink-muted));
}
.web-rich p { margin: 0.5rem 0; }
.web-rich ul { list-style: disc; padding-inline-start: 1.5rem; margin: 0.5rem 0; }
.web-rich ol { list-style: decimal; padding-inline-start: 1.5rem; margin: 0.5rem 0; }
.web-rich li { margin: 0.2rem 0; }
.web-rich a { color: var(--brand-color); text-decoration: underline; }
.web-rich h2, .web-rich h3, .web-rich h4 { color: var(--ink); font-weight: 700; margin: 0.7rem 0 0.35rem; }
.web-rich h2 { font-size: 1.5rem; }
.web-rich h3 { font-size: 1.25rem; }
.web-rich h4 { font-size: 1.1rem; }
.web-rich blockquote {
    border-inline-start: 3px solid var(--outline-strong, #cbd5e1);
    padding-inline-start: 0.85rem;
    margin: 0.6rem 0;
    font-style: italic;
}
.web-rich strong, .web-rich b { font-weight: 700; }

/* Rich-text editor in the builder props panel. */
.rt-editor-wrap {
    border: 1px solid var(--outline);
    border-radius: var(--radius-input, 0.5rem);
    overflow: hidden;
    background: var(--surface, #fff);
}
.rt-toolbar {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
    padding: 0.25rem;
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--outline);
}
.rt-btn {
    min-width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--ink-muted);
}
.rt-btn:hover { background: var(--surface-muted); color: var(--ink); }
.rt-sep { width: 1px; height: 1rem; background: var(--outline); margin: 0 0.15rem; }
.rt-color {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 1.75rem;
    padding: 0 0.3rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--ink-muted);
}
.rt-color:hover { background: var(--surface-muted); color: var(--ink); }
.rt-color input[type="color"] {
    width: 14px;
    height: 14px;
    border: 1px solid var(--outline);
    border-radius: 3px;
    padding: 0;
    background: none;
    cursor: pointer;
}
.rt-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.rt-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }
.rt-editor {
    min-height: 5rem;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.5rem 0.6rem;
    font-size: 0.875rem;
    outline: none;
    color: var(--ink);
}
.rt-editor:empty:before { content: attr(data-placeholder); color: var(--ink-faint); }
.rt-editor ul { list-style: disc; padding-inline-start: 1.25rem; margin: 0.35rem 0; }
.rt-editor ol { list-style: decimal; padding-inline-start: 1.25rem; margin: 0.35rem 0; }
.rt-editor a { color: var(--brand-color); text-decoration: underline; }
.rt-editor h3 { font-size: 1.1rem; font-weight: 700; margin: 0.3rem 0; }

.web-section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.75rem;
    color: var(--ink);
    text-wrap: balance;
}

.web-features .web-section-title,
.web-steps .web-section-title,
.web-pricing .web-section-title,
.web-testimonials .web-section-title {
    text-align: center;
}

.web-image {
    width: 100%;
    border-radius: var(--radius-card);
    object-fit: cover;
    max-height: 28rem;
}

.web-image-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin-top: 0.5rem;
}

.web-video-frame,
.web-map-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius-card);
}

.web-video-placeholder,
.web-map-placeholder {
    padding: 2rem;
    text-align: center;
    background: var(--surface-sunken);
    border-radius: var(--radius-card);
    color: var(--ink-muted);
}

.web-cta {
    text-align: center;
    padding: 1rem 0;
}

.web-image-btn {
    text-align: center;
    padding: 1rem 0;
}

.web-image-btn-link {
    display: inline-block;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
    text-decoration: none;
    box-shadow: none;
    font-size: 0;
    color: inherit;
}

.web-image-btn-link:hover,
.web-image-btn-link:focus {
    opacity: 0.92;
}

.web-image-btn-img {
    display: block;
    max-width: 100%;
    height: auto;
    border: none;
}

body.t-app a.web-image-btn-link,
body.t-app a.web-image-btn-link:hover {
    color: inherit;
    text-decoration: none;
    border: none;
    background: none;
}

.form-field .web-image-btn-link {
    border: none;
    background: none;
    box-shadow: none;
}

.form-card-body .web-image-btn {
    padding: 0.5rem 0;
}

.web-feature-grid,
.web-testimonial-grid,
.web-stat-grid,
.web-gallery-grid,
.web-pricing-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .web-feature-grid,
    .web-pricing-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .web-testimonial-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .web-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .web-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.web-feature-card,
.web-testimonial,
.web-pricing-card {
    padding: 1.75rem 1.5rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.web-feature-card:hover,
.web-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.web-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 1.1rem;
    font-size: 1.6rem;
    line-height: 1;
    border-radius: var(--radius-btn);
    background: linear-gradient(150deg, var(--brand-soft), color-mix(in srgb, var(--brand-color) 9%, var(--background)));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-color) 16%, transparent);
}

.web-feature-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    color: var(--ink);
}

.web-feature-desc {
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.form-info-block {
    padding: 1rem;
    border-radius: var(--radius-card);
    background: var(--sky-soft);
    color: var(--sky-deep);
}

.form-card-body .form-info-block {
    padding: 0;
    background: transparent;
    color: var(--ink-muted);
}

.form-card-body .form-field[data-field-id="item_price"] .web-paragraph p {
    margin-top: 0.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--brand-color);
}

.form-card-body .web-paragraph p {
    margin: 0;
    color: var(--ink-muted);
    line-height: 1.55;
}

.form-card-body .web-cta {
    margin-top: 0.75rem;
    text-align: start;
}

.web-testimonial-quote {
    font-style: italic;
    margin-bottom: 0.5rem;
}

.web-testimonial-author {
    font-size: 0.875rem;
    color: var(--ink-muted);
    font-style: normal;
}

.web-faq-item {
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    padding: 1rem 1.25rem;
    margin-bottom: 0.6rem;
    background: var(--background);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.web-faq-item:hover {
    border-color: color-mix(in srgb, var(--brand-color) 30%, var(--outline));
    box-shadow: var(--shadow-card);
}

.web-faq-question {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
}

.t-menu-icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: -0.15em;
    margin-inline-end: 0.35rem;
    object-fit: contain;
}

.t-menu-icon-picker {
    min-width: 0;
}

.t-page-select-picker {
    min-width: 0;
}

.t-page-select-picker select {
    flex: 1;
    min-width: 0;
}

.t-menu-icon-picker select {
    flex: 1;
    min-width: 0;
}

.t-menu-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--outline, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--surface, #fff);
    flex-shrink: 0;
}

.t-menu-icon-preview--sm {
    width: 1.75rem;
    height: 1.75rem;
}

.t-share-tab .t-menu-icon,
.web-nav-link .web-nav-icon,
.web-footer-link .web-nav-icon {
    opacity: 0.85;
}

.web-nav-link,
.web-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.web-nav-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.web-faq-answer {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--ink-muted);
}

.web-carousel-viewport {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-card);
}

.web-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.web-carousel-track::-webkit-scrollbar {
    display: none;
}

.web-carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    margin: 0;
    box-sizing: border-box;
}

.web-carousel[data-carousel-per-view="2"] .web-carousel-slide {
    flex: 0 0 50%;
}

.web-carousel[data-carousel-per-view="3"] .web-carousel-slide {
    flex: 0 0 33.3333%;
}

.web-carousel[data-carousel-per-view="4"] .web-carousel-slide {
    flex: 0 0 25%;
}

.web-carousel[data-carousel-per-view]:not([data-carousel-per-view="1"]) .web-carousel-track {
    gap: 0.5rem;
}

.web-carousel-slide-inner {
    width: 100%;
    min-height: 100%;
}

.web-carousel-slide-inner .form-field {
    margin-bottom: 0;
}

.web-carousel-slide-inner .form-field:last-child {
    margin-bottom: 0;
}

.web-carousel-controls.is-hidden {
    display: none;
}

.web-carousel-img {
    display: block;
    width: 100%;
    max-height: 28rem;
    object-fit: cover;
    border-radius: var(--radius-card);
}

.web-carousel-caption {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--ink-muted);
}

.web-carousel-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.web-carousel-prev,
.web-carousel-next {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--outline, #e2e8f0);
    border-radius: 9999px;
    background: var(--surface, #fff);
    color: var(--ink);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.web-carousel-prev:hover,
.web-carousel-next:hover {
    background: var(--surface-sunken, #f8fafc);
}

.web-collapsible-list {
    display: grid;
    gap: 0.5rem;
}

.web-collapsible-item {
    border: 1px solid var(--outline, #e2e8f0);
    border-radius: var(--radius-card);
    background: var(--surface, #fff);
}

.web-collapsible-summary {
    cursor: pointer;
    padding: 0.875rem 1rem;
    font-weight: 600;
    list-style: none;
}

.web-collapsible-summary::-webkit-details-marker {
    display: none;
}

.web-collapsible-summary::after {
    content: '+';
    float: inline-end;
    font-weight: 400;
    color: var(--ink-muted);
}

.web-collapsible-item[open] .web-collapsible-summary::after {
    content: '−';
}

.web-collapsible-body {
    padding: 0 1rem 1rem;
    color: var(--ink-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.web-stat {
    text-align: center;
    padding: 1.75rem 1.25rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    box-shadow: var(--shadow-card);
}

.web-stat-value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--brand-color);
}

.web-stat-label {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin-top: 0.25rem;
}

.web-gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-input);
}

.web-gallery-item figcaption {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin-top: 0.25rem;
}

.gallery-upload-list {
    margin-bottom: 0.5rem;
}

.gallery-upload-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
}

.gallery-upload-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--outline);
}

.gallery-upload-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--ink-muted);
}

.gallery-upload-fields {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.gallery-upload-btn,
.gallery-upload-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    border: 1px dashed var(--sky-mid, #38bdf8);
    border-radius: var(--radius-sm);
    color: var(--sky-deep, #0369a1);
    background: var(--sky-soft, #eff6ff);
    cursor: pointer;
    font-weight: 600;
}

.gallery-upload-add {
    margin-top: 0.5rem;
}

.gallery-upload-btn:hover,
.gallery-upload-add:hover {
    background: #dbeafe;
}

.web-navbar {
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    padding: 0.85rem 1.25rem;
    background: var(--surface-elevated);
    box-shadow: var(--shadow-sm);
}

.web-navbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.web-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.web-nav-logo {
    height: 2rem;
    width: auto;
}

.web-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.web-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-muted);
    text-decoration: none;
}

.web-nav-link:hover {
    color: var(--brand-color);
}

.web-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--outline);
    margin-top: 1rem;
}

.web-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.web-footer-link {
    font-size: 0.875rem;
    color: var(--ink-muted);
    text-decoration: none;
}

.web-footer-copy {
    font-size: 0.8125rem;
    color: var(--ink-subtle);
}

.web-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.web-social-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-btn);
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--ink);
}

.web-contact-list {
    display: grid;
    gap: 0.5rem;
}

.web-contact-item {
    padding: 0.75rem 1rem;
    background: var(--surface-sunken);
    border-radius: var(--radius-input);
    font-size: 0.9375rem;
}

.web-pricing-plan {
    font-weight: 700;
    font-size: 1.125rem;
}

.web-pricing-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-color);
    margin: 0.5rem 0 1rem;
}

.web-pricing-features {
    list-style: disc;
    padding-inline-start: 1.25rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.web-quote {
    border-inline-start: 4px solid var(--brand-color);
    padding: 1rem 1.25rem;
    background: var(--surface-sunken);
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

.web-quote-text {
    font-size: 1.125rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.web-quote-author {
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.web-list-items {
    list-style: disc;
    padding-inline-start: 1.5rem;
    line-height: 1.8;
    color: var(--ink-muted);
}

/* Team */
.web-team-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}

.web-team-card {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-card);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-card);
}

.web-team-photo {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.75rem;
    display: block;
}

.web-team-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.web-team-role {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin: 0;
}

/* Steps */
.web-steps-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.web-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.35rem 1.35rem 1.35rem 1.1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.web-step:hover,
.web-step:has(.web-step-title-link:hover) {
    border-color: color-mix(in srgb, var(--brand-color) 40%, var(--outline));
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.web-step-num {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand-color) 88%, white), var(--brand-color));
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px -3px var(--brand-ring);
}

.web-step-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.web-step-title-link {
    color: inherit;
    text-decoration: none;
}

.web-step-title-link:hover {
    color: var(--brand-color);
}

.web-step-desc {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin: 0;
    line-height: 1.5;
}

/* Logo cloud */
.web-logo-subtitle {
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.875rem;
    margin: -0.5rem 0 1rem;
}

.web-logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

.web-logo-img {
    max-height: 2.5rem;
    max-width: 7rem;
    object-fit: contain;
    opacity: 0.75;
    filter: grayscale(100%);
    transition: opacity var(--transition-fast), filter var(--transition-fast);
}

.web-logo-item:hover .web-logo-img {
    opacity: 1;
    filter: none;
}

/* Banner */
.web-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-btn);
    background: var(--brand-color);
    color: var(--text-on-brand);
    text-align: center;
}

.web-banner-text {
    margin: 0;
    font-weight: 600;
    font-size: 0.9375rem;
}

.web-btn-banner {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-on-brand);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.web-btn-banner:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Timeline */
.web-timeline-list {
    position: relative;
    padding-inline-start: 1.5rem;
    border-inline-start: 2px solid var(--outline);
}

.web-timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.web-timeline-item:last-child {
    padding-bottom: 0;
}

.web-timeline-marker {
    position: absolute;
    inset-inline-start: -1.625rem;
    top: 0.35rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.web-timeline-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.web-timeline-desc {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin: 0;
    line-height: 1.5;
}

/* Newsletter */
.web-newsletter {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-card);
    background: var(--surface-sunken);
}

.web-newsletter-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--ink);
}

.web-newsletter-sub {
    color: var(--ink-muted);
    font-size: 0.9375rem;
    margin: 0 0 1.25rem;
}

.web-newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 28rem;
    margin: 0 auto;
}

.web-newsletter-input {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-input);
    font-size: 0.9375rem;
}

/* Content cards */
.web-cards-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.web-content-card {
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--surface-elevated);
    box-shadow: var(--shadow-card);
}

.web-card-img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
    display: block;
}

.web-card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.web-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.375rem;
}

.web-card-desc {
    font-size: 0.875rem;
    color: var(--ink-muted);
    margin: 0;
    line-height: 1.5;
}

/* Comparison table */
.web-comparison-wrap {
    overflow-x: auto;
}

.web-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.web-comparison-table th,
.web-comparison-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--outline);
    text-align: center;
}

.web-comparison-table th {
    font-weight: 700;
    background: var(--surface-sunken);
}

.web-compare-feature-col,
.web-compare-feature {
    text-align: start;
    font-weight: 600;
}

.web-compare-yes {
    color: var(--leaf-deep);
    font-weight: 700;
}

.web-compare-no {
    color: var(--ink-faint);
}

.comparison-editor {
    font-size: 0.8125rem;
}

.comparison-plan-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.comparison-plan-chip {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
}

.comparison-plan-input {
    width: 5.5rem;
    border: none;
    background: transparent;
    padding: 0.2rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.comparison-plan-input:focus {
    outline: none;
}

.comparison-plan-remove {
    color: var(--ink-faint);
    padding: 0 0.25rem;
    line-height: 1;
}

.comparison-plan-remove:hover {
    color: #dc2626;
}

.comparison-grid {
    border: 1px solid var(--outline);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
}

.comparison-grid-header,
.comparison-feature-row {
    display: grid;
    grid-template-columns: minmax(6rem, 1.4fr) repeat(var(--compare-cols, 3), minmax(2.5rem, 1fr)) 1.5rem;
    gap: 0.25rem;
    align-items: center;
    padding: 0.35rem 0.5rem;
}

.comparison-grid-header {
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--outline);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-muted);
}

.comparison-feature-row {
    border-bottom: 1px solid var(--outline);
}

.comparison-feature-row:last-child {
    border-bottom: none;
}

.comparison-grid-feature-label {
    text-align: start;
}

.comparison-grid-plan {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comparison-feature-input {
    width: 100%;
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
}

.comparison-cell-toggle {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--outline);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    justify-self: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.comparison-cell-toggle.is-yes {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: var(--leaf-deep, #047857);
}

.comparison-cell-toggle.is-no {
    background: var(--surface-sunken);
    color: var(--ink-faint);
}

.comparison-cell-toggle:hover {
    border-color: var(--sky-mid, #38bdf8);
}

.comparison-feature-remove {
    justify-self: center;
}


/* ==========================================================================
   Workflow Builder
   ========================================================================== */

.workflow-node {
    position: absolute;
    min-width: 150px;
    padding: 0.85rem 2.5rem 0.85rem 1rem;
    border-radius: var(--radius-btn);
    border: 2px solid var(--outline-strong);
    background: var(--background);
    cursor: move;
    user-select: none;
    font-size: 0.875rem;
    z-index: 10;
    transition: box-shadow var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

.workflow-node.selected {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.workflow-node.linking-source {
    border-color: var(--sky);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 30%, transparent);
}

.workflow-node.link-target {
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--leaf) 25%, transparent);
    cursor: pointer;
    animation: pulse-target 1s ease infinite;
}

.workflow-node.link-ready {
    cursor: pointer;
}

.workflow-node.link-ready:hover {
    border-color: var(--sky);
    transform: scale(1.03);
}

@keyframes pulse-target {
    0%, 100% {
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--leaf) 25%, transparent);
    }
    50% {
        box-shadow: 0 0 0 8px color-mix(in srgb, var(--leaf) 15%, transparent);
    }
}

.workflow-node[data-type="start"] {
    border-color: var(--leaf);
    background: var(--leaf-soft);
}

.workflow-node[data-type="end"] {
    border-color: var(--coral);
    background: var(--coral-soft);
}

.workflow-node[data-type="human_task"] {
    border-color: var(--sky);
}

.workflow-node[data-type="condition"] {
    border-color: var(--sun);
}

.workflow-node[data-type="form_data"] {
    border-color: #8b5cf6;
    background: color-mix(in srgb, #8b5cf6 8%, var(--background));
}

.node-add-btn {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-pill);
    background: var(--brand-color);
    color: var(--text-on-brand);
    border: 2px solid var(--background);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-base), transform var(--transition-base);
}

.node-add-btn:hover {
    background: var(--brand-hover);
    transform: translateY(-50%) scale(1.1);
}

[dir="rtl"] .node-add-btn {
    right: auto;
    left: -14px;
}

.wf-mode-btn {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-input);
    border: 1px solid var(--outline-strong);
    background: var(--background);
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.wf-mode-btn.active {
    background: var(--brand-color);
    color: var(--text-on-brand);
    border-color: var(--brand-color);
}

.wf-mode-btn:hover:not(.active) {
    background: var(--brand-soft);
}

#workflow-canvas.connect-mode .workflow-node {
    cursor: pointer;
}

.quick-add-menu {
    position: fixed;
    z-index: 100;
    background: var(--background);
    border: 1px solid var(--outline);
    border-radius: var(--radius-btn);
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
}

.quick-add-menu button {
    display: block;
    width: 100%;
    text-align: inherit;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--radius-input);
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.quick-add-menu button:hover {
    background: var(--brand-soft);
}

.edge-label {
    font-size: 11px;
    fill: var(--ink-muted);
    font-family: var(--font-sans);
}


/* ==========================================================================
   WCAG 2.1 AA contrast — legacy Tailwind utilities & edge cases
   Normal text ≥ 4.5:1 · Large/bold ≥ 3:1 · UI components ≥ 3:1
   ========================================================================== */

/* Tailwind gray-400 (#9ca3af) fails AA on white — remap to ink-subtle */
body.t-app .text-gray-400,
.t-login-page .text-gray-400,
.t-share-page .text-gray-400 {
    color: var(--ink-subtle) !important;
}

/* Tailwind gray-500 on small labels — bump to ink-muted */
body.t-app .text-gray-500,
.t-login-page .text-gray-500,
.t-share-page .text-gray-500 {
    color: var(--ink-muted) !important;
}

/* Close / icon-only controls */
button.text-gray-400,
[data-modal-close] {
    color: var(--ink-subtle) !important;
}

button.text-gray-400:hover,
[data-modal-close]:hover {
    color: var(--ink-muted) !important;
}

/* Modal & builder inactive tabs */
[data-tab-group] button.border-transparent.text-gray-500 {
    color: var(--ink-muted) !important;
}

/* Form builder palette section labels (uppercase xs) */
#field-palette .text-gray-400 {
    color: var(--ink-muted) !important;
    letter-spacing: 0.05em;
}

#form-canvas .text-gray-400,
#field-props .text-gray-400 {
    color: var(--ink-muted) !important;
}

/* Stat & accent colors on white cards — use darker shades */
.text-green-600 { color: var(--leaf-deep) !important; }
.text-blue-600 { color: var(--sky-deep) !important; }
.text-red-600 { color: #B91C1C !important; }
.text-amber-600 { color: var(--sun-deep) !important; }
.text-purple-600 { color: #7E22CE !important; }
.text-purple-700 { color: #6D28D9 !important; }
.text-amber-700 { color: var(--sun-deep) !important; }
.text-blue-700 { color: var(--sky-deep) !important; }

/* Public form rendered summary labels */
.form-field + dl dt.text-gray-500,
dl .text-gray-500 {
    color: var(--ink-muted) !important;
}

/* Focus visibility — 3:1 against adjacent colors */
:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

.t-btn:focus-visible,
.t-nav-link:focus-visible,
.t-filter-pill:focus-visible,
.t-cat-tabs__tab:focus-visible,
.t-cat-sidebar__item:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.t-nav-ghost:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

body.t-app .t-btn-primary:focus-visible,
body.t-app .t-share-submit:focus-visible {
    outline-color: var(--brand-color);
    box-shadow: 0 0 0 4px var(--brand-ring);
}


/* ==========================================================================
   Accessibility — prefers-contrast & reduced-motion
   ========================================================================== */

@media (prefers-contrast: more) {
    :root {
        --ink-muted: #334155;
        --ink-subtle: #475569;
        --text-placeholder: #475569;
        --outline-strong: #64748B;
    }

    .t-nav-link,
    .t-nav-ghost,
    .t-user-chip {
        font-weight: 700;
    }

    .t-card,
    body.t-app main .bg-white.rounded-xl.shadow {
        border-color: var(--outline-strong) !important;
        border-width: 2px;
    }

    .t-btn:disabled,
    .t-btn[disabled],
    .t-btn-primary:disabled,
    .t-btn-primary[disabled] {
        border-width: 2px;
        color: var(--ink);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .t-btn:active,
    .t-grid-card:hover,
    .t-action-tile:hover,
    .palette-field-btn:active,
    .workflow-node.link-ready:hover,
    .node-add-btn:hover {
        transform: none;
    }
}

@media (forced-colors: active) {
    .t-btn-primary,
    .t-share-submit,
    .t-nav {
        forced-color-adjust: none;
    }
}

/* ==========================================================================
   Help & FAQ
   ========================================================================== */

.t-help-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.t-help-search-wrap {
    flex: 1 1 16rem;
    max-width: 28rem;
}

.t-help-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.t-help-search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-pill);
    background: var(--background) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23475569' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 0.85rem center;
    font-size: 0.9375rem;
    color: var(--ink);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.t-help-search-input:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 20%, transparent);
}

.t-help-overview {
    margin-bottom: 1.5rem;
}

.t-help-overview-intro {
    margin: 0 0 1.25rem;
    color: var(--ink-muted);
    font-size: 0.975rem;
    line-height: 1.7;
    max-width: 72ch;
}

.t-help-subheading {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
}

.t-help-concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.t-help-concept {
    padding: 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface-sunken);
}

.t-help-concept-title {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--sky-deep);
}

.t-help-concept-desc {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ink-muted);
}

.t-help-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.t-help-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.t-help-panel-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 1100px) {
    .t-help-panel-layout {
        grid-template-columns: 15rem minmax(0, 1fr);
    }
}

.t-help-sidebar {
    position: sticky;
    top: 1rem;
    padding: 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.t-help-sidebar-title {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
}

.t-help-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.t-help-toc-list li {
    margin-bottom: 0.25rem;
}

.t-help-toc-link {
    display: block;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-btn);
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ink-muted);
    text-decoration: none;
    transition: background var(--transition-base), color var(--transition-base);
}

.t-help-toc-link:hover {
    background: var(--sky-soft);
    color: var(--sky-deep);
}

.t-help-toc-num {
    font-weight: 700;
    color: var(--sky);
}

.t-help-guide-num {
    color: var(--sky);
    font-weight: 800;
    margin-inline-end: 0.25rem;
}

.t-help-step-text code {
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    background: var(--surface-sunken);
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--sky-deep);
}

.t-help-step-text a {
    color: var(--sky-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.t-help-search-empty {
    margin: 0 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--outline);
    border-radius: var(--radius-card);
    color: var(--ink-muted);
    font-size: 0.875rem;
    text-align: center;
}

.t-help-reference {
    margin-bottom: 1.5rem;
}

.t-help-navmap-wrap {
    overflow-x: auto;
}

.t-help-navmap {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.t-help-navmap th,
.t-help-navmap td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--outline);
    text-align: start;
    vertical-align: top;
}

.t-help-navmap th {
    background: var(--surface-sunken);
    font-weight: 700;
    color: var(--sky-deep);
    white-space: nowrap;
}

.t-help-navmap-path {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.t-help-navmap-link {
    font-weight: 600;
    color: var(--sky-deep);
    text-decoration: none;
}

.t-help-navmap-link:hover {
    text-decoration: underline;
}

.t-help-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 900px) {
    .t-help-bottom-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.t-help-support-body,
.t-help-demo-hint {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.t-help-demo-hint {
    margin-bottom: 1rem;
}

.t-help-demo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.t-help-demo-table th,
.t-help-demo-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--outline);
    text-align: start;
}

.t-help-demo-table th {
    background: var(--surface-sunken);
    font-weight: 700;
    color: var(--ink-muted);
}

.t-help-demo-table code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.t-help-hint {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-sunken);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.t-help-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.t-help-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--outline);
    border-radius: 9999px;
    background: var(--background);
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.t-help-tab:hover {
    border-color: var(--sky);
    color: var(--sky);
}

.t-help-tab.is-active {
    background: var(--sky);
    border-color: var(--sky);
    color: #fff;
}

.t-help-panel {
    display: none;
}

.t-help-panel.is-active {
    display: block;
}

.t-help-role-desc {
    margin-bottom: 1.5rem;
    color: var(--ink-muted);
    font-size: 0.9375rem;
}

.t-help-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.t-help-block-wide {
    width: 100%;
}

.t-help-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--sky-soft);
    color: var(--sky-deep);
    font-size: 0.75rem;
    font-weight: 700;
}

.t-help-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* --- Docs-style help layout (sidebar + content) --- */
.t-docs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .t-docs {
        grid-template-columns: 16rem minmax(0, 1fr);
        gap: 2.25rem;
    }
}
.t-docs-nav {
    min-width: 0;
}
@media (min-width: 1024px) {
    .t-docs-nav {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        display: flex;
        flex-direction: column;
    }
}
.t-docs-nav-search {
    margin-bottom: 1.25rem;
}
.t-docs-nav-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-end: 0.25rem;
    scrollbar-width: thin;
}
.t-docs-nav-group {
    margin-bottom: 1.25rem;
}
.t-docs-nav-heading {
    margin: 0 0 0.4rem;
    padding-inline-start: 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
}
.t-docs-nav-group.is-active .t-docs-nav-heading {
    color: var(--sky-deep);
}
.t-docs-nav-link {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-btn);
    border-inline-start: 2px solid transparent;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--ink-muted);
    text-decoration: none;
    transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.t-docs-nav-link:hover {
    background: var(--sky-soft);
    color: var(--sky-deep);
}
.t-docs-nav-link.is-current {
    background: var(--sky-soft);
    color: var(--sky-deep);
    border-inline-start-color: var(--sky);
    font-weight: 600;
}

.t-docs-main {
    min-width: 0;
}
.t-docs-hero {
    margin-bottom: 1.75rem;
}
.t-docs-hero-title {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.t-docs-hero-sub {
    margin: 0 0 1.1rem;
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.65;
    max-width: 66ch;
}
.t-docs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.t-docs-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    border: 1px solid var(--outline);
    font-size: 0.8125rem;
    color: var(--ink-muted);
}
.t-docs-chip strong {
    color: var(--ink);
    font-weight: 800;
}
.t-docs-chip-accent {
    background: var(--sky-soft);
    border-color: transparent;
    color: var(--sky-deep);
    font-weight: 600;
}

/* Concept cards get a bit more presence in the docs layout. */
.t-help-concept {
    transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}
.t-help-concept:hover {
    border-color: color-mix(in srgb, var(--sky) 45%, var(--outline));
    box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 8%, transparent);
    transform: translateY(-1px);
}

/* Read-time chip on each guide summary. */
.t-help-guide-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.t-help-guide-label {
    flex: 1 1 auto;
    min-width: 0;
}
.t-help-guide-meta {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--surface-sunken);
    border-radius: var(--radius-pill);
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .t-help-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.t-help-block .t-card-body {
    padding: 0;
}

.t-help-faq {
    display: flex;
    flex-direction: column;
}

.t-help-faq-item {
    border-bottom: 1px solid var(--outline);
}

.t-help-faq-item:last-child {
    border-bottom: none;
}

.t-help-faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    color: var(--ink);
}

.t-help-faq-item summary::-webkit-details-marker {
    display: none;
}

.t-help-faq-item summary::after {
    content: "+";
    float: inline-end;
    font-weight: 700;
    color: var(--sky);
}

.t-help-faq-item[open] summary::after {
    content: "−";
}

.t-help-faq-item p {
    margin: 0;
    padding: 0 1.25rem 1rem;
    color: var(--ink-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.t-help-howto {
    padding: 0;
}

.t-help-guide {
    border-bottom: 1px solid var(--outline);
}

.t-help-guide:last-child {
    border-bottom: none;
}

.t-help-guide-title {
    padding: 1rem 1.25rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}

.t-help-guide-title::-webkit-details-marker {
    display: none;
}

.t-help-guide-title::after {
    content: "+";
    float: inline-end;
    font-weight: 700;
    color: var(--sky);
}

.t-help-guide[open] .t-help-guide-title::after {
    content: "−";
}

.t-help-guide-body {
    padding: 0 1.25rem 1.25rem;
}

.t-help-guide-intro {
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-sunken);
    border-radius: var(--radius-card);
    border-inline-start: 3px solid var(--sky);
    color: var(--ink-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.t-help-guide article,
.t-help-guide:not(details) {
    margin-bottom: 1.5rem;
}

.t-help-guide:not(details) .t-help-guide-title {
    margin: 0 0 0.5rem;
    padding: 0;
    cursor: default;
}

.t-help-guide:not(details) .t-help-guide-title::after {
    display: none;
}

.t-help-steps {
    margin: 0;
    padding-inline-start: 1.25rem;
    color: var(--ink-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.t-help-step-text {
    margin-bottom: 0.5rem;
}

.t-help-step-ui {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.t-help-steps li {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--outline);
}

.t-help-steps li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* UI mockup snippets in help steps */
.t-ui-snippet {
    margin-top: 0.5rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface-sunken);
    overflow: hidden;
}

.t-ui-snippet-label {
    padding: 0.35rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    background: color-mix(in srgb, var(--sky) 8%, var(--background));
    border-bottom: 1px solid var(--outline);
}

.t-ui-snippet-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.t-ui-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
}

.t-ui-path-seg {
    color: var(--ink-muted);
}

.t-ui-path-seg.is-current {
    color: var(--sky-deep);
    font-weight: 700;
}

.t-ui-path-sep {
    color: var(--ink-muted);
    opacity: 0.6;
}

.t-ui-nav,
.t-ui-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.t-ui-nav-item,
.t-ui-tab {
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--outline);
    background: var(--background);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.t-ui-nav-item.is-active,
.t-ui-tab.is-active {
    background: var(--sky-soft);
    border-color: var(--sky);
    color: var(--sky-deep);
}

.t-ui-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--outline);
    background: var(--background);
    font-size: 0.75rem;
}

.t-ui-url code {
    font-family: var(--font-mono);
    color: var(--ink);
}

.t-ui-page-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--ink);
}

.t-ui-page-sub {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.t-ui-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.t-ui-btn {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--outline);
    background: var(--background);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink);
}

.t-ui-btn.is-primary {
    background: var(--sky);
    border-color: var(--sky);
    color: #fff;
}

.t-ui-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.t-ui-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.t-ui-field-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.t-ui-req {
    color: #dc2626;
}

.t-ui-input {
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--outline);
    background: #fff;
    font-size: 0.8125rem;
    color: var(--ink);
}

.t-ui-input.is-password {
    letter-spacing: 0.15em;
}

.t-ui-select {
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--outline);
    background: #fff;
    font-size: 0.8125rem;
}

.t-ui-opt.is-selected {
    font-weight: 700;
    color: var(--sky-deep);
}

.t-ui-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.t-ui-check-box {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--outline);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
}

.t-ui-check.is-on .t-ui-check-box {
    background: var(--sky);
    border-color: var(--sky);
    color: #fff;
}

.t-ui-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.t-ui-table th,
.t-ui-table td {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--outline);
    text-align: start;
}

.t-ui-table th {
    background: var(--background);
    font-weight: 700;
}

.t-ui-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.5rem;
}

.t-ui-stat {
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-card);
    border: 1px solid var(--outline);
    background: var(--background);
    border-inline-end: 3px solid var(--sky);
}

.t-ui-stat-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--ink-muted);
}

.t-ui-stat-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
}

.t-ui-term {
    margin: 0;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-btn);
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.75rem;
    overflow-x: auto;
}

.t-ui-term code {
    font-family: var(--font-mono);
}

.t-ui-menu {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 14rem;
}

.t-ui-menu-item {
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-btn);
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.t-ui-menu-item.is-active {
    background: var(--sky-soft);
    color: var(--sky-deep);
}

/* Task inbox & decision */
.t-table-inbox .t-task-group + .t-task-group tr:first-child td {
    border-top: 1px solid var(--outline);
}

.t-task-inbox-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    justify-content: flex-end;
}

.t-task-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    justify-content: flex-end;
    position: relative;
}

.t-task-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-muted);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    position: relative;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.t-task-action-btn:hover {
    background: var(--surface-sunken);
    color: var(--ink);
    border-color: var(--outline);
}

.t-task-action-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

.t-task-action-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.2rem 0.45rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
    z-index: 20;
}

.t-task-action-btn[data-tooltip]:hover::after,
.t-task-action-btn[data-tooltip]:focus-visible::after {
    opacity: 1;
}

.t-task-action-review {
    color: var(--ink-muted);
}

.t-task-action-approve {
    color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.t-task-action-approve:hover {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.t-task-action-reject {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.t-task-action-reject:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.t-task-action-forward {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.t-task-action-forward:hover {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.t-task-action-revert {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}

.t-task-action-revert:hover {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.t-task-forward-wrap {
    position: relative;
    display: inline-flex;
}

.t-task-forward-pop {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 10rem;
}

.t-task-forward-pop .t-input {
    flex: 1;
    min-width: 0;
}

.t-task-quick-decide {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.t-task-quick-decide .t-input {
    width: auto;
    min-width: 6.5rem;
    max-width: 9rem;
}

.t-table-inbox td:last-child,
.t-table-inbox th:last-child {
    white-space: nowrap;
}

.t-task-panel-row td {
    padding: 0 !important;
    background: var(--surface-sunken);
}

.t-task-panel-slot {
    padding: 0.75rem 1rem;
}

.t-task-panel {
    display: grid;
    gap: 1rem;
}

.t-task-panel-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
}

.t-task-panel-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.t-task-panel-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.t-task-panel-value {
    font-size: 0.875rem;
    color: var(--ink);
}

.t-task-panel-data {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.t-task-panel-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin: 0 0 0.35rem;
}

.t-readonly-form-compact {
    font-size: 0.8125rem;
}

.t-readonly-form-compact .t-field,
.t-readonly-form-compact .form-group,
.t-readonly-form-compact label {
    margin-bottom: 0.35rem;
}

.t-task-decision {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.t-task-decision-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: end;
}

.t-task-decision-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.t-task-decision-form,
.t-task-decision-forward,
.t-task-decision-revert {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.t-task-decision-comment {
    grid-column: span 1;
}

.t-task-decision-actions {
    display: inline-flex;
    gap: 0.5rem;
    grid-column: 1 / -1;
}

.t-task-decision-extra-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.t-task-decision-forward,
.t-task-decision-revert {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

.t-task-decision-extra {
    font-size: 0.8125rem;
}

.t-task-decision-extra-toggle {
    cursor: pointer;
    color: var(--ink-muted);
    user-select: none;
}

.t-task-decision-extra-toggle:hover {
    color: var(--ink);
}

.t-input-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    min-height: 1.75rem;
}

.t-btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}

.t-btn.t-btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}

.t-btn-danger:hover:not(:disabled):not([disabled]),
.t-btn.t-btn-danger:hover:not(:disabled):not([disabled]) {
    background: color-mix(in srgb, var(--color-danger) 85%, #000);
    border-color: color-mix(in srgb, var(--color-danger) 85%, #000);
    color: #fff;
}

.t-btn-warning {
    background: var(--color-warning);
    color: #fff;
    border-color: var(--color-warning);
}

.t-btn-warning:hover:not(:disabled):not([disabled]) {
    background: color-mix(in srgb, var(--color-warning) 85%, #000);
}

.t-ui-card {
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
    overflow: hidden;
}

.t-ui-card-head {
    padding: 0.5rem 0.75rem;
    font-weight: 700;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--outline);
}

.t-ui-card-body {
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.t-ui-task {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--background);
}

.t-ui-task-title {
    font-weight: 700;
    font-size: 0.875rem;
}

.t-ui-task-meta {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: 0.15rem;
}

.t-help-steps li {
    margin-bottom: 0.35rem;
}

.t-help-steps li::marker {
    color: var(--sky);
    font-weight: 700;
}

/* Admin settings hub & sub-nav */
.t-admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.t-admin-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-muted);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.t-admin-nav-link:hover {
    color: var(--ink);
    background: var(--surface);
}

.t-admin-nav-link.is-active {
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.t-admin-hub {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}

.t-admin-hub-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.t-admin-hub-card:hover {
    border-color: var(--sky);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.t-admin-hub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-btn);
    background: linear-gradient(150deg, var(--brand-soft), color-mix(in srgb, var(--brand-color) 9%, var(--background)));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-color) 16%, transparent);
    color: var(--brand-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.t-admin-hub-icon .t-mask-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.t-admin-hub-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
}

.t-admin-hub-desc {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    line-height: 1.4;
}

/* Form chatbot widget */
.form-chatbot {
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius-card);
    background: var(--background);
    overflow: hidden;
}

.form-chatbot-disabled {
    min-height: 4rem;
}

.chatbot-header {
    display: flex;
    justify-content: flex-end;
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--outline-strong);
    background: var(--background);
}

.chatbot-reset {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}

.chatbot-reset:hover {
    color: var(--sky);
    background: var(--surface-sunken);
}

.chatbot-reset:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-messages {
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--surface-sunken);
}

.chatbot-msg {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatbot-msg-user {
    align-self: flex-end;
    background: var(--sky);
    color: #fff;
}

.chatbot-msg-bot {
    align-self: flex-start;
    background: var(--background);
    border: 1px solid var(--outline-strong);
    color: var(--ink);
}

.chatbot-msg-bot.thinking {
    opacity: 0.7;
    font-style: italic;
}

.chatbot-msg-bot.error {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.chatbot-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--outline-strong);
}

.chatbot-input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.chatbot-send {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--sky);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-source-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 1.5rem;
}

.chatbot-source-chip {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    background: var(--sky-soft);
    color: var(--sky-deep);
    border-radius: var(--radius-pill);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-modal-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    margin-bottom: 0.5rem;
}

.chatbot-modal-list {
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius-md);
    max-height: 10rem;
    overflow-y: auto;
}

.chatbot-modal-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--outline);
    cursor: pointer;
}

.chatbot-modal-row:last-child {
    border-bottom: none;
}

.chatbot-modal-row:hover:not(.opacity-50) {
    background: var(--surface-sunken);
}

.chatbot-modal-row input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* Formula builder tab (calculated field) */
.formula-tab-panel .formula-editor-bar {
    min-height: 0;
}

.formula-tab-panel .formula-editor-textarea {
    min-height: 8rem;
    max-height: 14rem;
}

.formula-tab-panel .formula-palette {
    max-height: 22vh;
}

.chatbot-sources-panel .chatbot-modal-list {
    max-height: none;
}

/* Formula builder modal (Power BI–style calculated field) */
.formula-modal {
    min-height: min(88vh, 52rem);
}

.formula-modal .formula-palette {
    max-height: min(42vh, 24rem);
}

.formula-modal .formula-palette-content {
    max-height: min(38vh, 22rem);
    overflow-y: auto;
    border: 1px solid var(--outline);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.formula-palette-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.formula-palette-subtab {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--outline);
    border-radius: 9999px;
    background: var(--surface);
    color: var(--ink-muted);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.formula-palette-subtab:hover {
    background: var(--sky-soft);
    border-color: var(--sky-mid);
    color: var(--sky-deep);
}

.formula-palette-subtab.is-active {
    background: var(--sky-soft);
    border-color: var(--sky-mid);
    color: var(--sky-deep);
}

.formula-modal .formula-editor-bar {
    min-height: 0;
}

.formula-modal .formula-editor-textarea {
    min-height: 12rem;
}

.calculated-value-panel .formula-preview-expr {
    word-break: break-all;
}

.formula-editor-bar {
    min-height: min(46vh, 22rem);
}

.formula-editor-textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: var(--surface-sunken);
    border-color: var(--outline-strong);
    resize: vertical;
    min-height: 16rem;
    line-height: 1.5;
}

.formula-editor-textarea:focus {
    outline: 2px solid var(--sky-mid);
    outline-offset: 1px;
    border-color: var(--sky-mid);
}

.formula-op-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.formula-op-btn {
    min-width: 2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-family: ui-monospace, monospace;
    border: 1px solid var(--outline-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.formula-op-btn:hover {
    background: var(--sky-soft);
    border-color: var(--sky-mid);
    color: var(--sky-deep);
}

.formula-palette-section {
    min-height: 0;
}

.formula-cat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin: 0.5rem 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.formula-palette-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-bottom: 1px solid var(--outline);
    background: transparent;
    text-align: start;
    cursor: pointer;
}

.formula-palette-item:last-child {
    border-bottom: none;
}

.formula-palette-item:hover {
    background: var(--surface-sunken);
}

.formula-field-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink);
}

.formula-field-id {
    font-size: 0.6875rem;
    color: var(--sky-deep);
    background: var(--sky-soft);
    padding: 0.0625rem 0.375rem;
    border-radius: var(--radius-sm);
}

.formula-fn-sig {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sky-deep);
}

.formula-fn-desc,
.formula-tpl-label {
    font-size: 0.6875rem;
    color: var(--ink-muted);
    line-height: 1.3;
}

.formula-tpl-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink);
}

.formula-preview-box {
    padding: 0.75rem 0.875rem;
    background: var(--surface-sunken);
    border: 1px solid var(--outline);
    border-radius: var(--radius-md);
    min-height: 8rem;
    max-height: 14rem;
    overflow-y: auto;
}

.formula-preview-expr {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
}

.formula-field-lookup.is-expanded {
    background: var(--sky-soft);
}

.formula-lookup-tag {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sky-deep);
    background: var(--sky-soft);
    padding: 0.0625rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-inline-start: 0.25rem;
}

.formula-lookup-panel {
    padding: 0.5rem 0.75rem 0.75rem;
    margin: 0 0 0.25rem;
    background: var(--surface-sunken);
    border-inline-start: 3px solid var(--sky-mid);
}

.formula-lookup-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin: 0.5rem 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.formula-lookup-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.formula-lookup-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-align: start;
    cursor: pointer;
    font-size: 0.75rem;
}

.formula-lookup-action:hover {
    border-color: var(--sky-mid);
    background: var(--sky-soft);
}

.formula-lookup-action code {
    font-size: 0.6875rem;
    color: var(--sky-deep);
}

.formula-lookup-value-row {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 0.375rem;
}

.formula-lookup-value-col {
    font-size: 0.6875rem;
    color: var(--ink-muted);
}

.formula-lookup-value-select {
    width: 100%;
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
    background: var(--surface);
}

/* Content variable palette (page builder text fields) */
.content-var-palette {
    max-height: 28vh;
    overflow-y: auto;
}

.content-var-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    margin: 0.5rem 0 0.35rem;
}

.content-var-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.content-var-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    background: var(--surface-muted, #f9fafb);
    font-size: 0.7rem;
    cursor: grab;
    text-align: start;
    max-width: 100%;
}

.content-var-chip:hover {
    border-color: var(--accent, #0ea5e9);
    background: var(--accent-muted, #f0f9ff);
}

.content-var-chip:active {
    cursor: grabbing;
}

.content-var-chip-label {
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
}

.content-var-chip-token {
    font-size: 0.65rem;
    color: var(--ink-muted);
}

.content-var-target.content-var-drop-active {
    outline: 2px solid var(--accent, #0ea5e9);
    outline-offset: 1px;
    background: var(--accent-muted, #f0f9ff);
}

.prefill-panel,
.form-action-panel {
    line-height: 1.45;
}

.passed-field-select {
    font-size: 0.75rem;
}

.form-action-steps {
    list-style: decimal;
    padding-inline-start: 1.25rem;
    margin: 0;
}

.form-action-steps li {
    padding-inline-start: 0.15rem;
}

/* Dashboard widgets (form builder dashboard tab) */
.dash-block {
    grid-column: 1 / -1;
}

.dash-widget {
    position: relative;
    background: var(--background);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 1.15rem 1.35rem;
    min-height: 8rem;
}

.dash-widget-header {
    margin-bottom: 0.75rem;
}

.dash-widget-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.dash-widget-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--background) 82%, transparent);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-card);
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.dash-widget-loading.hidden {
    display: none;
}

.dash-widget-error {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-danger);
}

.dash-kpi-card {
    text-align: center;
    padding: 0.5rem 0;
}

.dash-kpi-label {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin-bottom: 0.25rem;
}

.dash-kpi-value {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1.1;
}

.dash-kpi-meta {
    font-size: 0.75rem;
    color: var(--ink-subtle);
    margin-top: 0.25rem;
}

.dash-chart-wrap {
    width: 100%;
    overflow-x: auto;
}

.dash-chart-canvas {
    width: 100%;
    display: block;
    cursor: default;
}

.dash-widget[data-group-by]:not([data-click-filter="0"]) .dash-chart-canvas,
.dash-widget[data-group-by]:not([data-click-filter="0"]) .dash-progress-item[data-filter-index] {
    cursor: pointer;
}

.dash-chart-tooltip {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    padding: 0.35rem 0.55rem;
    border-radius: 0.375rem;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    font-size: 0.75rem;
    line-height: 1.35;
    max-width: 14rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
    white-space: nowrap;
}

.dash-chart-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-card);
    background: var(--surface-sunken);
    border: 1px solid var(--outline);
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.dash-chart-filter-bar.hidden {
    display: none;
}

.dash-chart-filter-bar strong {
    color: var(--ink);
    font-weight: 600;
}

.dash-chart-filter-clear {
    margin-inline-start: auto;
    padding: 0.2rem 0.55rem;
    border-radius: 0.375rem;
    border: 1px solid var(--outline);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.75rem;
    cursor: pointer;
}

.dash-chart-filter-clear:hover {
    background: var(--surface-sunken);
}

.dash-progress-item.is-filter-active .dash-progress-label {
    font-weight: 700;
}

.dash-progress-item.is-filter-dimmed {
    opacity: 0.45;
}

.dash-table-wrap {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.dash-table th,
.dash-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--outline);
    text-align: start;
}

.dash-table th {
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-subtle);
    background: var(--surface-sunken);
}

.dash-table-empty {
    text-align: center;
    color: var(--ink-subtle);
    padding: 1.5rem !important;
}

.dash-heading-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--brand-color);
}

.dash-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-sunken);
    border-radius: var(--radius-card);
    margin-bottom: 0.5rem;
}

.dash-filter-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-muted);
}

.dash-filter-control {
    border: 1px solid var(--outline);
    border-radius: var(--radius-btn);
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    background: var(--surface);
}

.dash-gauge-wrap {
    position: relative;
    text-align: center;
}

.dash-gauge-canvas {
    width: 100%;
    display: block;
    max-width: 280px;
    margin: 0 auto;
}

.dash-gauge-value {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin: 0.25rem 0 0;
}

.dash-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dash-progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dash-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.dash-progress-label {
    color: var(--ink);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-progress-value {
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.dash-progress-track {
    height: 0.5rem;
    background: var(--surface-sunken);
    border-radius: 999px;
    overflow: hidden;
}

.dash-progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.dash-progress-empty {
    text-align: center;
    color: var(--ink-subtle);
    font-size: 0.875rem;
    padding: 1rem 0;
}

.dash-kanban-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dash-kanban-hint {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--ink-subtle);
}

.dash-kanban-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(15rem, 1fr);
    gap: 0.875rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.dash-kanban-column {
    background: var(--surface-sunken);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    min-height: 10rem;
    display: flex;
    flex-direction: column;
}

.dash-kanban-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ink);
    border-bottom: 1px solid var(--outline);
}

.dash-kanban-count {
    min-width: 1.5rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-muted);
    text-align: center;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.dash-kanban-dropzone {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.75rem;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    transition: background 0.15s ease, outline-color 0.15s ease;
}

.dash-kanban-dropzone.is-over {
    background: rgba(59, 130, 246, 0.08);
    outline: 2px dashed var(--brand-color);
    outline-offset: -0.35rem;
}

.dash-kanban-card {
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: 0.875rem;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: grab;
}

.dash-kanban-card[draggable="false"] {
    cursor: default;
}

.dash-kanban-card.is-dragging {
    opacity: 0.55;
}

.dash-kanban-card.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

.dash-kanban-card-title {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.875rem;
    line-height: 1.35;
}

.dash-kanban-card-meta {
    color: var(--ink-subtle);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.dash-kanban-card-fields {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--outline);
}

.dash-kanban-card-field {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.dash-kanban-card-field span {
    color: var(--ink-subtle);
}

.dash-kanban-card-field strong {
    color: var(--ink-muted);
    font-weight: 600;
    text-align: end;
}

.dash-kanban-empty {
    margin: auto 0;
    text-align: center;
    color: var(--ink-subtle);
    font-size: 0.8125rem;
    padding: 1rem 0.25rem;
}

.dash-kanban-empty-muted {
    min-height: 2.5rem;
    padding: 0.5rem;
}

/* Calendar widget */
.dash-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dash-calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-calendar-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ink);
    min-width: 8.5rem;
    text-align: center;
}

.dash-calendar-btn {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--outline);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--ink);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.dash-calendar-btn:hover {
    background: var(--surface-sunken);
}

.dash-calendar-weekdays,
.dash-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.dash-calendar-weekdays {
    margin-bottom: 0.25rem;
}

.dash-calendar-weekday {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--ink-subtle);
    padding: 0.25rem 0;
}

.dash-calendar-day {
    min-height: 4.75rem;
    border: 1px solid var(--outline);
    border-radius: 0.625rem;
    background: var(--surface);
    padding: 0.3rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.dash-calendar-day.is-empty {
    border-color: transparent;
    background: transparent;
}

.dash-calendar-day.is-today {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 1px var(--brand-color) inset;
}

.dash-calendar-day.has-events {
    background: var(--surface-sunken);
}

.dash-calendar-daynum {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-subtle);
    text-align: end;
}

.dash-calendar-day.is-today .dash-calendar-daynum {
    color: var(--brand-color);
}

.dash-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 0;
}

.dash-calendar-event {
    font-size: 0.6875rem;
    line-height: 1.2;
    padding: 0.1rem 0.3rem;
    border-radius: 0.35rem;
    background: color-mix(in srgb, var(--brand-color) 16%, transparent);
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-calendar-more {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--ink-subtle);
    padding: 0 0.3rem;
}

.dash-info {
    background: var(--surface-sunken);
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    padding: 0.875rem 1rem;
    border-inline-start: 3px solid var(--brand-color);
}

.dash-info-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.35rem;
}

.dash-info-body {
    font-size: 0.8125rem;
    color: var(--ink-muted);
    margin: 0;
    line-height: 1.5;
}

.dash-divider-line {
    border: none;
    border-top: 1px solid var(--outline);
    margin: 0.75rem 0;
}

.dash-props {
    background: #ecfdf5;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

/* Element design system (form builder) */
.props-tab {
    color: var(--ink-muted, #64748b);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.props-tab:hover {
    color: var(--ink, #0f172a);
}

.props-tab-bar .props-tab.active {
    background: var(--brand-soft, #eff6ff);
    color: var(--brand-color, #3b82f6);
}

.design-preset-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.design-chip {
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1px solid var(--outline, #e2e8f0);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--ink-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s ease;
}

.design-chip:hover {
    border-color: var(--brand-color, #3b82f6);
    color: var(--brand-color, #3b82f6);
}

.design-chip.active {
    background: var(--brand-color, #3b82f6);
    border-color: var(--brand-color, #3b82f6);
    color: #fff;
}

.design-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted, #64748b);
    margin-bottom: 0.5rem;
}

.design-section + .design-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--outline, #f1f5f9);
}

.design-range {
    accent-color: var(--brand-color, #3b82f6);
    height: 0.375rem;
}

.design-color-swatch {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--outline, #e2e8f0);
    border-radius: 0.375rem;
    cursor: pointer;
    background: none;
}

.elem-align-start { text-align: start; }
.elem-align-center { text-align: center; }
.elem-align-end { text-align: end; }

/* The element-level alignment control must win over inner button/media wrappers
   that hardcode their own alignment (e.g. .web-cta is always centered), otherwise
   Start/End do nothing on buttons. Constrained images align via auto margins. */
.elem-align-start :is(.web-cta, .web-image-btn) { text-align: start; }
.elem-align-center :is(.web-cta, .web-image-btn) { text-align: center; }
.elem-align-end :is(.web-cta, .web-image-btn) { text-align: end; }

.elem-align-start .web-image-block img { margin-inline-start: 0; margin-inline-end: auto; }
.elem-align-center .web-image-block img { margin-inline: auto; }
.elem-align-end .web-image-block img { margin-inline-start: auto; margin-inline-end: 0; }

.elem-text-sm { font-size: 0.875rem; }
.elem-text-base { font-size: 1rem; }
.elem-text-lg { font-size: 1.125rem; }
.elem-text-xl { font-size: 1.25rem; }
.elem-text-2xl { font-size: 1.5rem; }

.elem-weight-normal { font-weight: 400; }
.elem-weight-medium { font-weight: 500; }
.elem-weight-semibold { font-weight: 600; }
.elem-weight-bold { font-weight: 700; }

.elem-leading-tight { line-height: 1.25; }
.elem-leading-relaxed { line-height: 1.625; }
.elem-leading-loose { line-height: 1.85; }

.elem-radius-none { border-radius: 0; overflow: hidden; }
.elem-radius-sm { border-radius: 0.375rem; overflow: hidden; }
.elem-radius-md { border-radius: 0.5rem; overflow: hidden; }
.elem-radius-lg { border-radius: 0.75rem; overflow: hidden; }
.elem-radius-xl { border-radius: 1rem; overflow: hidden; }
.elem-radius-full { border-radius: 9999px; overflow: hidden; }

.elem-shadow-none { box-shadow: none; }
.elem-shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.elem-shadow-md { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); }
.elem-shadow-lg { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12); }

.elem-border-none { border: none; }
.elem-border-subtle { border: 1px solid var(--outline, #e2e8f0); }
.elem-border-strong { border: 2px solid var(--outline-strong, #cbd5e1); }

.elem-max-full { max-width: 100%; margin-inline: auto; }
.elem-max-prose { max-width: 42rem; margin-inline: auto; }
.elem-max-narrow { max-width: 28rem; margin-inline: auto; }

.elem-preset-card > .web-block,
.elem-preset-card {
    background: var(--surface, #fff);
}

.elem-preset-highlight {
    background: var(--brand-soft, #eff6ff);
}

.elem-preset-hero .web-hero,
.elem-preset-hero {
    background: linear-gradient(135deg, var(--brand-soft) 0%, var(--surface-sunken) 100%);
}

.form-page-shell {
    padding: 1rem 0;
}

.form-page-canvas {
    flex: 1;
    width: 100%;
    min-height: calc(100dvh - var(--form-page-chrome, 4.75rem));
    margin-inline: calc(-1 * var(--main-inline-pad, 1rem));
    padding-inline: var(--main-inline-pad, 1rem);
    padding-bottom: 1.5rem;
}

body.t-app:has(main .form-page-canvas) {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

body.t-app:has(main .form-page-canvas) main.t-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

main.t-main > .form-page-canvas {
    display: flex;
    flex-direction: column;
}

.t-main-wide > .form-page-canvas {
    --main-inline-pad: 0.75rem;
}

@media (min-width: 1024px) {
    .t-main-wide > .form-page-canvas {
        --main-inline-pad: 1.25rem;
    }
}

.form-page-canvas-preview {
    min-height: 60vh;
    margin-inline: 0;
    padding: 1rem;
    border-radius: 0.75rem;
}

.form-page-design {
    margin-inline: auto;
    padding: 1.25rem;
    background: var(--background);
    border-radius: var(--radius-card, 0.75rem);
    box-shadow: var(--shadow-card);
}

.form-page-width-narrow { max-width: 40rem; }
.form-page-width-medium { max-width: 56rem; }
.form-page-width-wide { max-width: 72rem; }
.form-page-width-full { max-width: 100%; }

.form-page-width-full.form-page-design {
    margin-inline: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.form-page-width-full .form-page-shell {
    padding: 0;
}

.form-gap-compact .form-grid-12 { gap: 0.5rem; }
.form-gap-normal .form-grid-12 { gap: 1rem; }
.form-gap-spacious .form-grid-12 { gap: 1.5rem; }

.form-block-spacing-compact .form-field { margin-bottom: 0.5rem !important; }
.form-block-spacing-normal .form-field { margin-bottom: 1rem !important; }
.form-block-spacing-spacious .form-field { margin-bottom: 1.75rem !important; }

.form-align-center .form-grid-12 { text-align: center; }
.form-align-end .form-grid-12 { text-align: end; }

.form-page-design.form-content-radius-none { border-radius: 0; }
.form-page-design.form-content-radius-sm { border-radius: 0.375rem; }
.form-page-design.form-content-radius-md { border-radius: 0.5rem; }
.form-page-design.form-content-radius-lg { border-radius: 0.75rem; }

.form-card-shadow-none { box-shadow: none; }
.form-card-shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.form-card-shadow-md { box-shadow: var(--shadow-card, 0 4px 12px rgba(15, 23, 42, 0.08)); }
.form-card-shadow-lg { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12); }

.form-card-border-none { border: none; }
.form-card-border-subtle { border: 1px solid var(--outline, #e2e8f0); }
.form-card-border-strong { border: 2px solid var(--outline-strong, #cbd5e1); }

.form-card-padding-compact { padding: 0.75rem; }
.form-card-padding-normal { padding: 1.25rem; }
.form-card-padding-spacious { padding: 2rem; }

.form-page-design[style*="--brand-color"] .web-cta,
.form-page-design[style*="--brand-color"] .t-btn-primary,
.form-page-design[style*="--brand-color"] button[type="submit"] {
    background-color: var(--brand-color);
}

.form-content-radius-none .form-grid-12 > .form-field { border-radius: 0; }
.form-content-radius-sm .form-grid-12 > .form-field { border-radius: 0.375rem; }
.form-content-radius-md .form-grid-12 > .form-field { border-radius: 0.5rem; }
.form-content-radius-lg .form-grid-12 > .form-field { border-radius: 0.75rem; }

.elem-variant-centered .web-hero { text-align: center; }
.elem-variant-left .web-hero { text-align: start; }
.elem-variant-left .web-hero-subtitle { margin-inline: 0; }
.elem-variant-minimal .web-hero { padding: 1.5rem; background: transparent; }
.elem-variant-cards .web-feature-grid,
.elem-variant-cards .web-pricing-grid { display: grid; }
.elem-variant-list .web-feature-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.elem-variant-list .web-feature-card { display: flex; gap: 1rem; align-items: flex-start; }
.elem-variant-full_bleed .web-image { border-radius: 0; max-height: none; }
.elem-variant-full_bleed .web-image-btn-img { border-radius: 0; max-width: none; width: 100%; }
.elem-variant-rounded .web-image { border-radius: 1rem; }
.elem-variant-rounded .web-image-btn-img { border-radius: 1rem; }
.elem-variant-outline .web-btn-primary { background: transparent; color: var(--brand-color); border: 2px solid var(--brand-color); }
.elem-variant-bordered .web-block { border-inline-start: 4px solid var(--brand-color); padding-inline-start: 1.25rem; }
.elem-variant-large .web-block { font-size: 1.25rem; }
.elem-variant-narrow .web-paragraph { max-width: 36rem; margin-inline: auto; }
.elem-variant-lead .web-paragraph p { font-size: 1.25rem; line-height: 1.8; color: var(--ink); }

.elem-variant-horizontal .web-steps-list { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.elem-variant-vertical .web-step { flex-direction: column; text-align: center; align-items: center; }
.elem-variant-compact .web-team-card { padding: 0.75rem; }
.elem-variant-compact .web-team-photo { width: 3.5rem; height: 3.5rem; }
.elem-variant-minimal .web-team-card { box-shadow: none; background: transparent; }
.elem-variant-scroll .web-logo-grid { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
.elem-variant-muted .web-logo-img { opacity: 0.5; }
.elem-variant-accent .web-banner { background: var(--ink); }
.elem-variant-alternating .web-timeline-item:nth-child(even) { padding-inline-start: 1rem; }
.elem-variant-inline .web-newsletter-form { flex-direction: row; }
.elem-variant-overlay .web-content-card { position: relative; }
.elem-variant-overlay .web-card-body { position: absolute; inset-inline: 0; bottom: 0; background: linear-gradient(transparent, rgba(15, 23, 42, 0.85)); color: #fff; }
.elem-variant-overlay .web-card-desc { color: rgba(255, 255, 255, 0.85); }
.elem-variant-striped .web-comparison-table tbody tr:nth-child(even) { background: var(--surface-sunken); }
.elem-variant-rounded .web-carousel-img { border-radius: 1rem; }
.elem-variant-minimal .web-carousel-controls { display: none; }
.elem-variant-bordered .web-collapsible-item { border-inline-start: 4px solid var(--brand-color, #0ea5e9); }
.elem-variant-compact .web-collapsible-summary { padding: 0.625rem 0.875rem; }
.elem-variant-compact .web-collapsible-body { padding: 0 0.875rem 0.75rem; font-size: 0.875rem; }

/* Per-element website & dashboard design */
.elem-cols-2 .web-feature-grid,
.elem-cols-2 .web-pricing-grid,
.elem-cols-2 .web-team-grid,
.elem-cols-2 .web-gallery-grid,
.elem-cols-2 .web-cards-grid,
.elem-cols-2 .web-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.elem-cols-3 .web-feature-grid,
.elem-cols-3 .web-pricing-grid,
.elem-cols-3 .web-team-grid,
.elem-cols-3 .web-gallery-grid,
.elem-cols-3 .web-cards-grid,
.elem-cols-3 .web-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.elem-cols-4 .web-feature-grid,
.elem-cols-4 .web-pricing-grid,
.elem-cols-4 .web-team-grid,
.elem-cols-4 .web-gallery-grid,
.elem-cols-4 .web-cards-grid,
.elem-cols-4 .web-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.elem-gap-compact .web-feature-grid,
.elem-gap-compact .web-pricing-grid,
.elem-gap-compact .web-team-grid,
.elem-gap-compact .web-gallery-grid,
.elem-gap-compact .web-cards-grid,
.elem-gap-compact .web-stats-grid,
.elem-gap-compact .web-steps-list { gap: 0.5rem; }
.elem-gap-normal .web-feature-grid,
.elem-gap-normal .web-pricing-grid,
.elem-gap-normal .web-team-grid,
.elem-gap-normal .web-gallery-grid,
.elem-gap-normal .web-cards-grid,
.elem-gap-normal .web-stats-grid,
.elem-gap-normal .web-steps-list { gap: 1rem; }
.elem-gap-spacious .web-feature-grid,
.elem-gap-spacious .web-pricing-grid,
.elem-gap-spacious .web-team-grid,
.elem-gap-spacious .web-gallery-grid,
.elem-gap-spacious .web-cards-grid,
.elem-gap-spacious .web-stats-grid,
.elem-gap-spacious .web-steps-list { gap: 1.5rem; }

.elem-fit-cover .web-image { object-fit: cover; width: 100%; }
.elem-fit-contain .web-image { object-fit: contain; width: 100%; }
.form-field[style*="--elem-image-height"] .web-image { height: var(--elem-image-height); max-height: var(--elem-image-height); }
.form-field[style*="--elem-image-height"] .web-image-btn-img { height: var(--elem-image-height); max-height: var(--elem-image-height); width: auto; }
.form-field[style*="--elem-min-height"] .web-hero,
.form-field[style*="--elem-min-height"] .web-banner,
.form-field[style*="--elem-min-height"] .web-image-block,
.form-field[style*="--elem-min-height"] .dash-table-wrap { min-height: var(--elem-min-height); }

.elem-variant-underline .dash-heading-title { border-bottom: 2px solid var(--elem-accent, var(--brand-color)); padding-bottom: 0.5rem; }
.elem-variant-minimal .dash-heading-title { font-size: 1rem; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.elem-overlay-light .web-hero,
.elem-overlay-light .web-image-block,
.elem-overlay-light .web-banner { position: relative; }
.elem-overlay-light .web-hero::after,
.elem-overlay-light .web-image-block::after,
.elem-overlay-light .web-banner::after {
    content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.35); pointer-events: none; border-radius: inherit;
}
.elem-overlay-dark .web-hero::after,
.elem-overlay-dark .web-image-block::after,
.elem-overlay-dark .web-banner::after {
    content: ''; position: absolute; inset: 0; background: rgba(15,23,42,0.45); pointer-events: none; border-radius: inherit;
}

.elem-btn-filled .web-btn-primary { background: var(--elem-accent, var(--brand-color)); border-color: var(--elem-accent, var(--brand-color)); color: #fff; }
body.t-app .elem-btn-filled a.web-btn-primary,
body.t-app .elem-btn-filled a.web-btn-primary:hover { color: #fff; }
.elem-btn-outline .web-btn-primary { background: transparent; color: var(--elem-accent, var(--brand-color)); border: 2px solid var(--elem-accent, var(--brand-color)); }
body.t-app .elem-btn-outline a.web-btn-primary,
body.t-app .elem-btn-outline a.web-btn-primary:hover { color: var(--elem-accent, var(--brand-color)); }
.elem-btn-ghost .web-btn-primary { background: transparent; color: var(--elem-accent, var(--brand-color)); border: none; box-shadow: none; }
body.t-app .elem-btn-ghost a.web-btn-primary,
body.t-app .elem-btn-ghost a.web-btn-primary:hover { color: var(--elem-accent, var(--brand-color)); }

.elem-hide-title .dash-widget-header { display: none; }

.elem-kpi-sm .dash-kpi-value { font-size: 1.5rem; }
.elem-kpi-md .dash-kpi-value { font-size: 2rem; }
.elem-kpi-lg .dash-kpi-value { font-size: 2.5rem; }
.elem-kpi-xl .dash-kpi-value { font-size: 3rem; }

.elem-dash-flat .dash-widget,
.elem-dash-flat .dash-kpi-card { box-shadow: none; background: var(--surface-sunken); }
.elem-dash-elevated .dash-widget { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1); border: none; }
.elem-dash-bordered .dash-widget { border-width: 2px; border-color: var(--elem-accent, var(--outline-strong)); }

.form-field[style*="--elem-chart-height"] .dash-chart-canvas,
.form-field[style*="--elem-chart-height"] .dash-gauge-canvas { height: var(--elem-chart-height); }

.elem-table-compact .dash-table th,
.elem-table-compact .dash-table td { padding: 0.25rem 0.5rem; }
.elem-table-comfortable .dash-table th,
.elem-table-comfortable .dash-table td { padding: 0.75rem 1rem; }

.elem-variant-horizontal .dash-chart-wrap { min-height: 12rem; }
.elem-variant-emphasis .dash-kpi-value { letter-spacing: -0.02em; }
.elem-variant-compact .dash-widget { padding: 0.75rem; min-height: 6rem; }
.elem-variant-callout .dash-info { border-inline-start: 4px solid var(--elem-accent, var(--brand-color)); padding-inline-start: 1rem; background: var(--surface-sunken); border-radius: 0.5rem; }
.elem-variant-smooth .dash-chart-canvas { filter: saturate(1.1); }
.elem-variant-gradient .dash-chart-wrap { background: linear-gradient(180deg, transparent, var(--surface-sunken)); border-radius: 0.5rem; }
.elem-variant-labeled .dash-progress-label { font-weight: 600; }

.app-context-bar {
    flex-shrink: 0;
    overflow: visible;
    background: var(--surface-raised, #fff);
    border: 1px solid var(--outline, #e5e7eb);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem 0;
}

.app-context-breadcrumb a.t-btn-link {
    color: var(--ink-muted, #6b7280);
}

.app-page-tabs-wrap {
    margin-inline: -1rem;
    padding-inline: 1rem;
}

.app-page-tabs {
    scrollbar-width: thin;
}

.app-page-tab-item {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.app-page-tab-item:not(.border-sky-400):hover {
    background: color-mix(in srgb, var(--sky, #0ea5e9) 6%, #fff);
}

/* Legal documents */
.t-legal-card {
    color: inherit;
}

.t-legal h2 {
    scroll-margin-top: 5rem;
}

.t-legal-section + .t-legal-section {
    border-top: 1px solid var(--outline, #f3f4f6);
    padding-top: 2rem;
}

.t-legal-footer a {
    text-decoration: none;
}

.t-legal-footer a:hover {
    text-decoration: underline;
}


/* ==========================================================================
   Partner portal
   ========================================================================== */

.t-partner-app {
    background: var(--surface);
}

.t-partner-nav .t-brand-text {
    font-size: 1rem;
}

.t-partner-hero {
    position: relative;
    overflow: hidden;
}

.t-partner-sales-deck {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, color-mix(in srgb, var(--sky) 8%, var(--background)), var(--surface-sunken));
}

.t-partner-sales-deck--compact {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
}

.t-partner-sales-deck-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.t-partner-sales-deck-body {
    flex: 1 1 12rem;
    min-width: 0;
}

.t-partner-sales-deck-title {
    margin: 0;
    font-weight: 700;
    color: var(--ink);
    font-size: 0.9375rem;
}

.t-partner-sales-deck-copy {
    margin: 0.25rem 0 0;
    color: var(--ink-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.t-partner-sales-deck-btn {
    flex-shrink: 0;
}

.t-partner-commission-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    min-height: 5.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-modal);
    background: linear-gradient(135deg, var(--sky-deep), var(--brand-color));
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    box-shadow: var(--shadow-card-hover);
}

.t-partner-referral-card .t-card-header {
    align-items: flex-start;
}

.t-partner-copy-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
}

.t-partner-copy-input {
    flex: 1 1 14rem;
    min-width: 0;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--outline);
    border-radius: var(--radius-input);
    background: var(--surface-sunken);
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.4;
    word-break: break-all;
}

.t-partner-payout-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 900px) {
    .t-partner-payout-grid {
        grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
        align-items: start;
    }
}

.t-partner-payout-form .t-card-header,
.t-partner-apply-form .t-card-header {
    flex-direction: column;
    align-items: flex-start;
}

.t-card-header--divider {
    border-top: 1px solid var(--outline);
}

.t-card-body--flush {
    padding: 0;
}

.t-card-body--flush .t-table-wrap {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.t-partner-form-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .t-partner-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Mobile responsiveness pass
   ========================================================================== */

/* Data tables: keep cells on one line so the wrapper scrolls horizontally
   instead of squashing columns into an unreadable mess on small screens. */
@media (max-width: 767px) {
    .t-table-wrap .t-table th,
    .t-table-wrap .t-table td {
        white-space: nowrap;
    }
}

/* Builders stack their palette / canvas / properties panels below the lg
   breakpoint. The desktop shell locks the body to 100vh with overflow:hidden
   so the panels can scroll internally; on mobile that traps the stacked panels
   off-screen. Unlock document scrolling and let the panels grow naturally. */
@media (max-width: 1023px) {
    body.t-app-builder,
    body.builder-mode.t-app {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .t-main-builder {
        overflow: visible;
        min-height: 0;
    }

    /* The field palette would otherwise expand to its full (very long) list and
       dominate the page — keep it bounded with its own scroll. */
    #field-palette {
        max-height: 60vh;
    }

    /* Canvas and properties panels should flow with the page rather than trap
       content behind an inner scrollbar that has no bounded height on mobile. */
    #fields-container,
    #form-canvas,
    #field-props {
        overflow: visible;
        max-height: none;
    }
}

/* Builder canvas multi-column rows (2/3/4-up) collapse to a single column on
   phones, matching how the published form renders. The grid template is set
   inline, so an !important override is required. */
@media (max-width: 639px) {
    .field-row-cols {
        grid-template-columns: 1fr !important;
    }

    .field-row-cols.field-row-sep-dashed > .field-item + .field-item,
    .field-row-cols.field-row-sep-solid > .field-item + .field-item,
    .field-row-cols.field-row-sep-dotted > .field-item + .field-item {
        border-inline-start: none;
        padding-inline-start: 0;
    }
}

/* Public share-page tabs: allow horizontal scroll when there are more tabs
   (Submit, Submissions, custom pages) than fit the viewport. */
.t-share-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.t-share-tabs::-webkit-scrollbar {
    display: none;
}

.share-tab,
.t-share-tab {
    white-space: nowrap;
    flex: 0 0 auto;
}

/* Public/marketing pages */
@media (max-width: 767px) {
    .public-header {
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .public-header-brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .public-header-brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .public-header-nav {
        flex: 0 1 auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: min(68vw, 18rem);
        gap: 0.4rem;
    }

    .public-header-nav .t-btn {
        min-height: 2.25rem;
        padding: 0.45rem 0.7rem;
        border-radius: 999px;
        font-size: 0.78rem;
    }

    .t-login-card {
        width: min(100%, 28rem);
    }

    .t-demo-account {
        overflow-wrap: anywhere;
        white-space: normal;
        text-align: start;
    }
}

.landing-mobile-nav {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.landing-mobile-nav::-webkit-scrollbar {
    display: none;
}

/* Compact circular button by default; expands to a labelled pill on hover/focus
   so the WhatsApp affordance stays discoverable without a persistent big label. */
.whatsapp-fab {
    color: #fff;
    text-decoration: none;
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    gap: 0;
    justify-content: center;
    overflow: hidden;
    transition: width .25s ease, padding .25s ease, gap .25s ease,
        background-color .2s ease, box-shadow .2s ease;
}

.whatsapp-fab > span {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width .25s ease, opacity .2s ease;
}

.whatsapp-fab:hover,
.whatsapp-fab:focus-visible {
    width: auto;
    padding-inline: 1.1rem;
    gap: 0.6rem;
}

.whatsapp-fab:hover > span,
.whatsapp-fab:focus-visible > span {
    max-width: 14rem;
    opacity: 1;
}

body.t-app a.whatsapp-fab,
body.t-app a.whatsapp-fab:hover {
    color: #fff;
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .whatsapp-fab,
    .whatsapp-fab > span {
        transition: none;
    }
}

@media (max-width: 639px) {
    .whatsapp-fab {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        inset-inline-end: calc(1rem + env(safe-area-inset-right, 0px));
    }

    /* No hover on touch: keep it icon-only and never expand. */
    .whatsapp-fab:hover,
    .whatsapp-fab:focus-visible {
        width: 3.25rem;
        padding-inline: 0;
        gap: 0;
    }

    .whatsapp-fab > span {
        display: none;
    }

    body:has(.whatsapp-fab) main,
    body:has(.whatsapp-fab) .t-login-page {
        padding-bottom: 4.75rem;
    }

    .t-template-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .t-template-card-actions {
        margin-inline-start: 0;
    }
}

/* ML dashboard widgets */
.dash-ml-metrics {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 9999px;
    padding: 0.15rem 0.55rem;
    margin-inline-start: 0.5rem;
}

.dash-ml-setup {
    font-size: 0.875rem;
    color: var(--ink-subtle, #64748b);
    padding: 0.75rem 0;
    text-align: center;
}

.dash-ml-mismatch {
    background: #fef2f2;
}

.dash-ml-table tbody tr.dash-ml-mismatch:hover {
    background: #fee2e2;
}

.dash-ml-regression .dash-widget-header,
.dash-ml-classification .dash-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dash-ml-predict {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.dash-ml-predict-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}

.dash-ml-predict-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
    flex: 1 1 auto;
    min-width: 0;
}

.dash-ml-predict-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 5.5rem;
    flex: 1 1 7rem;
    max-width: 12rem;
}

.dash-ml-predict-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-ml-predict-control {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
    background: #fff;
}

.dash-ml-predict-btn {
    flex-shrink: 0;
    align-self: flex-end;
}

.dash-ml-predict-result {
    flex: 1 1 100%;
    font-size: 0.95rem;
    font-weight: 600;
    color: #059669;
    padding: 0.25rem 0;
}

.dash-ml-predict-result.dash-ml-predict-error {
    color: #dc2626;
    font-weight: 500;
}

.dash-ml-predict-conf {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
}

.dash-ml-predict-hint {
    margin: 0.35rem 0 0;
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Capacitor native shell — share public pages */
body.capacitor-host {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

body.capacitor-host .t-share-shell {
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

body.capacitor-host.capacitor-offline::before {
    content: attr(data-offline-label);
    position: fixed;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: #0f172a;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    pointer-events: none;
}


/* ==========================================================================
   Dark theme tokens + Tailwind→token compatibility bridge
   - Dark palette flips design tokens; components styled via tokens follow.
   - The bridge remaps hardcoded Tailwind color utilities onto tokens so the
     ~1200 utility usages across templates tokenize (and go dark) in one place.
   ========================================================================== */

/* ---- Dark palette: applied on OS preference (unless user forced light) ---- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #172034;
        --surface: #0C1322;
        --surface-sunken: #080E1A;
        --surface-elevated: #1E2A44;

        --ink: #E7EDF6;
        --ink-muted: #AEBBCF;
        --ink-subtle: #77869E;
        --ink-faint: #47546B;

        --outline: #28334B;
        --outline-strong: #3C4A64;

        --brand-soft: color-mix(in srgb, var(--brand-color) 26%, #0C1322);
        --sky-soft: color-mix(in srgb, var(--sky) 26%, #0C1322);
        --leaf-soft: color-mix(in srgb, var(--leaf) 24%, #0C1322);
        --coral-soft: color-mix(in srgb, var(--coral) 26%, #0C1322);
        --berry-soft: color-mix(in srgb, var(--berry) 26%, #0C1322);
        --color-warning-bg: color-mix(in srgb, var(--sun) 22%, #0C1322);
        --color-amber-bg: color-mix(in srgb, var(--sun) 22%, #0C1322);

        --shadow-card: 0 0 0 1px var(--outline), 0 2px 4px rgba(0, 0, 0, 0.30), 0 12px 28px -12px rgba(0, 0, 0, 0.55);
        --shadow-card-hover: 0 0 0 1px color-mix(in srgb, var(--brand-color) 40%, var(--outline)), 0 16px 40px -8px rgba(0, 0, 0, 0.60);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);
    }
}

/* ---- Explicit user choice always wins over OS preference ---- */
:root[data-theme="dark"] {
    --background: #172034;
    --surface: #0C1322;
    --surface-sunken: #080E1A;
    --surface-elevated: #1E2A44;

    --ink: #E7EDF6;
    --ink-muted: #AEBBCF;
    --ink-subtle: #77869E;
    --ink-faint: #47546B;

    --outline: #28334B;
    --outline-strong: #3C4A64;

    --brand-soft: color-mix(in srgb, var(--brand-color) 26%, #0C1322);
    --sky-soft: color-mix(in srgb, var(--sky) 26%, #0C1322);
    --leaf-soft: color-mix(in srgb, var(--leaf) 24%, #0C1322);
    --coral-soft: color-mix(in srgb, var(--coral) 26%, #0C1322);
    --berry-soft: color-mix(in srgb, var(--berry) 26%, #0C1322);
    --color-warning-bg: color-mix(in srgb, var(--sun) 22%, #0C1322);
    --color-amber-bg: color-mix(in srgb, var(--sun) 22%, #0C1322);

    --shadow-card: 0 0 0 1px var(--outline), 0 2px 4px rgba(0, 0, 0, 0.30), 0 12px 28px -12px rgba(0, 0, 0, 0.55);
    --shadow-card-hover: 0 0 0 1px color-mix(in srgb, var(--brand-color) 40%, var(--outline)), 0 16px 40px -8px rgba(0, 0, 0, 0.60);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);
}

/* ---- Tailwind utility → token bridge (scoped to app; wins on specificity) ---- */
body.t-app .text-gray-900,
body.t-app .text-gray-800,
body.t-app .text-gray-700 { color: var(--ink); }
body.t-app .text-gray-600,
body.t-app .text-gray-500 { color: var(--ink-muted); }
body.t-app .text-gray-400 { color: var(--ink-subtle); }
body.t-app .text-gray-300 { color: var(--ink-faint); }
body.t-app .text-sky-500,
body.t-app .text-sky-600,
body.t-app .text-sky-700 { color: var(--brand-color); }

body.t-app .bg-white { background-color: var(--surface-elevated); }
body.t-app .bg-gray-50,
body.t-app .bg-gray-100 { background-color: var(--surface-sunken); }
body.t-app .hover\:bg-gray-50:hover,
body.t-app .hover\:bg-gray-100:hover { background-color: var(--surface-sunken); }
body.t-app .bg-sky-50,
body.t-app .bg-sky-100 { background-color: var(--brand-soft); }
body.t-app .bg-sky-600,
body.t-app .bg-sky-700 { background-color: var(--brand-color); }
body.t-app .hover\:bg-sky-700:hover { background-color: var(--brand-hover); }

body.t-app .border-gray-100,
body.t-app .border-gray-200 { border-color: var(--outline); }
body.t-app .border-gray-300 { border-color: var(--outline-strong); }
body.t-app .divide-gray-100 > * + *,
body.t-app .divide-gray-200 > * + *,
body.t-app .divide-y > * + * { border-color: var(--outline); }

/* Builder palette category tints → one restrained token hover */
body.t-app .hover\:bg-sky-50:hover,
body.t-app .hover\:bg-violet-50:hover,
body.t-app .hover\:bg-emerald-50:hover,
body.t-app .hover\:bg-amber-50:hover { background-color: var(--brand-soft); }
body.t-app .hover\:border-sky-400:hover,
body.t-app .hover\:border-violet-400:hover,
body.t-app .hover\:border-emerald-400:hover,
body.t-app .hover\:border-amber-400:hover { border-color: color-mix(in srgb, var(--brand-color) 45%, var(--outline)); }

/* Smooth the theme switch */
body.t-app,
body.t-app .t-card,
body.t-app .t-stat,
body.t-app .t-nav,
body.t-app .bg-white {
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

/* Theme toggle button */
.t-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--outline);
    border-radius: var(--radius-pill);
    background: var(--surface-elevated);
    color: var(--ink-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.t-theme-toggle:hover {
    color: var(--brand-color);
    border-color: color-mix(in srgb, var(--brand-color) 40%, var(--outline));
    background: var(--brand-soft);
}

.t-theme-toggle .t-theme-icon-moon { display: block; }
.t-theme-toggle .t-theme-icon-sun { display: none; }

:root[data-theme="light"] .t-theme-toggle .t-theme-icon-moon { display: block; }
:root[data-theme="light"] .t-theme-toggle .t-theme-icon-sun { display: none; }

:root[data-theme="dark"] .t-theme-toggle .t-theme-icon-moon { display: none; }
:root[data-theme="dark"] .t-theme-toggle .t-theme-icon-sun { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .t-theme-toggle .t-theme-icon-moon { display: none; }
    :root:not([data-theme="light"]) .t-theme-toggle .t-theme-icon-sun { display: block; }
}


/* ==========================================================================
   Motion pass — smooth page transitions, subtle enter, in-flight feedback
   ========================================================================== */

/* Cross-document view transitions on full-page navigations (progressive) */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
    @keyframes t-rise {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: none; }
    }
    /* Gentle rise-in for primary surfaces on load / htmx swap */
    body.t-app .t-card,
    body.t-app .t-stat,
    body.t-app .t-hero-panel {
        animation: t-rise 260ms var(--ease-bounce) both;
    }
    /* Dim a target while its htmx request is in flight, so actions feel responsive */
    body.t-app .htmx-request {
        opacity: 0.6;
        transition: opacity 120ms ease;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.t-app *,
    body.t-app *::before,
    body.t-app *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}


/* ==========================================================================
   Workflow canvas overhaul — pan/zoom, ports, token edges, toolbar
   ========================================================================== */

.wf-canvas {
    position: relative;
    overflow: hidden;
    background: var(--surface-sunken);
    cursor: grab;
}
.wf-canvas.is-panning { cursor: grabbing; }
.wf-canvas.wf-linking { cursor: crosshair; }

/* Dotted grid that pans/zooms with the world */
#canvas-inner {
    background-image: radial-gradient(circle, var(--outline) 1px, transparent 1.4px);
    background-size: 24px 24px;
}

.wf-canvas-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.wf-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem;
    background: var(--surface-elevated);
    border: 1px solid var(--outline);
    border-radius: var(--radius-btn);
    box-shadow: var(--shadow-sm);
}

.wf-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: none;
    border-radius: var(--radius-input);
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.wf-tool-btn svg { width: 16px; height: 16px; }
.wf-tool-btn:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-color); }
.wf-tool-btn:disabled { opacity: 0.4; cursor: default; }
.wf-tool-text { min-width: auto; }

.wf-zoom-label {
    min-width: 3rem;
    height: 2rem;
    padding: 0 0.25rem;
    border: none;
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-input);
}
.wf-zoom-label:hover { background: var(--brand-soft); color: var(--brand-color); }

.wf-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
}
.wf-status::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}
.wf-status[data-state="saved"]   { color: var(--color-success); background: var(--color-success-bg); }
.wf-status[data-state="saving"]  { color: var(--color-amber);   background: var(--color-warning-bg); }
.wf-status[data-state="unsaved"] { color: var(--ink-muted);     background: var(--surface-sunken); }
.wf-status[data-state="error"]   { color: var(--color-danger);  background: var(--color-danger-bg); }

.wf-toolbar-hint {
    margin-inline-start: auto;
    font-size: 0.75rem;
    color: var(--ink-subtle);
}

/* Nodes: icon + label, connection ports on the sides */
.workflow-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
}
.wf-node-ico {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    background-color: var(--ink-muted);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.wf-port {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--background);
    border: 2px solid var(--brand-color);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
    z-index: 20;
}
.wf-port-out { inset-inline-end: -8px; cursor: crosshair; }
.wf-port-in  { inset-inline-start: -8px; background: var(--brand-soft); }
.workflow-node:hover .wf-port,
.workflow-node.selected .wf-port { opacity: 1; }
.wf-port-out:hover { background: var(--brand-color); transform: translateY(-50%) scale(1.25); }
.workflow-node.wf-drop {
    border-color: var(--leaf) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 30%, transparent);
}
.workflow-node.wf-drop .wf-port-in { opacity: 1; background: var(--leaf); border-color: var(--leaf); }

/* Token-colored edges + arrowhead */
#edges-svg .wf-edge { stroke: var(--brand-color); stroke-width: 2.5; }
#edges-svg .wf-edge-temp { stroke-dasharray: 6 5; opacity: 0.85; }
#edges-svg .wf-arrow { fill: var(--brand-color); }
#edges-svg .edge-label {
    fill: var(--ink-muted);
    font-size: 0.7rem;
    font-weight: 600;
    paint-order: stroke;
    stroke: var(--surface-sunken);
    stroke-width: 3px;
}



/* Clickable stat tiles */
body.t-app a.t-stat-link,
body.t-app a.t-stat-link:hover {
    text-decoration: none;
    cursor: pointer;
    color: inherit;
}

/* ==========================================================================
   Simple-mode app wizard (New App modal): mode fork + guided wizard.
   Scoped under sw-* / the mode fork so it never affects other modal content.
   Uses existing design tokens so it adapts to light/dark automatically.
   ========================================================================== */
#sw-root, [data-anew-view="mode"] {
    --sw-line: var(--outline);
    --sw-card: var(--surface);
    --sw-sunken: var(--surface-sunken);
    --sw-faint: #94A3B8;
    --sw-muted: var(--ink-muted);
}

/* --- mode fork --- */
.sw-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .sw-mode-grid { grid-template-columns: 1fr; } }
.sw-mode-card {
    position: relative; text-align: start; border: 1.5px solid var(--sw-line);
    background: var(--sw-card); border-radius: var(--radius-card); padding: 22px;
    display: flex; flex-direction: column; transition: .15s; cursor: pointer;
}
.sw-mode-card:hover { border-color: var(--brand); box-shadow: 0 14px 34px -18px var(--brand-ring); transform: translateY(-2px); }
.sw-badge { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: var(--radius-pill); margin-bottom: 12px; align-self: flex-start; }
.sw-badge.simple { background: var(--leaf-soft); color: var(--leaf-deep); }
.sw-badge.adv { background: var(--sky-soft); color: var(--sky-deep); }
.sw-mode-em { font-size: 32px; display: block; margin-bottom: 10px; }
.sw-mode-title { font-size: 18px; font-weight: 800; color: var(--ink); }
.sw-mode-sub { color: var(--sw-muted); font-size: 13.5px; margin-top: 7px; line-height: 1.6; flex: 1; }
.sw-mode-cta { margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13.5px; }
.sw-mode-cta.simple { color: var(--leaf-deep); }
.sw-mode-cta.adv { color: var(--sky-deep); }
[dir="rtl"] .sw-cta-arrow { display: inline-block; transform: scaleX(-1); }
.sw-mode-hint { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--sw-faint); }
.sw-back-link { border: 0; background: transparent; color: var(--brand); font-weight: 700; font-size: 13px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.sw-back-link:hover { background: var(--brand-soft); }

/* --- wizard shell --- */
#sw-root { display: flex; flex-direction: column; min-height: 0; }
.sw-head { padding: 16px 24px 0; }
.sw-stepper { display: flex; align-items: center; gap: 5px; }
.sw-dot { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.sw-num { width: 26px; height: 26px; border-radius: var(--radius-pill); display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--sw-sunken); color: var(--sw-faint); border: 1.5px solid var(--sw-line); flex: none; transition: .2s; }
.sw-lbl { font-size: 12px; font-weight: 700; color: var(--sw-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-bar { height: 2.5px; background: var(--sw-line); border-radius: 2px; flex: 1; }
.sw-dot.active .sw-num { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.sw-dot.active .sw-lbl { color: var(--ink); }
.sw-dot.done .sw-num { background: var(--leaf-deep); color: #fff; border-color: var(--leaf-deep); }
.sw-bar.done { background: var(--leaf-deep); }

.sw-body { padding: 20px 24px; overflow: auto; flex: 1; }
.sw-step { display: none; }
.sw-step.active { display: block; animation: sw-fade .22s ease; }
@keyframes sw-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sw-step-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.sw-step-sub { color: var(--sw-muted); font-size: 14px; margin-top: 6px; }
.sw-label { display: block; font-weight: 700; font-size: 13.5px; margin: 18px 0 7px; color: var(--ink); }
.sw-input { width: 100%; border: 1.5px solid var(--sw-line); border-radius: var(--radius-input); padding: 11px 13px; font-size: 15px; font-family: inherit; background: var(--sw-card); color: var(--ink); transition: .15s; }
.sw-input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.sw-icon-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sw-icon-pick { width: 44px; height: 44px; border-radius: var(--radius-input); border: 1.5px solid var(--sw-line); background: var(--sw-card); font-size: 22px; display: grid; place-items: center; cursor: pointer; }
.sw-icon-pick.sel { border-color: var(--brand); background: var(--brand-soft); }

/* predefined style picker (step 1) */
.sw-style-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sw-style-card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: var(--radius-input); border: 1.5px solid var(--sw-line); background: var(--sw-card); cursor: pointer; text-align: start; transition: border-color .12s, box-shadow .12s; }
.sw-style-card:hover { border-color: var(--brand); }
.sw-style-card.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.sw-style-swatch { position: relative; height: 62px; border-radius: calc(var(--radius-input) - 2px); overflow: hidden; display: block; }
.sw-style-mini { position: absolute; inset: 12px 12px auto 12px; height: 44px; border-radius: 6px; box-shadow: 0 2px 6px rgba(15,23,42,.14); padding: 7px; display: block; }
.sw-style-bar { display: block; height: 5px; width: 40%; border-radius: 3px; margin-bottom: 5px; }
.sw-style-ln { display: block; height: 4px; width: 82%; border-radius: 3px; opacity: .22; margin-bottom: 4px; }
.sw-style-ln.short { width: 55%; }
.sw-style-btn { position: absolute; right: 7px; bottom: 6px; width: 16px; height: 8px; border-radius: 3px; }
.sw-style-meta { display: flex; flex-direction: column; gap: 1px; }
.sw-style-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.sw-style-desc { font-size: 11px; color: var(--sw-muted); line-height: 1.3; }
@media (max-width: 640px) { .sw-style-row { grid-template-columns: repeat(2, 1fr); } }

/* segmented build/import */
.sw-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 16px; }
@media (max-width: 560px) { .sw-seg { grid-template-columns: 1fr; } }
.sw-seg-btn { display: flex; align-items: center; gap: 12px; text-align: start; border: 1.5px solid var(--sw-line); background: var(--sw-card); border-radius: var(--radius-input); padding: 14px 15px; transition: .15s; cursor: pointer; }
.sw-seg-btn:hover { border-color: var(--brand); }
.sw-seg-btn.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.sw-se { font-size: 23px; flex: none; }
.sw-st { font-weight: 700; font-size: 14px; display: block; color: var(--ink); }
.sw-sd { font-size: 12px; color: var(--sw-muted); margin-top: 2px; display: block; }

.sw-dropzone { border: 2px dashed var(--sw-line); border-radius: var(--radius-card); padding: 28px 18px; text-align: center; background: var(--sw-sunken); transition: .15s; cursor: pointer; }
.sw-dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.sw-dz-em { font-size: 38px; }
.sw-dz-t { font-weight: 700; margin-top: 8px; font-size: 15px; color: var(--ink); }
.sw-dz-s { font-size: 12px; color: var(--sw-faint); margin-top: 4px; }
.sw-dz-btn { margin-top: 12px; display: inline-block; background: var(--brand); color: #fff; padding: 9px 18px; border-radius: var(--radius-input); font-weight: 700; font-size: 13px; }
.sw-import-result { border: 1.5px solid var(--leaf-deep); background: var(--leaf-soft); border-radius: var(--radius-input); padding: 12px 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.sw-import-result.sw-import-loading { border-color: var(--sw-line); background: var(--sw-sunken); color: var(--sw-muted); font-size: 13px; }
.sw-import-result.sw-import-error { border-color: var(--coral); background: var(--coral-soft); color: #B91C1C; font-size: 13px; }
.sw-ir-ic { font-size: 20px; }
.sw-ir-t { font-weight: 800; font-size: 13.5px; color: var(--leaf-deep); }
.sw-ir-s { font-size: 12.5px; color: var(--leaf-deep); }

/* form builder */
.sw-builder { display: grid; grid-template-columns: 1fr 290px; gap: 18px; align-items: start; }
@media (max-width: 760px) { .sw-builder { grid-template-columns: 1fr; } }
.sw-field-list { display: flex; flex-direction: column; gap: 9px; }
.sw-field-item { display: flex; flex-direction: column; }
/* per-field options editor (select / multi-select / radio) */
.sw-field-opts { margin: -1px 0 0; padding: 12px 12px 12px 40px; border: 1.5px solid var(--sw-line); border-top: 0; border-radius: 0 0 var(--radius-input) var(--radius-input); background: var(--sw-sunken); }
[dir="rtl"] .sw-field-opts { padding: 12px 40px 12px 12px; }
.sw-field-item .sw-field-row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.sw-opts-label { font-size: 11.5px; font-weight: 700; color: var(--sw-faint); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.sw-opts-list { display: flex; flex-direction: column; gap: 6px; }
.sw-opt-row { display: flex; align-items: center; gap: 9px; background: var(--sw-card); border: 1px solid var(--sw-line); border-radius: 9px; padding: 6px 10px; }
.sw-opt-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--brand); flex: none; }
.sw-opt-inp { flex: 1; min-width: 0; border: 0; background: transparent; font-family: inherit; font-size: 13.5px; color: var(--ink); padding: 2px 0; }
.sw-opt-inp:focus { outline: 0; }
.sw-opt-del { border: 0; background: transparent; color: var(--sw-faint); padding: 3px 5px; border-radius: 6px; cursor: pointer; display: inline-flex; }
.sw-opt-del:hover { background: var(--coral-soft, #FEE2E2); color: #B91C1C; }
.sw-opt-del .sw-ico { width: 13px; height: 13px; }
.sw-opt-add { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--brand); font-weight: 700; font-size: 12.5px; padding: 8px 2px 0; cursor: pointer; }
.sw-opt-add .sw-ico { width: 14px; height: 14px; }
/* preview: choice options */
.sw-pv-opts { display: flex; flex-direction: column; gap: 5px; }
.sw-pv-opt { font-size: 12.5px; color: var(--sw-muted); }
.sw-pv-select { display: flex; align-items: center; justify-content: space-between; color: var(--ink); }
.sw-pv-caret { color: var(--sw-faint); }
.sw-empty { border: 1.5px dashed var(--sw-line); border-radius: var(--radius-input); padding: 22px; text-align: center; color: var(--sw-faint); font-size: 13px; }
.sw-field-row { display: flex; align-items: center; gap: 11px; border: 1.5px solid var(--sw-line); background: var(--sw-card); border-radius: var(--radius-input); padding: 10px 12px; }
.sw-grip { color: var(--sw-faint); font-size: 15px; }
.sw-fem { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sw-sunken); font-size: 16px; flex: none; }
.sw-fmeta { flex: 1; min-width: 0; }
.sw-fname { font-weight: 700; font-size: 14px; border: 1px solid transparent; border-radius: 7px; background: transparent; width: 100%; padding: 4px 8px; margin-inline-start: -8px; font-family: inherit; color: var(--ink); transition: .12s; cursor: text; }
.sw-fname::placeholder { color: var(--sw-faint); font-weight: 500; }
.sw-fname:hover { border-color: var(--sw-line); background: var(--sw-sunken); }
.sw-fname:focus { outline: 0; border-color: var(--brand); background: var(--sw-card); box-shadow: 0 0 0 3px var(--brand-ring); }
.sw-ftype { font-size: 12px; color: var(--sw-faint); }
.sw-req { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); border: 1px solid var(--sw-line); background: var(--sw-card); color: var(--sw-muted); cursor: pointer; }
.sw-req.on { background: #FEF3C7; border-color: transparent; color: var(--sun-deep); }
.sw-del { border: 0; background: transparent; color: var(--sw-faint); font-size: 15px; padding: 4px 6px; border-radius: 7px; cursor: pointer; }
.sw-del:hover { background: var(--coral-soft); color: #B91C1C; }
.sw-add-label { font-size: 12.5px; font-weight: 700; color: var(--sw-faint); margin: 15px 0 8px; }
.sw-add-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-add-chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px dashed var(--sw-line); background: var(--sw-card); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--sw-muted); cursor: pointer; }
.sw-add-chip:hover { border-color: var(--brand); border-style: solid; color: var(--brand); background: var(--brand-soft); }

.sw-preview { position: sticky; top: 0; }
.sw-pv-card { border: 1px solid var(--sw-line); border-radius: var(--radius-card); background: var(--sw-card); overflow: hidden; }
.sw-pv-top { background: var(--brand); color: #fff; padding: 13px 15px; }
.sw-pv-t { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.sw-pv-s { font-size: 12px; opacity: .85; margin-top: 2px; }
.sw-pv-body { padding: 13px 15px; display: flex; flex-direction: column; gap: 11px; max-height: 300px; overflow: auto; }
.sw-pl { font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: var(--ink); }
.sw-star { color: #EF4444; }
.sw-pv-inp { border: 1.3px solid var(--sw-line); border-radius: 9px; background: var(--sw-card); height: 36px; display: flex; align-items: center; padding: 0 11px; color: var(--sw-faint); font-size: 12.5px; }
.sw-pv-inp.area { height: 52px; align-items: flex-start; padding-top: 9px; }
.sw-pv-submit { background: var(--brand); color: #fff; text-align: center; border-radius: 9px; padding: 10px; font-weight: 700; font-size: 13px; margin-top: 4px; }
.sw-pv-tag { font-size: 11px; color: var(--sw-faint); text-align: center; margin-top: 10px; }

/* views cards */
.sw-view-card { border: 1.5px solid var(--sw-line); border-radius: var(--radius-card); background: var(--sw-card); padding: 16px 18px; margin-bottom: 14px; transition: .15s; }
.sw-view-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.sw-vc-head { display: flex; align-items: flex-start; gap: 13px; }
.sw-vc-em { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 21px; flex: none; background: var(--brand-soft); }
.sw-view-card.dash .sw-vc-em { background: var(--berry-soft); }
.sw-view-card.kanban .sw-vc-em { background: var(--leaf-soft); }
.sw-vc-meta { flex: 1; min-width: 0; }
.sw-vc-t { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink); }
.sw-badge-default { font-size: 10.5px; font-weight: 800; background: var(--sky-soft); color: var(--sky-deep); padding: 2px 8px; border-radius: var(--radius-pill); }
.sw-vc-s { font-size: 12.5px; color: var(--sw-muted); margin-top: 4px; line-height: 1.55; }
.sw-vc-preview { margin-top: 13px; border-top: 1px dashed var(--sw-line); padding-top: 13px; overflow-x: auto; }

/* toggle switch */
.sw-switch { position: relative; width: 50px; height: 29px; flex: none; display: inline-block; cursor: pointer; }
.sw-switch input { display: none; }
.sw-track { position: absolute; inset: 0; background: var(--sw-line); border-radius: var(--radius-pill); transition: .2s; }
.sw-knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 23px; height: 23px; background: #fff; border-radius: var(--radius-pill); transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sw-switch input:checked + .sw-track { background: var(--brand); }
.sw-switch.locked input:checked + .sw-track { background: var(--leaf-deep); }
.sw-switch input:checked + .sw-track + .sw-knob { inset-inline-start: 24px; }

/* mini grid preview */
.sw-mgrid { border: 1px solid var(--sw-line); border-radius: 10px; overflow: hidden; font-size: 11.5px; min-width: 380px; }
.sw-gr { display: flex; }
.sw-gr.head { background: var(--sw-sunken); font-weight: 700; color: var(--sw-muted); }
.sw-gr:not(.head) { border-top: 1px solid var(--sw-line); }
.sw-gc { padding: 7px 10px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-inline-start: 1px solid var(--sw-line); color: var(--sw-muted); }
.sw-gc:first-child { border: 0; }
.sw-gc.editing { background: var(--sw-card); box-shadow: inset 0 0 0 2px var(--brand); color: var(--ink); font-weight: 600; border-radius: 4px; }
.sw-caret { color: var(--brand); font-weight: 700; }

/* mini dashboard preview */
.sw-mdash { display: flex; flex-direction: column; gap: 12px; min-width: 380px; }
.sw-kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sw-kpi { border: 1px solid var(--sw-line); border-radius: 10px; padding: 10px 12px; background: var(--sw-card); }
.sw-kv { font-size: 18px; font-weight: 800; color: var(--ink); }
.sw-kl { font-size: 11px; color: var(--sw-faint); margin-top: 2px; }
.sw-chart-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
@media (max-width: 520px) { .sw-chart-row { grid-template-columns: 1fr; } }
.sw-chart-box { border: 1px solid var(--sw-line); border-radius: 10px; padding: 11px 12px; }
.sw-cbt { font-size: 11.5px; font-weight: 700; color: var(--sw-muted); margin-bottom: 9px; }
.sw-bars { display: flex; align-items: flex-end; gap: 8px; height: 66px; }
.sw-bars i { flex: 1; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 45%, white)); border-radius: 5px 5px 0 0; min-height: 8px; }
.sw-donut { width: 66px; height: 66px; border-radius: var(--radius-pill); margin: 0 auto; background: conic-gradient(var(--brand) 0 45%, var(--berry, #7C3AED) 45% 72%, var(--sun-deep) 72% 100%); }

/* mini kanban preview */
.sw-mkan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; min-width: 380px; }
.sw-kcol { background: var(--sw-sunken); border: 1px solid var(--sw-line); border-radius: 10px; padding: 9px; }
.sw-kh { font-size: 11.5px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; color: var(--ink); }
.sw-kcnt { background: var(--sw-card); border: 1px solid var(--sw-line); border-radius: var(--radius-pill); padding: 0 7px; font-size: 10px; color: var(--sw-faint); }
.sw-kdot { width: 7px; height: 7px; border-radius: var(--radius-pill); display: inline-block; }
.sw-kcard { background: var(--sw-card); border: 1px solid var(--sw-line); border-radius: 8px; padding: 8px 9px; margin-bottom: 7px; font-size: 11px; color: var(--sw-muted); }
.sw-kt { font-weight: 700; color: var(--ink); font-size: 11.5px; }

/* approvals chain */
.sw-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1.5px solid var(--sw-line); border-radius: var(--radius-card); padding: 15px 18px; background: var(--sw-card); margin-top: 8px; }
.sw-tt { font-weight: 700; font-size: 15px; color: var(--ink); }
.sw-ts { font-size: 13px; color: var(--sw-muted); margin-top: 3px; }
.sw-chain { margin-top: 18px; }
.sw-chain.disabled { opacity: .45; pointer-events: none; }
.sw-chain-node { display: flex; gap: 14px; align-items: flex-start; }
.sw-chain-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.sw-bulb { width: 33px; height: 33px; border-radius: var(--radius-pill); background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.sw-chain-node.start .sw-bulb { background: var(--ink); }
.sw-chain-node.end .sw-bulb { background: var(--leaf-deep); }
.sw-line { width: 2.5px; background: var(--sw-line); flex: 1; min-height: 20px; margin: 2px 0; }
.sw-chain-card { flex: 1; border: 1.5px solid var(--sw-line); border-radius: var(--radius-input); background: var(--sw-card); padding: 11px 13px; margin-bottom: 13px; }
.sw-chain-node.start .sw-chain-card, .sw-chain-node.end .sw-chain-card { background: var(--sw-sunken); border-style: dashed; }
.sw-cl { font-size: 12px; color: var(--sw-faint); font-weight: 700; }
.sw-cv { font-weight: 700; font-size: 14px; margin-top: 4px; color: var(--ink); }
.sw-cr { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.sw-cr select, .sw-appr-email { flex: 1; min-width: 140px; border: 1.5px solid var(--sw-line); border-radius: 9px; padding: 9px 11px; font-family: inherit; font-size: 13.5px; background: var(--sw-card); color: var(--ink); }
.sw-add-step { display: inline-flex; align-items: center; gap: 7px; border: 1.5px dashed var(--sw-line); background: var(--sw-card); border-radius: 10px; padding: 9px 15px; font-size: 13.5px; font-weight: 700; color: var(--brand); margin-inline-start: 47px; cursor: pointer; }
.sw-add-step:hover { border-style: solid; background: var(--brand-soft); }

/* review */
.sw-art-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 8px; }
@media (max-width: 700px) { .sw-art-cards { grid-template-columns: 1fr; } }
.sw-art { border: 1.5px solid var(--sw-line); border-radius: var(--radius-card); padding: 16px; background: var(--sw-card); }
.sw-art.sw-art-wide { grid-column: 1 / -1; }
.sw-art.off { opacity: .5; }

/* Small phones: let the mini previews shrink to the modal width instead of
   forcing a 380px min-width that overflows the panel (most visibly the review
   artifact cards, which have no horizontal scroll of their own). */
@media (max-width: 480px) {
    .sw-mgrid,
    .sw-mdash,
    .sw-mkan { min-width: 0; }
    .sw-art { padding: 13px; }
    .sw-mkan { gap: 6px; }
    .sw-kcol { padding: 7px; }
}
.sw-art h4 { font-size: 15px; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.sw-aem { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: var(--brand-soft); }
.sw-cap { font-size: 12.5px; color: var(--sw-faint); margin: 3px 0 12px 41px; }
[dir="rtl"] .sw-cap { margin: 3px 41px 12px 0; }
.sw-mini-list { display: flex; flex-direction: column; gap: 6px; }
.sw-mi { font-size: 12.5px; color: var(--sw-muted); display: flex; align-items: center; gap: 8px; }
.sw-b { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--brand); flex: none; }
.sw-dim { color: var(--sw-faint); }
.sw-chain-mini { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sw-cm { font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--sky-deep); padding: 5px 10px; border-radius: 8px; }
.sw-cm.ok { background: var(--leaf-soft); color: var(--leaf-deep); }
.sw-arw { color: var(--sw-faint); font-size: 12px; }
[dir="rtl"] .sw-arw { transform: scaleX(-1); display: inline-block; }
.sw-offtag { font-size: 11px; font-weight: 700; color: var(--sw-faint); background: var(--sw-sunken); border: 1px solid var(--sw-line); border-radius: var(--radius-pill); padding: 2px 9px; display: inline-block; }

/* success */
.sw-success { text-align: center; padding: 14px 0 4px; }
.sw-success-badge { width: 72px; height: 72px; border-radius: var(--radius-pill); background: var(--leaf-soft); color: var(--leaf-deep); display: grid; place-items: center; font-size: 36px; margin: 0 auto 16px; }
.sw-success h2 { font-size: 23px; font-weight: 800; color: var(--ink); }
.sw-success p { color: var(--sw-muted); margin-top: 8px; font-size: 15px; }
.sw-gen-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.sw-g { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--sw-line); border-radius: 10px; padding: 8px 13px; font-size: 13px; font-weight: 700; background: var(--sw-card); color: var(--ink); }

/* success: share link + QR */
.sw-share { display: flex; gap: 16px; align-items: center; text-align: start; margin: 22px auto 4px; max-width: 460px; padding: 14px; border: 1.5px solid var(--sw-line); border-radius: 14px; background: var(--sw-card); }
.sw-share-qr { flex: 0 0 auto; }
.sw-share-qr img { display: block; border-radius: 8px; border: 1px solid var(--sw-line); background: #fff; padding: 5px; }
.sw-share-info { flex: 1 1 auto; min-width: 0; }
.sw-share-lbl { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.sw-share-row { display: flex; gap: 6px; }
.sw-share-url { flex: 1 1 auto; min-width: 0; border: 1.5px solid var(--sw-line); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; background: var(--sw-bg, transparent); color: var(--ink); }
.sw-share-copy { flex: 0 0 auto; border: 1.5px solid var(--brand); border-radius: 9px; padding: 8px 14px; font-size: 12.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand); cursor: pointer; }
.sw-share-copy:hover { background: var(--brand); color: #fff; }
.sw-share-open { display: inline-block; margin-top: 9px; font-size: 12.5px; font-weight: 700; color: var(--brand); text-decoration: none; }
.sw-share-open:hover { text-decoration: underline; }
@media (max-width: 520px) { .sw-share { flex-direction: column; align-items: stretch; text-align: center; } .sw-share-qr img { margin: 0 auto; } }

/* footer */
.sw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 24px; border-top: 1px solid var(--sw-line); }
.sw-btn { border: 0; border-radius: var(--radius-btn); padding: 11px 22px; font-weight: 700; font-size: 14.5px; transition: .15s; cursor: pointer; }
.sw-btn-primary { background: var(--brand); color: #fff; }
.sw-btn-primary:hover { background: var(--brand-hover); }
.sw-btn-primary:disabled { opacity: .55; cursor: default; }
.sw-btn-ghost { background: transparent; color: var(--sw-muted); }
.sw-btn-ghost:hover { background: var(--sw-sunken); color: var(--ink); }
.sw-hint { font-size: 12.5px; color: var(--sw-faint); }

/* --- scroll fix: the simple view fills the fixed-height panel so .sw-body scrolls --- */
[data-anew-view="simple"] { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* Same for the advanced view (AI / import / templates tabs), so its body can bound
   the tab panels' vertical scroll. :not([hidden]) keeps the view hideable. */
[data-anew-view="advanced"]:not([hidden]) { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#sw-root { flex: 1; min-height: 0; position: relative; }
.sw-body { min-height: 0; }

/* --- raw JSON editor --- */
.sw-json-toggle { position: absolute; top: 16px; inset-inline-end: 20px; z-index: 5; border: 0; background: none; padding: 2px 4px; font-size: 10.5px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--sw-faint); opacity: .5; cursor: pointer; letter-spacing: .02em; }
.sw-json-toggle:hover { opacity: 1; color: var(--brand); }

/* "Prefer your own AI? Copy the full prompt" — a quiet reveal under the AI generate
   button, with New / Edit modes that swap the complete copy-paste-ready prompt. */
.ai-ext { margin-top: 10px; }
.ai-ext-summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--sw-faint, #9ca3af); opacity: .6; user-select: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ai-ext-summary::-webkit-details-marker { display: none; }
.ai-ext[open] .ai-ext-summary, .ai-ext-summary:hover { opacity: 1; color: var(--brand); }
.ai-ext-box { margin-top: 10px; }
.ai-ext-modes { display: inline-flex; gap: 4px; padding: 3px; border-radius: 9px; background: var(--sw-sunken, #f3f4f6); margin-bottom: 8px; }
.ai-ext-mode { border: 0; border-radius: 7px; padding: 5px 14px; font-size: 12.5px; font-weight: 600; background: transparent; color: var(--sw-muted, #6b7280); cursor: pointer; }
.ai-ext-mode.sel { background: var(--card-bg, #fff); color: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ai-ext-apppick { margin-bottom: 8px; }
.ai-ext-select { width: 100%; border: 1px solid var(--sw-line, #e5e7eb); border-radius: 9px; padding: 8px 12px; font-size: 13px; background: var(--card-bg, #fff); color: var(--ink, #111827); }
.ai-ext-select:focus { outline: none; border-color: var(--brand); }
.ai-ext-note { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.ai-ext-prompt { width: 100%; height: 220px; resize: vertical; border: 1px solid var(--sw-line, #e5e7eb); border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.5; white-space: pre; overflow: auto; background: var(--sw-bg, #fafafa); color: var(--ink, #111827); }
.ai-ext-prompt:focus { outline: none; border-color: var(--brand); }
.ai-ext-copy { margin-top: 8px; border: 1.5px solid var(--brand); border-radius: 9px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand); cursor: pointer; }
.ai-ext-copy:hover { background: var(--brand); color: #fff; }
.ai-ext-paste { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--sw-line, #e5e7eb); }
.ai-ext-step { font-size: 12.5px; font-weight: 700; color: var(--ink, #111827); margin-bottom: 8px; }
.ai-ext-paste .ai-ext-prompt { height: 150px; margin-bottom: 8px; }
.ai-ext-import-err { margin-bottom: 8px; padding: 9px 12px; border-radius: 9px; font-size: 12.5px; background: rgba(220, 38, 38, .1); color: #dc2626; border: 1px solid rgba(220, 38, 38, .28); }
.ai-ext-hint { font-size: 11.5px; color: #9ca3af; margin-top: 6px; }
.sw-json { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 20px 24px; }
.sw-json .sw-step-sub { margin-bottom: 12px; }
.sw-json-ta { flex: 1; min-height: 220px; width: 100%; resize: none; border: 1.5px solid var(--sw-line); border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; tab-size: 2; background: var(--sw-bg, transparent); color: var(--ink); white-space: pre; overflow: auto; }
.sw-json-ta:focus { outline: none; border-color: var(--brand); }
.sw-json-err { margin-top: 10px; padding: 9px 12px; border-radius: 9px; font-size: 12.5px; background: rgba(220, 38, 38, .1); color: #dc2626; border: 1px solid rgba(220, 38, 38, .28); }
.sw-json-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sw-json-spacer { flex: 1 1 auto; }

/* --- vendored SVG icons rendered as currentColor masks (theme-aware) --- */
.sw-ico {
    display: inline-block; width: 1.15em; height: 1.15em; flex: none;
    background-color: currentColor;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    vertical-align: -0.2em;
}
/* app icon picker */
.sw-icon-pick { color: var(--sw-muted); }
.sw-icon-pick .sw-ico { width: 22px; height: 22px; }
.sw-icon-pick.sel { color: var(--brand); }
/* field-type chips + rows */
.sw-add-chip .sw-ico { width: 16px; height: 16px; }
.sw-fem { color: var(--ink); }
.sw-fem .sw-ico { width: 18px; height: 18px; }
.sw-mi-ic { color: var(--brand); width: 15px; height: 15px; }
/* live preview header (on brand bar) + file placeholder */
.sw-pv-t .sw-ico { width: 18px; height: 18px; }
.sw-pv-ph { width: 15px; height: 15px; color: var(--sw-faint); }
/* mode fork glyphs */
.sw-mode-em { display: inline-flex; }
.sw-mode-em.simple { color: var(--leaf-deep); }
.sw-mode-em.adv { color: var(--sky-deep); }
.sw-mode-em .sw-ico { width: 30px; height: 30px; }
/* view-card badges */
.sw-view-card.grid .sw-vc-em { color: var(--sky-deep); }
.sw-view-card.dash .sw-vc-em { color: var(--violet, #7C3AED); }
.sw-view-card.kanban .sw-vc-em { color: var(--leaf-deep); }
.sw-view-card.land .sw-vc-em { background: var(--sun-soft, #FEF3C7); color: var(--sun-deep, #B45309); }
.sw-view-card.appr .sw-vc-em { background: var(--coral-soft, #FEE2E2); color: #DC2626; }

/* views settings sub-pages */
.sw-field-lbl { display: block; font-weight: 700; font-size: 14px; color: var(--ink); margin: 20px 0 8px; }
.sw-help { font-size: 12.5px; color: var(--sw-muted); margin: -4px 0 10px; line-height: 1.5; }
.sw-landing-ta { resize: vertical; min-height: 96px; }
.sw-status-editor { display: flex; flex-direction: column; gap: 8px; }
.sw-status-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--sw-line); background: var(--sw-card); border-radius: var(--radius-input); padding: 8px 12px; }
.sw-status-dot { width: 9px; height: 9px; border-radius: var(--radius-pill); background: var(--brand); flex: none; }
.sw-status-inp { flex: 1; min-width: 0; border: 0; background: transparent; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink); padding: 2px 0; }
.sw-status-inp:focus { outline: 0; }
.sw-status-del { border: 0; background: transparent; color: var(--sw-faint); padding: 4px 6px; border-radius: 7px; cursor: pointer; display: inline-flex; }
.sw-status-del:hover { background: var(--coral-soft, #FEE2E2); color: #B91C1C; }
.sw-status-del .sw-ico { width: 14px; height: 14px; }
.sw-add-status { display: inline-flex; align-items: center; gap: 7px; border: 1.5px dashed var(--sw-line); background: var(--sw-card); border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 700; color: var(--brand); cursor: pointer; margin-top: 10px; }
.sw-add-status:hover { border-style: solid; background: var(--brand-soft); }
.sw-add-status .sw-ico { width: 15px; height: 15px; }
.sw-acc { align-items: flex-start; }
.sw-vc-em .sw-ico { width: 22px; height: 22px; }
/* delete buttons */
.sw-del .sw-ico { width: 15px; height: 15px; }
/* build/import segment */
.sw-se { color: var(--brand); display: inline-flex; }
.sw-se .sw-ico { width: 22px; height: 22px; }
/* dropzone */
.sw-dz-em { color: var(--sw-faint); display: inline-flex; }
.sw-dz-em .sw-ico { width: 34px; height: 34px; }
/* import banner check */
.sw-ir-ic { color: var(--leaf-deep); width: 20px; height: 20px; }
/* review card badges + success chips */
.sw-aem { color: var(--brand); }
.sw-aem .sw-ico { width: 17px; height: 17px; }
.sw-g .sw-ico { width: 15px; height: 15px; color: var(--brand); }

