/* DeviNote dashboard theme */

:root {
    --ds-success: #16A34A;
    --ds-error: #DC2626;
    --ds-warning: #EA580C;
    --ds-success-muted: rgba(22, 163, 74, 0.12);
    --ds-error-muted: rgba(220, 38, 38, 0.12);
    --ds-warning-muted: rgba(234, 88, 12, 0.12);
    --ds-accent: #00A870;
    --ds-accent-muted: rgba(0, 168, 112, 0.1);
    --ds-border: #E2E8F0;
    --ds-border-subtle: #F1F5F9;
    --ds-surface: #FFFFFF;
    --ds-surface-raised: #F8FAFC;
    --ds-bg: #F8FAFC;
    --ds-text-muted: #64748B;
    --ds-link: #2563EB;
    /* iOS/Android PWA (Add to Home Screen) — status bar / home indicator */
    --ds-safe-top: env(safe-area-inset-top, 0px);
    --ds-safe-right: env(safe-area-inset-right, 0px);
    --ds-safe-bottom: env(safe-area-inset-bottom, 0px);
    --ds-safe-left: env(safe-area-inset-left, 0px);
}

html.mud-theme-dark {
    --ds-success: #22C55E;
    --ds-error: #EF4444;
    --ds-warning: #F97316;
    --ds-success-muted: rgba(34, 197, 94, 0.15);
    --ds-error-muted: rgba(239, 68, 68, 0.15);
    --ds-warning-muted: rgba(249, 115, 22, 0.15);
    --ds-accent: #00E699;
    --ds-accent-muted: rgba(0, 230, 153, 0.12);
    --ds-border: #3F3F46;
    --ds-border-subtle: #2E2E33;
    --ds-surface: #26262B;
    --ds-surface-raised: #2E2E33;
    --ds-bg: #1C1C1F;
    --ds-text-muted: #A1A1AA;
    --ds-link: #60A5FA;
}

html {
    font-size: 17px;
}

html, body {
    background: var(--ds-bg);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

/* ── App shell ─────────────────────────────────────────────── */
.ds-appbar {
    background: var(--ds-bg) !important;
    border-bottom: 1px solid var(--ds-border);
    color: var(--mud-palette-text-primary);
    /* Push bar content below notch/status bar when installed as PWA */
    padding-top: var(--ds-safe-top) !important;
    min-height: calc(48px + var(--ds-safe-top)) !important;
    height: auto !important;
    box-sizing: border-box !important;
}

.mud-appbar.mud-appbar-dense.ds-appbar {
    min-height: calc(48px + var(--ds-safe-top)) !important;
}

.ds-appbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 4px;
    min-height: 48px;
}

.ds-appbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ds-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.ds-brand-mark {
    width: 36px;
    height: auto;
    display: block;
    flex-shrink: 0;
}

.ds-brand-name i {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 400;
}

.ds-brand-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.ds-suite-label {
    color: var(--ds-text-muted);
    font-size: 0.8125rem;
    padding-left: 12px;
    border-left: 1px solid var(--ds-border);
    white-space: nowrap;
}

.ds-search {
    max-width: 320px;
    min-width: 180px;
}

.ds-search .mud-input-root {
    background: var(--ds-surface) !important;
    border-radius: 8px !important;
}

.ds-appbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    overflow: visible;
}

.ds-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.ds-lang-btn {
    min-width: 36px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.ds-lang-trigger {
    min-width: 0 !important;
    padding: 0 4px 0 8px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
}

.ds-lang-trigger-caret {
    margin-left: 0 !important;
    font-size: 1.1rem !important;
    opacity: 0.85;
}

/* Dense app bar must not clip the bell badge */
.mud-appbar.ds-appbar,
.mud-appbar.ds-appbar .mud-toolbar,
.ds-appbar-inner {
    overflow: visible !important;
}

.ds-notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: visible;
}

.ds-notification-count {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
    box-sizing: border-box;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--mud-palette-error, #f44336);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.125rem;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--ds-bg);
}

@media (max-width: 767.98px) {
    .ds-appbar-inner {
        gap: 4px;
        padding: 0;
    }

    .ds-appbar-left {
        flex: 1 1 auto;
        min-width: 0;
        gap: 2px;
        overflow: hidden;
    }

    .ds-appbar-right {
        gap: 0;
        flex: 0 0 auto;
    }

    /* Mark alone is enough — name collides with lang / actions on phones (incl. Pro Max ~430px) */
    .ds-brand-name {
        display: none;
    }

    .ds-brand {
        gap: 0;
        flex-shrink: 0;
    }

    .ds-brand-mark {
        width: 32px;
        height: auto;
    }

    .ds-appbar .mud-button-root.mud-icon-button {
        padding: 6px !important;
    }

    .ds-appbar .mud-icon-button .mud-icon-root {
        font-size: 1.25rem !important;
    }

    .ds-appearance-controls {
        gap: 0;
    }

    .ds-user-chip {
        padding: 2px;
        max-width: none;
        gap: 0;
        border-radius: 999px;
        min-width: 0;
    }

    .ds-user-chip .mud-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }

    .ds-user-email {
        display: none !important;
    }

    /* Logout is available from Account / drawer — drop it from the crowded bar */
    .ds-appbar-right form[action="Account/Logout"] {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    .ds-user-chip {
        max-width: 176px;
    }
}

