/* ============================================================
   Deepnet Configuration Editor — Metronic 7 Theme
   Dark Aside · White Header · Light Content · Poppins font
   Override custom properties on the host page or <iframe> parent.
   ============================================================ */

/* ── Metronic 7 design tokens ───────────────────────────────── */
:root {
    /* Core palette */
    --m-primary:          #3699FF;
    --m-primary-dark:     #187DE4;
    --m-primary-light:    #E1F0FF;
    --m-success:          #1BC5BD;
    --m-success-light:    #C9F7F5;
    --m-warning:          #FFA800;
    --m-warning-light:    #FFF4DE;
    --m-danger:           #F64E60;
    --m-danger-light:     #FFE2E5;

    /* Text scale (Metronic dark naming) */
    --m-dark:             #181C32;
    --m-dark75:           #3F4254;
    --m-dark65:           #5E6278;
    --m-dark50:           #7E8299;
    --m-dark25:           #B5B5C3;

    /* Backgrounds */
    --m-bg-page:          #F3F6F9;
    --m-bg-white:         #FFFFFF;
    --m-bg-light:         #F3F6F9;
    --m-bg-light2:        #ECF0F3;

    /* Borders */
    --m-border:           #EBEDF3;
    --m-border-input:     #E4E6EF;

    /* Light aside */
    --m-aside-bg:          #FFFFFF;
    --m-aside-brand:       #F3F6F9;
    --m-aside-text:        #5E6278;
    --m-aside-active-text: var(--m-dark);
    --m-aside-hover-bg:    #F3F6F9;
    --m-aside-active-bg:   rgba(54,153,255,0.08);
    --m-aside-sep:         #EBEDF3;

    /* Shadows */
    --m-shadow-card:      0px 0px 30px 0px rgba(82,63,105,0.05);
    --m-shadow-header:    0 0 40px 0 rgba(82,63,105,0.10);
    --m-shadow-dropdown:  0px 0px 50px 0px rgba(82,63,105,0.15);

    /* Editor aliases */
    --editor-bg:             var(--m-bg-white);
    --editor-surface:        var(--m-bg-light);
    --editor-surface-hover:  var(--m-bg-light2);
    --editor-border:         var(--m-border);
    --editor-border-focus:   var(--m-primary);
    --editor-accent:         var(--m-primary);
    --editor-accent-hover:   var(--m-primary-dark);
    --editor-text:           var(--m-dark75);
    --editor-text-secondary: var(--m-dark50);
    --editor-text-disabled:  var(--m-dark25);
    --editor-error:          var(--m-danger);
    --editor-required:       var(--m-danger);
    --editor-label-width:    200px;
    --editor-nav-width:      265px;
    --editor-content-max:    920px;
    --editor-font:           'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --editor-font-size:      13px;
    --editor-radius:         0.42rem;
    --editor-gap:            8px;
    --editor-spotlight:      var(--m-primary-dark);
    --editor-group-border:   var(--m-border);
    --editor-page-tint:      var(--m-bg-light);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--editor-font);
    font-size: var(--editor-font-size);
    color: var(--editor-text);
    background: var(--m-bg-page);
    height: 100vh;
    /* overflow intentionally omitted — editor layout fills exactly 100vh via its own grid,
       so body never scrolls on the editor page; results/load pages scroll naturally */
}

/* ── App shell ─────────────────────────────────────────────── */

#app { height: 100vh; display: flex; flex-direction: column; }

.editor-layout {
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    overflow: hidden;
}

.editor-layout.single-page {
    grid-template-columns: 1fr;
}

/* ── Top bar — Metronic white header ────────────────────────── */
.top-bar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;   /* inherits fit-content(220px) 1fr from .editor-layout */
    align-items: center;
    gap: 0;
    height: 65px;                        /* Metronic header height */
    background: var(--m-bg-white);
    color: var(--m-dark75);
    box-shadow: var(--m-shadow-header);
    flex-shrink: 0;
    z-index: 100;
}

/* When there is no title column (hide-title / single-page), the right section spans full width */
.single-page .top-bar > .top-bar-right,
.hide-title .top-bar > .top-bar-right {
    grid-column: 1 / -1;
    padding: 0 20px;
}

.hide-search .top-bar {
    height: 0;
    overflow: hidden;
    padding: 0;
    box-shadow: none;
}

/* Title button — column 1 of the top bar subgrid (above the nav panel) */
.top-bar-title {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 11px 8px;
    min-height: 65px;
    border-right: 1px solid var(--m-aside-sep);
    background: var(--m-aside-brand);
    cursor: default;
    user-select: none;
    align-self: stretch;
    justify-content: center;
    overflow: hidden;
}

.top-bar-title-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #8B0000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    line-height: 1;
    align-self: flex-start;
}

.top-bar-title-text {
    display: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--m-dark);
    word-break: break-word;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

/* Right side of the top bar: search + action buttons */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 0 0;
    min-height: 65px;
    background: var(--m-bg-white);
    align-self: stretch;
}


.top-bar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.auto-save-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--m-dark50);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.btn {
    padding: 7px 16px;
    border: none;
    border-radius: var(--editor-radius);
    background: var(--m-bg-light);
    color: var(--m-dark65);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--editor-font);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--m-bg-light2); color: var(--m-primary); }
.btn.btn-primary { background: var(--m-primary); color: #fff; }
.btn.btn-primary:hover { background: var(--m-primary-dark); }
.btn.btn-danger { background: var(--m-danger-light); color: var(--m-danger); }
.btn.btn-danger:hover { background: var(--m-danger); color: #fff; }
.btn.btn-export-blocked { background: var(--m-warning-light); color: var(--m-warning); }
.btn.btn-export-blocked:hover { background: var(--m-warning); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }


/* ── Search bar — Metronic on white header ──────────────────── */
.search-container {
    flex: 1;
    min-width: 0;
    margin: 0 16px 0 20px;
    position: relative;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--m-border-input);
    border-radius: 0.42rem;
    background: var(--m-bg-light);
    color: var(--m-dark75);
    font-size: 12px;
    font-weight: 400;
    font-family: var(--editor-font);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder { color: var(--m-dark25); }

.search-input:focus {
    background: var(--m-bg-white);
    border-color: var(--m-primary);
    box-shadow: 0 0 0 0.2rem rgba(54,153,255,0.15);
}

.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--m-bg-light) inset;
    box-shadow: 0 0 0 1000px var(--m-bg-light) inset;
    -webkit-text-fill-color: var(--m-dark75);
}

.search-input::selection { background: var(--m-primary-light); color: var(--m-primary-dark); }

/* Floating search results — Metronic dropdown card */
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--m-bg-white);
    border: none;
    border-radius: 0.42rem;
    box-shadow: var(--m-shadow-dropdown);
    overflow: hidden;
    z-index: 10000;
    max-height: 320px;
    overflow-y: auto;
}

