/**
 * Nucleus Dashboard — стили для нового дашборда
 * Компоненты: статистика, календарь, доска месяца, ИИ саммари, sidebar
 */

/* ============================================
   DASHBOARD CONTAINER
   ============================================ */

.nucleus-dashboard-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 0 32px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: auto;
    max-height: none;
    gap: var(--spacing-4xl);
    /* remove container background */
    background: transparent;

    /* Typography scale for dashboard hierarchy (H1-H4 + body/caption) */
    --nd-type-h1: clamp(1.75rem, 1.5rem + 0.7vw, 2.125rem);
    --nd-type-h2: clamp(1.25rem, 1.12rem + 0.45vw, 1.5rem);
    --nd-type-h3: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
    --nd-type-h4: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
    --nd-type-body: 0.9375rem;
    --nd-type-caption: 0.75rem;
    --nd-line-tight: 1.2;
    --nd-line-body: 1.45;
}

/* Весь раздел Nucleus: без общего фона на контейнере — плитки/карточки несут свой surface */
#nucleus-dashboard-container {
    width: 100%;
    max-width: 1120px;
    /* Единый горизонтальный зазор островков к краю колонки (16px) */
    --nucleus-island-h-gutter: var(--spacing-lg);
    /* Без внешнего/внутреннего отступа сверху — контент от main-content без «поля» */
    margin: 0 auto 0;
    padding: 0 0 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
    /* Без скругления: иначе нижние горизонтали/AI ряд «ломаются» по радиусу и кажутся дубликатом линий */
    border-radius: 0;
    /* Горизонталь без «scrollport»: hidden даёт scroll containment в Chromium — колесо не уходит в .main-content */
    overflow-x: clip;
    overflow-y: visible;
    flex: 0 1 auto;
    height: auto;
    min-height: auto;
    max-height: none;
    align-self: stretch;
}

body.light-theme #nucleus-dashboard-container {
    background: transparent;
}

/* Ровный внешний ритм вокруг всей секции Nucleus: низ = верх */
body.nucleus-page .content-wrapper:has(#nucleus-dashboard-container) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    /* Перебить nucleus.css overflow-x:hidden — иначе вертикальное колесо не цепляется к .main-content поверх «пустых» зон */
    overflow-x: clip !important;
    /* На всю ширину main: иначе колонка max-width 1200px оставляет «мёртвые» поля,
       и кажется, что скролл «привязан» только к #nucleus-dashboard-container.
       Вертикальный скролл остаётся у .main-content; контент по-прежнему ограничен max-width у #nucleus-dashboard-container. */
    max-width: none !important;
    width: 100%;
    box-sizing: border-box;
    /* Высота по контенту: не тянуть на весь main (иначе фиксированная «ячейка» ~высоты вьюпорта) */
    height: auto !important;
    min-height: auto !important;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/*
 * content-wrapper — column flex + align-items: center (nucleus.css) сжимает потомков по ширине контента.
 * Сайдбар fixed и в потоке не участвует — растягиваем только дашборд на всю полосу content-wrapper.
 */
body.nucleus-page .content-wrapper:has(#nucleus-dashboard-container) #nucleus-dashboard-container {
    align-self: stretch;
    width: 100%;
    box-sizing: border-box;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    flex: 0 1 auto !important;
}

#nucleus-dashboard-container .nucleus-page-header-toolbar {
    padding-top: var(--spacing-4xl); /* 32px */
    padding-bottom: 18px;
    padding-left: 24px;
    padding-right: 24px;
    margin-bottom: 0;
    border-bottom: none;
}

body.light-theme #nucleus-dashboard-container .nucleus-page-header-toolbar {
    border-bottom: none;
}

#nucleus-dashboard-container .nucleus-budgeting-main-tabs {
    margin-top: 0;
    margin-bottom: 0;
    padding: 24px;
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

body.light-theme #nucleus-dashboard-container .nucleus-budgeting-main-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

#nucleus-dashboard-container #nucleus-tab-panel-dashboard,
#nucleus-dashboard-container #nucleus-finance-planner,
#nucleus-dashboard-container #nucleus-tab-panel-operations {
    margin-top: 0;
}

/* Налоги: tabpanel внутри острова — без отдельной «второй карточки» (токены см. #nucleus-taxes-section) */
#nucleus-dashboard-container #nucleus-taxes-section {
    margin-top: 0;
}

/* Без второй «коробки»: остров уже даёт фон, здесь только внутренние отступы и ритм */
#nucleus-dashboard-container .nucleus-taxes-workspace {
    padding: clamp(0.5rem, 1.5vw, 1rem) 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

#nucleus-dashboard-container .nucleus-main-tab-panel {
    padding-top: var(--spacing-lg);
    padding-left: 0;
    padding-right: 0;
    gap: var(--spacing-xl);
}

#nucleus-dashboard-container .nucleus-dashboard-extra {
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 0;
    background: transparent;
    /* Базовый .nucleus-dashboard-extra { overflow: hidden } обрезает абсолютные гайды и даёт артефакты углов */
    overflow: visible;
}

body.light-theme #nucleus-dashboard-container .nucleus-dashboard-extra {
    background: transparent;
}

#nucleus-dashboard-container .nucleus-budget-insights {
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 0;
    background: transparent;
    border-top: none;
}

body.light-theme #nucleus-dashboard-container .nucleus-budget-insights {
    background: transparent;
    border-top: none;
}

#nucleus-dashboard-container .nucleus-calendar-section {
    background: transparent;
    border-radius: 0;
    border-bottom: none;
    padding: var(--spacing-xl) 0 var(--spacing-2xl);
    margin-bottom: 0;
}

body.light-theme #nucleus-dashboard-container .nucleus-calendar-section {
    border-bottom: none;
}

#nucleus-dashboard-container .nucleus-main-tab-panel--budget,
#nucleus-dashboard-container .nucleus-main-tab-panel--income {
    gap: 0;
}

/* Общий календарь + Budget / Income: одна колонка как раньше у вкладки Budget */
/* Зазор между календарём и активным табом (Budget или Income) = 16px */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-finance-planner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Planner не должен попадать в Dashboard: display:flex не должен перебивать hidden. */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-finance-planner[hidden] {
    display: none !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid var(--nucleus-fin-island-border);
    border-radius: 0;
    background: transparent;
    padding: 0 0 var(--spacing-md);
    margin: 0 0 var(--spacing-md);
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-planner-stats {
    border-bottom: none;
}

/* Единый отступ от главных табов до контента во всех секциях Finance Island */
#nucleus-dashboard-container .nucleus-finance-island > #nucleus-tab-panel-dashboard,
#nucleus-dashboard-container .nucleus-finance-island > #nucleus-finance-planner,
#nucleus-dashboard-container .nucleus-finance-island > #nucleus-tab-panel-operations,
#nucleus-dashboard-container .nucleus-finance-island > #nucleus-taxes-section {
    margin-top: var(--nucleus-fin-panel-top-gap, 12px) !important;
    padding-top: 0 !important;
}

/* Operations summary tabs: exactly same dark rail as Income/Taxes */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-transactions-summary-bar
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
}

body.light-theme
    #nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-transactions-summary-bar
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__value {
    margin: 0;
    font-size: clamp(1.85rem, 3.1vw, 2.45rem);
    line-height: 1.12;
    font-weight: 800;
    color: var(--color-success);
    font-variant-numeric: tabular-nums;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__value--negative {
    color: var(--color-error, #fb923c);
}

/* Вторая строка под суммой: та же типографика, белый текст (Income: эффективная почасовка) */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__value-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__hourly {
    margin: 0;
    font-size: clamp(1.85rem, 3.1vw, 2.45rem);
    line-height: 1.12;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

body.light-theme #nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__hourly {
    color: var(--color-text-primary, #0f172a);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.35;
}

/* Подпись убрана из TS; при кэше старого nucleus-dashboard.js не показываем дубликат месяца */
#nucleus-dashboard-container #nucleus-income-planner-stats .nucleus-income-planner-stats__description {
    display: none;
}

/* Operations: та же подпись убрана из разметки; скрываем остаток при кэше старого JS */
#nucleus-dashboard-container #nucleus-transactions-summary-bar .nucleus-income-planner-stats__description {
    display: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__head {
    align-self: flex-start;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__head .nucleus-budget-insights-pills {
    margin: 0;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-segmented-pill--add {
    min-width: 26px;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-planner-currency-inline {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-planner-currency-inline__trigger {
    min-width: 90px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-planner-currency-inline__chevron {
    opacity: 0.7;
    font-size: 0.95em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transform: translateY(-1px);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-planner-currency-inline__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 90px;
    max-height: 180px;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid var(--color-border-primary);
    background: var(--color-bg-primary, #141821) !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 20;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-planner-currency-inline__option {
    width: 100%;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    padding: 0 8px;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-planner-currency-inline__option:hover {
    background: color-mix(in srgb, var(--color-brand-primary, #3b82f6) 16%, transparent);
}


#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-income-planner-stats__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: flex-end;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-planner-stats {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-planner-stats .nucleus-income-planner-stats__main {
    align-items: center;
}


#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-planner-stats .nucleus-transactions-summary {
    display: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-planner-stats .nucleus-transactions-summary-item {
    display: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-planner-stats .nucleus-transactions-summary-label {
    display: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-planner-stats .nucleus-transactions-summary-value {
    display: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-planner-stats .nucleus-income-planner-stats__value {
    color: var(--color-text-primary);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-summary-inline {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    min-height: 20px;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-summary-inline__item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-summary-inline__value {
    color: var(--color-text-primary);
    font-weight: 700;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-summary-inline__value.is-positive {
    color: var(--color-success);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-summary-inline__value.is-negative {
    color: var(--color-error);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-summary-inline__dot {
    opacity: 0.55;
}

/* Operations summary bar: force same action buttons as Income/Taxes */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-transactions-summary-bar
    .nucleus-income-planner-stats__actions
    .nucleus-taxes-pdf-btn {
    min-height: 44px !important;
    height: auto !important;
    border-radius: 999px !important;
    padding: 0.55rem 1.25rem !important;
    border: 1px solid var(--color-border-secondary) !important;
    background: transparent !important;
    font-size: var(--font-size-sm) !important;
    font-weight: var(--font-weight-semibold) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-transactions-summary-bar
    .nucleus-income-planner-stats__actions
    .nucleus-taxes-pdf-btn:hover:not(:disabled) {
    background: var(--color-bg-input) !important;
    border-color: var(--color-border-tertiary) !important;
}

/* ============================================
  TYPOGRAPHY SYSTEM (Nucleus Dashboard)
  H1 — page-level title
  H2 — section title
  H3 — card title
  H4 — block/subsection title
  ============================================ */

.nucleus-dashboard-container .nucleus-ai-summary-title,
.nucleus-dashboard-container .nucleus-month-board-card-title,
.nucleus-dashboard-container .nucleus-calendar-title {
    font-size: var(--nd-type-h2);
    line-height: var(--nd-line-tight);
    letter-spacing: -0.018em;
}

.nucleus-dashboard-container .nucleus-month-board-empty-title,
.nucleus-dashboard-container .nucleus-month-board-budget-block__title,
.nucleus-dashboard-container .nucleus-calendar-header-date {
    font-size: var(--nd-type-h3);
    line-height: var(--nd-line-tight);
    letter-spacing: -0.012em;
}

.nucleus-dashboard-container .nucleus-month-board-list-title,
.nucleus-dashboard-container .nucleus-month-board-stat-label,
.nucleus-dashboard-container .nucleus-month-board-budget-block__expenses-label,
.nucleus-dashboard-container .nucleus-stat-label {
    font-size: var(--nd-type-h4);
    line-height: 1.3;
}

.nucleus-dashboard-container .nucleus-ai-summary-content,
.nucleus-dashboard-container .nucleus-month-board-card-named,
.nucleus-dashboard-container .nucleus-month-board-budget-block__income-main {
    font-size: var(--nd-type-body);
    line-height: var(--nd-line-body);
}

.nucleus-dashboard-container .nucleus-month-board-card-date,
.nucleus-dashboard-container .nucleus-month-board-budget-block__period,
.nucleus-dashboard-container .nucleus-month-board-budget-expense-row,
.nucleus-dashboard-container .nucleus-month-board-budget-expenses-empty,
.nucleus-dashboard-container .nucleus-calendar-day,
.nucleus-dashboard-container .nucleus-calendar-legend-text:not(.nucleus-calendar-header-legend-label) {
    font-size: var(--nd-type-caption);
}

/* Page Header */
.nucleus-page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
}

/* Top toolbar: page title + primary entry to open Financial Mirror drawer */
.nucleus-page-header-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    width: 100%;
    margin-top: 0;
    /* Как у блока с заголовком в App Suite (.content-main-title — padding-top 6xl) */
    padding-top: var(--spacing-6xl);
}

/* Заголовок по ширине текста + «Demo» сразу справа от него (без растягивания h1 на всю полосу) */
.nucleus-page-header-toolbar__title-group {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
}

.nucleus-page-header-toolbar__title-group .nucleus-page-header-demo-caption {
    font-size: var(--nd-type-caption, 0.75rem);
    line-height: 1.25;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.42));
    flex: 0 0 auto;
    align-self: flex-start;
    white-space: nowrap;
    user-select: none;
}

body.light-theme .nucleus-page-header-toolbar__title-group .nucleus-page-header-demo-caption {
    color: var(--color-text-tertiary, rgba(24, 24, 27, 0.5));
}

/* Тот же визуал, что App Suite (.content-main-title в style.css); боковые/нижние отступы заголовка обнуляем — верх задаёт тулбар */
.nucleus-page-header-toolbar__title.content-main-title {
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

/* В тулбаре Nucleus: h1 по ширине текста (block + width:auto тянет строку — fit-content прижимает «Demo» к заголовку) */
.nucleus-page-header-toolbar__title-group > .nucleus-page-header-toolbar__title.content-main-title {
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}

.nucleus-budgeting-main-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

#nucleus-tab-panel-dashboard,
#nucleus-tab-panel-budget,
#nucleus-tab-panel-operations,
#nucleus-taxes-section {
    margin-top: var(--spacing-sm);
}

/* display:flex перебивает [hidden] у панелей вкладок */
#nucleus-tab-panel-dashboard[hidden],
#nucleus-tab-panel-budget[hidden],
#nucleus-tab-panel-operations[hidden],
#nucleus-tab-panel-income[hidden],
#nucleus-taxes-section[hidden] {
    display: none !important;
}

.nucleus-main-tab-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
}

#nucleus-tab-panel-dashboard.is-active-panel,
#nucleus-tab-panel-budget.is-active-panel,
#nucleus-tab-panel-operations.is-active-panel,
#nucleus-taxes-section.is-active-panel {
    animation: nucleusBudgetPanelIn 220ms ease-out;
}

.nucleus-dashboard-ai-panel {
    width: 100%;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-xl) var(--spacing-2xl);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    box-sizing: border-box;
}

.nucleus-dashboard-ai-placeholder {
    margin: 0;
    font-family: var(--font-primary);
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-tertiary);
    width: 100%;
    max-width: 72ch;
    overflow-wrap: anywhere;
}

body.light-theme .nucleus-dashboard-ai-panel {
    background: rgba(0, 0, 0, 0.02);
}

/* AI внутри единой панели — без отдельного фона и отступа сверху */
.nucleus-dashboard-extra-grid #nucleus-dashboard-ai-panel {
    margin-top: 0;
    background: transparent;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 56px;
    padding: 14px 24px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    /* Не «карточка»: у .nucleus-dashboard-ai-panel иначе тянется border-radius: 20px */
    border-radius: 0;
    box-shadow: none;
}

body.light-theme .nucleus-dashboard-extra-grid #nucleus-dashboard-ai-panel {
    background: transparent;
    border-top-color: rgba(0, 0, 0, 0.06);
}

/* ─── Вкладка «Налоги»: секции разделены линиями, без лишних вложенных карточек ─── */
#nucleus-taxes-section {
    --nucleus-taxes-r: 20px;
    --nucleus-taxes-r-sm: 14px;
}

.nucleus-taxes-section {
    border-radius: 0;
    padding: clamp(0.75rem, 2vw, 1.25rem) 0;
    border: none;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}

body.light-theme .nucleus-taxes-section {
    background: transparent;
    box-shadow: none;
}

/* Мои налоги: тулбар, три колонки playbook, дисклеймер */
.nucleus-taxes-workspace {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(0.875rem, 1.75vw, 1.25rem);
    min-width: 0;
}

/* Заголовок + лид; селекты Country/Year — соседний блок .nucleus-taxes-toolbar (не внутри header) */
.nucleus-taxes-head {
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    border-bottom: none;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}

.nucleus-taxes-title {
    font-family: var(--font-primary);
    font-size: clamp(var(--font-size-xl), 2.5vw, var(--font-size-3xl));
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--color-text-primary);
    margin: 0 0 0.5rem;
}

.nucleus-taxes-lead {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    line-height: 1.55;
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 42rem;
}

.nucleus-taxes-checklist-disclaimer {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    line-height: 1.45;
    color: var(--color-text-tertiary);
    margin: 0.65rem 0 0;
    max-width: 42rem;
}

.nucleus-taxes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Селекты налогов — те же invoice-currency-* компоненты, что календарь (selects.css) */
.nucleus-taxes-selects {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    padding: 4px;
    border-radius: var(--nucleus-taxes-r-sm);
    background: var(--color-bg-tertiary);
    border: none;
    box-sizing: border-box;
}

.nucleus-taxes-toolbar .nucleus-taxes-field {
    min-width: 0;
    padding: 0.35rem 0.65rem 0.5rem;
    flex: 1 1 10rem;
}

@media (min-width: 520px) {
    .nucleus-taxes-toolbar .nucleus-taxes-field {
        flex: 0 1 auto;
    }

    .nucleus-taxes-toolbar .nucleus-taxes-field + .nucleus-taxes-field {
        border-left: 1px solid var(--color-border-tertiary);
    }
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-wrapper {
    display: inline-block;
    width: 100%;
    max-width: 100%;
    vertical-align: middle;
}

/* Выровнять с min-height инпутов налогов (44px); иначе selects.css даёт wrapper 41px при триггере 44px */
#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-wrapper,
#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-wrapper,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-toolbar .invoice-currency-wrapper,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-wrapper {
    height: auto;
    min-height: 44px;
}

@media (min-width: 520px) {
    #nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-wrapper {
        width: auto;
    }
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-select {
    width: 100%;
    max-width: min(100%, 22rem);
    min-height: 44px;
    box-sizing: border-box;
    border: none;
    background: transparent;
    border-radius: calc(var(--nucleus-taxes-r-sm) - 2px);
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-select:hover {
    background: var(--color-bg-tertiary);
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-select .currency-value {
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 16rem;
    font-weight: var(--font-weight-medium);
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-dropdown {
    left: 0;
    right: auto;
    width: 100%;
    min-width: max(100%, 11rem);
    max-width: min(380px, 92vw);
}

/* Селект страны: поиск сверху, список скроллится отдельно (основной остров + клон в дровере) */
#nucleus-dashboard-container .nucleus-taxes-toolbar .nucleus-taxes-country-dropdown,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-dropdown {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .nucleus-taxes-country-dd-search-wrap,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-dd-search-wrap {
    flex-shrink: 0;
    padding: 8px 8px 10px;
    border-bottom: none;
    background: var(--color-bg-secondary);
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .nucleus-taxes-country-search-input,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    border-radius: var(--radius-xl);
    border: var(--color-input-border);
    background: var(--color-input-bg);
    color: var(--color-input-text);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .nucleus-taxes-country-search-input::placeholder,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-search-input::placeholder {
    color: var(--color-input-placeholder);
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .nucleus-taxes-country-search-input:hover,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-search-input:hover {
    background: var(--color-input-bg-hover);
}

#nucleus-dashboard-container .nucleus-taxes-toolbar .nucleus-taxes-country-search-input:focus,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-search-input:focus {
    outline: none;
    background: var(--color-input-bg-focus);
    border: var(--color-input-border);
}

#nucleus-dashboard-container
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-dropdown
    .invoice-currency-dropdown-inner,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .nucleus-taxes-country-dropdown
    .invoice-currency-dropdown-inner {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(42vh, 280px);
    overflow-y: auto;
}

/* Портальная версия country dropdown (invoice-dd переносит .nucleus-taxes-country-dropdown в body) */
body > .nucleus-taxes-country-dropdown[data-fm-dropdown-floating='1'],
body > .nucleus-taxes-country-dropdown {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg-secondary) !important;
    border: none !important;
}

body > .nucleus-taxes-country-dropdown .nucleus-taxes-country-dd-search-wrap {
    display: block;
    flex: 0 0 auto;
    padding: 8px 8px 10px;
    border-bottom: none;
    background: var(--color-bg-secondary);
    box-sizing: border-box;
}

body > .nucleus-taxes-country-dropdown .nucleus-taxes-country-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    border-radius: var(--radius-xl);
    border: var(--color-input-border);
    background: var(--color-input-bg);
    color: var(--color-input-text);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
}

body > .nucleus-taxes-country-dropdown .nucleus-taxes-country-search-input::placeholder {
    color: var(--color-input-placeholder);
}

body > .nucleus-taxes-country-dropdown .nucleus-taxes-country-search-input:hover {
    background: var(--color-input-bg-hover);
}

body > .nucleus-taxes-country-dropdown .nucleus-taxes-country-search-input:focus {
    outline: none;
    background: var(--color-input-bg-focus);
    border: var(--color-input-border);
}

body > .nucleus-taxes-country-dropdown .invoice-currency-dropdown-inner {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(42vh, 280px);
    overflow-y: auto;
}

.nucleus-taxes-dd-region {
    padding: 0.35rem 0.65rem 0.2rem;
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    pointer-events: none;
    border-bottom: none;
    margin-top: 0.15rem;
}

.nucleus-taxes-dd-region:first-child {
    margin-top: 0;
    padding-top: 0.25rem;
}

.nucleus-taxes-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 10rem;
}

/* Как у tabpanel: flex перебивает встроенное [hidden]{display:none} — поле остаётся в grid и метки наезжают */
.nucleus-taxes-field[hidden] {
    display: none !important;
}

.nucleus-taxes-label {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-tertiary);
}

/* Как основные кнопки сайта (variables + пилюля, как Add / FM) */
.nucleus-taxes-pdf-btn {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    background: transparent;
    border: 1px solid var(--color-border-secondary);
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    min-height: 44px;
    cursor: pointer;
    margin-top: 0;
    box-sizing: border-box;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.12s ease;
}

.nucleus-taxes-pdf-btn:hover:not(:disabled) {
    background: var(--color-bg-input);
    border-color: var(--color-border-tertiary);
}

.nucleus-taxes-pdf-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.nucleus-taxes-pdf-btn:focus-visible {
    outline: 2px solid var(--color-button-primary-focus);
    outline-offset: 2px;
}

.nucleus-taxes-pdf-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.nucleus-taxes-pdf-btn--primary {
    background: var(--color-button-primary);
    border: none;
    color: var(--color-button-primary-text);
}

.nucleus-taxes-pdf-btn--primary:hover:not(:disabled) {
    background: var(--color-button-primary-hover);
    color: var(--color-button-primary-text);
}

.nucleus-taxes-pdf-btn--secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-secondary);
}

.nucleus-taxes-pdf-btn--secondary:hover:not(:disabled) {
    background: var(--color-bg-input);
}

/* Вкладка налогов: блок «контекст для чата» (FM / ассистент) */
.nucleus-taxes-ai {
    margin-top: 0;
    max-width: none;
    padding: 1.25rem 0 0;
    border: none;
    border-top: 1px solid var(--color-border-secondary);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}

.nucleus-taxes-ai-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
    margin: 0 0 0.5rem;
}

.nucleus-taxes-ai-lead {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: 1.55;
    color: var(--color-text-secondary);
    margin: 0 0 0.65rem;
    max-width: 52rem;
}

.nucleus-taxes-ai-disclaimer {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    line-height: 1.45;
    color: var(--color-text-tertiary);
    margin: 0 0 1rem;
    max-width: 52rem;
}

.nucleus-taxes-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.nucleus-taxes-ai-actions .nucleus-taxes-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.nucleus-taxes-ai-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: inherit;
}

.nucleus-taxes-ai-btn-icon svg {
    width: 100%;
    height: 100%;
}

.nucleus-taxes-ai-btn-label {
    min-width: 0;
}

/* Блок брифа на странице + цель для html2pdf */
.nucleus-taxes-brief {
    margin-top: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border-secondary);
}

.nucleus-taxes-brief-doc {
    border-radius: var(--nucleus-taxes-r-sm);
    border: 1px solid var(--color-border-secondary);
    background: var(--color-bg-tertiary);
    padding: 1.25rem 1.35rem;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
}

.nucleus-taxes-brief-doc-head {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border-secondary);
}

.nucleus-taxes-brief-doc-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-xs);
    line-height: 1.25;
}

.nucleus-taxes-brief-doc-meta {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.45;
}

.nucleus-taxes-brief-doc-profile {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: var(--spacing-sm) 0 0;
    line-height: 1.55;
    white-space: pre-line;
}

.nucleus-taxes-brief-doc-context {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin: var(--spacing-md) 0 0;
    line-height: 1.5;
}

.nucleus-taxes-brief-block {
    margin-bottom: var(--spacing-lg);
}

.nucleus-taxes-brief-block:last-of-type {
    margin-bottom: var(--spacing-md);
}

.nucleus-taxes-brief-block-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-sm);
    letter-spacing: 0.02em;
}

.nucleus-taxes-brief-list {
    margin: 0;
    padding-left: 1.15rem;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.nucleus-taxes-brief-list li {
    margin-bottom: var(--spacing-sm);
}

.nucleus-taxes-brief-list li:last-child {
    margin-bottom: 0;
}

.nucleus-taxes-brief-disclaimer {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    line-height: 1.5;
    color: var(--color-text-tertiary);
    margin: var(--spacing-lg) 0 0;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border-secondary);
}

.nucleus-taxes-brief-doc-footer {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    line-height: 1.45;
    color: var(--color-text-tertiary);
    margin: var(--spacing-md) 0 0;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border-secondary);
}

/* Бриф / превью: база как document-generator (~A4); на вкладке налогов остров brief переопределяет ширину/высоту (см. #nucleus-taxes-island-brief) */
.nucleus-taxes-brief-doc--report {
    --tax-report-ink: #111827;
    --tax-report-body: #374151;
    --tax-report-muted: #6b7280;
    --tax-report-rule: #e5e7eb;
    /* Одна толщина линий внутри листа (раньше mix rule / rule-strong давал «рваный» вид) */
    --tax-report-rule-strong: #e5e7eb;
    background: #ffffff !important;
    color: var(--tax-report-ink);
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 40px rgba(2, 6, 23, 0.16) !important;
    padding: 50px !important;
    box-sizing: border-box !important;
    width: min(100%, 794px);
    min-height: 1123px;
    margin-left: 0;
    margin-right: auto;
    /* Футер и дисклеймер внизу «листа», если контент короче min-height */
    display: flex;
    flex-direction: column;
}

/* Лист отчёта: шапка и сетка как document-generator (.dg-generated-doc) */
.nucleus-taxes-report-doc-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: 1.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--tax-report-rule);
}

/* Первая строка: бренд + заголовок слева, мета справа; filer ниже на всю ширину листа */
.nucleus-taxes-report-doc-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    width: 100%;
    padding-bottom: 32px;
}

.nucleus-taxes-report-doc-header-main {
    flex: 1 1 auto;
    min-width: 0;
}

.nucleus-taxes-report-brand {
    font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tax-report-ink);
    margin-bottom: 0.5rem;
}

.nucleus-taxes-brief-doc--report .nucleus-taxes-report-doc-title,
.nucleus-taxes-report-doc .nucleus-taxes-report-doc-title {
    font-family: var(--font-primary);
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: var(--tax-report-ink) !important;
    margin: 0 0 0.35rem !important;
    line-height: 1.2 !important;
}

.nucleus-taxes-report-doc-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--tax-report-body);
    max-width: 28rem;
}

.nucleus-taxes-brief-doc--report .nucleus-taxes-report-doc-subtitle[hidden] {
    display: none !important;
}

/* Как .nucleus-taxes-report-kv-row: подпись слева, значение справа на всю ширину шапки */
.nucleus-taxes-report-doc-filer {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.65rem 0 0;
    width: 100%;
    max-width: none;
    align-self: stretch;
    box-sizing: border-box;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--tax-report-body);
}

.nucleus-taxes-report-doc-filer-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(5rem, max-content);
    align-items: baseline;
    column-gap: 1rem;
    row-gap: 0.2rem;
}

.nucleus-taxes-report-doc-filer-k {
    min-width: 0;
    padding-right: 0.25rem;
    color: var(--tax-report-muted);
    font-weight: 400;
}

.nucleus-taxes-report-doc-filer-v {
    min-width: 0;
    max-width: 100%;
    font-weight: 600;
    color: var(--tax-report-ink);
    text-align: right;
    justify-self: end;
    overflow-wrap: break-word;
}

.nucleus-taxes-report-meta {
    flex-shrink: 0;
    min-width: 11rem;
    text-align: right;
    font-size: 0.75rem;
    line-height: 1.55;
    color: var(--tax-report-body);
}

.nucleus-taxes-report-meta[hidden] {
    display: none !important;
}

.nucleus-taxes-report-meta-line {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.nucleus-taxes-report-meta-line:last-child {
    margin-bottom: 0;
}

.nucleus-taxes-report-meta-k {
    color: var(--tax-report-muted);
}

.nucleus-taxes-report-meta-v {
    font-weight: 600;
    color: var(--tax-report-ink);
}

.nucleus-taxes-brief-doc--report > .nucleus-taxes-report-block {
    margin: 0;
    padding: 1.125rem 0;
    border-bottom: 1px solid var(--tax-report-rule);
}

.nucleus-taxes-brief-doc--report > .nucleus-taxes-report-totals-wrap {
    border-bottom: none;
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
}

/* Класс --divider оставлен в разметке для семантики; линия задаётся у всех блоков выше */
.nucleus-taxes-report-block--divider {
    border-bottom: none;
}

.nucleus-taxes-report-block-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tax-report-muted);
    margin: 0 0 0.65rem;
}

