html.dashboard-root {
    font-size: calc(20px * var(--app-font-scale, 1));
    color-scheme: dark;
    --person-spark-width: 6.6rem;
}

html.dashboard-root[data-theme="light"] {
    color-scheme: light;
}

html.dashboard-root.s21-theme-fade,
html.dashboard-root.s21-theme-fade body.dashboard-body {
    transition:
        background-color var(--motion-panel) var(--motion-ease),
        color var(--motion-panel) var(--motion-ease);
}

.dashboard-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-body .dashboard-header h1 {
    font-size: 2.15rem;
}

.dashboard-body .subtitle {
    font-size: 0.95rem;
}

.dashboard-main {
    width: 100%;
    padding: 1.35rem 1.25rem 1.5rem;
}

.dashboard-stack {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.dashboard-section {
    border-radius: 14px;
    border: 1px solid var(--card-border);
    padding: 0;
    background: var(--section-bg);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.dashboard-section--table .dashboard-accordion-inner {
    overflow: visible;
}

.dashboard-section:not(.collapsed):focus-within {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.dashboard-accordion-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 1rem 1.15rem;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dashboard-accordion-trigger:hover {
    background: var(--surface-hover-strong);
}

.dashboard-accordion-trigger-main {
    flex: 1;
    min-width: 0;
}

.dashboard-accordion-chevron {
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: var(--surface-hover-strong);
    border: 1px solid var(--surface-border-medium);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
}

.dashboard-accordion-chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translate(-50%, -65%) rotate(45deg);
    transition: border-color 0.2s ease;
}

.dashboard-accordion-trigger:hover .dashboard-accordion-chevron {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

.dashboard-accordion-trigger:hover .dashboard-accordion-chevron::before {
    border-color: var(--primary);
}

.dashboard-accordion.collapsed .dashboard-accordion-chevron {
    transform: rotate(-90deg);
}

.dashboard-accordion-badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-hover-strong);
    border: 1px solid var(--surface-border-medium);
}

.dashboard-accordion-badge:not(:empty) {
    color: #c4b5fd;
    border-color: rgba(167, 139, 250, 0.35);
    background: rgba(167, 139, 250, 0.12);
}

.dashboard-accordion-body {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
}

.dashboard-accordion-body.is-folding {
    transition: grid-template-rows var(--motion-panel) var(--motion-ease);
}

.dashboard-accordion.collapsed .dashboard-accordion-body {
    grid-template-rows: 0fr;
}

.dashboard-accordion-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 1.15rem 1.15rem;
}

.dashboard-accordion.collapsed .dashboard-accordion-inner {
    padding: 0;
    visibility: hidden;
    pointer-events: none;
}

.dashboard-accordion.collapsed .dashboard-accordion-trigger {
    border-bottom: none;
}

.dashboard-accordion:not(.collapsed) .dashboard-accordion-trigger {
    border-bottom: 1px solid var(--surface-border-light);
}

.dashboard-section-header {
    margin-bottom: 0.95rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-section-header--compact {
    margin-bottom: 0.85rem;
}

/* Heading levels: docs/dashboard-typography-sections.md */
.dashboard-section-title {
    display: block;
    margin: 0;
    line-height: 1.25;
    font-size: var(--heading-section-size);
    font-weight: var(--heading-section-weight);
    letter-spacing: var(--heading-section-tracking);
    text-transform: var(--heading-section-transform);
    color: var(--heading-section-color);
}

.dashboard-heading-subsection,
.summary-subsection-title,
.publisher-detail-card-title {
    margin: 0 0 0.75rem;
    line-height: 1.3;
    font-size: var(--heading-subsection-size);
    font-weight: var(--heading-subsection-weight);
    letter-spacing: var(--heading-subsection-tracking);
    text-transform: var(--heading-subsection-transform);
    color: var(--heading-subsection-color);
}

.publisher-detail-card-title {
    margin-bottom: 0.35rem;
}

.dashboard-heading-panel,
.filters-title,
.chart-card h3,
.publisher-chart-title,
.grupos-role-card-title,
.detail-monthly-filter-title,
.wizard-step-label {
    margin: 0;
    line-height: 1.25;
    font-size: var(--heading-panel-size);
    font-weight: var(--heading-panel-weight);
    letter-spacing: var(--heading-panel-tracking);
    text-transform: var(--heading-panel-transform);
    color: var(--heading-panel-color);
}

.filters-title {
    flex-shrink: 0;
}

.chart-card h3 {
    margin-bottom: 0.5rem;
}

.grupos-role-card-title {
    display: block;
    margin-bottom: 0.22rem;
}

.detail-monthly-filter-title {
    margin-bottom: 0;
}

.wizard-step-label {
    margin: 0 0 0.25rem;
}

.dashboard-section-sub {
    display: block;
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.dashboard-section-sub strong {
    color: var(--primary);
    font-weight: 600;
}

.dashboard-section--load {
    margin-bottom: 1.35rem;
}

.summary-charts-block {
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--surface-border-light);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dashboard-accordion.collapsed .dashboard-section-sub {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    html.dashboard-root {
        scroll-behavior: auto;
        transition: none !important;
    }

    body.dashboard-body,
    .dashboard-accordion-body,
    .dashboard-accordion-chevron,
    .filters-body-fold,
    .pub-dates-fold,
    .motion-root,
    .motion-root * {
        transition: none !important;
        animation: none !important;
    }
}

.dashboard-container {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 1.5rem;
}

:root {
    --app-chrome-header-height: 3.25rem;
    --dashboard-nav-height: 3.65rem;
}

.dashboard-nav--bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    margin: 0;
    padding: 0.4rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: rgba(5, 6, 13, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
}

.dashboard-nav-inner {
    display: flex;
    align-items: stretch;
    gap: 0.2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

.dashboard-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.38rem 0.35rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color 0.15s, background 0.15s;
}

.dashboard-nav-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
    text-align: center;
}

.dashboard-nav-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    opacity: 0.82;
}

.dashboard-nav-btn.active .dashboard-nav-icon {
    opacity: 1;
}

.dashboard-nav-btn:hover {
    color: var(--text-main);
    background: var(--surface-hover-strong);
}

.dashboard-nav-btn.active {
    color: var(--primary);
    background: var(--surface-hover-strong);
    box-shadow: inset 0 0 0 1px var(--surface-border-medium);
}

#load-section,
.dashboard-accordion[data-accordion-id] {
    scroll-margin-top: calc(var(--app-chrome-header-height) + 0.75rem);
    scroll-margin-bottom: calc(var(--dashboard-nav-height) + 1rem);
}

body.dashboard-body {
    padding-top: calc(var(--app-chrome-header-height) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--dashboard-nav-height) + 0.75rem + env(safe-area-inset-bottom, 0px));
}

body.dashboard-body.pwa-bar-visible {
    padding-bottom: calc(var(--dashboard-nav-height) + 3.75rem + env(safe-area-inset-bottom, 0px));
}

body.dashboard-body.pwa-bar-visible .dashboard-nav--bottom {
    bottom: calc(3.35rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 420px) {
    :root {
        --dashboard-nav-height: 4.15rem;
    }

    .dashboard-nav-text {
        display: block;
        font-size: calc(10px * var(--app-font-scale, 1));
        white-space: normal;
        line-height: 1.15;
        letter-spacing: 0;
    }

    .dashboard-nav-btn {
        padding: 0.28rem 0.1rem 0.22rem;
        gap: 0.1rem;
        min-height: 44px;
    }

    .dashboard-nav-icon {
        width: 1.2rem;
        height: 1.2rem;
    }
}

@media (min-width: 640px) {
    .dashboard-nav-text {
        font-size: 0.68rem;
    }

    .dashboard-nav-btn {
        gap: 0.28rem;
        padding: 0.42rem 0.5rem;
    }
}

@media (min-width: 900px) {
    .dashboard-nav-inner {
        gap: 0.35rem;
    }

    .dashboard-nav-btn {
        flex-direction: row;
        gap: 0.45rem;
        font-size: 0.72rem;
        padding: 0.5rem 0.75rem;
    }

    .dashboard-nav-text {
        white-space: nowrap;
    }
}

.app-footer {
    display: none;
}

.dashboard-app-header,
.dashboard-nav--bottom {
    align-self: stretch;
}

.dashboard-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 310;
    padding: calc(0.35rem + env(safe-area-inset-top, 0px)) 0.5rem 0.35rem;
    background: rgba(5, 6, 13, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.18);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.dashboard-app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    max-width: 1100px;
    margin: 0 auto;
    min-height: calc(var(--app-chrome-header-height) - 0.7rem);
}

.dashboard-app-header-brand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-app-header-mark {
    position: relative;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    overflow: hidden;
    border-radius: 50%;
}

.dashboard-app-header-logo {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.dashboard-app-header-logo--dark {
    display: block;
}

html[data-theme="light"] .dashboard-app-header-logo--dark {
    display: none;
}

html[data-theme="light"] .dashboard-app-header-logo--light {
    display: block;
}

.dashboard-app-header-titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.08rem;
    min-width: 0;
}