.search-result {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 12px;
    color: var(--m-dark75);
    border-bottom: 2px solid var(--m-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-top {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}
.search-result:last-child  { border-bottom: none; }
.search-result:hover       { background: var(--m-bg-light); }
.search-result--group-disabled { opacity: 0.7; }

.search-result-group-hint {
    font-size: 11px;
    color: #E65100;
    font-style: italic;
}

.search-result-prefix {
    color: var(--m-dark);
    font-size: 12px;
}

.search-result-label {
    font-weight: 600;
    color: var(--m-dark75);
}

.search-result-description {
    font-size: 11px;
    color: var(--m-dark50);
    font-style: italic;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-description p  { margin: 0; }
.search-result-description b,
.search-result-description strong { font-weight: 600; font-style: normal; }

mark.search-highlight {
    background: rgba(54,153,255,0.15);
    color: var(--m-primary);
    font-weight: 700;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Nav panel — Metronic dark aside ────────────────────────── */
.nav-panel-container {
    grid-row: 2 / 3;
    min-height: 0;
    overflow: visible;
    position: relative;
}

.nav-panel {
    background: var(--m-aside-bg);
    border-right: 1px solid var(--m-aside-sep);
    overflow: hidden;
    padding: 8px 0;
    min-height: 0;
    width: 52px;
    min-width: 0;
    height: 100%;
}

/* Schema meta row — slim version; title has moved to top-bar-title */
.nav-schema-header {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--m-aside-sep);
    margin-bottom: 4px;
}

.nav-schema-info--standalone {
    font-size: 11px;
    color: var(--m-dark25);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-schema-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #8B0000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    line-height: 1;
}

.nav-schema-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--m-dark);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

.nav-schema-info {
    font-size: 13px;
    color: var(--m-dark25);
    cursor: default;
    flex-shrink: 0;
    align-self: center;
    transition: color 0.15s;
}
.nav-schema-info:hover { color: var(--m-primary); }

/* Nav strip toggle — expand/collapse the full panel */
.nav-toggle-btn {
    display: flex;
    width: 100%;
    height: 36px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--m-aside-sep);
    margin-bottom: 4px;
    cursor: pointer;
    align-items: center;
    justify-content: flex-end;
    padding: 0 7px 0 0;
    color: var(--m-dark50);
    transition: color 0.15s;
    flex-shrink: 0;
}
.nav-toggle-btn:hover { color: var(--m-primary); }

.nav-toggle-chevron {
    font-size: 18px;
    font-weight: 700;
    display: inline-block;
    transform: rotate(0deg);
    transition: transform 0.18s ease;
    line-height: 1;
}
.nav-toggle-chevron.open { transform: rotate(180deg); }

/* Flyout backdrop — rendered only when expanded */
.nav-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 499;
}

/*
 * All nav rows: 3-column grid — circle | chevron | label
 * Spacing matches desktop (ColumnSpacing=12 → gap: 12px)
 */
.nav-item {
    display: grid;
    grid-template-columns: 36px 22px 1fr;
    column-gap: 10px;
    padding: 7px 14px 7px 11px;
    cursor: pointer;
    color: var(--m-aside-text);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    user-select: none;
    align-items: start;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.nav-item:hover {
    background: color-mix(in srgb, var(--nav-color, var(--m-primary)) 7%, transparent);
    color: var(--nav-color, var(--m-aside-active-text));
}

/* Active state — palette colour tint (13%) matching desktop circleColor.WithAlpha(0.13f) */
.nav-item.active {
    background: color-mix(in srgb, var(--nav-color, var(--m-primary)) 13%, transparent);
    border-left-color: var(--nav-color, var(--m-primary));
    color: var(--nav-color, var(--m-aside-active-text));
}

.nav-item.nav-page        { padding: 7px 14px 7px 11px; font-size: 13px; }
.nav-item.nav-section     { padding: 5px 14px 5px 11px; font-size: 12px; }

.nav-item.nav-subsection  {
    padding: 4px 14px 4px 11px;
    font-size: 12px;
    color: color-mix(in srgb, var(--m-aside-text) 80%, transparent);
}
.nav-item.nav-subsection.active { color: var(--nav-color, var(--m-aside-active-text)); }

/* ── Nav circle — Col 0 ─────────────────────────────────────── */
.nav-circle {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    align-self: center;
}

/* ── Page chevron — Col 1 ───────────────────────────────────── */
/* Light grey circle matching desktop ChevronDrawable(DrawBackground=true) */
.nav-chevron {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E4E4E4;
    border: 1px solid #BBBBBB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #505050;
    font-weight: 700;
    transform: rotate(0deg);
    transition: transform 0.18s ease, background 0.12s, border-color 0.12s;
    flex-shrink: 0;
    line-height: 1;
    align-self: center;
}
.nav-chevron.open    { transform: rotate(90deg); }
.nav-chevron--hidden { visibility: hidden; }

.nav-item:hover .nav-chevron,
.nav-item.active .nav-chevron {
    background: color-mix(in srgb, var(--nav-color, var(--m-primary)) 15%, #E4E4E4);
    border-color: var(--nav-color, var(--m-primary));
    color: var(--nav-color, var(--m-primary));
}

/* ── Section chevron — Col 1 ────────────────────────────────── */
.nav-chevron-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E4E4E4;
    border: 1px solid #BBBBBB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #505050;
    font-weight: 700;
    transform: rotate(0deg);
    transition: transform 0.18s ease, background 0.12s, border-color 0.12s;
    flex-shrink: 0;
    justify-self: center;
    align-self: center;
    line-height: 1;
}
.nav-chevron-small.open { transform: rotate(90deg); }
.nav-item:hover .nav-chevron-small,
.nav-item.active .nav-chevron-small {
    background: color-mix(in srgb, var(--nav-color, var(--m-primary)) 15%, #E4E4E4);
    border-color: var(--nav-color, var(--m-primary));
    color: var(--nav-color, var(--m-primary));
}

/* ── Section dot — Col 1 ────────────────────────────────────── */
.nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 4px;
    background: #BBBBBB;
    flex-shrink: 0;
    justify-self: center;
    align-self: center;
    transition: background 0.12s;
}
.nav-item:hover .nav-dot,
.nav-item.active .nav-dot { background: var(--nav-color, var(--m-primary)); }

/* ── Subsection dot — Col 1 ─────────────────────────────────── */
.nav-dot-small {
    width: 5px;
    height: 5px;
    border-radius: 3px;
    background: #CCCCCC;
    flex-shrink: 0;
    justify-self: center;
    align-self: center;
    transition: background 0.12s;
}
.nav-item:hover .nav-dot-small,
.nav-item.active .nav-dot-small { background: var(--nav-color, var(--m-primary)); }

/* ── Label — Col 2 ──────────────────────────────────────────── */
.nav-label {
    min-width: 0;
    word-break: break-word;
    line-height: 1.3;
    align-self: center;
}

/* Wraps .nav-label + an optional .nav-required-badge as a single grid cell (Col 2) so the badge
   sits inline with the label instead of overflowing the grid's fixed 3-column layout. */
.nav-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    align-self: center;
}