/* Белый лист: не даём h3/p унаследовать светлый цвет текста от тёмного острова */
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report {
    color: var(--tax-report-ink) !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-block-title {
    color: var(--tax-report-muted) !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-doc-subtitle,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-doc-filer,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-doc-filer-line,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-kv-row,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-table,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-meta-line,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-total-row,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-empty,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-totals-hint {
    color: var(--tax-report-body) !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-doc-filer-k {
    color: var(--tax-report-muted) !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-doc-filer-v {
    color: var(--tax-report-ink) !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-table thead th {
    color: var(--tax-report-muted) !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-table thead th:nth-child(3),
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-table thead th:nth-child(4) {
    text-align: right !important;
}

/* PDF для консультанта: 3 колонки в tbody — убираем четвёртую из раскладки (html2pdf/печать). */
#nucleus-taxes-brief-print[data-tax-brief-layout="advisor"].nucleus-taxes-brief-doc--report
    col.nucleus-taxes-report-col-tax {
    visibility: collapse;
    width: 0;
    min-width: 0;
}

#nucleus-taxes-brief-print[data-tax-brief-layout="advisor"].nucleus-taxes-brief-doc--report
    #nucleus-taxes-report-th-tax {
    visibility: collapse;
    width: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: 0;
    line-height: 0;
}

#nucleus-taxes-brief-print[data-tax-brief-layout="advisor"].nucleus-taxes-brief-doc--report
    .nucleus-taxes-report-table
    thead
    th:nth-child(3) {
    text-align: right !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-kv-v,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-meta-v,
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report .nucleus-taxes-report-total-row--strong {
    color: var(--tax-report-ink) !important;
}

.nucleus-taxes-report-kv {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.nucleus-taxes-report-kv-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(5rem, max-content);
    align-items: baseline;
    column-gap: 1rem;
    row-gap: 0.2rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.nucleus-taxes-report-kv-k {
    color: var(--tax-report-muted);
    min-width: 0;
    padding-right: 0.25rem;
}

.nucleus-taxes-report-kv-v {
    font-weight: 600;
    color: var(--tax-report-ink);
    text-align: right;
    justify-self: end;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

.nucleus-taxes-report-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.nucleus-taxes-report-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.8125rem;
    color: var(--tax-report-body);
}

/* Фиксированные доли ширины — заголовки и цифры в одной колонке */
.nucleus-taxes-report-col-date {
    width: 5.5rem;
}

.nucleus-taxes-report-col-income {
    width: 6.75rem;
}

.nucleus-taxes-report-col-tax {
    width: 6.75rem;
}

.nucleus-taxes-report-col-desc {
    width: auto;
}

.nucleus-taxes-report-table thead th {
    text-align: left;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tax-report-muted);
    padding: 0 0.4rem 0.45rem;
    border-bottom: 1px solid var(--tax-report-rule);
    vertical-align: bottom;
}

.nucleus-taxes-report-table thead th:first-child,
.nucleus-taxes-report-table tbody td:first-child {
    padding-left: 0;
}

.nucleus-taxes-report-table thead th:nth-child(3),
.nucleus-taxes-report-table thead th:nth-child(4),
.nucleus-taxes-report-table tbody td.nucleus-taxes-report-table-num {
    text-align: right;
}

.nucleus-taxes-report-table tbody td {
    padding: 0.45rem 0.4rem;
    border-bottom: 1px solid var(--tax-report-rule);
    vertical-align: top;
}

.nucleus-taxes-report-table thead th:last-child,
.nucleus-taxes-report-table tbody td:last-child {
    padding-right: 0;
}

.nucleus-taxes-report-table tbody td:nth-child(2) {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.nucleus-taxes-report-table tbody tr:last-child td {
    border-bottom: none;
}

.nucleus-taxes-report-table-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nucleus-taxes-report-empty {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--tax-report-muted);
}

.nucleus-taxes-report-totals-wrap {
    padding-bottom: 0;
    margin-bottom: 0.35rem;
    border-bottom: none;
}

.nucleus-taxes-report-totals {
    margin-top: 0;
}

.nucleus-taxes-report-total-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(5rem, max-content);
    align-items: baseline;
    column-gap: 1rem;
    font-size: 0.875rem;
    padding: 0.3rem 0;
    color: var(--tax-report-body);
}

.nucleus-taxes-report-total-row > span:first-child {
    min-width: 0;
    padding-right: 0.25rem;
}

.nucleus-taxes-report-total-row > span:last-child {
    justify-self: end;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nucleus-taxes-report-total-row--strong {
    font-weight: 700;
    color: var(--tax-report-ink);
    font-size: 0.9375rem;
}

/* Отступ перед итогами без линии — разделение уже даёт border-bottom у блока таблицы */
.nucleus-taxes-report-totals > .nucleus-taxes-report-total-row--strong:first-child {
    margin-top: 0.35rem;
    padding-top: 0.55rem;
}

.nucleus-taxes-report-totals-hint {
    margin: 0.65rem 0 0;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--tax-report-muted);
}

@media (max-width: 540px) {
    .nucleus-taxes-report-doc-header-top {
        flex-direction: column;
    }

    .nucleus-taxes-report-meta {
        text-align: left;
        width: 100%;
    }

    .nucleus-taxes-report-meta-line {
        justify-content: flex-start;
    }
}

.nucleus-taxes-brief-doc--report .nucleus-taxes-brief-disclaimer {
    font-size: 0.75rem !important;
    line-height: 1.55 !important;
    color: var(--tax-report-muted) !important;
    margin: 1.5rem 0 0 !important;
    padding-top: 1rem !important;
    border-top: 1px solid var(--tax-report-rule) !important;
}

.nucleus-taxes-brief-doc--report .nucleus-taxes-brief-doc-footer {
    font-size: 0.6875rem !important;
    line-height: 1.45 !important;
    color: var(--tax-report-muted) !important;
    margin: 1rem 0 0 !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid var(--tax-report-rule) !important;
}

/* Футер внизу листа: без видимого дисклеймера — auto на footer; с дисклеймером — auto на нём, футер сразу под ним */
#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report:not(
        :has(.nucleus-taxes-brief-disclaimer:not([hidden]))
    )
    .nucleus-taxes-brief-doc-footer {
    margin-top: auto !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report:has(.nucleus-taxes-brief-disclaimer:not([hidden]))
    .nucleus-taxes-brief-disclaimer {
    margin-top: auto !important;
}

#nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report:has(.nucleus-taxes-brief-disclaimer:not([hidden]))
    .nucleus-taxes-brief-doc-footer {
    margin-top: 0.65rem !important;
}

.nucleus-taxes-brief-actions,
.nucleus-taxes-intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    margin-top: 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media print {
    .nucleus-taxes-print-brief-active body * {
        visibility: hidden;
    }

    .nucleus-taxes-print-brief-active #nucleus-taxes-brief-print,
    .nucleus-taxes-print-brief-active #nucleus-taxes-brief-print * {
        visibility: visible;
    }

    .nucleus-taxes-print-brief-active #nucleus-taxes-brief-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 1rem;
        border: none;
        box-shadow: none;
        background: #fff !important;
        color: #111 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Профиль налогоплательщика (этап 1); Country/Year — первый блок внутри секции, скроллится с полями */
.nucleus-taxes-profile {
    margin-bottom: 0;
    padding: 1.25rem 0;
    border: none;
    border-top: 1px solid var(--color-border-secondary);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
}

.nucleus-taxes-profile > .nucleus-taxes-toolbar {
    width: 100%;
    margin-bottom: var(--spacing-lg);
}

.nucleus-taxes-profile-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    margin: 0 0 1rem;
}

/* Профиль: на широком экране сетка 2×2 — (1)(2) / (3)(4); на узком — колонка */
.nucleus-taxes-profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
}

/* Ячейки сжимаются в grid (иначе min-width:auto даёт налезание колонок друг на друга) */
.nucleus-taxes-profile-grid > .nucleus-taxes-field {
    min-width: 0;
}

@media (max-width: 639px) {
    .nucleus-taxes-field--profile-note {
        grid-column: 1 / -1;
    }
}

@media (min-width: 640px) {
    .nucleus-taxes-profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            'tax-profile-name tax-profile-name'
            'tax-profile-business tax-profile-business'
            'tax-profile-address tax-profile-address'
            'tax-profile-contact tax-profile-contact'
            'tax-profile-doc tax-profile-taxid'
            'tax-profile-id-desc tax-profile-id-desc'
            'tax-profile-emp tax-profile-res'
            'tax-profile-note tax-profile-cur'
            'tax-profile-rate tax-profile-rate'
            'tax-profile-fx tax-profile-fx';
    }

    .nucleus-taxes-field--profile-filer-name {
        grid-area: tax-profile-name;
    }

    .nucleus-taxes-field--profile-business-name {
        grid-area: tax-profile-business;
    }

    .nucleus-taxes-field--profile-address {
        grid-area: tax-profile-address;
    }

    .nucleus-taxes-field--profile-contact {
        grid-area: tax-profile-contact;
    }

    .nucleus-taxes-field--profile-document-id {
        grid-area: tax-profile-doc;
    }

    .nucleus-taxes-field--profile-tax-id {
        grid-area: tax-profile-taxid;
    }

    .nucleus-taxes-field--profile-id-doc-desc {
        grid-area: tax-profile-id-desc;
    }

    .nucleus-taxes-field--profile-employment {
        grid-area: tax-profile-emp;
    }

    .nucleus-taxes-field--profile-residency {
        grid-area: tax-profile-res;
    }

    .nucleus-taxes-field--profile-note {
        grid-area: tax-profile-note;
    }

    .nucleus-taxes-field--profile-currency {
        grid-area: tax-profile-cur;
    }

    .nucleus-taxes-field--profile-tax-rate {
        grid-area: tax-profile-rate;
    }

    .nucleus-taxes-field--profile-fx-note {
        grid-area: tax-profile-fx;
    }

    /* Скрытое поле резидентства: валюта на всю строку «note + cur» */
    .nucleus-taxes-field--profile-note[hidden] + .nucleus-taxes-field--profile-currency {
        grid-area: auto;
        grid-column: 1 / -1;
        grid-row: 8;
    }
}

.nucleus-taxes-field-hint {
    margin: 0.35rem 0 0;
    font-size: var(--font-size-xs);
    line-height: 1.45;
    color: var(--color-text-tertiary);
    max-width: 36rem;
}

.nucleus-taxes-profile-input {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
    border: none;
    border-radius: var(--nucleus-taxes-r-sm);
    padding: 0.55rem 0.75rem;
    min-height: 44px;
    box-sizing: border-box;
    width: 100%;
    max-width: 22rem;
}

@media (min-width: 640px) {
    .nucleus-taxes-profile-grid .nucleus-taxes-profile-input {
        max-width: none;
    }
}

.nucleus-taxes-profile-input:focus-visible {
    outline: 2px solid var(--color-button-primary-focus);
    outline-offset: 2px;
}

#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
    vertical-align: middle;
}

#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
    border-radius: var(--nucleus-taxes-r-sm);
    background: var(--color-bg-tertiary);
    border: none;
}

#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-select .currency-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-select:hover {
    background: var(--color-bg-secondary);
}

#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-dropdown {
    left: 0;
    right: auto;
    width: 100%;
    min-width: max(100%, 11rem);
    max-width: min(360px, 92vw);
}

/*
 * Дровер налогов — сестринский к #nucleus-dashboard-container, не его потомок:
 * без этого блока не действуют правила выше, длинный текст в .currency-value ломает селект (flex без ellipsis).
 */
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
    vertical-align: middle;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
    border-radius: var(--nucleus-taxes-r-sm);
    background: var(--fm-drawer-field-fill) !important;
    border: none;
    font-size: var(--font-size-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-select .currency-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-select:hover,
#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-profile
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: var(--fm-drawer-field-fill-hover) !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-dropdown {
    left: 0;
    right: auto;
    width: 100%;
    min-width: max(100%, 11rem);
    max-width: min(360px, 92vw);
}

/* Те же заливки, что у FM в .nucleus-sidebar-content (#financial-mirror-container) */
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input {
    background: var(--fm-drawer-field-fill) !important;
    transition: background 0.15s ease, color 0.15s ease;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input:hover {
    background: var(--fm-drawer-field-fill-hover) !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input:focus,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input:focus-visible {
    background: var(--fm-drawer-field-fill) !important;
}

.nucleus-taxes-context-stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-top: 0;
    border-top: none;
}

.nucleus-taxes-context-stack:has(.nucleus-taxes-context:not([hidden])) {
    padding-top: 0.5rem;
    margin-top: 0;
    border-top: none;
}

/* Скруглённый блок: слева «столбик»-акцент (не border-left), справа текст */
.nucleus-taxes-context {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin: 0;
    padding: 0.75rem 1rem 0.75rem 0.85rem;
    border-radius: var(--nucleus-taxes-r-sm);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-tertiary);
    box-sizing: border-box;
}

.nucleus-taxes-context::before {
    content: '';
    flex: 0 0 4px;
    align-self: stretch;
    border-radius: 999px;
    background: var(--color-accent-primary);
}

.nucleus-taxes-year-context {
    margin-bottom: 0;
}

.nucleus-taxes-brief-doc-year {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin: var(--spacing-sm) 0 0;
    line-height: 1.5;
}

.nucleus-taxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
    gap: 1rem;
    margin-bottom: 0;
}

.nucleus-taxes-card {
    border-radius: var(--nucleus-taxes-r-sm);
    border: 1px solid var(--color-border-tertiary);
    background: var(--color-bg-tertiary);
    padding: 1rem 1.1rem;
    box-sizing: border-box;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Зелёный оттенок вместо warning — в духе акцента/успеха, без «жёлтой тревоги» */
.nucleus-taxes-card--limits {
    border-color: color-mix(in srgb, var(--color-success) 32%, var(--color-border-tertiary));
    background: color-mix(in srgb, var(--color-success) 6%, var(--color-bg-tertiary));
}

.nucleus-taxes-card-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0 0 0.85rem;
    letter-spacing: -0.01em;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--color-border-secondary);
}

.nucleus-taxes-list {
    margin: 0;
    padding-left: 1.15rem;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.nucleus-taxes-list li {
    margin-bottom: var(--spacing-sm);
}

.nucleus-taxes-list li:last-child {
    margin-bottom: 0;
}

.nucleus-taxes-list--checklist > li {
    border-bottom: 1px solid var(--color-border-secondary);
    /* воздух между текстом/кнопками строки и разделительной линией */
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.nucleus-taxes-list--checklist > li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Чеклист налогов: статусы и свои пункты */
.nucleus-taxes-list--checklist .nucleus-taxes-check-item {
    list-style: none;
    margin-left: -1.15rem;
    padding-left: 0;
}

.nucleus-taxes-check-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

/* Отступ под многострочный текст + descenders (y, g, p) до линии пункта */
.nucleus-taxes-check-text {
    flex: 1;
    min-width: 0;
    margin-bottom: var(--spacing-md);
}

.nucleus-taxes-check-tools {
    display: inline-flex;
    flex-shrink: 0;
    gap: 2px;
    border-radius: 999px;
    border: 1px solid var(--color-border-secondary);
    padding: 3px;
    background: var(--color-bg-secondary);
}

.nucleus-taxes-check-btn {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: 1;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 0.4rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
}

.nucleus-taxes-check-btn:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.nucleus-taxes-check-btn.is-active {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.nucleus-taxes-check-btn:focus-visible {
    outline: 2px solid var(--color-button-primary-focus);
    outline-offset: 1px;
}

.nucleus-taxes-check-item--done .nucleus-taxes-check-text {
    text-decoration: line-through;
    opacity: 0.72;
}

.nucleus-taxes-check-item--na .nucleus-taxes-check-text {
    opacity: 0.55;
    font-style: italic;
}

/* Внизу колонки: карточка — flex column, сетка тянет высоту ряда */
.nucleus-taxes-card .nucleus-taxes-custom-block {
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px dashed var(--color-border-secondary);
}

.nucleus-taxes-custom-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.nucleus-taxes-custom-input {
    flex: 1;
    min-width: 8rem;
    max-width: 100%;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    border: none;
    border-radius: var(--nucleus-taxes-r-sm);
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    box-sizing: border-box;
}

.nucleus-taxes-custom-add-btn {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    background: var(--color-button-secondary);
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--nucleus-taxes-r-sm);
    padding: 0.5rem 1rem;
    min-height: 44px;
    cursor: pointer;
}

.nucleus-taxes-custom-add-btn:hover {
    background: var(--color-button-secondary-hover);
}

.nucleus-taxes-custom-remove {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    line-height: 1;
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: 0;
    margin-left: 4px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
}

.nucleus-taxes-custom-remove:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
}

.nucleus-taxes-custom-list {
    margin-top: var(--spacing-xs);
}

.nucleus-taxes-brief-li-status {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
}

.nucleus-taxes-brief-li-status::after {
    content: '\00a0—\00a0';
    font-weight: var(--font-weight-normal);
    color: var(--color-text-tertiary);
}

.nucleus-taxes-brief-li-text {
    color: var(--color-text-primary);
}

.nucleus-taxes-brief-li--done .nucleus-taxes-brief-li-text {
    text-decoration: none;
    opacity: 1;
}

.nucleus-taxes-brief-li--na .nucleus-taxes-brief-li-text {
    color: var(--color-text-tertiary);
    font-style: normal;
}

.nucleus-taxes-brief-li--na .nucleus-taxes-brief-li-status {
    color: var(--color-text-tertiary);
}

.nucleus-taxes-brief-custom-list {
    margin-top: 0.35rem;
    margin-bottom: var(--spacing-md);
    padding-left: 1.15rem;
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

.nucleus-taxes-brief-custom-list:empty {
    display: none;
    margin: 0;
}

.nucleus-taxes-brief-custom-title {
    list-style: none;
    margin-left: -1.15rem;
    margin-bottom: 0.25rem;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

@keyframes nucleusBudgetPanelIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Finance → Dashboard: появление блоков с графиками при открытии вкладки */
@keyframes nucleusDashboardChartIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Внутри графиков: столбики Cashflow, ось/сетка, донат категорий */
@keyframes nucleusOpsChartBarGrow {
    from {
        opacity: 0.35;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes nucleusOpsChartAxisIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Донат: только сегменты; прогресс-бары — nucleusBiBarFill. */
@keyframes nucleusDonutSegDraw {
    0% {
        stroke-dasharray: 0 var(--donut-circ);
        stroke-opacity: 0;
    }
    12% {
        stroke-opacity: 1;
    }
    100% {
        stroke-dasharray: var(--donut-seg-len) var(--donut-seg-gap);
        stroke-opacity: 1;
    }
}

@keyframes nucleusDonutSegFullDraw {
    0% {
        stroke-dashoffset: var(--donut-circ);
        stroke-opacity: 0;
    }
    14% {
        stroke-opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        stroke-opacity: 1;
    }
}

/* Слева направо: маска (scaleX на % width в гриде даёт неверный origin) */
@keyframes nucleusBiBarFill {
    from {
        opacity: 0.9;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

.nucleus-budgeting-main-tab {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
    font-family: var(--font-primary);
    font-size: var(--font-size-sm, 13px);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    user-select: none;
    position: relative;
    outline: none;
}

.nucleus-budgeting-main-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary, #fff);
    transform: translateY(-1px);
}

.nucleus-budgeting-main-tab.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-text-primary, #fff);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nucleus-budgeting-main-tab:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

body.light-theme .nucleus-budgeting-main-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .nucleus-budgeting-main-tab.is-active {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-primary, #111);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

body.light-theme .nucleus-budgeting-main-tab:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-primary, #111);
}

body.light-theme .nucleus-budgeting-main-tab:focus-visible {
    outline-color: rgba(0, 0, 0, 0.28);
}

.nucleus-page-add-btn {
    background: var(--color-accent-primary);
    color: var(--color-text-primary);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--spacing-md) var(--spacing-3xl);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    flex-shrink: 0;
}

.nucleus-page-add-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 124, 102, 0.3);
}

.nucleus-page-income-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============================================
   STATISTICS GRID
   ============================================ */

/* Cashflow на вкладке Dashboard — внутри #nucleus-tab-panel-dashboard (порядок блоков — порядок в DOM) */
/* flex-shrink: 0 + без min-height:0 — иначе карточка схлопывается по высоте */
#nucleus-dashboard-container #nucleus-overview-cashflow-root.nucleus-cashflow-island {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    flex-shrink: 0;
    width: calc(100% - 2 * var(--nucleus-island-h-gutter));
    max-width: calc(100% - 2 * var(--nucleus-island-h-gutter));
    margin: 0 auto 28px;
    padding: var(--spacing-4xl);
    box-sizing: border-box;
    background: var(--rv-surface-rail);
    border: none;
    border-radius: var(--rv-radius);
    box-shadow: none;
    overflow: visible;
    gap: 0;
    min-height: min-content;
}

@media (max-width: 600px) {
    #nucleus-dashboard-container #nucleus-overview-cashflow-root.nucleus-cashflow-island {
        width: calc(100% - 2 * var(--nucleus-island-h-gutter));
        max-width: calc(100% - 2 * var(--nucleus-island-h-gutter));
        padding: 20px;
        margin-bottom: 24px;
    }
}

/* Finance → Dashboard: зазор между подсекциями = 16px (как gap в Planner и Operations) */
#nucleus-dashboard-container #nucleus-finance-island #nucleus-tab-panel-dashboard {
    --nucleus-fin-dashboard-gap: 16px;
    /* Единая высота карточек «категории» и Cashflow на desktop (под фактическую высоту Cashflow с шапкой/графиком/легендой) */
    --nucleus-fin-dashboard-paired-card-height: 640px;
    gap: var(--nucleus-fin-dashboard-gap) !important;
    row-gap: var(--nucleus-fin-dashboard-gap) !important;
    column-gap: 0 !important;
    /* Не клиповать тени/радиусы дочерних карточек (overflow у предков) */
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* Категории: без сдвига всего блока — анимация только донат + прогресс-бары (.nucleus-budget-insights-visual--enter). Cashflow ниже — как было. */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard.is-active-panel
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"]) {
    animation: nucleusDashboardChartIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@media (prefers-reduced-motion: reduce) {
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard.is-active-panel
        #nucleus-overview-cashflow-root {
        animation: none;
        opacity: 1;
        transform: none;
    }

    #nucleus-dashboard-container
        #nucleus-overview-cashflow-root
        #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
        .nucleus-ops-chart-bar,
    #nucleus-dashboard-container
        #nucleus-overview-cashflow-root
        .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
        .nucleus-ops-chart-y,
    #nucleus-dashboard-container
        #nucleus-overview-cashflow-root
        .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
        .nucleus-ops-chart-grid {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard.is-active-panel
        #nucleus-budget-insights:not([hidden])
        .nucleus-budget-insights-donut-wrap
        .nucleus-budget-insights-donut-seg {
        animation: none !important;
        stroke-opacity: 1 !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard.is-active-panel
        #nucleus-budget-insights:not([hidden])
        .nucleus-budget-insights-donut-wrap
        .nucleus-budget-insights-donut-seg--full {
        stroke-dashoffset: 0 !important;
        stroke-opacity: 1 !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard.is-active-panel
        #nucleus-budget-insights:not([hidden])
        .nucleus-budget-insights-visual--enter
        .nucleus-bi-bar-fill--anim {
        animation: none !important;
        clip-path: none !important;
        opacity: 1 !important;
    }

    #nucleus-dashboard-container
        #nucleus-overview-cashflow-root
        .nucleus-ops-metric-fade--anim,
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard.is-active-panel
        #nucleus-budget-insights:not([hidden])
        .nucleus-bi-metric-fade--anim {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Внутри Dashboard: как карточка .nucleus-budget-insights-visual в острове Finance (фон, обводка, тень; --nucleus-fin-island-radius) */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    #nucleus-overview-cashflow-root.nucleus-cashflow-island {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    --bi-pad-x: var(--nucleus-fin-card-pad-x);
    --bi-pad-y: var(--spacing-4xl);
    padding: var(--bi-pad-y) var(--bi-pad-x) calc(var(--bi-pad-y) + 2px) !important;
    box-sizing: border-box !important;
    /* Как у общего блока чата: --color-bg-chat (градиент в тёмной теме) */
    background: var(--color-bg-chat) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
}

@media (min-width: 768px) {
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-overview-cashflow-root.nucleus-cashflow-island {
        min-height: var(--nucleus-fin-dashboard-paired-card-height);
    }

    /* Cashflow в Finance: заполнить высоту карточки, блок графика прижать к низу */
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-overview-cashflow-root.nucleus-cashflow-island
        #nucleus-ops-chart-island {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-overview-cashflow-root.nucleus-cashflow-island
        .nucleus-overview-cashflow-visual.nucleus-budget-insights-visual {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-overview-cashflow-root.nucleus-cashflow-island
        .nucleus-ops-chart-visual-main.nucleus-budget-insights-visual-main {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-overview-cashflow-root.nucleus-cashflow-island
        .nucleus-ops-chart-head {
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-overview-cashflow-root.nucleus-cashflow-island
        .nucleus-ops-chart-body {
        flex: 0 0 auto !important;
        margin-top: 0 !important;
        padding-top: 28px !important;
    }
}

/* Dashboard / Finance: категории, extra-карточки, AI — оболочка как Cashflow (токены на .nucleus-finance-island) */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    .nucleus-budget-insights-visual:not(.nucleus-overview-cashflow-visual) {
    /* Как у общего блока чата: --color-bg-chat */
    background: var(--color-bg-chat) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    .nucleus-dashboard-extra-slot
    .nucleus-dashboard-extra-card {
    background: var(--nucleus-fin-island-surface) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
}

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    #nucleus-dashboard-ai-panel {
    background: var(--nucleus-fin-island-surface) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
}

/* Остров графика и цепочка до plot — на всю ширину карточки (не узкая колонка donut из .nucleus-budget-insights-visual-main @768px) */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-island {
    padding: 0;
    margin: 0;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Разметка как у budget insights: visual-head только с pills; без второй вложенной «плитки» */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-overview-cashflow-visual.nucleus-budget-insights-visual {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: var(--spacing-md);
    align-items: stretch !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme #nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-overview-cashflow-visual.nucleus-budget-insights-visual {
    background: transparent !important;
    box-shadow: none !important;
}

/* Cashflow: табы и период в одной строке (период справа, та же высота) */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-budget-insights-visual-head {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: var(--spacing-md) !important;
    width: 100% !important;
    max-width: none !important;
    align-self: stretch !important;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-period-bar {
    margin: 0 !important;
    margin-left: auto !important;
    padding: 0 !important;
    width: auto !important;
    max-width: min(100%, 52%) !important;
    text-align: right !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
}

@media (max-width: 640px) {
    #nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-period-bar {
        margin-left: 0 !important;
        flex: 1 1 100% !important;
        max-width: none !important;
        text-align: left !important;
    }
}

/* Табы метрик Cashflow: ширина как у Share % / Amounts — фон/трек задаёт #nucleus-dashboard-container … .nucleus-budget-insights-visual-head .nucleus-budget-insights-pills */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-budget-insights-visual-head .nucleus-budget-insights-pills {
    width: auto !important;
    max-width: max-content !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 auto !important;
}

/* Критично: перебить display:grid + grid-template-columns: 220px/280px | 1fr у .nucleus-budget-insights-visual-main (иначе шапка и чарт сидят в первой колонке ~280px) */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-visual-main.nucleus-budget-insights-visual-main {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    gap: var(--spacing-md) !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-head,
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-body {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-head {
    padding-top: 20px;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-body {
    align-self: stretch !important;
    /* grid, не flex — иначе stretch тянет ось Y на высоту plot+подписи и метки не бьются в сетку 200px */
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 0 12px !important;
    align-items: start !important;
    flex: 1 1 auto;
    margin-top: 0 !important;
    padding-top: 28px;
    box-sizing: border-box;
}

/* Крупнее итоги (режим All) и одна метрика — меньше «воздуха», акцент на цифрах */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-total-all {
    gap: 8px;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-total-all-row {
    font-size: var(--font-size-md, 15px);
    gap: 10px 14px;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-total-all-k {
    font-size: var(--font-size-sm, 13px);
    min-width: 5.25rem;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-total-all-v {
    font-size: clamp(1.2rem, 2.8vw, 1.75rem);
    font-weight: var(--font-weight-semibold);
}

/* Cashflow: появление цифр (итог всегда в DOM — только opacity/transform, без count-up) */
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root
    .nucleus-overview-cashflow-visual:not(.nucleus-overview-cashflow-visual--enter)
    .nucleus-ops-metric-fade--anim {
    display: inline-block;
    opacity: 0;
    transform: translate3d(0, 6px, 0);
}

#nucleus-dashboard-container
    #nucleus-overview-cashflow-root
    .nucleus-overview-cashflow-visual.nucleus-overview-cashflow-visual--enter
    .nucleus-ops-metric-fade--anim {
    display: inline-block;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition:
        opacity 0.44s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--ops-metric-fade-delay, 0s);
}

/* Режим Income / Expenses / Net: одна сумма — ~×2 к предыдущему размеру */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-total {
    font-size: clamp(2.8rem, 6.4vw, 4.1rem);
    line-height: 1.08;
}

/* Cashflow: класс .nucleus-ops-chart-bars--enter выставляет JS после отрисовки и когда панель видима (иначе анимация в display:none не играет) */
/* data-ops-chart-intro-done: после первого intro отключаем keyframes — иначе при innerHTML новые столбики анимируются снова */
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    .nucleus-ops-chart-bar {
    transform-origin: bottom center !important;
    animation: nucleusOpsChartBarGrow 0.62s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}

#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(1)
    .nucleus-ops-chart-bar {
    animation-delay: 0.03s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(2)
    .nucleus-ops-chart-bar {
    animation-delay: 0.07s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(3)
    .nucleus-ops-chart-bar {
    animation-delay: 0.11s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(4)
    .nucleus-ops-chart-bar {
    animation-delay: 0.15s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(5)
    .nucleus-ops-chart-bar {
    animation-delay: 0.19s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(6)
    .nucleus-ops-chart-bar {
    animation-delay: 0.23s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(7)
    .nucleus-ops-chart-bar {
    animation-delay: 0.27s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(8)
    .nucleus-ops-chart-bar {
    animation-delay: 0.31s !important;
}

#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
    .nucleus-ops-chart-y,
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root:not([data-ops-chart-intro-done="1"])
    .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
    .nucleus-ops-chart-grid {
    animation: nucleusOpsChartAxisIn 0.42s ease-out 0.06s both !important;
}

#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-intro-done="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    .nucleus-ops-chart-bar {
    animation: none !important;
    opacity: 1 !important;
    transform: scaleY(1) !important;
}

#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-intro-done="1"]
    .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
    .nucleus-ops-chart-y,
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-intro-done="1"]
    .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
    .nucleus-ops-chart-grid {
    animation: none !important;
    opacity: 1 !important;
}

/* Cashflow replay по клику табов метрики (All/Income/Expenses/Net). */
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    .nucleus-ops-chart-bar {
    transform-origin: bottom center !important;
    animation: nucleusOpsChartBarGrow 0.62s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(1)
    .nucleus-ops-chart-bar {
    animation-delay: 0.03s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(2)
    .nucleus-ops-chart-bar {
    animation-delay: 0.07s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(3)
    .nucleus-ops-chart-bar {
    animation-delay: 0.11s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(4)
    .nucleus-ops-chart-bar {
    animation-delay: 0.15s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(5)
    .nucleus-ops-chart-bar {
    animation-delay: 0.19s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(6)
    .nucleus-ops-chart-bar {
    animation-delay: 0.23s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(7)
    .nucleus-ops-chart-bar {
    animation-delay: 0.27s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    #nucleus-ops-chart-bars.nucleus-ops-chart-bars--enter
    > .nucleus-ops-chart-group:nth-child(8)
    .nucleus-ops-chart-bar {
    animation-delay: 0.31s !important;
}
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
    .nucleus-ops-chart-y,
#nucleus-dashboard-container
    #nucleus-overview-cashflow-root[data-ops-chart-replay="1"]
    .nucleus-ops-chart-body.nucleus-ops-chart-body--enter
    .nucleus-ops-chart-grid {
    animation: nucleusOpsChartAxisIn 0.42s ease-out 0.06s both !important;
}

/* Донат + строки: --enter вешает scheduleBudgetInsightsDonutEnterAnim после innerHTML */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard.is-active-panel
    #nucleus-budget-insights:not([hidden])
    .nucleus-budget-insights-visual:not(.nucleus-budget-insights-visual--enter)
    .nucleus-bi-bar-fill--anim {
    opacity: 0.9;
    clip-path: inset(0 100% 0 0);
}

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard.is-active-panel
    #nucleus-budget-insights:not([hidden])
    .nucleus-budget-insights-visual--enter
    .nucleus-bi-bar-fill--anim {
    animation: nucleusBiBarFill cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-duration: var(--bi-bar-dur, 0.5s);
    animation-delay: var(--bi-bar-delay, 0s);
}

/* Категории + донат: те же цифры в DOM — мягкое появление в такт задержкам полос */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard.is-active-panel
    #nucleus-budget-insights:not([hidden])
    .nucleus-budget-insights-visual:not(.nucleus-budget-insights-visual--enter)
    .nucleus-bi-metric-fade--anim {
    display: inline-block;
    opacity: 0;
    transform: translate3d(0, 5px, 0);
}

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard.is-active-panel
    #nucleus-budget-insights:not([hidden])
    .nucleus-budget-insights-visual--enter
    .nucleus-bi-metric-fade--anim {
    display: inline-block;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition:
        opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--bi-metric-fade-delay, 0s);
}

/* Стартовое «пусто» для сегментов задаётся в TS (stroke-dasharray 0 C), не только CSS — иначе вспышка при --enter */

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard.is-active-panel
    #nucleus-budget-insights:not([hidden])
    .nucleus-budget-insights-donut-wrap.nucleus-budget-insights-donut-wrap--enter
    .nucleus-budget-insights-donut-seg:not(.nucleus-budget-insights-donut-seg--full) {
    animation: nucleusDonutSegDraw cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-duration: var(--donut-seg-draw-dur, 0.24s);
    animation-delay: var(--donut-seg-delay, 0s);
}

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard.is-active-panel
    #nucleus-budget-insights:not([hidden])
    .nucleus-budget-insights-donut-wrap.nucleus-budget-insights-donut-wrap--enter
    .nucleus-budget-insights-donut-seg--full {
    animation: nucleusDonutSegFullDraw cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-duration: var(--donut-full-dur, 0.19s);
    animation-delay: var(--donut-seg-delay, 0.008s);
}


/* Ось Y только на 200px — совпадает с .nucleus-ops-chart-grid и рядом столбиков */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-y {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    align-self: start !important;
    padding-bottom: 0 !important;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-plot {
    align-self: start !important;
}

/* Cashflow: сетка строго 200px — иначе линии наезжают на подписи месяцев */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-grid {
    top: 0 !important;
    bottom: auto !important;
    height: 200px !important;
    max-height: 200px !important;
}

/* Cashflow на Dashboard: столбики толще, верх «капсула» (полное скругление сверху) */
#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-bar-pair {
    max-width: 52px !important;
    gap: 6px !important;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-bar {
    flex: 1 1 18px !important;
    max-width: 20px !important;
    min-width: 18px !important;
    border-radius: 999px 999px 5px 5px !important;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-group--all .nucleus-ops-chart-all-swatch {
    flex: 0 0 32px !important;
    width: 32px !important;
    min-width: 32px !important;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-group--all .nucleus-ops-chart-all-pair {
    gap: 5px !important;
}

#nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-group--all .nucleus-ops-chart-all-pair .nucleus-ops-chart-bar {
    width: 14px !important;
    min-width: 14px !important;
    max-width: 14px !important;
    border-radius: 999px 999px 4px 4px !important;
}

@media (min-width: 768px) {
    #nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-overview-cashflow-visual.nucleus-budget-insights-visual {
        height: auto !important;
        min-height: min-content !important;
    }

    #nucleus-dashboard-container #nucleus-overview-cashflow-root .nucleus-ops-chart-visual-main.nucleus-budget-insights-visual-main {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        height: auto !important;
        min-height: min-content !important;
    }
}

#nucleus-dashboard-container .nucleus-stats-grid {
    margin-top: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    background: transparent;
}

#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card {
    background: transparent;
    border-radius: 0;
    padding: 24px;
    min-height: 0;
    gap: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    box-sizing: border-box;
}

#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card:last-child {
    border-right: none;
}

body.light-theme #nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card {
    border-right-color: rgba(0, 0, 0, 0.06);
}

#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-text-tertiary);
}

#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-stability-row {
    margin-top: 2px;
}

#nucleus-dashboard-container #nucleus-stats-actual-row:not([hidden]) {
    margin: 0;
    padding: 14px 24px 18px;
    border-top: none;
    max-width: none;
    box-sizing: border-box;
}

body.light-theme #nucleus-dashboard-container #nucleus-stats-actual-row:not([hidden]) {
    border-top: none;
}

@media (max-width: 1024px) {
    #nucleus-dashboard-container .nucleus-stats-grid {
        grid-template-columns: 1fr;
    }

    #nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card {
        border-right: none;
    }

    #nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card:not(:first-child) {
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }

    body.light-theme #nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card:not(:first-child) {
        border-top-color: rgba(0, 0, 0, 0.06);
    }
}

.nucleus-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-2xl);
    width: 100%;
    margin-top: var(--spacing-2xl);
}

/* ============================================
   Transactions table (вкладка «Транзакции»)
   ============================================ */
.nucleus-transactions-table {
    margin-bottom: var(--spacing-2xl);
    --tx-control-height: 40px;
    --tx-control-radius: 12px;
    --tx-control-border-dark: 1px solid rgba(255, 255, 255, 0.12);
    --tx-control-bg-dark: rgba(255, 255, 255, 0.04);
    --tx-control-border-light: 1px solid rgba(0, 0, 0, 0.12);
    --tx-control-bg-light: rgba(0, 0, 0, 0.02);
}

/* Шапка: заголовок слева, Import/Export справа */
.nucleus-transactions-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.nucleus-transactions-table-head-text {
    flex: 1 1 auto;
    min-width: min(12rem, 100%);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nucleus-transactions-table-head-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.nucleus-transactions-table-head-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

/* Табы All/Income/Expense — под шапкой реестра, над KPI */
.nucleus-transactions-top-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 0;
}

.nucleus-transactions-table-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: var(--spacing-md);
}

/* Тулбар: табы; строка — сортировка + group/currency/поиск в одной линии */
.nucleus-transactions-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px 16px;
    width: 100%;
    min-width: 0;
}

.nucleus-transactions-toolbar-controls {
    margin: 0;
}

.nucleus-transactions-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.nucleus-transactions-toolbar-filters-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    min-width: 0;
}

.nucleus-transactions-inline-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.nucleus-transactions-inline-search-wrap {
    flex: 1 1 200px;
    min-width: min(200px, 100%);
    max-width: 420px;
    display: flex;
    align-items: center;
}

.nucleus-transactions-groupby-wrap--inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.nucleus-transactions-groupby-wrap--inline .nucleus-transactions-groupby-select {
    min-width: 8rem;
}

.nucleus-transactions-inline-currency .nucleus-transactions-currency-select {
    min-width: 7rem;
}

/* All / Income / Expenses — отдельная строка сверху слева, вне segment-rail */
.nucleus-transactions-toolbar-tabs {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
}

/* Сегмент фильтров — фон как у полей сайта */
.nucleus-transactions-segment-rail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px;
    box-sizing: border-box;
    border-radius: var(--radius-md);
    background: var(--color-bg-input);
}

/* Тулбар: без общей тёмной подложки — Date/Amount как отдельные чипы */
.nucleus-transactions-segment-rail.nucleus-transactions-segment-rail--toolbar {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    padding: 0;
    gap: 6px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--toolbar) .nucleus-transactions-filters,
.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--toolbar) .nucleus-transactions-sorters {
    gap: 4px;
}

.nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sorters {
    flex-wrap: nowrap;
    gap: 6px;
}

.nucleus-transactions-toolbar-tabs .nucleus-transactions-filters {
    gap: 6px;
}

/* Строка поиска на всю ширину под табами */
.nucleus-transactions-toolbar-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.nucleus-transactions-toolbar-compact .nucleus-transactions-search-row {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

/* Остальные фильтры — в раскрывающейся панели */
.nucleus-transactions-more {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-secondary);
    background: var(--color-bg-tertiary);
    overflow: hidden;
}

.nucleus-transactions-more-summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nucleus-transactions-more-summary::-webkit-details-marker {
    display: none;
}

.nucleus-transactions-more-summary::after {
    content: '';
    width: 0;
    height: 0;
    margin-left: auto;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.55;
    transition: transform 0.2s ease;
}

.nucleus-transactions-more[open] .nucleus-transactions-more-summary::after {
    transform: rotate(180deg);
}

.nucleus-transactions-more-summary:hover {
    color: var(--color-text-primary);
    background: color-mix(in srgb, var(--color-text-primary) 5%, transparent);
}

.nucleus-transactions-more-summary:focus-visible {
    outline: 2px solid var(--color-button-primary-focus, rgba(14, 124, 102, 0.6));
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.nucleus-transactions-more-body {
    padding: 0 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid var(--color-border-secondary);
}

.nucleus-transactions-segment-rail--panel {
    width: fit-content;
    max-width: 100%;
}

.nucleus-transactions-more-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.nucleus-transactions-more-fields .nucleus-transactions-groupby-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    max-width: 320px;
}

.nucleus-transactions-more-fields .nucleus-transactions-groupby-select {
    width: 100%;
    min-width: 0;
}

.nucleus-transactions-more-currency {
    width: 100%;
    max-width: 320px;
}

.nucleus-transactions-more-currency .nucleus-transactions-currency-select {
    width: 100%;
    min-width: 0;
}

.nucleus-transactions-more-reset {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Чипы внутри рейла (без toolbar — там сортировка иконка+текст) и табы сверху */
.nucleus-transactions-toolbar-tabs .nucleus-transactions-filter-btn,
.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--panel):not(.nucleus-transactions-segment-rail--toolbar)
    .nucleus-transactions-filter-btn,
.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--panel):not(.nucleus-transactions-segment-rail--toolbar)
    .nucleus-transactions-sort-btn {
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    transform: none;
    box-shadow: none;
}

.nucleus-transactions-toolbar-tabs .nucleus-transactions-filter-btn:hover,
.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--panel):not(.nucleus-transactions-segment-rail--toolbar)
    .nucleus-transactions-filter-btn:hover,
.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--panel):not(.nucleus-transactions-segment-rail--toolbar)
    .nucleus-transactions-sort-btn:hover {
    background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    color: var(--color-text-primary);
    transform: none;
}

.nucleus-transactions-toolbar-tabs .nucleus-transactions-filter-btn.is-active,
.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--panel):not(.nucleus-transactions-segment-rail--toolbar)
    .nucleus-transactions-filter-btn.is-active,
.nucleus-transactions-segment-rail:not(.nucleus-transactions-segment-rail--panel):not(.nucleus-transactions-segment-rail--toolbar)
    .nucleus-transactions-sort-btn.is-active {
    background: var(--color-button-secondary-hover);
    color: var(--color-text-primary);
    border: none;
}

.nucleus-transactions-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nucleus-transactions-search-row .nucleus-transactions-search-input {
    flex: 1 1 220px;
    max-width: none;
    min-width: 160px;
}

.nucleus-transactions-table-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.nucleus-transactions-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nucleus-transactions-sorters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nucleus-transactions-filters,
.nucleus-transactions-sorters,
.nucleus-transactions-groupby-wrap {
    align-items: center;
}

.nucleus-transactions-groupby-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nucleus-transactions-groupby-select {
    min-width: 140px;
    height: var(--tx-control-height);
    padding: 0 36px 0 12px;
    border-radius: var(--tx-control-radius);
    border: var(--tx-control-border-dark);
    background-color: var(--tx-control-bg-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(255,255,255,0.55)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    box-sizing: border-box;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.nucleus-transactions-groupby-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.nucleus-transactions-groupby-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.28);
    background-color: rgba(255, 255, 255, 0.07);
}

.nucleus-transactions-reset-btn {
    height: var(--tx-control-height);
    padding: 0 12px;
    border-radius: var(--tx-control-radius);
    border: var(--tx-control-border-dark);
    background: var(--tx-control-bg-dark);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.nucleus-transactions-reset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nucleus-transactions-reset-shortcut {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    opacity: 0.9;
    white-space: nowrap;
}

.nucleus-transactions-sort-btn {
    height: var(--tx-control-height);
    padding: 0 12px;
    border-radius: var(--radius-full);
    border: var(--tx-control-border-dark);
    background: var(--tx-control-bg-dark);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
}

.nucleus-transactions-sort-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
}

.nucleus-transactions-sort-btn.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--color-text-primary);
}

.nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sort-btn {
    height: 34px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    box-shadow: none;
}

.nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sort-btn:hover {
    background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    color: var(--color-text-primary);
}

.nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sort-btn.is-active {
    background: var(--color-button-secondary-hover);
    color: var(--color-text-primary);
    border: none;
}

.nucleus-transactions-sort-btn--icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 1;
}

.nucleus-transactions-sort-btn--icon-only .nucleus-transactions-sort-btn-icon {
    display: inline-flex;
    flex-shrink: 0;
    opacity: 0.95;
}

.nucleus-transactions-sort-btn--icon-only .nucleus-transactions-sort-btn-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Направление сортировки — мини-метка в углу чипа (только активная колонка) */
.nucleus-transactions-sort-btn--icon-only .nucleus-transactions-sort-btn-dir {
    position: absolute;
    right: 1px;
    bottom: 1px;
    font-size: 9px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sort-btn--icon-only {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: var(--radius-md);
}

.nucleus-transactions-search-input {
    min-width: 200px;
    flex: 1 1 220px;
    max-width: 320px;
    height: var(--tx-control-height);
    padding: 0 12px;
    border-radius: var(--tx-control-radius);
    border: var(--tx-control-border-dark);
    background: var(--tx-control-bg-dark);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: var(--tx-control-height);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: border-color var(--transition-base), background var(--transition-base);
}

.nucleus-transactions-search-counter {
    min-width: 52px;
    text-align: right;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    opacity: 0.9;
    white-space: nowrap;
    transition: opacity 180ms ease, transform 180ms ease;
    transform: translateY(0);
}

.nucleus-transactions-search-clear-btn {
    height: var(--tx-control-height);
    padding: 0 12px;
    border-radius: var(--tx-control-radius);
    border: var(--tx-control-border-dark);
    background: var(--tx-control-bg-dark);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-base);
    transform: translateY(0);
}

.nucleus-transactions-search-counter.is-hidden,
.nucleus-transactions-search-clear-btn.is-hidden {
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
}

.nucleus-transactions-search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nucleus-transactions-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.nucleus-transactions-search-input:focus {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.07);
}

.nucleus-transactions-filter-btn {
    height: var(--tx-control-height);
    padding: 0 14px;
    border-radius: var(--radius-full);
    border: var(--tx-control-border-dark);
    background: var(--tx-control-bg-dark);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    user-select: none;
}

.nucleus-transactions-filter-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.nucleus-transactions-filter-btn.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-filter-btn.is-active {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--color-text-primary);
}

.nucleus-transactions-currency-select {
    min-width: 160px;
    height: var(--tx-control-height);
    padding: 0 36px 0 12px;
    border-radius: var(--tx-control-radius);
    border: var(--tx-control-border-dark);
    background-color: var(--tx-control-bg-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(255,255,255,0.55)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color var(--transition-base), background-color var(--transition-base);
}

.nucleus-transactions-currency-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.nucleus-transactions-currency-select:focus {
    border-color: rgba(255, 255, 255, 0.28);
    background-color: rgba(255, 255, 255, 0.07);
}

body.light-theme .nucleus-transactions-search-input {
    border: var(--tx-control-border-light);
    background: var(--tx-control-bg-light);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-search-counter {
    color: rgba(0, 0, 0, 0.55);
}

body.light-theme .nucleus-transactions-search-clear-btn {
    border: var(--tx-control-border-light);
    background: var(--tx-control-bg-light);
    color: rgba(0, 0, 0, 0.75);
}

body.light-theme .nucleus-transactions-search-clear-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .nucleus-transactions-currency-select {
    border: var(--tx-control-border-light);
    background-color: var(--tx-control-bg-light);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(0,0,0,0.55)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-currency-select:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .nucleus-transactions-currency-select:focus {
    border-color: rgba(0, 0, 0, 0.2);
    background-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .nucleus-transactions-sort-btn {
    border: var(--tx-control-border-light);
    background: var(--tx-control-bg-light);
    color: rgba(0, 0, 0, 0.7);
}

body.light-theme .nucleus-transactions-sort-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.85);
}

body.light-theme .nucleus-transactions-sort-btn.is-active {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.16);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sort-btn {
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.55);
}

body.light-theme .nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sort-btn:hover {
    background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-segment-rail--toolbar .nucleus-transactions-sort-btn.is-active {
    background: var(--color-button-secondary-hover);
    color: var(--color-text-primary);
    border: none;
}

body.light-theme .nucleus-transactions-groupby-select {
    border: var(--tx-control-border-light);
    background-color: var(--tx-control-bg-light);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(0,0,0,0.55)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-groupby-select:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .nucleus-transactions-groupby-select:focus {
    border-color: rgba(0, 0, 0, 0.2);
    background-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .nucleus-transactions-reset-btn {
    border: var(--tx-control-border-light);
    background: var(--tx-control-bg-light);
}

body.light-theme .nucleus-transactions-reset-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .nucleus-transactions-reset-shortcut {
    color: rgba(0, 0, 0, 0.55);
}

body.light-theme .nucleus-transactions-summary-item {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.01);
}

body.light-theme .nucleus-transactions-table-el tbody tr.nucleus-transactions-group-row td {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .nucleus-transactions-table-el tbody tr.is-selected td {
    background: rgba(16, 185, 129, 0.1);
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.25);
}

body.light-theme .nucleus-transactions-table-el tbody tr.is-bulk-selected td {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

body.light-theme .nucleus-transactions-search-input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

body.light-theme .nucleus-transactions-search-input:focus {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.04);
}

.nucleus-transactions-import-btn {
    height: var(--tx-control-height);
    padding: 0 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.nucleus-transactions-import-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
}

body.light-theme .nucleus-transactions-import-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-import-btn:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.18);
}

.nucleus-transactions-export-btn {
    height: var(--tx-control-height);
    padding: 0 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.nucleus-transactions-filter-btn:focus-visible,
.nucleus-transactions-sort-btn:focus-visible,
.nucleus-transactions-reset-btn:focus-visible,
.nucleus-transactions-search-clear-btn:focus-visible,
.nucleus-transactions-import-btn:focus-visible,
.nucleus-transactions-export-btn:focus-visible,
.nucleus-bank-csv-import-btn:focus-visible,
.nucleus-transactions-search-input:focus-visible,
.nucleus-transactions-currency-select:focus-visible,
.nucleus-transactions-groupby-select:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.7);
    outline-offset: 2px;
}

body.light-theme .nucleus-transactions-filter-btn:focus-visible,
body.light-theme .nucleus-transactions-sort-btn:focus-visible,
body.light-theme .nucleus-transactions-reset-btn:focus-visible,
body.light-theme .nucleus-transactions-search-clear-btn:focus-visible,
body.light-theme .nucleus-transactions-import-btn:focus-visible,
body.light-theme .nucleus-transactions-export-btn:focus-visible,
body.light-theme .nucleus-bank-csv-import-btn:focus-visible,
body.light-theme .nucleus-transactions-search-input:focus-visible,
body.light-theme .nucleus-transactions-currency-select:focus-visible,
body.light-theme .nucleus-transactions-groupby-select:focus-visible {
    outline-color: rgba(5, 150, 105, 0.8);
}

.nucleus-transactions-export-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
}

body.light-theme .nucleus-transactions-export-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-export-btn:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.18);
}

/* Секция списка карточек (#nucleus-transactions-table): без второй оболочки, только фокус с клавиатуры */
#nucleus-transactions-table {
    width: 100%;
    min-width: 0;
}

#nucleus-transactions-table:focus {
    outline: none;
}

#nucleus-transactions-table:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.7);
    outline-offset: 2px;
}

body.light-theme #nucleus-transactions-table:focus-visible {
    outline-color: rgba(5, 150, 105, 0.8);
}

.nucleus-transactions-summary {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.nucleus-transactions-summary-item {
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    background: var(--color-bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nucleus-transactions-summary-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nucleus-transactions-summary-value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

.nucleus-transactions-summary-value.is-positive {
    color: var(--color-success);
}

.nucleus-transactions-summary-value.is-negative {
    color: var(--color-error);
}

/* Блоковый список транзакций (карточки вместо таблицы) */
.nucleus-transactions-data-table.nucleus-tx-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    width: 100%;
}

.nucleus-tx-list-summary-bar {
    padding: 0 0 12px;
    border-bottom: 1px solid var(--color-border-secondary);
    margin-bottom: 12px;
}

.nucleus-tx-list-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 0 0 6px;
}

.nucleus-tx-card {
    margin: 0;
    border-radius: 16px;
    border: 1px solid var(--color-border-tertiary);
    background: var(--color-bg-secondary, rgba(255, 255, 255, 0.04));
    overflow: hidden;
    /* background без transition — иначе при клике/фокусе заметно «переливается» фон */
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.nucleus-tx-card:hover {
    border-color: color-mix(in srgb, var(--color-text-primary) 10%, transparent);
    background: color-mix(in srgb, var(--color-text-primary) 2.5%, var(--color-bg-secondary));
}

/* Строка карточки: клик / Enter / Space раскрывает блок метаданных (без нативного <details>) */
.nucleus-tx-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    cursor: pointer;
}

.nucleus-tx-card-main:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-text-primary) 45%, transparent);
    outline-offset: 2px;
}

.nucleus-tx-card-leading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.nucleus-tx-card-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-tertiary);
}

.nucleus-tx-card--income .nucleus-tx-card-avatar {
    color: var(--color-success, #6ee7b7);
    border-color: color-mix(in srgb, var(--color-success) 28%, transparent);
    background: color-mix(in srgb, var(--color-success) 14%, transparent);
}

/* Иконка категории вместо буквы: SVG масштабируется, цвет — currentColor */
.nucleus-tx-card-avatar--icon {
    line-height: 0;
}

.nucleus-tx-card-avatar-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nucleus-tx-card-avatar--icon .nucleus-tx-card-avatar-icon-wrap svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nucleus-tx-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.nucleus-tx-card-title-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    min-width: 0;
}

.nucleus-tx-card-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.nucleus-tx-card-title-line .nucleus-tx-card-type-pill {
    flex-shrink: 0;
}

.nucleus-tx-card-sub {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    font-variant-numeric: tabular-nums;
}

.nucleus-tx-card-trailing {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* Компактная композиция строки транзакции: левая часть в одну строку (name · EUR · pill). */
.nucleus-tx-card-info--compact {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nucleus-tx-card-info--compact .nucleus-tx-card-name {
    flex: 0 1 auto;
}

.nucleus-tx-card-info--compact .nucleus-tx-card-sub {
    position: relative;
    padding-left: 12px;
    flex: 0 0 auto;
}

.nucleus-tx-card-info--compact .nucleus-tx-card-sub::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-text-tertiary);
    opacity: 0.6;
    transform: translateY(-50%);
}

/* Правая часть в одну строку: amount · date. */
.nucleus-tx-card-trailing--compact {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
}

.nucleus-tx-card-trailing--compact .nucleus-tx-card-date {
    position: relative;
    padding-left: 12px;
}

.nucleus-tx-card-trailing--compact .nucleus-tx-card-date::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-text-tertiary);
    opacity: 0.6;
    transform: translateY(-50%);
}

/* На узких экранах возвращаемся к 2-строчной верстке, чтобы не схлопывать в кашу. */
@media (max-width: 540px) {
    .nucleus-tx-card-info--compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .nucleus-tx-card-info--compact .nucleus-tx-card-sub {
        padding-left: 0;
    }
    .nucleus-tx-card-info--compact .nucleus-tx-card-sub::before {
        display: none;
    }
    .nucleus-tx-card-trailing--compact {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    .nucleus-tx-card-trailing--compact .nucleus-tx-card-date {
        padding-left: 0;
    }
    .nucleus-tx-card-trailing--compact .nucleus-tx-card-date::before {
        display: none;
    }
}

/* Кнопки edit/delete на карточке транзакции — всегда видны, hover больше не требуется. */
.nucleus-tx-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 4px;
    opacity: 1;
}

.nucleus-tx-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 4px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md, 8px);
    color: var(--color-text-tertiary);
    cursor: pointer;
    opacity: 0.85;
    transition: background var(--transition-base, 0.2s), color var(--transition-base, 0.2s), opacity var(--transition-base, 0.2s);
}

.nucleus-tx-card-action svg {
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.nucleus-tx-card-action--edit:hover,
.nucleus-tx-card-action--edit:focus-visible {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    color: var(--color-text-secondary);
    opacity: 1;
}

.nucleus-tx-card-action--delete:hover,
.nucleus-tx-card-action--delete:focus-visible {
    background: color-mix(in srgb, var(--color-error, #fb923c) 12%, transparent);
    color: var(--color-error, #fb923c);
    opacity: 1;
}

.nucleus-tx-card-amount {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--color-text-primary);
}

.nucleus-tx-card--income .nucleus-tx-card-amount {
    color: var(--color-success, #6ee7b7);
}

.nucleus-tx-card-date {
    font-size: 12px;
    color: var(--color-text-tertiary);
    font-variant-numeric: tabular-nums;
}

.nucleus-tx-card-details {
    border-top: none;
}

/* По умолчанию скрыто: иначе .nucleus-tx-card-details-grid { display: grid } перебивает HTML [hidden] */
.nucleus-tx-card-details-grid {
    display: none;
}

.nucleus-tx-card-details.is-open .nucleus-tx-card-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px 14px;
    padding: 4px 16px 14px;
    border-top: none;
}

.nucleus-tx-meta-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    min-width: 0;
}

.nucleus-tx-meta-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
}

.nucleus-tx-card.is-selected {
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.42);
}

.nucleus-tx-card.is-bulk-selected {
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
    border-color: rgba(59, 130, 246, 0.32);
}

.nucleus-tx-card.is-selected.is-pulse {
    animation: nucleusTxCardPulse 380ms ease;
}

@keyframes nucleusTxCardPulse {
    0% {
        box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.65);
    }
    100% {
        box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
    }
}

#nucleus-transactions-table .nucleus-transactions-group-row.nucleus-tx-list-group-row {
    margin: 4px 0 2px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--color-bg-input);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
}

body.light-theme .nucleus-tx-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .nucleus-tx-card:hover {
    border-color: rgba(0, 0, 0, 0.11);
}

body.light-theme .nucleus-tx-card.is-selected {
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.32);
}

body.light-theme .nucleus-tx-card.is-bulk-selected {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.28);
}

.nucleus-transactions-table-el {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.nucleus-transactions-table-el thead th {
    text-align: left;
    padding: 14px 16px;
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nucleus-transactions-table-el tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-tertiary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    vertical-align: top;
}

.nucleus-transactions-table-el tbody tr:hover td {
    background: var(--color-button-secondary);
}

.nucleus-transactions-table-el tbody tr.is-selected td {
    background: rgba(16, 185, 129, 0.14);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.nucleus-transactions-table-el tbody tr.is-bulk-selected td {
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.nucleus-transactions-table-el tbody tr.is-selected.is-pulse td {
    animation: nucleusTxRowPulse 380ms ease;
}

/* Сводка Income / Expenses / Net — первая строка tbody, под заголовками */
.nucleus-transactions-table-el tbody tr.nucleus-transactions-summary-row td.nucleus-transactions-summary-cell {
    padding: 14px 16px;
    border-top: none;
    border-bottom: 1px solid var(--color-border-secondary);
    background: var(--color-bg-tertiary);
    vertical-align: middle;
}

.nucleus-transactions-table-el tbody tr.nucleus-transactions-summary-row:hover td {
    background: var(--color-bg-tertiary);
}

.nucleus-transactions-bulk-bar {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.nucleus-transactions-bulk-bar.is-hidden {
    display: none !important;
}

.nucleus-transactions-bulk-count {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    font-size: var(--font-size-xs);
    line-height: 1;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.nucleus-transactions-bulk-overrides {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-secondary);
    font-family: var(--font-primary);
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.nucleus-transactions-bulk-overrides strong {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
    font-variant-numeric: tabular-nums;
}

.nucleus-transactions-bulk-overrides-info-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nucleus-transactions-bulk-overrides-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 2px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-primary);
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    cursor: help;
    transition: border-color 0.16s ease, color 0.16s ease;
}

.nucleus-transactions-bulk-overrides-info:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--color-text-primary);
}

.nucleus-transactions-bulk-overrides-info:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 2px;
}

.nucleus-transactions-bulk-overrides-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(2px);
    width: min(320px, 72vw);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #0f172a;
    color: #e2e8f0;
    font-family: var(--font-primary);
    font-size: 11px;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
    z-index: 12;
}

.nucleus-transactions-bulk-overrides-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 8px;
    height: 8px;
    transform: translateX(-50%) rotate(45deg);
    background: inherit;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.nucleus-transactions-bulk-overrides-info-wrap:hover .nucleus-transactions-bulk-overrides-tooltip,
.nucleus-transactions-bulk-overrides-info-wrap:focus-within .nucleus-transactions-bulk-overrides-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}

@media (max-width: 980px) {
    .nucleus-transactions-bulk-bar {
        width: 100%;
        align-items: flex-start;
        gap: 6px;
    }

    .nucleus-transactions-bulk-count {
        min-height: 22px;
        display: inline-flex;
        align-items: center;
    }

    .nucleus-transactions-bulk-select-wrap {
        flex: 1 1 220px;
        min-width: 0;
    }

    .nucleus-transactions-bulk-select {
        width: 100%;
        min-width: 140px;
    }

    .nucleus-transactions-bulk-btn {
        flex: 1 1 170px;
        min-width: 150px;
    }

    .nucleus-transactions-bulk-overrides-tooltip {
        left: auto;
        right: 0;
        transform: translateY(2px);
        width: min(300px, calc(100vw - 24px));
    }

    .nucleus-transactions-bulk-overrides-info-wrap:hover .nucleus-transactions-bulk-overrides-tooltip,
    .nucleus-transactions-bulk-overrides-info-wrap:focus-within .nucleus-transactions-bulk-overrides-tooltip {
        transform: translateY(0);
    }

    .nucleus-transactions-bulk-overrides-tooltip::after {
        left: auto;
        right: 6px;
        transform: rotate(45deg);
    }
}

@media (max-width: 680px) {
    .nucleus-transactions-bulk-bar {
        gap: 8px;
    }

    .nucleus-transactions-bulk-count,
    .nucleus-transactions-bulk-overrides {
        width: 100%;
    }

    .nucleus-transactions-bulk-btn {
        flex: 1 1 100%;
        min-width: 0;
    }
}

.nucleus-transactions-bulk-btn {
    height: var(--tx-control-height, 36px);
    padding: 0 10px;
    border-radius: var(--tx-control-radius, 999px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.nucleus-transactions-bulk-btn:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.09);
}

.nucleus-transactions-bulk-btn:focus-visible,
.nucleus-transactions-bulk-select:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 2px;
}

body.light-theme .nucleus-transactions-bulk-btn:focus-visible,
body.light-theme .nucleus-transactions-bulk-select:focus-visible,
body.light-theme .nucleus-transactions-bulk-overrides-info:focus-visible {
    outline-color: rgba(37, 99, 235, 0.7);
}

.nucleus-transactions-bulk-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nucleus-transactions-bulk-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.nucleus-transactions-bulk-select-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.nucleus-transactions-bulk-select {
    height: var(--tx-control-height, 36px);
    border-radius: var(--tx-control-radius, 999px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    padding: 0 28px 0 10px;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

body.light-theme .nucleus-transactions-bulk-select {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(15, 23, 42, 0.03);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-transactions-bulk-btn {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(15, 23, 42, 0.04);
    color: rgba(15, 23, 42, 0.88);
}

body.light-theme .nucleus-transactions-bulk-btn:hover:not(:disabled) {
    border-color: rgba(15, 23, 42, 0.3);
    background: rgba(15, 23, 42, 0.08);
}

body.light-theme .nucleus-transactions-bulk-btn:disabled {
    opacity: 1;
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.45);
}

body.light-theme .nucleus-transactions-bulk-select:disabled {
    opacity: 1;
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.02);
    color: rgba(15, 23, 42, 0.45);
}

body.light-theme .nucleus-transactions-bulk-count,
body.light-theme .nucleus-transactions-bulk-select-wrap {
    color: rgba(15, 23, 42, 0.66);
}

body.light-theme .nucleus-transactions-bulk-overrides {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(15, 23, 42, 0.04);
    color: rgba(15, 23, 42, 0.68);
}

body.light-theme .nucleus-transactions-bulk-overrides-info {
    border-color: rgba(15, 23, 42, 0.22);
    color: rgba(15, 23, 42, 0.62);
}

body.light-theme .nucleus-transactions-bulk-overrides-info:hover {
    border-color: rgba(15, 23, 42, 0.38);
    color: rgba(15, 23, 42, 0.88);
}

body.light-theme .nucleus-transactions-bulk-overrides-tooltip {
    border-color: rgba(15, 23, 42, 0.18);
    background: #ffffff;
    color: rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

body.light-theme .nucleus-transactions-bulk-overrides-tooltip::after {
    border-right-color: rgba(15, 23, 42, 0.18);
    border-bottom-color: rgba(15, 23, 42, 0.18);
}

.nucleus-transactions-table-el tbody tr[data-tx-type] td {
    cursor: pointer;
}

.nucleus-transactions-table-el tbody tr.nucleus-transactions-group-row td {
    background: var(--color-bg-input);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    cursor: pointer;
    user-select: none;
}

@keyframes nucleusTxRowPulse {
    0% {
        box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.75);
    }
    100% {
        box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
    }
}

@media (prefers-reduced-motion: reduce) {
    #nucleus-calendar-section.is-active-panel,
    #nucleus-tab-panel-dashboard.is-active-panel,
    #nucleus-tab-panel-budget.is-active-panel,
    #nucleus-tab-panel-operations.is-active-panel,
    .nucleus-transactions-search-counter,
    .nucleus-transactions-search-clear-btn,
    .nucleus-transactions-table-el tbody tr.is-selected.is-pulse td,
    .nucleus-tx-card.is-selected.is-pulse,
    .nucleus-transactions-bulk-overrides,
    .nucleus-transactions-bulk-overrides-info,
    .nucleus-transactions-bulk-btn,
    .nucleus-transactions-bulk-select,
    .nucleus-transactions-bulk-overrides-tooltip {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

.nucleus-transactions-table-el tbody td:nth-child(4) {
    white-space: nowrap;
}

.nucleus-transactions-table-el tbody td:nth-child(5) {
    white-space: nowrap;
}

.nucleus-stat-card {
    /* slightly more transparent card background */
    background: color-mix(in srgb, var(--color-bg-tertiary) 30%, transparent);
    border-radius: 24px;
    padding: var(--spacing-3xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: relative;
    min-height: 120px;
}

.nucleus-stat-label {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Stability badge (NORMAL / WARNING / CRITICAL)
   ============================================ */
.nucleus-stat-stability-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.nucleus-stat-stability-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.01);
    color: #e5e7eb;
    font-family: var(--font-primary);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    min-width: auto;
    position: relative;
    overflow: hidden;
}

body.light-theme .nucleus-stat-stability-badge {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.78);
}

.nucleus-stat-stability-badge::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.9;
}

.nucleus-stat-stability-badge--normal {
    color: #22c55e;
}

.nucleus-stat-stability-badge--warning {
    color: #f59e0b;
}

.nucleus-stat-stability-badge--critical {
    color: #fb923c;
}

.nucleus-stat-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    flex-wrap: nowrap;
    line-height: 1.2;
}

.nucleus-stat-value {
    font-family: var(--font-primary);
    font-size: clamp(1.8rem, 1.55rem + 0.75vw, 2.3rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.nucleus-stat-currency {
    font-family: var(--font-primary);
    font-size: clamp(1.8rem, 1.55rem + 0.75vw, 2.3rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    opacity: 0.2;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

/* Валюты, которые пишутся слева (доллар, юань и т.д.) */
.nucleus-stat-value-wrapper.currency-left {
    flex-direction: row;
}

.nucleus-stat-value-wrapper.currency-left .nucleus-stat-currency {
    order: -1;
    margin-right: var(--spacing-xs);
    margin-left: 0;
}

/* Валюты, которые пишутся справа (рубль, евро, фунт и т.д.) */
.nucleus-stat-value-wrapper.currency-right {
    flex-direction: row;
}

.nucleus-stat-value-wrapper.currency-right .nucleus-stat-currency {
    order: -1;
    margin-right: var(--spacing-xs);
    margin-left: 0;
}

/* ============================================
   CALENDAR SECTION
   ============================================ */

.nucleus-calendar-section {
    width: 100%;
    height: auto;
    /* slightly more transparent section background */
    background: color-mix(in srgb, var(--color-bg-tertiary) 30%, transparent);
    border-radius: 24px;
    padding: var(--spacing-xl) var(--spacing-3xl) var(--spacing-3xl);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    min-height: 0;
    overflow: visible;
    box-sizing: border-box;
}

/* Шапка календаря: дата слева, селекты и навигация справа */
.nucleus-calendar-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    width: 100%;
    min-height: 56px;
    height: auto;
    max-height: none;
    padding-inline: 0;
    box-sizing: border-box;
    overflow: visible;
}

.nucleus-calendar-header-leading {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    gap: 0;
    height: auto;
    align-self: center;
    padding-top: 0;
}

.nucleus-calendar-header-title-row {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    white-space: nowrap;
    line-height: 1;
    height: auto;
}

/* Главная строка шапки календаря — только дата */
.nucleus-calendar-header-date {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    white-space: nowrap;
    line-height: 1.1;
}

/* Строка под INCOME/EXPENSES/BUDGET: остаток после фактических расходов */
.nucleus-stats-actual-row {
    margin: 8px 0 0;
    font-size: var(--font-size-sm, 0.8125rem);
    line-height: 1.4;
    color: var(--color-text-secondary);
    max-width: 42rem;
}

/* Чипы месяцев с сохранёнными снимками */
.nucleus-snapshot-months-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 12px;
}

.nucleus-snapshot-months-nav[hidden] {
    display: none !important;
}

.nucleus-snapshot-months-nav__label {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    flex: 0 0 auto;
}

.nucleus-snapshot-months-nav__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nucleus-snapshot-months-nav__chip {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-primary);
    font-size: var(--font-size-xs, 0.75rem);
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.2;
}

.nucleus-snapshot-months-nav__chip:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nucleus-snapshot-months-nav__chip.is-active {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.12);
}