.ds-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    max-width: 220px;
}

.ds-user-chip:hover {
    background: var(--ds-surface-raised);
}

.ds-user-email {
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Blazor error UI is hidden until the framework adds .show */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1090;
    background: #b32121;
    color: #fff;
    padding: 0.75rem 1.25rem calc(0.75rem + var(--ds-safe-bottom));
}

#blazor-error-ui.show {
    display: block;
}

#blazor-error-ui .reload {
    color: #fff;
    margin-left: 0.75rem;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.ds-drawer {
    background: var(--ds-bg) !important;
    border-right: 1px solid var(--ds-border) !important;
}

.ds-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: calc(8px + var(--ds-safe-top)) 0 8px;
}

.ds-nav-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ds-text-muted);
    padding: 16px 20px 6px;
}

.ds-nav-menu .mud-nav-link {
    border-radius: 8px;
    margin: 2px 10px;
    min-height: 40px;
    font-size: 0.875rem;
}

.ds-nav-menu .mud-nav-link.active {
    background: var(--ds-surface-raised) !important;
    color: var(--mud-palette-text-primary) !important;
}

.ds-nav-menu .mud-nav-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.04) !important;
}

.ds-ticket-id {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
}

.ds-ticket-id-badge,
.ds-ticket-number-badge {
    position: relative;
    top: -2px;
    right: auto;
    flex-shrink: 0;
}

.ds-ticket-number-wrap {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
}

.ds-ticket-number {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-success) 18%, var(--mud-palette-surface));
    color: var(--mud-palette-success-darken, #2e7d32);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ds-nav-inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    margin-left: 8px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--mud-palette-error, #f44336);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.ds-sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--ds-border);
}

/* Desktop mini sidebar: fixed icon+label rail (no hover expand → no content jump). */
@media (min-width: 960px) {
    .ds-layout.ds-sidebar-mini .mud-drawer.ds-drawer--mini,
    .ds-layout.ds-sidebar-mini .mud-drawer.ds-drawer--mini.mud-drawer-open,
    .ds-layout.ds-sidebar-mini .mud-drawer.ds-drawer--mini:not(.mud-drawer-open) {
        width: 88px !important;
        max-width: 88px !important;
    }

    /* Keep main content offset locked to mini width so hover/open never shifts the page. */
    .ds-layout.ds-sidebar-mini .mud-main-content {
        margin-left: 88px !important;
        --mud-drawer-width-left: 88px;
    }

    .ds-drawer.ds-drawer--mini .ds-nav-group-label {
        display: none;
    }

    .ds-drawer.ds-drawer--mini .ds-sidebar-footer {
        padding: 12px 0;
        display: flex;
        justify-content: center;
    }

    .ds-drawer.ds-drawer--mini .mud-nav-link {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        min-height: 58px;
        margin: 2px 4px !important;
        padding: 8px 2px !important;
        gap: 2px;
        text-align: center;
    }

    .ds-drawer.ds-drawer--mini .mud-nav-link .mud-nav-link-icon {
        margin: 0 !important;
        padding: 0 !important;
    }

    .ds-drawer.ds-drawer--mini .mud-nav-link .mud-nav-link-text {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: 0.625rem !important;
        font-weight: 500;
        line-height: 1.15 !important;
        letter-spacing: 0;
        max-width: 76px;
        white-space: normal !important;
        text-align: center;
        opacity: 1 !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

.ds-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ds-success);
    box-shadow: 0 0 0 3px var(--ds-success-muted);
}

/* ── Main content ──────────────────────────────────────────── */
.ds-main {
    background: var(--ds-bg);
    min-height: calc(100vh - 56px);
}

/* Fixed dense appbar (~48px) + Tailwind pt-16 (64px) + safe area for PWA */
.mud-main-content.ds-main.pt-16,
.ds-main.pt-16 {
    padding-top: calc(4rem + var(--ds-safe-top)) !important;
}

.ds-page {
    max-width: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    overflow-x: clip;
    padding: 16px 20px 24px;
    padding-left: max(20px, var(--ds-safe-left));
    padding-right: max(20px, var(--ds-safe-right));
    padding-bottom: max(24px, calc(16px + var(--ds-safe-bottom)));
}

@media (max-width: 767.98px) {
    .ds-page {
        padding: 12px 12px 20px;
        padding-left: max(12px, var(--ds-safe-left));
        padding-right: max(12px, var(--ds-safe-right));
        padding-bottom: max(20px, calc(12px + var(--ds-safe-bottom)));
    }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    .ds-page {
        padding: 14px 16px 20px;
        padding-left: max(16px, var(--ds-safe-left));
        padding-right: max(16px, var(--ds-safe-right));
        padding-bottom: max(20px, calc(14px + var(--ds-safe-bottom)));
    }
}

/* ── Page header ───────────────────────────────────────────── */
.ds-page-header-wrap {
    margin-bottom: 16px;
}