/* Count of currently-empty required fields still pending in this section/subsection — a marker
   pointing the admin toward controls that still need filling (paired with each field's own "*"
   required-asterisk once they navigate in). Counts only empty required fields — a section with
   required fields that are already filled shows no badge at all. */
.nav-required-badge {
    flex-shrink: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: var(--m-danger, #e05252);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.nav-flyout-item .nav-required-badge { margin-left: auto; }

/* ── Strip (collapsed): fixed height per item, hide label so it can't stretch rows ── */
.nav-panel:not(.nav-expanded) .nav-item {
    padding: 4px 0 4px 8px;
    height: 44px;
    align-items: center;
}
.nav-panel:not(.nav-expanded) .nav-label { display: none; }
.nav-panel:not(.nav-expanded) .nav-section,
.nav-panel:not(.nav-expanded) .nav-subsection { display: none; }

/* Page-level "Action Required" warning — only ever visible in the icon-only collapsed strip,
   never once the nav is expanded (where the per-section numeric badges already cover this) or on
   wide screens (where "not(.nav-expanded)" still shows full labels via the media query below, so
   there's no real collapsed/strip state to attach the warning to in the first place). */
.nav-page-warning {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
    line-height: 1;
    background: var(--m-surface, #fff);
    border-radius: 50%;
}
.nav-panel:not(.nav-expanded) .nav-page-warning { display: block; }

/* ── Expanded: fixed overlay panel slides over content ────── */
.nav-panel.nav-expanded {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 265px;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 500;
    box-shadow: 4px 0 24px rgba(82,63,105,0.18);
    padding-bottom: 40px;
}

/* ── Strip flyout ─────────────────────────────────────────── */
.nav-strip-flyout {
    position: absolute;
    /* top is set inline — aligned to the circle's top-right corner */
    left: 52px;
    bottom: auto;
    width: 220px;
    background: var(--m-aside-bg);
    border: 1px solid var(--m-aside-sep);
    border-radius: 0 6px 6px 6px;
    box-shadow: 4px 8px 32px rgba(82,63,105,0.35);
    z-index: 500;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.nav-strip-flyout-header {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--m-dark25);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--m-aside-sep);
    margin-bottom: 4px;
}

.nav-flyout-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    cursor: pointer;
    color: var(--m-aside-text);
    font-size: 12px;
    text-decoration: none;
    user-select: none;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nav-flyout-item:hover {
    background: color-mix(in srgb, var(--nav-color, var(--m-primary)) 7%, transparent);
    color: var(--nav-color, var(--m-aside-active-text));
}
.nav-flyout-item.active {
    background: color-mix(in srgb, var(--nav-color, var(--m-primary)) 13%, transparent);
    border-left-color: var(--nav-color, var(--m-primary));
    color: var(--nav-color, var(--m-aside-active-text));
}
.nav-flyout-item.nav-flyout-sub {
    min-height: 40px;
    padding-left: 28px;
    font-size: 11.5px;
    color: color-mix(in srgb, var(--m-aside-text) 80%, transparent);
}
.nav-flyout-item.nav-flyout-sub.active {
    color: var(--nav-color, var(--m-aside-active-text));
}
.nav-flyout-item:hover .nav-chevron-small,
.nav-flyout-item.active .nav-chevron-small {
    background: color-mix(in srgb, var(--nav-color, var(--m-primary)) 15%, #E4E4E4);
    border-color: var(--nav-color, var(--m-primary));
    color: var(--nav-color, var(--m-primary));
}

/* ── Content area ───────────────────────────────────────────── */
.content-area {
    overflow-y: auto;
    padding: 0;
    min-height: 0;
    background: var(--m-bg-page);
}

.content-center {
    max-width: var(--editor-content-max);
    margin: 0 auto;
    padding: 28px 24px 56px;
}

/* Incompatible cached state banner — shown when parent provides state that doesn't match schema */
.incompatible-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--m-danger-light);
    border-radius: var(--editor-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.incompatible-banner-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: var(--m-danger);
}

.incompatible-banner-body strong { font-weight: 600; }
.incompatible-banner-body span   { font-weight: 400; font-size: 12px; }

.incompatible-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.incompatible-clear-btn {
    padding: 6px 14px;
    background: var(--m-danger);
    color: #fff;
    border: none;
    border-radius: var(--editor-radius);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--editor-font);
    cursor: pointer;
    transition: background 0.15s;
}
.incompatible-clear-btn:hover { background: #d63554; }

.incompatible-dismiss-btn {
    background: none;
    border: none;
    color: var(--m-danger);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

/* Restored-from-cache banner */

/* Breadcrumb — page/section title above tabs, coloured with the active page's palette colour */
.content-breadcrumb {
    font-size: 18px;
    font-weight: 600;
    color: var(--page-color, var(--editor-accent));
    margin-bottom: 18px;
    line-height: 1.2;
}

/* ── Tabs — Metronic line-tabs style ────────────────────────── */
.tab-wrapper {
    margin: 0 0 20px;
    background: var(--m-bg-white);
    border-radius: 0.42rem;
    box-shadow: var(--m-shadow-card);
    overflow: hidden;
}

/* Tab strip — white bg, bottom separator */
.tab-bar {
    display: flex;
    gap: 0;
    padding: 0 12px;
    position: sticky;
    top: 0;
    background: var(--m-bg-white);
    border-bottom: 1px solid var(--m-border);
    z-index: 10;
}

/* Tab button — Metronic line-tab */
.tab-btn {
    padding: 12px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--editor-font);
    color: var(--m-dark50);
    white-space: nowrap;
    margin-bottom: -1px;   /* sit on the strip border */
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--m-primary); }

/* Active tab — primary underline, no box */
.tab-btn.active {
    color: var(--m-primary);
    font-weight: 600;
    border-bottom-color: var(--m-primary);
    background: transparent;
}

.tab-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Remove the ::after separator line — replaced by border-bottom on .tab-bar */
.tab-bar::after { display: none; }

/* Collapsed tab bar — height:0 hides buttons visually but keeps them in DOM for scrollWidth measurement */
.tab-bar--overflow {
    height: 0;
    overflow: hidden;
    padding: 0;
    border-bottom: none;
}

/* Dropdown fallback — same visual weight as the tab bar */
.tab-dropdown-bar {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--m-bg-white);
    border-bottom: 1px solid var(--m-border);
}

.tab-select {
    padding: 10px 4px;
    border: none;
    border-bottom: 2px solid var(--m-primary);
    background: transparent;
    font-family: var(--editor-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--m-primary);
    cursor: pointer;
    outline: none;
    min-width: 140px;
}

/* Tab content — inside the white card, no extra border */
.tab-content-box {
    border: none;
    border-radius: 0;
    padding: 20px;
    background: var(--m-bg-white);
    overflow-y: auto;
}

