.demo-mode-tabs button.active {
    border-color: #0b67b2;
    background: #e6f1fb;
    color: #0b67b2;
    font-weight: 600;
}

.demo-mode-tabs button:not(.active) {
    background: #f8fafc;
}

.demo-orders-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 14px;
}

.demo-topbar h1.demo-page-heading {
    margin: 2px 0 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #17263a;
}

.demo-modal-backdrop {
    z-index: 250;
}

.demo-license-window {
    width: min(1100px, 100%);
    padding: 8px;
    border-radius: 0;
    color: #334155;
    font: 13px/1.45 'Segoe UI', sans-serif;
}

.demo-license-window [hidden] {
    display: none !important;
}

.demo-license-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 8px 16px;
    background: #0f172a;
    color: white;
}

.demo-license-header h2 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.demo-license-columns, .demo-license-actions {
    display: grid;
    grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
    gap: 8px;
    margin-top: 8px;
}

.demo-license-card {
    min-width: 0;
    border: 1px solid #cbd5e1;
    background: white;
}

.demo-license-card h3 {
    margin: 0;
    padding: 10px 14px;
    background: #1e293b;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.demo-license-fields {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
    gap: 6px 8px;
    padding: 14px 8px 8px 16px;
}

.demo-license-fields label {
    margin: 0;
    font-size: 13px;
}

.demo-license-window input, .demo-license-window select, .demo-license-window textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 0;
    background: white;
    color: #1e293b;
    font: inherit;
}

.demo-license-email {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) 16px minmax(100px, 1fr);
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.demo-license-email [data-demo-email-custom] {
    grid-column: 3;
}

.demo-license-tax {
    display: grid;
    grid-template-columns: minmax(0, 168px) minmax(40px, 1fr);
    gap: 6px;
}

.demo-license-note {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: #475569;
}

.demo-license-side {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 6px;
    min-width: 0;
}

.demo-license-contact {
    padding: 10px 14px;
}

.demo-license-contact p {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.demo-license-summary [data-xaml='LicenseSummaryCard'] {
    min-height: 120px;
    height: calc(100% - 40px);
    padding: 12px;
    background: #64748b;
}

.demo-license-action-row, .demo-license-backup-row, .demo-license-utility-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.demo-license-backup-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 6px;
}

.demo-license-utility-row {
    grid-template-columns: 112fr 88fr 88fr;
    align-self: start;
}

.demo-license-window .demo-license-actions button {
    min-width: 0;
    min-height: 36px;
    padding: 4px;
    border: 1px solid #1d4ed8;
    border-radius: 0;
    background: #2563eb;
    color: white;
    font: 11px/1.3 'Segoe UI', sans-serif;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.demo-license-window .demo-license-backup-row button {
    background: #0f766e;
    border-color: #115e59;
}

.demo-license-window [data-xaml='OnlineLicenseButton'] {
    background: #16a34a;
    border-color: #15803d;
}

.demo-license-window [data-xaml='ToggleLogButton'] {
    background: #1e40af;
    border-color: #1e3a8a;
}

.demo-license-window [data-xaml='Close_Click'] {
    background: #334155;
    border-color: #334155;
}

.demo-license-log {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
}

.demo-license-log textarea {
    display: block;
    min-height: 120px;
    padding: 8px 12px;
    resize: vertical;
}

@media (min-width: 1200px) {
    .demo-license-email {
        grid-template-columns: minmax(60px, 120px) 16px minmax(90px, 112px) minmax(60px, 1fr);
    }

    .demo-license-email [data-demo-email-custom] {
        grid-column: 4;
    }

}

@media (max-width: 760px) {
    .demo-modal-backdrop {
        padding: 12px;
    }

    .demo-license-header {
        flex-wrap: wrap;
        padding: 12px;
    }

    .demo-license-columns, .demo-license-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .demo-license-fields {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
        gap: 6px;
    }

    .demo-license-fields label {
        margin-top: 4px;
    }

    .demo-license-summary [data-xaml='LicenseSummaryCard'] {
        min-height: 70px;
    }

    .demo-license-tax {
        grid-template-columns: minmax(0, 1fr);
    }

    .demo-license-email [data-demo-email-custom] {
        grid-column: 1 / -1;
    }

    .demo-license-window .demo-license-actions button {
        min-height: 44px;
        font-size: 13px;
    }

}

html[data-theme] body.jt-site #main-content .demo-license-window .demo-license-header h2 {
    color: white !important;
    font-size: 18px !important;
    margin: 0 !important;
}

html[data-theme] body.jt-site #main-content .demo-license-window .demo-license-card h3 {
    color: white !important;
    font-size: 14px !important;
    margin: 0 !important;
}

.jt-site .demo-license-window :is(p, strong) {
    font-size: 13px !important;
    line-height: 1.45 !important;
}

html[data-theme] body.jt-site #main-content .demo-license-window :is(input, select, textarea) {
    background: white !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.demo-license-window {
    --jt-theme-ink: #1e293b;
    --jt-theme-muted: #475569;
    --jt-theme-surface: #ffffff;
    --jt-theme-line: #cbd5e1;
    color-scheme: light;
}

html[data-theme] body.jt-site #main-content .demo-license-window .demo-license-card h3 {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
}