.nucleus-calendar-header-center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    min-width: 0;
    height: auto;
    align-self: center;
    padding-top: 0;
    margin-left: auto;
}

/* Секция календаря: та же шапка без absolute — дата слева, контролы справа */
.nucleus-calendar-section > .nucleus-calendar-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--spacing-md) !important;
    position: relative !important;
    min-height: 56px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.nucleus-calendar-section > .nucleus-calendar-header > .nucleus-calendar-header-center,
.nucleus-calendar-section > .nucleus-calendar-header > .nucleus-calendar-header-leading {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nucleus-calendar-section > .nucleus-calendar-header > .nucleus-calendar-header-leading {
    align-items: flex-start !important;
    text-align: left !important;
}

.nucleus-calendar-section > .nucleus-calendar-header > .nucleus-calendar-header-center {
    margin-left: auto !important;
    justify-content: flex-end !important;
}

.nucleus-calendar-section > .nucleus-calendar-header .nucleus-calendar-controls,
.nucleus-calendar-section > .nucleus-calendar-header .nucleus-calendar-selects {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    align-items: center !important;
}

.nucleus-calendar-section > .nucleus-calendar-header .nucleus-calendar-header-title-row {
    justify-content: flex-start !important;
    align-items: flex-start !important;
}

.nucleus-calendar-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
    flex-shrink: 0;
}

.nucleus-calendar-controls {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.nucleus-calendar-nav-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0;
    gap: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xl);
    border: var(--color-input-border);
    background: var(--color-input-bg);
    cursor: pointer;
    opacity: 1;
    transition: background var(--transition-base), border-color var(--transition-base);
    pointer-events: auto;
    color: var(--color-input-text);
    flex-shrink: 0;
    box-sizing: border-box;
}

.nucleus-calendar-nav-btn:hover {
    background: var(--color-input-bg-hover);
    border: var(--color-input-border);
    opacity: 1;
}

.nucleus-calendar-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    opacity: 0.6;
    transition: opacity var(--transition-base);
}

.nucleus-calendar-nav-btn:hover .nucleus-calendar-nav-icon {
    opacity: 1;
}

.nucleus-calendar-nav-icon svg {
    width: 100%;
    height: 100%;
    color: currentColor;
    display: block;
}

body:not(.light-theme) .nucleus-calendar-nav-btn {
    color: rgba(255, 255, 255, 0.6);
}

body:not(.light-theme) .nucleus-calendar-nav-btn:hover {
    color: rgba(255, 255, 255, 1);
}

body:not(.light-theme) .nucleus-calendar-nav-icon {
    color: rgba(255, 255, 255, 0.6);
}

body:not(.light-theme) .nucleus-calendar-nav-btn:hover .nucleus-calendar-nav-icon {
    color: rgba(255, 255, 255, 1);
}

body.light-theme .nucleus-calendar-nav-btn {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .nucleus-calendar-nav-btn:hover {
    color: rgba(0, 0, 0, 1);
}

body.light-theme .nucleus-calendar-nav-icon {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .nucleus-calendar-nav-btn:hover .nucleus-calendar-nav-icon {
    color: rgba(0, 0, 0, 1);
}

.nucleus-calendar-selects {
    display: flex;
    gap: calc(var(--spacing-md) - 2px);
    flex-shrink: 0;
    align-items: center;
}

/* Стили для кастомных селектов берутся из css/components/selects.css */

/* Ширина селектов календаря — по контенту (перебиваем width:100% из selects.css) */
.nucleus-calendar-selects .invoice-currency-wrapper {
    display: inline-block;
    width: auto;
    max-width: 100%;
    vertical-align: middle;
    flex-shrink: 0;
}

.nucleus-calendar-selects .invoice-currency-select {
    width: max-content;
    max-width: 100%;
    box-sizing: border-box;
}

.nucleus-calendar-selects .invoice-currency-select .currency-value {
    flex: 0 1 auto;
    white-space: nowrap;
}

.nucleus-calendar-selects .invoice-currency-dropdown {
    left: 0;
    right: 0;
    width: 100%;
    min-width: max(100%, 8rem);
    max-width: min(320px, 90vw);
}

/* Селект месяца: шире триггер и список + воздух у пунктов (базовый inner в selects.css с padding 2px) */
.nucleus-calendar-selects #calendar-month-wrapper {
    min-width: clamp(10.5rem, 30vw, 14rem);
}

.nucleus-calendar-selects #calendar-month-wrapper .invoice-currency-select {
    width: 100%;
    min-width: 0;
}

.nucleus-calendar-selects #calendar-month-wrapper .invoice-currency-dropdown {
    min-width: max(100%, 11rem);
    max-width: min(22rem, 94vw);
}

.nucleus-calendar-selects #calendar-month-wrapper .invoice-currency-dropdown-inner {
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: var(--spacing-xs);
}

.nucleus-calendar-selects #calendar-month-wrapper .currency-option {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-md);
}

.nucleus-calendar-selects #calendar-month-wrapper .currency-option.selected {
    padding-right: var(--dropdown-option-selected-padding-right);
}

.nucleus-calendar-months {
    display: flex;
    gap: var(--spacing-xl);
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    min-height: 0;
}

.nucleus-calendar-month {
    flex: 1; /* Календари занимают равное пространство */
    min-width: 0;
    min-height: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    transition: all var(--transition-base);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: auto;
}

.nucleus-calendar-month.active {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Вертикальные разделители между календарями */
.nucleus-calendar-divider {
    width: 1px;
    height: calc(100% - 24px);
    background: rgba(168, 168, 168, 0.1);
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    pointer-events: none;
    margin: 12px calc((var(--spacing-xl) - 1px) / 2); /* Центрируем разделитель в gap, добавляем отступ сверху и снизу */
    align-self: center; /* Центрируем вертикально */
}

/* Светлая тема: разделители календарей */
body.light-theme .nucleus-calendar-divider {
    background: rgba(15, 23, 42, 0.1);
}

.nucleus-calendar-month-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    text-align: center;
    flex-shrink: 0;
}

.nucleus-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    align-content: start;
    grid-auto-rows: 28px;
    flex: 1; /* Занимает оставшееся пространство */
    min-height: 0; /* Позволяет сжиматься */
    height: 220px; /* Фиксированная высота для 6 строк (1 заголовок + 6 строк дней) */
}

.nucleus-calendar-day {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: var(--font-primary);
    font-size: 12px;
    color: var(--color-text-secondary);
    position: relative;
    transition: all var(--transition-base);
    cursor: pointer;
    box-sizing: border-box;
    margin: 0 auto;
}

.nucleus-calendar-day:hover:not(.is-today):not(.nucleus-calendar-day-header) {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
}

.nucleus-calendar-day.has-income {
    background: color-mix(in srgb, var(--color-accent-primary) 20%, transparent);
    color: var(--color-accent-primary);
}

.nucleus-calendar-day.has-expense {
    background: rgba(161, 161, 170, 0.14);
    color: #a1a1aa;
}

.nucleus-calendar-day.has-both {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--color-accent-primary) 20%, transparent) 0%,
        rgba(161, 161, 170, 0.14) 100%
    );
    color: var(--color-text-primary);
}

.nucleus-calendar-day.is-today {
    background: transparent;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-bold);
    position: relative;
    border: 1px solid var(--color-accent-primary);
}

.nucleus-calendar-day.is-today:hover {
    background: color-mix(in srgb, var(--color-accent-primary) 10%, transparent);
    border-color: var(--color-accent-primary);
}

.nucleus-calendar-day-header {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-tertiary);
    opacity: 0.7;
    cursor: default; /* Убираем pointer курсор */
    pointer-events: none; /* Отключаем все интерактивные события */
}

/* Метка (точка) для дней с бюджетом */
.nucleus-calendar-day.has-budget {
    position: relative;
}

.nucleus-calendar-budget-dot {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success, #0e7c66);
    pointer-events: none;
    z-index: 1;
    box-shadow: none;
}

.nucleus-calendar-day[style*="visibility: hidden"] {
    pointer-events: none;
}

.nucleus-calendar-legend-item {
    display: flex;
    align-items: center;
    /* 8px gap between dot and text */
    gap: 8px;
}

.nucleus-calendar-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent-primary);
    box-shadow: none;
    flex-shrink: 0;
}

.nucleus-calendar-legend-dot-expense {
    background: #a1a1aa;
}

/* Легенда шапки: день бюджета — зелёная метка (согласовано с --color-success) */
.nucleus-calendar-legend-dot-budget {
    background: var(--color-success, #0e7c66);
}

/* Базовый класс — не для подписей шапки (у них свой каскад через .nucleus-calendar-header-legend-label) */
.nucleus-calendar-legend-text:not(.nucleus-calendar-header-legend-label) {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

/* ============================================
   MONTH BOARD
   ============================================ */

.nucleus-month-board {
    width: 100%;
    min-height: 300px;
    /* slightly more transparent board background */
    background: color-mix(in srgb, var(--color-bg-tertiary) 30%, transparent);
    border-radius: 24px;
    padding: var(--spacing-4xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* С данными: контент на всю ширину, без центрирования колонки */
.nucleus-month-board:not(.zero-state) {
    align-items: stretch;
    justify-content: flex-start;
}

.nucleus-month-board.zero-state {
    text-align: center;
}

.nucleus-month-board-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.06);
}

.nucleus-month-board-empty-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.nucleus-month-board-empty-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin: 0;
}

.nucleus-month-board-empty-description {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    color: var(--color-text-tertiary);
    margin: 0;
}

.nucleus-month-board-zero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 420px;
}

.nucleus-month-board-import-csv-btn {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    padding: var(--spacing-md) var(--spacing-2xl);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.nucleus-month-board-import-csv-btn:hover {
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-month-board-import-csv-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--color-text-secondary);
}

body.light-theme .nucleus-month-board-import-csv-btn:hover {
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--color-text-primary);
}

.nucleus-month-board-add-btn {
    background: var(--color-accent-primary);
    color: var(--color-text-primary);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--spacing-md) var(--spacing-3xl);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.nucleus-month-board-add-btn:hover {
    background: var(--color-accent-hover);
}

.nucleus-month-board-data {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
}

/* Вкладка «Транзакции»: 1) бюджет месяца, 2) реестр транзакций (order фиксирует порядок при любом flex) */
.nucleus-month-board-data--stacked {
    flex-direction: column;
    gap: var(--spacing-3xl);
}

.nucleus-month-board-data--stacked > .nucleus-month-board-budgets-pane {
    order: 1;
}

.nucleus-month-board-data--stacked > .nucleus-month-board-transactions-pane {
    order: 2;
}

/* Вкладка «Операции»: колонка из двух островков (график + реестр), без общей карточки */
.nucleus-operations-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-3xl);
    width: 100%;
}

.nucleus-operations-chart-host.nucleus-month-board,
.nucleus-operations-ledger-host.nucleus-month-board {
    min-height: 0;
}

.nucleus-operations-ledger-host .nucleus-month-board-transactions-pane {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Островок графика «Операции»: сгруппированные столбики (текущий год vs год назад) */
.nucleus-ops-chart-island {
    width: 100%;
    padding: var(--spacing-2xl) var(--spacing-3xl);
    border-radius: 20px;
    border: none;
    background: transparent;
    box-sizing: border-box;
}

body.light-theme .nucleus-ops-chart-island {
    background: transparent;
}

.nucleus-ops-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

/* Период Cashflow: в одной строке с табами (#nucleus-overview-cashflow-root переопределяет выравнивание) */
.nucleus-ops-chart-period-bar {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    line-height: 1.35;
    color: var(--color-text-tertiary);
}

.nucleus-ops-chart-period-v {
    display: inline-block;
    max-width: 100%;
}

.nucleus-ops-chart-head-main {
    flex: 1;
    min-width: 200px;
}

.nucleus-ops-chart-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.nucleus-ops-chart-section-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
}

.nucleus-ops-chart-metric {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    max-width: 100%;
}

body.light-theme .nucleus-ops-chart-metric {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
}

.nucleus-ops-chart-total-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--spacing-md);
}

.nucleus-ops-chart-total {
    font-family: var(--font-primary);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.nucleus-ops-chart-legend {
    list-style: none;
    margin: var(--spacing-md) 0 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.nucleus-ops-chart-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nucleus-ops-chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nucleus-ops-chart-legend-dot--current {
    background: var(--color-text-primary);
}

.nucleus-ops-chart-legend-dot--prior {
    background: rgba(255, 255, 255, 0.28);
}

body.light-theme .nucleus-ops-chart-legend-dot--prior {
    background: rgba(0, 0, 0, 0.22);
}

/* Ось Y и plot: одна высота шкалы 200px; подписи месяцев только в plot (ниже сетки) */
.nucleus-ops-chart-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 var(--spacing-md, 16px);
    align-items: start;
    width: 100%;
}

.nucleus-ops-chart-y {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    width: auto;
    min-width: 3.5rem;
    max-width: 6rem;
    /* Строго высота области столбиков = высота сетки (не растягивать на подписи X) */
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    padding: 0 6px 0 0;
    margin: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
    font-size: 10px;
    color: var(--color-text-tertiary);
    text-align: right;
    align-self: start;
}

.nucleus-ops-chart-y-tick {
    line-height: 1;
    display: block;
}

.nucleus-ops-chart-plot {
    grid-column: 2;
    position: relative;
    min-width: 0;
    width: 100%;
    min-height: 200px;
    align-self: start;
    box-sizing: border-box;
    /* Место под подписи месяцев под зоной 200px */
    padding-bottom: 40px;
}

/* Сетка и линия «ноль» только над областью столбиков, не над .nucleus-ops-chart-xlabel */
.nucleus-ops-chart-grid {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    height: 200px;
    pointer-events: none;
    /* repeating даёт линии на 25/50/75/100%; без отдельной линии на 0% — верхняя метка «висит» */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(25% - 1px),
        rgba(255, 255, 255, 0.06) calc(25% - 1px),
        rgba(255, 255, 255, 0.06) 25%
    );
}

body.light-theme .nucleus-ops-chart-grid {
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.06);
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(25% - 1px),
        rgba(0, 0, 0, 0.06) calc(25% - 1px),
        rgba(0, 0, 0, 0.06) 25%
    );
}

.nucleus-ops-chart-bars {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    min-height: 200px;
    padding: 0 4px;
}

/* Две строки: ровно 200px под столбики + отдельная строка под подписи (не в зоне сетки) */
.nucleus-ops-chart-group {
    flex: 1;
    display: grid;
    grid-template-rows: 200px auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    justify-items: center;
    min-width: 0;
}

.nucleus-ops-chart-bar-pair {
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    width: 100%;
    max-width: 44px;
    height: 200px;
}

.nucleus-ops-chart-bar {
    flex: 1;
    max-width: 16px;
    border-radius: 3px;
    min-height: 2px;
    align-self: flex-end;
}

.nucleus-ops-chart-bar--current {
    background: var(--color-text-primary);
}

.nucleus-ops-chart-bar--prior {
    background: rgba(255, 255, 255, 0.22);
}

body.light-theme .nucleus-ops-chart-bar--prior {
    background: rgba(0, 0, 0, 0.18);
}

/* Режим «All»: три пары столбиков в ряд от одной базы (grouped bars), общая шкала Y */
.nucleus-ops-chart-group--all .nucleus-ops-chart-all-metrics {
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    justify-self: center;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 200px;
    width: 100%;
    max-width: 96px;
}

/* Явная ширина swatch/pair — иначе width:100% у pair даёт цикл «ширина от контента» и столбики схлопываются в 0 */
.nucleus-ops-chart-group--all .nucleus-ops-chart-all-swatch {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 0 0 28px;
    width: 28px;
    min-width: 28px;
    height: 200px;
    box-sizing: border-box;
}

.nucleus-ops-chart-group--all .nucleus-ops-chart-all-pair {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 200px;
    max-width: none;
    gap: 3px;
    box-sizing: border-box;
}

.nucleus-ops-chart-group--all .nucleus-ops-chart-all-pair .nucleus-ops-chart-bar {
    flex: 0 0 auto;
    width: 11px;
    min-width: 11px;
    max-width: 11px;
    border-radius: 2px;
}

.nucleus-ops-chart-bar--income-current {
    background: var(--color-success);
}

.nucleus-ops-chart-bar--income-prior {
    background: rgba(14, 124, 102, 0.38);
}

.nucleus-ops-chart-bar--expenses-current {
    background: var(--color-warning);
}

.nucleus-ops-chart-bar--expenses-prior {
    background: rgba(255, 152, 0, 0.42);
}

.nucleus-ops-chart-bar--net-current {
    background: var(--color-info);
}

.nucleus-ops-chart-bar--net-prior {
    background: rgba(33, 150, 243, 0.42);
}

body.light-theme .nucleus-ops-chart-bar--income-prior {
    background: rgba(14, 124, 102, 0.32);
}

body.light-theme .nucleus-ops-chart-bar--expenses-prior {
    background: rgba(230, 126, 0, 0.38);
}

body.light-theme .nucleus-ops-chart-bar--net-prior {
    background: rgba(25, 118, 210, 0.36);
}

.nucleus-ops-chart-legend-dot--income {
    background: var(--color-success);
}

.nucleus-ops-chart-legend-dot--expenses {
    background: var(--color-warning);
}

.nucleus-ops-chart-legend-dot--net {
    background: var(--color-info);
}

/* Те же оттенки, что у столбиков prior в режиме All — легенда Income/Expenses/Net */
.nucleus-ops-chart-legend-dot--income-prior {
    background: rgba(14, 124, 102, 0.38);
}

.nucleus-ops-chart-legend-dot--expenses-prior {
    background: rgba(255, 152, 0, 0.42);
}

.nucleus-ops-chart-legend-dot--net-prior {
    background: rgba(33, 150, 243, 0.42);
}

body.light-theme .nucleus-ops-chart-legend-dot--income-prior {
    background: rgba(14, 124, 102, 0.32);
}

body.light-theme .nucleus-ops-chart-legend-dot--expenses-prior {
    background: rgba(230, 126, 0, 0.38);
}

body.light-theme .nucleus-ops-chart-legend-dot--net-prior {
    background: rgba(25, 118, 210, 0.36);
}

.nucleus-ops-chart-legend--all {
    gap: 12px 22px;
}

.nucleus-ops-chart-total-all {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.nucleus-ops-chart-total-all-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: 1.3;
}

.nucleus-ops-chart-total-all-k {
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-medium);
    min-width: 4.5rem;
}

.nucleus-ops-chart-total-all-v {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: clamp(1rem, 2vw, 1.2rem);
    letter-spacing: -0.02em;
}

.nucleus-ops-chart-xlabel {
    grid-row: 2;
    grid-column: 1;
    font-family: var(--font-primary);
    font-size: 10px;
    color: var(--color-text-tertiary);
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
    margin: 0;
    padding-top: 2px;
}

.nucleus-month-board-budgets-pane {
    display: block;
}

.nucleus-month-board-transactions-pane {
    margin-top: 0;
    padding-top: var(--spacing-2xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Как у .nucleus-transactions-table: тулбар/поиск — снаружи section, без наследования переменных */
    --tx-control-height: 40px;
    --tx-control-radius: 12px;
    --tx-control-border-dark: 1px solid rgba(255, 255, 255, 0.12);
    --tx-control-bg-dark: rgba(255, 255, 255, 0.04);
    --tx-control-border-light: 1px solid rgba(0, 0, 0, 0.12);
    --tx-control-bg-light: rgba(0, 0, 0, 0.02);
}

body.light-theme .nucleus-month-board-transactions-pane {
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* Внутри панели транзакций нижний отступ таблицы не дублирует gap контейнера */
.nucleus-month-board-transactions-pane .nucleus-transactions-table {
    margin-bottom: 0;
}

.nucleus-month-board-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: var(--spacing-3xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.nucleus-month-board-list {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nucleus-month-board-list-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.nucleus-month-board-list-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.nucleus-month-board-list-item {
    display: grid;
    grid-template-columns: minmax(4.5rem, auto) 1fr auto;
    gap: var(--spacing-md);
    align-items: baseline;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
}

.nucleus-month-board-list-date {
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

.nucleus-month-board-list-name {
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.nucleus-month-board-list-amount {
    font-weight: var(--font-weight-semibold);
    color: var(--color-accent-primary);
    white-space: nowrap;
}

body.light-theme .nucleus-month-board-list {
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .nucleus-month-board-card-date {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-secondary);
}

.nucleus-month-board-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-2xl);
    gap: var(--spacing-lg);
}

/* Колонка заголовка: явная иерархия «заголовок → период → имя» */
.nucleus-month-board-card-header > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm, 10px);
    min-width: 0;
}

.nucleus-month-board-card-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-text-primary);
}

.nucleus-month-board-card-date {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-medium, 500);
    line-height: 1.25;
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-full);
}

/* Кастомное имя бюджета из FM, если отличается от «Month YYYY» */
.nucleus-month-board-card-named {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs, 6px);
    line-height: 1.35;
}

.nucleus-month-board-card-delete {
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--color-text-primary) 14%, transparent);
    color: var(--color-text-tertiary);
    border-radius: var(--radius-md);
    width: 2.25rem;
    height: 2.25rem;
    padding: var(--spacing-xs, 6px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.nucleus-month-board-card-delete:hover {
    border-color: color-mix(in srgb, var(--color-error, #fb923c) 35%, transparent);
    background: color-mix(in srgb, var(--color-error, #fb923c) 10%, transparent);
    color: var(--color-error, #fb923c);
}

.nucleus-month-board-card-delete svg {
    display: block;
    flex-shrink: 0;
}

.nucleus-month-board-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

/* Режим «только список по дням»: без тройной сетки INCOME/BUDGET */
.nucleus-month-board-card-stats--per-day-mode {
    grid-template-columns: 1fr;
    max-width: 320px;
}

/* Блоки бюджета по датам снимка */
.nucleus-month-board-card--budget-blocks {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.nucleus-month-board-card--budget-blocks .nucleus-month-board-card-header {
    margin-bottom: var(--spacing-lg, 16px);
}

.nucleus-month-board-card--budget-blocks .nucleus-month-board-card-title {
    font-size: clamp(1.125rem, 2.5vw, 1.35rem);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.025em;
}

.nucleus-month-board-card--budget-blocks .nucleus-month-board-card-date {
    display: inline-block;
}

.nucleus-month-board-budget-blocks {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl, 20px);
    margin-top: var(--spacing-sm, 8px);
}

/* Отдельная карточка на каждый бюджет — компактный radius для внутренних блочков
   (внешний остров оставляем крупным через --nucleus-fin-island-radius). */
.nucleus-month-board-budget-block-card {
    background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.04));
    border: none;
    box-shadow: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl, 20px);
    box-sizing: border-box;
}

.nucleus-month-board-budget-block-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md, 12px);
    margin-bottom: var(--spacing-lg, 16px);
    padding-bottom: var(--spacing-md, 12px);
    border-bottom: none;
}

/* Плавное раскрытие/сворачивание тела карточки бюджета */
.nucleus-month-board-budget-block-card__body {
    max-height: 720px;
    opacity: 1;
    overflow: hidden;
    transition:
        max-height 0.28s ease,
        opacity 0.22s ease;
    will-change: max-height, opacity;
}

.nucleus-month-board-budget-block-card--collapsed .nucleus-month-board-budget-block-card__body {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.nucleus-month-board-budget-block-card--collapsed .nucleus-month-board-budget-block-card__head {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

@media (prefers-reduced-motion: reduce) {
    .nucleus-month-board-budget-block-card__body {
        transition: none;
    }
}

.nucleus-month-board-budget-block-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: var(--radius-md, 10px);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nucleus-month-board-budget-block-toggle:hover {
    background: var(--color-button-secondary-hover, rgba(255, 255, 255, 0.08));
    color: var(--color-text-primary);
}

.nucleus-month-board-budget-block-toggle:focus-visible {
    outline: 2px solid var(--color-button-primary-focus, rgba(14, 124, 102, 0.6));
    outline-offset: 2px;
}

/* Шеврон: вниз = развёрнуто, вправо = свёрнуто */
.nucleus-month-board-budget-block-toggle-icon {
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.nucleus-month-board-budget-block-card--collapsed .nucleus-month-board-budget-block-toggle-icon {
    transform: translateY(0) rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
    .nucleus-month-board-budget-block-toggle-icon {
        transition: none;
    }
}

.nucleus-month-board-budget-block-card__head-text {
    flex: 1 1 220px;
    min-width: 0;
    cursor: pointer;
}

.nucleus-month-board-budget-block-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm, 8px);
    flex-shrink: 0;
    align-items: center;
}

/* Кнопки edit/delete у бюджет/income-карточек — единый стиль с .nucleus-tx-card-action. */
.nucleus-month-board-budget-edit,
.nucleus-month-board-budget-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 4px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md, 8px);
    color: var(--color-text-tertiary);
    cursor: pointer;
    opacity: 0.85;
    transition: background var(--transition-base, 0.2s), color var(--transition-base, 0.2s), opacity var(--transition-base, 0.2s);
}

.nucleus-month-board-budget-edit svg,
.nucleus-month-board-budget-delete svg {
    display: block;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.nucleus-month-board-budget-edit:hover,
.nucleus-month-board-budget-edit:focus-visible {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    color: var(--color-text-secondary);
    opacity: 1;
}

.nucleus-month-board-budget-delete:hover,
.nucleus-month-board-budget-delete:focus-visible {
    background: color-mix(in srgb, var(--color-error, #fb923c) 12%, transparent);
    color: var(--color-error, #fb923c);
    opacity: 1;
}

.nucleus-month-board-budget-block__title {
    margin: 0 0 0.2rem;
    font-family: var(--font-primary);
    font-size: var(--font-size-md, 0.9375rem);
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--color-text-primary);
}

.nucleus-month-board-budget-block-card__head .nucleus-month-board-budget-block__period {
    margin: 0;
}

.nucleus-month-board-budget-block__period {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 400;
    line-height: 1.35;
    color: var(--color-text-tertiary);
    max-width: 42rem;
}

.nucleus-month-board-budget-block__income {
    margin-bottom: var(--spacing-lg, 18px);
}

.nucleus-month-board-budget-block__income-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-sm, 8px);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: 1.35;
    color: var(--color-text-primary);
}

.nucleus-month-board-budget-block__income-name {
    font-weight: var(--font-weight-medium, 500);
    color: var(--color-text-secondary);
}

.nucleus-month-board-budget-block__income-amount {
    font-weight: var(--font-weight-semibold, 600);
    font-variant-numeric: tabular-nums;
    font-size: var(--nd-type-h4);
    color: var(--color-success, #4ade80);
}

.nucleus-month-board-budget-block__expenses-label {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-semibold, 600);
    text-transform: none;
    letter-spacing: 0.02em;
    line-height: 1.3;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm, 8px);
}

.nucleus-month-board-budget-expenses-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm, 8px);
}

.nucleus-month-board-budget-expense-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-sm, 8px);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs, 0.8125rem);
    line-height: 1.35;
    color: var(--color-text-secondary);
}

.nucleus-month-board-budget-expense-name {
    color: var(--color-text-primary);
}

.nucleus-month-board-budget-expense-amount {
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-medium, 500);
    font-size: var(--nd-type-caption);
    color: #a1a1aa;
}

.nucleus-month-board-budget-expenses-empty {
    margin: 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-xs, 0.8125rem);
    line-height: 1.4;
    color: var(--color-text-tertiary);
    font-style: normal;
}