/* Spotlight on focused tab container */
.tab-wrapper:focus-within .tab-btn.active {
    color: var(--m-primary);
    border-bottom-color: var(--m-primary);
}

/* ── Groups — Metronic card ─────────────────────────────────── */
.group-box {
    border: none;
    border-radius: 0.42rem;
    margin-bottom: 20px;
    overflow: visible;
    position: relative;
    background: var(--m-bg-white);
    box-shadow: var(--m-shadow-card);
}

/* No focus border change — Metronic cards don't react to spotlight */
.group-box:focus-within { border-color: transparent; }

/* Group header — Metronic card-header style */
.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 18px;
    background: var(--m-bg-white);
    border-bottom: 1px solid var(--m-border);
    font-weight: 600;
    font-size: 14px;
    color: var(--m-dark);
    border-radius: 0.42rem 0.42rem 0 0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.group-header-title { flex: 1; font-weight: 600; }

.group-header-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.group-header-toggle-label {
    font-size: 12px;
    color: var(--m-dark50);
    font-weight: 400;
}

.group-box:focus-within .group-header { border-bottom-color: var(--m-border); }

.group-body { padding: 16px 18px; }
.group-body > .stack-vertical { gap: 8px; }

/* ── Stack layouts ──────────────────────────────────────────── */
.stack-vertical {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stack-horizontal {
    display: grid;
    gap: var(--editor-gap);
    align-items: start;
}

/* ── Field rows ─────────────────────────────────────────────── */
.field-row {
    display: grid;
    grid-template-columns: var(--editor-label-width) 1fr;
    gap: 8px;
    align-items: start;
    min-height: 32px;
}

/* Spotlight — primary color, Metronic style */
.field-row:hover       .field-label,
.field-row:focus-within .field-label {
    color: var(--m-primary);
    font-weight: 600;
}

.field-label {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 4px;
    padding-top: 9px;
    font-size: 12px;
    font-weight: 500;
    color: var(--m-dark75);
    text-align: right;
    line-height: 1.4;
    word-break: break-word;
    transition: color 0s, font-weight 0s;
}

.field-required-asterisk {
    color: var(--m-danger);
    font-size: 14px;
    line-height: 1.4;
}

.field-input {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Info icon — same style as the nav ⓘ: plain icon, grey, primary on hover */
.field-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-style: normal;
    color: var(--m-dark25);
    cursor: default;
    flex-shrink: 0;
    margin-left: 4px;
    user-select: none;
    vertical-align: middle;
    transition: color 0.15s;
}
.field-info-icon:hover { color: var(--m-primary); }

/* Tooltip */
.field-tooltip {
    position: fixed;
    z-index: 9999;
    background: var(--m-dark);
    color: #f0f0f0;
    font-size: 12px;
    font-family: var(--editor-font);
    font-weight: 400;
    line-height: 1.6;
    padding: 10px 14px;
    border-radius: 0.42rem;
    max-width: 300px;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.field-tooltip b, .field-tooltip strong { font-weight: 700; }
.field-tooltip i, .field-tooltip em     { font-style: italic; }
.field-tooltip a  { color: #7cb9ff; }
.field-tooltip ul { margin: 4px 0 0 14px; }
.field-tooltip li { margin: 2px 0; }

.field-error {
    font-size: 11px;
    color: var(--m-danger);
    margin-top: 2px;
    font-weight: 500;
}

/* ── Inputs — Metronic form controls ────────────────────────── */
input[type="text"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--m-border-input);
    border-radius: 0.42rem;
    font-size: 13px;
    font-family: var(--editor-font);
    font-weight: 400;
    color: var(--m-dark75);
    background: var(--m-bg-white);
    outline: none;
    min-height: 38px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    border-color: var(--m-primary);
    box-shadow: 0 0 0 0.2rem rgba(54,153,255,0.15);
}

input[type="text"]:disabled,
input[type="password"]:disabled,
textarea:disabled,
select:disabled {
    background: var(--m-bg-light);
    color: #3f4254;
    cursor: default;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--m-border-input);
    border-radius: 3px;
    background: var(--m-bg-white);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background: var(--m-primary);
    border-color: var(--m-primary);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid #ffffff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

input[type="checkbox"]:hover:not(:disabled) { border-color: var(--m-primary); }
input[type="checkbox"]:focus { outline: none; box-shadow: 0 0 0 0.2rem rgba(54,153,255,0.2); }
input[type="checkbox"]:disabled { cursor: default; opacity: 0.5; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 9px;
}

select { cursor: pointer; }

/* ── GenericListEditorControl ────────────────────────────────── */
.listeditor-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px 0;
}

.listeditor-empty {
    font-style: italic;
    color: var(--m-dark25);
    font-size: 12px;
}

.listeditor-items {
    display: flex;
    flex-direction: column;
}

.listeditor-item-row {
    display: grid;
    grid-template-columns: 1fr 5px 56px;
    align-items: center;
    padding: 5px 0;
}

.listeditor-item-text {
    word-break: break-word;
    line-height: 1.4;
    font-size: 13px;
    color: var(--m-dark75);
}

.listeditor-delete-btn {
    font-size: 14px;
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--m-dark25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: var(--editor-font);
    transition: color 0.12s;
}
.listeditor-delete-btn:hover { color: var(--m-danger); }

.listeditor-add-row {
    display: grid;
    grid-template-columns: 1fr 6px 32px;
    align-items: center;
}

.listeditor-add-input {
    min-width: 150px;
    height: 32px;
    width: 100%;
}

/* + button — Metronic primary circle */
.listeditor-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--m-primary);
    color: #ffffff;
    font-size: 18px;
    font-weight: 400;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--editor-font);
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s;
}
.listeditor-add-btn:hover:not(:disabled) { background: var(--m-primary-dark); }
.listeditor-add-btn:disabled { opacity: 0.4; cursor: default; }

.listeditor-error {
    font-size: 11px;
    color: var(--m-danger);
    margin-top: 2px;
    font-weight: 500;
}

/* ── ImageProviderControl ───────────────────────────────────── */
.imgprov-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
}

.imgprov-left  { flex: 1; min-width: 0; }
.imgprov-gap   { width: 20px; flex-shrink: 0; }

.imgprov-right {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.imgprov-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.imgprov-value-entry {
    flex: 1;
    min-width: 0;
    height: 32px;
}

.imgprov-mode-picker {
    display: flex;
    border: 1px solid var(--m-border-input);
    border-radius: 0.42rem;
    overflow: hidden;
    height: 32px;
    flex-shrink: 0;
    width: 110px;
}

.imgprov-mode-btn {
    flex: 1;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--editor-font);
    color: var(--m-dark50);
    white-space: nowrap;
    padding: 0 6px;
    transition: background 0.12s, color 0.12s;
}
.imgprov-mode-btn:hover:not(:disabled) { background: var(--m-bg-light2); }
.imgprov-mode-btn.active { background: var(--m-primary); color: #ffffff; }
.imgprov-mode-btn:disabled { opacity: 0.5; cursor: default; }

.imgprov-browse-btn {
    height: 32px;
    padding: 0 12px;
    background: var(--m-primary);
    color: #ffffff;
    border: none;
    border-radius: 0.42rem;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--editor-font);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    transition: background 0.15s;
}
.imgprov-browse-btn:hover { background: var(--m-primary-dark); }