.dashboard-app-header-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.dashboard-app-header-section {
    font-size: var(--heading-section-size);
    font-weight: var(--heading-section-weight);
    letter-spacing: var(--heading-section-tracking);
    text-transform: var(--heading-section-transform);
    color: var(--heading-section-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

@media (min-width: 480px) {
    .dashboard-app-header-titles {
        flex-direction: row;
        align-items: baseline;
        flex-wrap: wrap;
        column-gap: 0.45rem;
        row-gap: 0.05rem;
    }

    .dashboard-app-header-section::before {
        content: '·';
        margin-right: 0.45rem;
        color: var(--text-muted);
        font-weight: 400;
        letter-spacing: 0;
        text-transform: none;
    }
}

.dashboard-app-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.dashboard-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--surface-border-light);
    border-radius: 10px;
    background: var(--surface-hover);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.dashboard-header-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.dashboard-header-btn:hover,
.dashboard-header-btn:focus-visible {
    color: var(--text-main);
    border-color: var(--card-border);
    background: var(--surface-hover-strong);
    outline: none;
}

.dashboard-header-btn[aria-pressed="true"] {
    color: var(--primary);
    border-color: rgba(0, 229, 255, 0.45);
    background: rgba(0, 229, 255, 0.1);
}

.dashboard-layout-icon.hidden {
    display: none;
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id][hidden] {
    display: none !important;
}

body.dashboard-layout-single .dashboard-accordion.dashboard-section--solo .dashboard-accordion-chevron {
    visibility: hidden;
}

body.dashboard-layout-single .dashboard-accordion.dashboard-section--solo .dashboard-accordion-trigger {
    cursor: default;
}

body.dashboard-layout-single .dashboard-stack {
    display: grid;
    grid-template-areas: "section";
    gap: 0;
    overflow: hidden;
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id] {
    grid-area: section;
    width: 100%;
    max-width: 100%;
    --motion-duration: var(--motion-view);
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root {
    opacity: 0;
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root.is-open,
body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root.is-closing {
    transition:
        opacity var(--motion-duration) var(--motion-ease),
        transform var(--motion-duration) var(--motion-ease);
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root[data-motion-from="right"]:not(.is-open) {
    transform: translateX(1.5rem);
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root[data-motion-from="left"]:not(.is-open) {
    transform: translateX(-1.5rem);
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root[data-motion-from="fade"]:not(.is-open) {
    transform: none;
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root.is-open:not(.is-closing) {
    opacity: 1;
    transform: none;
    z-index: 2;
}

body.dashboard-layout-single .dashboard-accordion[data-accordion-id].motion-root.is-closing {
    z-index: 1;
}

.theme-choice-btn.is-active {
    color: var(--primary);
    background: rgba(0, 229, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.35);
}

.theme-choice-group {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.theme-choice-group .theme-choice-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--surface-border-light);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.theme-choice-group .theme-choice-btn svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.theme-choice-group .theme-choice-btn.is-active {
    color: var(--primary);
    border-color: rgba(0, 229, 255, 0.45);
    background: rgba(0, 229, 255, 0.1);
}

@media (max-width: 420px) {
    .dashboard-app-header-title {
        font-size: 0.75rem;
    }

    .dashboard-app-header-section {
        font-size: calc(var(--heading-section-size) * 0.95);
    }

    .dashboard-app-header-mark,
    .dashboard-app-header-logo {
        width: 1.85rem;
        height: 1.85rem;
    }

    .dashboard-header-btn {
        width: 40px;
        height: 40px;
    }
}

.data-sources-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.55rem 0.65rem;
    background: var(--surface-elevated);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    text-align: left;
}

.data-sources-bar.hidden {
    display: none;
}

.data-sources-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.load-panel.has-sources {
    text-align: left;
}

.load-panel-intro.hidden {
    display: none;
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dashboard-header-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(56, 189, 248, 0.1);
}

.load-status {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    color: var(--text-main);
    margin-bottom: 0.65rem;
}

.load-status.warn {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.35);
}

.load-panel p strong {
    color: var(--primary);
    font-weight: 600;
}

.load-wizard {
    text-align: left;
}

.wizard-shell {
    display: grid;
    grid-template-areas: "pane";
}

.wizard-shell > .load-wizard,
.wizard-shell > .load-loaded {
    grid-area: pane;
}

.wizard-viewport {
    display: grid;
    grid-template-areas: "step";
    overflow: hidden;
}

.wizard-step {
    grid-area: step;
}

.wizard-step.hidden {
    display: none;
}

.wizard-step-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.85rem;
    color: var(--text-main);
}

.wizard-lead {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wizard-actions-wrap {
    margin: 0.75rem 0;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.wizard-field {
    margin-bottom: 0.75rem;
}

.wizard-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.wizard-field input,
.wizard-field select {
    width: 100%;
    max-width: 12rem;
}

.wizard-muted {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
}

.wizard-warn {
    font-size: 0.82rem;
    color: #f59e0b;
    margin: 0.35rem 0;
}

.wizard-ok {
    font-size: 0.82rem;
    color: var(--success);
    margin: 0.35rem 0;
}

.wizard-mobile-json-hint {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.08);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.wizard-mobile-json-hint code {
    font-size: 0.78rem;
    color: var(--accent-emerald, #34d399);
}

.wizard-json-paste-panel {
    margin-top: 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--surface-border-light);
    background: var(--surface-subtle);
}

.wizard-json-paste-panel summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
}

.wizard-json-paste-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.55rem 0;
}

.wizard-json-paste {
    width: 100%;
    min-height: 6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--surface-border-medium);
    background: rgba(5, 8, 18, 0.85);
    color: var(--text-main);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.35;
    resize: vertical;
}

.wizard-output-preview {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.wizard-output-preview code {
    font-size: 0.78rem;
    color: var(--primary);
}

.wizard-preview-list {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.wizard-preview-list li {
    margin-bottom: 0.25rem;
}

.wizard-folder-panel {
    margin-bottom: 0.5rem;
}

.wizard-options {
    margin-bottom: 0.5rem;
}

.wizard-switch {
    margin: 0.75rem 0;
}

.wizard-output-fields {
    margin-bottom: 0.5rem;
}

.wizard-run-box {
    text-align: center;
    padding: 1.5rem 1rem;
}

.wizard-run-box .spinner {
    margin: 0 auto 0.75rem;
}

.wizard-run-box p {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
}

.wizard-run-box p.warn {
    color: var(--error);
}

.wizard-json-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    max-height: 14rem;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

.wizard-json-list li {
    border-bottom: 1px solid var(--card-border);
}

.wizard-json-list li:last-child {
    border-bottom: none;
}

.wizard-json-list label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    font-size: 0.82rem;
}

.wizard-json-list label:hover {
    background: rgba(56, 189, 248, 0.06);
}

.wizard-json-year-pick {
    margin: 0.75rem 0;
    font-size: 0.82rem;
}

.wizard-year-block {
    margin-bottom: 0.5rem;
}

.wizard-year-block ul {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.load-loaded.hidden {
    display: none;
}

.load-panel {
    background: var(--surface-muted);
    border: 1px dashed var(--card-border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 0;
    transition: border-color 0.2s, background 0.2s;
}

.load-panel.drag-over {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.06);
}

.load-panel p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.65rem;
}

.load-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.perfil-aliases-hint {
    margin: 0;
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.local-cache-hint {
    margin: 0.15rem 0 0;
    font-size: 0.68rem;
    color: var(--accent-emerald, #34d399);
    line-height: 1.35;
}

.file-list {
    list-style: none;
    margin-top: 0.55rem;
    text-align: left;
}

.file-source-item {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 0.5rem 0.6rem;
    background: var(--surface-input);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.file-source-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-source-count {
    flex-shrink: 0;
    min-width: 3.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
}

.file-source-alias {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-main);
    background: var(--surface-pill);
    border: 1px solid var(--card-border);
    border-radius: 6px;
}

.file-source-alias:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.file-source-raw {
    font-size: 0.65rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 4.1rem;
}

@media (min-width: 720px) {
    .file-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .file-source-item {
        margin-bottom: 0;
    }
}

.kpi-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
}

.kpi-now-label {
    margin: 0 0 0.5rem;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-mode-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    margin: 0 auto 0.75rem;
    background: var(--surface-pill);
    border: 1px solid var(--card-border);
    border-radius: 999px;
}

.kpi-panel .kpi-mode-toggle {
    display: flex;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.kpi-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.42rem 1.1rem;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.kpi-mode-btn:hover {
    color: var(--text-main);
}

.kpi-mode-btn.active {
    background: var(--primary);
    color: var(--surface-active-text);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 4px 14px rgba(56, 189, 248, 0.25);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.6rem, 1fr));
    gap: 0.5rem;
}

@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.kpi-card {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    background: var(--surface-elevated);
    border: 1px solid var(--surface-border-faint);
    border-radius: 10px;
    padding: 0.55rem 0.45rem 0.55rem;
    text-align: center;
    min-height: 5.1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.12rem;
    width: 100%;
    color: inherit;
    cursor: pointer;
}

.kpi-card:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.kpi-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.kpi-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    line-height: 0;
}

.kpi-card-icon .metric-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.kpi-card--inactivos .kpi-card-icon {
    color: var(--text-muted);
}

.kpi-card--cursos .kpi-card-icon {
    color: var(--success);
}

.kpi-card--precursor_aux .kpi-card-icon {
    color: var(--person-anciano);
}

.kpi-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.kpi-value--split {
    font-size: 1.22rem;
}

.kpi-value-sep {
    font-weight: 500;
    opacity: 0.4;
    margin: 0 0.12em;
    font-size: 0.82em;
}

.kpi-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.2;
}

.kpi-hint {
    font-size: 0.62rem;
    color: rgba(143, 163, 191, 0.85);
    letter-spacing: 0.03em;
}

.datos-modal-card.kpi-detail-card {
    width: min(100%, 32rem);
    max-height: min(90vh, 40rem);
    display: flex;
    flex-direction: column;
}

.datos-modal-card.kpi-detail-card .datos-modal-title,
.datos-modal-card.kpi-detail-card .kpi-detail-lead,
.datos-modal-card.kpi-detail-card .kpi-detail-filters,
.datos-modal-card.kpi-detail-card .datos-modal-actions {
    flex-shrink: 0;
}

.kpi-detail-note {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.kpi-detail-section {
    margin: 0 0 0.85rem;
}

.kpi-detail-section-title {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.kpi-detail-section-hint {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.kpi-detail-cursos-toggle {
    display: flex;
    width: 100%;
    margin: 0 0 0.65rem;
}

.kpi-detail-cursos-toggle .totals-view-btn {
    flex: 1;
    min-height: 44px;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.kpi-detail-filters-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.kpi-detail-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.kpi-detail-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.kpi-detail-filter-field-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.kpi-detail-filter-field select {
    width: 100%;
    min-height: 44px;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
}

.kpi-detail-filter-field select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.kpi-detail-body {
    min-height: 0;
    overflow: auto;
    margin: 0 -0.15rem;
    padding: 0 0.15rem;
}

.kpi-detail-empty {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.kpi-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.kpi-detail-table th,
.kpi-detail-table td {
    padding: 0.45rem 0.4rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-border-subtle);
    vertical-align: top;
    white-space: normal;
}

.kpi-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-input);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-detail-table tbody tr:nth-child(even) td {
    background: var(--surface-muted);
}

.kpi-detail-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.kpi-detail-table .person-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.kpi-detail-table .person-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.kpi-detail-yes {
    color: var(--success);
    font-weight: 600;
}

.kpi-detail-no {
    color: var(--text-muted);
}

.kpi-detail-why {
    max-width: 16rem;
}

.kpi-detail-why-acc {
    margin: 0;
}

.kpi-detail-why-summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    cursor: pointer;
    list-style: none;
}

.kpi-detail-why-summary::-webkit-details-marker,
.kpi-detail-why-summary::marker {
    display: none;
    content: '';
}

.kpi-detail-why-short {
    min-width: 0;
    line-height: 1.25;
}

.kpi-detail-why-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--surface-pill);
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    transition: transform var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}

.kpi-detail-why-acc[open] .kpi-detail-why-plus {
    transform: rotate(45deg);
    color: var(--text-main);
}

.kpi-detail-why-full {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.metric-icon {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
}

.th-label,
.metric-head {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.28rem;
}

.th-label {
    justify-content: flex-start;
}

.th-label .metric-icon,
.metric-head .metric-icon {
    color: var(--primary);
    opacity: 0.9;
}

.person-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
}

.person-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-icon {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
    overflow: visible;
    color: var(--person-publicador);
}

.person-icon .person-bust {
    fill: currentColor;
    stroke: none;
}

.person-icon .person-mark {
    fill: currentColor;
    stroke: none;
}

.person-icon.person-icon--publicador { color: var(--person-publicador); }
.person-icon.person-icon--siervo { color: var(--person-siervo); }
.person-icon.person-icon--anciano { color: var(--person-anciano); }

.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.toolbar-field {
    flex: 1 1 140px;
    min-width: 120px;
}

.toolbar-field label {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.toolbar-field select {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
}

.toolbar-field select option {
    background-color: var(--surface-input);
    color: var(--text-main);
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

.totals-view-field {
    flex: 0 1 auto;
    min-width: 9.5rem;
}

.toolbar-field-label {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.totals-view-toggle {
    display: inline-flex;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-pill);
}

.totals-view-btn {
    padding: 0.48rem 0.7rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.totals-view-btn + .totals-view-btn {
    border-left: 1px solid var(--card-border);
}

.totals-view-btn.active {
    color: var(--surface-active-text, #041018);
    background: var(--primary);
}

.totals-view-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.totals-controls {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.totals-controls .totals-toolbar-row {
    margin-bottom: 0;
}

.totals-section-head {
    position: relative;
    z-index: 8;
    overflow: visible;
}

.totals-section-head-top {
    position: relative;
    display: flex;
    align-items: center;
}

.totals-section-head-top .dashboard-accordion-trigger {
    flex: 1;
    min-width: 0;
    justify-content: space-between;
}

.totals-section-head .dashboard-section-sub {
    display: block;
    padding: 0 1.15rem 0.75rem;
    margin-top: 0;
}

.dashboard-accordion.collapsed .totals-section-head .dashboard-section-sub {
    display: none;
}

.dashboard-accordion:not(.collapsed) .totals-section-head {
    border-bottom: 1px solid var(--surface-border-light);
}

.dashboard-accordion:not(.collapsed) .totals-section-head .dashboard-accordion-trigger {
    border-bottom: none;
}

.totals-section-head-top .totals-header-export {
    position: absolute;
    right: calc(1.15rem + 1.65rem + 0.55rem);
    top: 0;
    bottom: 0;
    transform: none;
    z-index: 3;
    margin-left: 0;
    display: flex;
    align-items: center;
}

.totals-header-export .export-menu-toggle {
    min-height: 2.15rem;
    padding: 0.32rem 0.65rem;
    font-size: 0.8rem;
}

.totals-header-export .export-menu-list {
    right: 0;
    left: auto;
}

body.dashboard-layout-single .dashboard-accordion.dashboard-section--solo .totals-header-export {
    right: 1.15rem;
}

.totals-workspace {
    display: block;
    position: relative;
    width: 100%;
}

.totals-workspace-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    position: relative;
    z-index: 1;
}

.totals-dock {
    position: relative;
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
}

.totals-dock--floating {
    position: fixed;
    top: calc(var(--app-chrome-header-height) + env(safe-area-inset-top, 0px) + 0.55rem);
    right: max(0.45rem, env(safe-area-inset-right, 0px), calc((100vw - 1100px) / 2 + 0.45rem));
    z-index: 280;
    max-height: calc(100dvh - var(--app-chrome-header-height) - var(--dashboard-nav-height) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.1rem);
    pointer-events: none;
}

.totals-dock--floating .totals-dock-rail,
.totals-dock--floating .totals-dock-peek,
.totals-dock--floating .totals-dock-panel {
    pointer-events: auto;
}

.totals-dock:has(.totals-dock-panel.is-open) {
    z-index: 16;
}

.totals-dock--floating:has(.totals-dock-panel.is-open) {
    z-index: 280;
}

.totals-dock-peek {
    display: none;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    min-height: 44px;
    margin: 0.15rem 0;
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--surface-elevated);
    color: var(--text-muted);
    cursor: pointer;
}

.totals-dock.is-collapsed .totals-dock-peek {
    display: inline-flex;
}

.totals-dock.is-collapsed .totals-dock-rail,
.totals-dock.is-collapsed .totals-dock-panel {
    display: none;
}

.totals-dock-peek svg,
.totals-dock-btn svg,
.totals-dock-collapse svg {
    width: 1.15rem;
    height: 1.15rem;
}

.totals-dock-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.08rem;
    width: auto;
    padding: 0.18rem 0.08rem 0.22rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--surface-elevated);
    box-shadow: var(--shadow, 0 8px 24px rgba(0, 0, 0, 0.22));
}

.totals-dock-btn,
.totals-dock-collapse {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
}

.totals-dock-btn:hover,
.totals-dock-collapse:hover,
.totals-dock-peek:hover {
    color: var(--text-main);
    background: var(--surface-hover);
}

.totals-dock-btn.is-open,
.totals-dock-btn.has-value,
.totals-dock-btn.active {
    color: var(--primary);
    background: var(--surface-hover-strong, var(--surface-hover));
}

.totals-dock--left {
    right: auto;
    left: max(0.45rem, env(safe-area-inset-left, 0px), calc((100vw - 1100px) / 2 + 0.45rem));
}

.totals-dock--left .totals-dock-panel {
    left: calc(100% + 0.3rem);
    right: auto;
}

.totals-dock--left .totals-dock-btn.is-open::before,
.totals-dock--left .totals-dock-btn.active::before {
    left: 0.1rem;
    right: auto;
}

.totals-dock--left .totals-dock-btn[data-tip]::after {
    left: calc(100% + 0.4rem);
    right: auto;
}

.totals-dock--left .totals-dock-btn.active::before {
    content: '';
    position: absolute;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 3px;
    border-radius: 99px;
    background: var(--primary);
}

.totals-dock-panel--wide {
    width: min(22.5rem, calc(100vw - 4.25rem));
}

.totals-dock-panel--wide .filters-panel {
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.totals-dock-panel--wide .filters-panel-detail .filters-toggle {
    display: none;
}

.totals-dock-panel--wide .filters-bar {
    padding: 0;
    min-height: 0;
}

.totals-dock-panel--wide .filters-bar-actions {
    width: 100%;
    justify-content: space-between;
}

.totals-dock-panel--wide .filters-panel.collapsed .filters-body-fold {
    grid-template-rows: 1fr;
}

.totals-dock-panel--wide .publisher-bulk-grupo-select {
    width: 100%;
}

.totals-dock-panel--wide .totals-dock-panel-card {
    max-height: min(72vh, 36rem);
    display: flex;
    flex-direction: column;
}

.totals-dock-panel--wide .totals-dock-panel-body {
    overflow-y: auto;
    max-height: min(64vh, 32rem);
}

.person-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
}

.person-name:has(.person-name-main--bits) {
    align-items: flex-start;
}

.person-name-main {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 1.55rem;
    padding: 0.05rem 0 0.12rem;
    line-height: 1.15;
}

.person-name-main--bits {
    min-height: 0;
    padding-bottom: 0;
    justify-content: flex-start;
}

.person-name-text {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-sparkline {
    position: absolute;
    left: 0;
    right: auto;
    top: 0.05rem;
    bottom: 0;
    display: block;
    width: var(--person-spark-width);
    min-width: var(--person-spark-width);
    max-width: var(--person-spark-width);
    height: auto;
    flex: none;
    color: var(--primary);
    opacity: 0.78;
    pointer-events: none;
    z-index: 0;
}

.person-sparkline--below {
    position: static;
    inset: auto;
    height: 0.78rem;
    min-height: 0.78rem;
    opacity: 0.95;
    margin-top: 0.12rem;
    z-index: 1;
}

.person-sparkline--below .person-sparkline-svg {
    height: 0.78rem;
}

.person-sparkline-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.person-sparkline-area {
    fill: currentColor;
    opacity: 0.28;
}

.person-sparkline-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.person-sparkline-bit.is-on {
    fill: var(--success);
    opacity: 0.95;
}

.person-sparkline-bit.is-off {
    fill: var(--text-muted);
    opacity: 0.35;
}

html[data-theme="light"] .person-sparkline {
    color: #0369a1;
    opacity: 0.7;
}

html[data-theme="light"] .person-sparkline--below {
    opacity: 0.92;
}

.data-table .pub-cell-name,
.kpi-detail-table td:has(.person-sparkline) {
    white-space: normal;
    overflow: visible;
}

.status-chart {
    width: 100%;
    min-height: 140px;
    display: flex;
    align-items: center;
}

.status-chart-track {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.28rem;
    width: 100%;
    padding: 0.35rem 0.15rem;
}

.status-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-height: 4.4rem;
    padding: 0.35rem 0.1rem 0.3rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-muted);
}

.status-cell.is-on {
    background: rgba(0, 255, 157, 0.14);
    background: color-mix(in srgb, var(--success) 16%, var(--surface-elevated));
    border-color: color-mix(in srgb, var(--success) 45%, var(--card-border));
}

.status-cell.is-off {
    background: rgba(255, 77, 109, 0.1);
    background: color-mix(in srgb, var(--error) 10%, var(--surface-elevated));
    border-color: color-mix(in srgb, var(--error) 28%, var(--card-border));
}

.status-cell.is-focus {
    outline: 2px solid var(--warning);
    outline-offset: 1px;
}

.status-mark {
    display: inline-flex;
    width: 1.15rem;
    height: 1.15rem;
    color: var(--text-muted);
}

.status-cell.is-on .status-mark {
    color: var(--success);
}

.status-cell.is-off .status-mark {
    color: var(--error);
    opacity: 0.85;
}

.status-mark svg {
    width: 100%;
    height: 100%;
}

.status-month {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .status-chart {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .status-chart-track {
        min-width: 34rem;
    }
}

body:not(.tools-dock-hidden) .grupos-toolbar,
body:not(.tools-dock-hidden) .grupos-tabs {
    display: none;
}

.publisher-chart-wrap:has(.status-chart) #publisher-detail-chart {
    display: none;
}

.totals-dock-btn.is-open::before {
    content: '';
    position: absolute;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 3px;
    border-radius: 99px;
    background: var(--primary);
    right: 0.1rem;
}

.totals-dock-collapse {
    margin-top: auto;
}

.totals-dock-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: calc(100% + 0.4rem);
    left: auto;
    padding: 0.22rem 0.45rem;
    border-radius: 6px;
    background: var(--surface-overlay, var(--surface-elevated));
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 20;
    box-shadow: var(--shadow, 0 8px 20px rgba(0, 0, 0, 0.2));
    transition: opacity var(--motion-fast) var(--motion-ease), visibility var(--motion-fast) var(--motion-ease);
}

.totals-dock-btn[data-tip]:hover::after,
.totals-dock-btn[data-tip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.totals-dock-btn.is-open[data-tip]::after {
    display: none;
}

.totals-dock-panel {
    position: absolute;
    top: 0;
    z-index: 12;
    width: min(14.25rem, calc(100vw - 6.5rem));
    opacity: 1;
    right: calc(100% + 0.3rem);
    left: auto;
}

.totals-dock-panel .motion-card {
    opacity: 1;
    transform: none;
}

.totals-dock-panel-card {
    position: relative;
    background: var(--section-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--shadow, 0 12px 32px rgba(0, 0, 0, 0.28));
    overflow: visible;
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.totals-dock-panel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-color);
    opacity: 0.78;
    pointer-events: none;
    z-index: 0;
}

html[data-theme="light"] .totals-dock-panel-card::before {
    opacity: 0;
}

.totals-dock-panel-head,
.totals-dock-panel-body {
    position: relative;
    z-index: 1;
}

.totals-dock-panel-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.45rem 0.42rem 0.7rem;
    border-bottom: 1px solid var(--card-border);
}

