/* =========================================================
   RESTREE CONFIGURATION & QUOTING UI SYSTEM

   Purpose:
   Standalone UI styles for RESTREE product search, configuration,
   quoting, order entry, and related administration.

   Conventions:
   - All custom component classes use the restree-* prefix.
   - All custom CSS variables use the --restree-* prefix.
   - Styles are scoped beneath .restree-app wherever practical.
   - Theme is controlled with:
         <html data-restree-theme="light">
         <html data-restree-theme="dark">
   - Bootstrap controls are supported, but overrides are scoped to
     .restree-app to avoid leaking into unrelated applications.
========================================================= */


/* =========================================================
   01. DESIGN TOKENS - LIGHT THEME
========================================================= */
.restree-app {
    color-scheme: light;
    --restree-bg-page: #f5f5f5;
    --restree-bg-surface: #ffffff;
    --restree-bg-subtle: #f8fafc;
    --restree-bg-muted: #f1f5f9;
    --restree-bg-hover: #f8fafc;
    --restree-bg-selected: #e7f1ff;
    --restree-text: #212529;
    --restree-text-muted: #6c757d;
    --restree-text-soft: #64748b;
    --restree-text-inverse: #ffffff;
    --restree-border: #b8c0cc;
    --restree-border-soft: #d7dde5;
    --restree-border-strong: #94a3b8;
    --restree-accent: #0d6efd;
    --restree-accent-hover: #0b5ed7;
    --restree-accent-soft: #e7f1ff;
    --restree-accent-border: #bfd7ff;
    --restree-accent-contrast: #ffffff;
    --restree-success: #198754;
    --restree-success-soft: #edf8f2;
    --restree-success-border: #a9dfc3;
    --restree-warning: #b26a00;
    --restree-warning-soft: #fff7e8;
    --restree-warning-border: #f1c27d;
    --restree-danger: #dc3545;
    --restree-danger-soft: #fff1f2;
    --restree-danger-border: #f2a8b0;
    --restree-info: #0d6efd;
    --restree-info-soft: #eef6ff;
    --restree-info-border: #bfd7ff;
    --restree-neutral-soft: #f1f5f9;
    --restree-header-bg: #000000;
    --restree-header-text: #ffffff;
    --restree-shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
    --restree-shadow-sm: 0 4px 12px rgba(15, 23, 42, .08);
    --restree-shadow-md: 0 12px 28px rgba(15, 23, 42, .12);
    --restree-radius-sm: 6px;
    --restree-radius-md: 10px;
    --restree-radius-lg: 14px;
    --restree-radius-pill: 999px;
    --restree-control-height: 38px;
    --restree-transition: 150ms ease;
}


/* =========================================================
   02. DESIGN TOKENS - DARK THEME
========================================================= */
html[data-restree-theme="dark"] .restree-app {
    color-scheme: dark;
    --restree-bg-page: #121212;
    --restree-bg-surface: #1e1e1e;
    --restree-bg-subtle: #262626;
    --restree-bg-muted: #303030;
    --restree-bg-hover: #2a2a2a;
    --restree-bg-selected: #3a2f12;
    --restree-text: #e8e8e8;
    --restree-text-muted: #a7a7a7;
    --restree-text-soft: #cbd5e1;
    --restree-text-inverse: #111111;
    --restree-border: #454545;
    --restree-border-soft: #343434;
    --restree-border-strong: #5a5a5a;
    --restree-accent: #f9c866;
    --restree-accent-hover: #e8b84f;
    --restree-accent-soft: #3a2f12;
    --restree-accent-border: #5a4520;
    --restree-accent-contrast: #111111;
    --restree-success: #4ade80;
    --restree-success-soft: #18251d;
    --restree-success-border: #2f5738;
    --restree-warning: #f9c866;
    --restree-warning-soft: #2a2418;
    --restree-warning-border: #5a4520;
    --restree-danger: #f87171;
    --restree-danger-soft: #2a1818;
    --restree-danger-border: #5a2a2a;
    --restree-info: #8ab4f8;
    --restree-info-soft: #182434;
    --restree-info-border: #2f4665;
    --restree-neutral-soft: #2a2a2a;
    --restree-header-bg: #000000;
    --restree-header-text: #ffffff;
    --restree-shadow-xs: 0 1px 2px rgba(0, 0, 0, .28);
    --restree-shadow-sm: 0 4px 14px rgba(0, 0, 0, .32);
    --restree-shadow-md: 0 14px 34px rgba(0, 0, 0, .46);
}


/* =========================================================
   03. APP SHELL / BASE
========================================================= */