.imgprov-preview-border {
    width: 200px;
    height: 120px;
    border-radius: 0.42rem;
    border: 1px solid var(--m-border-input);
    background: var(--m-bg-light);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.imgprov-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: var(--m-dark50);
    background: var(--m-bg-light);
    z-index: 2;
}
.imgprov-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--m-border);
    border-top-color: var(--m-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.imgprov-error-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--m-danger);
    background: var(--m-danger-light);
    z-index: 2;
    text-align: center;
    padding: 8px;
}

.imgprov-img-hidden { opacity: 0; }

.imgprov-no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-style: italic;
    color: var(--m-dark25);
}

.imgprov-preview-img {
    position: absolute;
    inset: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    object-fit: contain;
    transition: filter 0.35s ease, transform 0.35s ease;
}

/* Phase 1 — tiny thumbnail blown up with blur (progressive placeholder) */
.imgprov-preview-blur {
    filter: blur(8px);
    transform: scale(1.08); /* hide blurred edges */
}

/* Phase 2 — full image swapped in, blur fades out */
.imgprov-preview-sharp {
    filter: blur(0);
    transform: scale(1);
}

.imgprov-bottom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.imgprov-accept-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.imgprov-accept-row input[type="checkbox"] { width: 16px; flex-shrink: 0; }

.imgprov-accept-label {
    font-size: 12px;
    color: var(--m-dark75);
    white-space: nowrap;
}

.imgprov-clear-btn {
    height: 32px;
    padding: 0 12px;
    background: var(--m-bg-light2);
    color: var(--m-dark65);
    border: none;
    border-radius: 0.42rem;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--editor-font);
    display: inline-flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
.imgprov-clear-btn:hover { background: var(--m-danger-light); color: var(--m-danger); }

/* Upload-blocked navigation banner */
.upload-nav-block-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--m-warning-light);
    border-radius: var(--editor-radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--m-warning);
}
.upload-nav-block-body {
    display: flex;
    align-items: center;
    gap: 8px;
}
.upload-nav-block-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,168,0,0.3);
    border-top-color: var(--m-warning);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
.upload-nav-block-dismiss {
    background: none;
    border: none;
    color: var(--m-warning);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}

/* Cancel button inside progress status */
.imgprov-cancel-btn {
    background: none;
    border: none;
    color: var(--m-danger);
    font-size: 12px;
    cursor: pointer;
    padding: 0 2px;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}
.imgprov-cancel-btn:hover { color: #d63554; }

.imgprov-progress-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 5px;
}
.imgprov-progress-status.status-active { color: var(--m-primary); }
.imgprov-progress-status.status-done   { color: var(--m-success); }

.imgprov-progress-spinner {
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--m-primary-light);
    border-top-color: var(--m-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.d-none { display: none !important; }

/* ── Navigation validation dialog ───────────────────────────── */
.nav-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24,28,50,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.nav-dialog {
    background: var(--m-bg-white);
    border-radius: 0.42rem;
    box-shadow: 0 8px 40px rgba(82,63,105,0.18);
    padding: 28px;
    width: 440px;
    max-width: calc(100vw - 48px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nav-dialog-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--m-dark);
}

.nav-dialog-body {
    font-size: 13px;
    color: var(--m-dark75);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-dialog-body ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-dialog-body li {
    color: var(--m-danger);
    font-size: 12px;
}

.nav-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.nav-dialog-btn {
    padding: 8px 20px;
    border-radius: 0.42rem;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--editor-font);
    background: none;
    transition: background 0.15s, color 0.15s;
}

.nav-dialog-btn--stay {
    color: var(--m-dark65);
    background: var(--m-bg-light);
}
.nav-dialog-btn--stay:hover { background: var(--m-bg-light2); }

.nav-dialog-btn--continue {
    background: var(--m-primary);
    color: #fff;
}
.nav-dialog-btn--continue:hover { background: var(--m-primary-dark); }

/* ── Decorative nodes ───────────────────────────────────────── */
.section-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--m-dark);
    margin: 8px 0 2px;
}

.field-divider {
    border: none;
    border-top: 1px solid var(--m-border);
    margin: 8px 0;
}

.spec-heading-0 { font-size: 13px; margin: 6px 0 2px; }
.spec-heading   { font-weight: 600; color: var(--m-dark); }

/* ── Shared components ──────────────────────────────────────── */
.error-banner {
    background: var(--m-danger-light);
    border: none;
    border-radius: 0.42rem;
    padding: 12px 16px;
    color: var(--m-danger);
    font-size: 13px;
    font-weight: 500;
    white-space: pre-wrap;
    word-break: break-word;
}

.required-disclaimer {
    background: var(--m-warning-light);
    border: none;
    border-radius: 0.42rem;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--m-dark);
    margin-bottom: 16px;
    font-weight: 500;
}

.required-disclaimer ul { margin: 8px 0 0 16px; }
.required-disclaimer li { margin: 2px 0; font-weight: 400; }

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px;
    color: var(--m-dark50);
    font-size: 13px;
    font-weight: 500;
}

.spinner-ring {
    width: 26px;
    height: 26px;
    border: 3px solid var(--m-border);
    border-top-color: var(--m-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-init {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-family: var(--editor-font);
    color: var(--m-dark50);
    font-size: 14px;
    font-weight: 500;
    background: var(--m-bg-page);
}

#blazor-error-ui {
    background: var(--m-danger-light);
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(82,63,105,0.12);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--m-danger);
    font-size: 13px;
    font-family: var(--editor-font);
}

/* ── Editor waiting overlay — shown before schema is loaded ─── */
.editor-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--m-bg-page);
}

.editor-waiting-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--m-dark50);
    font-size: 14px;
    font-weight: 500;
}

.editor-waiting-error {
    color: var(--m-danger);
    font-weight: 500;
    font-size: 13px;
    max-width: 360px;
    text-align: center;
}

/* ── Load schema screen — Metronic login-card style ─────────── */
.load-schema-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 24px;
    gap: 32px;
    background: var(--m-bg-page);
}

.load-schema-card {
    width: 100%;
    max-width: 540px;
    border: none;
    border-radius: 0.42rem;
    padding: 36px 40px;
    background: var(--m-bg-white);
    box-shadow: var(--m-shadow-card);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.load-schema-card h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--m-dark);
    letter-spacing: -0.3px;
}

.load-schema-subtitle {
    font-size: 13px;
    color: var(--m-dark50);
    margin-top: -10px;
}