.ds-back-link {
    display: inline-flex;
    align-items: center;
    color: var(--ds-text-muted) !important;
    font-size: 0.875rem;
    margin-bottom: 12px;
    transition: color 0.15s;
}

.ds-back-link:hover {
    color: var(--mud-palette-text-primary) !important;
}

.ds-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ds-page-title {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    line-height: 1.2 !important;
}

.ds-page-subtitle {
    color: var(--ds-text-muted);
    margin-top: 4px;
}

.ds-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-page-tabs {
    margin-top: 20px;
    border-bottom: 1px solid var(--ds-border);
}

.ds-page-tabs .mud-tabs-toolbar {
    background: transparent !important;
}

/* ── Section cards ─────────────────────────────────────────── */
.ds-section-card {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 16px;
}

@media (max-width: 767.98px) {
    .ds-page-header-wrap {
        margin-bottom: 12px;
    }

    .ds-page-header {
        gap: 10px;
    }

    .ds-page-title {
        font-size: 1.35rem !important;
    }

    .ds-page-actions {
        width: 100%;
    }

    .ds-page-actions .mud-button {
        flex: 1 1 auto;
    }

    .ds-section-card {
        padding: 12px !important;
        border-radius: 10px !important;
        margin-bottom: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    .ds-section-card {
        padding: 14px !important;
        margin-bottom: 14px;
    }
}

.ds-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.ds-section-title-row .ds-section-title {
    margin-bottom: 0 !important;
}

.ds-section-title {
    font-weight: 600 !important;
    margin-bottom: 4px !important;
}

.ds-section-description {
    color: var(--ds-text-muted);
    margin-bottom: 16px;
}

/* ── Detail grid (Telnyx Details section) ──────────────────── */
.ds-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px 32px;
}

.ds-detail-item label,
.ds-detail-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--ds-text-muted);
    margin-bottom: 4px;
}

.ds-detail-value {
    font-size: 0.9375rem;
    font-weight: 500;
    word-break: break-word;
}

.ds-plan-current {
    border-color: var(--ds-accent) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ds-accent) 35%, transparent);
}

.ds-plan-current .mud-card-content {
    background: color-mix(in srgb, var(--ds-accent) 8%, transparent);
}

.ds-status-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ds-success);
    font-size: 0.875rem;
}

.ds-status-active::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ds-success);
}

.ds-status-not-exported {
    display: inline-flex;
    align-items: center;
    color: #8B5E3C;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Stats row ─────────────────────────────────────────────── */
.ds-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ds-stat-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 20px;
}

.ds-stat-label {
    font-size: 0.8125rem;
    color: var(--ds-text-muted);
    margin-bottom: 8px;
}

.ds-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

/* ── Quick actions ─────────────────────────────────────────── */
.ds-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ds-action-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.ds-action-card:hover {
    border-color: #333;
    background: var(--ds-surface-raised);
}

.ds-action-card.disabled,
.ds-action-disabled .ds-action-card {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.ds-action-card.disabled:hover,
.ds-action-disabled .ds-action-card:hover {
    border-color: var(--ds-border);
    background: var(--ds-surface);
}

.ds-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--ds-accent-muted);
    color: var(--ds-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ds-action-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.ds-action-desc {
    font-size: 0.8125rem;
    color: var(--ds-text-muted);
    line-height: 1.5;
}

.ds-action-body {
    min-width: 0;
}

/* ── Tables ────────────────────────────────────────────────── */
.ds-table-wrap {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .ds-table-wrap {
        border-radius: 10px;
    }

    .ds-action-grid {
        grid-template-columns: 1fr;
    }

    .ds-stat-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 479.98px) {
    .ds-stat-row {
        grid-template-columns: 1fr;
    }
}

.ds-table-wrap .mud-table {
    background: transparent !important;
}

.ds-table-wrap .mud-table-head .mud-table-cell {
    background-color: var(--ds-surface-raised) !important;
    color: var(--mud-palette-text-primary) !important;
    font-weight: 600;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--ds-border) !important;
}

.ds-table-wrap .mud-table-body .mud-table-row {
    background-color: var(--ds-surface) !important;
}

.ds-table-wrap .mud-table-body .mud-table-row:nth-child(even) {
    background-color: var(--ds-surface-raised) !important;
}

.ds-table-wrap .mud-table-body .mud-table-cell {
    color: var(--mud-palette-text-primary) !important;
    border-bottom: 1px solid var(--ds-border-subtle) !important;
    overflow: visible;
}

@media (max-width: 767.98px) {
    .ds-table-wrap .mud-table-head .mud-table-cell,
    .ds-table-wrap .mud-table-body .mud-table-cell {
        padding: 10px 12px !important;
    }

    .ds-table-wrap .mud-table-cell {
        word-break: break-word;
    }
}

.ds-inbox-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 28rem;
}

@media (max-width: 959.98px) {
    .ds-inbox-preview {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
    }
}

.ds-table-wrap .mud-table-body .mud-table-row:hover {
    background-color: color-mix(in srgb, var(--ds-accent) 8%, var(--ds-surface)) !important;
}

.ds-table-wrap .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none !important;
}