.nucleus-month-board-stat {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.nucleus-month-board-stat-label {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nucleus-month-board-stat-value {
    font-family: var(--font-primary);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* ============================================
   AI SUMMARY
   ============================================ */

.nucleus-ai-summary {
    width: 100%;
    background: var(--color-bg-tertiary);
    border-radius: 24px;
    padding: var(--spacing-3xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.nucleus-ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nucleus-ai-summary-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.nucleus-ai-summary-content {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.nucleus-ai-summary-placeholder {
    color: var(--color-text-tertiary);
    font-style: italic;
}

/* Доп. блоки дашборда: единая панель + сетка в духе neobank (Revolut-like): один фон, разделители, без вложенных «коробок» */
.nucleus-dashboard-extra {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto var(--spacing-2xl);
    border-radius: 16px;
    --nucleus-extra-surface: transparent;
    --nucleus-extra-divider: rgba(255, 255, 255, 0.07);
    background: transparent;
    overflow: hidden;
}

body.light-theme .nucleus-dashboard-extra {
    --nucleus-extra-surface: transparent;
    --nucleus-extra-divider: rgba(0, 0, 0, 0.06);
    background: transparent;
}

/* Внешний столбец: квартет (1–4) → plan vs actual → goals → AI; между секциями gap 16px */
.nucleus-dashboard-extra-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.nucleus-dashboard-chat-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Встроенный чат: одна формула высоты (без второго max-height) — баланс пустоты и полезной области */
.nucleus-dashboard-chat-embed {
    /* flex-shrink:0 — иначе колонка дашборда сжимает embed и iframe до нулевой высоты */
    flex: 0 0 auto;
    width: 100%;
    height: clamp(680px, calc(48dvh + 400px), min(960px, calc(65dvh + 400px)));
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Скругление как у карточек Finance (токен с .nucleus-finance-island) */
    border-radius: var(--nucleus-fin-island-radius, var(--radius-3xl));
    overflow: hidden;
    border: 1px solid var(--nucleus-extra-divider);
    box-sizing: border-box;
    isolation: isolate;
    position: relative;
}

/* Чат без вложенной «карточки»: одна оболочка — только .nucleus-dashboard-chat-embed */
.nucleus-dashboard-extra.nucleus-dashboard-extra--bare-chat {
    max-width: none;
    margin-bottom: 0;
    overflow: visible;
}

.nucleus-dashboard-chat-iframe {
    position: relative;
    z-index: 0;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
    border: none;
    display: block;
    background: var(--color-bg-primary, #0a0a0a);
}

/* Блоки 1–2 / 3–4: сетка 2×2, gap 16px; строки по высоте = max(лево, право) */
.nucleus-dashboard-extra-quad {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--spacing-lg);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Карточка в правой колонке тянется на всю высоту строки */
.nucleus-dashboard-extra-quad > .nucleus-dashboard-extra-slot {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nucleus-dashboard-extra-quad > .nucleus-dashboard-extra-slot > .nucleus-dashboard-extra-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Слот AI: убираем возможные скругления от комбинации классов */
#nucleus-dashboard-container #nucleus-dashboard-ai-panel.nucleus-dashboard-extra-slot {
    border-radius: 0 !important;
}

.nucleus-dashboard-extra-slot {
    background: var(--nucleus-extra-surface);
    padding: 0;
    box-sizing: border-box;
    min-width: 0;
}

/* Разделители рисуем отдельным слоем поверх сетки */
.nucleus-dashboard-extra-grid-guides {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.nucleus-dashboard-extra-grid-guide {
    position: absolute;
    background: var(--nucleus-extra-divider);
    border-radius: 0;
    box-sizing: border-box;
    pointer-events: none;
}

@media (max-width: 900px) {
    .nucleus-dashboard-extra-quad {
        grid-template-columns: 1fr;
    }

    .nucleus-dashboard-extra-grid-guides {
        display: none;
    }

    .nucleus-dashboard-extra-quad > .nucleus-dashboard-extra-slot:not(#nucleus-dashboard-trend) {
        position: relative;
    }

    .nucleus-dashboard-extra-quad > .nucleus-dashboard-extra-slot:not(#nucleus-dashboard-trend)::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 1px;
        background: var(--nucleus-extra-divider);
    }
}

/* Внутренние «карточки» из JS — без второго фона, только контент */
.nucleus-dashboard-extra-slot .nucleus-dashboard-extra-card {
    padding: 22px 24px;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    height: auto;
    box-shadow: none;
}

.nucleus-dashboard-extra-card--muted {
    opacity: 0.9;
}

.nucleus-dashboard-extra-title {
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px;
    color: var(--color-text-tertiary);
}

.nucleus-dashboard-extra-body,
.nucleus-dashboard-extra-muted,
.nucleus-dashboard-extra-accent {
    font-family: var(--font-primary);
    font-size: 13px;
    line-height: 1.55;
    margin: 0;
    color: var(--color-text-secondary);
}

.nucleus-dashboard-extra-muted {
    color: var(--color-text-tertiary);
}

.nucleus-dashboard-extra-accent {
    color: var(--color-text-primary);
    font-weight: 600;
    margin-top: var(--spacing-sm);
}

.nucleus-dashboard-trend-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nucleus-dashboard-trend-row {
    display: grid;
    grid-template-columns: minmax(72px, 88px) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.nucleus-dashboard-trend-row-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-tertiary);
}

.nucleus-dashboard-sparkline {
    width: 100%;
    height: 40px;
    color: var(--color-text-tertiary);
}

.nucleus-dashboard-trend-x {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-top: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.nucleus-dashboard-mom-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-secondary);
}

.nucleus-dashboard-pva-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 640px) {
    .nucleus-dashboard-pva-grid {
        grid-template-columns: 1fr;
    }
}

.nucleus-dashboard-pva-k {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-tertiary);
    margin-bottom: 4px;
}

.nucleus-dashboard-pva-v {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.nucleus-dashboard-pva-delta.is-over .nucleus-dashboard-pva-v {
    color: #fb923c;
}

.nucleus-dashboard-pva-delta.is-ok .nucleus-dashboard-pva-v {
    color: #4ade80;
}

.nucleus-dashboard-pva-hint {
    margin-top: var(--spacing-sm) !important;
}

.nucleus-dashboard-stability-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    padding: 5px 10px 5px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    margin-bottom: var(--spacing-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.01);
    color: #e5e7eb;
    box-shadow: none;
    position: relative;
}

/* Акцент слева (как у .nucleus-taxes-context), без полоски снизу */
.nucleus-dashboard-stability-badge-inline::before {
    content: '';
    flex: 0 0 3px;
    width: 3px;
    height: 0.95em;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.92;
}

.nucleus-dashboard-stability-badge-inline--normal {
    color: #10b981;
}

.nucleus-dashboard-stability-badge-inline--warning {
    color: #f59e0b;
}

.nucleus-dashboard-stability-badge-inline--critical {
    color: #f97316;
}

body.light-theme .nucleus-dashboard-stability-badge-inline--normal {
    color: #16a34a;
}

body.light-theme .nucleus-dashboard-stability-badge-inline--warning {
    color: #d97706;
}

body.light-theme .nucleus-dashboard-stability-badge-inline--critical {
    color: #ea580c;
}

.nucleus-dashboard-insights-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.nucleus-dashboard-insights-list li + li {
    margin-top: 6px;
}

/* Блок «План по категориям»: та же единая панель, что у .nucleus-dashboard-extra — фон, 16px, разделители, без «второй коробки» */
.nucleus-main-tab-panel--dashboard .nucleus-budget-insights {
    margin-top: 0;
}

.nucleus-budget-insights {
    width: 100%;
    max-width: 1120px;
    margin: var(--spacing-2xl) auto 0;
    border-radius: 16px;
    padding: 0;
    border: none;
    overflow: hidden;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
}

body.light-theme .nucleus-budget-insights {
    background: rgba(0, 0, 0, 0.03);
}

.nucleus-budget-insights-head {
    margin: 0;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body.light-theme .nucleus-budget-insights-head {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.nucleus-budget-insights-title {
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-tertiary);
    margin: 0 0 10px;
    line-height: 1.25;
}

.nucleus-budget-insights-intro {
    font-family: var(--font-primary);
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 42rem;
}

.nucleus-budget-insights-no-categories {
    font-family: var(--font-primary);
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    padding: 16px 24px 22px;
    max-width: none;
    line-height: 1.55;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body.light-theme .nucleus-budget-insights-no-categories {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.nucleus-budget-insights-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body.light-theme .nucleus-budget-insights-pills {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Share % / Amounts внутри визуала: компактно, слева сверху */
.nucleus-budget-insights-visual-head {
    align-self: flex-start;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.nucleus-budget-insights-visual-head .nucleus-budget-insights-pills {
    margin: 0;
    padding: 3px 4px;
    gap: 4px;
    width: auto;
    max-width: none;
    border-bottom: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

/* DS: единый компонент Nucleus Segmented Pills (жёсткая фиксация внешнего вида). */
.nucleus-segmented-pills {
    margin: 0 !important;
    padding: 3px !important;
    gap: 3px !important;
    width: auto !important;
    max-width: max-content !important;
    border: none !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
    box-shadow: none !important;
}

.nucleus-segmented-pill {
    flex: 0 0 auto !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 5px 11px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    background: transparent !important;
    color: var(--rv-text-muted) !important;
    box-shadow: none !important;
    transform: none !important;
}

.nucleus-segmented-pill:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: var(--color-text-primary) !important;
}

.nucleus-segmented-pill.is-active {
    background: var(--rv-active-chip) !important;
    color: var(--color-text-primary) !important;
}

body.light-theme .nucleus-segmented-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

body.light-theme .nucleus-segmented-pill:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .nucleus-budget-insights-visual-head .nucleus-budget-insights-pills {
    background: rgba(0, 0, 0, 0.05);
}

.nucleus-budget-insights-visual-head .nucleus-budget-insights-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
}

.nucleus-budget-insights-visual-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-lg);
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    box-sizing: border-box;
}

.nucleus-budget-insights-pill {
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nucleus-budget-insights-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--color-text-primary);
}

.nucleus-budget-insights-pill.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: var(--color-text-primary);
    border-color: rgba(255, 255, 255, 0.22);
}

body.light-theme .nucleus-budget-insights-pill {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-budget-insights-pill:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .nucleus-budget-insights-pill.is-active {
    background: rgba(0, 0, 0, 0.08);
    color: var(--color-text-primary);
    border-color: rgba(0, 0, 0, 0.14);
}

/* Мобилка: столбик; десктоп: донат | разделитель | список.
   Revolut-like: вложенная мягкая «плитка», hairline, air, без тяжёлой рамки */
.nucleus-budget-insights-visual {
    --bi-pad-x: 22px;
    --bi-pad-y: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: calc(100% - 2 * var(--nucleus-island-h-gutter, var(--spacing-lg)));
    max-width: 100%;
    margin: 14px var(--nucleus-island-h-gutter, var(--spacing-lg)) 18px;
    padding: var(--bi-pad-y) var(--bi-pad-x) calc(var(--bi-pad-y) + 2px);
    gap: var(--spacing-md);
    box-sizing: border-box;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 28px rgba(0, 0, 0, 0.18);
}

body.light-theme .nucleus-budget-insights-visual {
    background: rgba(0, 0, 0, 0.025);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 8px 24px rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
    .nucleus-budget-insights-visual-main {
        --bi-left-col: 246px;
        --bi-gap: 28px;
        display: grid;
        grid-template-columns: var(--bi-left-col) minmax(0, 1fr);
        column-gap: var(--bi-gap);
        row-gap: 0;
        align-items: start;
    }

    .nucleus-budget-insights-visual-main::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(var(--bi-left-col) + (var(--bi-gap) / 2));
        width: 1px;
        background: rgba(255, 255, 255, 0.08);
        pointer-events: none;
    }

    body.light-theme .nucleus-budget-insights-visual-main::before {
        background: rgba(0, 0, 0, 0.07);
    }
}

.nucleus-budget-insights-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    flex: 0 0 auto;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .nucleus-budget-insights-chart {
        margin: 0;
        justify-content: flex-start;
        align-items: flex-start;
        align-self: start;
        padding-right: 0;
        margin-right: 0;
        border-right: none;
    }
}

.nucleus-budget-insights-donut-wrap {
    position: relative;
    width: min(280px, 72vw);
    aspect-ratio: 1;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: center;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

body.light-theme .nucleus-budget-insights-donut-wrap {
    background: rgba(0, 0, 0, 0.03);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
    .nucleus-budget-insights-visual-main .nucleus-budget-insights-donut-wrap {
        width: 244px;
        max-width: 244px;
        padding: 13px;
    }
}

.nucleus-budget-insights-donut-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Round caps: «точки» при нулевой длине штриха снимаем stroke-opacity в keyframes + в TS до --enter */
.nucleus-budget-insights-donut-svg circle.nucleus-budget-insights-donut-seg {
    stroke-linecap: round;
}

.nucleus-budget-insights-donut-empty {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-linecap: round;
}

body.light-theme .nucleus-budget-insights-donut-empty {
    stroke: rgba(0, 0, 0, 0.1);
}

.nucleus-budget-insights-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    padding: 18%;
}

.nucleus-budget-insights-donut-total {
    font-family: var(--font-primary);
    font-size: clamp(1.34rem, 3.95vw, 1.95rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-primary);
    line-height: 1.12;
}

.nucleus-budget-insights-donut-meta {
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-text-tertiary);
    margin-top: 6px;
    line-height: 1.3;
    opacity: 0.85;
}

.nucleus-budget-insights-rows {
    list-style: none;
    margin: 0;
    padding: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .nucleus-budget-insights-visual-main .nucleus-budget-insights-rows {
        flex: 1 1 0;
    }
}

.nucleus-budget-insights-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(80px, 2.2fr) minmax(72px, auto);
    align-items: center;
    gap: 12px 18px;
}

@media (max-width: 640px) {
    .nucleus-budget-insights-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .nucleus-budget-insights-row-value {
        justify-self: start;
    }
}

.nucleus-budget-insights-row-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nucleus-budget-insights-row-name {
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
    opacity: 0.92;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nucleus-budget-insights-row-sub {
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--color-text-tertiary);
}

.nucleus-budget-insights-row-est {
    font-family: var(--font-primary);
    font-size: 11px;
    color: var(--color-text-tertiary);
}

.nucleus-budget-insights-row-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

body.light-theme .nucleus-budget-insights-row-bar {
    background: rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}

.nucleus-budget-insights-row-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    min-width: 0;
    max-width: 100%;
    transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}

.nucleus-budget-insights-row-bar-fill.nucleus-bi-bar-fill--anim {
    transition: none;
}

body.light-theme .nucleus-budget-insights-row-bar-fill {
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.nucleus-budget-insights-row-bar-fill.is-over {
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
}

.nucleus-budget-insights-row-value {
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    text-align: right;
    white-space: nowrap;
    opacity: 0.95;
}

@media (max-width: 640px) {
    .nucleus-budget-insights-row-value {
        text-align: left;
    }
}

.nucleus-budget-insights-note {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    line-height: 1.5;
    color: var(--color-text-tertiary);
    margin: 0;
    padding: 16px 24px 22px;
    max-width: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-sizing: border-box;
}

body.light-theme .nucleus-budget-insights-note {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.nucleus-budget-insights-empty {
    font-family: var(--font-primary);
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    padding: 22px 24px;
    max-width: 48rem;
    line-height: 1.55;
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    .nucleus-budget-insights-row-bar-fill {
        transition: none;
    }

    .nucleus-budget-insights-row-bar-fill.nucleus-bi-bar-fill--anim {
        clip-path: none;
        opacity: 1;
    }
}

/* ============================================
   FINANCIAL MIRROR SIDEBAR
   ============================================ */

.nucleus-financial-mirror-sidebar {
    /* Ширина панели: +10% к прежним 524px → 576px */
    --nucleus-fm-drawer-width: 576px;
    --drawer-pad-inline: 16px;
    /* FM: как карточки месяца; в режиме налогов (.nucleus-sidebar--taxes-workspace) переопределяется на --drawer-pad-inline */
    --nucleus-fin-card-pad-x: var(--spacing-4xl);
    --drawer-gap-section: 32px;
    --drawer-gap-subsection: 20px;
    --drawer-gap-row: 12px;
    --drawer-gap-title: 16px;
    /* Как .nucleus-taxes-island--intro в finance island: обводка/тень острова + заливка полей (--rv-segment-track mix) */
    --nucleus-taxes-r-sm: 14px;
    /* Как у #nucleus-dashboard-container .nucleus-finance-island — заливка карточек налогов в дровере */
    --nucleus-fin-island-surface: rgba(255, 255, 255, 0.03);
    --nucleus-fin-island-border: rgba(255, 255, 255, 0.07);
    --nucleus-fin-island-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 1px 0 rgba(255, 255, 255, 0.02),
        0 14px 42px rgba(0, 0, 0, 0.16);
    /* Дровер фиксированной ширины — тот же визуальный радиус, что верх clamp на дашборде */
    --nucleus-fin-island-radius: 40px;
    --fm-drawer-field-fill: color-mix(in srgb, var(--color-bg-input) 84%, #000 16%);
    --fm-drawer-field-fill-hover: color-mix(in srgb, var(--color-bg-input) 78%, #000 22%);
    position: fixed;
    top: 0;
    right: calc(-1 * var(--nucleus-fm-drawer-width));
    width: var(--nucleus-fm-drawer-width);
    height: 100vh;
    background: var(--color-bg-tertiary);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    transition: right var(--transition-slow), 
                margin-top var(--transition-slow), 
                margin-bottom var(--transition-slow),
                height var(--transition-slow),
                padding-left var(--transition-slow),
                padding-right var(--transition-slow),
                border-radius var(--transition-slow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    border-radius: 0;
    box-sizing: border-box;
}

body.light-theme .nucleus-financial-mirror-sidebar {
    --nucleus-fin-island-surface: rgba(0, 0, 0, 0.025);
    --nucleus-fin-island-border: rgba(0, 0, 0, 0.08);
    --nucleus-fin-island-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 1px 0 rgba(255, 255, 255, 0.4),
        0 12px 36px rgba(0, 0, 0, 0.06);
    --fm-drawer-field-fill: color-mix(in srgb, var(--color-bg-input) 90%, #000 10%);
    --fm-drawer-field-fill-hover: color-mix(in srgb, var(--color-bg-input) 86%, #000 14%);
}

.nucleus-financial-mirror-sidebar.open {
    right: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    height: calc(100vh - 32px);
    padding-left: 0;
    padding-right: 0;
    border-radius: var(--nucleus-fin-island-radius);
    box-sizing: border-box;
    background: var(--color-bg-chat);
    border: 1px solid var(--nucleus-fin-island-border);
    box-shadow: var(--nucleus-fin-island-shadow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.nucleus-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: 16px var(--drawer-pad-inline) 12px;
    border-bottom: none;
}

/* Как #nucleus-page-title: .content-main-title в style.css (serif, 4xl, semibold, градиент) */
#nucleus-financial-mirror-sidebar .nucleus-sidebar-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.6) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme #nucleus-financial-mirror-sidebar .nucleus-sidebar-title {
    background: linear-gradient(135deg, #020617 0%, #0f172a 60%, #111827 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Как nucleus-month-board-budget-block-card__actions у карточки бюджета */
.nucleus-sidebar-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm, 8px);
    flex-shrink: 0;
    align-items: center;
}

/* Закрытие дровера: без рамки и фона по умолчанию; подсветка только при hover */
.nucleus-financial-mirror-sidebar .nucleus-sidebar-close {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    box-sizing: border-box;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: none;
    transition:
        background var(--transition-base, 0.2s),
        color var(--transition-base, 0.2s);
}

.nucleus-financial-mirror-sidebar .nucleus-sidebar-close:hover {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    color: var(--color-text-primary);
}

.nucleus-financial-mirror-sidebar .nucleus-sidebar-close:focus,
.nucleus-financial-mirror-sidebar .nucleus-sidebar-close:focus-visible {
    outline: none;
}

.nucleus-financial-mirror-sidebar .nucleus-sidebar-close .nucleus-drawer-close-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 1;
}

.nucleus-financial-mirror-sidebar .nucleus-sidebar-close .nucleus-drawer-close-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
    fill: none;
}

.nucleus-drawer-scope-hint {
    margin: 0 var(--drawer-pad-inline) var(--spacing-sm, 8px);
    padding: var(--spacing-sm, 8px) var(--spacing-md, 12px);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs, 0.75rem);
    line-height: 1.4;
    color: var(--color-text-tertiary);
    background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    border-radius: var(--radius-md, 8px);
    border: 1px solid color-mix(in srgb, var(--color-text-primary) 10%, transparent);
}

.nucleus-month-board-shared-expenses-hint {
    margin: 0 0 var(--spacing-md, 12px);
    padding: 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-xs, 0.75rem);
    line-height: 1.4;
    color: var(--color-text-tertiary);
    background: none;
}

.nucleus-sidebar-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Как у .nucleus-sidebar-footer: одинаковый отступ сверху и снизу (раньше 12 / 24) */
    padding: var(--drawer-pad-inline) 0;
    scrollbar-gutter: stable;
}

/*
 * Фокус во всём правом дровере: у .nucleus-financial-mirror-sidebar overflow:hidden —
 * outline с outline-offset: 2px режется по краям. Внутреннее кольцо (-2px).
 * FM/поля даты ниже тоже используют -2px (!important).
 */
#nucleus-financial-mirror-sidebar input:focus-visible,
#nucleus-financial-mirror-sidebar textarea:focus-visible,
#nucleus-financial-mirror-sidebar select:focus-visible,
#nucleus-financial-mirror-sidebar .nucleus-taxes-profile-input:focus,
#nucleus-financial-mirror-sidebar .nucleus-taxes-profile-input:focus-visible,
#nucleus-financial-mirror-sidebar .invoice-currency-select:focus-visible,
#nucleus-financial-mirror-sidebar .nucleus-sidebar-tab:focus-visible,
#nucleus-financial-mirror-sidebar .nucleus-sidebar-primary-btn:focus-visible,
#nucleus-financial-mirror-sidebar .nucleus-taxes-saved-doc-btn:focus-visible {
    outline-offset: -2px !important;
}

/* Налоги: скрываем FM и табы; контент — в #nucleus-sidebar-taxes-drawer-panel внутри того же .nucleus-sidebar-content, что и бюджет */
.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace .nucleus-sidebar-tabs,
.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-drawer-expenses-scope-hint,
.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #financial-mirror-container {
    display: none !important;
}

/* Налоги в дровере: внутренние скругления в ритме iOS-карточки (без cqw — фиксированная ширина панели) */
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace {
    --nucleus-taxes-r: 24px;
    --nucleus-taxes-r-sm: 16px;
}

/* Налоги: та же оболочка дровера, что Budget — .nucleus-sidebar-content + .nucleus-sidebar-footer без отдельной «карточки» */

#nucleus-sidebar-taxes-drawer-panel:not([hidden]) {
    /* Как #financial-mirror-container: только поток контента, inset задаёт .nucleus-sidebar-content */
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Кнопки профиля только в футере дровера; JS удаляет блок из клона — при старом кэше bundle скрываем дубль */
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-intro-actions {
    display: none !important;
}

.nucleus-taxes-drawer-panel-lead {
    margin: 0;
    padding: var(--spacing-sm) 0 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    line-height: 1.55;
    color: var(--color-text-secondary);
    max-width: 52ch;
}

/* Клон в дровере: скролл как у FM — у всего .nucleus-sidebar-content, без вложенного scrollport */
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-profile {
    border-top: none !important;
}

/*
 * Клон в дровере: инпуты/селекты как у FM в Budget (перебиваем rv-segment на градиенте --color-bg-chat).
 */
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .invoice-currency-select,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .invoice-currency-select {
    background: var(--fm-drawer-field-fill) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--nucleus-taxes-r-sm) !important;
    padding: 0 var(--spacing-md) 0 calc(var(--spacing-md) + 4px) !important;
    font-size: var(--font-size-sm) !important;
    color: var(--color-text-primary) !important;
    font-family: var(--font-primary) !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    line-height: 1.25 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    height: 44px !important;
    min-height: 44px !important;
}

#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input:hover,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .invoice-currency-select:hover,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .invoice-currency-select:hover,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .invoice-currency-wrapper.select-open
    .invoice-currency-select,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: var(--fm-drawer-field-fill-hover) !important;
    border: none !important;
}

#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input:focus,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input:focus-visible,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .invoice-currency-select:focus,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .invoice-currency-select:focus-visible,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .invoice-currency-select:focus,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .invoice-currency-select:focus-visible {
    outline: 2px solid var(--color-button-primary-focus) !important;
    outline-offset: -2px !important;
    background: var(--fm-drawer-field-fill) !important;
}

body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input,
body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .invoice-currency-select,
body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-profile
    .invoice-currency-select {
    background: var(--fm-drawer-field-fill) !important;
}

/* Шапка в дровере: без разделителя (у базового .nucleus-taxes-head нет border-bottom) */
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island--intro .nucleus-taxes-head {
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Клон: <header> удаляется в mountTaxesDrawerClone(); тулбар внутри .nucleus-taxes-profile */

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar {
    width: 100% !important;
    max-width: 100%;
    flex-shrink: 0 !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-selects {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
    width: 100%;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

@media (min-width: 640px) {
    #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-selects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .nucleus-taxes-field {
    min-width: 0 !important;
    flex: none !important;
    padding: 0 !important;
    border-left: none !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 44px;
    box-sizing: border-box;
    border-radius: var(--nucleus-taxes-r-sm);
    background: var(--fm-drawer-field-fill) !important;
    border: none !important;
    box-shadow: none !important;
    font-size: var(--font-size-sm) !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-select:hover {
    background: var(--fm-drawer-field-fill-hover) !important;
}

#nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-toolbar
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: var(--fm-drawer-field-fill-hover) !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-select .currency-value {
    max-width: none !important;
}

#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-dropdown {
    left: 0;
    right: auto;
    width: 100%;
    min-width: max(100%, 11rem);
    max-width: min(360px, 92vw);
}

/*
 * Вкладка Taxes на Finance island (основной workspace): та же шапка, что в дровере —
 * без блока с заголовком/лидом; Country + Tax year — сетка как у профиля.
 */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-head-text {
    display: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-head {
    align-items: stretch !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar {
    width: 100% !important;
    max-width: 100%;
    justify-self: stretch !important;
    align-self: stretch !important;
    flex-shrink: 1;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-selects {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
    width: 100%;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

@media (min-width: 640px) {
    #nucleus-dashboard-container
        .nucleus-finance-island
        #nucleus-taxes-workspace
        .nucleus-taxes-island--intro
        .nucleus-taxes-selects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .nucleus-taxes-field {
    min-width: 0 !important;
    flex: none !important;
    padding: 0 !important;
    border-left: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 44px;
    box-sizing: border-box;
    border-radius: var(--nucleus-taxes-r-sm);
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-select:hover {
    background: color-mix(in srgb, var(--rv-segment-track) 78%, #000 22%) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: color-mix(in srgb, var(--rv-segment-track) 78%, #000 22%) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-select
    .currency-value {
    max-width: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-dropdown {
    left: 0;
    right: auto;
    width: 100%;
    min-width: max(100%, 11rem);
    max-width: min(360px, 92vw);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-select {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-select:hover,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-toolbar
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: color-mix(in srgb, var(--rv-segment-track) 86%, #000 14%) !important;
}

/*
 * Налоги + дровер: триггер селекта всегда с полным скруглением (не «склеивается» с панелью).
 * Перебивает selects.css (.invoice-currency-wrapper.select-open .invoice-currency-select { radius только сверху }).
 */
#nucleus-dashboard-container
    #nucleus-taxes-workspace
    .invoice-currency-wrapper.select-open
    .invoice-currency-select,
#nucleus-dashboard-container
    #nucleus-taxes-workspace
    .invoice-currency-wrapper.dropdown-open-up.select-open
    .invoice-currency-select,
#nucleus-sidebar-taxes-drawer-panel
    .invoice-currency-wrapper.select-open
    .invoice-currency-select,
#nucleus-sidebar-taxes-drawer-panel
    .invoice-currency-wrapper.dropdown-open-up.select-open
    .invoice-currency-select {
    border-radius: var(--nucleus-taxes-r-sm) !important;
}

/* Режимы дровера: тот же визуал, что Share % / Amounts (.nucleus-budget-insights-visual-head .nucleus-budget-insights-pills) */
.nucleus-sidebar-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    width: fit-content;
    max-width: calc(100% - 2 * var(--drawer-pad-inline));
    box-sizing: border-box;
    margin: 0 var(--drawer-pad-inline) var(--drawer-gap-section);
    padding: 3px;
    position: relative;
    z-index: 1;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-bg-input) 84%, #000 16%);
    border: none;
    box-shadow: none;
}

body.light-theme .nucleus-financial-mirror-sidebar .nucleus-sidebar-tabs {
    background: color-mix(in srgb, var(--color-bg-input) 90%, #000 10%);
}

.nucleus-sidebar-content #financial-mirror-container {
    width: 100%;
}

.nucleus-sidebar-tab {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    border: none;
    border-radius: 999px;
    padding: 5px 11px;
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-tertiary);
    transition: background 0.15s ease, color 0.15s ease;
    text-align: center;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 0;
}

.nucleus-sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-financial-mirror-sidebar .nucleus-sidebar-tab:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-primary);
}

.nucleus-sidebar-tab.is-active {
    background: var(--color-button-secondary-hover);
    color: var(--color-text-primary);
}

.nucleus-financial-mirror-sidebar.fm-mode-expenses-only .fm-section.fm-budget-name,
.nucleus-financial-mirror-sidebar.fm-mode-expenses-only .fm-section.fm-period,
.nucleus-financial-mirror-sidebar.fm-mode-expenses-only .fm-section.fm-income,
.nucleus-financial-mirror-sidebar.fm-mode-expenses-only .fm-section.fm-add-button-section {
    display: none !important;
}

.nucleus-financial-mirror-sidebar.fm-mode-income-only .fm-section.fm-budget-name,
.nucleus-financial-mirror-sidebar.fm-mode-income-only .fm-section.fm-expenses,
.nucleus-financial-mirror-sidebar.fm-mode-income-only .fm-section.fm-add-button-section {
    display: none !important;
}

.nucleus-financial-mirror-sidebar.fm-mode-add-only .fm-income-item .fm-btn-remove,
.nucleus-financial-mirror-sidebar.fm-mode-add-only .fm-btn-remove-expense-category {
    display: none !important;
}

/* Компактная иерархия секций внутри дровера (без "раздувания" из общих стилей страницы) */
.nucleus-financial-mirror-sidebar #financial-mirror-container .financial-mirror-combined .fm-section {
    margin-bottom: var(--drawer-gap-section) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: var(--drawer-pad-inline) !important;
    padding-right: var(--drawer-pad-inline) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section {
    margin-bottom: var(--drawer-gap-section) !important;
    border-top: none !important;
    padding-left: var(--drawer-pad-inline) !important;
    padding-right: var(--drawer-pad-inline) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section:last-child {
    margin-bottom: 0 !important;
}

/* Compact-ритм верхних секций дровера (SaaS density) */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-budget-name {
    margin-bottom: 10px !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period {
    margin-bottom: 12px !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-income {
    margin-bottom: 14px !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-expenses {
    margin-bottom: 0 !important;
}

.nucleus-sidebar-footer {
    /* Было 12 / 16 / 24 — верх меньше низа; одинаковый inset, в ритме --drawer-pad-inline как у контента */
    padding: var(--drawer-pad-inline);
    border-top: none;
    background: transparent;
}

.nucleus-sidebar-footer-inner {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
    box-sizing: border-box;
}

/* Налоги: две кнопки поровну по ширине (PDF + CSV), Budget — одна на всю ширину */
.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace .nucleus-sidebar-footer-inner {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--spacing-md, 12px);
}

.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace .nucleus-sidebar-footer-inner .nucleus-sidebar-primary-btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

/* Вторая кнопка — контур, как вторичная в форме налогов */
.nucleus-sidebar-footer-btn--secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-secondary);
}

.nucleus-sidebar-footer-btn--secondary:hover {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    border-color: var(--color-border-tertiary);
}

body.light-theme .nucleus-sidebar-footer-btn--secondary {
    border-color: rgba(0, 0, 0, 0.14);
}

.nucleus-sidebar-primary-btn {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: #ffffff;
    color: #0f1115;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold, 600);
    cursor: pointer;
    transition: all var(--transition-base);
}

.nucleus-sidebar-primary-btn:hover {
    background: #f4f5f7;
    border-color: #ffffff;
}

.nucleus-sidebar-primary-btn:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: -2px;
}

.nucleus-sidebar-primary-btn:disabled,
.nucleus-sidebar-footer-btn--secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/*
 * Налоговый дровер: те же кнопки, что на вкладке Taxes (.nucleus-taxes-pdf-btn / --primary / --secondary).
 * Глобальные .nucleus-sidebar-primary-btn выше — поэтому блок здесь, после них.
 */
.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-primary-action.nucleus-sidebar-primary-btn {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    padding: 0.55rem 1.25rem;
    min-height: 44px;
    height: auto;
    border-radius: 999px;
    background: var(--color-button-primary);
    border: none;
    color: var(--color-button-primary-text);
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.12s ease;
}

.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-primary-action.nucleus-sidebar-primary-btn:hover:not(:disabled) {
    background: var(--color-button-primary-hover);
    color: var(--color-button-primary-text);
    border-color: transparent;
}

.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-primary-action.nucleus-sidebar-primary-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-primary-action.nucleus-sidebar-primary-btn:focus-visible {
    outline: 2px solid var(--color-button-primary-focus);
    outline-offset: 2px;
}

.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-csv-action.nucleus-sidebar-primary-btn.nucleus-sidebar-footer-btn--secondary {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    padding: 0.55rem 1.25rem;
    min-height: 44px;
    height: auto;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-secondary);
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.12s ease;
}

.nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-csv-action.nucleus-sidebar-primary-btn.nucleus-sidebar-footer-btn--secondary:hover:not(:disabled) {
    background: var(--color-bg-input);
    border-color: var(--color-border-tertiary);
    color: var(--color-text-primary);
}

/* Внешний footer заменяет внутреннюю кнопку FM */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-add-button-section {
    display: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .financial-mirror-combined .fm-section:first-of-type {
    padding-top: 0 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .financial-mirror-combined .fm-income-expenses-row {
    margin-top: 0 !important;
    margin-bottom: var(--drawer-gap-section) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-income,
.nucleus-financial-mirror-sidebar #financial-mirror-container .financial-mirror-combined .fm-section.fm-income {
    margin-top: 0 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section h2,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-income h1 {
    margin-bottom: var(--drawer-gap-title) !important;
    font-size: clamp(1.1rem, 1rem + 0.45vw, 1.35rem) !important; /* H2 */
    line-height: 1.25 !important;
    font-weight: 700 !important;
    letter-spacing: -0.015em;
    color: var(--color-text-primary) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-section-label {
    margin-bottom: 10px !important;
    font-size: 1rem !important; /* H3 */
    line-height: 1.35 !important;
    font-weight: 600 !important;
    color: var(--color-text-secondary) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row-horizontal {
    margin-bottom: var(--drawer-gap-row) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row:last-child,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row-horizontal:last-child {
    margin-bottom: 0 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-section {
    margin-bottom: var(--drawer-gap-subsection) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-section:last-child {
    margin-bottom: 0 !important;
}

/* Income form: плотные внутренние блоки */
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-section {
    margin-bottom: 8px !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-section:last-child {
    margin-bottom: 0 !important;
}

/* Expenses form: минимальные расстояния между категориями */
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form .fm-form-row.fm-expense-category-row {
    margin-bottom: 4px !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row label {
    font-size: 0.875rem !important; /* Label */
    line-height: 1.35 !important;
    font-weight: 500 !important;
    color: color-mix(in srgb, var(--color-text-secondary) 88%, var(--color-text-primary) 12%) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-input-hint {
    font-size: 0.75rem !important; /* Helper/caption */
    line-height: 1.35 !important;
    color: var(--color-text-tertiary) !important;
}

/* Единая высота controls в дровере */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="text"],
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="number"],
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="date"],
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row select,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-category-name-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-name-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-amount-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-amount-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form .fm-monthly-expense-actual-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-select,
.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-date-wrapper {
    height: 44px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
}

/* FM дровер: инпуты и кастомные селекты — как .nucleus-taxes-profile* в finance island (заливка segment-track, без рамки) */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="text"],
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="number"],
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="date"],
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row select,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-category-name-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-name-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-amount-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-amount-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form .fm-monthly-expense-actual-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-select {
    background: var(--fm-drawer-field-fill) !important;
    border: none !important;
    border-radius: var(--nucleus-taxes-r-sm) !important;
    padding: 0 var(--spacing-md) 0 calc(var(--spacing-md) + 4px) !important;
    font-size: var(--font-size-sm) !important;
    color: var(--color-text-primary) !important;
    font-family: var(--font-primary) !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    box-shadow: none !important;
    line-height: 1.25 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="text"]:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="number"]:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="date"]:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row select:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-category-name-input:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-name-input:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-amount-input:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-amount-input:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form .fm-monthly-expense-actual-input:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-select:hover {
    border: none !important;
    background: var(--fm-drawer-field-fill-hover) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-wrapper.select-open .invoice-currency-select {
    background: var(--fm-drawer-field-fill-hover) !important;
    border: none !important;
    box-shadow: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="text"]:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="number"]:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="date"]:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row select:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-category-name-input:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-name-input:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-amount-input:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-amount-input:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form .fm-monthly-expense-actual-input:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-select:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="text"]:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="number"]:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="date"]:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row select:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-category-name-input:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-name-input:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-amount-input:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-amount-input:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form .fm-monthly-expense-actual-input:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-select:focus-visible {
    outline: 2px solid var(--color-button-primary-focus) !important;
    outline-offset: -2px !important;
    border: none !important;
    background: var(--fm-drawer-field-fill) !important;
    box-shadow: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="text"]::placeholder,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form-row input[type="number"]::placeholder,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-category-name-input::placeholder,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-name-input::placeholder,
.nucleus-financial-mirror-sidebar #financial-mirror-container .expense-amount-input::placeholder,
.nucleus-financial-mirror-sidebar #financial-mirror-container .custom-expense-amount-input::placeholder,
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form .fm-monthly-expense-actual-input::placeholder {
    color: var(--color-text-tertiary) !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-budget-name .fm-form-section {
    padding-top: 12px !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-section:first-child {
    padding-bottom: 0 !important;
}

/* Отступ сверху для секции Период - равен боковому паддингу модалки */
#financial-mirror-container .fm-section.fm-period {
    padding-top: 0 !important;
}

/* Overlay для sidebar */
.nucleus-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.nucleus-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 1024px) {
    .nucleus-stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .nucleus-financial-mirror-sidebar {
        width: 100%;
        right: -100%;
    }

    /* Адаптив: авто-колонки без наезда сетки дней */
    .nucleus-calendar-months {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }

    .nucleus-calendar-divider {
        display: none;
    }
}

/* Календарь: на планшетах — дата строкой сверху, контролы на всю ширину снизу */
@media (max-width: 1024px) {
    .nucleus-calendar-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }

    .nucleus-calendar-header-leading {
        width: 100%;
        max-width: 100%;
    }

    .nucleus-calendar-header-center {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .nucleus-calendar-header-center .nucleus-calendar-controls {
        width: 100%;
    }

    .nucleus-calendar-selects {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nucleus-month-board-card-stats {
        grid-template-columns: 1fr;
    }

    .nucleus-calendar-section > .nucleus-calendar-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: var(--spacing-md) !important;
        min-height: 0 !important;
    }

    .nucleus-calendar-section > .nucleus-calendar-header > .nucleus-calendar-header-leading {
        width: 100% !important;
        max-width: 100% !important;
    }

    .nucleus-calendar-section > .nucleus-calendar-header > .nucleus-calendar-header-center {
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
    }

    .nucleus-calendar-section > .nucleus-calendar-header .nucleus-calendar-header-title-row {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
        white-space: normal;
        width: 100%;
    }

    .nucleus-calendar-section > .nucleus-calendar-header .nucleus-calendar-header-date {
        white-space: normal;
        word-break: break-word;
    }

    .nucleus-calendar-section > .nucleus-calendar-header .nucleus-calendar-selects {
        justify-content: flex-start;
        gap: var(--spacing-sm);
    }
}

/* Дровер FM: на узкой ширине инпорты категорий и валют не должны вылезать */
@media (max-width: 1024px) {
    .nucleus-financial-mirror-sidebar.open {
        right: 0;
        margin-top: 0;
        margin-bottom: 0;
        width: 100%;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        --drawer-pad-inline: 12px;
    }
}

.nucleus-financial-mirror-sidebar #financial-mirror-container {
    min-width: 0;
    max-width: 100%;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-form,
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form,
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form {
    min-width: 0;
    max-width: 100%;
}

/*
 * Расходы в дровере: колонка — (название + удаление), затем (сумма + валюта); кнопка «+» ниже в форме.
 */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-category-row.fm-expense-category-stack,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-custom-expense-row.fm-expense-category-stack {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: visible !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-fields-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px 10px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-name-row .expense-category-name-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-name-row .custom-expense-name-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-amount-row .expense-amount-input,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-amount-row .custom-expense-amount-input {
    flex: 1 1 120px !important;
    min-width: 96px !important;
    min-height: 44px !important;
    width: auto !important;
    max-width: none !important;
    margin-right: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    /* z-index: 0 давал свой контекст наложения и мешал выпадашке валюты быть поверх триггера */
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-amount-row .invoice-currency-wrapper {
    flex: 1 1 160px !important;
    min-width: 140px !important;
    max-width: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 40px;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 1;
}

/* Выпадашка не обрезается flex-строкой и соседним полем */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-amount-row {
    overflow: visible !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-category-row .fm-btn-remove-expense-category,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-custom-expense-row .fm-btn-remove-custom-expense {
    flex: 0 0 auto;
    margin-left: 0 !important;
}

/* Список доходов: корзина как у расходов (белая/серая иконка, круг, ховер — красный туман) */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-income-item .fm-btn-remove {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    transition: all 0.2s ease;
    transform: none;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-income-item .fm-btn-remove:hover {
    background: rgba(251, 146, 60, 0.2);
    color: #ff6666;
    transform: scale(1.05);
}

body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-income-item .fm-btn-remove {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.7);
}

body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-income-item .fm-btn-remove:hover {
    background: rgba(234, 88, 12, 0.15);
    color: #ea580c;
    transform: scale(1.05);
}

/* Сумма + валюта оплаты: колонка вместо жёсткой ширины селекта */
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row-horizontal {
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 8px;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row-horizontal > * {
    margin-right: 0 !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row-horizontal .invoice-currency-wrapper {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row-horizontal .invoice-currency-select,
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row-horizontal .invoice-currency-dropdown {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    height: 44px !important;
    min-height: 44px !important;
}

/*
 * Дата снимка: calendar.css задаёт input padding/font без высоты 44px — выравниваем с остальными инпутами дровера.
 */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 40px 0 calc(var(--spacing-md) + 4px) !important;
    font-size: var(--font-size-sm) !important;
    line-height: 1.25 !important;
    color: var(--color-text-primary) !important;
    background: var(--fm-drawer-field-fill) !important;
    border: none !important;
    border-radius: var(--nucleus-taxes-r-sm) !important;
    font-family: var(--font-primary) !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date:hover,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper:hover input#snapshot-date,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper:hover input.fm-input-date {
    background: var(--fm-drawer-field-fill-hover) !important;
    border: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date:focus,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date:focus-visible,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date:focus-visible {
    outline: 2px solid var(--color-button-primary-focus) !important;
    outline-offset: -2px !important;
    background: var(--fm-drawer-field-fill) !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date,
body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date {
    background: var(--fm-drawer-field-fill) !important;
    border: none !important;
    color: var(--color-text-primary) !important;
}

body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date:hover,
body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date:hover,
body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper:hover input#snapshot-date,
body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper:hover input.fm-input-date {
    background: var(--fm-drawer-field-fill-hover) !important;
}

body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date:focus,
body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date:focus,
body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input#snapshot-date:focus-visible,
body.light-theme .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-period .invoice-date-wrapper input.fm-input-date:focus-visible {
    background: var(--fm-drawer-field-fill) !important;
    border: none !important;
}

/* Остальные строки дохода: подпись сверху, поле на всю ширину */
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row:not(.fm-form-row-horizontal):not(.fm-currencies-row),
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-budget-name .fm-form-row {
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 6px;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row:not(.fm-form-row-horizontal):not(.fm-currencies-row) > label,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-budget-name .fm-form-row > label {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row:not(.fm-form-row-horizontal):not(.fm-currencies-row) > input,
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form .fm-form-row:not(.fm-form-row-horizontal):not(.fm-currencies-row) > select,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-budget-name .fm-form-row > input {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Ряд валют отображения дохода — перенос при нехватке места */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-currencies-row {
    flex-wrap: wrap !important;
    gap: 8px;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-currencies-row .invoice-currency-wrapper {
    flex: 1 1 160px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
}

/* Кастомные выпадашки: ограничение по высоте + скролл (перебивает глобальные 418px из selects.css) */
.nucleus-financial-mirror-sidebar .invoice-currency-wrapper.select-open .invoice-currency-dropdown {
    max-height: min(52vh, 340px) !important;
}

.nucleus-financial-mirror-sidebar .invoice-currency-wrapper.select-open .invoice-currency-dropdown-inner {
    max-height: min(48vh, 300px) !important;
}

.nucleus-financial-mirror-sidebar .fm-display-currency-picker-wrap {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/*
 * Выпадашка .invoice-currency-dropdown переносится в document.body (invoice-dd.ts) с position:fixed.
 * Раньше здесь снимали overflow у сайдбара — это меняло скроллбар и давало layout shift при открытии/закрытии.
 * Z-index для секций ниже — по-прежнему нужен для наложения блоков FM друг на друга.
 */

/*
 * Секция Income (форма + список доходов) и Expenses — соседи в DOM. Выпадашка в списке доходов / категориях
 * иначе оказывается под блоком ниже. Поднимаем всю секцию, пока открыт селект.
 */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-income:has(.invoice-currency-wrapper.select-open),
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-section.fm-expenses:has(.invoice-currency-wrapper.select-open) {
    position: relative;
    z-index: 100120 !important;
}

/* Не обрезаем выпадашку списка валют (родительский overflow) */
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-display-currencies-block,
.nucleus-financial-mirror-sidebar #financial-mirror-container .fm-currencies-list {
    overflow: visible !important;
    max-height: none !important;
}

/*
 * Кастомные селекты (invoice-currency): следующий блок в DOM (#income-list-container, вердикт и т.д.)
 * рисуется поверх position:absolute выпадашки. Поднимаем контейнер формы, пока открыт любой такой селект.
 */
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-form-container:has(.invoice-currency-wrapper.select-open),
.nucleus-financial-mirror-sidebar #financial-mirror-container #expenses-form-container:has(.invoice-currency-wrapper.select-open),
.nucleus-financial-mirror-sidebar #financial-mirror-container #income-list-container:has(.invoice-currency-wrapper.select-open) {
    position: relative;
    z-index: 100100 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-wrapper.select-open {
    z-index: 100105 !important;
}

.nucleus-financial-mirror-sidebar #financial-mirror-container .invoice-currency-wrapper.select-open .invoice-currency-dropdown {
    z-index: 100106 !important;
}

/* JS выставляет position:fixed + data-fm-dropdown-floating — тень для читаемости поверх скролла */
.nucleus-financial-mirror-sidebar .invoice-currency-dropdown[data-fm-dropdown-floating="1"],
#financial-mirror-container .invoice-currency-dropdown[data-fm-dropdown-floating="1"] {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

@media (max-width: 1024px) {
    .nucleus-financial-mirror-sidebar .nucleus-sidebar-content {
        padding-bottom: max(80px, 18vh);
    }

}

/* Узкий дровер: сумма и валюта переносятся */
@media (max-width: 400px) {
    .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-amount-row {
        flex-wrap: wrap !important;
    }

    .nucleus-financial-mirror-sidebar #financial-mirror-container .fm-expense-amount-row .invoice-currency-wrapper {
        flex: 1 1 100% !important;
        max-width: none;
    }
}

/* ============================================
   Nucleus layout normalization (single surface)
   Цвета блоков — из variables.css (--color-bg-*, --color-text-*, --color-button-*).
   ============================================ */

/* Холст main: тёмная тема — secondary; светлая — primary (как у остального сайта) */
body.nucleus-page:not(.light-theme) .main-content {
    background-color: var(--color-bg-primary);
}

body.nucleus-page.light-theme .main-content {
    background-color: var(--color-bg-primary);
}

#nucleus-dashboard-container {
    --nucleus-line-dark: rgba(255, 255, 255, 0.07);
    --nucleus-line-light: rgba(0, 0, 0, 0.06);
    --nucleus-line-soft-dark: rgba(255, 255, 255, 0.055);
    --nucleus-line-soft-light: rgba(0, 0, 0, 0.05);
    --nucleus-x-pad: 24px;
    /* Острова: тёмная тема — tertiary на primary на secondary; сегменты — input */
    --rv-radius: 20px;
    --rv-radius-sm: 12px;
    --rv-surface: var(--color-bg-tertiary);
    --rv-surface-rail: color-mix(in srgb, var(--color-bg-tertiary) 72%, var(--color-bg-primary));
    --rv-segment-track: var(--color-bg-input);
    --rv-active-chip: var(--color-button-secondary-hover);
    --rv-text-muted: var(--color-text-tertiary);
}

body.light-theme #nucleus-dashboard-container {
    --rv-surface: var(--color-bg-card);
    --rv-surface-rail: var(--color-bg-card);
    --rv-segment-track: var(--color-bg-tertiary);
    --rv-active-chip: var(--color-bg-secondary);
}

#nucleus-dashboard-container .nucleus-page-header-toolbar {
    /* В один ряд с горизонтальным gutter островков (16px) */
    padding-left: var(--nucleus-island-h-gutter) !important;
    padding-right: var(--nucleus-island-h-gutter) !important;
    padding-bottom: 20px !important;
}

#nucleus-dashboard-container .nucleus-budgeting-main-tabs {
    /* Сегмент-рейл: дорожка темнее карточек, как в Revolut */
    margin: 0 var(--nucleus-island-h-gutter) 4px !important;
    margin-top: 0 !important;
    padding: 6px !important;
    width: calc(100% - 2 * var(--nucleus-island-h-gutter)) !important;
    max-width: none !important;
    box-sizing: border-box !important;
    gap: 4px !important;
    border-radius: var(--rv-radius) !important;
    background: var(--rv-segment-track) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container .nucleus-main-tab-panel,
#nucleus-dashboard-container #nucleus-tab-panel-dashboard,
#nucleus-dashboard-container #nucleus-tab-panel-budget,
#nucleus-dashboard-container #nucleus-tab-panel-operations,
#nucleus-dashboard-container #nucleus-taxes-section {
    margin-top: 0 !important;
}

/* Taxes: как .nucleus-main-tab-panel внутри острова — без доп. горизонтального inset (иначе карточка уже Dashboard/Budget) */
#nucleus-dashboard-container #nucleus-finance-island #nucleus-taxes-section.nucleus-taxes-section {
    /* Внутренние скругления в ритме внешних карточек (cqw от .nucleus-finance-island — nucleus-fin-island) */
    --nucleus-taxes-r: clamp(22px, 2.75cqw, 32px);
    --nucleus-taxes-r-sm: clamp(14px, 1.75cqw, 20px);
    padding-top: 0 !important;
    padding-bottom: var(--spacing-xl) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}

#nucleus-dashboard-container #nucleus-finance-island #nucleus-taxes-section .nucleus-taxes-workspace {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    width: 100%;
}

#nucleus-dashboard-container .nucleus-dashboard-extra,
#nucleus-dashboard-container .nucleus-budget-insights,
#nucleus-dashboard-container .nucleus-calendar-section,
#nucleus-dashboard-container .nucleus-taxes-section {
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

/* Month board внутри дашборда — без отдельной карточки; вертикальный ритм вкладок Budget/Operations */
#nucleus-dashboard-container .nucleus-month-board {
    margin: 0 !important;
    border-radius: 0 !important;
    border-top: none;
    background: transparent !important;
    padding: var(--spacing-2xl) 0 var(--spacing-xl);
}

#nucleus-dashboard-container .nucleus-dashboard-extra {
    border-top: none !important;
}

/* Extra: колонка секций + квартет 2×2; везде 16px между блоками */
#nucleus-dashboard-container .nucleus-dashboard-extra-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--spacing-lg) !important;
    width: 100%;
    box-sizing: border-box;
}

#nucleus-dashboard-container .nucleus-dashboard-extra-quad {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: var(--spacing-lg) !important;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#nucleus-dashboard-container .nucleus-dashboard-extra-quad > .nucleus-dashboard-extra-slot {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

#nucleus-dashboard-container .nucleus-dashboard-extra-quad > .nucleus-dashboard-extra-slot > .nucleus-dashboard-extra-card {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

@media (max-width: 900px) {
    #nucleus-dashboard-container .nucleus-dashboard-extra-quad {
        grid-template-columns: 1fr !important;
    }
}

#nucleus-dashboard-container .nucleus-dashboard-extra-slot .nucleus-dashboard-extra-card {
    padding-left: var(--nucleus-x-pad) !important;
    padding-right: var(--nucleus-x-pad) !important;
}

#nucleus-dashboard-container .nucleus-main-tab-panel--dashboard .nucleus-budget-insights {
    border-top: none !important;
    /* Визуал на всю ширину панели; отступы только у шапки/пилюль (у них свои padding) */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Без горизонталей между шапкой/пустым состоянием и рейлом — границы только у плиток */
#nucleus-dashboard-container .nucleus-budget-insights-head,
#nucleus-dashboard-container .nucleus-budget-insights-no-categories {
    border: none !important;
}

#nucleus-dashboard-container .nucleus-budget-insights-visual::before,
#nucleus-dashboard-container .nucleus-budget-insights-visual-main::before {
    display: none !important;
}

/* Сетка extra: без линий-разделителей (гайды из JS + ::before на узкой ширине) */
#nucleus-dashboard-container .nucleus-dashboard-extra-grid-guides {
    display: none !important;
}

#nucleus-dashboard-container .nucleus-dashboard-extra-grid-guide {
    display: none !important;
}

@media (max-width: 900px) {
    #nucleus-dashboard-container
        .nucleus-dashboard-extra-quad
        > .nucleus-dashboard-extra-slot:not(#nucleus-dashboard-trend)::before {
        display: none !important;
    }
}

@media (max-width: 767px) {
    #nucleus-dashboard-container .nucleus-budget-insights-visual {
        gap: var(--spacing-2xl);
        /* Высота по контенту — без «пустого» min-height от vh */
        min-height: 0;
    }
}