.totals-dock-panel-head strong {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-main);
}

.totals-dock-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.totals-dock-panel-close:hover {
    color: var(--text-main);
    background: var(--surface-hover);
}

.totals-dock-panel-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem 0.65rem;
}

.totals-dock-panel-body .toolbar-field {
    width: 100%;
    min-width: 0;
    flex: none;
}

.totals-dock-panel-body .toolbar-field-label {
    margin-bottom: -0.2rem;
}

.totals-dock-panel-body select {
    position: relative;
    z-index: 2;
}

.totals-check-list,
.spark-metric-list {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.spark-metric-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    margin: 0;
    padding: 0.38rem 0.45rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
    min-height: 2.45rem;
}

.spark-metric-option svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
}

.spark-metric-option:hover {
    background: var(--surface-hover);
}

.spark-metric-option.is-open,
.spark-metric-option.active {
    color: var(--primary);
    background: var(--surface-hover-strong, var(--surface-hover));
}

.totals-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    min-height: 1.6rem;
}

.totals-check input {
    width: 0.7rem;
    height: 0.7rem;
    min-width: 0.7rem;
    min-height: 0.7rem;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.totals-dock-panel[data-motion-from="right"]:not(.is-open),
.totals-dock-panel:not(.is-open) {
    opacity: 1;
    transform: translateX(0.45rem);
}

.totals-dock-panel.is-open,
.totals-dock-panel.is-closing {
    transition: transform var(--motion-panel) var(--motion-ease);
}

.totals-dock-panel.is-open {
    opacity: 1;
    transform: none;
}

.totals-toolbar-row--group,
.totals-toolbar-row--time {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    align-items: end;
}

.totals-toolbar-row--group .toolbar-field,
.totals-toolbar-row--time .toolbar-field {
    flex: none;
    min-width: 0;
}

.totals-controls .toolbar-field label,
.totals-controls .toolbar-field-label {
    font-size: 0.66rem;
    margin-bottom: 0.16rem;
}

.totals-controls .toolbar-field select {
    padding: 0.32rem 0.4rem;
    font-size: 0.8rem;
}

.totals-toolbar-row--profiles {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.4rem;
    padding: 0.1rem 0 0;
    background: transparent;
    border: none;
}

.totals-toolbar-row--profiles .toolbar-field-label {
    margin-bottom: 0;
    margin-right: 0.15rem;
}

.totals-chart-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem 0.75rem;
}

.totals-chart-heading .totals-metric-field {
    flex: 1 1 12rem;
    min-width: 0;
    max-width: 18rem;
}

.totals-chart-heading .totals-metric-field label {
    font-size: 0.66rem;
    margin-bottom: 0.16rem;
}

.totals-chart-heading .totals-metric-field select {
    padding: 0.32rem 0.4rem;
    font-size: 0.8rem;
}

.totals-chart-heading .totals-footer-toggles {
    margin-top: 0;
    margin-left: auto;
    flex: 0 0 auto;
    width: auto;
    flex-wrap: nowrap;
}

.totals-chart-heading .totals-floats {
    justify-content: flex-end;
    width: auto;
    flex: 0 0 auto;
}

.totals-chart-heading .totals-float--grafico .totals-float-panel {
    left: auto;
    right: 0;
}

.totals-footer-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.4rem 0.65rem;
    margin-top: 0.15rem;
}

.totals-floats {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 0.45rem;
    margin-bottom: 0;
}

.totals-float {
    position: relative;
    z-index: 6;
}

.totals-float-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.04rem;
    min-width: 7.25rem;
    padding: 0.32rem 0.9rem 0.34rem 0.8rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--surface-elevated);
    color: var(--text-main);
    font-family: inherit;
    cursor: pointer;
    line-height: 1.15;
    transition: background var(--motion-fast, 150ms), border-color var(--motion-fast, 150ms);
}

.totals-float--grafico .totals-float-btn {
    align-items: flex-start;
    text-align: left;
}

.totals-float-btn:hover,
.totals-float.is-open .totals-float-btn {
    border-color: var(--primary);
    background: var(--surface-hover, var(--surface-elevated));
}

.totals-float-kicker {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.totals-float-value {
    font-size: 0.88rem;
    font-weight: 700;
}

.totals-float-panel {
    position: absolute;
    top: calc(100% + 0.3rem);
    left: 0;
    min-width: 13.5rem;
    padding: 0.4rem;
    background: var(--surface-elevated);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity var(--motion-fast, 150ms) var(--motion-ease, ease),
        transform var(--motion-fast, 150ms) var(--motion-ease, ease),
        visibility var(--motion-fast, 150ms);
}

.totals-float-panel--end {
    left: auto;
    right: 0;
}

.totals-float.is-open .totals-float-panel {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.totals-view-toggle--compact {
    display: flex;
    width: 100%;
}

.totals-view-toggle--compact .totals-view-btn {
    flex: 1 1 0;
    padding: 0.32rem 0.4rem;
    font-size: 0.72rem;
}

.totals-float-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.4rem;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.totals-float-metric select {
    width: 100%;
    padding: 0.32rem 0.4rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

#totals-table-block {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.totals-charts-block.summary-charts-block {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.totals-charts-block--metric-only .chart-grid {
    display: none;
}

.totals-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.totals-body--report .totals-charts-block {
    order: 1;
}

.totals-body--report .totals-charts-block .charts-toolbar {
    margin-bottom: 0.35rem;
}

.totals-body--report #chart-bar-card h3 {
    font-size: var(--heading-panel-size, 0.82rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.totals-body--report #totals-table-block {
    order: 2;
}

.totals-body--report .totals-table-wrap {
    order: 2;
}

.totals-body--report .totals-matrix-summary {
    order: 3;
}

.totals-body--report .totals-chart-heading {
    order: 0;
}

.totals-dimension-toggle-wrap {
    display: flex;
    justify-content: flex-start;
}

.totals-dimension-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-pill);
    max-width: 100%;
}

.totals-dimension-btn {
    padding: 0.22rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    cursor: pointer;
    transition: background var(--motion-fast, 150ms), color var(--motion-fast, 150ms);
    white-space: nowrap;
}

.totals-dimension-btn + .totals-dimension-btn {
    border-left: 1px solid var(--card-border);
}