/* Light mode: stronger contrast for seat / data tables */
html:not(.mud-theme-dark) .ds-table-wrap {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

html:not(.mud-theme-dark) .ds-table-wrap .mud-table-head .mud-table-cell {
    background-color: #E2E8F0 !important;
    color: #1E293B !important;
}

html:not(.mud-theme-dark) .ds-table-wrap .mud-table-body .mud-table-cell {
    color: #0F172A !important;
}

html:not(.mud-theme-dark) .ds-table-wrap .mud-button-text {
    color: #2563EB !important;
}

html:not(.mud-theme-dark) .ds-table-wrap .mud-button-text.mud-button-color-error {
    color: var(--ds-error) !important;
}

html:not(.mud-theme-dark) .ds-seats-page .mud-typography-h6 {
    color: #0F172A;
}

html:not(.mud-theme-dark) .ds-seats-page .mud-input-outlined-border {
    border-color: #CBD5E1 !important;
}

/* ── Auth pages ────────────────────────────────────────────── */
.ds-auth-shell {
    min-height: 100dvh;
    background: var(--ds-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + var(--ds-safe-top)) calc(24px + var(--ds-safe-right)) calc(24px + var(--ds-safe-bottom)) calc(24px + var(--ds-safe-left));
    box-sizing: border-box;
}

/* Inner page wrapper — do NOT nest another full-viewport shell */
.ds-auth-page {
    width: 100%;
    max-width: 980px;
    min-height: 0;
    padding: 0;
}

.ds-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: 16px !important;
    padding: 32px !important;
}

.ds-auth-split {
    width: 100%;
    max-width: 960px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
}

.ds-auth-grid {
    align-items: stretch !important;
}

.ds-auth-hero-col {
    display: flex;
    flex-direction: column;
}

.ds-auth-hero {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 560px;
    background-color: #1c1c1f;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.ds-auth-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        165deg,
        rgba(12, 12, 14, 0.82) 0%,
        rgba(12, 12, 14, 0.55) 50%,
        rgba(0, 100, 70, 0.45) 100%
    );
}

.ds-auth-hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.ds-auth-mobile-hero {
    display: none;
    position: relative;
    height: 160px;
    background-color: #1c1c1f;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    overflow: hidden;
}

.ds-auth-mobile-hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.ds-auth-hero-desktop {
    display: block;
}

@media (max-width: 959.98px) {
    /* Collapse desktop hero completely — min-height:560px was still inflating layout
       when display:none lost to Mud/grid styles */
    .ds-auth-hero-desktop,
    .ds-auth-hero-col .ds-auth-hero-desktop {
        display: none !important;
        min-height: 0 !important;
        height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: none !important;
    }

    .ds-auth-mobile-hero {
        display: block !important;
        height: 160px;
        flex: none;
    }

    .ds-auth-shell {
        min-height: auto;
        align-items: flex-start;
        justify-content: flex-start;
        padding: var(--ds-safe-top) var(--ds-safe-right) var(--ds-safe-bottom) var(--ds-safe-left);
    }

    .ds-auth-page {
        max-width: none;
    }

    .ds-auth-split {
        max-width: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .ds-auth-hero-col {
        flex: none;
        min-height: 0;
    }
}

@media (min-width: 960px) {
    .ds-auth-hero-col .ds-auth-mobile-hero {
        display: none !important;
    }

    .ds-auth-hero {
        min-height: 100%;
        height: 100%;
    }
}

@media (max-width: 767.98px) {
    .ds-auth-mobile-hero {
        height: 140px;
    }
}

@media (min-width: 768px) and (max-width: 959.98px) {
    .ds-auth-mobile-hero {
        height: 180px;
    }
}

/* ── Transcription overrides ───────────────────────────────── */
.ds-main .segment-card,
.ds-main .empty-state {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
}

.ds-main .live-segment-card {
    background: var(--ds-success-muted) !important;
    border-color: color-mix(in srgb, var(--ds-success) 35%, transparent) !important;
}

.ds-main .dt-header-status {
    border-color: var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-muted);
}

.ds-main .trx-container {
    border-color: var(--ds-border);
    background: var(--ds-surface);
}

.ds-main .trx-row-odd {
    background: rgba(255, 255, 255, 0.03);
}

/* Legacy dashboard — dark overrides */
.ds-main .hero-card,
.ds-main .hero-visual,
.ds-main .action-card,
.ds-main .stat-card {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
}

.ds-main .action-title,
.ds-main .stat-number,
.ds-main .hero-title {
    color: var(--mud-palette-text-primary) !important;
}

.ds-main .action-description,
.ds-main .stat-label,
.ds-main .hero-subtitle {
    color: var(--ds-text-muted) !important;
}

.ds-main .action-purple,
.ds-main .stat-purple {
    background: var(--ds-accent-muted) !important;
    color: var(--ds-accent) !important;
}