@media (min-width: 768px) {
    #nucleus-dashboard-container .nucleus-budget-insights-visual {
        align-items: stretch;
        min-height: 0;
    }

    #nucleus-dashboard-container .nucleus-budget-insights-visual-main {
        --bi-left-col: 280px;
        --bi-gap: var(--spacing-lg);
        align-items: start;
        min-height: 0;
    }

    #nucleus-dashboard-container .nucleus-budget-insights-chart {
        align-self: start;
    }

    #nucleus-dashboard-container .nucleus-budget-insights-rows {
        align-self: start;
        flex: none;
    }

    #nucleus-dashboard-container .nucleus-budget-insights-visual-main .nucleus-budget-insights-donut-wrap {
        width: min(252px, 100%);
        max-width: 252px;
        padding: 16px;
    }
}

/* Ширину задаёт базовый .nucleus-budget-insights-visual (calc + margin) */
#nucleus-dashboard-container .nucleus-budget-insights-visual {
    max-width: none;
    box-sizing: border-box;
}

/* Regression fix: container should not clip content; высота только по контенту */
#nucleus-dashboard-container {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* Dashboard: колонка; порядок секций — порядок узлов в nucleus.html (категории → Cashflow → extra) */
#nucleus-tab-panel-dashboard {
    display: flex;
    flex-direction: column;
}

/* Без gap между секциями на Budget/Operations; Dashboard — только внутри #nucleus-finance-island (см. --nucleus-fin-dashboard-gap) */
#nucleus-dashboard-container #nucleus-tab-panel-budget,
#nucleus-dashboard-container #nucleus-tab-panel-operations {
    gap: 0;
    row-gap: 0;
    column-gap: 0;
}

/* Категории на вебе: слева донат, справа шкалы (как в базовых правилах .nucleus-budget-insights-visual @768px).
   На узком экране остаётся колонка из базового CSS — контейнерные !important убраны. */

/* =============================================================================
   Nucleus — острова в #nucleus-dashboard-container (layout как Revolut, цвета — variables.css).
   Токены --rv-* маппятся на --color-* в блоке normalization выше.
   ============================================================================= */

/* Add — фирменная кнопка сайта */
#nucleus-dashboard-container .nucleus-page-add-btn {
    background: var(--color-button-primary) !important;
    color: var(--color-button-primary-text) !important;
    border: none !important;
    border-radius: 999px !important;
    box-shadow: none;
}

#nucleus-dashboard-container .nucleus-page-add-btn:hover {
    background: var(--color-button-primary-hover) !important;
    color: var(--color-button-primary-text) !important;
    transform: translateY(-1px);
    box-shadow: none;
}

#nucleus-dashboard-container .nucleus-page-header-toolbar__title,
#nucleus-dashboard-container .content-main-title {
    color: var(--color-text-primary) !important;
}

#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-label {
    color: var(--rv-text-muted) !important;
}

#nucleus-dashboard-container .nucleus-dashboard-extra-title {
    color: var(--rv-text-muted) !important;
}

#nucleus-dashboard-container .nucleus-budget-insights-title {
    color: var(--rv-text-muted) !important;
}

#nucleus-dashboard-container .nucleus-budget-insights-intro {
    color: var(--rv-text-muted) !important;
}

/* Сводка: три плитки без лишнего внешнего паддинга сетки — не «выпирает» относительно острова */
#nucleus-dashboard-container .nucleus-stats-grid {
    gap: 12px !important;
    padding: 0 !important;
}

#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card {
    border-right: none !important;
    border-radius: var(--rv-radius) !important;
    background: var(--rv-surface) !important;
    border: none !important;
    box-shadow: none !important;
    padding: 24px !important;
}

@media (max-width: 1024px) {
    #nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-card:not(:first-child) {
        border-top: none !important;
    }
}

#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-value,
#nucleus-dashboard-container .nucleus-stats-grid .nucleus-stat-currency {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

#nucleus-dashboard-container .nucleus-budgeting-main-tab {
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 13px;
    color: var(--rv-text-muted);
    background: transparent;
}

#nucleus-dashboard-container .nucleus-budgeting-main-tab:hover {
    transform: none;
    color: var(--color-text-primary);
}

#nucleus-dashboard-container .nucleus-budgeting-main-tab.is-active {
    background: var(--rv-active-chip);
    color: var(--color-text-primary);
    box-shadow: none;
}

/* Шапка + переключатель Share % / Amounts */
#nucleus-dashboard-container .nucleus-budget-insights-head {
    padding: 20px 22px 18px;
}

/* Share % / Amounts: pills внутри segment-track */
#nucleus-dashboard-container .nucleus-budget-insights-visual-head .nucleus-budget-insights-pills {
    margin: 0 !important;
    padding: 3px !important;
    width: auto !important;
    max-width: max-content !important;
    align-self: flex-start !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
    background: var(--rv-segment-track) !important;
    border: none !important;
    box-shadow: none !important;
    gap: 3px !important;
}

/* Operations: All / Income / Expenses — сверху слева, без общей «дорожки» */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-toolbar-tabs {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
    align-self: flex-start !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-toolbar-tabs .nucleus-transactions-filters {
    gap: 3px !important;
}

#nucleus-dashboard-container .nucleus-budget-insights-visual-head .nucleus-budget-insights-pill,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-transactions-toolbar-tabs
    .nucleus-transactions-filter-btn {
    flex: 0 0 auto !important;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    justify-content: center;
    text-align: center;
    border-radius: 999px;
    padding: 5px 11px !important;
    font-weight: 600;
    font-size: 11px !important;
    border: none !important;
    background: transparent !important;
    color: var(--rv-text-muted) !important;
    box-shadow: none !important;
    transform: none !important;
}

#nucleus-dashboard-container .nucleus-budget-insights-visual-head .nucleus-budget-insights-pill:hover,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-transactions-toolbar-tabs
    .nucleus-transactions-filter-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--color-text-primary);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pill:hover,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-transactions-toolbar-tabs
    .nucleus-transactions-filter-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

#nucleus-dashboard-container .nucleus-budget-insights-visual-head .nucleus-budget-insights-pill.is-active,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-transactions-toolbar-tabs
    .nucleus-transactions-filter-btn.is-active {
    background: var(--rv-active-chip) !important;
    color: var(--color-text-primary) !important;
}

#nucleus-dashboard-container .nucleus-budget-insights-note {
    margin: 0 var(--nucleus-island-h-gutter) 18px;
    width: calc(100% - 2 * var(--nucleus-island-h-gutter));
    max-width: none;
    box-sizing: border-box;
    padding: 16px 20px !important;
    border-radius: var(--rv-radius) !important;
    background: var(--rv-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Карточки дашборда (тренд, MoM, стабильность, highlights, goals) */
#nucleus-dashboard-container .nucleus-dashboard-extra-slot .nucleus-dashboard-extra-card {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    padding: 20px 22px !important;
    background: var(--rv-surface) !important;
    border: none !important;
    border-radius: var(--rv-radius) !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container .nucleus-dashboard-sparkline {
    display: block;
    border-radius: var(--rv-radius-sm);
    background: var(--rv-segment-track);
    padding: 4px 8px;
    box-sizing: content-box;
}

#nucleus-dashboard-container .nucleus-dashboard-mom-list {
    font-variant-numeric: tabular-nums;
}

#nucleus-dashboard-container .nucleus-dashboard-trend-x {
    font-variant-numeric: tabular-nums;
}

/* AI — та же плитка, что у карточек */
#nucleus-dashboard-container .nucleus-dashboard-extra-grid #nucleus-dashboard-ai-panel {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    align-self: stretch;
    box-sizing: border-box;
    padding: 16px 22px !important;
    border: none !important;
    border-radius: var(--rv-radius) !important;
    background: var(--rv-surface) !important;
    box-shadow: none !important;
}

/* Budget + Income: календарь как плитка (общий блок #nucleus-finance-planner) */
#nucleus-dashboard-container #nucleus-finance-planner #nucleus-calendar-section {
    margin: 16px var(--nucleus-island-h-gutter) !important;
    width: calc(100% - 2 * var(--nucleus-island-h-gutter)) !important;
    max-width: none !important;
    padding: 20px 22px 24px !important;
    box-sizing: border-box !important;
    border-radius: var(--rv-radius) !important;
    background: var(--rv-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container .nucleus-main-tab-panel--budget .nucleus-month-board,
#nucleus-dashboard-container .nucleus-main-tab-panel--income .nucleus-month-board,
#nucleus-dashboard-container .nucleus-main-tab-panel--operations .nucleus-month-board {
    margin-top: 0 !important;
    padding: 0 0 28px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-top: none !important;
}