.totals-dimension-btn.active {
    color: var(--surface-active-text, #041018);
    background: var(--primary);
}

.totals-dimension-swap {
    display: flex;
    align-items: center;
    padding: 0 0.15rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0.7;
}

.totals-matrix-summary {
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
}

.totals-matrix-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.totals-matrix-summary-label {
    font-weight: 700;
    color: var(--text-main);
}

.totals-matrix-summary-value {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.totals-body--report .totals-table--matrix .totals-matrix-col-head,
.totals-body--report .totals-table--matrix .totals-matrix-row-head {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.totals-body--report .totals-table--matrix .totals-matrix-corner {
    color: var(--text-muted);
}

.totals-body--report .totals-table--matrix tbody td.num {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-variant-numeric: tabular-nums;
}

.totals-body--report .totals-table--matrix .totals-matrix-cell--empty {
    color: var(--text-muted);
    font-weight: 500;
}

.totals-body--report .totals-table--matrix tfoot {
    display: none;
}

.totals-table--matrix .totals-matrix-corner {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.totals-table--matrix .totals-matrix-row-head {
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    background: var(--surface-muted);
}

.totals-table--matrix .totals-matrix-col-head {
    text-align: center;
    font-size: 0.78rem;
    white-space: nowrap;
}

.totals-table--matrix tbody td.num.drillable {
    text-align: center;
    font-weight: 600;
}

.totals-table--matrix {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.totals-table--matrix tfoot td,
.totals-table--matrix tfoot th {
    font-weight: 700;
    background: rgba(56, 189, 248, 0.08);
    border-top: 1px solid rgba(56, 189, 248, 0.22);
}

.totals-table--matrix tfoot td {
    text-align: center;
}

.filters-panel {
    background: var(--surface-muted);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
}

.filters-panel-detail {
    margin-bottom: 0.65rem;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem 0.3rem;
}

.filters-panel-detail .filters-toggle {
    flex: 1 1 12rem;
    min-width: 0;
    width: auto;
    padding: 0.12rem 0;
    min-height: 0;
}

.filters-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.filter-mode-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: var(--surface-pill);
    border: 1px solid var(--card-border);
    border-radius: 999px;
}

.filter-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.28rem 0.58rem;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    cursor: pointer;
}

.filter-mode-btn.active {
    background: var(--primary);
    color: var(--surface-active-text);
}

.filters-panel-detail .filters-body {
    padding: 0 0.65rem 0.65rem;
}

.filters-panel .filters-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    cursor: pointer;
    min-width: 0;
}

.filters-panel.filters-panel-detail .filters-toggle {
    flex: 1 1 12rem;
    width: auto;
    min-height: 0;
    padding: 0.12rem 0;
    gap: 0.4rem;
}

.filters-toggle-main {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.filters-summary {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}

.filters-panel:not(.collapsed) .filters-summary {
    opacity: 0.65;
}

.filters-panel.collapsed .filters-summary {
    opacity: 1;
    color: var(--text-main);
}

.filters-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.filters-body-fold {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
}

.filters-body-fold.is-folding {
    transition: grid-template-rows var(--motion-panel) var(--motion-ease);
}

.filters-panel.collapsed .filters-body-fold {
    grid-template-rows: 0fr;
}

.filters-body {
    padding: 0 0.75rem 0.75rem;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.filters-panel-detail,
.filters-body,
.filters-compact,
.filters-stack,
.filters-row {
    min-width: 0;
    max-width: 100%;
}

.filters-compact,
.filters-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.totals-dock-panel .filters-stack .filter-group,
.totals-dock-panel .filters-compact .filter-group {
    width: 100%;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    width: 100%;
}

.filters-row--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filters-row .filter-group {
    min-width: 0;
    width: 100%;
}

.filter-label-short {
    display: none;
}

.filter-group-label {
    flex: 1 1 auto;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.filter-group-summary {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.42rem 0.55rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    min-width: 0;
}

.filter-group-count {
    flex-shrink: 0;
}

.filter-group-summary::after {
    content: '▾';
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

@media (max-width: 768px) {
    .filters-panel-detail .filters-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.2rem 0.4rem;
        padding: 0.28rem 0.45rem 0.18rem;
    }

    .filters-panel.filters-panel-detail .filters-toggle {
        flex: 1 1 auto;
        width: auto;
        min-height: 0;
        padding: 0.08rem 0;
        gap: 0.35rem;
    }

    .filters-panel-detail .filters-bar-actions {
        width: auto;
        flex: 1 1 auto;
        justify-content: flex-end;
        min-width: 0;
    }

    .filters-panel-detail .filters-body,
    .filters-panel-detail .filters-body-fold + .filters-body,
    .filters-panel-detail .filters-body-fold .filters-body {
        padding: 0 0.45rem 0.4rem;
    }

    .filters-row {
        gap: 0.28rem;
    }

    .filters-row--triple {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-label-full {
        display: none;
    }

    .filter-label-short {
        display: inline;
    }

    .filter-group-summary {
        padding: 0.38rem 0.4rem;
        gap: 0.2rem;
    }

    .filter-group-label {
        font-size: 0.58rem;
        letter-spacing: 0.01em;
    }

    .filter-group-count {
        font-size: 0.55rem;
        padding: 0.05rem 0.28rem;
    }

    .filter-group-chips {
        padding: 0 0.38rem 0.38rem;
    }

    .filter-chip {
        font-size: 0.68rem;
        padding: 0.2rem 0.32rem;
        max-width: 100%;
    }

    .filter-mode-btn {
        padding: 0.2rem 0.45rem;
    }
}

@media (max-width: 400px) {
    .filter-group-label {
        font-size: 0.52rem;
    }

    .filter-mode-btn {
        padding: 0.28rem 0.42rem;
        font-size: 0.58rem;
    }
}

.filter-group {
    border: 1px solid var(--surface-border-subtle);
    border-radius: 8px;
    background: var(--surface-subtle);
    overflow: hidden;
}

.filter-group-summary::-webkit-details-marker {
    display: none;
}

.filter-group[open] .filter-group-summary::after {
    transform: rotate(180deg);
}

.filter-group-count {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 999px;
    padding: 0.08rem 0.4rem;
    flex-shrink: 0;
}

.filter-group-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    padding: 0 0.5rem 0.5rem;
}

.filter-group-empty {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.filters-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.35rem;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(143, 163, 191, 0.35) transparent;
}

.filters-grid::-webkit-scrollbar {
    height: 4px;
}

.filters-grid::-webkit-scrollbar-thumb {
    background: rgba(143, 163, 191, 0.35);
    border-radius: 4px;
}

.filter-card {
    flex: 1 1 0;
    min-width: 6.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 0.4rem 0.42rem 0.45rem;
    background: var(--surface-elevated);
    border: 1px solid var(--surface-border-subtle);
    border-radius: 8px;
}

.filter-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.25;
    min-width: 0;
    hyphens: auto;
}

.filter-chips {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
    flex: 1;
}

.filter-chips-scroll {
    max-height: 4.8rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(143, 163, 191, 0.35) transparent;
}

.filter-chips-scroll::-webkit-scrollbar {
    width: 4px;
}

.filter-chips-scroll::-webkit-scrollbar-thumb {
    background: rgba(143, 163, 191, 0.35);
    border-radius: 4px;
}

.filter-chip {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.24rem 0.42rem;
    border-radius: 6px;
    border: 1px solid var(--surface-border-light);
    background: var(--surface-hover);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    text-align: left;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    flex-shrink: 0;
}

.filter-chip:hover {
    background: var(--surface-hover-strong);
    color: var(--text-main);
}

.filter-chip.on {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--primary);
    font-weight: 500;
}

.filter-chip-exclude.on {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fca5a5;
}

.charts-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    height: auto;
    min-height: 0;
    margin-bottom: 0.55rem;
    padding: 0.5rem 0.55rem;
    background: var(--section-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

.charts-toolbar > * {
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
}

.charts-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.charts-toolbar-row--metric label {
    flex: 0 0 auto;
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.charts-toolbar-row--metric select {
    flex: 1 1 9rem;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
}

.charts-toolbar-row--exclude {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.05rem;
    scrollbar-width: thin;
}

.chart-exclude-toggle {
    flex-shrink: 0;
}

.charts-toolbar-row--profiles {
    padding-top: 0.35rem;
    border-top: 1px solid var(--surface-border-faint);
}

.charts-toolbar-row--profiles.hidden {
    display: none !important;
}

.charts-exclude-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.chart-exclude-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    background: var(--surface-pill);
    border: 1px solid var(--card-border);
    border-radius: 999px;
}

.chart-exclude-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    min-width: 1.65rem;
    padding: 0.28rem 0.38rem;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1;
}

.chart-exclude-btn:hover {
    color: var(--text-main);
}

.chart-exclude-btn.active {
    background: var(--primary);
    color: var(--surface-active-text);
}

.chart-profile-toggles-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

.chart-profile-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.35rem;
    align-items: center;
}

.chart-profile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
    font-size: 0.64rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    line-height: 1.15;
    min-height: 0;
    padding: 0.04rem 0.08rem;
}

.chart-profile-toggle:hover {
    color: var(--text-main);
}

.chart-profile-toggle input {
    width: 0.58rem;
    height: 0.58rem;
    min-width: 0.58rem;
    min-height: 0.58rem;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.chart-profile-toggle.is-inactivo {
    opacity: 0.75;
}

.chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
    margin-bottom: 0;
    width: 100%;
    min-width: 0;
}

.summary-charts-block {
    width: 100%;
    min-width: 0;
}

.chart-grid.single-chart {
    grid-template-columns: minmax(0, 1fr);
}

.chart-card {
    background: var(--section-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.75rem;
    min-height: 260px;
    min-width: 0;
    max-width: 100%;
}

.chart-scroll-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.35) transparent;
}

.chart-scroll-wrap::-webkit-scrollbar {
    height: 6px;
}

.chart-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.28);
    border-radius: 999px;
}

.chart-wrap {
    position: relative;
    height: 210px;
    min-width: 100%;
    width: 100%;
    box-sizing: border-box;
    cursor: default;
}

.chart-scroll-wrap--vertical {
    overflow-x: hidden;
    overflow-y: auto;
}

.chart-wrap canvas {
    cursor: pointer;
}

.chart-card h3 .chart-title-note {
    font-size: 0.62rem;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    opacity: 0.72;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 0.5rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.data-table th {
    background: var(--surface-input);
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    padding-right: 1.25rem;
    position: sticky;
}

.data-table th.sortable:hover {
    color: var(--text-main);
    background: var(--surface-input-hover);
}

.data-table th .sort-icon {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    opacity: 0.35;
}

.data-table th.sortable.sort-asc .sort-icon,
.data-table th.sortable.sort-desc .sort-icon {
    opacity: 1;
    color: var(--primary);
}

.data-table th.sortable.sort-asc .sort-icon::after {
    content: '▲';
}

.data-table th.sortable.sort-desc .sort-icon::after {
    content: '▼';
}

.data-table th.sortable:not(.sort-asc):not(.sort-desc) .sort-icon::after {
    content: '⇅';
}

.data-table tbody tr:hover {
    background: var(--surface-hover);
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .num.drillable {
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

.data-table .num.drillable:hover {
    color: var(--accent, #38bdf8);
    background: rgba(56, 189, 248, 0.08);
}

.detail-monthly-filter {
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.detail-monthly-filter.hidden {
    display: none;
}

.detail-monthly-filter-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.detail-monthly-filter-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6ee7b7;
}

.detail-monthly-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.detail-monthly-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-monthly-chip-source {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.45);
    color: #7dd3fc;
}

.detail-monthly-chip-context {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

.detail-monthly-chip-mes {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.detail-monthly-chip-scope {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
}

.detail-monthly-chip-metric {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.45);
    color: #fcd34d;
}

.detail-cross-filter.hidden {
    display: none;
}

.data-table tfoot td {
    font-weight: 600;
    background: rgba(56, 189, 248, 0.08);
    border-top: 2px solid var(--card-border);
}

.publisher-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

.publisher-section-sub {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.publisher-section-head {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 4;
    overflow: visible;
}

.publisher-section .dashboard-accordion-trigger {
    padding-bottom: 0.35rem;
}

.publisher-section-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0 1.15rem 0.85rem;
}

.publisher-section-meta .export-menu {
    margin-left: 0;
}

.publisher-section-meta .export-menu-list {
    left: 0;
    right: auto;
}

.publisher-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 0.75rem;
    line-height: 1.2;
    font-size: 0.72rem;
}

.dashboard-accordion:not(.collapsed) .publisher-section-head {
    border-bottom: 1px solid var(--surface-border-light);
}

.dashboard-accordion:not(.collapsed) .publisher-section .dashboard-accordion-trigger {
    border-bottom: none;
}

.publisher-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.65rem;
}

.publisher-bulk-grupo-select {
    min-width: 9.5rem;
    padding: 0.38rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.78rem;
}

.publisher-search {
    flex: 1 1 180px;
    min-width: 0;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
}

.publisher-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
    min-width: 0;
}

.publisher-list-wrap {
    max-height: min(42vh, 360px);
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    margin-bottom: 0;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--surface-muted);
    scrollbar-width: thin;
    scrollbar-color: rgba(143, 163, 191, 0.5) var(--surface-subtle);
}

.publisher-list-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.publisher-list-wrap::-webkit-scrollbar-track {
    background: var(--surface-subtle);
    border-radius: 8px;
}

.publisher-list-wrap::-webkit-scrollbar-thumb {
    background: rgba(143, 163, 191, 0.5);
    border-radius: 999px;
    border: 2px solid var(--surface-subtle);
}

.publisher-list-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(143, 163, 191, 0.72);
}

.publisher-list-table {
    margin: 0;
}

.publisher-list-table td:nth-child(1) {
    max-width: 11rem;
}

.publisher-list-table .pub-cell-name .person-name {
    width: 100%;
}

.publisher-list-table .pub-cell-name .person-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.publisher-list-table td:nth-child(2) {
    max-width: 8rem;
}

.publisher-list-table td:nth-child(3) {
    max-width: 5.5rem;
    font-size: 0.76rem;
}

.publisher-list-table td:nth-child(4),
.publisher-list-table td:nth-child(5) {
    max-width: 6rem;
    font-size: 0.76rem;
}

.publisher-list-table tbody tr.publisher-row {
    cursor: default;
}

.publisher-list-table tbody tr:not(.publisher-row):not(.publisher-row-dates) {
    cursor: pointer;
}