.load-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.load-section label {
    font-size: 12px;
    font-weight: 600;
    color: var(--m-dark65);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.load-row input { flex: 1; }

/* Metronic primary button */
.btn-load {
    padding: 9px 20px;
    background: var(--m-primary);
    color: #fff;
    border: none;
    border-radius: 0.42rem;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--editor-font);
    white-space: nowrap;
    transition: background 0.15s;
}
.btn-load:hover    { background: var(--m-primary-dark); }
.btn-load:disabled { opacity: 0.5; cursor: default; }

/* Divider "or" */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--m-dark25);
    font-size: 12px;
    font-weight: 500;
}
.section-divider::before,
.section-divider::after { content: ''; flex: 1; border-top: 1px solid var(--m-border); }

/* File input label — Metronic dashed upload area */
.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border: 1.5px dashed var(--m-primary);
    border-radius: 0.42rem;
    color: var(--m-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    background: var(--m-primary-light);
    transition: background 0.15s;
}
.file-input-label:hover { background: rgba(54,153,255,0.15); }

input[type="file"] { display: none; }

/* Drop zone */
.load-dropzone {
    border: 2px dashed var(--m-border-input);
    border-radius: 0.42rem;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    font-size: 13px;
    color: var(--m-dark50);
}
.load-dropzone.drag-over {
    border-color: var(--m-primary);
    background: var(--m-primary-light);
}
.load-dropzone-icon { font-size: 32px; }
.load-selected {
    font-size: 12px;
    color: var(--m-primary);
    font-weight: 600;
}

/* Progress steps */
.load-progress { padding: 8px 0; }

.load-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.load-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--m-dark50);
    padding: 4px 0;
}

.load-progress-step.step-active {
    color: var(--m-dark75);
    font-weight: 600;
}

.step-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--m-border);
    border-top-color: var(--m-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.step-check {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m-success);
    font-size: 12px;
    flex-shrink: 0;
}

/* Cache info banner */
.load-cache-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--m-primary-light);
    border: none;
    border-radius: 0.42rem;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--m-primary-dark);
}

.load-cache-clear {
    padding: 4px 12px;
    border: 1px solid var(--m-primary);
    border-radius: 0.42rem;
    background: none;
    color: var(--m-primary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--editor-font);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.load-cache-clear:hover { background: var(--m-primary); color: #fff; }

.load-cache-cleared {
    font-size: 12px;
    font-weight: 500;
    color: var(--m-success);
    text-align: center;
    padding: 4px 0;
}

/* ── Results page ───────────────────────────────────────────── */
.results-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.results-back-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 0.42rem;
    background: var(--m-bg-light2);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--editor-font);
    color: var(--m-dark65);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.results-back-btn:hover { background: var(--m-primary-light); color: var(--m-primary); }

.results-title { display: flex; flex-direction: column; }
.results-schema-name { font-size: 20px; font-weight: 700; color: var(--m-dark); }
.results-schema-ver  { font-size: 13px; color: var(--m-dark50); }

.results-valid-badge {
    background: var(--m-success-light);
    border: none;
    border-radius: 0.42rem;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--m-success);
}

.results-warnings {
    background: var(--m-warning-light);
    border: none;
    border-radius: 0.42rem;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--m-warning);
}
.results-warnings ul { margin: 6px 0 0 16px; }
.results-warnings li { margin: 2px 0; font-size: 12px; font-weight: 400; }

.results-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.results-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--m-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-file-picker {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--m-border-input);
    border-radius: 0.42rem;
    background: var(--m-bg-white);
    cursor: pointer;
    font-family: var(--editor-font);
}

.results-file-list {
    border: none;
    border-radius: 0.42rem;
    overflow: hidden;
    background: var(--m-bg-white);
    box-shadow: var(--m-shadow-card);
}

.results-file-row {
    display: grid;
    grid-template-columns: 24px 1fr 28px auto;
    column-gap: 10px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--m-border);
    font-size: 13px;
}
.results-file-row:last-child { border-bottom: none; }

.results-file-icon { font-size: 16px; }
.results-file-name { color: var(--m-dark75); font-weight: 500; }
.results-file-status { font-size: 14px; text-align: center; }
.status-ok   { color: var(--m-success); }
.status-warn { color: var(--m-warning); }

.results-dl-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 0.42rem;
    background: var(--m-primary-light);
    color: var(--m-primary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--editor-font);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.results-dl-btn:hover { background: var(--m-primary); color: #fff; }

/* JSON preview — VS Code dark theme */
.results-preview {
    background: #1E1E2D;     /* Metronic dark shade */
    color: #ABB2BF;
    border-radius: 0.42rem;
    padding: 18px;
    font-size: 12px;
    font-family: 'Cascadia Code', 'Consolas', 'Monaco', monospace;
    overflow-x: auto;
    max-height: 360px;
    overflow-y: auto;
    white-space: pre;
    line-height: 1.6;
    box-shadow: var(--m-shadow-card);
}

.results-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 48px;
}

.results-exporting {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--m-dark50);
}

.results-export-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--m-border);
    border-top-color: var(--m-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.results-dl-all-btn {
    padding: 11px 28px;
    background: var(--m-primary);
    color: #fff;
    border: none;
    border-radius: 0.42rem;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--editor-font);
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.2px;
}
.results-dl-all-btn:hover { background: var(--m-primary-dark); }

/* ── Search highlight flash ─────────────────────────────────── */
@keyframes groupSpotlight {
    0%   { background: rgba(255,179,0,0.30); box-shadow: 0 0 0 3px rgba(255,179,0,0.50); }
    60%  { background: rgba(255,179,0,0.10); box-shadow: 0 0 0 3px rgba(255,179,0,0.20); }
    100% { background: transparent;          box-shadow: none; }
}

.group-spotlight {
    border-radius: var(--editor-radius);
    animation: groupSpotlight 2.5s ease forwards;
}

@keyframes fieldFlash {
    0%   { background: rgba(54,153,255,0.22); box-shadow: 0 0 0 3px rgba(54,153,255,0.22); }
    55%  { background: rgba(54,153,255,0.08); box-shadow: 0 0 0 3px rgba(54,153,255,0.08); }
    100% { background: transparent;           box-shadow: none; }
}

.field-flash {
    border-radius: var(--editor-radius);
    animation: fieldFlash 2s ease forwards;
}

.unsupported-field {
    padding: 6px 0;
    font-size: 11px;
    color: var(--m-dark25);
    font-style: italic;
}

/* ── Responsive breakpoints ─────────────────────────────────── */

/* ≥1200px — scale up font and spacing, keep content centered */
@media (min-width: 1200px) {
    :root {
        --editor-font-size:   14px;
        --editor-label-width: 240px;
    }

    .content-center { padding: 32px 28px 64px; }
}