/* Auth form: force readable Mud colors from html.mud-theme-dark (static SSR safe) */
html:not(.mud-theme-dark) .ds-auth-shell,
html:not(.mud-theme-dark) .ds-auth-shell .ds-auth-split {
    --mud-palette-text-primary: #0F172A;
    --mud-palette-text-secondary: #64748B;
    --mud-palette-text-disabled: #94A3B8;
    --mud-palette-action-default: #64748B;
    --mud-palette-lines-default: #E2E8F0;
    --mud-palette-lines-inputs: #CBD5E1;
    --mud-palette-background: #F8FAFC;
    --mud-palette-background-grey: #F1F5F9;
    --mud-palette-surface: #FFFFFF;
    --mud-palette-primary: #00A870;
    --mud-palette-primary-text: #FFFFFF;
    color: #0F172A;
}

html.mud-theme-dark .ds-auth-shell,
html.mud-theme-dark .ds-auth-shell .ds-auth-split {
    --mud-palette-text-primary: #FAFAFA;
    --mud-palette-text-secondary: #A1A1AA;
    --mud-palette-text-disabled: #71717A;
    --mud-palette-action-default: #A1A1AA;
    --mud-palette-lines-default: #3F3F46;
    --mud-palette-lines-inputs: #52525B;
    --mud-palette-background: #1C1C1F;
    --mud-palette-background-grey: #242428;
    --mud-palette-surface: #26262B;
    --mud-palette-primary: #00E699;
    --mud-palette-primary-text: #141416;
    color: #FAFAFA;
}

/* Override stuck SSR Mud text (links / Color.* accents left alone) */
html:not(.mud-theme-dark) .ds-auth-shell .ds-auth-split .mud-typography-h4,
html:not(.mud-theme-dark) .ds-auth-shell .ds-auth-split .mud-typography-h5,
html:not(.mud-theme-dark) .ds-auth-shell .ds-auth-split .mud-typography-h6,
html:not(.mud-theme-dark) .ds-auth-shell .ds-auth-split .mud-checkbox .mud-typography,
html:not(.mud-theme-dark) .ds-auth-shell .ds-auth-split .mud-input-label {
    color: #0F172A !important;
}

html:not(.mud-theme-dark) .ds-auth-shell .ds-auth-split .mud-input-label.mud-input-label-inputlabel {
    color: #64748B !important;
}

html.mud-theme-dark .ds-auth-shell .ds-auth-split .mud-typography-h4,
html.mud-theme-dark .ds-auth-shell .ds-auth-split .mud-typography-h5,
html.mud-theme-dark .ds-auth-shell .ds-auth-split .mud-typography-h6,
html.mud-theme-dark .ds-auth-shell .ds-auth-split .mud-checkbox .mud-typography,
html.mud-theme-dark .ds-auth-shell .ds-auth-split .mud-input-label {
    color: #FAFAFA !important;
}

html.mud-theme-dark .ds-auth-shell .ds-auth-split .mud-input-label.mud-input-label-inputlabel {
    color: #A1A1AA !important;
}

/* Keep hero overlay text white in both themes */
.ds-auth-hero-content .mud-typography,
.ds-auth-mobile-hero-content .mud-typography {
    color: #FFFFFF !important;
}

/* Light mode: hero tags a bit darker than pure Surface white */
html:not(.mud-theme-dark) .ds-auth-hero-content .mud-chip,
html:not(.mud-theme-dark) .ds-auth-mobile-hero .mud-chip {
    background-color: rgba(15, 23, 42, 0.72) !important;
    color: #F8FAFC !important;
}

html:not(.mud-theme-dark) .ds-auth-hero-content .mud-chip .mud-chip-icon,
html:not(.mud-theme-dark) .ds-auth-mobile-hero .mud-chip .mud-chip-icon,
html:not(.mud-theme-dark) .ds-auth-hero-content .mud-chip .mud-icon-root,
html:not(.mud-theme-dark) .ds-auth-mobile-hero .mud-chip .mud-icon-root {
    color: #F8FAFC !important;
}