.publisher-list-table tbody tr.selected {
    background: rgba(56, 189, 248, 0.12);
}

.publisher-list-table tbody tr.selected td:first-child {
    color: var(--primary);
    font-weight: 500;
}

.publisher-list-table tbody tr.selected .person-icon.person-icon--publicador { color: var(--person-publicador); }
.publisher-list-table tbody tr.selected .person-icon.person-icon--siervo { color: var(--person-siervo); }
.publisher-list-table tbody tr.selected .person-icon.person-icon--anciano { color: var(--person-anciano); }

.publisher-list-table td {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publisher-detail {
    min-width: 0;
    background: var(--surface-elevated);
    border: 1px solid var(--surface-border-subtle);
    border-radius: 8px;
    padding: 0.65rem;
}

.publisher-detail-back-wrap {
    margin-bottom: 0.55rem;
}

.publisher-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.publisher-back-btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.publisher-back-btn:hover,
.publisher-back-btn:focus-visible {
    color: var(--primary);
    outline: none;
}

.publisher-monthly-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: stretch;
    min-width: 0;
}

.publisher-chart-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
}

.publisher-metric-toggle {
    display: none;
    gap: 2px;
    padding: 2px;
    background: var(--surface-pill);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    align-self: flex-start;
}

.publisher-metric-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.32rem 0.45rem;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    cursor: pointer;
    transition: color var(--motion-fast) var(--motion-ease);
}

.publisher-metric-btn .metric-icon {
    width: 0.85rem;
    height: 0.85rem;
    color: currentColor;
}

.publisher-metric-btn span {
    padding: 0.12em 0.45em;
    border-radius: 999px;
    transition: color var(--motion-fast) var(--motion-ease),
        background-color var(--motion-fast) var(--motion-ease);
}

.publisher-metric-btn:hover {
    color: var(--primary);
}

.publisher-metric-btn.active,
.publisher-metric-btn:focus-visible {
    color: var(--primary);
    outline: none;
}

.publisher-metric-btn.active span,
.publisher-metric-btn:focus-visible span {
    background: var(--primary);
    color: var(--surface-active-text);
}

.publisher-chart-wrap {
    position: relative;
    flex: 1;
    min-height: 12.5rem;
    min-width: 0;
}

.publisher-monthly-scroll {
    overflow-x: hidden;
    min-width: 0;
}

.publisher-monthly-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) repeat(4, minmax(0, 0.72fr)) minmax(0, 1.35fr);
    gap: 0.2rem 0.28rem;
    font-size: 0.82rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
}

.publisher-monthly-head,
.publisher-monthly-row {
    display: contents;
}

.publisher-monthly-head > span,
.publisher-monthly-head > .metric-head {
    display: flex;
    align-items: flex-end;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid var(--card-border);
}

.publisher-monthly-head > .publisher-metric-head-btn {
    appearance: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.12rem;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.12rem 0.05rem 0.22rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--motion-fast) var(--motion-ease);
}

.publisher-monthly-head > .publisher-metric-head-btn .metric-icon {
    width: 0.9rem;
    height: 0.9rem;
    color: currentColor;
}

.publisher-monthly-head > .publisher-metric-head-btn span {
    display: block;
    min-width: 0;
    max-width: 100%;
    padding: 0.08em 0.28em;
    border-radius: 0.28rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    transition: color var(--motion-fast) var(--motion-ease),
        background-color var(--motion-fast) var(--motion-ease);
}

.publisher-monthly-head > .publisher-metric-head-btn:hover {
    color: var(--primary);
}

.publisher-monthly-head > .publisher-metric-head-btn.active,
.publisher-monthly-head > .publisher-metric-head-btn:focus-visible {
    color: var(--primary);
    outline: none;
}

.publisher-monthly-head > .publisher-metric-head-btn.active {
    border-bottom-color: var(--primary);
}

.publisher-monthly-head > .publisher-metric-head-btn.active span,
.publisher-monthly-head > .publisher-metric-head-btn:focus-visible span {
    background: var(--primary);
    color: var(--surface-active-text);
}

.publisher-monthly-row > span {
    padding: 0.22rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    min-width: 0;
    overflow-wrap: break-word;
}

.publisher-monthly-row-focus > span {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    font-weight: 600;
}

.publisher-monthly-row-flash > span {
    animation: monthlyRowFlash 1.4s ease-out;
}

.publisher-monthly-row > span.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.publisher-monthly-head > .comment-head,
.publisher-monthly-row > span.comment {
    text-align: left;
    font-size: 0.76rem;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.publisher-monthly-head > .comment-head {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.publisher-monthly-row > span.comment-empty {
    color: rgba(143, 163, 191, 0.45);
}

.publisher-monthly-row-focus > span.comment:not(.comment-empty) {
    color: #a7f3d0;
}

.publisher-monthly-total > span {
    font-weight: 600;
    color: var(--text-main);
    border-bottom: none;
    padding-top: 0.25rem;
}

.pub-cell-expand,
.pub-expand-head {
    width: 2.25rem;
    text-align: center;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
}

.pub-cell-tap {
    cursor: pointer;
}

.pub-cell-tap:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.55);
    outline-offset: 2px;
    border-radius: 4px;
}

.pub-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 1px solid var(--surface-border-medium);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.pub-expand-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
}

.pub-expand-icon {
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-1px) rotate(45deg);
    transition: transform 0.2s ease, border-color 0.15s;
}

.publisher-row.is-expanded .pub-expand-icon {
    transform: translateY(1px) rotate(-135deg);
    border-color: var(--primary);
}

.publisher-row-dates {
    display: none;
}

.pub-dates-fold {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
}

.pub-dates-fold.is-folding {
    transition: grid-template-rows var(--motion-fast) var(--motion-ease);
}

.publisher-row-dates.is-collapsed .pub-dates-fold {
    grid-template-rows: 0fr;
}

.publisher-row-dates.is-collapsed {
    pointer-events: none;
}

.pub-dates-fold > .pub-dates-kv {
    min-height: 0;
    overflow: hidden;
}

.pub-dates-kv {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.pub-kv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.pub-kv dt {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex: 0 0 auto;
}

.pub-kv dd {
    margin: 0;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    text-align: right;
}

@keyframes monthlyRowFlash {
    0% {
        background: rgba(251, 191, 36, 0.45);
        color: #fde68a;
    }
    55% {
        background: rgba(251, 191, 36, 0.28);
        color: #fcd34d;
    }
    100% {
        background: rgba(16, 185, 129, 0.14);
        color: #6ee7b7;
    }
}

.publisher-detail-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
    padding: 1.5rem 0.5rem;
    text-align: center;
}

.publisher-profile {
    margin-bottom: 0.65rem;
}

.publisher-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 0.15rem;
    line-height: 1.25;
    word-break: break-word;
}

