.demo-page {
    --brand-primary: #1E4D3D;
    --brand-primary-dark: #0F2F25;
    --brand-primary-soft: #DCE9E3;
    --surface-page: #F5F7F6;
    --surface-card: #FFFFFF;
    --surface-sidebar: #123B2E;
    --surface-sidebar-hover: #245B47;
    --surface-sidebar-active: #356C57;
    --text-primary: #17222B;
    --text-secondary: #63717C;
    --text-muted: #8A97A3;
    --text-on-dark: #FFFFFF;
    --border-default: #DCE3E0;
    --border-strong: #C7D2CD;
    --success: #168A55;
    --success-soft: #DDF4E9;
    --warning: #C77912;
    --danger: #C73838;
    --danger-soft: #FBE1E1;
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-dark);
    --bg: var(--surface-page);
    --card: var(--surface-card);
    --text: var(--text-primary);
    --muted: var(--text-secondary);
    --border: var(--border-default);
    background: var(--surface-page);
}

.demo-page .demo-banner {
    display: none;
}

.demo-page .app-shell {
    display: block;
}

.demo-page .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    padding: 20px 12px;
    background: var(--surface-sidebar);
}

.demo-page .main {
    min-height: 100vh;
    margin-left: 260px;
    background: var(--surface-page);
}

.demo-page .topbar {
    min-height: 57px;
    padding: 10px 22px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-default);
}

.demo-page .content {
    padding: 24px;
}

.demo-page .page-header {
    margin-bottom: 22px;
}

.demo-page .page-header h1 {
    margin: 0 0 2px;
    color: #061421;
    font-size: 30px;
    line-height: 1.15;
}

.demo-page .page-header p {
    margin: 0;
    color: #708395;
    font-size: 14px;
}

.demo-page .card,
.demo-page .metric-card {
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(23, 34, 43, 0.04);
}

.demo-page .section-spacing {
    margin-top: 24px;
}

.demo-page .main-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 20px;
}

.demo-page .form-stack {
    display: grid;
    gap: 12px;
}

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

.demo-page .table-link-strong {
    color: #001a14;
    font-weight: 750;
}

.demo-page .metric-sub {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}

.demo-page .badge-danger {
    color: #991b1b;
    background: #fee2e2;
}

.demo-page .settings-demo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.demo-page .settings-card-link {
    min-height: 174px;
    padding: 22px;
    color: #073b31;
    text-align: left;
    cursor: pointer;
}

.demo-page .settings-card-link h2,
.demo-page .settings-card-link p {
    text-decoration: underline;
}

.demo-page .settings-card-link p {
    margin: 18px 0 0;
    color: #073b31;
    font-size: 16px;
}

.demo-page .settings-card-link:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 3px 10px rgba(23, 34, 43, 0.08);
}

.demo-page .public-footer {
    display: none;
}

.is-hidden {
    display: none !important;
}

.tour-welcome {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
}

.tour-welcome-card {
    width: min(520px, 100%);
    padding: 28px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.tour-welcome-card h1 {
    margin: 0 0 8px;
    color: #061421;
    font-size: 30px;
}

.tour-welcome-card p {
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.tutorial-helper {
    position: fixed;
    left: 16px;
    bottom: 18px;
    z-index: 1300;
    display: grid;
    width: min(292px, calc(100vw - 28px));
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
    padding: 15px 38px 15px 15px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}

.tutorial-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #0f172a;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.tutorial-close:hover,
.tutorial-close:focus {
    background: #e2e8f0;
}

.tutorial-helper::after {
    display: none;
}

.tutorial-kicker {
    margin-bottom: 4px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.tutorial-helper h2 {
    margin: 0 0 7px;
    color: var(--ink);
    font-size: 18px;
}

.tutorial-helper p {
    margin: 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.35;
}

.tutorial-instruction {
    margin-top: 8px !important;
    font-weight: 750;
}

.tutorial-helper-side {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.tutorial-progress,
.tutorial-actions,
.tutorial-complete-actions .inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tutorial-progress:empty {
    display: none;
}

.tutorial-dot {
    min-width: 0;
    min-height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    background: #dbeafe;
    box-shadow: inset 0 0 0 2px #bfdbfe;
    color: #1e3a8a;
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
}

.tutorial-dot.is-current {
    min-height: 30px;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(21, 81, 65, 0.16);
}

.tutorial-dot.is-complete {
    background: #16a34a;
    color: #ffffff;
    box-shadow: none;
    position: relative;
}

.tutorial-dot span {
    display: inline-block;
}

.tutorial-message {
    display: none;
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 750;
}

.tutorial-message.is-visible {
    display: inline-block;
}

.tutorial-message.is-success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.tutorial-message.is-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.tutorial-highlight {
    position: relative;
}

.tutorial-required-highlight {
    outline: 3px solid #2563eb !important;
    outline-offset: 4px;
    box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.14) !important;
}

.tutorial-arrow {
    position: fixed;
    z-index: 1400;
    width: 36px;
    height: 24px;
    background: #2563eb;
    clip-path: polygon(0 34%, 58% 34%, 58% 0, 100% 50%, 58% 100%, 58% 66%, 0 66%);
    pointer-events: none;
    filter: drop-shadow(0 8px 14px rgba(37, 99, 235, 0.32));
    animation: tutorialArrowNudge 1.05s ease-in-out infinite;
}

.tutorial-arrow[data-direction="left"] {
    transform: rotate(180deg);
}

.tutorial-arrow[data-direction="up"] {
    transform: rotate(-90deg);
}

.tutorial-arrow[data-direction="down"] {
    transform: rotate(90deg);
}

.tutorial-arrow.is-hidden {
    display: none;
}

.tutorial-highlight::before,
.tutorial-highlight::after {
    content: "";
    display: none;
}

@keyframes tutorialArrowNudge {
    0%, 100% {
        opacity: 0.95;
        filter: drop-shadow(0 8px 14px rgba(37, 99, 235, 0.32));
    }
    50% {
        opacity: 0.72;
        filter: drop-shadow(0 10px 18px rgba(37, 99, 235, 0.44));
    }
}

.demo-page textarea {
    width: 100%;
    min-height: 76px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.demo-page .radio-group {
    display: grid;
    gap: 8px;
}

.demo-page .radio-group label {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #334155;
    font-weight: 750;
}

.demo-page .radio-group input {
    width: auto;
    min-height: auto;
}

.demo-record-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 28px 20px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.48);
}

.demo-record-modal.is-open {
    display: flex;
}

.demo-record-modal-card {
    width: min(760px, 100%);
}

.demo-record-modal-card-wide {
    width: min(1120px, 100%);
}

.demo-record-modal-card-narrow {
    width: min(520px, 100%);
}

.demo-modal-header {
    margin-bottom: 16px !important;
}

.demo-record-modal .card {
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

.demo-record-modal .demo-form {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
}

.demo-page .alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.demo-page .alert-success {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.demo-page .alert-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

@media (max-width: 900px) {
    .demo-page .sidebar {
        position: static;
        width: auto;
    }

    .demo-page .main {
        margin-left: 0;
    }

    .demo-page .main-grid {
        grid-template-columns: 1fr;
    }

    .demo-page .settings-demo-grid {
        grid-template-columns: 1fr;
    }

    .tutorial-helper {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
    }

    .tutorial-helper-side {
        justify-items: start;
    }

}
