/* Non-scoped — RCL scoped CSS was not applying in Staff WASM, so headers looked centered. */
.dataset-editor {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.dataset-editor-chrome {
    flex: 0 0 auto;
    z-index: 5;
    padding: 0.5rem 0.5rem 0;
    background: var(--iq-surface-alt, var(--iq-bg, #f5f6f8));
}

.dataset-editor-chrome > .mb-3 {
    margin-bottom: 0.75rem !important;
}

.dataset-editor-audit {
    text-align: right;
    font-size: 0.75rem;
    line-height: 1.25;
    color: var(--iq-muted, #6c757d);
    padding: 0 0.15rem 0.45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dataset-editor-preview {
    min-width: 0;
    flex: 1 1 auto;
}

.dataset-editor-preview .card {
    margin-bottom: 0;
    box-shadow: none;
}

.dataset-editor-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 0.5rem 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.dataset-editor-sections {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dataset-editor-section {
    scroll-margin-top: 0.5rem;
    overflow: hidden;
    min-width: 0;
}

.dataset-editor-sections.focus-mode > .dataset-editor-section:not(.is-pinned):not(.is-active) {
    display: none;
}

.sections-focus-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.15rem 0 0.35rem;
    padding: 0.35rem 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--iq-border, #dee2e6);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--iq-muted, #6c757d);
}

.sections-focus-bar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    min-width: 0;
}

.sections-focus-bar strong {
    color: var(--iq-text, #212529);
    font-weight: 650;
}

.sections-focus-bar .focus-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    flex-shrink: 0;
}

.sections-focus-bar button.linkish {
    appearance: none;
    border: 0;
    background: transparent;
    color: #0d6efd;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.sections-focus-bar button.linkish:hover {
    text-decoration: underline;
}

.pin-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--iq-primary, #042c54);
    background: #e8f1fb;
    border: 1px solid #c5daf0;
    border-radius: 999px;
    padding: 0.1rem 0.25rem 0.1rem 0.35rem;
}

.pin-chip .bi-pin-angle-fill {
    font-size: 0.7rem;
}

.pin-chip .pin-chip-x {
    appearance: none;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 999px;
    width: 1.15rem;
    height: 1.15rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
}

.pin-chip .pin-chip-x:hover {
    background: #dbeafe;
    color: #b91c1c;
}

.dataset-editor-section-heading-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--iq-border, #dee2e6);
    background: transparent;
}

.dataset-editor-section.is-collapsed .dataset-editor-section-heading-row {
    border-bottom: 0;
}

.dataset-editor-section-heading-row .dataset-editor-section-heading {
    flex: 0 0 auto;
    min-width: 0;
    width: auto !important;
    border-bottom: 0 !important;
}

.dataset-editor-section-chrome {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 0.45rem;
    border-left: 1px solid #eef1f4;
    background: #fafbfc;
}

.dataset-editor-section-chrome .btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

.dataset-editor-section-chrome .section-search {
    position: relative;
    flex: 1 1 10rem;
    min-width: 8rem;
}

.dataset-editor-section-chrome .section-search input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.2rem 0.45rem 0.2rem 1.6rem;
    font: inherit;
    font-size: 0.78rem;
    height: 1.7rem;
    background: #fff;
}

.dataset-editor-section-chrome .section-search .bi-search {
    position: absolute;
    left: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.78rem;
}

.section-pin,
.section-pin-badge {
    appearance: none;
    border: 0;
    border-left: 1px solid #eef1f4;
    background: #fafbfc;
    color: #475569;
    min-width: 2.75rem;
    padding: 0.35rem 0.55rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    flex-shrink: 0;
    font: inherit;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1;
}

.section-pin {
    cursor: pointer;
}

.section-pin:hover {
    background: #eef2f7;
    color: var(--iq-primary, #042c54);
}

.section-pin-badge {
    color: var(--iq-primary, #042c54);
    background: #e8f1fb;
    border-left: 1px solid #c5daf0;
    cursor: default;
    user-select: none;
}

.section-pin .bi,
.section-pin-badge .bi {
    font-size: 1.05rem;
    line-height: 1;
}

.dataset-editor-section-heading {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem;
    width: 100% !important;
    margin: 0;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
    text-align: left !important;
    cursor: pointer;
    user-select: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--iq-border, #dee2e6) !important;
    border-radius: 0;
    box-shadow: none !important;
    color: inherit;
    font: inherit;
}

.dataset-editor-section.is-collapsed .dataset-editor-section-heading {
    border-bottom: 0 !important;
}

.dataset-editor-section-heading:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

.dataset-editor-section-heading-main {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left !important;
}

.dataset-editor-section-chevron {
    flex: 0 0 auto;
    width: 1rem;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--iq-muted-text, #6c757d);
}

.dataset-editor-section-title {
    margin: 0;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--iq-text, #212529);
    text-align: left !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dataset-editor-section-count {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.35rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background-color: var(--iq-primary, #0d6efd) !important;
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.dataset-editor-section-body {
    padding: 0.375rem 0.5rem 0.5rem;
    min-height: 0;
    min-width: 0;
    overflow-x: auto;
}

/* DatasetScreen nests its own cards — drop redundant outer wrappers inside sections */
.dataset-editor-section-body .dataset-screen-container {
    padding: 0;
}

.dataset-editor-section-body .screen-section {
    padding: 0;
    margin-bottom: 0 !important;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.dataset-editor-section-body .screen-flow-container {
    padding: 0.45rem 0.55rem 0.5rem;
}

.dataset-editor-section-body .screen-flow-panel-heading {
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
}

.dataset-editor-section-body .screen-row {
    margin-bottom: 0.35rem;
}

.dataset-editor-section-body .control-wrapper {
    margin-bottom: 0.35rem;
    padding: 0.3rem 0.4rem 0.35rem;
}

.dataset-editor-section.is-collapsed .dataset-editor-section-body[hidden] {
    display: none !important;
}

#dataset-editor-scroll-pad {
    width: 100%;
}

.dataset-editor-section-body .dataset-list-row-new,
.dataset-editor-section-body .dataset-list-row-new > td {
    background-color: rgba(var(--bs-warning-rgb, 255, 193, 7), 0.18);
}