.publisher-name.person-name .person-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.publisher-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.publisher-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.publisher-badge {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.38rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    html.dashboard-root {
        font-size: calc(15px * var(--app-font-scale, 1));
    }

    body.dashboard-body {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
        padding-bottom: calc(var(--dashboard-nav-height) + 0.75rem + env(safe-area-inset-bottom, 0px));
    }

    body.dashboard-body.pwa-bar-visible {
        padding-bottom: calc(var(--dashboard-nav-height) + 3.75rem + env(safe-area-inset-bottom, 0px));
    }

    .dashboard-container {
        max-width: 100%;
    }

    .dashboard-body .dashboard-header h1 {
        font-size: 1.45rem;
    }

    .dashboard-body .subtitle {
        font-size: 0.82rem;
    }

    .main-card.dashboard-main {
        padding: 0.35rem 0;
        border: none;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .dashboard-stack {
        gap: 0.75rem;
    }

    .dashboard-section {
        border-radius: 10px;
    }

    .dashboard-accordion-trigger {
        padding: 0.65rem 0.7rem;
        gap: 0.5rem;
    }

    .totals-section-head .dashboard-section-sub {
        padding: 0 0.7rem 0.5rem;
    }

    .totals-header-export {
        right: calc(0.7rem + 1.65rem + 0.45rem);
    }

    body.dashboard-layout-single .dashboard-accordion.dashboard-section--solo .totals-header-export {
        right: 0.7rem;
    }

    .dashboard-accordion-inner {
        padding: 0 0.55rem 0.65rem;
    }

    .publisher-section-meta {
        padding: 0 0.7rem 0.55rem;
    }

    .publisher-section .dashboard-accordion-trigger {
        padding-bottom: 0.2rem;
    }

    .dashboard-section-title {
        font-size: calc(var(--heading-section-size) * 1.05);
        line-height: 1.2;
    }

    .dashboard-section-sub {
        font-size: 0.72rem;
        margin-top: 0.2rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .dashboard-toolbar {
        gap: 0.4rem;
        margin-bottom: 0.55rem;
    }

    .totals-workspace {
        padding: 0;
    }

    .totals-dock-btn,
    .totals-dock-collapse,
    .totals-dock-peek,
    .totals-dock-panel-close {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }

    .totals-check {
        min-height: 44px;
    }

    .toolbar-field {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }

    .toolbar-field label {
        font-size: 0.68rem;
        margin-bottom: 0.2rem;
    }

    .toolbar-field select {
        padding: 0.42rem 0.5rem;
        font-size: 0.8rem;
    }

    .kpi-panel .kpi-mode-toggle {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        margin-bottom: 0.55rem;
        border-radius: 10px;
    }

    .kpi-mode-btn {
        padding: 0.38rem 0.25rem;
        font-size: 0.58rem;
        letter-spacing: 0.04em;
    }

    .kpi-card {
        padding: 0.45rem 0.3rem 0.4rem;
        min-height: 4.35rem;
        border-radius: 8px;
    }

    .kpi-card-icon .metric-icon {
        width: 1rem;
        height: 1rem;
    }

    .kpi-value {
        font-size: 1.15rem;
    }

    .kpi-value--split {
        font-size: 1.02rem;
    }

    .kpi-label {
        font-size: 0.62rem;
    }

    .kpi-hint {
        font-size: 0.58rem;
    }

    .summary-charts-block {
        margin-top: 0.65rem;
        padding-top: 0.55rem;
    }

    .summary-subsection-title {
        margin-bottom: 0.5rem;
    }

    .charts-toolbar {
        gap: 0.35rem;
        padding: 0.45rem 0.5rem;
        border: none;
        background: var(--surface-muted);
        border-radius: 8px;
    }

    .charts-toolbar-row--metric label {
        font-size: 0.68rem;
    }

    .charts-toolbar-row--metric select {
        font-size: 0.8rem;
    }

    .charts-toolbar-row--profiles {
        padding-top: 0.3rem;
    }

    .chart-profile-toggles {
        gap: 0.35rem 0.5rem;
    }

    .chart-profile-toggle {
        font-size: 0.68rem;
    }

    .chart-grid {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .chart-card {
        padding: 0.45rem 0.35rem;
        min-height: auto;
        border: none;
        background: var(--surface-subtle);
        border-radius: 8px;
    }

    .chart-card h3 {
        font-size: 0.72rem;
        margin-bottom: 0.35rem;
    }

    .chart-wrap {
        height: 185px;
    }

    .filters-panel {
        border-radius: 8px;
    }

    .filters-bar {
        padding: 0.28rem 0.45rem 0.18rem;
    }

    .filters-body {
        padding: 0 0.45rem 0.4rem;
    }

    .filter-group-summary {
        padding: 0.38rem 0.48rem;
    }

    .filter-group-chips {
        padding: 0 0.45rem 0.45rem;
    }

    .filters-toggle-main {
        flex-direction: row;
        align-items: baseline;
        gap: 0.35rem;
    }

    .filters-summary {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
    }

    .publisher-toolbar {
        gap: 0.35rem;
        margin-bottom: 0.5rem;
    }

    .publisher-search {
        font-size: 0.82rem;
        padding: 0.42rem 0.5rem;
    }

    .publisher-list-wrap {
        max-height: min(45vh, 300px);
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0.65rem;
    }

    .toolbar-actions {
        margin-left: 0;
        width: auto;
    }

    .toolbar-actions .btn-secondary {
        flex: 0 0 auto;
    }

    .publisher-monthly-panel {
        grid-template-columns: 1fr;
    }

    .publisher-metric-toggle {
        display: inline-flex;
    }

    .publisher-monthly-head > .publisher-metric-head-btn {
        min-height: 0;
        padding-bottom: 0.15rem;
        border-bottom: 2px solid var(--card-border);
        color: var(--text-muted);
        cursor: default;
        pointer-events: none;
    }

    .publisher-monthly-head > .publisher-metric-head-btn.active,
    .publisher-monthly-head > .publisher-metric-head-btn:hover,
    .publisher-monthly-head > .publisher-metric-head-btn:focus-visible {
        color: var(--text-muted);
        border-bottom-color: var(--card-border);
    }

    .publisher-monthly-head > .publisher-metric-head-btn.active span,
    .publisher-monthly-head > .publisher-metric-head-btn:hover span,
    .publisher-monthly-head > .publisher-metric-head-btn:focus-visible span {
        background: transparent;
        color: inherit;
    }

    .publisher-chart-wrap {
        height: 10rem;
    }

    .chart-wrap {
        height: auto;
        min-height: 140px;
    }

    .publisher-monthly-grid {
        max-width: none;
    }

    .publisher-name {
        font-size: 0.95rem;
    }

    .data-table {
        font-size: 0.82rem;
    }
}

@media (max-width: 640px) {
    .table-wrap--responsive {
        overflow-x: visible;
        border: none;
        border-radius: 0;
        margin-bottom: 0.55rem;
        background: transparent;
    }

    .table-wrap--responsive:has(.totals-table--matrix) {
        overflow-x: auto;
        border: 1px solid var(--surface-border-light);
        border-radius: 10px;
        background: var(--surface-elevated);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) thead {
        display: none;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody tr {
        display: block;
        padding: 0.55rem 0.65rem;
        background: var(--surface-elevated);
        border: 1px solid var(--surface-border-light);
        border-radius: 10px;
        cursor: pointer;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody tr:hover {
        background: var(--surface-elevated);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 0.65rem;
        padding: 0.24rem 0;
        border-bottom: none;
        white-space: normal;
        max-width: none;
        overflow: visible;
        text-overflow: unset;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 0.6rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody td:first-child {
        font-weight: 600;
        font-size: 0.88rem;
        color: var(--text-main);
        padding-bottom: 0.35rem;
        margin-bottom: 0.2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody td:first-child::before {
        display: none;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody td.num {
        font-size: 0.92rem;
        font-weight: 600;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody tr.selected {
        border-color: rgba(56, 189, 248, 0.45);
        background: rgba(56, 189, 248, 0.1);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tbody tr.selected td:first-child {
        color: var(--primary);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tfoot {
        display: block;
        margin-top: 0.15rem;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tfoot tr {
        display: block;
        padding: 0.55rem 0.65rem;
        background: rgba(56, 189, 248, 0.1);
        border: 1px solid rgba(56, 189, 248, 0.28);
        border-radius: 10px;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tfoot td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 0.65rem;
        padding: 0.24rem 0;
        border: none;
        background: transparent;
        font-weight: 600;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tfoot td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 0.6rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tfoot td:first-child {
        font-size: 0.88rem;
        padding-bottom: 0.35rem;
        margin-bottom: 0.2rem;
        border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tfoot td:first-child::before {
        display: none;
    }

    .data-table--cards-mobile:not(.totals-table--matrix) tfoot td:empty {
        display: none;
    }

    .data-table--cards-mobile.totals-table--matrix {
        display: table;
        width: max-content;
        min-width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        table-layout: auto;
    }

    .data-table--cards-mobile.totals-table--matrix thead {
        display: table-header-group;
    }

    .data-table--cards-mobile.totals-table--matrix tbody {
        display: table-row-group;
    }

    .data-table--cards-mobile.totals-table--matrix tfoot {
        display: table-footer-group;
    }

    .data-table--cards-mobile.totals-table--matrix tr {
        display: table-row;
    }

    .data-table--cards-mobile.totals-table--matrix th,
    .data-table--cards-mobile.totals-table--matrix td {
        display: table-cell;
        padding: 0.45rem 0.55rem;
        border-bottom: 1px solid var(--surface-border-light);
        white-space: nowrap;
        vertical-align: middle;
    }

    .data-table--cards-mobile.totals-table--matrix td::before,
    .data-table--cards-mobile.totals-table--matrix th::before {
        display: none !important;
        content: none !important;
    }

    .data-table--cards-mobile.totals-table--matrix .totals-matrix-corner,
    .data-table--cards-mobile.totals-table--matrix .totals-matrix-row-head {
        position: sticky;
        left: 0;
        z-index: 2;
        background: var(--surface-elevated);
        box-shadow: 1px 0 0 var(--surface-border-light);
    }

    .data-table--cards-mobile.totals-table--matrix tfoot .totals-matrix-row-head,
    .data-table--cards-mobile.totals-table--matrix tfoot td {
        background: rgba(56, 189, 248, 0.08);
        font-weight: 700;
        border-top: 1px solid rgba(56, 189, 248, 0.22);
    }

    .data-table--cards-mobile.totals-table--matrix .totals-matrix-col-head,
    .data-table--cards-mobile.totals-table--matrix tbody td.num {
        min-width: 3.25rem;
        text-align: center;
    }

    .publisher-list-table tbody td:first-child {
        word-break: break-word;
    }

    .publisher-list-wrap.table-wrap--responsive {
        overflow-x: hidden;
        overflow-y: auto;
        max-height: min(45vh, 300px);
        border: 1px solid var(--card-border);
        border-radius: 10px;
        background: var(--surface-muted);
        padding: 0.35rem;
        margin-bottom: 0.55rem;
    }

    .publisher-list-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
        padding-right: 0.1rem;
    }

    .publisher-list-table thead {
        display: none;
    }

    .publisher-list-table tbody tr.publisher-row,
    .publisher-list-table tbody tr.publisher-row-dates {
        display: block;
        width: 100%;
    }

    .publisher-list-table tbody tr.publisher-row {
        padding: 0.55rem 0.65rem 0.4rem;
        background: var(--surface-elevated);
        border: 1px solid var(--surface-border-light);
        border-radius: 10px;
        cursor: pointer;
    }

    .publisher-list-table tbody tr.publisher-row.is-expanded {
        border-radius: 10px 10px 0 0;
        border-bottom: none;
        padding-bottom: 0.35rem;
    }

    .publisher-list-table tbody tr.publisher-row:not(.is-expanded) {
        margin-bottom: 0;
    }

    .publisher-list-table tbody tr.publisher-row-dates {
        margin-top: -0.45rem;
        overflow: hidden;
    }

    .publisher-list-table tbody tr.publisher-row-dates:not(.is-collapsed) {
        padding: 0 0.65rem 0.55rem;
        background: var(--surface-elevated);
        border: 1px solid var(--surface-border-light);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0 0 10px 10px;
    }

    .publisher-list-table tbody tr.publisher-row.selected {
        border-color: rgba(56, 189, 248, 0.45);
        background: rgba(56, 189, 248, 0.1);
    }

    .publisher-list-table tbody tr.publisher-row.selected + tr.publisher-row-dates:not(.is-collapsed) {
        border-color: rgba(56, 189, 248, 0.45);
        background: rgba(56, 189, 248, 0.08);
    }

    .publisher-list-table tbody tr.publisher-row td:not(.pub-cell-expand),
    .publisher-list-table tbody tr.publisher-row-dates td {
        display: block;
        border: none;
        padding: 0;
        max-width: none;
        white-space: normal;
    }

    .publisher-list-table tbody tr.publisher-row td.pub-date-col {
        display: none !important;
        visibility: hidden;
        position: absolute;
        width: 0;
        height: 0;
        overflow: hidden;
        pointer-events: none;
    }

    .publisher-list-table tbody tr.publisher-row {
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-template-areas:
            "name name expand"
            "profile grupo expand";
        column-gap: 0.45rem;
        row-gap: 0.12rem;
        align-items: center;
    }

    .publisher-list-table .pub-date-col {
        display: none !important;
    }

    .publisher-list-table .pub-cell-name {
        grid-area: name;
        font-weight: 600;
        font-size: 0.88rem;
        color: var(--text-main);
        line-height: 1.25;
    }

    .publisher-list-table tbody tr.publisher-row.selected .pub-cell-name {
        color: var(--primary);
    }

    .publisher-list-table .pub-cell-profile {
        grid-area: profile;
        font-size: 0.72rem;
        color: var(--text-muted);
    }

    .publisher-list-table .pub-cell-grupo {
        grid-area: grupo;
        font-size: 0.72rem;
        color: var(--accent-emerald, #34d399);
        font-weight: 600;
    }

    .publisher-list-table .pub-cell-expand {
        grid-area: expand;
        align-self: center;
        justify-self: end;
        display: block;
    }

    .publisher-list-table .pub-dates-kv {
        padding-top: 0.15rem;
    }

    .publisher-list-table .publisher-list-empty {
        display: block;
        text-align: center;
        padding: 1.25rem 0.75rem;
        border: 1px dashed rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        color: var(--text-muted);
    }

    .data-table--cards-mobile .publisher-list-empty::before {
        display: none;
    }

    .totals-toolbar-row--group,
    .totals-toolbar-row--time {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.28rem;
    }

    .totals-header-export {
        right: calc(0.7rem + 1.65rem + 0.4rem);
    }

    .totals-header-export .export-menu-toggle {
        min-height: 44px;
    }

    body.dashboard-layout-single .dashboard-accordion.dashboard-section--solo .totals-header-export {
        right: 0.7rem;
    }

    .totals-controls .toolbar-field select,
    .totals-metric-field select {
        min-height: 44px;
    }

    .totals-float-btn {
        min-height: 44px;
        padding-top: 0.28rem;
        padding-bottom: 0.28rem;
    }

    .totals-view-toggle--compact .totals-view-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .totals-dimension-btn {
        min-height: 44px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .chart-profile-toggle {
        min-height: 44px;
        padding: 0.1rem 0.18rem;
        font-size: 0.7rem;
    }

    .chart-profile-toggle input {
        width: 0.62rem;
        height: 0.62rem;
        min-width: 0.62rem;
        min-height: 0.62rem;
    }
}

@media (min-width: 641px) {
    .publisher-row-dates {
        display: none !important;
    }

    .pub-cell-expand,
    .pub-expand-head {
        display: none;
    }
}

@media (max-width: 480px) {
    html.dashboard-root {
        font-size: calc(14px * var(--app-font-scale, 1));
    }

    body.dashboard-body {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        padding-bottom: calc(var(--dashboard-nav-height) + 0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .dashboard-accordion-inner {
        padding: 0 0.45rem 0.55rem;
    }

    .kpi-grid {
        gap: 0.35rem;
    }

    .toolbar-field {
        flex: 1 1 100%;
    }
}

/* —— Grupos de campo —— */
.grupos-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.grupos-count-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.grupos-count-field input {
    width: 4rem;
    padding: 0.38rem 0.45rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
}

.grupos-persist-toggle {
    flex: 1 1 14rem;
    min-width: min(100%, 14rem);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.grupos-persist-toggle .switch-label {
    line-height: 1.25;
}

.grupos-summary-badge {
    font-size: 0.72rem;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grupos-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.grupos-roles-panel {
    padding-top: 1.1rem;
    margin-bottom: 0.65rem;
}

.grupos-roles-accordion {
    border: 1px solid var(--surface-border-light);
    border-radius: 10px;
    background: var(--surface-muted);
    overflow: hidden;
}

.grupos-roles-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.42rem 0.65rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-main);
}

.grupos-roles-accordion-summary::-webkit-details-marker {
    display: none;
}

.grupos-roles-accordion-body {
    padding: 0.35rem 0.6rem 0.5rem;
    border-top: 1px solid var(--surface-border-faint);
}

.grupos-group-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.grupos-empty-inline {
    margin: 0.35rem 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.grupos-others-details {
    margin-top: 0.55rem;
    border: 1px dashed var(--surface-border-medium);
    border-radius: 8px;
    background: var(--surface-dashed-bg);
}

.grupos-others-summary {
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.grupos-others-summary::-webkit-details-marker {
    display: none;
}

.grupos-member-list--in {
    padding-top: 0.35rem;
}

.grupos-member-list--out {
    padding: 0.35rem 0.6rem 0.55rem;
}

.grupos-chip {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.grupos-chip--sup {
    background: var(--person-sup-bg);
    color: var(--person-sup);
    border: 1px solid var(--person-sup-border);
}

.grupos-chip--aux {
    background: var(--person-aux-bg);
    color: var(--person-aux);
    border: 1px solid var(--person-aux-border);
}

.grupos-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.35rem;
}

.grupos-role-card {
    padding: 0.38rem 0.5rem;
    border: 1px solid var(--surface-border-light);
    border-radius: 8px;
    background: var(--surface-muted);
}

.grupos-tab-btn {
    border: 1px solid var(--surface-border-medium);
    background: var(--surface-hover);
    color: var(--text-muted);
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.grupos-tab-btn.active {
    color: var(--primary);
    border-color: var(--surface-border-medium);
    background: var(--surface-hover-strong);
}

.grupos-empty {
    margin: 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.grupos-group-card,
.grupos-profile-card {
    margin-bottom: 0.55rem;
    border: 1px solid var(--surface-border-light);
    border-radius: 10px;
    background: var(--surface-muted);
    overflow: hidden;
}

.grupos-group-summary,
.grupos-profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 0.88rem;
}

.grupos-group-summary::-webkit-details-marker,
.grupos-profile-summary::-webkit-details-marker {
    display: none;
}

.grupos-group-title,
.grupos-profile-title {
    color: var(--text-main);
}

.grupos-group-badge {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.grupos-group-body,
.grupos-profile-body {
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid var(--surface-border-faint);
}

.grupos-roles-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    padding: 0;
}

.grupos-role-field {
    flex: 1 1 11rem;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.grupos-role-label {
    line-height: 1.15;
}

.grupos-role-combo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.grupos-role-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 0.26rem 0.42rem;
    border-radius: 7px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.76rem;
    user-select: text;
    -webkit-user-select: text;
}

.grupos-role-input:focus {
    outline: none;
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.15);
}

.grupos-role-clear {
    flex: 0 0 auto;
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    border: 1px solid var(--surface-border-light);
    border-radius: 6px;
    background: var(--surface-hover-strong);
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1;
    cursor: pointer;
}

.grupos-role-clear:hover {
    color: var(--text-main);
    border-color: var(--surface-border-medium);
}

.grupos-role-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.2rem);
    z-index: 40;
    max-height: 11rem;
    overflow: auto;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 8px;
    background: var(--surface-overlay);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.grupos-role-option {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    padding: 0.38rem 0.55rem;
    cursor: pointer;
}

.grupos-role-option:hover,
.grupos-role-option:focus {
    background: rgba(52, 211, 153, 0.12);
    outline: none;
}

.grupos-role-option-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
}

.grupos-role-option-name.person-name .person-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.grupos-role-option-profile {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.grupos-role-option--empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: default;
}

.grupos-role-option--empty:hover {
    background: transparent;
}

.grupos-role-select {
    padding: 0.38rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.8rem;
}

.grupos-member-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.25rem 0.65rem;
    max-height: 16rem;
    overflow: auto;
    padding-top: 0.35rem;
}

.grupos-member-list--profile {
    max-height: 14rem;
}

.grupos-member-check {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "cb main"
        "cb profile";
    column-gap: 0.45rem;
    row-gap: 0.08rem;
    align-items: start;
    padding: 0.32rem 0.35rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.grupos-member-check input[type="checkbox"] {
    grid-area: cb;
    margin-top: 0.15rem;
    cursor: pointer;
}

.grupos-member-check-main {
    grid-area: main;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.45rem;
}

.grupos-member-check .grupos-member-profile {
    grid-area: profile;
}

.grupos-member-check:hover {
    background: var(--surface-hover-strong);
}

.grupos-member-name {
    color: var(--text-main);
    font-weight: 500;
}

.grupos-member-name-row,
.grupos-matrix-name-row {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.grupos-publisher-name-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 0;
    max-width: 100%;
}

.grupos-publisher-name-btn .person-name-main {
    flex: 1;
    min-width: 0;
}

.grupos-publisher-name-btn .person-sparkline {
    min-width: var(--person-spark-width);
    width: var(--person-spark-width);
    max-width: var(--person-spark-width);
}

.grupos-publisher-name-btn .person-name-text {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.12em;
    transition: text-decoration-color 0.15s;
}

.grupos-publisher-name-btn:hover,
.grupos-publisher-name-btn:focus-visible {
    color: var(--text-main);
    outline: none;
}

.grupos-publisher-name-btn:hover .person-name-text,
.grupos-publisher-name-btn:focus-visible .person-name-text {
    text-decoration-color: currentColor;
}

.grupos-publisher-name-btn--assign {
    color: var(--accent-emerald, #34d399);
}

.grupos-publisher-name-btn .person-icon.person-icon--publicador,
.grupos-publisher-name-btn--assign .person-icon.person-icon--publicador {
    color: var(--person-publicador);
}
.grupos-publisher-name-btn .person-icon.person-icon--siervo,
.grupos-publisher-name-btn--assign .person-icon.person-icon--siervo {
    color: var(--person-siervo);
}
.grupos-publisher-name-btn .person-icon.person-icon--anciano,
.grupos-publisher-name-btn--assign .person-icon.person-icon--anciano {
    color: var(--person-anciano);
}

.grupos-matrix-name .grupos-publisher-name-btn {
    max-width: 100%;
    overflow: hidden;
}

.grupos-matrix-name .grupos-publisher-name-btn .person-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grupos-publisher-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--surface-border-light);
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.grupos-publisher-detail-btn svg {
    width: 1rem;
    height: 1rem;
}

.grupos-publisher-detail-btn:hover,
.grupos-publisher-detail-btn:focus-visible {
    color: var(--text-main);
    border-color: rgba(0, 229, 255, 0.45);
    background: rgba(0, 229, 255, 0.12);
    outline: none;
}

.grupos-member-check .grupos-publisher-detail-btn {
    margin-left: 0.15rem;
}

.grupos-matrix-name-row {
    width: 100%;
}

.grupos-matrix-name-row .grupos-matrix-name-text {
    flex: 1 1 auto;
    min-width: 0;
}

.grupos-member-profile,
.grupos-member-grupo {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.grupos-member-grupo {
    color: var(--accent-emerald, #34d399);
}

.grupos-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    vertical-align: middle;
}

.grupos-tag--sup {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.grupos-tag--aux {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.grupos-profile-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0 0.45rem;
}

.grupos-profile-target {
    min-width: 8rem;
    padding: 0.38rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.8rem;
}

.grupos-matrix-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.grupos-matrix-search,
.grupos-panel-search {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.42rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--surface-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
}

.grupos-group-search-wrap {
    margin-bottom: 0.45rem;
}

.grupos-group-search-wrap .grupos-group-search {
    width: 100%;
}

.grupos-matrix-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.grupos-matrix-scroll {
    max-height: 420px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--surface-border-light);
    border-radius: 10px;
    width: 100%;
}

.grupos-matrix-scroll.table-wrap {
    overflow-x: hidden;
}

.grupos-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: fixed;
}

.grupos-matrix-table th,
.grupos-matrix-table td {
    border: 1px solid var(--surface-border-faint);
    padding: 0.35rem 0.45rem;
    vertical-align: middle;
}

.grupos-matrix-name-col,
.grupos-matrix-name {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface-overlay);
    text-align: left;
    width: 11rem;
    min-width: 9rem;
    max-width: 13rem;
    padding-left: 0.6rem;
    padding-right: 0.5rem;
    white-space: normal;
    word-break: break-word;
}

.grupos-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface-overlay);
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.grupos-matrix-table thead th.grupos-matrix-name-col {
    text-align: left;
}

.grupos-matrix-name-col {
    z-index: 4;
}

.grupos-matrix-name-text {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
    text-align: left;
}

.grupos-matrix-profile {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    text-align: left;
}

.grupos-matrix-profile-header .grupos-matrix-profile-head {
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(12, 20, 36, 0.98);
    border-top: 2px solid rgba(52, 211, 153, 0.28);
    border-bottom: 1px solid var(--surface-border-light);
    padding: 0.45rem 0.55rem;
    text-align: left;
    font-weight: 600;
}

.grupos-matrix-profile-header:first-child .grupos-matrix-profile-head {
    border-top: none;
}

.grupos-matrix-profile-head-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
}

.grupos-matrix-profile-head-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    min-width: 0;
}

.grupos-matrix-profile-label {
    color: var(--accent-emerald, #34d399);
    font-size: 0.82rem;
    font-weight: 600;
}

.grupos-matrix-profiles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grupos-matrix-profile-block {
    border: 1px solid var(--surface-border-light);
    border-radius: 10px;
    background: var(--surface-muted);
    overflow: hidden;
}

.grupos-matrix-profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.grupos-matrix-profile-summary::-webkit-details-marker {
    display: none;
}

.grupos-matrix-profile-block .grupos-matrix-scroll {
    max-height: 280px;
    border-top: 1px solid var(--surface-border-faint);
    border-radius: 0;
}

.grupos-matrix-col-head {
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
    vertical-align: top;
    padding: 0.35rem 0.3rem !important;
    position: relative;
    text-align: left;
}

.grupos-col-num {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.grupos-col-roles-expanded {
    display: none;
}

.grupos-col-role-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    margin-top: 0.2rem;
    line-height: 1.15;
}

.grupos-col-role-line .grupos-chip {
    font-size: 0.58rem;
    padding: 0.06rem 0.28rem;
}

.grupos-col-person {
    display: block;
    max-width: 100%;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.2;
    word-break: break-word;
}

.grupos-matrix-col-head:hover,
.grupos-matrix-col-head:focus-visible {
    background: rgba(52, 211, 153, 0.12);
    outline: none;
}

.grupos-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.grupos-modal.hidden {
    display: none;
}

.grupos-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
}

.grupos-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 22rem);
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: var(--surface-overlay);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.grupos-modal-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--accent-emerald, #34d399);
}

.grupos-modal-roles {
    margin: 0 0 1rem;
}

.grupos-modal-role-row {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.grupos-modal-role-row:last-child {
    border-bottom: none;
}

.grupos-modal-role-row dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.grupos-modal-role-row dd {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-word;
}

.grupos-modal-role-row:first-child dd {
    color: #fbbf24;
}

.grupos-modal-role-row:last-child dd {
    color: #38bdf8;
}

.grupos-matrix-person-row .grupos-matrix-name {
    padding-left: 0.85rem;
}

.grupos-matrix-col {
    width: 2.35rem;
    min-width: 2.35rem;
    max-width: 2.35rem;
    text-align: center;
}

.grupos-matrix-cell {
    cursor: pointer;
    color: var(--accent-emerald, #34d399);
    font-weight: 700;
    font-size: 0.85rem;
    width: 2.35rem;
    min-width: 2.35rem;
    max-width: 2.35rem;
    text-align: center;
    transition: background 0.12s;
}

.grupos-matrix-cell:hover {
    background: rgba(52, 211, 153, 0.12);
}

.grupos-matrix-cell.is-active {
    background: rgba(52, 211, 153, 0.22);
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.45);
}

.grupos-matrix-cell:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.grupos-col-tooltip {
    position: fixed;
    z-index: 450;
    min-width: 9rem;
    max-width: min(16rem, calc(100vw - 1rem));
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: var(--surface-overlay);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    transform: translate(-50%, -100%);
}

.grupos-col-tooltip.hidden {
    display: none;
}

.grupos-col-tooltip-line {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.68rem;
    line-height: 1.35;
    color: var(--text-main);
}

.grupos-col-tooltip-line + .grupos-col-tooltip-line {
    margin-top: 0.3rem;
}

.grupos-col-tooltip-line .grupos-chip {
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.grupos-col-tooltip-name {
    font-weight: 500;
    word-break: break-word;
}

@media (min-width: 768px) {
    .grupos-col-roles-expanded {
        display: block;
    }

    .grupos-col-num {
        margin-bottom: 0.25rem;
    }

    .grupos-matrix-table {
        table-layout: auto;
    }

    .grupos-matrix-name-col,
    .grupos-matrix-name {
        width: auto;
        min-width: 9rem;
        max-width: none;
    }

    .grupos-matrix-col,
    .grupos-matrix-cell {
        width: auto;
        min-width: 3.25rem;
        max-width: none;
    }

    .grupos-matrix-col-head {
        white-space: normal;
        text-align: left;
    }

    .grupos-col-role-line {
        width: 100%;
    }

    .grupos-col-person {
        font-size: 0.68rem;
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .grupos-member-list {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .grupos-matrix-scroll {
        max-height: 320px;
    }

    .grupos-matrix-profile-head-inner {
        flex-direction: row;
    }

    .publisher-bulk-grupo-select {
        flex: 1 1 9rem;
        min-width: 0;
    }

    .dashboard-nav-text {
        font-size: 0.58rem;
    }

    .dashboard-nav-btn {
        padding: 0.38rem 0.2rem;
    }
}

/* --- Settings panel & preferences --- */
.btn-settings-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-settings-header:hover,
.btn-settings-header:focus-visible {
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.14);
    outline: none;
}

.btn-settings-header svg {
    width: 1.35rem;
    height: 1.35rem;
}

.settings-tabs--hidden {
    display: none !important;
}

.settings-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.55rem 1rem 0;
    border-bottom: 1px solid var(--surface-border-light);
    position: sticky;
    top: 3.1rem;
    background: inherit;
    z-index: 2;
}

.settings-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 0.65rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.settings-tab:hover {
    color: var(--text-main);
}

.settings-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
}

.settings-tab-stage {
    display: grid;
    grid-template-areas: "settings-tab";
    min-width: 0;
}

.settings-tab-panel {
    grid-area: settings-tab;
    min-width: 0;
}

#settings-panel-datos {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.datos-accordion {
    border: 1px solid var(--surface-border-light);
    border-radius: 10px;
    background: var(--surface-elevated);
}

.datos-accordion > .datos-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.datos-accordion > .datos-accordion-summary::-webkit-details-marker,
.datos-accordion > .datos-accordion-summary::marker {
    display: none;
    content: '';
}

.datos-accordion-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-main);
    min-width: 0;
}

.datos-accordion-title::before {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(-45deg);
    flex-shrink: 0;
}

.datos-accordion[open] > .datos-accordion-summary .datos-accordion-title::before {
    transform: rotate(45deg);
}

.datos-accordion-badge {
    flex-shrink: 0;
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-pill);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.datos-accordion.has-report > .datos-accordion-summary .datos-accordion-badge {
    color: var(--text-main);
}

.datos-accordion-body {
    padding: 0.15rem 0.75rem 0.75rem;
    border-top: 1px solid var(--surface-border-subtle);
}

.datos-accordion-actions {
    justify-content: flex-start;
    margin: 0.45rem 0 0.35rem;
}

.datos-load-entry {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0.2rem 0 0.85rem;
}

.datos-load-entry .btn-primary,
.datos-load-entry .btn-secondary {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.datos-load-entry .btn-primary {
    font-size: 1.05rem;
    font-weight: 700;
}

.datos-accordion-empty {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.datos-help-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.55rem;
}

.datos-help-copy {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.datos-help-copy p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.datos-accordion-body .data-sources-bar {
    margin-top: 0.55rem;
}

.datos-help-stack .datos-help {
    margin: 0;
}

.load-status--global {
    margin-bottom: 0;
}

.load-status--toast {
    position: fixed;
    left: max(0.65rem, env(safe-area-inset-left, 0px));
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    bottom: calc(var(--dashboard-nav-height) + 0.55rem + env(safe-area-inset-bottom, 0px));
    z-index: 305;
    margin-bottom: 0;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.datos-panel {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
}

.datos-panel.hidden {
    display: none;
}

.datos-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.datos-panel-sheet {
    position: relative;
    z-index: 1;
    width: min(100%, 26rem);
    max-height: 100%;
    overflow-y: auto;
    background: var(--surface-overlay);
    border-left: 1px solid rgba(52, 211, 153, 0.25);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
    padding: 0 0 2rem;
}

.datos-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--surface-border-light);
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 2;
}

.datos-panel-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.datos-panel-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.datos-panel-body {
    padding: 0.75rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.datos-section-title {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.datos-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.datos-section-head .datos-section-title {
    margin: 0;
}

.datos-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.load-loaded-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.datos-modal-card.datos-update-card {
    width: min(100%, 36rem);
    max-height: min(92vh, 44rem);
    display: flex;
    flex-direction: column;
}

.datos-update-body {
    min-height: 0;
    overflow: auto;
    max-height: min(65vh, 32rem);
}

.datos-update-report,
.datos-update-report-saved {
    font-size: 0.85rem;
}

.datos-update-report-saved {
    max-height: min(40vh, 22rem);
    overflow: auto;
    padding: 0.2rem 0.05rem 0.15rem;
}

.datos-update-lead {
    margin: 0 0 0.55rem;
}

.datos-update-section {
    margin-top: 0.7rem;
}

.datos-update-section-title {
    margin: 0.15rem 0 0.35rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: normal;
    text-transform: none;
}

.datos-update-summary,
.datos-update-list {
    margin: 0;
    padding-left: 1.25rem;
}

.datos-update-summary li,
.datos-update-list li {
    margin: 0.18rem 0;
}

.datos-update-person {
    margin: 0.4rem 0 0.5rem;
}

.datos-update-person strong {
    font-weight: 600;
}

.datos-update-person ul {
    margin: 0.15rem 0 0;
    padding-left: 1.1rem;
}

.datos-update-more {
    color: var(--text-muted);
}

.datos-update-pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.78rem;
}

.datos-update-details {
    margin: 0.45rem 0 0;
    border: 1px solid var(--surface-border-subtle);
    border-radius: 8px;
    background: var(--surface-muted);
    padding: 0.2rem 0.55rem 0.35rem;
}

.datos-update-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.datos-update-details ul {
    margin: 0 0 0.35rem;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: var(--text-main);
}

.datos-update-details li {
    margin: 0.15rem 0;
}

.datos-muted {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.dataset-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.dataset-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--surface-border-light);
    background: var(--surface-elevated);
}

.dataset-card-main {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
    border-radius: 6px;
}

.dataset-card-main:hover,
.dataset-card-main:focus-visible {
    outline: none;
    background: var(--surface-hover-strong);
}

.dataset-card.is-active {
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.08);
}

.dataset-card-name {
    display: block;
    font-size: 0.85rem;
}

.dataset-card-meta,
.dataset-card-profiles,
.dataset-card-date {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.dataset-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.dataset-active-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-emerald, #34d399);
}

.dataset-duplicate-hint {
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-main);
}

.pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

.pref-range {
    width: 8rem;
    max-width: 45%;
}

.pref-toggle {
    width: 2.5rem;
    height: 1.35rem;
}

.datos-help {
    border: 1px solid var(--surface-border-light);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
}

.datos-help summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.datos-help p {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    line-height: 1.4;
}

.datos-clear-wrap {
    margin: 0.5rem 0 0;
    text-align: center;
}

.datos-clear-link {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.35rem;
}

.datos-clear-link:hover {
    color: var(--error);
}

.datos-modal {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.datos-modal.hidden {
    display: none;
}

.datos-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.datos-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 22rem);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: var(--surface-overlay);
}

.datos-modal-title {
    margin: 0 0 0.65rem;
    font-size: 1rem;
}

.datos-modal-body {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.datos-modal-body p {
    margin: 0 0 0.5rem;
}

.datos-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

.export-options-card {
    width: min(100%, 24rem);
}

.export-options-lead {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.export-options-groups {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.export-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-height: 44px;
    margin: 0;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text-main);
    cursor: pointer;
}

.export-option:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.export-option:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface-muted));
}

.export-option:has(input:disabled) {
    cursor: default;
}

.export-option input {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0.15rem 0 0;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.export-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.export-option-label {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
}

.export-option-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.datos-warn-box {
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    font-size: 0.78rem;
}

.datos-warn-box ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.datos-clear-input {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 8, 18, 0.85);
    color: var(--text-main);
}

body.datos-panel-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .datos-panel-sheet {
        width: 100%;
        border-left: none;
        box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
    }
}

.export-menu {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    margin-left: auto;
}

.export-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
}

.export-menu-icon,
.export-menu-caret,
.export-menu-item svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.export-menu-caret {
    width: 0.85rem;
    height: 0.85rem;
    opacity: 0.7;
    transition: transform var(--motion-fast) var(--motion-ease);
}

.export-menu.is-open .export-menu-caret {
    transform: rotate(180deg);
}

.export-menu.is-open {
    z-index: 30;
}

.export-menu-list {
    position: absolute;
    top: calc(100% + 0.28rem);
    right: 0;
    left: auto;
    z-index: 40;
    min-width: 10.5rem;
    padding: 0.28rem;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--surface-overlay);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.25rem);
    transition: opacity var(--motion-fast) var(--motion-ease),
        transform var(--motion-fast) var(--motion-ease),
        visibility var(--motion-fast) var(--motion-ease);
}

.export-menu.is-open .export-menu-list {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0.4rem 0.55rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.export-menu-item:hover,
.export-menu-item:focus-visible {
    background: var(--surface-hover);
    color: var(--primary);
    outline: none;
}

#export-render-host {
    position: fixed;
    left: -10000px;
    top: 0;
    z-index: -1;
    pointer-events: none;
}

.export-sheet {
    box-sizing: border-box;
    width: max-content;
    min-width: 320px;
    max-width: 1400px;
    padding: 0 0 16px;
    background: #ffffff;
    color: #1e293b;
    font-family: 'Outfit', system-ui, sans-serif;
    overflow: hidden;
}

.export-sheet-accent {
    height: 5px;
    background: linear-gradient(90deg, #00e5ff 0%, #0891b2 45%, #7c3aed 100%);
}

.export-sheet-head {
    margin: 0;
    padding: 14px 22px 12px;
}

.export-sheet-brand {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0891b2;
}

.export-sheet-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
}

.export-sheet-sub {
    margin: 5px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: #64748b;
}

.export-sheet-table-wrap {
    overflow: visible;
    padding: 0 22px;
}

.export-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
    line-height: 1.3;
}