.ds-appearance-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ds-auth-appearance {
    position: fixed;
    top: calc(16px + var(--ds-safe-top));
    right: calc(16px + var(--ds-safe-right));
    z-index: 1300;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ds-auth-brand {
    position: fixed;
    top: calc(16px + var(--ds-safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
}

.ds-auth-back {
    position: fixed;
    top: calc(12px + var(--ds-safe-top));
    left: calc(12px + var(--ds-safe-left));
    z-index: 1300;
}

.ds-auth-back-btn {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: 8px !important;
    min-height: 36px;
    padding-left: 8px !important;
    padding-right: 12px !important;
}

.ds-auth-form-title {
    font-weight: 800 !important;
    line-height: 1.2 !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    padding-right: 0;
}

.ds-auth-mobile-hero-title {
    font-weight: 800 !important;
    color: var(--mud-palette-white) !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.ds-auth-mobile-hero-sub {
    color: rgba(255, 255, 255, 0.92) !important;
    line-height: 1.3 !important;
    margin-top: 4px !important;
}

@media (max-width: 959.98px) {
    .ds-auth-shell {
        /* room for fixed back + appearance controls */
        padding-top: calc(56px + var(--ds-safe-top)) !important;
    }

    .ds-auth-form-title {
        font-size: 1.35rem !important;
        font-weight: 700 !important;
        /* Leave room for fixed theme/language controls */
        padding-right: 7.5rem;
        max-width: 100%;
    }

    .ds-auth-mobile-hero {
        height: 112px !important;
    }

    .ds-auth-mobile-hero-content {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        padding-left: 7rem !important; /* don't sit under back button */
        padding-right: 7.5rem !important; /* don't sit under appearance controls */
    }

    .ds-auth-mobile-hero-title {
        font-size: 0.95rem !important;
    }

    .ds-auth-mobile-hero-sub {
        font-size: 0.75rem !important;
    }

    .ds-auth-split > .mud-grid > .mud-grid-item:last-child {
        padding-top: 12px !important;
    }
}

@media (max-width: 399.98px) {
    .ds-auth-form-title {
        font-size: 1.2rem !important;
        padding-right: 6.75rem;
    }
}

.ds-auth-appearance .ds-lang-toggle {
    display: inline-flex;
    gap: 2px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    padding: 2px;
}

.ds-auth-appearance .ds-lang-btn {
    min-width: 36px;
}

.ds-auth-theme-toggle {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border);
}

/* ── Transcripe page ─────────────────────────────────────── */
.trx-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin: 4px 0;
    cursor: pointer;
    user-select: none;
    color: var(--mud-palette-text-primary);
    line-height: 1.4;
}

.trx-consent-input {
    width: 1.15rem;
    height: 1.15rem;
    margin: 2px 0 0;
    flex: 0 0 auto;
    accent-color: var(--mud-palette-warning, #f59e0b);
    cursor: pointer;
}

.trx-session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px 24px;
}

.trx-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 8px;
}

.trx-split-slot,
.trx-split-slot-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.trx-split-slot-body,
.trx-split-slot .trx-workspace-pane {
    flex: 1 1 auto;
}

.trx-pane-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.trx-pane-heading-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.trx-transcript-head {
    justify-content: space-between;
    align-items: center;
}

.trx-timer-inline {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 6px 12px;
}

.trx-timer-inline .trx-timer-value {
    font-size: 1.15rem;
    min-width: 5.6rem;
}

.trx-split .trx-transcript-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.trx-split .trx-live-wave {
    margin: 0 0 12px;
    flex: 0 0 auto;
}

.trx-split .trx-transcript-panel {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    max-height: none;
}

.trx-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 14px 16px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ds-border);
    border-radius: 0;
    margin: 0;
}

.trx-live-wave {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #0B0B0D;
    border: 1px solid #1F1F24;
    box-sizing: border-box;
}

.trx-live-wave.is-paused {
    opacity: 0.78;
}

.trx-live-wave-time {
    flex: 0 0 auto;
    min-width: 3.4ch;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.88);
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.trx-live-wave-canvas {
    flex: 1 1 auto;
    width: 100%;
    height: 56px;
    display: block;
}

@media (max-width: 600px) {
    .trx-live-wave {
        gap: 8px;
        padding: 12px 10px;
    }

    .trx-live-wave-canvas {
        height: 48px;
    }

    .trx-live-wave-time {
        font-size: 0.75rem;
        min-width: 3ch;
    }
}

.trx-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.trx-inactivity-hint {
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--ds-text-muted, #6b7280);
    max-width: 36ch;
}

.trx-transcript-panel {
    min-height: 280px;
    max-height: 420px;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    background: var(--ds-surface-raised);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trx-transcript-editor {
    flex: 1 1 auto;
    width: 100%;
    min-height: 240px;
    border: none;
    outline: none;
    resize: vertical;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    padding: 0;
}

.trx-mic-btn-host {
    display: inline-flex;
}

.trx-mic-native-btn {
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: var(--mud-default-borderradius, 4px);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
}

.trx-mic-native-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.help-video-card {
    height: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: var(--ds-surface-raised, var(--mud-palette-surface));
}

.help-video-media {
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: rgba(var(--mud-palette-primary-rgb), 0.06);
    border-bottom: 1px solid var(--ds-border, var(--mud-palette-lines-default));
}

.help-video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #0b1220;
}

.help-video-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
}

.help-video-embed,
.help-video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.help-faq-panels {
    border: 1px solid var(--ds-border, var(--mud-palette-lines-default));
    border-radius: 10px;
    overflow: hidden;
}

.trx-timer-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    background: var(--ds-surface);
}

.trx-timer-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    min-width: 88px;
}

@media (max-width: 767.98px) {
    .trx-controls-bar {
        padding: 12px 14px;
        gap: 10px;
    }

    .trx-controls-left {
        width: 100%;
    }

    .trx-timer-block:not(.trx-timer-inline) {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }

    .trx-timer-inline {
        width: auto;
        justify-content: flex-start;
    }

    .trx-timer-value {
        min-width: 74px;
        font-size: 1.25rem;
    }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    .trx-timer-block {
        padding: 8px 12px;
    }
}

.trx-tabs {
    margin-top: 8px;
}

.trx-tabs .mud-tabs-toolbar {
    background: transparent !important;
    border-bottom: 1px solid var(--ds-border);
}

.trx-tabs .mud-tabs-toolbar .mud-tabs-tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trx-tabs .mud-tabs-toolbar .mud-tab {
    flex: 0 0 auto;
}

.trx-tabs.trx-tabs-stacked .mud-tabs-toolbar .mud-tabs-tabbar {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
}