.restree-app {
    min-height: 100vh;
    background: var(--restree-bg-page);
    color: var(--restree-text);
    font-size: 14px;
}

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

    .restree-app .restree-shell {
        width: 100%;
        max-width: 1500px;
        margin: 0 auto;
        padding: 0 18px 40px;
    }

    .restree-app .restree-content {
        min-width: 0;
    }

    .restree-app .restree-page-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 18px;
        margin-bottom: 18px;
    }

    .restree-app .restree-page-header-main {
        min-width: 0;
    }

    .restree-app .restree-page-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
    }

    .restree-app .restree-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
        margin-bottom: 14px;
    }

    .restree-app .restree-toolbar-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .restree-app .restree-divider {
        border: 0;
        border-top: 1px solid var(--restree-border-soft);
        margin: 18px 0;
    }


    /* =========================================================
   04. TYPOGRAPHY / LINKS
========================================================= */
    .restree-app .restree-title {
        margin: 0;
        color: var(--restree-text);
        font-size: 20px;
        font-weight: 700;
        line-height: 1.25;
    }

    .restree-app .restree-subtitle {
        margin: 5px 0 0;
        color: var(--restree-text-muted);
        font-size: 13px;
        line-height: 1.55;
    }

    .restree-app .restree-section-title {
        margin: 0;
        color: var(--restree-text);
        font-size: 15px;
        font-weight: 700;
    }

    .restree-app .restree-label {
        color: var(--restree-text);
        font-size: 12px;
        font-weight: 700;
    }

    .restree-app .restree-help,
    .restree-app .restree-muted {
        color: var(--restree-text-muted);
    }

    .restree-app .restree-help {
        margin-top: 4px;
        font-size: 11px;
        line-height: 1.45;
    }

    .restree-app a:not(.btn):not(.restree-button) {
        color: var(--restree-accent);
        text-decoration-color: color-mix(in srgb, var(--restree-accent) 45%, transparent);
    }

        .restree-app a:not(.btn):not(.restree-button):hover {
            color: var(--restree-accent-hover);
        }

    .restree-app mark {
        padding: .1em .25em;
        border-radius: 3px;
        background: var(--restree-accent-soft);
        color: var(--restree-text);
    }


    /* =========================================================
   05. PANELS / CARDS / SECTION HEADERS
========================================================= */
    .restree-app .restree-panel {
        margin-bottom: 18px;
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border-soft);
        border-radius: var(--restree-radius-md);
        box-shadow: var(--restree-shadow-xs);
    }

    .restree-app .restree-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        background: var(--restree-bg-subtle);
        border-bottom: 1px solid var(--restree-border-soft);
        border-radius: var(--restree-radius-md) var(--restree-radius-md) 0 0;
    }

    .restree-app .restree-panel-body {
        padding: 16px;
    }

    .restree-app .restree-panel-footer {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        padding: 12px 14px;
        background: var(--restree-bg-subtle);
        border-top: 1px solid var(--restree-border-soft);
        border-radius: 0 0 var(--restree-radius-md) var(--restree-radius-md);
    }

    .restree-app .restree-card {
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-md);
        box-shadow: var(--restree-shadow-xs);
    }

    .restree-app .restree-card-body {
        padding: 14px;
    }

    .restree-app .restree-card.is-selected {
        border-color: var(--restree-accent);
        box-shadow: 0 0 0 2px var(--restree-accent-soft);
    }

    .restree-app .restree-empty-state {
        padding: 28px 18px;
        background: var(--restree-bg-subtle);
        border: 1px dashed var(--restree-border);
        border-radius: var(--restree-radius-md);
        color: var(--restree-text-muted);
        text-align: center;
    }

    .restree-app .restree-empty-state-title {
        margin-bottom: 4px;
        color: var(--restree-text);
        font-weight: 700;
    }


    /* =========================================================
   06. FORMS
========================================================= */
    .restree-app .form-label,
    .restree-app .restree-form-label {
        margin-bottom: 5px;
        color: var(--restree-text);
        font-size: 12px;
        font-weight: 700;
    }

    .restree-app .form-control,
    .restree-app .form-select,
    .restree-app textarea,
    .restree-app .restree-input,
    .restree-app .restree-select,
    .restree-app .restree-textarea {
        min-height: var(--restree-control-height);
        background-color: var(--restree-bg-surface);
        color: var(--restree-text);
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-sm);
        transition: border-color var(--restree-transition), box-shadow var(--restree-transition), background-color var(--restree-transition);
    }

    .restree-app textarea,
    .restree-app .restree-textarea {
        min-height: 88px;
        resize: vertical;
    }

        .restree-app .form-control:focus,
        .restree-app .form-select:focus,
        .restree-app textarea:focus,
        .restree-app .restree-input:focus,
        .restree-app .restree-select:focus,
        .restree-app .restree-textarea:focus {
            background-color: var(--restree-bg-surface);
            color: var(--restree-text);
            border-color: var(--restree-accent);
            box-shadow: 0 0 0 3px var(--restree-accent-soft);
            outline: none;
        }

        .restree-app .form-control:disabled,
        .restree-app .form-select:disabled,
        .restree-app textarea:disabled,
        .restree-app .restree-input:disabled,
        .restree-app .restree-select:disabled,
        .restree-app .restree-textarea:disabled {
            background-color: var(--restree-bg-muted);
            color: var(--restree-text-muted);
            cursor: not-allowed;
            opacity: .85;
        }

    .restree-app .form-check-input {
        background-color: var(--restree-bg-surface);
        border-color: var(--restree-border);
    }

        .restree-app .form-check-input:checked {
            background-color: var(--restree-accent);
            border-color: var(--restree-accent);
        }

        .restree-app .form-check-input:focus {
            border-color: var(--restree-accent);
            box-shadow: 0 0 0 3px var(--restree-accent-soft);
        }

    .restree-app .restree-form-grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 14px;
    }

    .restree-app .restree-col-12 {
        grid-column: span 12;
    }

    .restree-app .restree-col-10 {
        grid-column: span 10;
    }

    .restree-app .restree-col-9 {
        grid-column: span 9;
    }

    .restree-app .restree-col-8 {
        grid-column: span 8;
    }

    .restree-app .restree-col-6 {
        grid-column: span 6;
    }

    .restree-app .restree-col-5 {
        grid-column: span 5;
    }

    .restree-app .restree-col-4 {
        grid-column: span 4;
    }

    .restree-app .restree-col-3 {
        grid-column: span 3;
    }

    .restree-app .restree-col-2 {
        grid-column: span 2;
    }

    .restree-app .restree-field-error {
        margin-top: 4px;
        color: var(--restree-danger);
        font-size: 11px;
        font-weight: 600;
    }


    /* =========================================================
   07. BUTTONS / ICON ACTIONS
========================================================= */
    .restree-app .btn,
    .restree-app .restree-button {
        min-height: 36px;
        border-radius: var(--restree-radius-sm);
        font-weight: 600;
    }

    .restree-app .btn-primary,
    .restree-app .restree-button-primary {
        background: var(--restree-accent) !important;
        border-color: var(--restree-accent) !important;
        color: var(--restree-accent-contrast) !important;
    }

        .restree-app .btn-primary:hover,
        .restree-app .btn-primary:focus,
        .restree-app .restree-button-primary:hover,
        .restree-app .restree-button-primary:focus {
            background: var(--restree-accent-hover) !important;
            border-color: var(--restree-accent-hover) !important;
            color: var(--restree-accent-contrast) !important;
        }

    .restree-app .btn-outline-primary {
        border-color: var(--restree-accent);
        color: var(--restree-accent);
    }

        .restree-app .btn-outline-primary:hover,
        .restree-app .btn-outline-secondary:hover,
        .restree-app .btn-secondary:hover,
        .restree-app .btn-light:hover {
            background: var(--restree-bg-muted) !important;
            border-color: var(--restree-border) !important;
            color: var(--restree-text) !important;
        }

    .restree-app .restree-icon-button {
        display: inline-flex;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        padding: 0;
        background: transparent;
        color: var(--restree-text-muted);
        border: 1px solid transparent;
        border-radius: var(--restree-radius-sm);
        cursor: pointer;
        transition: color var(--restree-transition), background var(--restree-transition), border-color var(--restree-transition);
    }

        .restree-app .restree-icon-button:hover {
            background: var(--restree-bg-muted);
            color: var(--restree-text);
            border-color: var(--restree-border-soft);
        }

        .restree-app .restree-icon-button.is-danger:hover {
            background: var(--restree-danger-soft);
            color: var(--restree-danger);
            border-color: var(--restree-danger-border);
        }


    /* =========================================================
   08. BADGES / STATUS / ALERTS
========================================================= */
    .restree-app .restree-badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 4px 8px;
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-pill);
        background: var(--restree-bg-subtle);
        color: var(--restree-text);
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
    }

    .restree-app .restree-badge-success {
        background: var(--restree-success-soft);
        border-color: var(--restree-success-border);
        color: var(--restree-success);
    }

    .restree-app .restree-badge-warning {
        background: var(--restree-warning-soft);
        border-color: var(--restree-warning-border);
        color: var(--restree-warning);
    }

    .restree-app .restree-badge-danger {
        background: var(--restree-danger-soft);
        border-color: var(--restree-danger-border);
        color: var(--restree-danger);
    }

    .restree-app .restree-badge-info {
        background: var(--restree-info-soft);
        border-color: var(--restree-info-border);
        color: var(--restree-info);
    }

    .restree-app .restree-badge-accent {
        background: var(--restree-accent-soft);
        border-color: var(--restree-accent-border);
        color: var(--restree-accent);
    }

    .restree-app .restree-alert,
    .restree-app .alert {
        padding: 12px 14px;
        background: var(--restree-bg-subtle);
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-md);
        color: var(--restree-text);
    }

    .restree-app .restree-alert-success,
    .restree-app .alert-success {
        background: var(--restree-success-soft) !important;
        border-color: var(--restree-success-border) !important;
        color: var(--restree-success) !important;
    }

    .restree-app .restree-alert-warning,
    .restree-app .alert-warning {
        background: var(--restree-warning-soft) !important;
        border-color: var(--restree-warning-border) !important;
        color: var(--restree-warning) !important;
    }

    .restree-app .restree-alert-danger,
    .restree-app .alert-danger {
        background: var(--restree-danger-soft) !important;
        border-color: var(--restree-danger-border) !important;
        color: var(--restree-danger) !important;
    }

    .restree-app .restree-alert-info,
    .restree-app .alert-info {
        background: var(--restree-info-soft) !important;
        border-color: var(--restree-info-border) !important;
        color: var(--restree-info) !important;
    }


    /* =========================================================
   09. TABLE SYSTEM
========================================================= */
    .restree-app .restree-table-wrap {
        width: 100%;
        overflow-x: auto;
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-md);
        background: var(--restree-bg-surface);
    }

    .restree-app .restree-table,
    .restree-app .table {
        width: 100%;
        margin-bottom: 0;
        color: var(--restree-text);
        --bs-table-color: var(--restree-text);
        --bs-table-bg: transparent;
        --bs-table-border-color: var(--restree-border-soft);
        --bs-table-striped-color: var(--restree-text);
        --bs-table-striped-bg: var(--restree-bg-subtle);
        --bs-table-hover-color: var(--restree-text);
        --bs-table-hover-bg: var(--restree-bg-hover);
    }

        .restree-app .restree-table th,
        .restree-app .table thead th {
            padding: 10px 12px;
            background: var(--restree-bg-subtle) !important;
            color: var(--restree-text-muted) !important;
            border-color: var(--restree-border-soft) !important;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .04em;
            white-space: nowrap;
        }

        .restree-app .restree-table td,
        .restree-app .table td {
            padding: 11px 12px;
            background: transparent;
            color: var(--restree-text) !important;
            border-color: var(--restree-border-soft) !important;
            font-size: 13px;
            vertical-align: middle;
        }

        .restree-app .restree-table tbody tr:hover,
        .restree-app .table-hover tbody tr:hover {
            background: var(--restree-bg-hover);
        }

        .restree-app .restree-table tbody tr.is-selected,
        .restree-app .restree-table tbody tr.is-editing,
        .restree-app .gv-row-editing,
        .restree-app .gv-row-editing td {
            background: var(--restree-bg-selected) !important;
        }

    .restree-app .restree-table-actions {
        display: flex;
        justify-content: flex-end;
        gap: 4px;
        white-space: nowrap;
    }

    .restree-app .restree-table .restree-cell-primary {
        color: var(--restree-text);
        font-weight: 700;
    }

    .restree-app .restree-table .restree-cell-secondary {
        color: var(--restree-text-muted);
        font-size: 12px;
    }


    /* =========================================================
   10. LIST / MASTER-DETAIL SYSTEM
========================================================= */
    .restree-app .restree-split-layout {
        display: grid;
        grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
        gap: 16px;
        align-items: start;
    }

    .restree-app .restree-master-pane,
    .restree-app .restree-detail-pane {
        min-width: 0;
    }

    .restree-app .restree-list {
        overflow: hidden;
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-md);
    }

    .restree-app .restree-list-item {
        display: block;
        width: 100%;
        padding: 11px 13px;
        background: var(--restree-bg-surface);
        color: var(--restree-text);
        border: 0;
        border-bottom: 1px solid var(--restree-border-soft);
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        transition: background var(--restree-transition), border-color var(--restree-transition);
    }

        .restree-app .restree-list-item:last-child {
            border-bottom: 0;
        }

        .restree-app .restree-list-item:hover,
        .restree-app .restree-list-item:focus {
            background: var(--restree-bg-hover);
            color: var(--restree-text);
        }

        .restree-app .restree-list-item.is-selected {
            padding-left: 9px;
            background: var(--restree-bg-selected);
            border-left: 4px solid var(--restree-accent);
        }

    .restree-app .restree-list-item-title {
        color: var(--restree-text);
        font-weight: 700;
        line-height: 1.3;
    }

    .restree-app .restree-list-item-meta {
        margin-top: 3px;
        color: var(--restree-text-muted);
        font-size: 11px;
    }

    .restree-app .restree-scroll-list {
        max-height: 520px;
        overflow-y: auto;
    }


    /* =========================================================
   11. FILTERS / SEARCH / TABS
========================================================= */
    .restree-app .restree-filter-bar {
        display: flex;
        align-items: end;
        gap: 10px;
        flex-wrap: wrap;
        padding: 10px;
        margin-bottom: 12px;
        background: var(--restree-bg-subtle);
        border: 1px solid var(--restree-border-soft);
        border-radius: var(--restree-radius-md);
    }

    .restree-app .restree-filter-field {
        min-width: 160px;
    }

    .restree-app .restree-filter-search {
        flex: 1 1 260px;
    }

    .restree-app .restree-tabs {
        display: flex;
        gap: 4px;
        margin-bottom: 14px;
        padding: 4px;
        overflow-x: auto;
        background: var(--restree-bg-muted);
        border: 1px solid var(--restree-border-soft);
        border-radius: var(--restree-radius-md);
    }

    .restree-app .restree-tab {
        flex: 0 0 auto;
        padding: 7px 11px;
        background: transparent;
        color: var(--restree-text-muted);
        border: 0;
        border-radius: var(--restree-radius-sm);
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }

        .restree-app .restree-tab:hover {
            color: var(--restree-text);
        }

        .restree-app .restree-tab.is-active {
            background: var(--restree-bg-surface);
            color: var(--restree-text);
            box-shadow: var(--restree-shadow-xs);
        }


    /* =========================================================
   12. MODEL MATCH / COMPARISON WORKSPACE
========================================================= */
    .restree-app .restree-match-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 14px;
        align-items: stretch;
        margin-bottom: 14px;
    }

    .restree-app .restree-match-product {
        padding: 14px;
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-md);
    }

    .restree-app .restree-match-product-label {
        margin-bottom: 5px;
        color: var(--restree-text-muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .restree-app .restree-match-product-name {
        color: var(--restree-text);
        font-size: 16px;
        font-weight: 700;
    }

    .restree-app .restree-match-versus {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        color: var(--restree-text-muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .restree-app .restree-criteria-grid {
        overflow: hidden;
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-md);
        background: var(--restree-bg-surface);
    }

    .restree-app .restree-criteria-row {
        display: grid;
        grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(135px, .75fr) 190px;
        border-bottom: 1px solid var(--restree-border-soft);
    }

        .restree-app .restree-criteria-row:last-child {
            border-bottom: 0;
        }

        .restree-app .restree-criteria-row.is-header {
            background: var(--restree-bg-subtle);
            color: var(--restree-text-muted);
            font-size: 10px;
            font-weight: 800;
            letter-spacing: .04em;
            text-transform: uppercase;
        }

        .restree-app .restree-criteria-row.is-inactive {
            opacity: .6;
        }

    .restree-app .restree-criteria-cell {
        min-width: 0;
        padding: 10px 12px;
        border-right: 1px solid var(--restree-border-soft);
    }

        .restree-app .restree-criteria-cell:last-child {
            border-right: 0;
        }

    .restree-app .restree-criteria-name {
        color: var(--restree-text);
        font-weight: 700;
    }

    .restree-app .restree-criteria-notes {
        margin-top: 4px;
        color: var(--restree-text-muted);
        font-size: 11px;
        line-height: 1.4;
    }

    .restree-app .restree-comparison-status {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        font-weight: 800;
        white-space: nowrap;
    }

        .restree-app .restree-comparison-status::before {
            content: "";
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: currentColor;
        }

    .restree-app .restree-status-match {
        color: var(--restree-success);
    }

    .restree-app .restree-status-draper-exceeds {
        color: var(--restree-success);
    }

    .restree-app .restree-status-competitor-exceeds {
        color: var(--restree-warning);
    }

    .restree-app .restree-status-no-match {
        color: var(--restree-danger);
    }

    .restree-app .restree-status-info {
        color: var(--restree-info);
    }

    .restree-app .restree-status-na {
        color: var(--restree-text-muted);
    }

    .restree-app .restree-comparison-summary {
        display: grid;
        grid-template-columns: repeat(4, minmax(120px, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }

    .restree-app .restree-summary-card {
        padding: 12px;
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border-soft);
        border-radius: var(--restree-radius-md);
    }

    .restree-app .restree-summary-value {
        color: var(--restree-text);
        font-size: 20px;
        font-weight: 800;
        line-height: 1;
    }

    .restree-app .restree-summary-label {
        margin-top: 5px;
        color: var(--restree-text-muted);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
    }


    /* =========================================================
   13. DOCUMENTS / FILES
========================================================= */
    .restree-app .restree-file-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 10px;
    }

    .restree-app .restree-file-card {
        position: relative;
        min-width: 0;
        padding: 12px;
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border-soft);
        border-radius: var(--restree-radius-md);
        color: var(--restree-text);
        transition: transform var(--restree-transition), border-color var(--restree-transition), box-shadow var(--restree-transition);
    }

        .restree-app .restree-file-card:hover {
            transform: translateY(-2px);
            border-color: var(--restree-accent);
            box-shadow: var(--restree-shadow-sm);
        }

    .restree-app .restree-file-name {
        overflow: hidden;
        color: var(--restree-text);
        font-size: 12px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .restree-app .restree-file-meta {
        margin-top: 4px;
        color: var(--restree-text-muted);
        font-size: 10px;
    }

    .restree-app .restree-dropzone {
        padding: 24px;
        background: var(--restree-bg-subtle);
        border: 2px dashed var(--restree-border);
        border-radius: var(--restree-radius-md);
        color: var(--restree-text-muted);
        text-align: center;
        transition: background var(--restree-transition), border-color var(--restree-transition);
    }

        .restree-app .restree-dropzone.is-dragover {
            background: var(--restree-accent-soft);
            border-color: var(--restree-accent);
        }


    /* =========================================================
   14. MODALS / DRAWERS
========================================================= */
    .restree-app .modal-content {
        background: var(--restree-bg-surface);
        color: var(--restree-text);
        border: 1px solid var(--restree-border);
    }

    .restree-app .modal-header,
    .restree-app .modal-footer {
        border-color: var(--restree-border-soft);
    }

    .restree-app .modal-title {
        color: var(--restree-text);
    }

    .restree-app .restree-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(0, 0, 0, .45);
    }

    .restree-app .restree-drawer {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1050;
        width: min(520px, 92vw);
        height: 100vh;
        background: var(--restree-bg-surface);
        border-left: 1px solid var(--restree-border);
        box-shadow: var(--restree-shadow-md);
        overflow-y: auto;
    }

    .restree-app .restree-drawer-header {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px;
        background: var(--restree-bg-surface);
        border-bottom: 1px solid var(--restree-border-soft);
    }

    .restree-app .restree-drawer-body {
        padding: 16px;
    }

    .restree-app .restree-drawer-footer {
        position: sticky;
        bottom: 0;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        padding: 12px 16px;
        background: var(--restree-bg-surface);
        border-top: 1px solid var(--restree-border-soft);
    }


    /* =========================================================
   15. NAVIGATION / BREADCRUMBS / THEME TOGGLE
========================================================= */
    .restree-app .restree-breadcrumbs {
        display: flex;
        align-items: center;
        gap: 7px;
        flex-wrap: wrap;
        margin-bottom: 10px;
        color: var(--restree-text-muted);
        font-size: 11px;
    }

        .restree-app .restree-breadcrumbs a {
            text-decoration: none;
        }

    .restree-app .restree-breadcrumb-separator {
        color: var(--restree-border-strong);
    }

    .restree-app .restree-theme-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .restree-app .restree-theme-switch {
        position: relative;
        display: inline-flex;
        width: 42px;
        height: 22px;
        flex: 0 0 auto;
    }

        .restree-app .restree-theme-switch input {
            width: 1px;
            height: 1px;
            opacity: 0;
            position: absolute;
        }

    .restree-app .restree-theme-switch-track {
        width: 100%;
        height: 100%;
        background: var(--restree-bg-muted);
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-pill);
        cursor: pointer;
        transition: background var(--restree-transition), border-color var(--restree-transition);
    }

        .restree-app .restree-theme-switch-track::after {
            content: "";
            position: absolute;
            top: 3px;
            left: 3px;
            width: 14px;
            height: 14px;
            background: var(--restree-text-muted);
            border-radius: 50%;
            transition: transform var(--restree-transition), background var(--restree-transition);
        }

    .restree-app .restree-theme-switch input:checked + .restree-theme-switch-track {
        background: var(--restree-accent-soft);
        border-color: var(--restree-accent);
    }

        .restree-app .restree-theme-switch input:checked + .restree-theme-switch-track::after {
            transform: translateX(20px);
            background: var(--restree-accent);
        }


    /* =========================================================
   16. LOADING / PROGRESS / UTILITY STATES
========================================================= */
    .restree-app .restree-loading {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--restree-text-muted);
        font-size: 12px;
    }

    .restree-app .restree-spinner {
        width: 16px;
        height: 16px;
        border: 2px solid var(--restree-border);
        border-top-color: var(--restree-accent);
        border-radius: 50%;
        animation: restree-spin .7s linear infinite;
    }