.export-sheet-table th,
.export-sheet-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
}

.export-sheet-group-row .export-sheet-group {
    background: #155e75;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
}

.export-sheet-table thead tr:not(.export-sheet-group-row) th {
    background: #0e7490;
    color: #ffffff;
    font-weight: 600;
}

.export-sheet-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.export-sheet-table td.num,
.export-sheet-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.export-sheet-table tfoot td {
    background: #e0f2fe;
    font-weight: 700;
    color: #0f172a;
    border-top: 2px solid #0891b2;
}

.export-sheet-meta {
    margin: 10px 22px 0;
    font-size: 9px;
    color: #94a3b8;
}

/* --- Motion system (opt-in: .motion-root + child roles) --- */
.motion-root {
    --motion-duration: var(--motion-panel);
}

.motion-root.is-closing {
    pointer-events: none;
}

.motion-root .motion-backdrop {
    opacity: 0;
    pointer-events: none;
}

.motion-root.is-open .motion-backdrop,
.motion-root.is-closing .motion-backdrop {
    transition: opacity var(--motion-duration) var(--motion-ease);
}

.motion-root.is-open:not(.is-closing) .motion-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.motion-root.is-open .motion-sheet,
.motion-root.is-closing .motion-sheet {
    transition: transform var(--motion-duration) var(--motion-ease);
}