/* Карточки бюджета по дням в острове — токены сайта + --rv-* острова */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-blocks {
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card {
    background: var(--nucleus-fin-island-surface) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    /* Внутренняя карточка (Budget/Income block) — компактный radius;
       клампа острова (clamp(30px,4.25cqw,44px)) хватало бы только внешнему острову,
       внутри он выглядел «надувным», поэтому фиксируем 16px. */
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    padding: var(--spacing-4xl) var(--nucleus-fin-card-pad-x);
    box-sizing: border-box;
}

/* Бюджеты под календарём: доска — сосед календаря в #nucleus-finance-planner */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-budget-month-root.nucleus-month-board {
    margin-top: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-budget-month-root .nucleus-month-board-data {
    gap: 0;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-budget-month-root
    .nucleus-month-board-card--budget-blocks {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-budget-month-root
    .nucleus-month-board-budget-blocks {
    margin-top: 0;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-budget-month-root
    .nucleus-month-board-budget-block-card {
    /* Внутренняя карточка дня бюджета — те же компактные углы, что Income line card. */
    border-radius: var(--radius-lg) !important;
    background: var(--nucleus-fin-island-surface) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card__head {
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-toggle {
    border-radius: var(--rv-radius-sm);
    background: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
    color: var(--color-text-tertiary);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-toggle:hover {
    background: var(--color-button-secondary-hover, var(--rv-active-chip));
    color: var(--color-text-primary);
}

/* Остров: в свёрнутом виде не дублировать разделитель «шапка | пусто» */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-month-board-budget-block-card--collapsed
    .nucleus-month-board-budget-block-card__head {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    box-shadow: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0 0 6px;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__period {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    line-height: 1.4;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--radius-2xl, 28px);
    background: var(--rv-segment-track);
    box-sizing: border-box;
    overflow: hidden;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income-main {
    font-size: var(--font-size-sm);
    gap: 10px;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income-name {
    color: var(--color-text-primary);
    font-weight: 500;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income-amount {
    font-size: var(--font-size-md);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-success);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__expenses-label {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expenses-ul {
    gap: var(--spacing-sm, 8px);
    padding: 4px 0 0;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-row {
    padding: 8px 0;
    font-size: var(--font-size-sm);
    line-height: 1.35;
    border-bottom: none;
    color: var(--color-text-secondary);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-month-board-budget-expense-row:last-child {
    padding-bottom: 0;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-name {
    color: var(--color-text-primary);
    font-weight: 500;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-amount {
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-secondary);
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expenses-empty {
    padding: 8px 0 0;
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* Внутри финансового острова — оставляем единый стиль с .nucleus-tx-card-action: прозрачный фон, hover как у транзакций. */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-edit,
#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-delete {
    background: transparent;
    border: none;
    border-radius: var(--radius-md, 8px);
    color: var(--color-text-tertiary);
    opacity: 0.85;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-edit:hover,
#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-edit:focus-visible {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    color: var(--color-text-secondary);
    opacity: 1;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-delete:hover,
#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-delete:focus-visible {
    background: color-mix(in srgb, var(--color-error, #fb923c) 12%, transparent);
    color: var(--color-error, #fb923c);
    opacity: 1;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-card--budget-blocks {
    padding: 0;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-card--budget-blocks .nucleus-month-board-card-header {
    margin-bottom: var(--spacing-md);
}

/* Блоки бюджета по дням (под календарём) — iPad / мобилка: плотнее отступы, колонка там, где строка не влезает */
@media (max-width: 1024px) {
    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-blocks {
        gap: var(--spacing-md);
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card {
        padding: var(--spacing-2xl) var(--spacing-lg) !important;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card__head {
        gap: 12px;
        padding-bottom: 14px;
        margin-bottom: 14px;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__title {
        font-size: var(--font-size-md);
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__period {
        font-size: 11px;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income {
        padding: 12px 14px;
        margin-bottom: 14px;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-row {
        padding: 10px 0;
    }
}

@media (max-width: 768px) {
    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card {
        padding: var(--spacing-lg) 12px !important;
        border-radius: var(--radius-lg) !important;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card__head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card__actions {
        justify-content: flex-end;
        width: 100%;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income-amount {
        font-size: var(--font-size-sm);
        width: 100%;
        word-break: break-word;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 0;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-amount {
        align-self: flex-end;
        text-align: right;
        max-width: 100%;
        word-break: break-word;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-name {
        max-width: 100%;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-blocks {
        gap: var(--spacing-sm);
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block-card {
        padding: 12px 10px !important;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__title {
        font-size: var(--font-size-sm);
        line-height: 1.35;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__period {
        font-size: 10px;
        line-height: 1.4;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__income {
        padding: 10px 12px;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-block__expenses-label {
        font-size: 10px;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-row {
        font-size: var(--font-size-xs);
        padding: 8px 0;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-budget-expense-amount {
        font-size: var(--font-size-xs);
    }

}

/* Визуал категорий — те же токены, что у остальных плиток (не Cashflow в overview: фон даёт хост) */
#nucleus-dashboard-container .nucleus-budget-insights-visual:not(.nucleus-overview-cashflow-visual) {
    border-radius: var(--rv-radius) !important;
    background: var(--rv-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container .nucleus-budget-insights-donut-wrap {
    box-shadow: none !important;
    background: transparent !important;
}

/* Строка «фактических» между Cashflow и Finance — ширина как у островов */
#nucleus-dashboard-container #nucleus-stats-actual-row:not([hidden]) {
    margin: 0 auto 16px !important;
    padding: 16px var(--nucleus-island-h-gutter) !important;
    width: calc(100% - 2 * var(--nucleus-island-h-gutter)) !important;
    max-width: calc(100% - 2 * var(--nucleus-island-h-gutter)) !important;
    box-sizing: border-box !important;
    border-radius: var(--rv-radius) !important;
    border: none !important;
    background: var(--rv-surface) !important;
    box-shadow: none !important;
}

@media (max-width: 600px) {
    #nucleus-dashboard-container #nucleus-stats-actual-row:not([hidden]) {
        width: calc(100% - 2 * var(--nucleus-island-h-gutter)) !important;
        max-width: calc(100% - 2 * var(--nucleus-island-h-gutter)) !important;
    }
}

/* Остров Finance: без внутреннего padding и без скругления контейнера (контент — в дочерних карточках) */
#nucleus-dashboard-container .nucleus-finance-island {
    /* Container query: донат|список по ширине карточки, а не только по viewport (768px) */
    container-type: inline-size;
    container-name: nucleus-fin-island;
    /* Оболочка как у Cashflow / категорий на Dashboard (все вкладки Finance) */
    --nucleus-fin-card-pad-x: var(--spacing-4xl);
    --nucleus-fin-island-surface: rgba(255, 255, 255, 0.03);
    --nucleus-fin-island-border: rgba(255, 255, 255, 0.07);
    /* iOS-подобные крупные углы: плавный clamp по ширине острова */
    --nucleus-fin-island-radius: clamp(30px, 4.25cqw, 44px);
    --nucleus-fin-island-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 1px 0 rgba(255, 255, 255, 0.02),
        0 14px 42px rgba(0, 0, 0, 0.16);
    margin: 0 auto 28px;
    padding: 0;
    max-width: calc(100% - 2 * var(--nucleus-island-h-gutter));
    width: calc(100% - 2 * var(--nucleus-island-h-gutter));
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

body.light-theme #nucleus-dashboard-container .nucleus-finance-island {
    --nucleus-fin-island-surface: rgba(0, 0, 0, 0.025);
    --nucleus-fin-island-border: rgba(0, 0, 0, 0.08);
    --nucleus-fin-island-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 1px 0 rgba(255, 255, 255, 0.4),
        0 12px 36px rgba(0, 0, 0, 0.06);
}

@media (max-width: 600px) {
    #nucleus-dashboard-container .nucleus-finance-island {
        max-width: calc(100% - 2 * var(--nucleus-island-h-gutter));
        width: calc(100% - 2 * var(--nucleus-island-h-gutter));
        padding: 0;
        margin-bottom: 24px;
    }
}

/* Рейл вкладок внутри острова — без подложки (фон прозрачный) */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-budgeting-main-tabs {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 14px !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Income: only layout hooks, visuals reuse existing taxes components */
#nucleus-dashboard-container .nucleus-income-section {
    padding: 0;
}

#nucleus-dashboard-container .nucleus-income-total {
    margin: 0.45rem 0 0;
    font-family: var(--font-primary);
    font-size: clamp(var(--font-size-lg), 2vw, var(--font-size-2xl));
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

/* Income: тот же ритм, что доска бюджета под календарём (без отдельного «острова» taxes-intro) */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-workspace {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-workspace-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-workspace-head-text {
    flex: 1 1 200px;
    min-width: 0;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-workspace-kicker {
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-tertiary);
    letter-spacing: 0.02em;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-workspace-toolbar {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-workspace-head {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Income: строки дохода — те же карточки, что budget blocks на month board (Finance island) */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-line-cards {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-line-card__meta {
    margin: 0;
    line-height: 1.45;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-line-card__amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-success);
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-line-card__period-suffix {
    color: var(--color-text-tertiary);
    font-weight: 500;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-line-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    max-width: 100%;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-income-root
    .nucleus-income-line-card__actions
    .nucleus-taxes-pdf-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-xs);
    line-height: 1.25;
    border-radius: var(--rv-radius-sm, var(--radius-md));
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-income-root .nucleus-income-line-cards-empty {
    margin: 0;
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    background: var(--nucleus-fin-island-surface);
    border: 1px dashed var(--nucleus-fin-island-border);
    border-radius: var(--nucleus-fin-island-radius);
    box-sizing: border-box;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-income-root
    .nucleus-income-line-cards-empty {
    background: var(--nucleus-fin-island-surface);
}

/* Неактивные табы: подложка alpha 0.02; hover чуть плотнее */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-budgeting-main-tab:not(.is-active) {
    background: rgba(255, 255, 255, 0.02) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-budgeting-main-tab:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.065) !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-budgeting-main-tab:not(.is-active) {
    background: rgba(0, 0, 0, 0.02) !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-budgeting-main-tab:not(.is-active):hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-main-tab-panel {
    padding-top: var(--nucleus-fin-panel-top-gap, 12px) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Budget / Income живут внутри #nucleus-finance-planner, который сам задаёт gap 16px после календаря.
   Дополнительный padding-top тут даёт «двойной» воздух — обнуляем.
   Operations: контент стартует сразу с ledger — лишний padding-top сверху не нужен. */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-finance-planner > #nucleus-tab-panel-budget,
#nucleus-dashboard-container .nucleus-finance-island #nucleus-finance-planner > #nucleus-tab-panel-income,
#nucleus-dashboard-container .nucleus-finance-island > #nucleus-tab-panel-operations {
    padding-top: 0 !important;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-section {
    padding-top: var(--nucleus-fin-panel-top-gap, 12px) !important;
}

/* Операции в острове: без отдельной вложенной карточки — общие стили .nucleus-transactions-* */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-table {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-month-board-transactions-pane {
    padding-top: 0;
    border-top: none;
}

/* Operations: шапка реестра; табы; KPI; секция таблицы (поиск внутри — перед «Sort, group…») */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-month-board-transactions-pane {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    align-items: stretch;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-operations-ledger-kpis {
    width: 100%;
    flex-shrink: 0;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-table-el thead th:nth-child(4),
#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-table-el thead th:nth-child(5),
#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-table-el tbody td:nth-child(4),
#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-table-el tbody td:nth-child(5) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-bulk-bar:not(.is-hidden) {
    margin-top: 2px;
    padding: 8px;
    border-radius: var(--radius-md);
    background: var(--color-bg-input);
    box-sizing: border-box;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-budget-insights {
    margin-top: 0 !important;
}

/* Обёртка категорий: базовый .nucleus-budget-insights { overflow: hidden } обрезал фон/тень .nucleus-budget-insights-visual */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    #nucleus-budget-insights {
    overflow: visible !important;
}

/* В линию с extra-карточками острова: 32px */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-budget-insights-head {
    padding: var(--spacing-4xl) !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-budget-insights-note {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-budget-insights-visual-head .nucleus-budget-insights-pills,
#nucleus-dashboard-container .nucleus-finance-island .nucleus-transactions-toolbar-tabs {
    width: auto !important;
    max-width: max-content !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Dashboard / Finance: трек Income|Expenses|… и Share %|Amounts — чуть темнее сегмента */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
}

body.light-theme
    #nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

/* Planner stats tabs (Income/Budget): тот же track, что у Nucleus Segmented Pills */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-income-planner-stats
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
}

body.light-theme
    #nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-income-planner-stats
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

/* Taxes stats tabs: тот же тёмный трек, что у Share % / Amounts */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-taxes-workspace
    #nucleus-taxes-accumulated-stats
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
}

body.light-theme
    #nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-taxes-workspace
    #nucleus-taxes-accumulated-stats
    .nucleus-budget-insights-visual-head
    .nucleus-budget-insights-pills {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

/* Внутренние отступы 32px — как у .nucleus-dashboard-extra-card в острове (не верхний Cashflow) */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-budget-insights-visual:not(.nucleus-overview-cashflow-visual) {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    --bi-pad-x: var(--nucleus-fin-card-pad-x);
    --bi-pad-y: var(--spacing-4xl);
    padding: var(--bi-pad-y) var(--bi-pad-x) calc(var(--bi-pad-y) + 2px) !important;
}

/* Фиксируем высоту visual-блока на desktop: как у Cashflow (--nucleus-fin-dashboard-paired-card-height), Share%/Amounts без скачка высоты карточки. */
@media (min-width: 768px) {
    #nucleus-dashboard-container
        .nucleus-finance-island
        .nucleus-budget-insights-visual:not(.nucleus-overview-cashflow-visual) {
        height: var(--nucleus-fin-dashboard-paired-card-height, 640px);
        min-height: var(--nucleus-fin-dashboard-paired-card-height, 640px);
    }

    #nucleus-dashboard-container
        .nucleus-finance-island
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main) {
        height: 100%;
        align-items: stretch;
    }

    #nucleus-dashboard-container .nucleus-finance-island .nucleus-budget-insights-rows {
        min-height: 0;
        overflow-y: auto;
        padding-right: 4px;
    }
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-dashboard-extra-slot .nucleus-dashboard-extra-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    padding: var(--spacing-4xl) var(--nucleus-fin-card-pad-x) !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-dashboard-extra-grid {
    width: 100% !important;
    box-sizing: border-box !important;
    gap: var(--nucleus-fin-dashboard-gap) !important;
}

/* Встроенный чат: секция без рамки; embed — только flex+высота, без второй «коробки» вокруг iframe */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    #nucleus-dashboard-extra.nucleus-dashboard-extra--bare-chat {
    width: 100% !important;
    max-width: none !important;
    /* Ритм только через gap родителя #nucleus-tab-panel-dashboard — иначе gap + margin-top давали «двойной» зазор */
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    #nucleus-dashboard-chat-panel {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
}

/* Не min(62vh,780px): это перебивало базовый компактный чат и снова давало огромную пустоту снизу */
#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    #nucleus-dashboard-extra.nucleus-dashboard-extra--bare-chat
    .nucleus-dashboard-chat-embed {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    align-self: stretch !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    /* 0 0 auto — не сжимать блок с iframe в flex-колонке вкладки Dashboard */
    flex: 0 0 auto !important;
    height: clamp(680px, calc(48dvh + 400px), min(960px, calc(65dvh + 400px))) !important;
    min-height: unset !important;
    overflow: hidden !important;
    gap: 0 !important;
}

/* Адаптив: min-height 680px + fixed main ломали чат на телефонах; высота от dvh, без обрезки родителем */
@media (max-width: 800px) {
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-dashboard-extra.nucleus-dashboard-extra--bare-chat {
        overflow: visible !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-dashboard-extra.nucleus-dashboard-extra--bare-chat
        .nucleus-dashboard-chat-embed {
        height: clamp(260px, min(520px, 58dvh), min(640px, 78dvh)) !important;
        min-height: 240px !important;
        flex: 0 0 auto !important;
    }
}

#nucleus-dashboard-container
    #nucleus-finance-island
    #nucleus-tab-panel-dashboard
    #nucleus-dashboard-extra.nucleus-dashboard-extra--bare-chat
    .nucleus-dashboard-chat-iframe {
    flex: 1 1 auto !important;
    /* не оставлять только 0 — при сжатии embed iframe исчезал визуально */
    min-height: 120px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    border-radius: 0 !important;
    background: transparent !important;
}

@media (max-width: 800px) {
    /* После базового min-height:0 — иначе iframe схлопывается на мобилке */
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        #nucleus-dashboard-extra.nucleus-dashboard-extra--bare-chat
        .nucleus-dashboard-chat-iframe {
        min-height: 200px !important;
    }
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-dashboard-extra-quad {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    gap: var(--nucleus-fin-dashboard-gap) !important;
}

/* Внутри extra-карточек: убрать «двойной» горизонтальный отступ (колонка подписей + sparkline padding + список MoM) */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-tab-panel-dashboard .nucleus-dashboard-trend-row {
    grid-template-columns: minmax(60px, 78px) minmax(0, 1fr);
    gap: 8px;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-tab-panel-dashboard .nucleus-dashboard-sparkline {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-tab-panel-dashboard .nucleus-dashboard-mom-list {
    padding-left: 0.75rem !important;
}

@media (min-width: 768px) {
    /* Категории: больше воздуха, крупнее донат и типографика, ровные pill-бары */
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main) {
        row-gap: var(--spacing-md);
        align-items: stretch;
        align-self: stretch;
        min-height: 0;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main)
        .nucleus-budget-insights-chart {
        align-self: center;
        justify-content: center;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main)
        .nucleus-budget-insights-donut-wrap {
        width: min(336px, 100%) !important;
        max-width: 336px !important;
        padding: 20px !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main)
        .nucleus-budget-insights-donut-total {
        font-size: clamp(1.48rem, 2.7vw, 2.2rem) !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main)
        .nucleus-budget-insights-donut-meta {
        font-size: 12px !important;
        margin-top: 6px !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-rows {
        flex: 1 1 auto !important;
        align-self: stretch !important;
        min-height: 0 !important;
        gap: 18px !important;
        padding: 8px 0 !important;
        justify-content: space-evenly !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-name {
        font-size: 14px !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-value {
        font-size: 14px !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-bar {
        height: 10px !important;
        border-radius: 9999px !important;
        box-sizing: border-box !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-bar-fill {
        border-radius: 9999px !important;
        min-height: 10px !important;
    }
}

/* Узкий остров Finance: бублик сверху раньше, чем срабатывает только min-width:768px по viewport */
@container nucleus-fin-island (max-width: 800px) {
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual:not(.nucleus-overview-cashflow-visual) {
        height: auto !important;
        min-height: 0 !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main) {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        column-gap: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        align-items: stretch !important;
        row-gap: var(--spacing-lg) !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main)::before {
        display: none !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-chart {
        align-self: center !important;
        justify-content: center !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-rows {
        flex: none !important;
        align-self: stretch !important;
        min-height: 0 !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
        gap: 14px !important;
        justify-content: flex-start !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main)
        .nucleus-budget-insights-donut-wrap {
        width: min(280px, 85cqw) !important;
        max-width: 100% !important;
        padding: 16px !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-name,
    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-value {
        font-size: 13px !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-bar {
        height: 6px !important;
    }

    #nucleus-dashboard-container
        #nucleus-finance-island
        #nucleus-tab-panel-dashboard
        .nucleus-budget-insights-row-bar-fill {
        min-height: 6px !important;
    }
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-dashboard-extra-slot {
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-dashboard-extra-grid #nucleus-dashboard-ai-panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none !important;
    padding: var(--spacing-4xl) var(--nucleus-fin-card-pad-x) !important;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-finance-planner #nucleus-calendar-section {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: var(--spacing-4xl) var(--nucleus-fin-card-pad-x) calc(var(--spacing-4xl) + 2px) !important;
    box-sizing: border-box !important;
    /* Как .nucleus-budget-insights-visual на Dashboard: --color-bg-chat (градиент в тёмной теме) */
    background: var(--color-bg-chat) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Бюджет — селект месяца/год: как .fm-form-row input / поиск в Operations (input-bg, radius-xl, 40px) */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-calendar-section
    .nucleus-calendar-selects
    .invoice-currency-wrapper {
    min-height: 40px;
    height: auto;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-calendar-section
    .nucleus-calendar-selects
    .invoice-currency-select {
    background: var(--color-input-bg) !important;
    border: var(--color-input-border) !important;
    border-radius: var(--radius-xl) !important;
    min-height: 40px !important;
    height: auto !important;
    line-height: 1.35 !important;
    font-size: var(--font-size-md) !important;
    padding: 0 0.75rem !important;
    box-shadow: none !important;
    color: var(--color-input-text);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-calendar-section
    .nucleus-calendar-selects
    .invoice-currency-select:hover {
    background: var(--color-input-bg-hover) !important;
    border: var(--color-input-border) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-calendar-section
    .nucleus-calendar-selects
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: var(--color-input-bg-focus) !important;
    border: var(--color-input-border) !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-calendar-section
    .nucleus-calendar-selects
    .invoice-currency-wrapper.select-open
    .invoice-currency-dropdown {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    border: var(--color-input-border);
    border-top: none;
    background: var(--color-input-bg-focus);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-calendar-section
    .nucleus-calendar-selects
    .invoice-currency-select:focus-visible {
    outline: 2px solid var(--color-button-primary-focus);
    outline-offset: 2px;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-calendar-section
    .nucleus-calendar-selects
    .invoice-currency-select:focus-visible {
    outline-color: rgba(5, 150, 105, 0.55);
}

/* Бюджет: блок месяца без вертикального padding и без min-height 300px — высота по контенту */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-finance-planner
    #nucleus-tab-panel-budget
    #nucleus-budget-month-root.nucleus-month-board {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: auto !important;
    min-height: unset !important;
}

/* Операции: ledger — как блок категорий / чат: градиент --color-bg-chat */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-main-tab-panel--operations .nucleus-month-board {
    margin-top: 0 !important;
    padding: var(--spacing-4xl) var(--nucleus-fin-card-pad-x) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    background: var(--color-bg-chat) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    box-sizing: border-box !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-bank-reconcile-panel {
    margin-top: 0 !important;
    padding: var(--spacing-4xl) var(--nucleus-fin-card-pad-x) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    background: var(--nucleus-fin-island-surface) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    box-sizing: border-box !important;
}

/* Пустое состояние Bank statement: dropzone сам несёт CTA — hint скрываем. */
#nucleus-bank-reconcile-panel.is-empty .nucleus-bank-reconcile-hint {
    display: none;
}

#nucleus-bank-reconcile-panel.is-empty .nucleus-bank-reconcile-title {
    margin-bottom: 16px;
}

/* Dropzone в стиле современных import-flow:
   - default: иконка-стопка (3 квадрата) + заголовок + subtle хинт
   - loading: иконка спрятана, на её месте арка 270° с большим процентом
   - file-row: отдельная карточка под dropzone (имя + бар + %) */
.nucleus-bank-dropzone {
    --bank-dz-accent: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 260px;
    padding: 32px 20px;
    border-radius: var(--nucleus-fin-island-radius, 16px);
    border: 1.5px dashed color-mix(in srgb, var(--color-text-primary) 22%, transparent);
    background: color-mix(in srgb, var(--color-text-primary) 2%, transparent);
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
    box-sizing: border-box;
}

.nucleus-bank-dropzone:hover,
.nucleus-bank-dropzone:focus-visible {
    border-color: color-mix(in srgb, var(--bank-dz-accent) 60%, transparent);
    background: color-mix(in srgb, var(--bank-dz-accent) 5%, transparent);
    outline: none;
}

.nucleus-bank-dropzone.is-dragover {
    border-color: var(--bank-dz-accent);
    background: color-mix(in srgb, var(--bank-dz-accent) 10%, transparent);
    transform: scale(1.004);
}

/* Сцена 120×120 — внутри либо иконка-стопка, либо progress-арка с %. */
.nucleus-bank-dropzone-stage {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nucleus-bank-dropzone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    opacity: 0.1;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nucleus-bank-dropzone:hover .nucleus-bank-dropzone-icon,
.nucleus-bank-dropzone.is-dragover .nucleus-bank-dropzone-icon {
    opacity: 0.25;
}

.nucleus-bank-dropzone.is-dragover .nucleus-bank-dropzone-icon {
    transform: scale(1.04);
}

/* Loading: иконка скрывается, прогресс — единственное содержимое сцены.
   Рамку и фон убираем — иначе внутри карточки Bank statement получается «рамка в рамке»,
   а на финальных 100 % это даёт ощущение «странного пустого блока» под прогрессом. */
.nucleus-bank-dropzone.is-loading .nucleus-bank-dropzone-icon {
    display: none;
}

.nucleus-bank-dropzone.is-loading {
    border-color: transparent;
    background: transparent;
    cursor: default;
    transform: none;
}

.nucleus-bank-dropzone.is-loading:hover,
.nucleus-bank-dropzone.is-loading:focus-visible {
    border-color: transparent;
    background: transparent;
}

.nucleus-bank-dropzone-progress {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nucleus-bank-dropzone-progress[hidden] {
    display: none;
}

.nucleus-bank-dropzone-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.nucleus-bank-dropzone-ring-track {
    stroke: color-mix(in srgb, var(--color-text-primary) 10%, transparent);
}

.nucleus-bank-dropzone-ring-fill {
    stroke: var(--bank-dz-accent);
    transition: stroke-dasharray 0.12s linear;
}

.nucleus-bank-dropzone-pct {
    position: relative;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.nucleus-bank-dropzone-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.nucleus-bank-dropzone-sub {
    font-size: 0.875rem;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.55));
    line-height: 1.4;
}

/* Meta — отдельной строкой ПОД dropzone, не внутри (как в референсе) */
.nucleus-bank-dropzone-meta {
    font-size: 0.75rem;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.45));
    line-height: 1.45;
    text-align: center;
    margin: 12px auto 0;
    max-width: 420px;
}

/* File-row — отдельная карточка под dropzone, появляется при выборе файла */
.nucleus-bank-dropzone-file {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 12px;
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-text-primary) 3%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-text-primary) 10%, transparent);
    text-align: left;
}

.nucleus-bank-dropzone-file[hidden] {
    display: none;
}

.nucleus-bank-dropzone-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    color: var(--color-text-secondary);
    flex: 0 0 auto;
}

.nucleus-bank-dropzone-file-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.nucleus-bank-dropzone-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nucleus-bank-dropzone-file-bar {
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text-primary) 10%, transparent);
    overflow: hidden;
}

.nucleus-bank-dropzone-file-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--bank-dz-accent);
    border-radius: inherit;
    transition: width 0.12s linear;
}

.nucleus-bank-dropzone-file-pct {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bank-dz-accent);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .nucleus-bank-dropzone {
        min-height: 220px;
        padding: 24px 14px;
    }
    .nucleus-bank-dropzone-stage {
        width: 96px;
        height: 96px;
    }
    .nucleus-bank-dropzone-icon svg {
        width: 76px;
        height: 76px;
    }
    .nucleus-bank-dropzone-pct {
        font-size: 1.25rem;
    }
}

/* Import bank CSV — как Import CSV у реестра транзакций на вкладке Operations */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-bank-reconcile-panel
    .nucleus-bank-csv-import-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-secondary);
    background: transparent;
    color: var(--color-text-primary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    white-space: nowrap;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-bank-reconcile-panel
    .nucleus-bank-csv-import-btn:hover {
    background: var(--color-bg-input);
    border-color: var(--color-border-tertiary);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-bank-reconcile-panel
    .nucleus-bank-csv-import-btn {
    border-color: var(--color-border-secondary);
    background: transparent;
    color: var(--color-text-primary);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-bank-reconcile-panel
    .nucleus-bank-csv-import-btn:hover {
    background: var(--color-bg-input);
    border-color: var(--color-border-tertiary);
}

/* Операции (остров): между блоками стека — 16px (как gap в Planner: календарь ↔ доска) */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-tab-panel-operations
    #nucleus-operations-root.nucleus-operations-stack {
    gap: 16px !important;
}

/* Операции (остров): тот же ритм, что .nucleus-budget-insights-visual / extra-card — сегмент-трек, --rv-text-muted, без тяжёлой вложенной рамки */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-head {
    margin-bottom: 0;
    padding-bottom: var(--spacing-md);
    border-bottom: none;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-top-controls {
    margin-bottom: 0;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-toolbar {
    margin-bottom: 0;
    gap: var(--spacing-md);
}

/* Одна строка: сортировка + селекты + длинный поиск (остаток ширины) */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-filters-line {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
    position: relative;
    z-index: 0;
    isolation: isolate;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-filters {
    flex-wrap: nowrap;
    flex: 1 1 0;
    min-width: 0;
    gap: 8px 10px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-search-wrap {
    flex: 1 1 120px;
    min-width: 0;
    max-width: none;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-segment-rail.nucleus-transactions-segment-rail--toolbar {
    flex: 0 0 auto;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-filters
    .nucleus-transactions-groupby-wrap--inline {
    flex: 0 0 auto;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-currency {
    flex: 0 0 auto;
}

/* Кастомные селекты (tool-controls + invoice-controls-unified): список не клиповать */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-toolbar,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main {
    overflow: visible;
}

/* Revolut-подобно: сегмент All / Income / Expenses — капсула как Cashflow на Dashboard */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-tabs {
    padding: 3px !important;
    width: fit-content !important;
    max-width: 100% !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-tabs {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

@media (max-width: 900px) {
    #nucleus-dashboard-container
        .nucleus-finance-island
        .nucleus-main-tab-panel--operations
        .nucleus-transactions-toolbar-filters-line {
        flex-wrap: wrap;
    }

    #nucleus-dashboard-container
        .nucleus-finance-island
        .nucleus-main-tab-panel--operations
        .nucleus-transactions-inline-filters {
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    #nucleus-dashboard-container
        .nucleus-finance-island
        .nucleus-main-tab-panel--operations
        .nucleus-transactions-inline-search-wrap {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* Широкий экран: табы в строке реестра */
@media (min-width: 900px) {
    #nucleus-dashboard-container
        .nucleus-finance-island
        .nucleus-main-tab-panel--operations
        .nucleus-transactions-top-controls {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: flex-start;
    }

    #nucleus-dashboard-container
        .nucleus-finance-island
        .nucleus-main-tab-panel--operations
        .nucleus-transactions-toolbar-tabs {
        width: fit-content !important;
        max-width: 100% !important;
    }
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-head-title {
    font-size: clamp(1.0625rem, 0.9vw + 0.85rem, 1.3125rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.025em;
}

/*
 * Operations toolbar: заливка полей как у налогов в FM-дровере
 * (--fm-drawer-field-fill там только на .nucleus-financial-mirror-sidebar — дублируем формулу сюда).
 */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-toolbar {
    --nucleus-ops-field-fill: color-mix(in srgb, var(--color-bg-input) 84%, #000 16%);
    --nucleus-ops-field-fill-hover: color-mix(in srgb, var(--color-bg-input) 78%, #000 22%);
    --nucleus-ops-field-radius: 16px;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-toolbar {
    --nucleus-ops-field-fill: color-mix(in srgb, var(--color-bg-input) 90%, #000 10%);
    --nucleus-ops-field-fill-hover: color-mix(in srgb, var(--color-bg-input) 86%, #000 14%);
}

/* Поиск: та же «коробка», что инпуты в налоговом дровере */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-search-wrap
    .nucleus-transactions-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: none;
    min-height: var(--nucleus-control-height);
    padding: 0 0.75rem;
    border-radius: var(--nucleus-ops-field-radius, 16px);
    background: var(--nucleus-ops-field-fill);
    border: none;
    box-shadow: none;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-row:focus-within {
    background: var(--nucleus-ops-field-fill-hover);
    outline: 2px solid var(--nucleus-control-focus);
    outline-offset: 2px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-input:focus-visible,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-clear-btn:focus-visible {
    outline: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-input {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: var(--nucleus-control-height);
    line-height: var(--nucleus-control-height);
    padding: 0 6px 0 0;
    margin: 0;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: var(--font-size-sm);
    font-family: var(--font-primary);
    color: var(--nucleus-control-fg);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-input::placeholder {
    color: var(--nucleus-control-fg-muted);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-input:focus {
    border: none !important;
    background: transparent !important;
    outline: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-counter {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-height: var(--nucleus-control-height);
    line-height: 1.2;
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--nucleus-control-fg-muted);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    line-height: 1;
    border: none !important;
    border-radius: var(--radius-full);
    background: transparent !important;
    font-size: var(--font-size-sm);
    font-family: var(--font-primary);
    color: var(--nucleus-control-fg-muted);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-search-clear-btn:hover {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent) !important;
    color: var(--nucleus-control-fg);
}

/* Нативные селекты: дефолтная заливка как в налоговом дровере */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select {
    height: var(--nucleus-control-height);
    min-height: var(--nucleus-control-height);
    padding: 0 32px 0 12px;
    border-radius: var(--nucleus-ops-field-radius, 16px);
    border: none !important;
    background-color: var(--nucleus-ops-field-fill) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(255,255,255,0.55)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 8px;
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    box-sizing: border-box;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select:hover,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select:hover {
    background-color: var(--nucleus-ops-field-fill-hover) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select:focus,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select:focus {
    outline: none;
    background-color: var(--nucleus-ops-field-fill-hover) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select:focus-visible,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select:focus-visible {
    outline: 2px solid var(--nucleus-control-focus);
    outline-offset: 2px;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select {
    border: none !important;
    background-color: var(--nucleus-ops-field-fill) !important;
    color: var(--color-text-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(0,0,0,0.55)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select:hover,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select:hover {
    background-color: var(--nucleus-ops-field-fill-hover) !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select:focus,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select:focus {
    background-color: var(--nucleus-ops-field-fill-hover) !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-groupby-select:focus-visible,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-toolbar-main
    .nucleus-transactions-currency-select:focus-visible {
    outline: 2px solid var(--nucleus-control-focus);
    outline-offset: 2px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-import-btn {
    height: 36px;
    border: 1px solid var(--color-border-secondary);
    background: transparent;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-import-btn:hover {
    background: var(--color-bg-input);
    border-color: var(--color-border-tertiary);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-export-btn {
    height: 36px;
    border: 1px solid var(--color-border-secondary);
    background: transparent;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-export-btn:hover {
    background: var(--color-bg-input);
    border-color: var(--color-border-tertiary);
}

/* Operations: список карточек без внутренней «второй коробки» — только карточки на фоне вкладки */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    #nucleus-transactions-table {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow-x: visible;
    overflow-y: visible;
    box-sizing: border-box;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    #nucleus-transactions-table {
    border: none !important;
    background: transparent !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    thead
    th {
    color: var(--rv-text-muted);
    border-bottom-color: var(--nucleus-line-soft-dark);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    thead
    th {
    border-bottom-color: var(--nucleus-line-soft-light);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    td {
    border-bottom-color: var(--nucleus-line-soft-dark);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    td {
    border-bottom-color: var(--nucleus-line-soft-light);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    tr:hover
    td {
    background: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    tr.nucleus-transactions-summary-row
    td.nucleus-transactions-summary-cell {
    background: transparent;
    border-bottom-color: var(--nucleus-line-soft-dark);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    tr.nucleus-transactions-summary-row
    td.nucleus-transactions-summary-cell {
    border-bottom-color: var(--nucleus-line-soft-light);
}

/* Сводка и строки — island surface; KPI-плитки компактные, без «таблеток» 28px */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-operations-ledger-kpis
    .nucleus-transactions-summary {
    gap: var(--spacing-md);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-summary-item {
    border: none !important;
    border-radius: var(--radius-lg);
    background: var(--nucleus-fin-island-surface) !important;
    box-shadow: none !important;
    padding: var(--spacing-md) var(--spacing-lg);
    gap: 6px;
    min-height: 3.5rem;
    justify-content: center;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-summary-label {
    color: var(--rv-text-muted);
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-summary-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
}

/* Отрицательный NET без красного — тот же акцент, что и остальные суммы */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-summary-value.is-negative {
    color: var(--color-text-primary) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-summary-value.is-positive {
    color: var(--color-success);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-bulk-bar:not(.is-hidden) {
    padding: 10px 12px;
    border-radius: var(--nucleus-fin-island-radius);
    background: var(--nucleus-fin-island-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Операции: список транзакций в духе Revolut — тип-пилюля, иерархия текста */
.nucleus-tx-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    white-space: nowrap;
}

.nucleus-tx-type-pill--income {
    background: color-mix(in srgb, var(--color-success, #34d399) 22%, transparent);
    color: var(--color-success, #6ee7b7);
}

.nucleus-tx-type-pill--expense {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    color: var(--color-text-secondary);
}

body.light-theme .nucleus-tx-type-pill--income {
    background: color-mix(in srgb, var(--color-success, #059669) 16%, transparent);
    color: var(--color-success, #047857);
}

body.light-theme .nucleus-tx-type-pill--expense {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(15, 23, 42, 0.65);
}

.nucleus-tx-cell-date {
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-tertiary);
    vertical-align: middle;
}

.nucleus-tx-cell-type {
    vertical-align: middle;
}

.nucleus-tx-cell-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--color-text-primary);
    vertical-align: middle;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nucleus-tx-cell-amount {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    vertical-align: middle;
}

.nucleus-tx-cell-ccy {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    white-space: nowrap;
    vertical-align: middle;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    tr[data-tx-meta-id]
    td {
    padding-top: 16px;
    padding-bottom: 16px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    tr[data-tx-type='income']
    .nucleus-tx-cell-amount {
    color: var(--color-success, #6ee7b7);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    tbody
    tr[data-tx-type='expense']
    .nucleus-tx-cell-amount {
    color: var(--color-text-primary);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    thead
    th {
    padding: 14px 12px 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    color: var(--rv-text-muted);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-table-el
    thead
    th:nth-child(n + 6) {
    color: color-mix(in srgb, var(--rv-text-muted) 85%, transparent);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-list-summary-bar {
    border-bottom: none;
    margin-bottom: var(--spacing-md);
    padding-bottom: 0;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card[data-tx-type='expense']
    .nucleus-tx-card-amount {
    color: var(--color-text-primary);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-list {
    gap: 0;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-list-body {
    gap: var(--spacing-md);
}

/* Карточки транзакций: island surface без рамки; скругление чуть меньше внешней оболочки списка */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card {
    border-radius: var(--radius-2xl);
    background: var(--nucleus-fin-island-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card:hover {
    background: color-mix(
        in srgb,
        var(--nucleus-fin-island-surface) 92%,
        var(--color-text-primary) 8%
    ) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card.is-selected,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card.is-bulk-selected {
    background: color-mix(
        in srgb,
        var(--nucleus-fin-island-surface) 94%,
        var(--color-text-primary) 6%
    ) !important;
    border: none !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-text-primary) 12%, transparent) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card-main {
    padding: 16px 18px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    background: color-mix(in srgb, #ffffff 6%, transparent);
    border-color: rgba(255, 255, 255, 0.08);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card--income
    .nucleus-tx-card-avatar {
    background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    border-color: color-mix(in srgb, var(--color-text-primary) 12%, transparent);
    color: var(--color-text-secondary);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card-amount {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card--income
    .nucleus-tx-card-amount {
    color: var(--color-text-primary);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-type-pill--income {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    color: var(--color-text-secondary);
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-type-pill--income {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(15, 23, 42, 0.65);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    #nucleus-transactions-table
    .nucleus-tx-list-group-row {
    background: var(--nucleus-fin-island-surface) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--radius-2xl);
    color: var(--rv-text-muted);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card-details.is-open
    .nucleus-tx-card-details-grid {
    border-top: none;
    background: transparent;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card {
    background: var(--nucleus-fin-island-surface) !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card:hover {
    background: color-mix(
        in srgb,
        var(--nucleus-fin-island-surface) 93%,
        var(--color-text-primary) 7%
    ) !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-tx-card-details.is-open
    .nucleus-tx-card-details-grid {
    border-top: none;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    #nucleus-transactions-table
    .nucleus-tx-list-group-row {
    background: var(--nucleus-fin-island-surface) !important;
    border: none !important;
    color: var(--rv-text-muted);
}

/* id + остров — выше, чем #nucleus-dashboard-container #nucleus-taxes-section { margin-top: 0 } */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-section {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

/*
 * Налоги в острове — тот же ритм, что .nucleus-dashboard-extra-grid / .nucleus-budget-insights-visual:
 * колонка с gap: var(--spacing-lg); каждая плитка — --rv-surface + 32px + --rv-radius.
 * Playbook (скрыт): оболочка без фона. Brief: как остальные острова — rv-surface.
 */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-section .nucleus-taxes-workspace {
    gap: var(--spacing-lg) !important;
    max-width: none;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-workspace .nucleus-taxes-island,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-4xl) var(--nucleus-fin-card-pad-x) !important;
    background: var(--nucleus-fin-island-surface) !important;
    border-radius: var(--nucleus-fin-island-radius) !important;
    border: 1px solid var(--nucleus-fin-island-border) !important;
    box-shadow: var(--nucleus-fin-island-shadow) !important;
    box-sizing: border-box !important;
    min-width: 0;
    width: 100%;
}

/* Intro: тот же фон, что у .nucleus-budget-insights-visual (градиент в тёмной теме) */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-workspace .nucleus-taxes-island--intro,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island--intro {
    background: var(--color-bg-chat) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-workspace #nucleus-taxes-accumulated-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 0 0 var(--spacing-sm);
}

.nucleus-taxes-accumulated-stats__head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
    width: auto;
    max-width: 100%;
    align-self: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nucleus-taxes-accumulated-stats__title {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.nucleus-taxes-accumulated-stats__head .nucleus-budget-insights-pills {
    margin: 0;
    width: auto !important;
    max-width: max-content !important;
    align-self: flex-start !important;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.nucleus-taxes-accumulated-stats__currency-pills {
    margin-left: 0 !important;
    flex-shrink: 0;
}

.nucleus-taxes-accumulated-stats__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Как у Income planner (.nucleus-income-planner-stats__value / __value-stack) */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-accumulated-stats
    .nucleus-taxes-accumulated-stats__value {
    margin: 0;
    font-size: clamp(1.85rem, 3.1vw, 2.45rem);
    line-height: 1.12;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
}

#nucleus-dashboard-container .nucleus-taxes-accumulated-stats__value-prefix {
    color: #ffffff;
    font-weight: 700;
}

body.light-theme #nucleus-dashboard-container .nucleus-taxes-accumulated-stats__value-prefix {
    color: var(--color-text-secondary, #64748b);
}

#nucleus-dashboard-container .nucleus-taxes-accumulated-stats__value-amount {
    color: var(--color-accent-primary);
}

.nucleus-taxes-accumulated-stats__main .nucleus-taxes-pdf-btn {
    white-space: nowrap;
}

/*
 * Правый дровер налогов: без вложенной карточки острова (как поток FM в #financial-mirror-container).
 * На дашборде вкладка Taxes сохраняет остров из селектора .nucleus-taxes-island выше.
 */
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--drawer-gap-subsection) !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    min-width: 0;
    width: 100%;
}

#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island--intro {
    background: transparent !important;
}

#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile {
    padding-left: var(--drawer-pad-inline);
    padding-right: var(--drawer-pad-inline);
    box-sizing: border-box;
}

/* Playbook скрыт; brief — как intro: фон/радиус/padding задаёт общий .nucleus-taxes-island */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-workspace .nucleus-taxes-island--playbook, #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island--playbook {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Остров превью: контейнер для cqw — лист тянется на ширину, высота ~ A4 от ширины */
#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-workspace #nucleus-taxes-island-brief {
    container-type: inline-size;
    container-name: nucleus-tax-brief-sheet;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-workspace .nucleus-taxes-island--brief, #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island--brief {
    align-items: stretch;
}

#nucleus-dashboard-container .nucleus-finance-island #nucleus-taxes-workspace .nucleus-taxes-island--brief .nucleus-taxes-brief, #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace #nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-island--brief .nucleus-taxes-brief {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-lg);
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: none;
    border-top: none;
    background: transparent;
}

/* Лист отчёта: на всю ширину острова; min-height как у A4 (297/210) от ширины контейнера; поля масштабируются */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    #nucleus-taxes-island-brief
    #nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--brief
    #nucleus-taxes-brief-print.nucleus-taxes-brief-doc--report {
    width: 100% !important;
    max-width: 100% !important;
    min-height: calc(100cqw * 297 / 210) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    padding: clamp(1.25rem, 5cqw, 3.125rem) clamp(1rem, 4cqw, 3.125rem) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--brief
    .nucleus-taxes-brief-actions,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--brief
    .nucleus-taxes-brief-actions,
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-intro-actions,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--intro
    .nucleus-taxes-intro-actions {
    justify-content: flex-start;
    align-content: flex-start;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* Кнопка «Сохранить превью» в конце intro: отступ от сетки профиля */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-taxes-island--intro
    .nucleus-taxes-intro-actions,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--intro
    .nucleus-taxes-intro-actions {
    margin-top: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
}

/* Экспорт PDF/CSV под превью — отступ от листа отчёта */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--brief
    .nucleus-taxes-brief-actions {
    margin-top: var(--spacing-lg);
}

/* Остров intro: gap у .nucleus-taxes-island задаёт шаг между шапкой, тулбаром (Country/Year) и профилем */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-taxes-island--intro .nucleus-taxes-head,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--intro
    .nucleus-taxes-head {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-taxes-island--intro .nucleus-taxes-profile,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--intro
    .nucleus-taxes-profile {
    border-top: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Шапка налогов: Country / Tax year — не tertiary на плитке workspace */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-selects,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-selects {
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Клон шапки в дровере: селекты в сетке, общий фон у полей — не у обёртки .nucleus-taxes-selects */
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-intro-drawer-clone
    .nucleus-taxes-selects {
    background: transparent !important;
}

/* То же на основной вкладке Taxes (intro-остров): обёртка без общей заливки */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--intro
    .nucleus-taxes-selects {
    background: transparent !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-toolbar
    .invoice-currency-select:hover,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-toolbar
    .invoice-currency-select:hover {
    background: color-mix(in srgb, var(--rv-segment-track) 78%, #000 22%) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-toolbar
    .invoice-currency-wrapper.select-open
    .invoice-currency-select,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-toolbar
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: color-mix(in srgb, var(--rv-segment-track) 78%, #000 22%) !important;
}

/* Профиль на rv-surface: раньше селект/инпут = тот же tertiary — не отличить от фона плитки */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-profile
    .invoice-currency-select,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-profile
    .invoice-currency-select {
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-profile
    .invoice-currency-select:hover,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-profile
    .invoice-currency-select:hover {
    background: color-mix(in srgb, var(--rv-segment-track) 78%, #000 22%) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-profile
    .invoice-currency-wrapper.select-open
    .invoice-currency-select,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-profile
    .invoice-currency-wrapper.select-open
    .invoice-currency-select {
    background: color-mix(in srgb, var(--rv-segment-track) 78%, #000 22%) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input {
    background: color-mix(in srgb, var(--rv-segment-track) 84%, #000 16%) !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-selects,
body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-selects,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-profile
    .invoice-currency-select,
body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-profile
    .invoice-currency-select,
body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input,
body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-profile
    .nucleus-taxes-profile-input {
    background: color-mix(in srgb, var(--rv-segment-track) 90%, #000 10%) !important;
}

/* Сетка Reporting / Deductions / Limits — как ячейки extra-quad: --rv-surface, 32px, тот же radius */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-card,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-card {
    background: var(--rv-surface) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--rv-radius) !important;
    padding: var(--spacing-4xl) !important;
    box-sizing: border-box !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-card--limits,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-card--limits {
    border-color: transparent !important;
    background: var(--rv-surface) !important;
}

/* Поля «своя строка» + ○ ✓ — — как .nucleus-taxes-profile-input (--color-bg-input), без резкого bg-primary */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-custom-input,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-custom-input {
    background: var(--color-bg-input) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-check-tools,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-check-tools {
    background: var(--color-bg-input) !important;
    border: none !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-check-btn,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-check-btn {
    background: transparent !important;
    color: var(--rv-text-muted) !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-check-btn:hover,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-check-btn:hover {
    background: var(--color-bg-input-focus) !important;
    color: var(--color-text-primary) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-check-btn.is-active,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-check-btn.is-active {
    background: var(--rv-active-chip) !important;
    color: var(--color-text-primary) !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-custom-add-btn,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-custom-add-btn {
    background: transparent !important;
    color: var(--color-text-primary) !important;
    border: 1px solid var(--color-border-secondary) !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-custom-add-btn:hover,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-custom-add-btn:hover {
    background: var(--color-bg-input) !important;
    border-color: var(--color-border-tertiary) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-card-title,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-card-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--color-text-tertiary) !important;
    border-bottom-color: var(--nucleus-line-dark) !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-grid
    .nucleus-taxes-card-title,
body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-grid
    .nucleus-taxes-card-title {
    border-bottom-color: var(--nucleus-line-light) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--playbook
    .nucleus-taxes-grid,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--playbook
    .nucleus-taxes-grid {
    gap: var(--spacing-lg) !important;
    border-radius: 0;
    overflow: visible;
}

@media (min-width: 900px) {
    #nucleus-dashboard-container
        .nucleus-finance-island
        #nucleus-taxes-workspace
        .nucleus-taxes-island--playbook
        .nucleus-taxes-grid,
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
        #nucleus-sidebar-taxes-drawer-panel
        .nucleus-taxes-island--playbook
        .nucleus-taxes-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Остров playbook скрыт: чеклисты, подсказки workspace и блок ассистента — вкладка только профиль + отчёт/PDF. */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--playbook,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--playbook {
    display: none !important;
}

/* Intro: шапка → тулбар (Country/Year) → профиль — ритм через gap острова */
#nucleus-dashboard-container .nucleus-finance-island .nucleus-taxes-head {
    border-bottom: none !important;
    padding-bottom: 0;
    /* Отступ до следующего блока — gap у .nucleus-taxes-island--intro */
    margin-bottom: 0 !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-taxes-profile {
    border-top: none !important;
    padding-top: 0;
}

/* Workspace hint: одна плитка как extra-card / budget note, без отдельного «зелёного» акцента */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-taxes-island--playbook
    .nucleus-taxes-context-stack:has(.nucleus-taxes-context:not([hidden])) {
    margin: 0 !important;
    padding: var(--spacing-4xl) !important;
    border: none !important;
    border-radius: var(--rv-radius) !important;
    background: var(--rv-surface) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    gap: var(--spacing-md) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-taxes-island--playbook
    .nucleus-taxes-context-stack
    .nucleus-taxes-context {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--color-text-secondary) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-taxes-island--playbook
    .nucleus-taxes-context-stack
    .nucleus-taxes-context::before {
    display: none !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-taxes-island--playbook .nucleus-taxes-ai {
    margin: 0 !important;
    padding: var(--spacing-4xl) !important;
    border: none !important;
    border-radius: var(--rv-radius) !important;
    background: var(--rv-surface) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

#nucleus-dashboard-container .nucleus-finance-island .nucleus-taxes-island--playbook .nucleus-taxes-ai-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--color-text-tertiary) !important;
}

/* Белый лист отчёта: .nucleus-taxes-brief-doc--report — не перебиваем островом */

/* Бух. поля в реестре операций, выписка, сохранённые налоговые отчёты */
/* Мета-колонки: компактная сетка; сами поля — «ghost», без визуальной решётки как в Excel */
.nucleus-tx-meta-cell {
    padding: 6px 8px !important;
    vertical-align: middle;
    min-width: 3.25rem;
    max-width: 7.5rem;
}

/* Revolut-like: пустые ячейки не выглядят как тёмные боксы — только лёгкий фон при hover/focus */
.nucleus-tx-meta-input {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 10px;
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    line-height: 1.35;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.65));
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.nucleus-tx-meta-input::placeholder {
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.35));
    opacity: 1;
}

.nucleus-tx-meta-input:hover {
    background: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
    color: var(--color-text-primary);
}

.nucleus-tx-meta-input:focus {
    outline: none;
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
    border-color: color-mix(in srgb, var(--color-text-primary) 14%, transparent);
    color: var(--color-text-primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent-primary, #10b981) 40%, transparent);
}

.nucleus-tx-meta-input:focus::placeholder {
    opacity: 0.35;
}

body.light-theme .nucleus-tx-meta-input {
    color: rgba(15, 23, 42, 0.55);
}

body.light-theme .nucleus-tx-meta-input:hover {
    background: rgba(0, 0, 0, 0.045);
    color: rgba(15, 23, 42, 0.9);
}

body.light-theme .nucleus-tx-meta-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.35);
    color: rgba(15, 23, 42, 0.95);
}

.nucleus-bank-reconcile-panel {
    margin-top: var(--spacing-xl, 24px);
    padding: var(--spacing-lg, 20px);
    border-radius: var(--rv-radius, 12px);
    border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.1));
    background: var(--rv-surface, rgba(255, 255, 255, 0.03));
}

.nucleus-bank-reconcile-title {
    font-size: var(--nd-type-h3, 1.0625rem);
    margin: 0 0 8px;
}

.nucleus-bank-reconcile-hint {
    margin: 0 0 12px;
    font-size: var(--nd-type-caption, 0.75rem);
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.5));
}

/* Fallback вне острова Finance — тот же ритм, что .nucleus-transactions-import-btn */
.nucleus-bank-csv-import-btn {
    height: var(--tx-control-height, 40px);
    padding: 0 16px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.nucleus-bank-csv-import-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
}

body.light-theme .nucleus-bank-csv-import-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-primary);
}

body.light-theme .nucleus-bank-csv-import-btn:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.18);
}

.nucleus-bank-reconcile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.nucleus-bank-reconcile-table th,
.nucleus-bank-reconcile-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
}

/* В ячейке reconcile-таблицы используется каноничный invoice-style select
   (см. css/components/selects.css) — тут только размеры под колонку и контраст. */
.nucleus-bank-match-wrapper {
    width: 100%;
    min-width: 220px;
}

/* Используем те же ДС-переменные, что и селекты Tax workspace
   (Country/region, Tax year) — ровно как на референсе. Двойной класс
   .nucleus-ops-inline-select.nucleus-bank-match-wrapper нужен, чтобы
   перебить более позднее правило для .nucleus-ops-inline-select. */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select.nucleus-bank-match-wrapper
    .invoice-currency-select {
    min-height: var(--nucleus-control-height) !important;
    height: var(--nucleus-control-height) !important;
    border-radius: var(--nucleus-control-radius) !important;
    background: var(--nucleus-control-bg) !important;
    border: none !important;
    color: var(--nucleus-control-fg) !important;
    box-shadow: none !important;
    font-size: var(--font-size-sm) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select.nucleus-bank-match-wrapper
    .invoice-currency-select:hover,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select.nucleus-bank-match-wrapper.select-open
    .invoice-currency-select {
    background: var(--nucleus-control-bg-hover) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select.nucleus-bank-match-wrapper
    .invoice-currency-select
    .currency-value {
    font-size: var(--font-size-sm) !important;
    color: var(--nucleus-control-fg) !important;
}

.nucleus-bank-match-wrapper .currency-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Dropdown портируется в <body> при открытии — поэтому модификатор живёт на сам
   .invoice-currency-dropdown, не на wrapper. Опции в одну строку с ellipsis. */
.invoice-currency-dropdown.nucleus-bank-match-dropdown .currency-option {
    font-size: 0.875rem !important;
    min-height: 38px !important;
    padding: 8px 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    line-height: 22px !important;
    border-radius: 10px !important;
}

.nucleus-bank-match-wrapper > select.nucleus-bank-match-select {
    display: none !important;
}

/* Reconcile-таблица: даём колонке селекта приоритет ширины, остальные — компактные. */
.nucleus-bank-reconcile-table th:last-child,
.nucleus-bank-reconcile-table td:last-child {
    width: 36px;
    text-align: center;
}

.nucleus-bank-reconcile-table th:nth-last-child(2),
.nucleus-bank-reconcile-table td:nth-last-child(2) {
    width: 240px;
    min-width: 220px;
}

/* Скелетон-карточка для ledger во время импорта банк-CSV (rendered via addLedgerSkeletons) */
.nucleus-tx-card--skeleton {
    pointer-events: none;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 6px 0;
    animation: nucleus-tx-skel-fade 0.32s ease-out backwards;
}

.nucleus-tx-card--skeleton .nucleus-tx-card-skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
}

.nucleus-tx-card--skeleton .nucleus-tx-card-skeleton-avatar,
.nucleus-tx-card--skeleton .nucleus-tx-card-skeleton-name,
.nucleus-tx-card--skeleton .nucleus-tx-card-skeleton-amount {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--color-text-primary) 6%, transparent) 0%,
        color-mix(in srgb, var(--color-text-primary) 14%, transparent) 50%,
        color-mix(in srgb, var(--color-text-primary) 6%, transparent) 100%
    );
    background-size: 200% 100%;
    animation: nucleus-tx-skel-shimmer 1.2s ease-in-out infinite;
    border-radius: 8px;
    display: block;
}

.nucleus-tx-card--skeleton .nucleus-tx-card-skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nucleus-tx-card--skeleton .nucleus-tx-card-skeleton-name {
    flex: 1 1 auto;
    height: 14px;
    max-width: 240px;
}

.nucleus-tx-card--skeleton .nucleus-tx-card-skeleton-amount {
    width: 88px;
    height: 14px;
    flex-shrink: 0;
}

@keyframes nucleus-tx-skel-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes nucleus-tx-skel-fade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Кнопка удаления bank-line — в стиле tx-card-action */
.nucleus-bank-line-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.55));
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nucleus-bank-line-delete:hover {
    background: color-mix(in srgb, #f97316 16%, transparent);
    color: #f97316;
}

/* Кнопка «Import another CSV» под таблицей — компактный pill */
/* Footer-actions под reconcile-таблицей: secondary "Import another" + primary "Save to transactions" */
.nucleus-bank-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 0;
    flex-wrap: wrap;
}

.nucleus-bank-import-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    margin: 0;
    border-radius: 999px;
    border: 1px dashed color-mix(in srgb, var(--color-text-primary) 22%, transparent);
    background: transparent;
    color: var(--color-text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.nucleus-bank-import-more:hover {
    border-color: color-mix(in srgb, var(--color-text-primary) 45%, transparent);
    background: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
}

/* Primary CTA — invertированный pill (как primary-кнопки сайта) */
.nucleus-bank-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 18px;
    margin: 0;
    border-radius: 999px;
    border: 1px solid var(--color-text-primary);
    background: var(--color-text-primary);
    color: var(--color-bg-primary, #0f1115);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.05s ease;
}

.nucleus-bank-save-btn:hover {
    opacity: 0.9;
}

.nucleus-bank-save-btn:active {
    transform: translateY(1px);
}

.nucleus-bank-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nucleus-bank-reconcile-empty,
.nucleus-taxes-saved-docs-empty {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.5));
    max-width: 62ch;
}

.nucleus-taxes-saved-docs {
    margin-top: var(--spacing-xl, 24px);
    padding-top: var(--spacing-lg, 20px);
    border-top: none;
}

.nucleus-taxes-island--saved-docs {
    min-height: 340px;
}

/* Остров сохранённых отчётов — тот же воздушный градиент, что intro (без «тяжёлой» серой плитки) */
#nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--saved-docs,
#nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--saved-docs {
    background: var(--color-bg-chat) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    #nucleus-taxes-workspace
    .nucleus-taxes-island--saved-docs,
body.light-theme
    #nucleus-financial-mirror-sidebar.nucleus-sidebar--taxes-workspace
    #nucleus-sidebar-taxes-drawer-panel
    .nucleus-taxes-island--saved-docs {
    background: var(--color-bg-secondary) !important;
}

.nucleus-taxes-saved-docs-body--populated {
    min-height: 0;
}

/*
 * Сохранённые отчёты: без второй «карточки» внутри острова — только список с линиями.
 * Рамка/скругление задаёт родитель .nucleus-taxes-island; здесь прозрачный скролл-контейнер.
 */
#nucleus-dashboard-container .nucleus-taxes-saved-docs-table-scroll,
.nucleus-taxes-saved-docs-table-scroll {
    width: 100%;
    max-height: min(52vh, 440px);
    overflow: auto;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-font-smoothing: antialiased;
    -webkit-overflow-scrolling: touch;
}

.nucleus-taxes-saved-docs-table-caption {
    caption-side: top;
    text-align: left;
    padding: 0 0 18px;
    margin: 0;
    font-family: var(--font-primary, system-ui, sans-serif);
    font-size: var(--font-size-lg, 16px);
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: -0.02em;
    line-height: var(--line-height-tight, 1.2);
    color: var(--color-text-primary);
}

.nucleus-taxes-saved-docs-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: var(--font-primary, system-ui, sans-serif);
    font-size: var(--font-size-md, 14px);
}

.nucleus-taxes-saved-docs-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 16px 12px 0;
    border: none;
    border-bottom: 1px solid var(--nucleus-line-soft-dark, rgba(255, 255, 255, 0.055));
    background: color-mix(in srgb, var(--color-bg-tertiary, #272727) 52%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none;
    font-weight: var(--font-weight-semibold, 600);
    font-size: var(--font-size-xs, 11px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-tertiary, rgba(255, 255, 255, 0.5));
    vertical-align: bottom;
}

.nucleus-taxes-saved-docs-table thead th:nth-child(1) {
    min-width: 12rem;
    width: 100%;
    text-align: left;
}

.nucleus-taxes-saved-docs-table thead th:nth-child(2) {
    white-space: nowrap;
    width: 9.5rem;
    min-width: 9.5rem;
}

.nucleus-taxes-saved-docs-table thead th:nth-child(3) {
    white-space: nowrap;
    width: 1%;
}

.nucleus-taxes-saved-docs-table thead th.nucleus-taxes-saved-docs-actions {
    text-align: right;
    padding-right: 0;
    padding-left: 20px;
    width: 1%;
    white-space: nowrap;
}

body.light-theme .nucleus-taxes-saved-docs-table thead th {
    background: color-mix(in srgb, var(--color-bg-secondary, #fff) 88%, transparent);
    border-bottom-color: var(--nucleus-line-soft-light, rgba(0, 0, 0, 0.05));
}

body.light-theme .nucleus-taxes-saved-docs-table tbody tr.nucleus-taxes-saved-docs-row td {
    border-bottom-color: var(--nucleus-line-soft-light, rgba(0, 0, 0, 0.05));
}

body.light-theme .nucleus-taxes-saved-docs-table tbody tr.nucleus-taxes-saved-docs-row:hover td {
    background: rgba(0, 0, 0, 0.035);
}

body.light-theme .nucleus-taxes-saved-docs-pdf-icon {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--nucleus-line-soft-light, rgba(0, 0, 0, 0.05));
    color: var(--color-text-secondary);
}

.nucleus-taxes-saved-docs-empty-state {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 16px;
    border-radius: var(--rv-radius-sm, 12px);
    background: transparent;
}

.nucleus-taxes-saved-docs-empty-icon {
    width: 76px;
    height: 76px;
    color: var(--color-text-tertiary);
    opacity: 0.1;
}

.nucleus-taxes-saved-docs-empty-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.nucleus-taxes-saved-docs-empty-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 650;
    color: var(--color-text-primary);
}

.nucleus-taxes-saved-docs-title {
    font-size: var(--nd-type-h3, 1.0625rem);
    margin: 0 0 12px;
}

.nucleus-taxes-saved-docs-table tbody tr.nucleus-taxes-saved-docs-row td {
    text-align: left;
    vertical-align: middle;
    padding: 16px 16px 16px 0;
    border: none;
    border-bottom: 1px solid var(--nucleus-line-soft-dark, rgba(255, 255, 255, 0.055));
    background: transparent;
}

.nucleus-taxes-saved-docs-table tbody tr.nucleus-taxes-saved-docs-row:first-child td {
    padding-top: 18px;
}

.nucleus-taxes-saved-docs-table tbody tr.nucleus-taxes-saved-docs-row:last-child td {
    border-bottom: none;
}

.nucleus-taxes-saved-docs-table tbody tr.nucleus-taxes-saved-docs-row:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.nucleus-taxes-saved-docs-col-title {
    min-width: 0;
    padding-right: 16px;
}

.nucleus-taxes-saved-docs-col-meta {
    vertical-align: middle;
}

.nucleus-taxes-saved-docs-title-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 36px;
}

.nucleus-taxes-saved-docs-pdf-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
    border: 1px solid var(--nucleus-line-soft-dark, rgba(255, 255, 255, 0.055));
}

.nucleus-taxes-saved-docs-pdf-icon svg {
    display: block;
    opacity: 0.92;
}

.nucleus-taxes-saved-docs-title-text {
    font-weight: var(--font-weight-medium, 500);
    font-size: var(--font-size-md, 14px);
    letter-spacing: -0.012em;
    line-height: 1.4;
    color: var(--color-text-primary);
    word-break: break-word;
}

.nucleus-taxes-saved-docs-meta {
    display: inline-block;
    font-size: var(--font-size-sm, 13px);
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
    white-space: nowrap;
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
    line-height: 1.45;
    vertical-align: middle;
}

.nucleus-taxes-saved-docs-meta--num {
    font-weight: var(--font-weight-medium, 500);
}

.nucleus-taxes-saved-docs-actions {
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
    padding-left: 20px;
    padding-right: 0;
}

.nucleus-taxes-saved-docs-actions-inner {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 32px;
}

.nucleus-taxes-saved-doc-btn {
    margin: 0;
    box-sizing: border-box;
    padding: 0 13px;
    min-height: 32px;
    font-family: inherit;
    font-size: var(--font-size-xs, 12px);
    font-weight: var(--font-weight-medium, 500);
    letter-spacing: 0.01em;
    line-height: 1;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        opacity 0.15s ease;
}

.nucleus-taxes-saved-doc-btn:focus-visible {
    outline: 2px solid var(--color-accent-light, rgba(14, 124, 102, 0.6));
    outline-offset: 2px;
}

.nucleus-taxes-saved-doc-btn--primary {
    background: var(--color-button-primary, #0e7c66);
    color: var(--color-button-primary-text, #fff);
    box-shadow: none;
    padding-inline: 14px;
}

.nucleus-taxes-saved-doc-btn--primary:hover {
    background: var(--color-button-primary-hover, #12a184);
}

.nucleus-taxes-saved-doc-btn--primary:active {
    background: var(--color-button-primary-active, #0b614f);
}

.nucleus-taxes-saved-doc-btn--icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 8px;
}

.nucleus-taxes-saved-doc-btn--icon svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

/* Иконки в таблице saved reports: без заливки по умолчанию, фон только hover / active */
.nucleus-taxes-saved-doc-btn--secondary {
    background: transparent;
    color: var(--color-text-primary, rgba(255, 255, 255, 0.92));
}

.nucleus-taxes-saved-doc-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.22);
}

.nucleus-taxes-saved-doc-btn--secondary:active {
    background: rgba(255, 255, 255, 0.14);
}

.nucleus-taxes-saved-doc-btn--danger {
    background: transparent;
    color: color-mix(in srgb, var(--color-error, #fb923c) 84%, #fff 16%);
}

.nucleus-taxes-saved-doc-btn--danger:hover {
    background: color-mix(in srgb, var(--color-error, #fb923c) 24%, rgba(255, 255, 255, 0.08));
}

.nucleus-taxes-saved-doc-btn--danger:active {
    background: color-mix(in srgb, var(--color-error, #fb923c) 34%, rgba(255, 255, 255, 0.06));
}

body.light-theme .nucleus-taxes-saved-doc-btn--secondary {
    background: transparent;
    color: rgba(0, 0, 0, 0.85);
}

body.light-theme .nucleus-taxes-saved-doc-btn--secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .nucleus-taxes-saved-doc-btn--secondary:active {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .nucleus-taxes-saved-doc-btn--danger {
    background: transparent;
    color: #c53030;
}

body.light-theme .nucleus-taxes-saved-doc-btn--danger:hover {
    background: rgba(255, 77, 77, 0.18);
}

body.light-theme .nucleus-taxes-saved-doc-btn--danger:active {
    background: rgba(255, 77, 77, 0.12);
}

@media (max-width: 720px) {
    .nucleus-taxes-saved-docs-table-scroll {
        overflow-x: auto;
    }

    .nucleus-taxes-saved-docs-table {
        min-width: 560px;
    }

    .nucleus-taxes-saved-docs-table tbody tr.nucleus-taxes-saved-docs-row td {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .nucleus-taxes-saved-docs-actions {
        white-space: normal;
    }

    .nucleus-taxes-saved-docs-actions-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nucleus-taxes-saved-doc-btn {
        padding: 7px 12px;
    }

    .nucleus-taxes-saved-doc-btn--icon {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        padding: 0;
    }
}

.nucleus-taxes-doc-edit-dialog {
    max-width: min(640px, 96vw);
    padding: 0;
    border: none;
    border-radius: 12px;
    background: var(--rv-surface, #1a1a1f);
    color: inherit;
}

.nucleus-taxes-doc-edit-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.nucleus-taxes-doc-edit-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nucleus-taxes-doc-edit-heading {
    margin: 0 0 8px;
    font-size: 1.125rem;
}

.nucleus-taxes-doc-edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
}

.nucleus-taxes-doc-edit-html {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    min-height: 200px;
    resize: vertical;
}

.nucleus-taxes-doc-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* -----------------------------------------------------------------------------
   Finance → Dashboard: усиленный селектор в конце файла (перебивает кеш/порядок).
   Зазор 16px между карточками — единый ритм Finance (Planner / Operations / Dashboard).
   ----------------------------------------------------------------------------- */
#nucleus-dashboard-container
    #nucleus-finance-island
    div#nucleus-tab-panel-dashboard.nucleus-main-tab-panel--dashboard {
    --nucleus-fin-dashboard-gap: 16px;
    gap: var(--nucleus-fin-dashboard-gap) !important;
    row-gap: var(--nucleus-fin-dashboard-gap) !important;
    column-gap: 0 !important;
}

@media (min-width: 768px) {
    #nucleus-dashboard-container
        #nucleus-finance-island
        div#nucleus-tab-panel-dashboard.nucleus-main-tab-panel--dashboard
        .nucleus-budget-insights-visual-main:not(.nucleus-ops-chart-visual-main) {
        --bi-left-col: 352px;
        --bi-gap: var(--spacing-xl) !important;
        column-gap: var(--spacing-xl) !important;
    }
}

/* -----------------------------------------------------------------------------
   Nucleus Controls Library (острова + дроверы)
   Единые токены и базовый визуал: select / input / checkbox / button.
   ----------------------------------------------------------------------------- */
#nucleus-dashboard-container,
#nucleus-financial-mirror-sidebar {
    --nucleus-control-height: 44px;
    --nucleus-control-radius: var(--nucleus-taxes-r-sm, 14px);
    --nucleus-control-bg: var(--color-bg-tertiary);
    --nucleus-control-bg-hover: var(--color-bg-secondary);
    --nucleus-control-fg: var(--color-text-primary);
    --nucleus-control-fg-muted: var(--color-text-tertiary);
    --nucleus-control-focus: var(--color-button-primary-focus);
}

/* Inputs: Taxes island + Taxes drawer */
#nucleus-dashboard-container .nucleus-taxes-profile .nucleus-taxes-profile-input,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input {
    min-height: var(--nucleus-control-height);
    height: var(--nucleus-control-height);
    border-radius: var(--nucleus-control-radius);
    background: var(--nucleus-control-bg) !important;
    border: none !important;
    color: var(--nucleus-control-fg);
    font-size: var(--font-size-sm);
    line-height: var(--nucleus-control-height);
}

#nucleus-dashboard-container .nucleus-taxes-profile .nucleus-taxes-profile-input:hover,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input:hover {
    background: var(--nucleus-control-bg-hover) !important;
}

#nucleus-dashboard-container .nucleus-taxes-profile .nucleus-taxes-profile-input:focus,
#nucleus-dashboard-container .nucleus-taxes-profile .nucleus-taxes-profile-input:focus-visible,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input:focus,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .nucleus-taxes-profile-input:focus-visible {
    outline: 2px solid var(--nucleus-control-focus);
    outline-offset: 2px;
    background: var(--nucleus-control-bg) !important;
}

/* Custom selects: Taxes island + Taxes drawer */
#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-select,
#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-select,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-select,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-select {
    min-height: var(--nucleus-control-height);
    height: var(--nucleus-control-height);
    border-radius: var(--nucleus-control-radius) !important;
    background: var(--nucleus-control-bg) !important;
    border: none !important;
    color: var(--nucleus-control-fg) !important;
    box-shadow: none !important;
}

#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-select:hover,
#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-select:hover,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-select:hover,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-select:hover {
    background: var(--nucleus-control-bg-hover) !important;
}

#nucleus-dashboard-container .nucleus-taxes-profile .invoice-currency-select .currency-value,
#nucleus-dashboard-container .nucleus-taxes-toolbar .invoice-currency-select .currency-value,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-profile .invoice-currency-select .currency-value,
#nucleus-sidebar-taxes-drawer-panel .nucleus-taxes-intro-drawer-clone .nucleus-taxes-toolbar .invoice-currency-select .currency-value {
    font-size: var(--font-size-sm);
    color: var(--nucleus-control-fg);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-segment-rail--toolbar
    .nucleus-transactions-sort-btn {
    height: var(--nucleus-control-height);
    min-height: var(--nucleus-control-height);
    padding: 0 14px;
    border-radius: var(--nucleus-ops-field-radius, 16px);
    border: none !important;
    background: var(--nucleus-ops-field-fill) !important;
    color: var(--color-text-secondary);
    box-shadow: none;
    position: relative;
    z-index: 1;
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-segment-rail--toolbar
    .nucleus-transactions-sort-btn:hover {
    background: var(--nucleus-ops-field-fill-hover) !important;
    color: var(--color-text-primary);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-segment-rail--toolbar
    .nucleus-transactions-sort-btn.is-active {
    background: var(--nucleus-ops-field-fill-hover) !important;
    color: var(--color-text-primary);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-text-primary) 10%, transparent) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-segment-rail--toolbar
    .nucleus-transactions-sort-btn:focus-visible {
    outline: 2px solid var(--nucleus-control-focus);
    outline-offset: 2px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-segment-rail--toolbar
    .nucleus-transactions-sort-btn--icon-only {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: var(--nucleus-ops-field-radius, 16px);
}

/* Buttons: compact control look */
#nucleus-dashboard-container .nucleus-transactions-import-btn,
#nucleus-dashboard-container .nucleus-transactions-export-btn,
#nucleus-financial-mirror-sidebar .nucleus-sidebar-primary-btn {
    min-height: 40px;
    border-radius: 12px;
}

/*
 * Operations: кастомный select — та же заливка что налоги в дровере; меню — отдельная карточка.
 */
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-filters
    .invoice-currency-wrapper.nucleus-ops-inline-select,
#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-currency
    .invoice-currency-wrapper.nucleus-ops-inline-select {
    display: block;
    width: auto;
    min-width: 0;
    max-width: 100%;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-filters
    .nucleus-transactions-groupby-wrap--inline:first-of-type
    .invoice-currency-wrapper.nucleus-ops-inline-select {
    min-width: 92px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-filters
    .nucleus-transactions-groupby-wrap--inline:nth-of-type(2)
    .invoice-currency-wrapper.nucleus-ops-inline-select {
    min-width: 104px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-currency
    .invoice-currency-wrapper.nucleus-ops-inline-select {
    min-width: 148px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    > select {
    display: none !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-select {
    min-height: var(--nucleus-control-height);
    height: var(--nucleus-control-height);
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px;
    border-radius: var(--nucleus-ops-field-radius, 16px) !important;
    background: var(--nucleus-ops-field-fill) !important;
    border: none !important;
    color: var(--color-text-primary) !important;
    font-weight: var(--font-weight-medium);
    box-shadow: none !important;
    transition: background-color 0.15s ease;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-select:hover {
    background: var(--nucleus-ops-field-fill-hover) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select.select-open
    .invoice-currency-select {
    background: var(--nucleus-ops-field-fill-hover) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-select:focus-visible {
    outline: 2px solid var(--nucleus-control-focus);
    outline-offset: 2px;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-select
    .currency-value {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-dropdown {
    left: 0;
    right: auto;
    width: 100%;
    min-width: max(100%, 12.5rem);
    max-width: min(360px, 92vw);
    z-index: 40;
    margin-top: 6px;
    border-radius: var(--radius-2xl) !important;
    border: none !important;
    background: color-mix(in srgb, var(--color-bg-primary) 92%, transparent) !important;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--color-text-primary) 8%, transparent),
        0 20px 48px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .nucleus-transactions-inline-currency
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-dropdown {
    min-width: max(100%, 14rem);
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select.select-open:not(.dropdown-open-up)
    .invoice-currency-select {
    border-radius: var(--nucleus-ops-field-radius, 16px) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-dropdown-inner {
    padding: 6px !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .currency-option {
    border-radius: var(--radius-lg);
    color: var(--color-text-primary) !important;
}

#nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .currency-option:hover {
    background: var(--nucleus-ops-field-fill-hover) !important;
}

body.light-theme
    #nucleus-dashboard-container
    .nucleus-finance-island
    .nucleus-main-tab-panel--operations
    .invoice-currency-wrapper.nucleus-ops-inline-select
    .invoice-currency-dropdown {
    background: color-mix(in srgb, var(--color-bg-primary) 96%, transparent) !important;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--color-text-primary) 10%, transparent),
        0 16px 40px rgba(0, 0, 0, 0.12);
}