.trx-tabs.trx-tabs-stacked .mud-tabs-toolbar .mud-tabs-tabbar-content {
    width: 100%;
}

.trx-tabs.trx-tabs-stacked .mud-tabs-toolbar .mud-tab {
    width: 100% !important;
    max-width: none !important;
    justify-content: flex-start !important;
}

@media (max-width: 767.98px) {
    .trx-tabs .mud-tabs-toolbar {
        overflow-x: auto;
    }
}

.trx-tab-panel {
    padding-top: 20px;
}

.trx-tabs .mud-tabs-panels,
.trx-tabs .mud-tabs-panels .mud-tab-panel {
    background: transparent !important;
}

.trx-workspace-shell {
    margin-top: 12px;
}

.trx-workspace-bar {
    position: sticky;
    top: calc(48px + var(--ds-safe-top));
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0 12px;
    margin-bottom: 12px;
    background: var(--ds-bg);
    border-bottom: 1px solid var(--ds-border);
}

.trx-workspace-bar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.trx-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.trx-workspace-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    overflow: hidden;
}

.trx-workspace-pane-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ds-border);
    background: var(--ds-surface-raised);
}

.trx-workspace-pane-body {
    padding: 14px 16px 16px;
    min-width: 0;
}

.trx-workspace-pane-body .ds-section-card {
    margin-bottom: 0;
}

.trx-note-card {
    padding: 14px !important;
    border-radius: 10px !important;
}

.trx-note-card-compact {
    padding: 12px !important;
}

.ds-main .mud-paper.trx-note-card-soap {
    background: #E6E9EE !important;
}

html.mud-theme-dark .ds-main .mud-paper.trx-note-card-soap {
    background: #323238 !important;
}

.trx-export-overlay {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 16px 24px;
    box-sizing: border-box;
}

.trx-export-dialog {
    width: min(640px, 100%);
    max-height: min(80vh, 760px);
    overflow: auto;
    padding: 20px 20px 18px !important;
    border-radius: 12px !important;
    background: var(--ds-surface) !important;
}

@media (min-width: 992px) {
    .trx-split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .trx-split > .trx-workspace-pane,
    .trx-split > .trx-split-slot {
        height: min(760px, calc(100dvh - 17.5rem));
        min-height: min(320px, calc(100dvh - 17.5rem));
        overflow: hidden;
    }

    .trx-split .trx-workspace-pane,
    .trx-split .trx-workspace-pane-body {
        min-height: 0;
    }

    .trx-split .trx-workspace-pane-body {
        flex: 1 1 auto;
        overflow: auto;
        overscroll-behavior: contain;
        max-height: none;
    }

    .trx-split .trx-workspace-pane-body.trx-transcript-body {
        overflow: hidden;
    }

    .trx-split .trx-transcript-body .trx-transcript-panel {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }
}

@media (min-width: 1400px) {
    .trx-split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    .trx-workspace-shell .trx-workspace-pane-body {
        max-height: calc(100dvh - 11.5rem);
        overflow: auto;
        overscroll-behavior: contain;
    }
}

@media (max-width: 1199.98px) {
    .trx-workspace-bar {
        position: static;
    }
}

@media (max-width: 991.98px) {
    .trx-split {
        gap: 12px;
    }

    .trx-split .trx-transcript-panel {
        min-height: 200px;
        max-height: min(52vh, 420px);
    }
}

@media (max-width: 767.98px) {
    .trx-workspace {
        gap: 12px;
    }

    .trx-workspace-pane {
        border-radius: 10px;
    }

    .trx-workspace-pane-head,
    .trx-workspace-pane-body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .trx-export-overlay {
        padding: 12px;
        align-items: center;
    }

    .trx-export-dialog {
        padding: 16px !important;
        max-height: min(88vh, 760px);
    }

    .trx-split .trx-workspace-pane-head .trx-pane-export {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 479.98px) {
    .trx-session-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.ds-main .mud-paper {
    background-color: var(--ds-surface) !important;
    color: var(--mud-palette-text-primary);
}

.ds-main .mud-tabs-panels {
    background: transparent !important;
}

.recording-pulse {
    animation: trx-pulse 1.4s ease-in-out infinite;
}

@keyframes trx-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

html:not(.mud-theme-dark) .ds-main .trx-row-odd {
    background: rgba(0, 0, 0, 0.03);
}

html.mud-theme-dark .ds-main .trx-row-odd {
    background: rgba(255, 255, 255, 0.03);
}

html:not(.mud-theme-dark) .dt-header-status.is-online .dt-header-status-dot {
    background: var(--ds-success);
    box-shadow: 0 0 0 6px var(--ds-success-muted);
}

/* Semantic status utilities */
.text-success { color: var(--ds-success) !important; }
.text-danger { color: var(--ds-error) !important; }
.text-warning { color: var(--ds-warning) !important; }

/* Connection / status cards */
.dt-status-card {
    text-align: center;
    padding: 48px 24px;
    border-radius: 12px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
}

.dt-status-card--error {
    border-color: var(--ds-error);
    background: var(--ds-error-muted);
}

.dt-status-icon--error {
    color: var(--ds-error) !important;
}

html:not(.mud-theme-dark) .dt-header-status {
    border-color: var(--ds-border);
    background: var(--ds-surface);
}

/* iPhone install guide — large symbols next to each step */
.ds-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface-raised);
}