/* ≥901px — full static sidebar nav, no strip/flyout needed */
@media (min-width: 901px) {
    .editor-layout {
        grid-template-columns: 265px 1fr;
    }

    .nav-panel {
        width: 265px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Restore full nav item appearance (override strip-collapsed rules) */
    .nav-panel:not(.nav-expanded) .nav-item {
        height: auto;
        padding: 7px 14px 7px 11px;
        align-items: start;
    }
    .nav-panel:not(.nav-expanded) .nav-item.nav-section  { padding: 5px 14px 5px 11px; }
    .nav-panel:not(.nav-expanded) .nav-item.nav-subsection { padding: 4px 14px 4px 11px; }
    .nav-panel:not(.nav-expanded) .nav-label { display: block; }
    .nav-panel:not(.nav-expanded) .nav-section,
    .nav-panel:not(.nav-expanded) .nav-subsection { display: grid; }
    .nav-panel:not(.nav-expanded) .nav-page-warning { display: none; }

    /* Hide toggle button, flyout, and overlay backdrop — not needed on wide screens */
    .nav-toggle-btn      { display: none; }
    .nav-strip-flyout    { display: none; }
    .nav-overlay-backdrop { display: none; }

    /* Show schema name in top-bar title column */
    .top-bar-title {
        justify-content: flex-start;
        gap: 10px;
        padding: 11px 16px;
    }
    .top-bar-title-text { display: block; }
}

/* ≤900px — tighter label width + stacked image provider */
@media (max-width: 900px) {
    :root {
        --editor-label-width: 130px;
    }

    /* No toggle button — flyout opens by tapping a page circle */
    .nav-toggle-btn { display: none; }

    .content-center {
        padding: 20px 16px 40px;
    }

    /* Stack image provider: inputs on top, preview beside */
    .imgprov-layout {
        flex-direction: column;
        gap: 10px;
    }
    .imgprov-gap { display: none; }
    .imgprov-left  { width: 100%; }
    .imgprov-right {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    .imgprov-preview-border {
        width: 120px;
        height: 80px;
        flex-shrink: 0;
    }
}

/* Small phone (<520px) — single-column fields */
@media (max-width: 520px) {
    .field-row {
        grid-template-columns: 1fr;
        gap: 4px;
        min-height: unset;
    }
    .field-label {
        text-align: left;
        justify-content: flex-start;
        padding-top: 0;
        padding-bottom: 2px;
    }
    .content-center {
        padding: 12px 12px 32px;
    }
    .tab-content-box { padding: 14px; }
    .group-body      { padding: 12px 14px; }
}

/* ============================================================
   Alt Input — button + modal picker
   ============================================================ */

.altinput-btn {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid #3699FF;
    border-radius: 4px;
    color: #3699FF;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.altinput-btn:hover {
    background: #3699FF;
    color: #fff;
}
.altinput-icon {
    flex-shrink: 0;
    opacity: 0.85;
}

/* Overlay */
.altinput-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal */
.altinput-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    width: min(420px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 64px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.altinput-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #EEF0F8;
    flex-shrink: 0;
}
.altinput-modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #181C32;
}
.altinput-modal-subtitle {
    font-size: 0.75rem;
    color: #7E8299;
    margin-top: 2px;
}
.altinput-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #7E8299;
    font-size: 0.9rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}
.altinput-modal-close:hover { background: #F5F8FA; color: #181C32; }

/* Search */
.altinput-search-wrap {
    position: relative;
    padding: 10px 12px 8px;
    flex-shrink: 0;
    border-bottom: 1px solid #EEF0F8;
}
.altinput-search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #B5B5C3;
    pointer-events: none;
}
.altinput-search {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px 6px 30px;
    border: 1px solid #E4E6EF;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #181C32;
    background: #F5F8FA;
    outline: none;
    transition: border-color 0.15s;
}
.altinput-search:focus {
    border-color: #3699FF;
    background: #fff;
}

/* List */
.altinput-list {
    overflow-y: auto;
    flex: 1;
    padding: 6px 0;
}
.altinput-empty {
    padding: 16px 16px;
    font-size: 0.82rem;
    color: #B5B5C3;
    text-align: center;
}