.motion-root[data-motion-from="right"] .motion-sheet {
    transform: translateX(100%);
}

.motion-root[data-motion-from="left"] .motion-sheet {
    transform: translateX(-100%);
}

.motion-root[data-motion-from="bottom"] .motion-sheet {
    transform: translateY(100%);
}

.motion-root.is-open:not(.is-closing) .motion-sheet {
    transform: none;
}

.motion-root .motion-card {
    opacity: 0;
    transform: scale(0.96);
}

.motion-root.is-open .motion-card,
.motion-root.is-closing .motion-card {
    transition:
        opacity var(--motion-duration) var(--motion-ease),
        transform var(--motion-duration) var(--motion-ease);
}

.motion-root[data-motion-from="fade"] .motion-card {
    transform: none;
}

.motion-root.is-open:not(.is-closing) .motion-card {
    opacity: 1;
    transform: none;
}

.totals-dock-panel.motion-root .motion-card,
.totals-dock-panel.motion-root.is-open .motion-card,
.totals-dock-panel.motion-root.is-closing .motion-card,
.totals-dock-panel.motion-root:not(.is-open) .motion-card {
    opacity: 1;
    transform: none;
    transition: none;
}

.motion-root .motion-view {
    opacity: 0;
}

.motion-root[data-motion-from="right"] .motion-view {
    transform: translateX(1.25rem);
}

.motion-root[data-motion-from="left"] .motion-view {
    transform: translateX(-1.25rem);
}

.motion-root.is-open .motion-view,
.motion-root.is-closing .motion-view {
    transition:
        opacity var(--motion-duration) var(--motion-ease),
        transform var(--motion-duration) var(--motion-ease);
}

.motion-root.is-open:not(.is-closing) .motion-view {
    opacity: 1;
    transform: none;
}

.pwa-install-bar.motion-root {
    transform: translateY(100%);
    transition: transform var(--motion-panel) var(--motion-ease);
}

.pwa-install-bar.motion-root.is-open:not(.is-closing) {
    transform: none;
}

.wizard-shell > .motion-root,
.dashboard-stage > .motion-root {
    --motion-duration: var(--motion-fast);
    opacity: 0;
}

.wizard-shell > .motion-root.is-open,
.wizard-shell > .motion-root.is-closing,
.dashboard-stage > .motion-root.is-open,
.dashboard-stage > .motion-root.is-closing {
    transition: opacity var(--motion-duration) var(--motion-ease);
}

.wizard-shell > .motion-root.is-open:not(.is-closing),
.dashboard-stage > .motion-root.is-open:not(.is-closing) {
    opacity: 1;
    z-index: 2;
}

.wizard-shell > .motion-root.is-closing,
.dashboard-stage > .motion-root.is-closing {
    z-index: 1;
}

.dashboard-stage {
    display: grid;
    grid-template-areas: "stage";
}

.dashboard-stage > #dashboard-content,
.dashboard-stage > #empty-state {
    grid-area: stage;
}

.wizard-step.motion-root {
    --motion-duration: var(--motion-view);
    width: 100%;
    opacity: 0;
}

.wizard-step.motion-root.is-open,
.wizard-step.motion-root.is-closing {
    transition:
        opacity var(--motion-duration) var(--motion-ease),
        transform var(--motion-duration) var(--motion-ease);
}

.wizard-step.motion-root[data-motion-from="right"]:not(.is-open) {
    transform: translateX(1.25rem);
}

.wizard-step.motion-root[data-motion-from="left"]:not(.is-open) {
    transform: translateX(-1.25rem);
}

.wizard-step.motion-root[data-motion-from="fade"]:not(.is-open) {
    transform: none;
}

.wizard-step.motion-root.is-open:not(.is-closing) {
    opacity: 1;
    transform: none;
    z-index: 2;
}

.wizard-step.motion-root.is-closing {
    z-index: 1;
}

.publisher-detail-stage {
    display: grid;
    grid-template-areas: "publisher-detail";
    overflow: hidden;
}

.publisher-detail-empty.motion-root,
.publisher-detail-content.motion-root {
    grid-area: publisher-detail;
    --motion-duration: var(--motion-view);
    width: 100%;
    opacity: 0;
}

.publisher-detail-empty.motion-root.is-open,
.publisher-detail-empty.motion-root.is-closing,
.publisher-detail-content.motion-root.is-open,
.publisher-detail-content.motion-root.is-closing {
    transition:
        opacity var(--motion-duration) var(--motion-ease),
        transform var(--motion-duration) var(--motion-ease);
}

.publisher-detail-empty.motion-root[data-motion-from="right"]:not(.is-open),
.publisher-detail-content.motion-root[data-motion-from="right"]:not(.is-open) {
    transform: translateX(1.25rem);
}

.publisher-detail-empty.motion-root[data-motion-from="left"]:not(.is-open),
.publisher-detail-content.motion-root[data-motion-from="left"]:not(.is-open) {
    transform: translateX(-1.25rem);
}

.publisher-detail-empty.motion-root[data-motion-from="fade"]:not(.is-open),
.publisher-detail-content.motion-root[data-motion-from="fade"]:not(.is-open) {
    transform: none;
}

.publisher-detail-empty.motion-root.is-open:not(.is-closing),
.publisher-detail-content.motion-root.is-open:not(.is-closing) {
    opacity: 1;
    transform: none;
    z-index: 2;
}

.publisher-detail-empty.motion-root.is-closing,
.publisher-detail-content.motion-root.is-closing {
    z-index: 1;
}

.settings-tab-panel.motion-root {
    --motion-duration: var(--motion-fast);
    opacity: 0;
    transition: opacity var(--motion-duration) var(--motion-ease);
}

.settings-tab-panel.motion-root.is-open:not(.is-closing) {
    opacity: 1;
    z-index: 2;
}

.settings-tab-panel.motion-root.is-closing {
    z-index: 1;
}