@keyframes restree-spin {
    to {
        transform: rotate(360deg);
    }
}

.restree-app .restree-skeleton {
    min-height: 14px;
    border-radius: 4px;
    background: linear-gradient( 90deg, var(--restree-bg-muted) 25%, var(--restree-bg-subtle) 50%, var(--restree-bg-muted) 75% );
    background-size: 200% 100%;
    animation: restree-skeleton 1.2s ease-in-out infinite;
}

@keyframes restree-skeleton {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.restree-app .restree-progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    background: var(--restree-bg-muted);
    border-radius: var(--restree-radius-pill);
}

.restree-app .restree-progress-bar {
    height: 100%;
    background: var(--restree-accent);
    border-radius: inherit;
}

.restree-app .restree-hidden {
    display: none !important;
}

.restree-app .restree-visually-muted {
    opacity: .65;
}

.restree-app .restree-nowrap {
    white-space: nowrap;
}

.restree-app .restree-text-right {
    text-align: right;
}


/* =========================================================
   17. STICKY ACTION BAR
========================================================= */
.restree-app .restree-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--restree-bg-surface) 94%, transparent);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
    box-shadow: var(--restree-shadow-sm);
    backdrop-filter: blur(8px);
}

.restree-app .restree-sticky-actions-left,
.restree-app .restree-sticky-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}