/* Items (shared) */
.altinput-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.1s;
}
.altinput-item:hover { background: #F5F8FA; }
.altinput-item-body { flex: 1; min-width: 0; }
.altinput-item-label {
    font-size: 0.84rem;
    color: #181C32;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.altinput-item-desc {
    font-size: 0.75rem;
    color: #7E8299;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Multi-select checkbox */
.altinput-item-check {
    width: 16px;
    height: 16px;
    border: 1.5px solid #D1D3E0;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
}
.altinput-item-check--on {
    background: #3699FF;
    border-color: #3699FF;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3.5L4 6.5L9 1' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px 8px;
}
.altinput-item--checked .altinput-item-label { color: #3699FF; }

/* Single-select tick */
.altinput-item-tick {
    color: #3699FF;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.altinput-item-tick--hidden { visibility: hidden; }
.altinput-item--selected { background: #F0F7FF; }
.altinput-item--selected .altinput-item-label { color: #3699FF; }

/* Footer (multi-select only) */
.altinput-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #EEF0F8;
    flex-shrink: 0;
}
.altinput-footer-count {
    flex: 1;
    font-size: 0.78rem;
    color: #7E8299;
}
.altinput-footer-count strong { color: #3699FF; }
.altinput-btn-cancel {
    background: none;
    border: 1px solid #E4E6EF;
    border-radius: 4px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 0.78rem;
    color: #7E8299;
    cursor: pointer;
}
.altinput-btn-cancel:hover { border-color: #B5B5C3; color: #181C32; }
.altinput-btn-apply {
    background: #3699FF;
    border: none;
    border-radius: 4px;
    padding: 5px 14px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.altinput-btn-apply:hover:not(:disabled) { background: #187DE4; }
.altinput-btn-apply:disabled { opacity: 0.45; cursor: not-allowed; }

.altinput-no-data {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #B5B5C3;
    font-style: italic;
}

/* ── Dropdown altInput — custom control with showValSubtext / noData fallback ── */

.dd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
}

.dd-nodata-warn {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border: 1px dashed #FCD34D;
    border-radius: 4px;
    background: #FFFBEB;
    font-size: 0.78rem;
    color: #B45309;
    line-height: 1.5;
}

.dd-nodata-warn ul {
    margin: 4px 0 0 4px;
    padding-left: 16px;
}

.dd-nodata-warn li { margin: 2px 0; }

.dd-nodata-warn code {
    font-family: monospace;
    background: rgba(180, 83, 9, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.dd-embed-frame {
    margin-bottom: 6px;
}

.dd-embed-iframe {
    width: 100%;
    /* Low floor, not a real target height — the embedded page resizes this element to its actual
       content height itself (see auth.js's #embed-appreg branch, window.__embedResize). This is
       just enough to avoid a zero-height flash before that first measurement lands. A taller floor
       here (e.g. matching the modal's height) would fight the dynamic sizing and reintroduce the
       "too much empty space in the idle state" it exists to fix. */
    min-height: 120px;
    border: none;
    box-shadow: none;
    background: transparent;
    display: block;
}

.dd-filter-empty {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    border: 1px dashed #93C5FD;
    border-radius: 4px;
    background: #EFF6FF;
    font-size: 0.78rem;
    color: #1D4ED8;
    line-height: 1.5;
}

.dd-filter-empty svg { color: #3B82F6; }

.dd-opt--manual {
    border-top: 1px solid #E4E6EF;
    margin-top: 2px;
    padding-top: 2px;
}

.dd-opt-manual-label {
    font-size: 0.78rem;
    color: #6366F1;
    padding: 4px 0;
}

.dd-modal-item--manual {
    border-top: 1px solid #E4E6EF;
    margin-top: 4px;
}

.dd-modal-item--manual .dd-modal-item-label {
    font-size: 0.82rem;
    color: #6366F1;
}

.dd-modal-footer {
    flex-shrink: 0;
    padding: 14px 20px;
    cursor: pointer;
    border-top: 1px solid #E4E6EF;
    background: #fff;
    transition: background 0.1s;
}

.dd-modal-footer:active { background: #F0F7FF; }

.dd-modal-footer .dd-modal-item-label {
    font-size: 0.82rem;
    color: #6366F1;
}

.dd-modal-search {
    flex-shrink: 0;
    padding: 10px 16px;
    border-bottom: 1px solid #EEF0F8;
    background: #fff;
}
.dd-modal-search .dd-search-input {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
}

.dd-manual-back {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid #3699FF;
    border-radius: 4px;
    color: #3699FF;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.dd-manual-back:hover { background: #3699FF; color: #fff; }

.dd-fallback-input--error { border-color: #F64E60 !important; }

.dd-fallback-input {
    width: 100%;
    height: 34px;
    border: 1px solid #E4E6EF;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 0.84rem;
    font-family: monospace;
    color: #181C32;
    background: #fff;
    transition: border-color 0.15s;
}
.dd-fallback-input:focus { outline: none; border-color: #3699FF; }
.dd-fallback-input:disabled { background: #F5F8FA; color: #B5B5C3; cursor: not-allowed; }

.dd-custom {
    position: relative;
}
.dd-custom--disabled { pointer-events: none; }
.dd-custom--disabled .dd-chevron { color: transparent; }
.dd-custom--disabled .dd-trigger { background: #f5f8fa; cursor: default; }
.dd-custom--disabled .dd-trigger-label { color: #181c32; }
.dd-custom--disabled .dd-trigger-val   { color: #5e6278; }

.dd-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #E4E6EF;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s;
}
.dd-trigger:hover { border-color: #B5B5C3; }
.dd-trigger:focus { outline: none; border-color: #3699FF; box-shadow: 0 0 0 2px rgba(54,153,255,.15); }
.dd-trigger--open { border-color: #3699FF; border-radius: 4px 4px 0 0; box-shadow: 0 0 0 2px rgba(54,153,255,.15); }

.dd-trigger-inner {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.dd-trigger-label {
    font-size: 0.84rem;
    font-weight: 500;
    color: #181C32;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dd-trigger-val {
    font-size: 0.67rem;
    color: #7E8299;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dd-placeholder {
    font-size: 0.84rem;
    color: #B5B5C3;
}
.dd-chevron {
    flex-shrink: 0;
    color: #7E8299;
    transition: transform 0.15s;
}
.dd-chevron--open { transform: rotate(180deg); }

.dd-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #3699FF;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 6px 16px rgba(28,32,51,.1);
    z-index: 50;
    max-height: 240px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dd-menu-list {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
.dd-menu-footer {
    flex-shrink: 0;
    padding: 8px 12px;
    cursor: pointer;
    border-top: 1px solid #E4E6EF;
    background: #fff;
    transition: background 0.1s;
}
.dd-menu-footer:hover { background: #F0F7FF; }

.dd-menu-search {
    flex-shrink: 0;
    padding: 6px 8px;
    border-bottom: 1px solid #EEF0F8;
    background: #fff;
}
.dd-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 3px;
    font-size: 12px;
    color: #3F4254;
    outline: none;
    background: #FAFAFA;
}
.dd-search-input:focus { border-color: #3699FF; background: #fff; }
.dd-no-results {
    padding: 10px 12px;
    font-size: 12px;
    color: #9799AA;
    text-align: center;
}
mark.dd-hl {
    background: #DBEAFE;
    color: #1D4ED8;
    border-radius: 2px;
    padding: 0 1px;
    font-style: normal;
    font-weight: 600;
}

.dd-opt {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #EEF0F8;
    transition: background 0.1s;
}
.dd-opt:last-child { border-bottom: none; }
.dd-opt:hover { background: #F0F7FF; }
.dd-opt--sel { background: #F0F7FF; }

.dd-opt-label {
    font-size: 0.84rem;
    font-weight: 500;
    color: #181C32;
}
.dd-opt--sel .dd-opt-label { color: #3699FF; }

.dd-opt-val {
    font-size: 0.67rem;
    color: #7E8299;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

/* ── Subtext dropdown: desktop/mobile split ─────────────────── */
.dd-desktop-only { display: block; }
.dd-mobile-only  { display: none; }

@media (max-width: 767px) {
    .dd-desktop-only { display: none; }
    .dd-mobile-only  { display: block; }
}

/* ── Subtext dropdown: resolving/loading state ──────────────── */
.dd-spin {
    flex-shrink: 0;
    color: #B5B5C3;
    animation: spin 0.8s linear infinite;
}
.dd-resolving-label {
    font-size: 0.75rem !important;
    font-style: italic;
    color: #B5B5C3 !important;
    font-weight: 400 !important;
}

/* ── Picker modal — bottom sheet, position:fixed covers iframe ─ */
.dd-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24, 28, 50, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dd-modal {
    width: 100%;
    max-width: 480px;
    max-height: 72vh;
    background: #fff;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(24, 28, 50, 0.22);
}

.dd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #EEF0F8;
    flex-shrink: 0;
}

.dd-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #181C32;
}

.dd-modal-close {
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #7E8299;
    cursor: pointer;
    padding: 0 2px;
}

.dd-modal-list {
    overflow-y: auto;
    flex: 1;
}

.dd-modal-item {
    padding: 14px 20px;
    border-bottom: 1px solid #EEF0F8;
    cursor: pointer;
}

.dd-modal-item:last-child { border-bottom: none; }
.dd-modal-item:active { background: #F0F7FF; }

.dd-modal-item--sel { background: #F5F8FF; }

.dd-modal-item-label {
    font-size: 14px;
    font-weight: 500;
    color: #181C32;
}

.dd-modal-item--sel .dd-modal-item-label {
    color: #3699FF;
    font-weight: 600;
}

.dd-modal-item-val {
    font-size: 11px;
    color: #7E8299;
    font-variant-numeric: tabular-nums;
    margin-top: 3px;
    word-break: break-all;
}