.ds-ios-step-badge {
    flex: 0 0 auto;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ds-ios-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0B0B0B;
    background: var(--ds-accent);
}

.ds-ios-step-icon {
    font-size: 2rem !important;
    width: 2rem !important;
    height: 2rem !important;
    color: var(--ds-accent) !important;
}

.ds-ios-step-body {
    min-width: 0;
    flex: 1 1 auto;
    padding-top: 2px;
}

/* Legal documents */
.ds-legal-doc {
    max-width: 52rem;
    line-height: 1.65;
    font-size: 0.95rem;
}

.ds-legal-doc h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.ds-legal-doc p,
.ds-legal-doc ul {
    margin: 0 0 0.85rem;
}

.ds-legal-doc ul {
    padding-left: 1.25rem;
}

.ds-legal-doc li {
    margin-bottom: 0.35rem;
}

.ds-legal-lead {
    color: var(--ds-text-muted);
}

.ds-legal-missing {
    color: var(--ds-warning);
    font-style: italic;
}

.ds-legal-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--ds-warning);
    background: var(--ds-warning-muted);
    font-size: 0.875rem;
}

.ds-legal-alert code {
    font-size: 0.8em;
}

/* Cookie notice */
.ds-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    padding: 12px;
    pointer-events: none;
}

.ds-cookie-banner-inner {
    pointer-events: auto;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
}

.ds-cookie-banner-text {
    flex: 1 1 240px;
    min-width: 0;
}

.ds-handbook-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0 0 8px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.ds-handbook-marker {
    flex: 0 0 auto;
    min-width: 1.25rem;
    color: var(--mud-palette-text-secondary);
}

.ds-handbook-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    padding: 0 4px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

.ds-support-fab {
    position: fixed;
    right: calc(16px + var(--ds-safe-right, 0px));
    bottom: calc(16px + var(--ds-safe-bottom, 0px));
    z-index: 1200;
}

.ds-support-fab-btn {
    position: relative;
    display: inline-flex;
    overflow: visible;
}

.ds-support-unread {
    top: -2px;
    right: -2px;
    box-shadow: 0 0 0 2px var(--mud-palette-surface, #fff);
}

.ds-support-panel {
    position: fixed;
    right: calc(16px + var(--ds-safe-right, 0px));
    bottom: calc(88px + var(--ds-safe-bottom, 0px));
    width: min(400px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 120px));
    z-index: 1200;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-surface);
    border: 1px solid var(--ds-border, var(--mud-palette-lines-default));
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.ds-support-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    padding: 8px 12px 0;
}

.ds-support-actions .mud-button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 28px !important;
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
    white-space: normal;
}

.ds-support-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--ds-border, var(--mud-palette-lines-default));
}

.ds-support-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ds-support-bubble {
    max-width: 92%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.ds-support-bubble--user {
    align-self: flex-end;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.ds-support-bubble--bot,
.ds-support-bubble--human,
.ds-support-bubble--system {
    align-self: flex-start;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 6%, var(--mud-palette-surface));
}

.ds-support-bubble-name {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
    opacity: 0.8;
}

.ds-support-composer {
    border-top: 1px solid var(--ds-border, var(--mud-palette-lines-default));
    padding: 10px 12px 12px;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 4%, var(--mud-palette-surface));
}

.ds-support-input-row {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 44px;
    padding: 2px 4px 2px 2px;
    border: 1px solid var(--ds-border, var(--mud-palette-lines-default));
    border-radius: 14px;
    background: var(--mud-palette-surface);
}

.ds-support-input-row .mud-icon-button {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 6px;
}

.ds-support-field {
    min-width: 0;
}

.ds-support-field .mud-input-underline:before,
.ds-support-field .mud-input-underline:after {
    display: none;
}

.ds-support-field .mud-input-slot {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.875rem;
}

.ds-support-topic-popover {
    text-transform: none !important;
}

.ds-support-topic-popover .mud-menu-item-text,
.ds-support-topic-popover .mud-list-item-text {
    text-transform: none !important;
    font-size: 0.8125rem !important;
}

.ds-support-topic-btn {
    text-transform: none !important;
    min-width: 0 !important;
    max-width: 5.4rem;
    height: auto !important;
    min-height: 36px;
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    text-align: center;
    flex-shrink: 0;
}

.ds-support-caution {
    margin: 6px 4px 0;
    color: var(--ds-text-muted, var(--mud-palette-text-secondary));
    font-size: 0.68rem;
    line-height: 1.35;
}

.ds-support-shot {
    display: block;
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    margin: 4px 0 6px;
}

.ds-support-pending {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 0 4px 6px;
}

.ds-support-upload {
    min-width: 10rem;
}

.ds-support-upload .mud-progress-linear {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.28) !important;
}

.ds-support-upload .mud-progress-linear-bar {
    background: #fff !important;
}

.ds-support-waiting {
    min-width: 8.5rem;
}

.ds-support-waiting .mud-progress-linear {
    margin-top: 6px;
}