/* =========================================================
   18. RESPONSIVE
========================================================= */
@media (max-width: 1100px) {
    .restree-app .restree-comparison-summary {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .restree-app .restree-criteria-row {
        grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(120px, .8fr) 180px;
    }
}

@media (max-width: 900px) {
    .restree-app .restree-page-header {
        flex-direction: column;
    }

    .restree-app .restree-page-actions {
        justify-content: flex-start;
    }

    .restree-app .restree-split-layout {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-match-header {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-match-versus {
        min-height: 24px;
    }

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

    .restree-app .restree-col-10,
    .restree-app .restree-col-9,
    .restree-app .restree-col-8,
    .restree-app .restree-col-6,
    .restree-app .restree-col-5,
    .restree-app .restree-col-4,
    .restree-app .restree-col-3,
    .restree-app .restree-col-2 {
        grid-column: span 6;
    }
}

@media (max-width: 720px) {
    .restree-app .restree-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .restree-app .restree-comparison-summary {
        grid-template-columns: 1fr 1fr;
    }

    .restree-app .restree-criteria-grid {
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .restree-app .restree-criteria-row {
        display: block;
        margin-bottom: 10px;
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border);
        border-radius: var(--restree-radius-md);
    }

        .restree-app .restree-criteria-row.is-header {
            display: none;
        }

    .restree-app .restree-criteria-cell {
        padding: 9px 11px;
        border-right: 0;
        border-bottom: 1px solid var(--restree-border-soft);
    }

        .restree-app .restree-criteria-cell:last-child {
            border-bottom: 0;
        }

    .restree-app .restree-sticky-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .restree-app .restree-sticky-actions-left,
    .restree-app .restree-sticky-actions-right {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .restree-app .restree-comparison-summary {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-form-grid {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-col-12,
    .restree-app .restree-col-10,
    .restree-app .restree-col-9,
    .restree-app .restree-col-8,
    .restree-app .restree-col-6,
    .restree-app .restree-col-5,
    .restree-app .restree-col-4,
    .restree-app .restree-col-3,
    .restree-app .restree-col-2 {
        grid-column: 1;
    }

    .restree-app .restree-toolbar,
    .restree-app .restree-filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .restree-app .restree-filter-field,
    .restree-app .restree-filter-search {
        width: 100%;
        min-width: 0;
    }

    .restree-app .restree-file-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   19. ACCESSIBILITY / REDUCED MOTION
========================================================= */
.restree-app :focus-visible {
    outline: 2px solid var(--restree-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .restree-app *,
    .restree-app *::before,
    .restree-app *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* =========================================================
   20. OPTIONAL SITE HEADER HOOKS
   Use only when the RESTREE Configurator page owns the header.
========================================================= */
.restree-app .restree-app-header {
    background: var(--restree-header-bg);
    color: var(--restree-header-text);
    border-bottom: 0;
}

    .restree-app .restree-app-header a,
    .restree-app .restree-app-header button {
        color: var(--restree-header-text);
    }
/* =========================================================
   21. ADMIN MASTER / PRIMARY NAVIGATION
========================================================= */
.restree-app .restree-admin-header {
    position: relative;
    z-index: 1000;
    background: var(--restree-header-bg);
    color: var(--restree-header-text);
}

.restree-app .restree-admin-header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 28px;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 12px 18px 10px;
}

.restree-app .restree-admin-brand {
    display: inline-flex;
    align-items: flex-end;
    min-width: 0;
    color: var(--restree-header-text);
    text-decoration: none;
}

.restree-app .restree-admin-logo {
    display: block;
    width: auto;
    max-width: 230px;
    height: auto;
}

.restree-app .restree-admin-brand-text {
    margin-left: 14px;
    padding-bottom: 5px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.restree-app .restree-admin-menu {
    min-width: 0;
}

.restree-app .restree-admin-nav {
    display: flex;
    align-items: flex-end;
    gap: clamp(24px, 4vw, 58px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.restree-app .restree-admin-nav-item {
    position: relative;
    flex: 0 0 auto;
}

.restree-app .restree-admin-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 7px;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    opacity: .88;
    transition: opacity var(--restree-transition), color var(--restree-transition);
}

    .restree-app .restree-admin-nav-link:hover,
    .restree-app .restree-admin-nav-link:focus,
    .restree-app .restree-admin-nav-item.is-current > .restree-admin-nav-link,
    .restree-app .restree-admin-nav-item.is-open > .restree-admin-nav-link {
        color: #ffffff !important;
        opacity: 1;
    }

        .restree-app .restree-admin-nav-item.is-current > .restree-admin-nav-link::after {
            content: "";
            position: absolute;
            right: 0;
            bottom: 0;
            left: 0;
            height: 3px;
            background: var(--restree-accent);
            border-radius: var(--restree-radius-pill) var(--restree-radius-pill) 0 0;
        }

.restree-app .restree-admin-nav-caret {
    width: 0;
    height: 0;
    margin-top: 2px;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.restree-app .restree-admin-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: -12px;
    display: none;
    min-width: 220px;
    padding: 7px;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
    box-shadow: var(--restree-shadow-md);
}

.restree-app .restree-admin-nav-item.is-open > .restree-admin-dropdown {
    display: block;
}

.restree-app .restree-admin-dropdown a {
    display: block;
    padding: 9px 10px;
    color: var(--restree-text) !important;
    border-radius: var(--restree-radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}

    .restree-app .restree-admin-dropdown a:hover,
    .restree-app .restree-admin-dropdown a:focus {
        background: var(--restree-bg-hover);
        color: var(--restree-text) !important;
    }

.restree-app .restree-admin-utilities {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-bottom: 1px;
}

.restree-app .restree-admin-utility-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: var(--restree-radius-sm);
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background var(--restree-transition), border-color var(--restree-transition);
}

    .restree-app .restree-admin-utility-link:hover,
    .restree-app .restree-admin-utility-link:focus {
        background: rgba(255, 255, 255, .09);
        border-color: rgba(255, 255, 255, .42);
        color: #ffffff !important;
    }

.restree-app .restree-admin-theme {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

    .restree-app .restree-admin-theme .restree-theme-switch-track {
        background: rgba(255, 255, 255, .12);
        border-color: rgba(255, 255, 255, .32);
    }

        .restree-app .restree-admin-theme .restree-theme-switch-track::after {
            background: #ffffff;
        }

    .restree-app .restree-admin-theme .restree-theme-switch input:checked + .restree-theme-switch-track {
        background: var(--restree-accent-soft);
        border-color: var(--restree-accent);
    }

        .restree-app .restree-admin-theme .restree-theme-switch input:checked + .restree-theme-switch-track::after {
            background: var(--restree-accent);
        }

.restree-app .restree-admin-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: var(--restree-radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.restree-app .restree-admin-main {
    min-height: calc(100vh - 160px);
    padding-top: 20px;
}

.restree-app .restree-admin-footer {
    margin-top: 28px;
    padding: 14px 18px;
    background: #000000;
    color: rgba(255, 255, 255, .72);
    text-align: center;
    font-size: 11px;
}

    .restree-app .restree-admin-footer a {
        color: #ffffff !important;
    }


/* =========================================================
   22. ADMIN MASTER - RESPONSIVE
========================================================= */
@media (max-width: 1100px) {
    .restree-app .restree-admin-header-inner {
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 18px;
    }

    .restree-app .restree-admin-brand-text {
        display: none;
    }

    .restree-app .restree-admin-nav {
        gap: 26px;
    }

    .restree-app .restree-admin-utility-link {
        display: none;
    }
}

@media (max-width: 820px) {
    .restree-app .restree-admin-header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .restree-app .restree-admin-brand {
        min-width: 0;
    }

    .restree-app .restree-admin-logo {
        max-width: 205px;
    }

    .restree-app .restree-admin-mobile-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
    }

    .restree-app .restree-admin-menu {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        padding-top: 6px;
    }

        .restree-app .restree-admin-menu.is-open {
            display: block;
        }

    .restree-app .restree-admin-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        width: 100%;
    }

    .restree-app .restree-admin-nav-item {
        width: 100%;
    }

    .restree-app .restree-admin-nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 10px 12px;
        background: rgba(255, 255, 255, .06);
        border-radius: var(--restree-radius-sm);
    }

    .restree-app .restree-admin-nav-item.is-current > .restree-admin-nav-link::after {
        top: 7px;
        right: auto;
        bottom: 7px;
        left: 0;
        width: 3px;
        height: auto;
        border-radius: 0 var(--restree-radius-pill) var(--restree-radius-pill) 0;
    }

    .restree-app .restree-admin-dropdown {
        position: static;
        min-width: 0;
        margin-top: 5px;
        background: var(--restree-bg-surface);
        box-shadow: none;
    }

    .restree-app .restree-admin-utilities {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 2px;
    }

    .restree-app .restree-admin-utility-link {
        display: inline-flex;
    }
}

@media (max-width: 520px) {
    .restree-app .restree-admin-logo {
        max-width: 180px;
    }

    .restree-app .restree-admin-utilities {
        align-items: stretch;
        flex-direction: column;
    }

    .restree-app .restree-admin-theme {
        justify-content: space-between;
        width: 100%;
    }

    .restree-app .restree-admin-utility-link {
        justify-content: center;
        width: 100%;
    }
}

/* =========================================================
   23. ADMIN DASHBOARD
========================================================= */
.restree-app .restree-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.restree-app .restree-metric-card {
    min-width: 0;
    padding: 14px;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-metric-value {
    color: var(--restree-text);
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.restree-app .restree-metric-label {
    margin-top: 6px;
    color: var(--restree-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.restree-app .restree-admin-launch-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.restree-app .restree-admin-launch-card {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    padding: 18px;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-md);
    box-shadow: var(--restree-shadow-xs);
    color: var(--restree-text) !important;
    text-decoration: none !important;
    transition: transform var(--restree-transition), border-color var(--restree-transition), box-shadow var(--restree-transition);
}

    .restree-app .restree-admin-launch-card:hover,
    .restree-app .restree-admin-launch-card:focus {
        transform: translateY(-2px);
        border-color: var(--restree-accent);
        box-shadow: var(--restree-shadow-sm);
        color: var(--restree-text) !important;
    }

.restree-app .restree-admin-launch-kicker {
    margin-bottom: 8px;
    color: var(--restree-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.restree-app .restree-admin-launch-title {
    margin: 0 0 8px;
    color: var(--restree-text);
    font-size: 17px;
    font-weight: 800;
}

.restree-app .restree-admin-launch-text {
    margin: 0;
    color: var(--restree-text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.restree-app .restree-admin-launch-action {
    margin-top: auto;
    padding-top: 16px;
    color: var(--restree-accent);
    font-size: 12px;
    font-weight: 800;
}

.restree-app .restree-health-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.restree-app .restree-health-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--restree-border-soft);
}

    .restree-app .restree-health-row:first-child {
        padding-top: 0;
    }

    .restree-app .restree-health-row:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

.restree-app .restree-health-label {
    color: var(--restree-text);
    font-weight: 700;
}

.restree-app .restree-health-help {
    margin-top: 2px;
    color: var(--restree-text-muted);
    font-size: 11px;
}

.restree-app .restree-health-count {
    min-width: 34px;
    color: var(--restree-text);
    font-size: 18px;
    font-weight: 800;
    text-align: right;
}

@media (max-width: 900px) {
    .restree-app .restree-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .restree-app .restree-admin-launch-grid {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-admin-launch-card {
        min-height: 0;
    }
}

@media (max-width: 520px) {
    .restree-app .restree-metric-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   24. COMPARISON PREVIEW
   Append this section to the current RESTREEConfig_UI.css bible.
========================================================= */

.restree-app .restree-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--restree-bg-subtle);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

.restree-app .restree-preview-toolbar-title {
    color: var(--restree-text);
    font-size: 13px;
    font-weight: 800;
}

.restree-app .restree-preview-document {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-lg);
    box-shadow: var(--restree-shadow-sm);
}

.restree-app .restree-preview-header {
    padding: 30px 34px 26px;
    background: var(--restree-bg-subtle);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-preview-eyebrow {
    margin-bottom: 8px;
    color: var(--restree-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.restree-app .restree-preview-title {
    margin: 0;
    color: var(--restree-text);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
}

.restree-app .restree-preview-intro {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--restree-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.restree-app .restree-preview-products {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    margin: 0;
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-preview-product {
    min-width: 0;
    padding: 24px 30px;
    background: var(--restree-bg-surface);
}

    .restree-app .restree-preview-product.is-draper {
        background: var(--restree-accent-soft);
    }

.restree-app .restree-preview-product-kicker {
    margin-bottom: 6px;
    color: var(--restree-text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.restree-app .restree-preview-product.is-draper .restree-preview-product-kicker {
    color: var(--restree-accent);
}

.restree-app .restree-preview-product-name {
    color: var(--restree-text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
}

.restree-app .restree-preview-product-meta {
    margin-top: 5px;
    color: var(--restree-text-muted);
    font-size: 12px;
}

.restree-app .restree-preview-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--restree-bg-subtle);
    color: var(--restree-text-muted);
    border-right: 1px solid var(--restree-border-soft);
    border-left: 1px solid var(--restree-border-soft);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
}

    .restree-app .restree-preview-vs span {
        display: inline-flex;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        background: var(--restree-bg-surface);
        border: 1px solid var(--restree-border);
        border-radius: 50%;
    }

.restree-app .restree-preview-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-preview-summary-item {
    padding: 18px 22px;
    background: var(--restree-bg-surface);
    border-right: 1px solid var(--restree-border-soft);
}

    .restree-app .restree-preview-summary-item:last-child {
        border-right: 0;
    }

.restree-app .restree-preview-summary-number {
    color: var(--restree-text);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.restree-app .restree-preview-summary-label {
    margin-top: 6px;
    color: var(--restree-text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.restree-app .restree-preview-section {
    padding: 28px 30px 32px;
}

.restree-app .restree-preview-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.restree-app .restree-preview-section-kicker {
    margin-bottom: 3px;
    color: var(--restree-text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.restree-app .restree-preview-section-title {
    margin: 0;
    color: var(--restree-text);
    font-size: 18px;
    font-weight: 800;
}

.restree-app .restree-preview-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.restree-app .restree-preview-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--restree-text-muted);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.restree-app .restree-preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.restree-app .restree-preview-dot-match {
    background: var(--restree-success);
}

.restree-app .restree-preview-dot-exceeds {
    background: var(--restree-accent);
}

.restree-app .restree-preview-dot-review {
    background: var(--restree-warning);
}

.restree-app .restree-preview-criterion {
    position: relative;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

    .restree-app .restree-preview-criterion:last-child {
        margin-bottom: 0;
    }

    .restree-app .restree-preview-criterion::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 4px;
        background: var(--restree-border-strong);
    }

    .restree-app .restree-preview-criterion.is-match::before {
        background: var(--restree-success);
    }

    .restree-app .restree-preview-criterion.is-draper-exceeds::before {
        background: var(--restree-accent);
    }

    .restree-app .restree-preview-criterion.is-review::before {
        background: var(--restree-warning);
    }

    .restree-app .restree-preview-criterion.is-no-match::before {
        background: var(--restree-danger);
    }

    .restree-app .restree-preview-criterion.is-info::before {
        background: var(--restree-info);
    }

.restree-app .restree-preview-criterion-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px 12px 20px;
    background: var(--restree-bg-subtle);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-preview-criterion-name {
    margin: 0;
    color: var(--restree-text);
    font-size: 14px;
    font-weight: 800;
}

.restree-app .restree-preview-criterion-meta {
    margin-top: 3px;
    color: var(--restree-text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.restree-app .restree-preview-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    background: var(--restree-neutral-soft);
    color: var(--restree-text-muted);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-pill);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

    .restree-app .restree-preview-status::before {
        content: "";
        width: 7px;
        height: 7px;
        background: currentColor;
        border-radius: 50%;
    }

    .restree-app .restree-preview-status.is-match {
        background: var(--restree-success-soft);
        color: var(--restree-success);
        border-color: var(--restree-success-border);
    }

    .restree-app .restree-preview-status.is-draper-exceeds {
        background: var(--restree-accent-soft);
        color: var(--restree-accent);
        border-color: var(--restree-accent-border);
    }

    .restree-app .restree-preview-status.is-review {
        background: var(--restree-warning-soft);
        color: var(--restree-warning);
        border-color: var(--restree-warning-border);
    }

    .restree-app .restree-preview-status.is-no-match {
        background: var(--restree-danger-soft);
        color: var(--restree-danger);
        border-color: var(--restree-danger-border);
    }

    .restree-app .restree-preview-status.is-info {
        background: var(--restree-info-soft);
        color: var(--restree-info);
        border-color: var(--restree-info-border);
    }

    .restree-app .restree-preview-status.is-na {
        background: var(--restree-neutral-soft);
        color: var(--restree-text-muted);
        border-color: var(--restree-border);
    }

.restree-app .restree-preview-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.restree-app .restree-preview-value-column {
    min-width: 0;
    padding: 16px 18px 17px 20px;
}

    .restree-app .restree-preview-value-column + .restree-preview-value-column {
        border-left: 1px solid var(--restree-border-soft);
    }

    .restree-app .restree-preview-value-column.is-draper {
        background: color-mix(in srgb, var(--restree-accent-soft) 45%, transparent);
    }

.restree-app .restree-preview-value-label {
    margin-bottom: 6px;
    color: var(--restree-text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.restree-app .restree-preview-value {
    color: var(--restree-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
    white-space: pre-line;
}

.restree-app .restree-preview-notes {
    padding: 12px 18px 14px 20px;
    background: var(--restree-bg-subtle);
    border-top: 1px solid var(--restree-border-soft);
}

.restree-app .restree-preview-notes-label {
    margin-bottom: 4px;
    color: var(--restree-text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.restree-app .restree-preview-notes-text {
    color: var(--restree-text);
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-line;
}

.restree-app .restree-preview-footer {
    padding: 20px 30px 24px;
    background: var(--restree-bg-subtle);
    color: var(--restree-text-muted);
    border-top: 1px solid var(--restree-border-soft);
    font-size: 10px;
    line-height: 1.55;
}

.restree-app .restree-preview-footer-title {
    margin-bottom: 4px;
    color: var(--restree-text);
    font-weight: 800;
}

.restree-app .restree-preview-footer p {
    margin: 0;
}


@media (max-width: 760px) {

    .restree-app .restree-preview-toolbar,
    .restree-app .restree-preview-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

        .restree-app .restree-preview-toolbar .restree-page-actions,
        .restree-app .restree-preview-legend {
            justify-content: flex-start;
        }

    .restree-app .restree-preview-header,
    .restree-app .restree-preview-section {
        padding-left: 18px;
        padding-right: 18px;
    }

    .restree-app .restree-preview-products {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-preview-vs {
        min-height: 46px;
        border-top: 1px solid var(--restree-border-soft);
        border-right: 0;
        border-bottom: 1px solid var(--restree-border-soft);
        border-left: 0;
    }

    .restree-app .restree-preview-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .restree-app .restree-preview-summary-item:nth-child(2) {
        border-right: 0;
    }

    .restree-app .restree-preview-summary-item:nth-child(-n+2) {
        border-bottom: 1px solid var(--restree-border-soft);
    }

    .restree-app .restree-preview-criterion-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .restree-app .restree-preview-values {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-preview-value-column + .restree-preview-value-column {
        border-top: 1px solid var(--restree-border-soft);
        border-left: 0;
    }
}


@media (max-width: 480px) {

    .restree-app .restree-preview-summary {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-preview-summary-item {
        border-right: 0;
        border-bottom: 1px solid var(--restree-border-soft);
    }

        .restree-app .restree-preview-summary-item:last-child {
            border-bottom: 0;
        }
}


@media print {

    .restree-app .restree-preview-admin-only,
    .restree-app .restree-admin-header,
    .restree-app .restree-admin-footer {
        display: none !important;
    }

    .restree-app .restree-admin-main {
        padding-top: 0;
    }

    .restree-app .restree-shell {
        max-width: none;
        padding: 0;
    }

    .restree-app .restree-preview-document {
        max-width: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .restree-app .restree-preview-criterion {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* =========================================================
   25. DEALER / PROJECT UI REFINEMENTS
========================================================= */

.restree-app .restree-form-grid > [class^="restree-col-"],
.restree-app .restree-form-grid > [class*=" restree-col-"] {
    min-width: 0;
}

.restree-app .restree-form-grid {
    align-items: start;
}

.restree-app .restree-form-label {
    display: block;
    width: 100%;
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.restree-app .restree-form-grid .form-control,
.restree-app .restree-form-grid .form-select,
.restree-app .restree-form-grid input[type="file"],
.restree-app .restree-form-grid textarea {
    display: block;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.restree-app .restree-file-input {
    width: 100%;
    min-width: 0;
}

.restree-app .restree-check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

    .restree-app .restree-check-row input[type="checkbox"] {
        /* Bootstrap 4 .form-check-input is absolutely positioned by default.
           RESTREE checkbox rows participate in normal flex layout, so explicitly
           keep the checkbox in-flow. This also prevents it from drifting while
           the configurator panel scrolls independently. */
        position: static !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        float: none !important;
        flex: 0 0 auto;
        width: auto;
        margin: 3px 0 0 0 !important;
        transform: none !important;
    }

    .restree-app .restree-check-row label {
        display: block;
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        margin: 0;
        line-height: 1.35;
        white-space: nowrap;
    }

.restree-app .restree-checkbox-field {
    align-self: start;
}

.restree-app .restree-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    .restree-app .restree-table-wrap .restree-table {
        width: 100%;
        margin-bottom: 0;
    }

.restree-app .restree-table .d-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.restree-app .restree-table .justify-content-end {
    justify-content: flex-end;
}

.restree-app .restree-page-actions,
.restree-app .restree-panel-footer,
.restree-app .restree-panel-header > .d-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .restree-app .restree-page-actions .btn,
    .restree-app .restree-panel-footer .btn {
        white-space: nowrap;
    }

@media (max-width: 900px) {
    .restree-app .restree-form-grid > [class^="restree-col-"],
    .restree-app .restree-form-grid > [class*=" restree-col-"] {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .restree-app .restree-checkbox-field {
        align-self: auto;
    }

    .restree-app .restree-check-row label {
        white-space: normal;
    }
}


/* Dealer logo upload row: give the native file input enough real width and keep
   the Default Logo control aligned from the top of the field. */
.restree-app .restree-logo-file-field {
    min-width: 0;
}

    .restree-app .restree-logo-file-field input[type="file"],
    .restree-app .restree-logo-file-field .restree-file-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 300px;
    }

.restree-app .restree-logo-default-field {
    align-self: start !important;
}

    .restree-app .restree-logo-default-field .restree-check-row {
        min-height: 38px;
        align-items: flex-start;
    }

@media (max-width: 1100px) {
    .restree-app .restree-logo-name-field,
    .restree-app .restree-logo-file-field,
    .restree-app .restree-logo-default-field {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

        .restree-app .restree-logo-file-field input[type="file"],
        .restree-app .restree-logo-file-field .restree-file-input {
            min-width: 0;
        }
}


/* =========================================================
   26. REVISION CONFIGURATOR
========================================================= */

.restree-app .restree-config-status-value {
    font-size: 16px;
    line-height: 1.2;
}

.restree-app .restree-config-item-header {
    align-items: flex-start;
}

.restree-app .restree-config-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.restree-app .restree-config-section {
    margin-bottom: 18px;
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

    .restree-app .restree-config-section:last-child {
        margin-bottom: 0;
    }

.restree-app .restree-config-section-header {
    padding: 11px 14px;
    background: var(--restree-bg-subtle);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-config-section-title {
    margin: 0;
    color: var(--restree-text);
    font-size: 14px;
    font-weight: 800;
}

.restree-app .restree-config-section-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.restree-app .restree-config-field {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--restree-border-soft);
    border-bottom: 1px solid var(--restree-border-soft);
}

    .restree-app .restree-config-field:nth-child(2n) {
        border-right: 0;
    }

    .restree-app .restree-config-field:nth-last-child(-n+2) {
        border-bottom: 0;
    }

    .restree-app .restree-config-field.is-disabled {
        opacity: .7;
    }

.restree-app .restree-config-field-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}

.restree-app .restree-config-field-label-wrap {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.restree-app .restree-config-field-label {
    color: var(--restree-text);
    font-size: 13px;
    font-weight: 800;
}

.restree-app .restree-config-required {
    padding: 3px 7px;
    font-size: 9px;
}

.restree-app .restree-config-option-key {
    flex: 0 0 auto;
    color: var(--restree-text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.restree-app .restree-config-help {
    margin-bottom: 8px;
    color: var(--restree-text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.restree-app .restree-config-marketing {
    margin: 8px 0 10px;
    padding: 9px 10px;
    background: var(--restree-accent-soft);
    color: var(--restree-text);
    border: 1px solid var(--restree-accent-border);
    border-radius: var(--restree-radius-sm);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}

.restree-app .restree-config-control {
    min-width: 0;
}

.restree-app .restree-config-input {
    width: 100%;
    max-width: none;
}

.restree-app .restree-config-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px;
}

.restree-app .restree-config-choice {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: stretch;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-sm);
    transition: border-color var(--restree-transition), background var(--restree-transition), box-shadow var(--restree-transition);
}

    .restree-app .restree-config-choice:hover {
        border-color: var(--restree-accent);
    }

    .restree-app .restree-config-choice.is-selected {
        background: var(--restree-accent-soft);
        border-color: var(--restree-accent);
        box-shadow: 0 0 0 1px var(--restree-accent-soft);
    }

    .restree-app .restree-config-choice.is-disabled {
        cursor: not-allowed;
        opacity: .6;
    }

    .restree-app .restree-config-choice > span.restree-config-choice-input,
    .restree-app .restree-config-choice > .restree-config-choice-input {
        display: flex;
        flex: 0 0 auto;
        align-items: flex-start;
        padding: 12px 0 12px 12px;
    }

    .restree-app .restree-config-choice-input input[type="radio"],
    .restree-app .restree-config-choice-input input[type="checkbox"],
    .restree-app .restree-config-choice > input[type="radio"],
    .restree-app .restree-config-choice > input[type="checkbox"] {
        margin: 2px 0 0;
    }

.restree-app .restree-config-choice-label {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 10px 12px 10px 9px;
    color: var(--restree-text);
    cursor: pointer;
}

.restree-app .restree-config-choice.is-disabled .restree-config-choice-label {
    cursor: not-allowed;
}

.restree-app .restree-config-swatch {
    display: block;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid var(--restree-border-strong);
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.restree-app .restree-config-choice-image {
    display: block;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: cover;
    background: var(--restree-bg-subtle);
    border: 1px solid var(--restree-border);
    border-radius: 5px;
}

.restree-app .restree-config-choice-text {
    display: block;
    min-width: 0;
}

.restree-app .restree-config-choice-title {
    display: block;
    color: var(--restree-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.restree-app .restree-config-choice-description {
    display: block;
    margin-top: 2px;
    color: var(--restree-text-muted);
    font-size: 10px;
    line-height: 1.35;
}

.restree-app .restree-config-additional {
    margin-top: 10px;
}

.restree-app .restree-config-readonly {
    min-height: var(--restree-control-height);
    padding: 8px 10px;
    background: var(--restree-bg-muted);
    color: var(--restree-text-muted);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-sm);
}

.restree-app .restree-config-footer {
    align-items: center;
    justify-content: space-between;
}

.restree-app .restree-config-autosave-note {
    color: var(--restree-text-muted);
    font-size: 11px;
}

.restree-app .restree-config-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .restree-app .restree-config-section-body {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-config-field,
    .restree-app .restree-config-field:nth-child(2n),
    .restree-app .restree-config-field:nth-last-child(-n+2) {
        border-right: 0;
        border-bottom: 1px solid var(--restree-border-soft);
    }

        .restree-app .restree-config-field:last-child {
            border-bottom: 0;
        }

    .restree-app .restree-config-field-heading,
    .restree-app .restree-config-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .restree-app .restree-config-option-key {
        white-space: normal;
    }

    .restree-app .restree-config-item-actions,
    .restree-app .restree-config-footer-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .restree-app .restree-config-choice-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   27. RESTREE PRODUCT SEARCH / PRODUCT RESULTS
   Product picker used by Shades and AV.
========================================================= */

.restree-app .restree-product-search {
    display: grid;
    gap: 14px;
}

.restree-app .restree-product-type {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    padding: 4px;
    overflow-x: auto;
    background: var(--restree-bg-muted);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

.restree-app .restree-product-type-option {
    position: relative;
    flex: 0 0 auto;
}

    .restree-app .restree-product-type-option input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

.restree-app .restree-product-type-label {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    color: var(--restree-text-muted);
    border: 1px solid transparent;
    border-radius: var(--restree-radius-sm);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--restree-transition), color var(--restree-transition), border-color var(--restree-transition), box-shadow var(--restree-transition);
}

    .restree-app .restree-product-type-label:hover {
        color: var(--restree-text);
    }

.restree-app .restree-product-type-option input:checked + .restree-product-type-label {
    background: var(--restree-bg-surface);
    color: var(--restree-text);
    border-color: var(--restree-border-soft);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-product-type-option input:focus-visible + .restree-product-type-label {
    outline: 2px solid var(--restree-accent);
    outline-offset: 2px;
}

.restree-app .restree-product-search-row {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.restree-app .restree-product-search-field {
    flex: 1 1 420px;
    min-width: 240px;
}

.restree-app .restree-product-search-input {
    width: 100%;
}

.restree-app .restree-product-search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--restree-text-muted);
    font-size: 11px;
}

.restree-app .restree-product-result-count {
    font-weight: 700;
}

.restree-app .restree-product-list {
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-md);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-product-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 108px;
    padding: 14px;
    background: var(--restree-bg-surface);
    border-bottom: 1px solid var(--restree-border-soft);
    transition: background var(--restree-transition);
}

    .restree-app .restree-product-row:last-child {
        border-bottom: 0;
    }

    .restree-app .restree-product-row:hover {
        background: var(--restree-bg-hover);
    }

    .restree-app .restree-product-row.is-selected {
        background: var(--restree-bg-selected);
        box-shadow: inset 4px 0 0 var(--restree-accent);
    }

.restree-app .restree-product-thumb {
    display: flex;
    width: 88px;
    height: 78px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--restree-bg-muted);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-sm);
}

    .restree-app .restree-product-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.restree-app .restree-product-thumb-placeholder {
    color: var(--restree-text-muted);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.restree-app .restree-product-info {
    min-width: 0;
}

.restree-app .restree-product-name {
    margin: 0;
    color: var(--restree-accent);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
}

.restree-app a.restree-product-name {
    text-decoration: none;
}

    .restree-app a.restree-product-name:hover,
    .restree-app a.restree-product-name:focus {
        color: var(--restree-accent-hover);
        text-decoration: underline;
        text-underline-offset: 2px;
    }

.restree-app .restree-product-subtitle {
    margin-top: 3px;
    color: var(--restree-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.restree-app .restree-product-description {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: var(--restree-text-muted);
    font-size: 11px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.restree-app .restree-product-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
    color: var(--restree-text-muted);
    font-size: 10px;
}

.restree-app .restree-product-part-number {
    font-weight: 700;
}

.restree-app .restree-product-actions {
    display: flex;
    min-width: 118px;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

    .restree-app .restree-product-actions .btn,
    .restree-app .restree-product-actions .restree-button {
        min-width: 110px;
        white-space: nowrap;
    }

.restree-app .restree-product-loading-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 118px;
    gap: 16px;
    padding: 14px;
    border-bottom: 1px solid var(--restree-border-soft);
}

    .restree-app .restree-product-loading-row:last-child {
        border-bottom: 0;
    }


/* =========================================================
   28. RESTREE QUOTE / CONFIGURATOR WORKSPACE
   General layout hooks for the next stages of this project.
========================================================= */

.restree-app .restree-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(440px, 500px);
    gap: 18px;
    align-items: start;
}

.restree-app .restree-workspace-main,
.restree-app .restree-workspace-side {
    min-width: 0;
}

.restree-app .restree-workspace-side {
    position: sticky;
    top: 16px;
}

.restree-app .restree-quote-summary {
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-md);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-quote-summary-header {
    padding: 12px 14px;
    background: var(--restree-bg-subtle);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-quote-summary-title {
    margin: 0;
    color: var(--restree-text);
    font-size: 14px;
    font-weight: 800;
}

.restree-app .restree-quote-summary-body {
    padding: 12px 14px;
}

.restree-app .restree-quote-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid var(--restree-border-soft);
}

    .restree-app .restree-quote-summary-row:last-child {
        border-bottom: 0;
    }

.restree-app .restree-quote-summary-label {
    color: var(--restree-text-muted);
    font-size: 11px;
}

.restree-app .restree-quote-summary-value {
    color: var(--restree-text);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.restree-app .restree-quote-summary-total {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 2px solid var(--restree-border);
}

    .restree-app .restree-quote-summary-total .restree-quote-summary-label,
    .restree-app .restree-quote-summary-total .restree-quote-summary-value {
        color: var(--restree-text);
        font-size: 14px;
        font-weight: 900;
    }

.restree-app .restree-stepper {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    overflow-x: auto;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

.restree-app .restree-step {
    position: relative;
    display: flex;
    min-width: 145px;
    flex: 1 0 auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: var(--restree-text-muted);
    border-right: 1px solid var(--restree-border-soft);
    font-size: 11px;
    font-weight: 700;
}

    .restree-app .restree-step:last-child {
        border-right: 0;
    }

.restree-app .restree-step-number {
    display: inline-flex;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    background: var(--restree-bg-muted);
    color: var(--restree-text-muted);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
}

.restree-app .restree-step.is-active {
    background: var(--restree-accent-soft);
    color: var(--restree-text);
}

    .restree-app .restree-step.is-active .restree-step-number {
        background: var(--restree-accent);
        color: var(--restree-accent-contrast);
    }

.restree-app .restree-step.is-complete .restree-step-number {
    background: var(--restree-success);
    color: #ffffff;
}

.restree-app .restree-money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.restree-app .restree-number {
    font-variant-numeric: tabular-nums;
}

.restree-app .restree-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.restree-app .restree-action-bar-left,
.restree-app .restree-action-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}


/* =========================================================
   29. RESTREE RESPONSIVE ADDITIONS
========================================================= */

@media (max-width: 900px) {
    .restree-app .restree-workspace {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-workspace-side {
        position: static;
    }
}

@media (max-width: 720px) {
    .restree-app .restree-product-row {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
    }

    .restree-app .restree-product-thumb {
        width: 72px;
        height: 68px;
    }

    .restree-app .restree-product-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: flex-end;
    }

    .restree-app .restree-product-loading-row {
        grid-template-columns: 72px minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .restree-app .restree-product-type {
        display: flex;
        width: 100%;
    }

    .restree-app .restree-product-type-option {
        flex: 1 1 0;
    }

    .restree-app .restree-product-type-label {
        width: 100%;
    }

    .restree-app .restree-product-search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .restree-app .restree-product-search-field {
        width: 100%;
        min-width: 0;
    }

    .restree-app .restree-product-row {
        grid-template-columns: 58px minmax(0, 1fr);
        min-height: 0;
        padding: 12px;
    }

    .restree-app .restree-product-thumb {
        width: 58px;
        height: 58px;
    }

    .restree-app .restree-product-name {
        font-size: 15px;
    }

    .restree-app .restree-product-actions {
        justify-content: stretch;
    }

        .restree-app .restree-product-actions .btn,
        .restree-app .restree-product-actions .restree-button {
            width: 100%;
        }

    .restree-app .restree-action-bar,
    .restree-app .restree-action-bar-left,
    .restree-app .restree-action-bar-right {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }
}
/* =========================================================
   30. RESTREE PRODUCT SUBCATEGORIES / LIVE SEARCH SUGGESTIONS
========================================================= */

.restree-app .restree-product-subcategories {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.restree-app .restree-product-subcategory {
    position: relative;
    flex: 0 0 auto;
}

    .restree-app .restree-product-subcategory input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

.restree-app .restree-product-subcategory-label {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: var(--restree-bg-surface);
    color: var(--restree-text-muted);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-sm);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--restree-transition), color var(--restree-transition), border-color var(--restree-transition), box-shadow var(--restree-transition);
}

    .restree-app .restree-product-subcategory-label:hover {
        background: var(--restree-bg-hover);
        color: var(--restree-text);
        border-color: var(--restree-border-strong);
    }

.restree-app .restree-product-subcategory input:checked + .restree-product-subcategory-label {
    background: var(--restree-accent-soft);
    color: var(--restree-accent);
    border-color: var(--restree-accent);
    box-shadow: 0 0 0 1px var(--restree-accent-soft);
}

.restree-app .restree-product-subcategory input:focus-visible + .restree-product-subcategory-label {
    outline: 2px solid var(--restree-accent);
    outline-offset: 2px;
}

.restree-app .restree-live-search {
    position: relative;
}

.restree-app .restree-autocomplete {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    z-index: 1100;
    display: none;
    max-height: 420px;
    overflow-y: auto;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-md);
    box-shadow: var(--restree-shadow-md);
}

    .restree-app .restree-autocomplete.is-open {
        display: block;
    }

.restree-app .restree-autocomplete-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: var(--restree-bg-surface);
    color: var(--restree-text);
    border: 0;
    border-bottom: 1px solid var(--restree-border-soft);
    text-align: left;
    cursor: pointer;
}

    .restree-app .restree-autocomplete-item:last-child {
        border-bottom: 0;
    }

    .restree-app .restree-autocomplete-item:hover,
    .restree-app .restree-autocomplete-item:focus,
    .restree-app .restree-autocomplete-item.is-active {
        background: var(--restree-bg-hover);
        outline: none;
    }

.restree-app .restree-autocomplete-thumb {
    display: flex;
    width: 48px;
    height: 42px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--restree-bg-muted);
    border: 1px solid var(--restree-border-soft);
    border-radius: 5px;
}

    .restree-app .restree-autocomplete-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.restree-app .restree-autocomplete-thumb-placeholder {
    color: var(--restree-text-muted);
    font-size: 8px;
    font-weight: 800;
    text-align: center;
}

.restree-app .restree-autocomplete-content {
    min-width: 0;
}

.restree-app .restree-autocomplete-name {
    overflow: hidden;
    color: var(--restree-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restree-app .restree-autocomplete-subtitle {
    overflow: hidden;
    margin-top: 2px;
    color: var(--restree-text-muted);
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restree-app .restree-autocomplete-meta {
    margin-top: 2px;
    color: var(--restree-text-muted);
    font-size: 9px;
    font-weight: 700;
}

.restree-app .restree-autocomplete-message {
    padding: 11px 12px;
    color: var(--restree-text-muted);
    font-size: 11px;
}

.restree-app .restree-search-hint {
    margin-top: 5px;
    color: var(--restree-text-muted);
    font-size: 10px;
}

@media (max-width: 520px) {
    .restree-app .restree-product-subcategories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .restree-app .restree-product-subcategory,
    .restree-app .restree-product-subcategory-label {
        width: 100%;
    }
}

/* =========================================================
   31. SHADE CONFIGURATOR
   Product header + compact reflowing shade field layout.
   Hidden fields/sections use .restree-hidden and occupy no space.
========================================================= */

.restree-app .restree-shade-config-page {
    padding-top: 18px;
}

.restree-app .restree-config-product-card {
    overflow: hidden;
}

.restree-app .restree-config-product-body {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.restree-app .restree-config-product-media {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--restree-bg-subtle);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

.restree-app .restree-config-product-image {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
}

.restree-app .restree-config-product-no-image {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 18px;
    color: var(--restree-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.restree-app .restree-config-product-content {
    min-width: 0;
}

.restree-app .restree-config-product-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.restree-app .restree-config-product-name {
    display: block;
    font-size: 22px;
}

.restree-app .restree-config-product-description {
    max-width: 920px;
    margin-top: 7px;
    color: var(--restree-text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.restree-app .restree-config-product-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin-top: 18px;
}

.restree-app .restree-config-product-detail-row {
    display: grid;
    grid-template-columns: minmax(105px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.restree-app .restree-config-product-detail-label {
    color: var(--restree-text-muted);
    font-size: 11px;
    font-weight: 800;
}

.restree-app .restree-config-product-detail-value {
    min-width: 0;
    color: var(--restree-text);
    font-size: 12px;
    font-weight: 700;
}

.restree-app .restree-config-product-price {
    font-weight: 900;
}

.restree-app .restree-config-product-small-input {
    width: 92px;
    max-width: 100%;
}

.restree-app .restree-config-product-label-input {
    width: min(100%, 360px);
}

.restree-app .restree-shade-config-panel-body {
    padding: 14px;
}

.restree-app .restree-shade-section {
    margin-bottom: 14px;
}

    .restree-app .restree-shade-section:last-child {
        margin-bottom: 0;
    }

.restree-app .restree-shade-section-body {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    align-items: stretch;
}

.restree-app .restree-shade-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 10px;
    background: var(--restree-bg-subtle);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-sm);
}

    .restree-app .restree-shade-field .restree-config-control {
        margin-top: auto;
    }

.restree-app .restree-shade-field-label {
    display: block;
    margin-bottom: 6px;
    line-height: 1.3;
}

.restree-app .restree-shade-required {
    margin-left: 2px;
    color: var(--restree-danger);
    font-weight: 900;
}

.restree-app .restree-shade-field .form-control,
.restree-app .restree-shade-field .form-select,
.restree-app .restree-shade-field .restree-config-input {
    width: 100%;
    max-width: none;
}

.restree-app .restree-shade-checkbox-row {
    min-height: var(--restree-control-height);
    align-items: center;
}

.restree-app .restree-shade-checkbox {
    position: static !important;
    float: none !important;
    margin: 0 !important;
}

/* The rule engine will use .restree-hidden. Because hidden nodes are display:none,
   CSS grid immediately re-packs the remaining fields with no blank cells. */
.restree-app .restree-shade-field.restree-hidden,
.restree-app .restree-shade-section.restree-hidden {
    display: none !important;
}

@media (max-width: 1300px) {
    .restree-app .restree-shade-section-body {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .restree-app .restree-shade-section-body {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .restree-app .restree-shade-section-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .restree-app .restree-config-product-body {
        grid-template-columns: 170px minmax(0, 1fr);
        gap: 18px;
    }

    .restree-app .restree-config-product-media,
    .restree-app .restree-config-product-image {
        min-height: 150px;
        height: 150px;
    }

    .restree-app .restree-config-product-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .restree-app .restree-config-product-body {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-config-product-media {
        width: min(100%, 260px);
    }

    .restree-app .restree-config-product-detail-row {
        grid-template-columns: 100px minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .restree-app .restree-shade-section-body {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   32. RESTREE CONFIGURATOR / SEARCH WORKSPACE + SHARED QUOTE SIDEBAR
   Search, Shade Config, and AV Config use the same balanced desktop
   workspace. Both columns stay the same height. The quote list uses the
   available middle space and only scrolls vertically when it truly needs to.
========================================================= */

/* Keep shade/AV field cards compact and consistent. */
.restree-app .restree-shade-section-body {
    grid-template-columns: repeat(auto-fill, minmax(205px, 235px));
    justify-content: start;
    align-items: start;
}

.restree-app .restree-shade-field {
    width: 100%;
    min-height: 92px;
}

/* One shared desktop proportion for Product Search, Shade Config, and AV Config.
   The overall restree-shell width does not change; more of the existing width is
   simply assigned to the quote column. */
.restree-app .restree-product-search-workspace,
.restree-app .restree-shade-workspace,
.restree-app .restree-av-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(440px, 500px);
    height: clamp(620px, 72vh, 820px);
    align-items: stretch;
}

.restree-app .restree-product-search-workspace .restree-workspace-main,
.restree-app .restree-shade-workspace .restree-workspace-main,
.restree-app .restree-av-workspace .restree-workspace-main {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

/* Product Search: keep the left panel the same height as the quote. Results
   scroll inside the existing panel only when they exceed the workspace. */
.restree-app .restree-product-search-workspace .restree-workspace-main > .restree-panel {
    height: 100%;
    margin-bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Shade Config: preserve the fixed-height configuration panel with its own
   options scroller and pinned action row. */
.restree-app .restree-shade-config-panel {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    margin-bottom: 0;
    overflow: hidden;
}

.restree-app .restree-shade-config-panel > .restree-panel-header {
    flex: 0 0 auto;
}

.restree-app .restree-shade-config-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.restree-app .restree-shade-config-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 14px;
    background: var(--restree-bg-subtle);
    border-top: 1px solid var(--restree-border-soft);
}

.restree-app .restree-shade-config-actions .btn {
    min-width: 112px;
}

/* AV Config uses the same fixed-height behavior as Shade Config. UpdatePanel
   renders an extra wrapper, so make that wrapper participate in the flex layout. */
.restree-app .restree-av-config-panel {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    margin-bottom: 0;
    overflow: hidden;
}

.restree-app .restree-av-config-panel > .restree-panel-header {
    flex: 0 0 auto;
}

.restree-app .restree-av-config-panel > div[id$="upAVConfigurator"] {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.restree-app .restree-av-config-panel > div[id$="upAVConfigurator"] > .restree-shade-config-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.restree-app .restree-av-config-panel > div[id$="upAVConfigurator"] > .restree-shade-config-actions {
    flex: 0 0 auto;
}

/* Shared quote panel: always stretch to the same height as the left column. */
.restree-app .restree-shade-quote-side {
    position: static;
    top: auto;
    align-self: stretch;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.restree-app .restree-shade-quote-summary {
    display: flex;
    height: 100%;
    min-height: 0;
    max-height: none;
    flex-direction: column;
    margin-bottom: 0;
    overflow: hidden;
}

.restree-app .restree-shade-quote-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
}

/* The table is the flexible middle region. It fills the unused quote height so
   the totals/footer remain visually anchored at the bottom. */
.restree-app .restree-shade-quote-table {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    margin: 12px 14px 0;
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-sm);
}

.restree-app .restree-shade-quote-table-head,
.restree-app .restree-shade-quote-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 94px 94px 26px;
    gap: 8px;
    align-items: start;
}

.restree-app .restree-shade-quote-table-head {
    flex: 0 0 auto;
    padding: 9px 10px;
    background: var(--restree-bg-subtle);
    color: var(--restree-text-muted);
    border-bottom: 1px solid var(--restree-border-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.restree-app .restree-shade-quote-table-head > span:nth-child(n+2):not(:last-child) {
    text-align: right;
}

.restree-app .restree-shade-quote-items {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.restree-app .restree-shade-quote-item {
    width: 100%;
    min-width: 0;
    padding: 10px;
    background: var(--restree-bg-surface);
    color: var(--restree-text);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-shade-quote-item:last-child {
    border-bottom: 0;
}

.restree-app .restree-shade-quote-item:hover {
    background: var(--restree-bg-hover);
}

.restree-app .restree-shade-quote-label {
    min-width: 0;
    overflow: visible;
    color: var(--restree-text);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.restree-app .restree-shade-quote-qty,
.restree-app .restree-shade-quote-price,
.restree-app .restree-shade-quote-total {
    min-width: 0;
    color: var(--restree-text);
    font-size: 10px;
    font-weight: 700;
    text-align: right;
    line-height: 1.25;
    white-space: nowrap;
}

.restree-app .restree-shade-quote-remove {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    justify-self: end;
    padding: 0;
    background: transparent;
    color: var(--restree-text-muted);
    border: 0;
    border-radius: var(--restree-radius-sm);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.restree-app .restree-shade-quote-remove:hover,
.restree-app .restree-shade-quote-remove:focus {
    background: var(--restree-danger-soft);
    color: var(--restree-danger);
    outline: none;
}

/* Empty-state text occupies the same flexible table region without changing
   the height of the quote card. */
.restree-app .restree-shade-quote-empty {
    position: absolute;
    inset: 38px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 18px;
    color: var(--restree-text-muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
}

.restree-app .restree-shade-quote-totals {
    flex: 0 0 auto;
    padding: 14px 18px 10px;
}

.restree-app .restree-shade-quote-footer {
    flex: 0 0 auto;
    padding: 12px 18px 18px;
}

.restree-app .restree-shade-place-order {
    width: 100%;
    min-height: 42px;
}

@media (max-width: 1180px) {
    .restree-app .restree-product-search-workspace,
    .restree-app .restree-shade-workspace,
    .restree-app .restree-av-workspace {
        grid-template-columns: minmax(0, 1fr) 420px;
    }

    .restree-app .restree-shade-section-body {
        grid-template-columns: repeat(auto-fill, minmax(190px, 220px));
    }
}

@media (max-width: 900px) {
    .restree-app .restree-product-search-workspace,
    .restree-app .restree-shade-workspace,
    .restree-app .restree-av-workspace {
        grid-template-columns: 1fr;
        height: auto;
        align-items: start;
    }

    .restree-app .restree-product-search-workspace .restree-workspace-main,
    .restree-app .restree-shade-workspace .restree-workspace-main,
    .restree-app .restree-av-workspace .restree-workspace-main,
    .restree-app .restree-product-search-workspace .restree-workspace-main > .restree-panel,
    .restree-app .restree-shade-config-panel,
    .restree-app .restree-av-config-panel,
    .restree-app .restree-shade-quote-side,
    .restree-app .restree-shade-quote-summary {
        height: auto;
        overflow: visible;
    }

    .restree-app .restree-shade-config-panel-body {
        overflow: visible;
    }

    .restree-app .restree-av-config-panel > div[id$="upAVConfigurator"] {
        display: block;
        overflow: visible;
    }

    .restree-app .restree-av-config-panel > div[id$="upAVConfigurator"] > .restree-shade-config-panel-body {
        overflow: visible;
    }

    .restree-app .restree-shade-quote-table {
        flex: none;
        min-height: 280px;
    }

    .restree-app .restree-shade-quote-items {
        max-height: 340px;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

@media (max-width: 520px) {
    .restree-app .restree-shade-section-body {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .restree-app .restree-shade-field {
        min-height: 0;
    }

    .restree-app .restree-shade-config-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .restree-app .restree-shade-config-actions .btn {
        width: 100%;
    }

    .restree-app .restree-shade-quote-table-head,
    .restree-app .restree-shade-quote-item {
        grid-template-columns: minmax(0, 1fr) 34px 70px 76px 24px;
        gap: 5px;
    }
}

/* =========================================================
   33. SHADE CONFIGURATOR - DATABASE FABRIC PICKER
========================================================= */

.restree-app .restree-shade-field-fabric {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 0;
}

    .restree-app .restree-shade-field-fabric .restree-config-control {
        margin-top: 0;
    }

.restree-app .restree-fabric-picker {
    display: grid;
    gap: 12px;
}

.restree-app .restree-fabric-picker-family {
    width: min(100%, 420px);
}

.restree-app .restree-fabric-picker-message {
    min-height: 18px;
    color: var(--restree-text-muted);
    font-size: 11px;
    line-height: 1.45;
}

    .restree-app .restree-fabric-picker-message.is-loading {
        color: var(--restree-info);
    }

    .restree-app .restree-fabric-picker-message.is-error {
        color: var(--restree-danger);
        font-weight: 700;
    }

    .restree-app .restree-fabric-picker-message.is-selected {
        color: var(--restree-text);
        font-weight: 700;
    }

.restree-app .restree-fabric-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    width: 100%;
}

.restree-app .restree-fabric-swatch {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--restree-bg-surface);
    color: var(--restree-text);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-sm);
    box-shadow: var(--restree-shadow-xs);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--restree-transition), box-shadow var(--restree-transition), transform var(--restree-transition), background var(--restree-transition);
}

    .restree-app .restree-fabric-swatch:hover,
    .restree-app .restree-fabric-swatch:focus-visible {
        transform: translateY(-1px);
        border-color: var(--restree-accent);
        box-shadow: var(--restree-shadow-sm);
    }

    .restree-app .restree-fabric-swatch.is-selected {
        background: var(--restree-accent-soft);
        border-color: var(--restree-accent);
        box-shadow: 0 0 0 2px var(--restree-accent-soft);
    }

.restree-app .restree-fabric-swatch-image-wrap {
    position: relative;
    display: flex;
    width: 100%;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--restree-bg-muted);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-fabric-swatch-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.restree-app .restree-fabric-swatch-placeholder {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: var(--restree-text-muted);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.restree-app .restree-fabric-swatch-body {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    padding: 9px 10px 10px;
}

.restree-app .restree-fabric-swatch-name {
    overflow: hidden;
    color: var(--restree-text);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restree-app .restree-fabric-swatch-back,
.restree-app .restree-fabric-swatch-part {
    overflow: hidden;
    color: var(--restree-text-muted);
    font-size: 9px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restree-app .restree-fabric-swatch-part {
    font-weight: 700;
}

.restree-app .restree-fabric-status-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.restree-app .restree-fabric-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 5px;
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-pill);
    color: var(--restree-text-muted);
    font-size: 8px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

    .restree-app .restree-fabric-status.is-in {
        background: var(--restree-success-soft);
        color: var(--restree-success);
        border-color: var(--restree-success-border);
    }

    .restree-app .restree-fabric-status.is-out,
    .restree-app .restree-fabric-status.is-discontinued {
        background: var(--restree-danger-soft);
        color: var(--restree-danger);
        border-color: var(--restree-danger-border);
    }

    .restree-app .restree-fabric-status.is-delayed {
        background: var(--restree-warning-soft);
        color: var(--restree-warning);
        border-color: var(--restree-warning-border);
    }

@media (max-width: 1180px) {
    .restree-app .restree-fabric-swatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    }
}

@media (max-width: 620px) {
    .restree-app .restree-fabric-picker-family {
        width: 100%;
    }

    .restree-app .restree-fabric-swatch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   34. SHADE CONFIGURATOR - UPDATEPANEL FLEX / SCROLL FIX
   UpdatePanel renders an extra div around the configurator body.
   Make that generated wrapper participate in the fixed-height flex
   layout so the options area keeps its independent scrollbar.
========================================================= */
.restree-app .restree-shade-config-panel > div[id$="upShadeConfigurator"] {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

    /* Keep the options region as the only scrolling area. */
    .restree-app .restree-shade-config-panel > div[id$="upShadeConfigurator"] > .restree-shade-config-panel-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    /* Keep Reset Options / Add Item pinned below the scrolling options. */
    .restree-app .restree-shade-config-panel > div[id$="upShadeConfigurator"] > .restree-shade-config-actions {
        flex: 0 0 auto;
    }

@media (max-width: 900px) {
    .restree-app .restree-shade-config-panel > div[id$="upShadeConfigurator"] {
        display: block;
        overflow: visible;
    }

        .restree-app .restree-shade-config-panel > div[id$="upShadeConfigurator"] > .restree-shade-config-panel-body {
            overflow: visible;
        }
}

/* =========================================================
   RESIDENTIAL SHADE ADVISOR
   ========================================================= */
.restree-app .restree-advisor-header {
    margin-bottom: 22px;
    padding: 24px 26px;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-lg);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-advisor-eyebrow {
    margin-bottom: 6px;
    color: var(--restree-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.restree-app .restree-advisor-title {
    margin: 0;
    color: var(--restree-text);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.restree-app .restree-advisor-intro {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--restree-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.restree-app .restree-advisor-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.restree-app .restree-advisor-main { min-width: 0; }
.restree-app .restree-advisor-profile { position: sticky; top: 18px; min-width: 0; }

.restree-app .restree-advisor-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.restree-app .restree-advisor-progress-label {
    color: var(--restree-text-muted);
    font-size: 11px;
    font-weight: 700;
}

.restree-app .restree-question-card {
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-lg);
    box-shadow: var(--restree-shadow-sm);
}

.restree-app .restree-question-body { padding: 28px; }

.restree-app .restree-question-step {
    margin-bottom: 7px;
    color: var(--restree-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.restree-app .restree-question-title {
    margin: 0;
    color: var(--restree-text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
}

.restree-app .restree-question-help {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--restree-text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.restree-app .restree-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.restree-app .restree-answer { position: relative; display: block; min-width: 0; }

.restree-app .restree-answer input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.restree-app .restree-answer-label {
    display: flex;
    min-height: 92px;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--restree-bg-surface);
    color: var(--restree-text);
    border: 1px solid var(--restree-border);
    border-radius: var(--restree-radius-md);
    cursor: pointer;
    transition: background var(--restree-transition), border-color var(--restree-transition), box-shadow var(--restree-transition), transform var(--restree-transition);
}

.restree-app .restree-answer-label:hover {
    transform: translateY(-1px);
    background: var(--restree-bg-hover);
    border-color: var(--restree-accent);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-answer input:checked + .restree-answer-label {
    background: var(--restree-accent-soft);
    border-color: var(--restree-accent);
    box-shadow: 0 0 0 2px var(--restree-accent-soft);
}

.restree-app .restree-answer-marker {
    display: flex;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    background: var(--restree-bg-surface);
    border: 2px solid var(--restree-border);
    border-radius: 50%;
}

.restree-app .restree-answer input:checked + .restree-answer-label .restree-answer-marker {
    background: var(--restree-accent);
    border-color: var(--restree-accent);
    box-shadow: inset 0 0 0 5px var(--restree-bg-surface);
}

.restree-app .restree-answer-content { min-width: 0; }
.restree-app .restree-answer-title { display: block; color: var(--restree-text); font-size: 14px; font-weight: 800; line-height: 1.35; }
.restree-app .restree-answer-description { display: block; margin-top: 4px; color: var(--restree-text-muted); font-size: 11px; line-height: 1.45; }

.restree-app .restree-question-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    background: var(--restree-bg-subtle);
    border-top: 1px solid var(--restree-border-soft);
}

.restree-app .restree-question-footer-right { display: flex; align-items: center; gap: 8px; }

.restree-app .restree-profile-card {
    overflow: hidden;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-lg);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-profile-header {
    padding: 15px 17px;
    background: var(--restree-bg-subtle);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-profile-title { margin: 0; color: var(--restree-text); font-size: 15px; font-weight: 800; }
.restree-app .restree-profile-subtitle { margin-top: 3px; color: var(--restree-text-muted); font-size: 10px; line-height: 1.4; }
.restree-app .restree-profile-body { padding: 4px 17px; }

.restree-app .restree-profile-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    padding: 10px 0;
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-profile-row:last-child { border-bottom: 0; }
.restree-app .restree-profile-label { color: var(--restree-text-muted); font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.restree-app .restree-profile-value { min-width: 0; color: var(--restree-text); font-size: 12px; font-weight: 700; line-height: 1.35; }
.restree-app .restree-profile-value.is-empty { color: var(--restree-text-muted); font-weight: 500; }

.restree-app .restree-profile-edit {
    padding: 3px 0;
    background: transparent;
    color: var(--restree-accent);
    border: 0;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.restree-app .restree-profile-edit:hover { color: var(--restree-accent-hover); text-decoration: underline; }

.restree-app .restree-profile-footer {
    padding: 13px 17px;
    background: var(--restree-bg-subtle);
    color: var(--restree-text-muted);
    border-top: 1px solid var(--restree-border-soft);
    font-size: 10px;
    line-height: 1.45;
}

.restree-app .restree-advisor-spacer { height: 14px; }

@media (max-width: 1000px) {
    .restree-app .restree-advisor-workspace { grid-template-columns: minmax(0, 1fr) 310px; }
}

@media (max-width: 820px) {
    .restree-app .restree-advisor-workspace { grid-template-columns: 1fr; }
    .restree-app .restree-advisor-profile { position: static; }
}

@media (max-width: 620px) {
    .restree-app .restree-advisor-header { padding: 20px; }
    .restree-app .restree-advisor-title { font-size: 24px; }
    .restree-app .restree-question-body { padding: 20px; }
    .restree-app .restree-question-title { font-size: 20px; }
    .restree-app .restree-answer-grid { grid-template-columns: 1fr; }
    .restree-app .restree-question-footer { align-items: stretch; flex-direction: column; }
    .restree-app .restree-question-footer-right { justify-content: space-between; }
}

/* =========================================================
   RESTREE SHADE ADVISOR RECOMMENDATION RESULTS
========================================================= */
.restree-app .restree-results-header {
    margin-bottom: 20px;
    padding: 26px 28px;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-lg);
    box-shadow: var(--restree-shadow-xs);
}

.restree-app .restree-results-title {
    margin: 0;
    color: var(--restree-text);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.restree-app .restree-results-intro {
    max-width: 820px;
    margin: 8px 0 0;
    color: var(--restree-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.restree-app .restree-results-workspace {
    display: grid;
    grid-template-columns: minmax(0,1fr) 360px;
    gap: 20px;
    align-items: start;
}

.restree-app .restree-results-main {
    min-width: 0;
}

.restree-app .restree-recommendation-card {
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--restree-bg-surface);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-lg);
    box-shadow: var(--restree-shadow-sm);
}

    .restree-app .restree-recommendation-card.is-best {
        border-color: var(--restree-accent);
        box-shadow: 0 0 0 1px var(--restree-accent-soft),var(--restree-shadow-md);
    }

.restree-app .restree-recommendation-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 18px;
    background: var(--restree-bg-subtle);
    border-bottom: 1px solid var(--restree-border-soft);
}

.restree-app .restree-recommendation-card.is-best .restree-recommendation-heading {
    background: var(--restree-accent-soft);
}

.restree-app .restree-recommendation-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 8px;
    padding: 4px 9px;
    background: var(--restree-neutral-soft);
    color: var(--restree-text-muted);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-pill);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

    .restree-app .restree-recommendation-badge.is-best {
        background: var(--restree-accent);
        color: var(--restree-accent-contrast);
        border-color: var(--restree-accent);
    }

.restree-app .restree-recommendation-name {
    margin: 0;
    color: var(--restree-text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
}

.restree-app .restree-recommendation-previous {
    margin-top: 4px;
    color: var(--restree-text-muted);
    font-size: 11px;
}

.restree-app .restree-recommendation-overview {
    display: grid;
    grid-template-columns: 240px minmax(0,1fr);
    gap: 24px;
    padding: 24px;
}

.restree-app .restree-recommendation-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.restree-app .restree-recommendation-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.restree-app .restree-recommendation-image-placeholder, .restree-app .restree-fabric-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: inherit;
    align-items: center;
    justify-content: center;
    color: var(--restree-text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.restree-app .restree-recommendation-summary {
    min-width: 0;
}

.restree-app .restree-recommendation-description {
    margin: 0;
    color: var(--restree-text);
    font-size: 13px;
    line-height: 1.65;
}

.restree-app .restree-recommendation-tags, .restree-app .restree-fabric-attributes, .restree-app .restree-option-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.restree-app .restree-result-tag {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    background: var(--restree-bg-muted);
    color: var(--restree-text);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-pill);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.restree-app .restree-recommendation-section {
    padding: 22px 24px 24px;
    border-top: 1px solid var(--restree-border-soft);
}

.restree-app .restree-recommendation-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

    .restree-app .restree-recommendation-section-heading h4 {
        margin: 0;
        color: var(--restree-text);
        font-size: 16px;
        font-weight: 800;
    }

    .restree-app .restree-recommendation-section-heading p {
        margin: 3px 0 0;
        color: var(--restree-text-muted);
        font-size: 11px;
        line-height: 1.45;
    }

.restree-app .restree-fabric-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
}

.restree-app .restree-fabric-card {
    display: grid;
    grid-template-columns: 112px minmax(0,1fr);
    min-width: 0;
    overflow: hidden;
    background: var(--restree-bg-subtle);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

.restree-app .restree-fabric-image-wrap {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--restree-bg-muted);
    border-right: 1px solid var(--restree-border-soft);
}

.restree-app .restree-fabric-image {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.restree-app .restree-fabric-body {
    min-width: 0;
    padding: 13px;
}

.restree-app .restree-fabric-rank {
    margin-bottom: 3px;
    color: var(--restree-accent);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.restree-app .restree-fabric-name {
    margin: 0;
    color: var(--restree-text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.restree-app .restree-fabric-attributes {
    margin-top: 8px;
}

.restree-app .restree-fabric-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 9px 0 0;
    color: var(--restree-text-muted);
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.restree-app .restree-option-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

.restree-app .restree-option-card {
    min-width: 0;
    padding: 13px 14px;
    background: var(--restree-bg-subtle);
    border: 1px solid var(--restree-border-soft);
    border-radius: var(--restree-radius-md);
}

.restree-app .restree-option-name {
    color: var(--restree-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.restree-app .restree-option-tags {
    margin-top: 8px;
}

.restree-app .restree-option-meta {
    margin-top: 5px;
    color: var(--restree-text-muted);
    font-size: 10px;
    line-height: 1.4;
}

.restree-app .restree-results-actions {
    display: flex;
    justify-content: flex-start;
    padding: 4px 0 24px;
}

@media (max-width:1100px) {
    .restree-app .restree-results-workspace {
        grid-template-columns: minmax(0,1fr) 310px;
    }

    .restree-app .restree-fabric-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width:820px) {
    .restree-app .restree-results-workspace {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-recommendation-overview {
        grid-template-columns: 200px minmax(0,1fr);
    }
}

@media (max-width:620px) {
    .restree-app .restree-results-header {
        padding: 20px;
    }

    .restree-app .restree-results-title {
        font-size: 23px;
    }

    .restree-app .restree-recommendation-heading, .restree-app .restree-recommendation-overview, .restree-app .restree-recommendation-section {
        padding-left: 18px;
        padding-right: 18px;
    }

    .restree-app .restree-recommendation-overview {
        grid-template-columns: 1fr;
    }

    .restree-app .restree-recommendation-image-wrap, .restree-app .restree-recommendation-image {
        height: 210px;
    }

    .restree-app .restree-fabric-card {
        grid-template-columns: 90px minmax(0,1fr);
    }

    .restree-app .restree-fabric-image-wrap, .restree-app .restree-fabric-image {
        height: 135px;
        min-height: 135px;
    }

    .restree-app .restree-option-grid {
        grid-template-columns: 1fr;
    }
}
