:root {
  --bg: #f6f4ee;
  --panel: #fffdf8;
  --ink: #1a1c20;
  --muted: #59606b;
  --line: #d8d4c8;
  --ok: #0f7a47;
  --warn: #b26a00;
  --bad: #b1122e;
  --oneoff: #2457a6;
  --mobile-nav-height: 78px;
  --focus-ring: #1f6fd6;
  --focus-ring-soft: rgba(31, 111, 214, 0.32);
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --surface-primary-bg: rgba(255, 255, 255, 0.86);
  --surface-secondary-bg: rgba(255, 255, 255, 0.68);
  --surface-tertiary-bg: rgba(248, 249, 252, 0.88);
  --screen-title-space-y: 0.25rem;
  --screen-title-space-bottom: 0.5rem;
  --surface-table-air-top: 0.5rem;
  --surface-table-air-bottom: 1rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #fefaf0, var(--bg) 40%);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(5px);
}
.topbar-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.56rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.topbar-center {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
}
.brand-block {
  text-align: center;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.02rem;
}
.brand-home-link {
  color: inherit;
  text-decoration: none;
}
.brand-home-link:hover,
.brand-home-link:focus-visible {
  text-decoration: none;
}
.brand-block h1 {
  margin: 0;
  font-size: 1.46rem;
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.brand-block .muted {
  margin-top: 0.08rem;
  font-size: 0.92rem;
  line-height: 1.05;
  opacity: 0.86;
}
.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 44px;
}
.sunshine-status-btn {
  border: 0;
  background: transparent;
  color: #334155;
  min-height: 56px;
  min-width: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.15rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.sunshine-status-btn:active {
  transform: scale(0.98);
}
.sunshine-status-glyph {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex: 0 0 auto;
}
.sunshine-status-glyph svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sunshine-status-btn:hover {
  background: transparent;
  box-shadow: none;
}
.sunshine-status-btn:focus-visible {
  background: transparent;
  box-shadow: 0 0 0 3px var(--focus-ring-soft);
}
.sunshine-status-btn.tone-ok {
  background: transparent;
}
.sunshine-status-btn.tone-warn {
  background: transparent;
}
.sunshine-status-btn.tone-bad {
  background: transparent;
}
.sunshine-status-btn.tone-loading,
.sunshine-status-btn.tone-muted {
  background: transparent;
}
.sunshine-status-btn[aria-expanded="true"] {
  background: transparent;
  box-shadow: none;
}
.sunshine-status-panel {
  position: fixed;
  top: 76px;
  left: 16px;
  width: min(420px, calc(100vw - 24px));
  border: 1px solid #d9deea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(18, 35, 62, 0.18);
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.5rem;
  z-index: 1300;
}
.sunshine-status-panel.hidden {
  display: none !important;
}
.sunshine-status-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.sunshine-status-panel-head h3 {
  margin: 0;
  font-size: 1.1rem;
}
.sunshine-status-alerts {
  display: grid;
  gap: 0.42rem;
}
.sunshine-status-alert-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
}
.sunshine-status-alert-text {
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
  color: #3e4552;
  line-height: 1.35;
}
.mke-sunshine-param-row {
  grid-template-columns: 1fr;
}
.mke-sunshine-param-row .sunshine-status-alert-text {
  color: var(--bad);
}
.mke-sunshine-param-row.is-achieved .sunshine-status-alert-text {
  color: var(--ok);
}
.sunshine-status-alert-empty {
  font-size: 0.94rem;
  color: #4d5768;
  border: 1px dashed #d7deea;
  border-radius: 10px;
  background: #f7faff;
  padding: 0.5rem 0.6rem;
}
h1 { margin: 0 0 0.2rem; font-size: 1.4rem; }
.muted { color: var(--muted); margin: 0; }

.sys-msg {
  margin-top: 0.45rem;
  padding: 0.42rem 0.58rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  line-height: 1.35;
}
.sys-msg.is-success {
  border-color: #a7d8be;
  background: #edf9f2;
  color: #0f7a47;
}
.sys-msg.is-warning {
  border-color: #e7c78d;
  background: #fff7ea;
  color: #8f5400;
}
.sys-msg.is-error {
  border-color: #e6a8b3;
  background: #fff0f3;
  color: #9d1029;
}

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1200;
  width: min(420px, calc(100vw - 24px));
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: start;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.app-toast.is-exit {
  transform: translateY(-5px);
  opacity: 0;
}
.app-toast.is-success {
  border-color: #a7d8be;
  background: #edf9f2;
}
.app-toast.is-warning {
  border-color: #e7c78d;
  background: #fff7ea;
}
.app-toast.is-error {
  border-color: #e6a8b3;
  background: #fff0f3;
}
.app-toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 700;
  margin-top: 1px;
}
.app-toast.is-success .app-toast-icon {
  color: #0f7a47;
}
.app-toast.is-warning .app-toast-icon {
  color: #8f5400;
}
.app-toast.is-error .app-toast-icon {
  color: #9d1029;
}
.app-toast-text {
  font-size: 0.86rem;
  line-height: 1.35;
}
.app-toast-close {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.2rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
}
.app-toast-close:hover,
.app-toast-close:focus-visible {
  background: rgba(0, 0, 0, 0.08);
}
.layout {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  grid-template-columns: repeat(12, 1fr);
}
body.mobile-shell .layout {
  padding-bottom: calc(var(--mobile-nav-height) + 1.2rem + env(safe-area-inset-bottom));
}
.view-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.mobile-bottom-nav {
  display: none;
}
.mobile-bottom-nav-btn {
  border: 1px solid #cad3e6;
  border-radius: 12px;
  background: #f4f7ff;
  color: #1f2a3a;
  min-height: 48px;
  padding: 0.5rem 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.1;
}
.mobile-bottom-nav-btn.is-primary {
  background: #1e5ec8;
  border-color: #1e5ec8;
  color: #fff;
}
.mobile-bottom-nav-btn.is-active {
  border-color: #1e5ec8;
  box-shadow: inset 0 0 0 1px #1e5ec8;
}
.mobile-bottom-nav-btn.is-primary.is-active {
  box-shadow: inset 0 0 0 1px #ffffff;
}
.desktop-only {
  display: inline-flex;
}
.mobile-only {
  display: none !important;
}
.view-nav button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.context-selector {
  position: relative;
  min-width: 0;
  --context-selector-width: 184px;
}
.context-selector-trigger {
  min-height: 44px;
  width: var(--context-selector-width);
  padding: 0.3rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #172133;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.22rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  box-shadow: none;
}
.context-selector:hover .context-selector-trigger,
.context-selector.is-open .context-selector-trigger {
  border-color: transparent;
  background: transparent;
  color: #111927;
  box-shadow: none;
}
.context-selector-trigger:focus-visible {
  border-color: #9cc1f3;
  background: #f7fbff;
  box-shadow: 0 0 0 3px var(--focus-ring-soft);
}
.context-selector-label {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-selector-caret {
  margin-left: 0.14rem;
  font-size: 0.84rem;
  color: #4d5a72;
  font-weight: 800;
  transition: transform 120ms ease;
}
.context-selector.is-open .context-selector-caret {
  transform: rotate(180deg);
}
.context-selector-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1200;
  width: var(--context-selector-width);
  border: 1px solid #c1ccdf;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  padding: 0.3rem;
  display: grid;
  gap: 0.16rem;
}
.context-selector-menu.hidden {
  display: none !important;
}
.context-selector-menu-title {
  margin: 0;
  padding: 0.34rem 0.48rem 0.22rem;
  color: #66758f;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.context-selector-option {
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.18rem;
  padding: 0.3rem 0.45rem;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.15;
  position: relative;
  text-align: left;
}
.context-selector-option:hover {
  border-color: #bfd0e8;
  background: #f6f9ff;
}
.context-selector-option:focus-visible {
  border-color: #9cc1f3;
  background: #f6f9ff;
  box-shadow: 0 0 0 3px var(--focus-ring-soft);
}
.context-selector-option.is-active {
  border-color: #d6dfec;
  background: #eef3fa;
  color: #111927;
}
.context-selector-option.is-active::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f7de4;
  transform: translateY(-50%);
}
.context-selector-option.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.context-option-label {
  display: inline-block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.context-option-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}
.context-option-kind {
  color: #66758f;
  font-size: 0.7rem;
  font-weight: 600;
}
.card {
  background: var(--surface-primary-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: var(--space-4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}
.card-panel { display: none; }
.layout.view-dashboard .card-dashboard { display: block; grid-column: 1 / -1; }
.layout.view-reports .card-mke-dashboard:not(.hidden) { display: block; grid-column: 1 / -1; }
.layout.view-reports .reporting-dashboard-panel:not(.hidden) { display: block; grid-column: 1 / -1; }
.card-dashboard {
  --dashboard-flow-gap: var(--space-4);
}
.layout.view-budgets .card-budgets { display: block; grid-column: 1 / -1; }
.budget-workspace-tabs { display: flex; gap: .35rem; margin: 0; }
.budget-workspace-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: .45rem .45rem 0 0; background: transparent; color: var(--muted, #637083); padding: .55rem .8rem; font-weight: 700; }
.budget-workspace-tabs button.is-active, .budget-workspace-tabs button[aria-selected="true"] { border-bottom-color: #557453; color: #355439; background: #f2f6f0; }
.budget-workspace-tabs button:focus-visible { outline: 3px solid rgba(57,119,200,.35); outline-offset: 2px; }
.budget-wallet-slot { display: flex; justify-content: flex-end; margin-left: auto; }
.budget-wallet-control { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.budget-wallet-control .budget-wallet-currency-select { width: 62px; min-height: 30px; font-size: .72rem; font-weight: 400; border-radius: 8px; }
.budget-workspace-nav { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 .75rem; border-bottom: 1px solid var(--line); }
.planned-income-execution { margin-top: 1rem; }
.planned-income-over { display: block; color: var(--muted); font-size: .72rem; margin-top: .25rem; }
.planned-income-execution-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.planned-income-drilldown { margin: 0; padding-left: 1.2rem; }
.card-budgets .budget-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.card-budgets .budget-kpi .kpi { min-height: 98px; padding: 13px 16px; }
.card-budgets .budget-kpi .kpi-head { display: block; }
.card-budgets .budget-kpi .value { margin-top: 5px; font-size: 1.35rem; line-height: 1.3; text-align: left; }
.card-budgets .budget-kpi .label { font-size: .86rem; color: var(--muted); }
.card-budgets .budget-kpi .subvalue { margin-top: 6px; font-size: .7rem; min-height: 1em; }
.card-budgets .budget-kpi .budget-kpi-negative { color: #a43c4c; background: #fdf7f8; border-color: #dec0c7; }
.card-budgets .budget-kpi-negative .label { color: #a43c4c; }
.card-budgets .budget-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: 0 0 .6rem; }
.card-budgets .budget-msg:empty, .planned-income-msg:empty, .planned-income-error:empty { display: none; }
.card-budgets #plannedIncomeKpi { display: none; }
.card-budgets #plannedIncomePanel { margin-top: 0; }
.card-budgets #plannedIncomePanel.hidden { display: none; }
.card-budgets #budgetReserveToggleBtn { display: none; }
.planned-income-editor { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(130px, 1.2fr) minmax(110px, 1fr) auto; gap: 12px; align-items: end; padding: 18px 0; }
.planned-income-editor label, .month-opening-wealth label { display: grid; gap: 6px; font-size: .82rem; color: var(--muted); }
.planned-income-editor input, .planned-income-editor select, .month-opening-wealth input { width: 100%; min-width: 0; }
.planned-income-editor .planned-income-error { grid-column: 1 / -1; margin: 0; }
.planned-income-editor-actions, .planned-income-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.planned-income-table .num { white-space: nowrap; }
.month-opening-wealth { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.month-opening-wealth p { grid-column: 1 / -1; margin: 0; }
.card-budgets .section-head { margin-bottom: 1rem; }
@media (max-width: 1000px) {
  .budget-workspace-nav { flex-wrap: wrap; gap: .4rem; }
  .budget-wallet-control { font-size: .7rem; }
  .budget-workspace-tabs button { padding: .55rem .55rem; }
  .planned-income-editor { grid-template-columns: 1fr 1fr; }
  .card-budgets .budget-kpi .value { font-size: 1.12rem; }
  .month-opening-wealth { grid-template-columns: 1fr; }
}
.layout.view-transactions .card-transactions-tools { display: block; grid-column: 1 / -1; }
.layout.view-transactions .card-transactions-list { display: block; grid-column: 1 / -1; }
.layout.view-settings .card-settings { display: block; grid-column: 1 / -1; }
body.mobile-shell .layout.view-transactions.mobile-flow-quick-add .card-transactions-list {
  display: none;
}
body.mobile-shell .layout.view-transactions.mobile-flow-triage #addTxnPanel {
  display: none !important;
}

.gear-link {
  border: 1px solid var(--line);
  background: #f2f5f9;
  color: #4e5561;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}
.gear-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateY(0);
}
.gear-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.gear-link:hover,
.gear-link:focus-visible {
  background: #e9f1fc;
  border-color: #b6c7de;
  color: #1f6fd6;
}
.gear-link:active {
  transform: scale(0.96);
}
.gear-link.is-active {
  color: #1f6fd6;
  background: #dfeeff;
  border-color: #a9c6f0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.section-title-inline {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
  flex-wrap: wrap;
}
.section-head h2,
.settings-head h2 {
  margin: 0;
  padding-top: var(--screen-title-space-y);
  padding-bottom: var(--screen-title-space-bottom);
  line-height: 1.16;
}
.month-nav {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.month-nav strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 7.5ch;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.month-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d8d4c8;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #4b5565;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}
.month-nav-btn:hover,
.month-nav-btn:focus-visible {
  border-color: #c9c2b3;
  background: rgba(255, 255, 255, 0.98);
  color: #202938;
  transform: translateY(-1px);
}
.month-nav-btn:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
}
.month-nav-btn span {
  display: block;
  transform: translateY(-0.06rem);
}
input,
select,
button,
textarea {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
button { cursor: pointer; font-weight: 600; }
button.secondary { background: #f2f5f9; }
button.secondary.is-active {
  background: #1f6fd6;
  color: #fff;
  border-color: #1f6fd6;
}
button.primary {
  background: #0f7a47;
  color: #fff;
  border-color: #0f7a47;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}
.dashboard-kpi {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-1);
  margin-bottom: 0;
}
.mke-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  /* Same gap as between the sections below it (owner 2026-08-06: keep
     spacing consistent across the whole dashboard, not just section+section
     -- this row is a <div>, not a <section>, so that rule alone missed it). */
  margin-bottom: var(--space-5);
}
.card-mke-dashboard .mke-sync-status-block {
  margin-top: var(--space-3);
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}
.card-mke-dashboard .mke-sync-status,
.card-mke-dashboard .mke-sync-status-row {
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0;
}
.mke-sync-status-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.mke-sync-refresh-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--ok);
  text-decoration: underline;
  cursor: pointer;
}
.mke-sync-refresh-btn:hover {
  opacity: 0.8;
}
.mke-sync-refresh-btn:disabled {
  cursor: default;
  opacity: 0.5;
  text-decoration: none;
}
.mke-exceptions-toggle-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--bad);
  text-decoration: underline;
  cursor: pointer;
}
.mke-exceptions-toggle-btn:hover {
  opacity: 0.8;
}
.mke-exceptions-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.mke-exceptions-list li {
  font-size: 0.75rem;
  color: var(--bad);
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--bad);
  border-radius: 8px;
  background: rgba(177, 18, 46, 0.06);
}
.card-mke-dashboard h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.card-mke-dashboard section + section {
  /* Owner request 2026-08-06: more breathing room between dashboard
     sections (Poziomy dojrzałości / Wynagrodzenia / Rozbicie kosztów). */
  margin-top: var(--space-5);
}
.mke-status-value {
  font-weight: 700;
}
.mke-status-value.status-green {
  color: var(--ok);
}
.mke-status-value.status-red {
  color: var(--bad);
}
.mke-maturity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.mke-maturity-list li {
  /* padding/border/radius/background come from the shared .kpi.kpi-compact
     classes now (owner 2026-08-06: consistent box spacing across the whole
     dashboard) -- this rule only sets the flex layout. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  flex: 1 1 0;
  min-width: 220px;
}
.mke-maturity-list .mke-maturity-heading {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  /* SFA177 reopen 2026-08-07: icon moved to the card's right edge (was
     bunched right next to "Poziom N") -- needs the full card width
     (parent li aligns children to flex-start, so this row is otherwise
     only as wide as its own content) for space-between to have room to
     push the icon over. */
  width: 100%;
  justify-content: space-between;
}
.mke-maturity-list .mke-maturity-icon {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
}
.mke-maturity-list li.is-achieved .mke-maturity-icon {
  color: var(--ok);
}
.mke-maturity-list li:not(.is-achieved) .mke-maturity-icon {
  color: var(--bad);
}
.mke-maturity-list .mke-maturity-level-num {
  /* Not bold (owner 2026-08-06): competed with the "Poziomy dojrzałości"
     section title for attention. */
  font-weight: 400;
}
.mke-maturity-list .mke-maturity-label {
  display: block;
  line-height: 1.4;
}
.mke-maturity-list .mke-maturity-hint-line {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.82rem;
}
.mke-streak-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}
.mke-streak-bar-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.mke-streak-bar-fill {
  /* Color comes from the shared .progress-bar.cover-ok/.cover-low gradient
     classes (owner 2026-08-06: blue while incomplete, green at target) --
     this rule only sets the track-fill geometry. */
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.mke-streak-bar-label {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 900px) {
  .mke-maturity-list {
    flex-direction: column;
  }
  .mke-maturity-list li {
    min-width: 0;
  }
}
.mke-comp-summary {
  font-size: 0.85rem;
  margin: 0;
}
.mke-compensation-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (max-width: 720px) {
  .mke-compensation-rows {
    grid-template-columns: 1fr;
  }
}
.mke-comp-card {
  /* SFA177 reopen 2026-08-07: containing block for the status icon below,
     pinned to the card's own corner regardless of whether this particular
     row has a subLine (missing-amount hint) or not. Extra bottom padding
     reserves room so the icon never overlaps the amount/subLine text. */
  position: relative;
  padding-bottom: 2.15rem;
}
.mke-comp-card .mke-comp-status-icon {
  /* Moved from inline-next-to-the-name (owner 2026-08-07 reopen: read as
     "clipped", especially the ✗) to the card's bottom-right corner, under
     the amount -- and sized to match "Poziomy dojrzałości"'s own
     .mke-maturity-icon exactly, instead of inheriting the surrounding
     .label's 1rem. */
  position: absolute;
  right: var(--space-3);
  bottom: 0.7rem;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--bad);
}
.mke-comp-card .mke-comp-status-icon.is-achieved {
  color: var(--ok);
}
.mke-comp-amount-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  text-align: left;
  display: block;
  width: 100%;
}
.mke-comp-amount-btn.value {
  width: auto;
  text-align: right;
}
.mke-comp-amount-btn:hover,
.mke-comp-amount-btn:focus-visible {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.mke-comp-card-editing {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.mke-comp-card-editing .mke-comp-name {
  font-weight: 600;
}
.mke-comp-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
  width: 100%;
}
.mke-comp-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.mke-comp-edit-field input {
  padding: 0.3rem 0.4rem;
}
.mke-cost-breakdown {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 0.75rem;
  margin: 0;
}
.mke-cost-breakdown dt {
  color: var(--muted);
}
.mke-cost-breakdown dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}
.mke-cost-breakdown dt.is-expandable {
  cursor: pointer;
  user-select: none;
}
.mke-cost-breakdown dt.is-expandable:hover {
  color: var(--text);
}
.mke-cost-breakdown .mke-cost-disclosure {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.7rem;
  color: #8f98a6;
  transition: transform 120ms ease;
}
.mke-cost-breakdown .mke-cost-disclosure.is-open {
  transform: rotate(180deg);
}
.mke-cost-breakdown dt.mke-cost-subrow,
.mke-cost-breakdown dd.mke-cost-subrow {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 400;
  padding-left: 0.75rem;
}
.mke-cost-subrow-amount-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.mke-cost-subrow-amount-btn:hover,
.mke-cost-subrow-amount-btn:focus-visible {
  color: var(--text);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
@media (max-width: 1300px) {
  #mkeKpiGrid.mke-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  #mkeKpiGrid.mke-kpi-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .mke-cost-breakdown {
    grid-template-columns: 1fr;
  }
  .mke-cost-breakdown dd {
    text-align: left;
    margin-bottom: 0.25rem;
  }
}
.kpi {
  padding: var(--space-3);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-secondary-bg);
}
.kpi.kpi-compact {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.kpi.kpi-action {
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.kpi.kpi-action:hover,
.kpi.kpi-action:focus-visible {
  border-color: #aebed8;
  box-shadow: 0 0 0 3px rgba(89, 123, 178, 0.12);
  transform: translateY(-1px);
}
.kpi .kpi-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}
.kpi .label {
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
}
.kpi-disclosure {
  display: inline-block;
  margin-left: 0.35rem;
  color: #8f98a6;
  font-size: 0.75rem;
  transform: translateY(-0.04rem);
}
.kpi-disclosure.is-open {
  transform: rotate(180deg) translateY(0.04rem);
}
.kpi .value {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0;
  white-space: nowrap;
  text-align: right;
}
.kpi .subvalue {
  margin: 0.28rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.kpi .subvalue .mke-decks-line-2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
/* SFA177 reopen 2026-08-07: second stacked line under mke-decks-line-2 --
   "Przychody"'s "Inne: X" (below "Sklep: X · +N% m/m"), and "Koszty"'s
   demo-deck microcopy (below its own %-only line). */
.kpi .subvalue .mke-decks-second-line {
  display: block;
  margin-top: 0.2rem;
}
/* "Koszty"'s demo-deck line only (owner 2026-08-07, live correction) --
   right-aligned under its own %-badge line above; "Przychody"'s "Inne: X"
   stays left, under "Sklep: X", so the two channel amounts still read as
   a list. */
.kpi .subvalue .mke-decks-second-line-right {
  text-align: right;
}
/* A m/m badge with nothing on its left ("Koszty", "Saldo" while in
   deficit) -- right-aligned on its own, same horizontal position as the
   right-hand half of mke-decks-line-2 above, without needing an empty
   flex sibling to push it there. */
.kpi .subvalue .mke-decks-meta-standalone {
  display: block;
  text-align: right;
}
.kpi .value-inline-split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.kpi .value-inline-secondary {
  font: inherit;
  white-space: nowrap;
}
.progress-wrap {
  margin-top: 0.25rem;
  background: #ece8db;
  border-radius: 99px;
  overflow: hidden;
  height: 8px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #93c5fd 0%, #60a5fa 55%, #3b82f6 100%);
}
.progress-bar.budget-ok {
  background: linear-gradient(90deg, #93c5fd 0%, #60a5fa 55%, #3b82f6 100%);
}
.progress-bar.over-budget {
  background: linear-gradient(90deg, #fda4af 0%, #ef4444 55%, #b91c1c 100%);
}
.progress-bar.cover-low {
  background: linear-gradient(90deg, #93c5fd 0%, #60a5fa 55%, #3b82f6 100%);
}
.progress-bar.cover-ok {
  background: linear-gradient(90deg, #86efac 0%, #4ade80 55%, #16a34a 100%);
}

@media (min-width: 981px) {
  #kpi.kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  #kpi.kpi-grid .kpi {
    padding: 0.75rem 0.8rem;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
}
.cash-exchange-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.allocation-form > label:not(.full) {
  grid-column: span 3;
}
.allocation-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
}
.allocation-search-row input,
.allocation-form select,
.allocation-form input {
  min-width: 0;
  width: 100%;
}
.card-transactions-tools {
  padding-bottom: var(--space-3);
}
.tx-tools-grid {
  display: contents;
}
.tx-tools-quick {
  display: flex;
  gap: var(--space-2);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.tx-tool-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-secondary-bg);
  padding: var(--space-4);
  min-height: 0;
}
.tx-panel {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-3);
  background: rgba(24, 26, 31, 0.34);
  backdrop-filter: blur(6px);
  z-index: 1180;
}
.tx-panel.hidden {
  display: none;
}
.tx-tool-drawer {
  width: min(620px, calc(100vw - (2 * var(--space-3))));
  max-height: min(760px, calc(100vh - (2 * var(--space-3))));
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.18);
  overflow: auto;
}
.tx-drawer-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-2);
}
.tx-drawer-close-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b7280;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}
.tx-drawer-close-icon:hover,
.tx-drawer-close-icon:focus-visible {
  background: rgba(148, 163, 184, 0.12);
  color: #111827;
}
body.tx-drawer-open {
  overflow: hidden;
}
.tx-tool-card h2 {
  margin-top: 0;
}
label { display: grid; gap: 0.25rem; font-size: 0.9rem; }
label input,
label select {
  width: 100%;
}
.full { grid-column: 1 / -1; }
.f-col-opis { grid-column: 1 / 4; }
.f-col-kwota { grid-column: 4 / 5; }
.f-col-waluta { grid-column: 5 / 6; }
.f-col-kurs { grid-column: 6 / 7; }
.f-col-miejsce { grid-column: 1 / 4; }
.f-col-kategoria { grid-column: 4 / -1; }
.f-col-data { grid-column: 1 / 4; }
.f-col-aktor { grid-column: 4 / 6; }
.f-col-budget-impact { grid-column: 4 / -1; align-self: end; justify-self: end; }
.actions { display: flex; gap: 0.6rem; }
.actions .primary { margin-left: auto; }
.f-col-kwota input,
.f-col-waluta select,
.f-col-kurs input {
  max-width: 160px;
}
.f-col-waluta select {
  max-width: 112px;
}
.f-col-kurs input {
  max-width: 140px;
}
.tx-cash-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #546070;
}
.f-select-readonly,
.f-input-readonly {
  border-color: var(--line);
  background: #fff;
}
.f-select-readonly:hover,
.f-input-readonly:hover {
  border-color: var(--line);
  background: #fbfbfd;
}
.import-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.import-card-head {
  display: grid;
  gap: 0.25rem;
}
.add-txn-card-head {
  margin-bottom: 0.55rem;
}
.tx-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.tx-card-title-row h2 {
  margin: 0;
}
.tx-write-scope-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  border: 1px solid #d3dfef;
  border-radius: 999px;
  background: #eef4fe;
  color: #23374f;
  font-size: 0.8rem;
  font-weight: 700;
  width: fit-content;
  padding: 0.22rem 0.6rem;
  margin: 0;
}
.import-card-head .muted {
  margin: 0;
  font-size: 0.84rem;
}
.cash-exchange-form .full {
  grid-column: 1 / -1;
}
@media (max-width: 760px) {
  .tx-card-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .cash-exchange-form {
    grid-template-columns: 1fr;
  }
}
.import-card h3 {
  margin: 0;
  font-size: 0.95rem;
}
.import-step {
  border: 1px solid #e2ddd1;
  border-radius: 10px;
  background: #fff;
  padding: 0.6rem;
}
.import-file-label {
  display: grid;
  gap: 0;
}
.import-file-label input[type="file"] {
  border: 1px dashed #c5cddd;
  border-radius: 8px;
  padding: 0.45rem;
  background: #f9fbff;
}
.import-toolbar {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
#importAnalyzeBtn {
  white-space: nowrap;
}
.import-file-info {
  min-height: 1rem;
  margin: 0;
  font-size: 0.82rem;
}
.import-profile-info {
  min-height: 1rem;
  margin: 0;
  font-size: 0.82rem;
  color: #4f6284;
}
.import-toolbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}
.import-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}
.import-report-summary {
  display: flex;
  gap: 0.32rem;
  flex-wrap: wrap;
}
.import-report-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid #d9deea;
  border-radius: 999px;
  background: #f7f9fd;
  padding: 0.16rem 0.48rem;
  font-size: 0.76rem;
  color: #2f3d57;
}
.import-mapping-wrap.hidden,
.import-preview-wrap.hidden,
.import-report.hidden,
.hidden {
  display: none !important;
}

.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: #fffdf8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.boot-loading.hidden {
  display: none !important;
}
.boot-loading-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  color: var(--ink);
}
.boot-loading-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid #e6ddc9;
  border-top-color: #f5b236;
  animation: boot-loading-spin 0.8s linear infinite;
}
@keyframes boot-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(20, 25, 33, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-gate.hidden {
  display: none !important;
}
.auth-gate-card {
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}
.auth-gate-card h2 {
  margin: 0;
}
.auth-gate-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.auth-gate-tabs .secondary.is-active {
  background: #1f6fd6;
  border-color: #1f6fd6;
  color: #fff;
}
.auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.auth-form label {
  margin: 0;
}
.auth-form .primary {
  grid-column: 1 / -1;
}
.auth-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}
.auth-panel {
  display: grid;
  gap: 0.55rem;
}
.auth-panel.hidden {
  display: none !important;
}
.auth-webauthn-btn {
  width: 100%;
}
.auth-legacy-fallback {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}
.auth-legacy-fallback summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
}
.auth-legacy-fallback .auth-form {
  margin-top: 0.5rem;
}
.auth-legacy-warning {
  font-size: 0.8rem;
}
.auth-gate-error {
  margin: 0;
  border: 1px solid #e6a8b3;
  border-radius: 8px;
  background: #fff0f3;
  color: #9d1029;
  padding: 0.42rem 0.56rem;
  font-size: 0.84rem;
}
.auth-gate-error.hidden {
  display: none !important;
}
.layout.auth-blocked {
  pointer-events: none;
  user-select: none;
  filter: blur(1px) grayscale(0.15);
}
.import-mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.import-preview-table th,
.import-preview-table td,
.import-errors-table th,
.import-errors-table td {
  font-size: 0.78rem;
  padding: 0.3rem 0.35rem;
}
.import-report {
  margin-top: 0;
  padding-top: 0.55rem;
}
.import-report-summary {
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
}

/* Desktop transactions table: MKE flow-type has its own column (like every
   other field) instead of being stacked inside the category cell -- a table
   built for single-line rows shouldn't grow a 3-control mini-form in one
   cell. Review-vs-confirmed status is communicated by tinting the whole row
   (row-unassigned, already used elsewhere in this table) rather than a
   text badge, so it stays a one-line cell like its neighbors. */
.tx-flow-type-cell {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  max-width: 100%;
}
.tx-flow-type-cell select {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.78rem;
}
.tx-flow-type-cell .tx-classification-person,
.tx-flow-type-cell .txm-classification-person {
  flex: 1 1 6rem;
}

/* Mobile triage cards are a vertically-stacked form by design (unlike the
   desktop table), so the original stacked layout + status badge is still
   the right shape there. */
.mke-tx-classification {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.4rem;
  min-width: 0;
  max-width: 100%;
}
.mke-tx-classification select {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  font-size: 0.78rem;
}
.mke-review-status {
  width: max-content;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff0d6;
  color: #754400;
}
.mke-tx-classification.is-confirmed .mke-review-status {
  background: #e4f4ea;
  color: #1d603d;
}

.table-wrap { overflow-x: auto; overflow-y: visible; }
.card-panel > .table-wrap {
  padding-top: var(--surface-table-air-top);
  padding-bottom: var(--surface-table-air-bottom);
}
.card-panel > .table-wrap:not(#txTableWrap)::after {
  content: "";
  display: block;
  height: 56px;
}
.dashboard-mobile-focus {
  display: none;
}
.dash-mobile-grid {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.dash-mobile-card {
  border: 1px solid #d7dde9;
  border-radius: 12px;
  background: #fff;
  padding: 0.6rem 0.68rem;
  display: grid;
  gap: 0.28rem;
}
.dash-mobile-card[role="button"] {
  cursor: pointer;
}
.dash-mobile-card[role="button"]:focus-visible {
  outline: 2px solid #1e5ec8;
  outline-offset: 2px;
}
.dash-mobile-priority {
  gap: 0.36rem;
  padding: 0.72rem;
}
.dash-mobile-priority-label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475569;
}
.dash-mobile-secondary {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.58rem;
}
.dash-mobile-card-compact {
  padding: 0.56rem 0.62rem;
}
.dash-mobile-card.is-critical {
  border-color: #e7b9b9;
  background: #fff4f4;
}
.dash-mobile-card.is-warning {
  border-color: #ebd4ad;
  background: #fff9ec;
}
.dash-mobile-card.is-review {
  border-color: #bfd0e8;
  background: #f5f9ff;
}
.dash-mobile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dash-mobile-title {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 700;
}
.dash-mobile-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.84rem;
}
.dash-mobile-values strong {
  font-size: 0.94rem;
}
.dash-mobile-budget-with-assumption {
  margin-left: auto;
}
.dash-mobile-linkhint {
  margin: 0;
  font-size: 0.76rem;
  color: #5b6678;
}
.tx-mobile-triage {
  display: none;
}
.tx-mobile-group {
  display: grid;
  gap: 0.55rem;
}
.tx-mobile-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.tx-mobile-group-head h3 {
  margin: 0;
  font-size: 0.93rem;
}
.tx-mobile-list {
  display: grid;
  gap: 0.5rem;
}
.tx-mobile-card {
  border: 1px solid #d7deea;
  border-radius: 12px;
  background: #fff;
  padding: 0.62rem;
  display: grid;
  gap: 0.46rem;
}
.tx-mobile-card.is-unassigned {
  border-color: #b8caea;
  background: #f4f8ff;
}
.tx-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.tx-mobile-amount {
  font-size: 1rem;
  font-weight: 700;
}
.tx-mobile-desc {
  margin: 0;
  font-size: 0.87rem;
  color: #2d3747;
  line-height: 1.32;
}
.tx-mobile-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #4e5c70;
}
.tx-mobile-meta-chip {
  border: 1px solid #d2daea;
  border-radius: 999px;
  background: #f6f9ff;
  padding: 0.14rem 0.45rem;
}
.tx-mobile-edit {
  display: grid;
  gap: 0.42rem;
}
.tx-mobile-actions {
  display: flex;
  gap: 0.38rem;
  flex-wrap: wrap;
}
.tx-mobile-empty {
  margin: 0;
  border: 1px dashed #d7deea;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.7rem;
  color: #50607a;
  font-size: 0.86rem;
}
.tx-section-head {
  margin-bottom: var(--space-3);
}
.tx-top-panel {
  border: 1px solid #e2ddd1;
  border-radius: 14px;
  background: var(--surface-secondary-bg);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  display: grid;
  gap: var(--space-2);
}
.tx-advanced-toggle-btn {
  display: none;
}
.tx-filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.55fr) repeat(4, minmax(120px, 1fr)) repeat(2, minmax(146px, 1.15fr));
  gap: var(--space-2);
  margin-bottom: 0;
  align-items: start;
  overflow-x: visible;
  padding-bottom: 0;
}
.tx-filters label,
.tx-filters button {
  min-width: 0;
}
.tx-filter {
  display: grid;
  grid-template-rows: 1.2em 44px;
  align-content: start;
  gap: 0.25rem;
  width: auto;
  min-width: 0;
}
.tx-filter input,
.tx-filter select {
  width: 100%;
  height: 44px;
  min-height: 44px;
}
.tx-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  flex-wrap: nowrap;
  overflow-x: visible;
  padding-bottom: 0;
}
.tx-mode-switch {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: var(--space-1);
}
.tx-pln-summary-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: 0 0 auto;
  min-width: 0;
  flex-wrap: nowrap;
}
.tx-pln-summary {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9fc;
  color: #2c3240;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.2rem 0.56rem;
  white-space: nowrap;
}
.tx-pln-summary-spent {
  background: #f8f9fc;
  border-color: #cfd6e4;
  color: #2c3240;
}
.tx-pln-summary-income {
  background: #f3faf6;
  border-color: #bddfca;
  color: #1d5e3d;
}
.tx-pln-summary-hint {
  display: none !important;
}
.tx-clear-btn {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: normal;
  font-size: 0.96rem;
  min-height: 44px;
  padding: 0.2rem 0;
}
.inline-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
}
table { width: 100%; border-collapse: collapse; }
.tx-table {
  table-layout: fixed;
  min-width: 1360px;
}
.tx-table .col-date { width: 8%; }
.tx-table .col-category { width: 12.5%; }
.tx-table .col-flow-type { width: 9%; }
.tx-table .col-recipient { width: 11%; }
.tx-table .col-desc { width: 15%; }
.tx-table .col-amount { width: 6.3%; }
.tx-table .col-currency { width: 4.5%; }
.tx-table .col-pln { width: 6.5%; }
.tx-table .col-actor { width: 3.4%; }
.tx-table .col-budget-month { width: 6%; }
.tx-table .col-context { width: 4.5%; }
.tx-table .col-impact { width: 4.8%; }
.tx-table .col-source { width: 3.8%; }
.tx-table .col-actions { width: 4.7%; }
th, td {
  padding: 0.34rem 0.28rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.81rem;
  vertical-align: middle;
  white-space: nowrap;
}
.tx-table thead th { white-space: nowrap; }
.tx-table th.tx-col-impact,
.tx-table td.tx-col-impact {
  padding-right: 0.22rem;
}
.tx-table th.tx-col-source,
.tx-table td.tx-col-source {
  text-align: center;
  padding-left: 0.04rem;
  padding-right: 0.04rem;
  min-width: 2.4rem;
}
.tx-table th.tx-col-impact,
.tx-table th.tx-col-source,
.tx-table th.actions-col {
  text-align: center;
}
.tx-table th.actions-col,
.tx-table td.actions-col {
  padding-left: 0.04rem;
  padding-right: 0.04rem;
}
.row-exceeded td {
  background: #fff1f1;
}
.row-exceeded td:first-child {
  box-shadow: inset 3px 0 0 #d96b6b;
}
.row-risk td {
  background: #fff9ef;
}
.row-risk td:first-child {
  box-shadow: inset 3px 0 0 #e0b870;
}
.row-unassigned td {
  background: #f5f8ff;
}
.row-unassigned td:first-child {
  box-shadow: inset 3px 0 0 #93b3e8;
}
.row-review td {
  background: #f8fbff;
}
.row-review td:first-child {
  box-shadow: inset 3px 0 0 #9eb7db;
}
.category-exceeded {
  color: #8f2323;
  font-weight: 600;
}
.dash-unassigned-label {
  color: #35598f;
  font-weight: 400;
}
.dash-unassigned-amount {
  color: #35598f;
  font-weight: 700;
}
.dash-unassigned-link {
  color: #35598f;
  font-weight: 400;
}
.cash-special-hint {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.74rem;
  color: #5f6673;
  white-space: nowrap;
}
.dash-cat-link {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.dash-cat-link:hover,
.dash-cat-link:focus-visible {
  text-decoration: underline;
}
.dash-cat-link.is-exceeded {
  font-weight: 700;
}
th { white-space: nowrap; }
.dash-sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: right;
  cursor: pointer;
}
.dash-sort-btn:hover,
.dash-sort-btn:focus-visible {
  text-decoration: underline;
}
.dash-sort-btn.is-active {
  font-weight: 700;
}
.num { text-align: right; }
.center { text-align: center; }
.mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #ccd4e2;
  background: #f8faff;
  color: #4169ab;
}
.mode-icon.mode-time {
  border-color: #b9cdee;
  background: #f4f8ff;
  color: #3b66ab;
}
.mode-icon.mode-oneoff {
  border-color: #e3cfaa;
  background: #fff8ec;
  color: #9a6800;
}
.mode-icon.mode-mixed {
  border-color: #cbb8d9;
  background: #faf5ff;
  color: #6a3f8a;
}
.mode-glyph {
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-0.25px);
}
.tx-cat-select {
  width: 100%;
  min-width: 0;
  font-size: 0.81rem;
  padding: 0.16rem 0.28rem;
}
.tx-currency-select {
  width: 100%;
  min-width: 0;
  font-size: 0.81rem;
  padding: 0.16rem 0.1rem;
}
.tx-context-select {
  text-align: center;
}
.tx-actor-select,
.tx-context-select,
.tx-budget-month-select,
.tx-impact-select {
  width: 100%;
  min-width: 0;
  font-size: 0.81rem;
  padding: 0.16rem 0.1rem;
}
.tx-cat-select.readonly {
  border-color: transparent;
  background: transparent;
}
.tx-cat-select.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.tx-cat-unassigned {
  font-weight: 800;
}
.tx-currency-select.readonly {
  border-color: transparent;
  background: transparent;
}
.tx-currency-select.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.tx-actor-select.readonly,
.tx-context-select.readonly,
.tx-budget-month-select.readonly,
.tx-impact-select.readonly {
  border-color: transparent;
  background: transparent;
}
.tx-actor-select.readonly:hover,
.tx-context-select.readonly:hover,
.tx-budget-month-select.readonly:hover,
.tx-impact-select.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.tx-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.08rem;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 60px;
}
.tx-actions .secondary {
  padding: 0.14rem 0.2rem;
  font-size: 0.66rem;
  line-height: 1.1;
  white-space: nowrap;
}
.tx-icon-btn {
  width: 21px;
  height: 21px;
  padding: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  flex: 0 0 auto;
}
.tx-icon-btn:hover {
  transform: translateY(-1px);
}
.tx-icon-btn:active {
  transform: translateY(0);
}
.tx-split.is-split-series,
.txm-split.is-split-series {
  border-color: #e6c97c;
  background: linear-gradient(180deg, #fff7de 0%, #ffeeba 100%);
  color: #8a5b00;
  box-shadow: inset 0 0 0 1px rgba(186, 136, 17, 0.08);
}
.tx-split.is-split-series:hover,
.tx-split.is-split-series:focus-visible,
.txm-split.is-split-series:hover,
.txm-split.is-split-series:focus-visible {
  border-color: #dbb451;
  background: linear-gradient(180deg, #fff3cf 0%, #ffe39b 100%);
  color: #7a4f00;
}
.tx-split.is-split-series:active,
.txm-split.is-split-series:active {
  background: #ffd97d;
}
.tx-split.is-split-series > span[aria-hidden="true"] {
  transform: scale(1.08);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tx-desc-input {
  width: 100%;
  min-width: 0;
  font-size: 0.81rem;
  padding: 0.22rem 0.28rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-recipient-input {
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 0.81rem;
  padding: 0.22rem 0.28rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-recipient-input.readonly {
  border-color: transparent;
  background: transparent;
}
.tx-recipient-input.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.tx-amount-input,
.tx-date-input {
  width: 100%;
  min-width: 0;
  font-size: 0.81rem;
  padding: 0.22rem 0.28rem;
}
.tx-amount-input {
  width: 10ch;
  max-width: 10ch;
  margin-left: auto;
  text-align: right;
}
.f-col-kwota input[type="number"],
.f-col-kurs input[type="number"],
.tx-amount-input {
  appearance: textfield;
  -moz-appearance: textfield;
}
.f-col-kwota input[type="number"]::-webkit-outer-spin-button,
.f-col-kwota input[type="number"]::-webkit-inner-spin-button,
.f-col-kurs input[type="number"]::-webkit-outer-spin-button,
.f-col-kurs input[type="number"]::-webkit-inner-spin-button,
.tx-amount-input::-webkit-outer-spin-button,
.tx-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.tx-amount-input.readonly,
.tx-date-input.readonly {
  border-color: transparent;
  background: transparent;
}
.tx-date-input.tx-offmonth-emphasis,
.tx-budget-month-select.tx-offmonth-emphasis {
  font-weight: 800;
}
.tx-amount-input.readonly:hover,
.tx-date-input.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.tx-desc-input.readonly {
  border-color: transparent;
  background: transparent;
}
.tx-desc-input.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  padding: 0.08rem 0.14rem;
  border-radius: 999px;
  line-height: 1;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}
.source-icon.source-import {
  background: rgba(31, 111, 214, 0.1);
  color: #1f6fd6;
}
.source-icon.source-import.source-bank-ing {
  background: rgba(230, 118, 22, 0.14);
  color: #d46a12;
}
.source-icon.source-import.source-bank-millennium {
  background: #f5dae6;
  color: #bd004f;
}
.source-icon.source-import.source-bank-revolut {
  background: rgba(31, 111, 214, 0.12);
  color: #1f6fd6;
}
.source-icon.source-manual {
  background: rgba(72, 85, 99, 0.12);
  color: #485563;
}
.source-icon.source-other {
  background: rgba(95, 102, 115, 0.1);
  color: #5f6673;
}
.tx-source-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.share-hint-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 111, 214, 0.16);
  background: rgba(31, 111, 214, 0.08);
  color: #1f6fd6;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.dashboard-share-chip {
  margin-left: 0.4rem;
}
.dash-mobile-share {
  margin: -0.15rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4f3ee;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
  white-space: nowrap;
}
.alert-badge.is-exceeded {
  font-weight: 800;
}
.alert-badge.is-risk {
  font-weight: 800;
}
.card-dashboard > .funding-mix-panel,
.card-dashboard > #dashboardImportReviewHint,
.card-dashboard > #dashboardMobileFocus,
.card-dashboard > #dashboardTableWrap {
  margin-top: var(--dashboard-flow-gap);
}
.card-dashboard > .dashboard-monitoring-panel {
  margin-top: 0.35rem;
}
.funding-mix-panel {
  margin-top: 0;
}
.funding-mix-section {
  display: grid;
  gap: 0.35rem;
}
.funding-mix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.funding-mix-titleblock h3 {
  margin: 0;
  font-size: 1rem;
}
.funding-mix-actions {
  display: flex;
  gap: 0;
  justify-content: flex-end;
}
.funding-mix-close {
  border: 0;
  background: transparent;
  color: #7f8793;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.funding-mix-table-wrap {
  padding-top: 0;
  padding-bottom: 0;
}
.funding-mix-table-wrap::after {
  height: 0;
}
.funding-mix-table {
  width: 100%;
}
.funding-mix-table tbody tr:first-child td {
  border-top-color: rgba(130, 123, 96, 0.24);
}
.funding-mix-link {
  display: flex;
  align-items: center;
  gap: 0;
  width: auto;
}
.funding-mix-table th.num,
.funding-mix-table td.num {
  text-align: right;
  white-space: nowrap;
}
.funding-mix-table td.num .funding-mix-link {
  justify-content: flex-end;
  width: 100%;
}
.funding-mix-table tbody td:nth-child(3) {
  color: var(--muted);
}
@media (max-width: 720px) {
  .funding-mix-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .funding-mix-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .funding-mix-link {
    width: 100%;
  }
}
.alert-badge.ok {
  color: #127445;
  border-color: #b7d7c4;
  background: #eef9f2;
}
.alert-badge.warn {
  color: #925700;
  border-color: #ebd4ad;
  background: #fff7e9;
}
.alert-badge.info {
  color: #2f5f9a;
  border-color: #bad0ef;
  background: #ecf4ff;
  font-weight: 800;
}
.alert-badge.inflow {
  color: #137247;
  border-color: #c7e4d2;
  background: #f0faf4;
  font-weight: 700;
}
.alert-badge.limit {
  color: #a52121;
  border-color: #e2b8b8;
  background: #fff0f0;
}
.alert-badge.critical {
  color: #860909;
  border-color: #d79b9b;
  background: #ffe3e3;
}
.alert-badge.none {
  color: #59606b;
}
.alert-badge-action {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;
}
.alert-badge-action:hover,
.alert-badge-action:focus-visible {
  transform: translateY(-1px);
}
.actions-col {
  width: auto;
  white-space: nowrap;
  text-align: right;
}
.tx-empty-row td {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 1.6rem 0.6rem;
}
.tx-bottom-spacer td {
  border-bottom: 0;
  padding: 0;
  height: 56px;
}
.tx-bottom-spacer.tx-bottom-spacer-large td {
  height: 110px;
}
.dash-empty-row td {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 1.1rem 0.6rem;
}
.budget-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.planned-income-panel { display: block; margin: 1.25rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.5); }
.planned-income-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.planned-income-head h3 { margin: 0 0 .25rem; }
.planned-income-head p { margin: 0; }
.planned-income-msg { min-height: 1.4em; }
.planned-income-kpi { margin: .75rem 0; }
.planned-income-rows { display: grid; gap: .5rem; }
.planned-income-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: .75rem; align-items: center; padding: .65rem .75rem; border-top: 1px solid var(--line); }
.planned-income-row small { display: block; color: var(--muted); }
.planned-income-amount { white-space: nowrap; }
.planned-income-actions { display: flex; gap: .4rem; }
.planned-income-error { color: var(--bad); }
.planned-income-modal-field { display: grid; gap: .25rem; margin: .65rem 0; font-weight: 600; }
.planned-income-modal-field input { width: 100%; box-sizing: border-box; }
.budget-head {
  display: flex;
  align-items: center;
  min-height: 30px;
}
.budget-head h2 {
  margin: 0;
}
.budget-head-line {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.budget-hero-month {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 700;
}
.dashboard-review-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.3;
}
.card-dashboard > #dashboardTableWrap {
  margin-top: var(--dashboard-flow-gap);
  padding-top: 0;
  padding-bottom: 0;
}
.card-dashboard > #dashboardTableWrap::after {
  height: 0;
}
.dashboard-monitoring-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.dashboard-monitoring-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  margin-bottom: 0.35rem;
  text-align: left;
}
.dashboard-monitoring-head h3 {
  margin: 0;
  font-size: 1rem;
}
.dashboard-monitoring-table {
  width: 100%;
}
.dashboard-monitoring-table tbody tr:first-child td {
  border-top-color: rgba(130, 123, 96, 0.24);
}
.dashboard-monitoring-mobile {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.dash-monitor-card {
  border-color: #d7dde9;
  background: #fbfcfe;
}
.dash-monitor-empty {
  color: var(--muted);
}
.budget-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.budget-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f5f7fa;
  color: #445066;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1;
  width: fit-content;
}
.budget-status-badge.is-finalized {
  border-color: #b7d7c4;
  background: #eef9f2;
  color: #127445;
}
.budget-status-badge.is-draft {
  border-color: #c8d2e2;
  background: #f2f6fd;
  color: #36557f;
}
.budget-reserve-wrap {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-secondary-bg);
}
.budget-reserve-head {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.budget-reserve-titleline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.budget-reserve-toggle {
  min-height: 44px;
  flex: 0 0 auto;
}
.budget-reserve-summary {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.budget-reserve-summary.has-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.budget-reserve-summary.is-placeholder {
  line-height: 1.35;
}
.budget-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  border: 1px solid #d8d4c8;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #445066;
  font-size: 0.86rem;
}
.budget-summary-chip-value {
  color: var(--ink);
  font-size: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.budget-summary-chip.is-total {
  border-color: #d1c9b8;
  background: rgba(255, 255, 255, 0.98);
}
.budget-summary-chip.is-total .budget-summary-chip-value {
  color: var(--ink);
  font-weight: 700;
}
.budget-carry {
  display: grid;
  gap: var(--space-3);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.month-opening-headline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.month-opening-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f5f7fa;
  color: #445066;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  width: fit-content;
}
.month-opening-status-badge.is-committed {
  border-color: #b7d7c4;
  background: #eef9f2;
  color: #127445;
}
.month-opening-status-badge.is-draft {
  border-color: #c8d2e2;
  background: #f2f6fd;
  color: #36557f;
}
.month-opening-status-badge.is-reopened {
  border-color: #e3cfaa;
  background: #fff8ec;
  color: #9a6800;
}
.month-opening-revision {
  font-size: 0.8rem;
  color: #546070;
  font-weight: 600;
}
.month-opening-blocks {
  display: grid;
  gap: var(--space-2);
}
.month-opening-table-toolbar {
  display: grid;
  gap: 0.6rem;
}
.month-opening-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.month-opening-toolbar-btn {
  min-height: 38px;
}
.month-opening-restore-strip {
  display: grid;
  gap: 0.38rem;
  border: 1px dashed #d9d4c8;
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.92);
  padding: 0.55rem 0.65rem;
}
.month-opening-restore-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6c5731;
}
.month-opening-restore-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}
.month-opening-restore-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.02rem;
  min-height: 0;
  padding: 0.45rem 0.62rem;
}
.month-opening-restore-btn small {
  font-size: 0.7rem;
  color: #6d7687;
}
.month-opening-table-wrap {
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.month-opening-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
}
.month-opening-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(250, 248, 242, 0.98);
  border-bottom: 1px solid #e2dccf;
  color: #5d6677;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
  padding: 0.7rem 0.55rem;
  white-space: normal;
  line-height: 1.18;
}
.month-opening-table tbody td {
  border-bottom: 1px solid #eee7da;
  padding: 0.46rem 0.5rem;
  vertical-align: middle;
  background: transparent;
}
.month-opening-table-row {
  --month-opening-row-bg: rgba(255, 255, 255, 0.96);
}
.month-opening-table-row.is-cash td {
  --month-opening-row-bg: rgba(252, 247, 237, 0.74);
  background: rgba(252, 247, 237, 0.74);
}
.month-opening-table-row.is-bank td {
  --month-opening-row-bg: rgba(247, 250, 255, 0.8);
  background: rgba(247, 250, 255, 0.8);
}
.month-opening-table-row.is-savings td {
  --month-opening-row-bg: rgba(250, 246, 252, 0.84);
  background: rgba(250, 246, 252, 0.84);
}
.month-opening-table-row.is-credit td {
  --month-opening-row-bg: rgba(244, 251, 247, 0.82);
  background: rgba(244, 251, 247, 0.82);
}
.month-opening-table tbody tr:last-child td {
  border-bottom: 0;
}
.month-opening-table-cell input,
.month-opening-table-cell select {
  width: 100%;
  min-height: 36px;
  padding: 0.4rem 0.5rem;
  font-size: 0.82rem;
}
.month-opening-table-cell-num {
  min-width: 124px;
}
.month-opening-table-cell-fx {
  min-width: 124px;
}
.month-opening-num-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.month-opening-table-cell-check {
  text-align: center;
}
.month-opening-table-cell-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}
.month-opening-table-cell-name {
  min-width: 190px;
}
.month-opening-table-cell-name input {
  font-weight: 600;
  color: var(--ink);
}
.month-opening-account-name {
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
}
.month-opening-table-cell-currency {
  min-width: 94px;
}
.month-opening-table-cell-type {
  min-width: 120px;
}
.month-opening-table thead th:nth-child(7),
.month-opening-table thead th:nth-child(8) {
  min-width: 110px;
}
.month-opening-table thead th:nth-child(9),
.month-opening-table thead th:nth-child(10) {
  min-width: 76px;
}
.month-opening-table-cell-actions {
  width: 44px;
  text-align: right;
}
.month-opening-table-cell-actions .month-opening-remove-icon {
  position: static;
  margin-left: auto;
}
.month-opening-toolbar-btn:disabled,
.month-opening-remove-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.month-opening-toolbar-btn:disabled:hover,
.month-opening-remove-icon:disabled:hover {
  border-color: transparent;
  background: transparent;
  color: inherit;
}
.month-opening-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #d8d4c8;
  background: rgba(255, 255, 255, 0.82);
  color: #4d5a6d;
  white-space: nowrap;
}
.month-opening-type-pill.is-cash {
  border-color: #e4c995;
  background: #fff4de;
  color: #8b5a00;
}
.month-opening-type-pill.is-bank {
  border-color: #c8d7ef;
  background: #eef5ff;
  color: #2c5d9e;
}
.month-opening-type-pill.is-savings {
  border-color: #ddc8e6;
  background: #f6effa;
  color: #74478f;
}
.month-opening-type-pill.is-credit {
  border-color: #c3dfca;
  background: #eef9f1;
  color: #0f7344;
}
.month-opening-table-note-row td {
  padding-top: 0;
  background: rgba(255, 255, 255, 0.96);
}
.month-opening-inline-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0 0.3rem;
}
.month-opening-inline-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  border: 1px solid #dde3ee;
  background: #f7faff;
  color: #42556f;
  font-size: 0.72rem;
  line-height: 1.25;
}
.month-opening-inline-note.is-ok {
  border-color: #bfe0cb;
  background: #eef8f2;
  color: #1d6846;
}
.month-opening-inline-note.is-bad {
  border-color: #e5b2bb;
  background: #fff1f4;
  color: #9e162b;
}
.month-opening-inline-note.is-info {
  border-color: #c8d9f0;
  background: #eff6ff;
  color: #2d5c98;
}
.month-opening-inline-note.is-muted {
  border-color: #ddd8ea;
  background: #f7f4fb;
  color: #65527b;
}
.month-opening-table-empty td {
  padding: 1rem 0.8rem;
  text-align: center;
  color: #677283;
  font-size: 0.82rem;
}
.month-opening-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: start;
}
.month-opening-block {
  border: 1px solid #ddd8cb;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  padding: 0.65rem;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.month-opening-block-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.month-opening-block-head h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6a7382;
  text-align: right;
}
.month-opening-block-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.22rem;
  border-top: 1px dashed #e6e1d6;
}
.month-opening-row {
  border-top: 1px solid #ece5d8;
  padding: 0.34rem 0 0.24rem;
  position: relative;
  display: grid;
  gap: 0.2rem;
}
.month-opening-row:first-of-type {
  border-top: 0;
  padding-top: 0.05rem;
}
.month-opening-row-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem 0.28rem;
  align-items: end;
  padding-right: 1.72rem;
}
.mo-field {
  gap: 0.08rem;
  font-size: 0.73rem;
  display: flex;
  flex-direction: column;
  align-items: start;
  min-width: 0;
  flex: 0 0 auto;
}
.mo-field input,
.mo-field select {
  min-height: 30px;
  padding: 0.28rem 0.42rem;
}
.mo-inline-edit,
.mo-inline-edit-select,
.mo-inline-soft,
.mo-inline-soft-select {
  border-color: #d7d1c3;
  background: #fff;
  box-shadow: none;
}
.mo-inline-edit:hover,
.mo-inline-edit:focus,
.mo-inline-edit-select:hover,
.mo-inline-edit-select:focus,
.mo-inline-soft:hover,
.mo-inline-soft:focus,
.mo-inline-soft-select:hover,
.mo-inline-soft-select:focus {
  border-color: #c3bba9;
  background: #fffdf8;
}
.mo-inline-soft,
.mo-inline-soft-select {
  border-style: dashed;
  background: var(--month-opening-row-bg, rgba(255, 255, 255, 0.96));
  color: var(--ink);
}
.mo-inline-static {
  border-color: #d7d1c3 !important;
  border-style: dashed !important;
  background: var(--month-opening-row-bg, rgba(245, 241, 233, 0.92)) !important;
  color: #6f7888 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  -webkit-text-fill-color: currentColor;
}
.mo-readonly {
  border-color: #d7d1c3 !important;
  border-style: dashed !important;
  background: var(--month-opening-row-bg, rgba(245, 241, 233, 0.92)) !important;
  color: #6f7888 !important;
  box-shadow: none !important;
  pointer-events: none;
  opacity: 1 !important;
  -webkit-text-fill-color: currentColor;
}
.mo-readonly:hover,
.mo-readonly:focus {
  border-color: #d7d1c3 !important;
  background: var(--month-opening-row-bg, rgba(245, 241, 233, 0.92)) !important;
}
.mo-readonly[type="checkbox"] {
  opacity: 0.8;
}
.is-month-opening-committed .month-opening-row input[readonly]:not(.mo-readonly),
.is-month-opening-committed .month-opening-row select[disabled]:not(.mo-readonly),
.is-month-opening-committed .month-opening-table input[readonly]:not(.mo-readonly),
.is-month-opening-committed .month-opening-table input[disabled]:not(.mo-readonly),
.is-month-opening-committed .month-opening-table select[disabled]:not(.mo-readonly) {
  border-color: #d7d1c3 !important;
  border-style: dashed !important;
  background: var(--month-opening-row-bg, rgba(245, 241, 233, 0.92)) !important;
  box-shadow: none !important;
  color: #6f7888 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: currentColor;
}
.is-month-opening-committed .month-opening-row input[readonly]:not(.mo-readonly):hover,
.is-month-opening-committed .month-opening-row input[readonly]:not(.mo-readonly):focus,
.is-month-opening-committed .month-opening-row select[disabled]:not(.mo-readonly):hover,
.is-month-opening-committed .month-opening-row select[disabled]:not(.mo-readonly):focus,
.is-month-opening-committed .month-opening-table input[readonly]:not(.mo-readonly):hover,
.is-month-opening-committed .month-opening-table input[readonly]:not(.mo-readonly):focus,
.is-month-opening-committed .month-opening-table input[disabled]:not(.mo-readonly):hover,
.is-month-opening-committed .month-opening-table input[disabled]:not(.mo-readonly):focus,
.is-month-opening-committed .month-opening-table select[disabled]:not(.mo-readonly):hover,
.is-month-opening-committed .month-opening-table select[disabled]:not(.mo-readonly):focus {
  border-color: #d7d1c3 !important;
  background: var(--month-opening-row-bg, rgba(245, 241, 233, 0.92)) !important;
}
.mo-field-name {
  flex: 0 1 176px;
}
.mo-field-name input {
  width: 100%;
  min-width: 144px;
  max-width: 188px;
  font-weight: 800;
  color: #161d29;
  letter-spacing: 0.01em;
}
.mo-field-name input::placeholder {
  font-weight: 600;
  color: #8b94a3;
}
.mo-field-currency {
  flex: 0 0 auto;
}
.mo-field-currency .mo-currency {
  width: 76px;
  min-width: 76px;
}
.mo-field-balance input {
  width: 11ch;
  min-width: 112px;
  max-width: 134px;
}
.mo-field-fx input {
  width: 10ch;
  min-width: 96px;
  max-width: 118px;
}
.mo-field-pln input {
  width: 11ch;
  min-width: 112px;
  max-width: 136px;
}
.mo-field-status select {
  width: 134px;
  min-width: 134px;
}
.mo-field-toggle {
  flex: 0 0 auto;
}
.month-opening-remove-icon {
  position: absolute;
  top: 0.14rem;
  right: 0.04rem;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border-radius: 999px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #8c94a3;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.month-opening-remove-icon:hover,
.month-opening-remove-icon:focus-visible {
  border-color: #d7deea;
  background: #f6f8fb;
  color: #505a6c;
}
.month-opening-flag {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  font-size: 0.74rem;
}
.month-opening-flag input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}
.month-opening-help {
  margin: 0;
}
.month-opening-help > summary {
  list-style: none;
  width: 18px;
  height: 18px;
  border: 1px solid #ccd4e3;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f6486;
  font-size: 0.69rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  background: #f4f8ff;
}
.month-opening-help > summary::-webkit-details-marker {
  display: none;
}
.month-opening-help-pop {
  margin-top: 0.16rem;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #42556f;
  border: 1px solid #dbe5f3;
  border-radius: 8px;
  background: #f8fbff;
  padding: 0.24rem 0.36rem;
  max-width: 320px;
}
.month-opening-empty {
  margin: 0;
  padding: 0.22rem 0 0.12rem;
  font-size: 0.78rem;
}
.month-opening-equation {
  margin: 0;
  font-size: 0.72rem;
  color: #49566d;
}
.month-opening-equation.is-bad {
  color: #9e162b;
}
.month-opening-equation.is-ok {
  color: #245e43;
}
.month-opening-credit-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #5a667a;
}
.month-opening-cash-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #355e7f;
}
.month-opening-savings-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #355e7f;
}
.month-opening-preview {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.month-opening-preview-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-1);
}
.month-opening-preview-kpi article {
  border: 1px solid #dde3eb;
  border-radius: 12px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  display: grid;
  gap: 0.16rem;
}
.month-opening-preview-kpi span {
  font-size: 0.76rem;
  color: #5a6578;
}
.month-opening-preview-kpi-value {
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.month-opening-preview-kpi article.is-total .month-opening-preview-kpi-value {
  font-weight: 700;
}
.month-opening-preview-table {
  display: grid;
  gap: 0;
  border: 1px solid #dfe4eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.month-opening-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.62rem 0.78rem;
  border-bottom: 1px solid #edf0f4;
  font-size: 0.82rem;
}
.month-opening-preview-row:last-child {
  border-bottom: 0;
}
.month-opening-preview-row-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
  color: var(--ink);
}
.month-opening-preview-row.is-account-total,
.month-opening-preview-row.is-account-total .month-opening-preview-row-value {
  font-weight: 700;
}
.month-opening-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.month-opening-actions-main {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-left: auto;
}
.month-opening-modal-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.month-opening-modal-field {
  display: grid;
  gap: 0.28rem;
}
.month-opening-modal-field input,
.month-opening-modal-field select {
  width: 100%;
  min-height: 38px;
}
.month-opening-modal-field span {
  font-size: 0.82rem;
  color: var(--muted);
}
.month-opening-modal-field-wide {
  grid-column: 1 / -1;
}
.month-opening-modal-check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  min-height: 36px;
  grid-column: 1 / -1;
  width: max-content;
  max-width: 100%;
  padding-top: 0.15rem;
}
.month-opening-modal-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}
.month-opening-modal-check span {
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--muted);
}
.month-opening-msg {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.35;
}
.budget-msg {
  min-height: 1rem;
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
}
.budget-msg:empty {
  display: none;
}
.budget-kpi {
  margin: 0 0 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-1);
}
.kpi-wallet-currency-value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.budget-wallet-currency-select {
  width: 100%;
  max-width: 180px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid #bfc8d8;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  padding: 0.3rem 0.52rem;
}
.kpi-wallet-currency.is-finalized .budget-wallet-currency-select {
  background: #f7f9fd;
  border-style: dashed;
  border-color: #b7c4dc;
  opacity: 0.94;
}
.budget-input {
  width: 11ch;
  max-width: 11ch;
  margin-left: auto;
  text-align: right;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
}
.budget-input.readonly {
  border-color: transparent;
  background: transparent;
}
.budget-input.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.budget-input-managed {
  pointer-events: none;
  cursor: default;
}
.budget-value-col {
  padding-right: 1rem;
}
.budget-row-actions {
  display: flex;
  width: 100%;
  justify-content: flex-end;
  gap: 0.25rem;
  flex-wrap: nowrap;
  align-items: center;
}
.budget-row-actions .secondary {
  padding: 0.22rem 0.34rem;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}
.budget-row-actions .tx-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.budget-row-actions .tx-icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}
.budget-actions-col {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-left: 0.65rem;
  padding-right: 0;
}
.budget-row-review-toggle {
  color: #9b7a14;
}
.budget-row-review-toggle.is-active {
  border-color: #9eb7db;
  background: linear-gradient(180deg, #edf4ff 0%, #dce9fb 100%);
  color: #2d5e97;
  box-shadow: inset 0 0 0 1px rgba(79, 122, 178, 0.08);
}
.budget-row-review-toggle.is-active:hover,
.budget-row-review-toggle.is-active:focus-visible {
  border-color: #86a7d3;
  background: linear-gradient(180deg, #e5f0ff 0%, #cfe2fb 100%);
}
.budget-row-review td {
  background: #f8fbff;
}
.budget-row-review td:first-child {
  box-shadow: inset 3px 0 0 #9eb7db;
}
.budget-spent-link {
  margin-left: auto;
}
.budget-managed-chip {
  margin-left: 0.35rem;
}
.budget-row-assumption {
  color: #7a7163;
}
.budget-row-assumption:hover,
.budget-row-assumption:focus-visible {
  border-color: #cbbf9e;
  background: #fff8e6;
  color: #6f5510;
}
.budget-row-assumption.is-empty {
  opacity: 0.68;
}
.budget-row-assumption.is-current {
  border-color: #d9c68b;
  background: #fff9e8;
  color: #7d6111;
}
.budget-row-assumption.is-carryover {
  border-color: #9eb7db;
  background: #edf4ff;
  color: #2d5e97;
}
.dashboard-budget-cell {
  white-space: nowrap;
}
.dashboard-assumption-head,
.dashboard-assumption-cell {
  width: 4.4rem;
  min-width: 4.4rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
}
.dashboard-assumption-cell .dashboard-assumption-chip {
  margin-inline: auto;
}
.dashboard-budget-with-assumption,
.dash-mobile-budget-with-assumption {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) 1.35rem;
  align-items: center;
  justify-content: flex-end;
  column-gap: 0.28rem;
}
.dashboard-budget-with-assumption {
  width: 100%;
}
.dashboard-budget-value {
  min-width: 0;
  text-align: right;
}
.dashboard-spent-with-income {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) 1.35rem;
  align-items: center;
  justify-content: flex-end;
  column-gap: 0.28rem;
  width: 100%;
}
.dash-mobile-values .dashboard-spent-with-income {
  width: auto;
}
.dashboard-assumption-chip {
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #7a7163;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  line-height: 0;
  opacity: 0.78;
}
.dashboard-assumption-chip:hover,
.dashboard-assumption-chip:focus-visible {
  background: rgba(122, 113, 99, 0.1);
  color: #4b5565;
  opacity: 1;
}
.dashboard-assumption-chip.is-carryover {
  color: #536f9d;
}
.budget-assumption-icon {
  width: 1.08rem;
  height: 1.08rem;
  display: block;
}
.dashboard-assumption-chip .budget-assumption-icon {
  width: 1rem;
  height: 1rem;
}
.budget-assumption-editor {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}
.budget-assumption-editor-note {
  margin: 0;
  padding: 0.65rem 0.72rem;
  border: 1px solid #bfd1ee;
  border-radius: 8px;
  background: #f2f7ff;
  color: #2d5e97;
  font-size: 0.88rem;
  line-height: 1.35;
}
.budget-assumption-textarea-label {
  display: block;
  font-weight: 400;
  color: var(--ink);
}
.budget-assumption-textarea {
  width: 100%;
  min-height: 10rem;
  max-height: min(42vh, 20rem);
  padding: 0.75rem 0.85rem;
  border-color: #d2cabd;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}
.budget-assumption-textarea:focus {
  outline: 3px solid rgba(31, 111, 214, 0.2);
  border-color: #2b72d6;
}
.budget-assumption-clear {
  border-color: #e0c2bd;
  background: #fff8f6;
  color: #8f2b1f;
}
.budget-assumption-clear:hover,
.budget-assumption-clear:focus-visible {
  border-color: #c9857d;
  background: #fff0ed;
  color: #711f16;
}
.budget-assumption-dismiss {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  padding: 0.52rem 0.6rem;
  border: 1px solid #e0dacd;
  border-radius: 8px;
  background: #fffdf8;
}
.budget-assumption-dismiss input {
  width: 1rem;
  height: 1rem;
}
.budget-prev {
  color: var(--muted);
}

.settings-grid {
  display: grid;
  gap: 0.8rem;
}
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.settings-head h2 {
  margin: 0;
}
.settings-version-inline {
  margin: 0;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  font-size: 0.8rem;
  line-height: 1.2;
}
.settings-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  background: #fff;
}
.settings-block-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  padding: 0.12rem 0;
  min-height: 44px;
  text-align: left;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}
.settings-block-header:hover .settings-toggle-icon {
  color: #1f6fd6;
}
.settings-toggle-icon {
  font-size: 0.95rem;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.settings-block-body {
  margin-top: 0.6rem;
}
.settings-block[data-settings-id="categories"],
.settings-block[data-settings-id="categories"] .settings-block-body,
.settings-block[data-settings-id="categories"] .table-wrap {
  overflow: visible;
}
.settings-block.is-collapsed .settings-block-body {
  display: none;
}
.settings-block.is-collapsed .settings-toggle-icon {
  transform: rotate(-90deg);
}
.settings-row {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.settings-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pwa-install-mode-hint {
  margin: 0.28rem 0 0;
  font-size: 0.82rem;
}
.pwa-install-guide {
  margin-top: 0.48rem;
  border: 1px dashed #cad7ec;
  border-radius: 10px;
  background: #f7fbff;
  padding: 0.58rem 0.66rem;
  display: grid;
  gap: 0.3rem;
}
.pwa-install-guide-title {
  margin: 0;
  color: #385273;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pwa-install-guide-list {
  margin: 0;
  padding-left: 1.08rem;
  display: grid;
  gap: 0.24rem;
}
.pwa-install-guide-list li {
  color: #223248;
  font-size: 0.84rem;
  line-height: 1.35;
}
.pwa-install-guide-note {
  margin: 0;
  font-size: 0.8rem;
  color: #4f6284;
}
.settings-mobile-cards {
  display: none;
}
.settings-mobile-card {
  border: 1px solid #d9deea;
  border-radius: 10px;
  background: #fafcff;
  padding: 0.62rem;
  display: grid;
  gap: 0.38rem;
}
.settings-mobile-card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}
.settings-mobile-card-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.6fr);
  gap: 0.42rem;
  align-items: start;
}
.settings-mobile-card-row dt {
  margin: 0;
  font-size: 0.76rem;
  color: #52627c;
}
.settings-mobile-card-row dd {
  margin: 0;
  font-size: 0.79rem;
  color: #1f2b3d;
  word-break: break-word;
}
.settings-mobile-mono {
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 0.75rem;
  line-height: 1.3;
}
.settings-mobile-card-actions {
  display: flex;
  gap: 0.42rem;
  flex-wrap: wrap;
}
.settings-mobile-card-actions .secondary {
  min-height: 44px;
}
.settings-inline-form {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.settings-inline-form > * {
  min-width: 0;
}
.auth-recovery-form {
  grid-template-columns: 1fr 1.4fr auto;
}
.csv-profile-create-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}
.csv-profile-list {
  display: grid;
  gap: 0.65rem;
}
.csv-profile-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.62rem;
}
.csv-profile-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.csv-profile-name-wrap {
  flex: 1 1 260px;
}
.csv-profile-active-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  white-space: nowrap;
}
.csv-profile-map-grid {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}
.csv-profile-map-field {
  font-size: 0.8rem;
}
.csv-profile-map-input,
.csv-profile-name {
  width: 100%;
}
.csv-profile-actions {
  margin-top: 0.62rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.36rem;
  flex-wrap: wrap;
}
.fx-inline-form {
  grid-template-columns: 1fr 1fr auto;
}
.fx-rate-row-status {
  font-size: 0.8rem;
  color: var(--muted);
}
.fx-rate-actions {
  display: inline-flex;
  gap: 0.3rem;
}
.fx-rate-actions .secondary {
  padding: 0.2rem 0.42rem;
  font-size: 0.74rem;
}
.fx-rate-input {
  width: 10ch;
  max-width: 10ch;
  text-align: right;
}
.settings-rule-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 1fr auto;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}
#newTagRuleForm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#newTagRuleForm #incomeRuleHelp { grid-column: 1 / -1; }
.settings-lexicon-form {
  grid-template-columns: minmax(12rem, 1.2fr) minmax(12rem, 1fr) minmax(9rem, 0.8fr) auto;
}
.settings-rule-filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.9fr 0.9fr auto;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}
.settings-rule-diagnostics {
  margin: 0 0 0.4rem;
}
.settings-rule-diagnostics summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.settings-rule-diagnostics-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}
.settings-guidance-row,
.settings-subsection-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.settings-guidance-row {
  margin: 0 0 0.65rem;
}
.settings-guidance-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f5663;
}
.settings-filter-summary {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.82rem;
}
.settings-rule-subsection {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.settings-rule-subsection h3 {
  margin: 0;
  font-size: 1rem;
}
.settings-row-highlight {
  animation: settings-row-highlight 2.2s ease-out;
}
.settings-subsection-title {
  margin: 0 0 0.5rem;
}
.settings-category-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}
.settings-category-toolbar-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 26rem;
  flex-wrap: wrap;
}
.settings-category-toolbar-main input[type="text"] {
  flex: 1 1 18rem;
  min-width: 14rem;
}
.settings-category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0 0.2rem;
  color: var(--muted);
  font-size: 0.84rem;
}
.settings-category-toggle input[type="checkbox"],
.settings-active-toggle-wrap input[type="checkbox"],
.category-matrix-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}
.category-create-panel {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
  padding: 0.9rem;
  border: 1px solid #e6ddcc;
  border-radius: 1rem;
  background: linear-gradient(180deg, #fffdf9 0%, #fff8ed 100%);
  box-shadow: 0 10px 28px rgba(80, 56, 14, 0.06);
}
.category-create-panel.hidden {
  display: none;
}
.category-create-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.category-create-panel-copy {
  display: grid;
  gap: 0.2rem;
}
.category-create-panel-copy h4 {
  margin: 0;
  font-size: 1rem;
}
.category-create-panel-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.category-create-name-row {
  display: grid;
}
.category-rules-matrix-host {
  min-width: 0;
}
.category-management-table-wrap {
  margin-top: 0.15rem;
  overflow: visible;
}
.category-management-table {
  width: 100%;
  min-width: 76rem;
  border-collapse: separate;
  border-spacing: 0;
  position: relative;
}
.category-management-table thead th {
  padding: 0.5rem 0.6rem 0.58rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid #e6e0d4;
  background: rgba(255, 251, 242, 0.92);
}
.category-management-table td {
  padding: 0.7rem 0.6rem;
  vertical-align: top;
  border-bottom: 1px solid #ece5d9;
  background: #fff;
}
.category-summary-row.is-expanded td {
  background: #fffdf8;
}
.category-empty-row td {
  color: var(--muted);
  padding: 1rem 0.6rem;
}
.category-empty-state {
  display: grid;
  gap: 0.38rem;
  justify-items: start;
}
.category-empty-state strong {
  color: #38404c;
}
.category-empty-state .secondary {
  margin-top: 0.15rem;
}
.category-name-cell {
  min-width: 18rem;
}
.category-row-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
}
.category-row-toggle:hover .settings-category-name,
.category-row-toggle:focus-visible .settings-category-name {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}
.category-row-toggle:focus-visible {
  outline: 2px solid #c4972f;
  outline-offset: 4px;
  border-radius: 0.7rem;
}
.category-row-toggle-icon {
  color: #8d7a50;
  font-size: 0.92rem;
  line-height: 1.2;
  margin-top: 0.15rem;
}
.category-row-toggle-copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}
.settings-category-name {
  font-weight: 700;
}
.settings-category-meta {
  margin-top: 0.02rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.category-summary-cell {
  display: grid;
  gap: 0.38rem;
  min-width: 11.5rem;
}
.category-summary-cell.is-hidden {
  gap: 0.25rem;
}
.category-summary-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  width: fit-content;
  padding: 0.26rem 0.56rem;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.category-summary-mode.mode-time {
  color: #6a4e00;
  background: #fff0bf;
}
.category-summary-mode.mode-oneoff {
  color: #0b5c55;
  background: #d8f5ef;
}
.category-summary-mode.mode-mixed {
  color: #5c4f86;
  background: #ece6ff;
}
.category-summary-mode-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
}
.category-summary-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}
.category-summary-chip,
.category-visibility-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid #e4dccd;
  background: #fff;
  color: #5c5c5c;
}
.category-summary-chip.is-funding {
  color: #7a4d00;
  background: #fff2d6;
  border-color: #f0d59d;
}
.category-summary-chip.is-ignore {
  color: #6d6f7b;
  background: #f2f4f7;
  border-color: #d8dee6;
}
.category-visibility-badge.is-visible {
  color: #245e35;
  background: #e1f5e5;
  border-color: #b9e1c2;
}
.category-visibility-badge.is-hidden {
  color: #7a7d86;
  background: #f3f4f6;
  border-color: #d9dce1;
}
.category-summary-muted {
  font-size: 0.74rem;
  color: var(--muted);
}
.category-status-cell {
  min-width: 8.5rem;
}
.settings-active-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.8rem;
  font-size: 0.83rem;
  color: var(--muted);
}
.settings-category-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.category-editor-row td {
  padding: 0 0.6rem 0.95rem;
  border-bottom: 1px solid #ece5d9;
  background: #fffdf9;
}
.category-editor-panel {
  display: grid;
  gap: 0.7rem;
  border: 1px solid #e7ddca;
  border-radius: 1rem;
  background: linear-gradient(180deg, #fffefb 0%, #fffaf1 100%);
  padding: 0.9rem;
  overflow: visible;
}
.category-editor-panel-head h4 {
  margin: 0 0 0.16rem;
  font-size: 1rem;
}
.category-editor-panel-head .muted {
  font-size: 0.79rem;
}
.category-editor-panel-copy {
  display: grid;
  gap: 0.42rem;
}
.category-alias-form {
  margin: 0;
}
.category-alias-field {
  display: grid;
  gap: 0.28rem;
}
.category-alias-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #6c5731;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.category-alias-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.category-alias-input {
  flex: 1 1 22rem;
  min-width: 14rem;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.62rem 0.72rem;
}
.settings-save-alias-btn {
  white-space: nowrap;
}
.category-rules-matrix {
  width: 100%;
  min-width: 44rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e7ddca;
  border-radius: 0.95rem;
  overflow: visible;
  background: #fff;
}
.category-rules-matrix thead th:first-child {
  border-top-left-radius: 0.95rem;
}
.category-rules-matrix thead th:last-child {
  border-top-right-radius: 0.95rem;
}
.category-rules-matrix thead th {
  background: #f8f1e5;
  color: #655739;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #eadfc9;
}
.category-rules-matrix tbody th,
.category-rules-matrix tbody td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #efe6d5;
  vertical-align: middle;
}
.category-rules-matrix tbody th {
  width: 9.8rem;
  font-size: 0.77rem;
  color: var(--muted);
  font-weight: 700;
  background: #fffdf8;
}
.category-rule-label {
  display: grid;
  gap: 0.34rem;
  align-items: start;
  min-width: 0;
}
.category-rule-label-head {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}
.settings-inline-help {
  position: relative;
  display: grid;
  justify-items: start;
  margin: 0;
}
.settings-inline-help[open] {
  z-index: 2;
}
.settings-inline-help > summary {
  list-style: none;
  width: 19px;
  height: 19px;
  border: 1px solid #d7ccb7;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7a6640;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  background: #fff7ea;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.settings-inline-help[open] > summary,
.settings-inline-help > summary:hover,
.settings-inline-help > summary:focus-visible {
  background: #fff0d8;
  border-color: #cdb48b;
  color: #6b5117;
}
.settings-inline-help > summary:focus-visible {
  outline: 2px solid #c4972f;
  outline-offset: 2px;
}
.settings-inline-help > summary::-webkit-details-marker {
  display: none;
}
.settings-inline-help-pop {
  margin-top: 0.34rem;
  width: min(21rem, 46vw);
  min-width: 13.5rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid #e4d4b7;
  border-radius: 0.85rem;
  background: #fffaf1;
  color: #454b57;
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(69, 53, 19, 0.08);
  overflow-wrap: anywhere;
}
.settings-rule-help {
  display: inline-grid;
}
.settings-rule-help-pop {
  width: min(34rem, 76vw);
}
.settings-rule-help-pop p {
  margin: 0 0 0.45rem;
}
.settings-rule-help-pop p:last-child {
  margin-bottom: 0;
}
.category-rules-matrix tbody tr:nth-last-child(-n+2) .settings-inline-help-pop {
  order: -1;
  margin-top: 0;
  margin-bottom: 0.34rem;
}
.category-rules-matrix tbody tr:last-child th,
.category-rules-matrix tbody tr:last-child td {
  border-bottom: 0;
}
.category-rules-matrix tbody tr:last-child th:first-child {
  border-bottom-left-radius: 0.95rem;
}
.category-rules-matrix tbody tr:last-child td:last-child {
  border-bottom-right-radius: 0.95rem;
}
.category-rules-matrix td.is-disabled {
  background: #f6f7f8;
}
.category-rules-matrix td.is-disabled .category-matrix-toggle span {
  color: #9097a2;
}
.category-rules-matrix select {
  width: 100%;
  min-width: 0;
}
.category-matrix-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2rem;
  font-size: 0.84rem;
  color: #40444d;
}
.category-matrix-toggle.is-compact {
  font-size: 0.8rem;
}
.settings-category-actions {
  display: flex;
  justify-content: flex-end;
}
.settings-delete-btn {
  padding: 0.22rem 0.44rem;
  font-size: 0.75rem;
  line-height: 1.1;
}
body.mobile-shell .settings-block[data-settings-id="api"],
body.mobile-shell .settings-block[data-settings-id="fx"],
body.mobile-shell .settings-block[data-settings-id="csv_profiles"],
body.mobile-shell .settings-block[data-settings-id="categories"],
body.mobile-shell .settings-block[data-settings-id="rules"] {
  display: none;
}
.tag-rule-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.tag-rule-actions .secondary {
  padding: 0.2rem 0.4rem;
  font-size: 0.74rem;
}
.tag-rule-quality {
  display: grid;
  gap: 0.22rem;
  min-width: 8.5rem;
}
.tag-rule-quality-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 1.45rem;
  padding: 0.12rem 0.46rem;
  border: 1px solid #d9dce1;
  border-radius: 999px;
  background: #f8fafc;
  color: #4d5562;
  font-size: 0.72rem;
  font-weight: 700;
}
.tag-rule-quality-badge.is-ok {
  border-color: #b9e1c2;
  background: #e1f5e5;
  color: #245e35;
}
.tag-rule-quality-badge.is-review {
  border-color: #f0d59d;
  background: #fff2d6;
  color: #7a4d00;
}
.tag-rule-quality-badge.is-risky {
  border-color: #efc4c0;
  background: #fff0ed;
  color: #8b2c1f;
}
.tag-rule-quality-note {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}
.tag-rule-pattern-input,
.tag-rule-field-select,
.tag-rule-type-select,
.tag-rule-category-select,
.tag-rule-active-select {
  width: 100%;
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.2rem 0.35rem;
}
.tag-rule-pattern-input.readonly,
.tag-rule-field-select.readonly,
.tag-rule-type-select.readonly,
.tag-rule-category-select.readonly,
.tag-rule-active-select.readonly {
  border-color: transparent;
  background: transparent;
}
.tag-rule-pattern-input.readonly:hover,
.tag-rule-field-select.readonly:hover,
.tag-rule-type-select.readonly:hover,
.tag-rule-category-select.readonly:hover,
.tag-rule-active-select.readonly:hover {
  border-color: var(--line);
  background: #fff;
}
.tag-rule-pattern-readonly {
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 28rem;
  overflow-wrap: anywhere;
}

@keyframes settings-row-highlight {
  0% {
    background: #fff5d6;
  }
  100% {
    background: transparent;
  }
}

@media (max-width: 1200px) {
  .settings-category-toolbar-main {
    width: 100%;
  }
  .category-management-table {
    min-width: 68rem;
  }
  .category-rules-matrix {
    min-width: 38rem;
  }
}

.app-modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 26, 31, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1200;
}
.app-modal.hidden {
  display: none;
}
.app-modal-card {
  width: min(480px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.22);
  padding: 1rem;
}
.app-modal-card.similar-suggestion-modal-card {
  width: min(940px, 100%);
}
.app-modal-card.atm-review-modal-card {
  width: min(860px, calc(100vw - 2rem));
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: 1.2rem;
}
.atm-review-modal-card .app-modal-details {
  max-height: none;
  overflow: visible;
  padding: 0.75rem;
}
.app-modal-card.budget-assumption-modal-card {
  width: min(620px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 1.15rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 1rem;
}
.budget-assumption-modal-card .app-modal-title {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font-size: 1.24rem;
  line-height: 1.18;
  margin: 0;
  overflow-wrap: anywhere;
}
.budget-assumption-modal-card .app-modal-message {
  grid-column: 2;
  grid-row: 1;
  align-self: baseline;
  justify-self: end;
  color: #4b5565;
  font-size: 1rem;
  white-space: nowrap;
}
.budget-assumption-modal-card .app-modal-details {
  grid-column: 1 / -1;
  margin-top: 0.85rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  max-height: none;
  overflow: visible;
}
.budget-assumption-modal-card .app-modal-input-wrap,
.budget-assumption-modal-card .app-modal-error {
  grid-column: 1 / -1;
}
.budget-assumption-modal-card .app-modal-actions {
  grid-column: 1 / -1;
  margin-top: 0.9rem;
}
.budget-assumption-modal-card .budget-assumption-clear {
  margin-right: auto;
}
.app-modal-title {
  margin: 0 0 0.4rem;
  font-size: 1.12rem;
}
.app-modal-message {
  margin: 0;
  color: var(--ink);
  white-space: pre-line;
}
.app-modal-details {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.95);
  padding: 0.55rem;
  max-height: 230px;
  overflow: auto;
}
.similar-suggestion-modal-card .app-modal-details {
  padding: 0.8rem;
  max-height: min(60vh, 560px);
}
.app-modal-details.hidden {
  display: none;
}
.import-scope-hint-box {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  line-height: 1.35;
}
.import-scope-hint-box strong {
  color: var(--ink);
}
.import-scope-hint-options {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.2rem;
}
.import-scope-hint-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.98rem;
  cursor: pointer;
}
.import-scope-hint-option input[type="radio"] {
  margin: 0;
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
}
.import-scope-hint-option span {
  display: inline;
  line-height: 1.3;
}
.similar-preview-title {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 700;
}
.similar-preview-note {
  margin: 0.18rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.similar-preview-shell {
  display: grid;
  gap: 0.7rem;
}
.similar-preview-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.similar-preview-summary {
  min-width: 0;
}
.similar-preview-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.similar-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.82rem;
  color: var(--ink);
}
.similar-preview-toggle input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
}
.similar-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.similar-preview-table th,
.similar-preview-table td {
  text-align: left;
  padding: 0.42rem 0.38rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  vertical-align: top;
}
.similar-preview-table th {
  color: var(--muted);
  font-weight: 600;
}
.similar-preview-table tbody tr {
  cursor: pointer;
}
.similar-preview-table tbody tr:hover {
  background: rgba(251, 191, 36, 0.08);
}
.similar-preview-cell-check {
  width: 4.6rem;
  text-align: center;
}
.similar-preview-table th.similar-preview-cell-check,
.similar-preview-table td.similar-preview-cell-check {
  text-align: center;
}
.similar-preview-table td.is-num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.similar-preview-row-checkbox {
  width: 0.95rem;
  height: 0.95rem;
}
.similar-preview-match-field {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.similar-preview-field-value {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
}
.similar-preview-field-value.is-empty,
.similar-preview-empty {
  color: var(--muted);
}
.similar-preview-mark {
  padding: 0 0.08rem;
  border-radius: 0.2rem;
  background: #fff2bf;
  color: inherit;
}
.similar-preview-more {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .similar-suggestion-modal-card {
    width: min(100%, 100%);
  }
  .similar-preview-table {
    min-width: 48rem;
  }
}
@media (max-width: 700px) {
  .app-modal {
    align-items: flex-start;
    padding: 0.8rem;
  }
  .app-modal-card.budget-assumption-modal-card {
    width: 100%;
    padding: 1rem;
  }
  .app-modal-card.atm-review-modal-card {
    width: 100%;
    max-height: calc(100vh - 1.6rem);
    padding: 1rem;
  }
  .budget-assumption-textarea {
    min-height: 10rem;
  }
  .app-modal-card.budget-assumption-modal-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .budget-assumption-modal-card .app-modal-message {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin-top: 0.15rem;
  }
  .budget-assumption-modal-card .app-modal-details {
    margin-top: 0.75rem;
  }
}
.app-modal-input-wrap {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.8rem;
}
.app-modal-input-wrap.hidden {
  display: none;
}
.app-modal-input-label {
  font-size: 0.86rem;
  color: var(--muted);
}
.app-modal-error {
  margin: 0.5rem 0 0;
  color: var(--bad);
  font-size: 0.82rem;
}
.app-modal-error.hidden {
  display: none;
}
.app-modal-actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.atm-review-box {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.1fr);
  gap: 0.9rem 1rem;
  align-items: start;
}
.atm-review-summary {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}
.atm-review-summary-row {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.84rem;
}
.atm-review-summary-row span {
  color: var(--muted);
}
.atm-review-summary-row strong {
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.atm-review-fields {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
.atm-review-field {
  display: grid;
  gap: 0.22rem;
}
.atm-review-field span {
  font-size: 0.82rem;
  color: var(--muted);
}
.atm-review-hint {
  grid-column: 2;
  margin: 0;
  font-size: 0.8rem;
  color: #516173;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .atm-review-box {
    grid-template-columns: minmax(0, 1fr);
  }
  .atm-review-summary-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }
  .atm-review-summary-row strong {
    text-align: left;
  }
  .atm-review-hint {
    grid-column: auto;
  }
}
.tx-split-modal-card {
  width: min(760px, 100%);
}
.tx-split-rows {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.8rem;
  max-height: 44vh;
  overflow: auto;
}
.tx-split-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.4fr auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
}
.tx-split-row label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.tx-split-row input,
.tx-split-row select {
  width: 100%;
}
.tx-split-row.is-primary {
  background: rgba(240, 242, 246, 0.95);
}
.tx-split-row.is-primary input,
.tx-split-row.is-primary select {
  pointer-events: none;
  border-color: var(--line);
  background: rgba(246, 248, 252, 1);
  color: rgba(17, 24, 39, 0.82);
}
.tx-split-row-spacer {
  display: block;
  width: 100%;
  min-height: 42px;
}
.tx-split-toolbar {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
}
.tx-split-totals {
  display: none;
}

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .month-nav {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-left {
    order: 1;
    width: 100%;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .topbar-center {
    display: none;
  }
  .view-nav {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .context-selector-trigger {
    min-height: 44px;
  }
  .context-selector-menu {
    width: var(--context-selector-width);
  }
  .topbar-right {
    order: 2;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.55rem;
    min-width: 0;
  }
  .topbar-tools {
    justify-content: flex-end;
  }
  .sunshine-status-btn {
    min-height: 60px;
    min-width: 60px;
    padding: 0.12rem;
  }
  .sunshine-status-glyph {
    width: 54px;
    height: 54px;
  }
  .sunshine-status-panel {
    width: min(420px, calc(100vw - 18px));
  }
  .form-grid { grid-template-columns: 1fr; }
  .tx-split-row {
    grid-template-columns: 1fr;
  }
  .tx-tools-grid { grid-template-columns: 1fr; }
  .tx-tool-card { min-height: 0; }
  .f-col-kwota,
  .f-col-waluta,
  .f-col-kurs,
  .f-col-opis,
  .f-col-kategoria,
  .f-col-miejsce,
  .f-col-data,
  .f-col-aktor,
  .f-col-budget-impact { grid-column: 1 / -1; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .tx-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tx-filter {
    min-width: 0;
  }
  .tx-filter-actions {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.42rem;
  }
  .tx-clear-btn {
    margin-left: auto;
  }
  .import-mapping-grid { grid-template-columns: 1fr; }
  .auth-form {
    grid-template-columns: 1fr;
  }
  .import-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .import-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .settings-rule-form { grid-template-columns: 1fr 1fr; }
  .settings-rule-filters { grid-template-columns: 1fr 1fr; }
  .fx-inline-form { grid-template-columns: 1fr 1fr; }
  .auth-recovery-form {
    grid-template-columns: 1fr;
  }
  .csv-profile-create-form {
    grid-template-columns: 1fr;
  }
  .settings-category-toolbar {
    align-items: stretch;
  }
  .settings-category-toolbar-main {
    width: 100%;
  }
  .settings-category-toolbar-main input[type="text"] {
    min-width: 100%;
  }
  .category-create-panel-head {
    flex-direction: column;
  }
  .category-create-panel-actions {
    width: 100%;
  }
  .category-create-panel-actions button,
  #toggleNewCategoryBtn {
    width: 100%;
  }
  .csv-profile-map-grid {
    grid-template-columns: 1fr;
  }
  .settings-head {
    align-items: flex-start;
  }
  .budget-reserve-head {
    align-items: flex-start;
  }
  .budget-toolbar {
    align-items: flex-start;
  }
  .month-opening-toolbar-actions {
    width: 100%;
  }
  .month-opening-toolbar-actions button {
    flex: 1 1 180px;
  }
  .month-opening-restore-buttons {
    width: 100%;
  }
  .month-opening-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .month-opening-preview-kpi {
    grid-template-columns: 1fr;
  }
  .month-opening-modal-grid {
    grid-template-columns: 1fr;
  }
  .month-opening-actions {
    align-items: stretch;
  }
  .month-opening-actions-main {
    width: 100%;
  }
  .month-opening-actions-main button,
  .month-opening-actions > button {
    width: 100%;
  }
  .tx-bottom-spacer td {
    height: 72px;
  }
  .tx-bottom-spacer.tx-bottom-spacer-large td {
    height: 140px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }
  body.tx-drawer-open {
    overflow: hidden;
  }
  button,
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea {
    min-height: 44px;
  }
  body.mobile-shell .desktop-only {
    display: none !important;
  }
  body.mobile-shell .mobile-only {
    display: inline-flex !important;
  }
  body.mobile-shell .settings-block[data-settings-id="storage_status"] .table-wrap,
  body.mobile-shell .settings-block[data-settings-id="security_auth"] .table-wrap {
    display: none;
  }
  body.mobile-shell .settings-mobile-cards {
    display: grid;
    gap: 0.5rem;
  }
  .sunshine-status-btn { min-height: 56px; min-width: 56px; }
  .sunshine-status-glyph { width: 48px; height: 48px; }
  .topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.64rem 0.72rem;
  }
  .topbar-left {
    width: auto;
    order: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.42rem;
  }
  .context-selector-trigger {
    min-height: 44px;
    width: 134px;
  }
  .context-selector-menu {
    width: 156px;
  }
  .sunshine-status-panel {
    width: calc(100vw - 18px);
  }
  .brand-block h1 {
    font-size: 1.2rem;
  }
  .brand-block .muted {
    font-size: 0.8rem;
  }
  .topbar-right {
    display: none;
  }
  .topbar-center {
    display: none;
  }
  .view-nav {
    display: none;
  }
  .tx-panel {
    padding: var(--space-2) var(--space-2) 0;
    align-items: flex-end;
  }
  .tx-tool-drawer {
    width: 100%;
    max-height: calc(100vh - var(--space-2));
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .allocation-form > label:not(.full) {
    grid-column: 1 / -1;
  }
  .allocation-search-row {
    grid-template-columns: 1fr;
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.38rem;
    padding: 0.46rem 0.56rem calc(0.46rem + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, 0.97);
    border-top: 1px solid #d8d7cd;
    backdrop-filter: blur(8px);
    z-index: 900;
  }
  .tx-filters {
    grid-template-columns: 1fr;
  }
  body.mobile-shell .tx-top-panel .tx-filter-advanced {
    display: none;
  }
  body.mobile-shell .tx-top-panel.is-mobile-advanced-open .tx-filter-advanced {
    display: block;
  }
  body.mobile-shell .tx-advanced-toggle-btn {
    width: 100%;
    justify-content: center;
  }
  .tx-filter {
    width: 100%;
    min-width: 0;
  }
  .tx-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .tx-mode-switch {
    width: 100%;
  }
  .tx-mode-switch button {
    flex: 1 1 160px;
  }
  .tx-clear-btn {
    margin-left: 0;
    width: fit-content;
  }
  .tx-pln-summary-wrap {
    width: 100%;
    order: 3;
    flex-wrap: wrap;
    row-gap: 0.32rem;
  }
  .tx-pln-summary {
    white-space: normal;
  }
  .settings-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-actions button {
    width: 100%;
  }
  .settings-inline-form {
    grid-template-columns: 1fr;
  }
  .settings-inline-form button {
    width: 100%;
  }
  .card {
    padding: 0.78rem;
  }
  .month-opening-table-wrap {
    margin-inline: -0.1rem;
  }
  .month-opening-table {
    min-width: 980px;
  }
  .month-opening-toolbar-actions {
    flex-direction: column;
  }
  .month-opening-toolbar-actions button,
  .month-opening-restore-btn {
    width: 100%;
  }
  .month-opening-restore-buttons {
    flex-direction: column;
  }
  .month-opening-inline-notes {
    flex-direction: column;
  }
  .month-opening-board {
    grid-template-columns: 1fr;
  }
  .month-opening-row-grid {
    padding-right: 1.45rem;
    gap: 0.2rem 0.22rem;
  }
  .month-opening-block-head {
    align-items: flex-start;
  }
  .month-opening-block-foot {
    justify-content: stretch;
  }
  .month-opening-block-foot .month-opening-add-btn {
    width: 100%;
  }
  .mo-field-currency {
    flex: 0 0 auto;
  }
  .mo-field-currency .mo-currency {
    width: 70px;
    min-width: 70px;
  }
  .mo-field-name {
    flex: 1 1 100%;
    max-width: none;
  }
  .mo-field-name input {
    min-width: 0;
    max-width: none;
  }
  .card-dashboard .month-nav .month-nav-btn,
  .card-dashboard .month-nav strong {
    opacity: 0.84;
  }
  .card-dashboard .month-nav .month-nav-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }
  .card-dashboard .month-nav strong {
    font-size: 0.92rem;
    min-height: 38px;
  }
  body.mobile-shell #dashboardMobileFocus {
    display: block;
  }
  body.mobile-shell #dashboardTableWrap {
    display: none;
  }
  body.mobile-shell #txTableWrap {
    display: none;
  }
  body.mobile-shell #txMobileTriage {
    display: grid;
    gap: 0.58rem;
  }
  .tx-tool-card label {
    font-size: 0.95rem;
  }
  .tx-tool-card input,
  .tx-tool-card select,
  .tx-tool-card button {
    min-height: 48px;
    font-size: 0.98rem;
  }
  .f-col-kwota { order: 1; }
  .f-col-kategoria { order: 2; }
  .f-col-data { order: 3; }
  .f-col-opis { order: 4; }
  .f-col-miejsce { order: 5; }
  .f-col-waluta { order: 6; }
  .f-col-kurs { order: 7; }
  .f-col-budget-impact { order: 8; justify-self: flex-start; }
  .actions { order: 9; }
  .actions .primary {
    margin-left: 0;
    width: 100%;
    min-height: 52px;
  }
  .f-col-kwota input,
  .f-col-waluta select,
  .f-col-kurs input {
    max-width: none;
  }
  .fx-inline-form { grid-template-columns: 1fr; }
}
/* SFA243: persistent server-confirmed profile marker. */
.view-as-banner { position: sticky; top: 0; z-index: 1000; padding: .65rem 1rem; background: #fff7ed; color: #7c2d12; border-bottom: 1px solid #fed7aa; text-align: center; }
body.admin-capability-hidden [data-admin-only],
body.view-as-active [data-view-as-hidden] { display: none !important; }

.reporting-dashboard-panel { min-width: 0; }
.rpt-head, .rpt-tools, .rpt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rpt-head { margin-bottom: 14px; }
.rpt-head h2 { margin: 0; font-size: 26px; }
.rpt-scope { color: var(--muted); font-size: 14px; }
.rpt-tools { padding: 9px 0; margin-bottom: 14px; border-block: 1px solid var(--line); flex-wrap: wrap; }
.rpt-tools .month-nav { display: flex; align-items: center; gap: 10px; }
.rpt-tools .month-nav strong { min-width: 132px; text-align: center; }
.rpt-tabs { display: flex; gap: 4px; }
.rpt-tabs button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--muted); padding: 8px 12px; }
.rpt-tabs button[aria-pressed="true"] { color: white; background: #1f6fd6; border-color: #1f6fd6; }
.rpt-quality { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border: 1px solid #cfb77f; background: #fff8e9; border-radius: 10px; font-size: 14px; }
.rpt-quality > span { padding: 4px 0; }
.rpt-quality summary { cursor: pointer; color: #175bad; padding: 4px 0; }
.rpt-quality ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
.rpt-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.rpt-kpis article { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-height: 105px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.rpt-kpis span { color: var(--muted); font-size: 15px; }
.rpt-kpis strong { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rpt-kpis small { font-size: 14px; color: var(--muted); }
.rpt-kpis .rpt-negative { background: #fff7f8; border-color: #dca8b2; }
.rpt-negative strong, .rpt-negative > span { color: var(--bad); }
.rpt-main-grid, .rpt-year-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.rpt-lower-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rpt-panel { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.rpt-panel h3, .rpt-category-dialog h3 { margin: 0 0 8px; font-size: 19px; }
.rpt-panel p { font-size: 14px; line-height: 1.5; }
.rpt-panel-head { align-items: start; }
.rpt-panel-head select { min-height: 44px; font-size: 14px; width: auto; max-width: 140px; }
.rpt-muted { color: var(--muted); }
.rpt-empty { color: var(--muted); padding: 28px 0; }
.rpt-chart-caption { margin: 4px 0 0; font-size: 14px !important; }
.rpt-bar-chart, .rpt-stock-chart { display: block; width: 100%; margin-top: 10px; overflow: visible; }
.rpt-bar-chart text, .rpt-stock-chart text { font-size: 14px; fill: var(--muted); }
.rpt-bar { fill: #3977c8; }
.rpt-bar.partial { fill: #729ad2; stroke: #3063a7; stroke-width: 1; stroke-dasharray: 4 2; }
.rpt-bar.refund { fill: #478665; stroke: #306544; }
.rpt-axis { stroke: #9c9e96; }
.rpt-grid-line { stroke: #e5e1d7; }
.rpt-stock-line { fill: none; stroke: #3977c8; stroke-width: 3; }
.rpt-stock-dot { fill: #3977c8; }
.rpt-stock-line.forecast { stroke-dasharray: 7 5; }
.rpt-stock-dot.forecast { fill: white; stroke: #3977c8; stroke-width: 2; }
.rpt-bar.forecast { fill: #b8cee7; stroke: #3977c8; stroke-width: 1; stroke-dasharray: 4 3; }
.rpt-year-grid.rpt-without-wealth, .rpt-lower-grid.rpt-without-wealth { grid-template-columns: 1fr; }
.rpt-kpis.rpt-kpis-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rpt-chart-data, .rpt-assumptions { margin-top: 8px; font-size: 14px; }
.rpt-chart-data summary, .rpt-assumptions summary { cursor: pointer; color: #175bad; font-weight: 600; min-height: 44px; padding: 12px 0; }
.rpt-chart-data table, .rpt-assumptions table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-chart-data caption { text-align: left; color: var(--muted); padding-bottom: 8px; }
.rpt-chart-data th, .rpt-chart-data td, .rpt-assumptions th, .rpt-assumptions td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rpt-chart-data td:nth-child(2), .rpt-assumptions td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rpt-table-scroll { max-width: 100%; overflow-x: auto; }
.rpt-category-row { width: 100%; min-height: 54px; padding: 10px 0; border: 0; border-top: 1px solid #e5e1d7; border-radius: 0; background: white; color: var(--ink); display: flex; justify-content: space-between; gap: 10px; text-align: left; }
.rpt-category-row:hover { background: #f6f4ee; }
.rpt-category-row > span { display: flex; gap: 8px; align-items: center; }
.rpt-category-row i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rpt-category-row b { text-align: right; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rpt-category-row small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.rpt-text-button { border: 0; background: transparent; color: #175bad; text-decoration: underline; font-weight: 600; padding: 10px 0; min-height: 44px; }
.rpt-fund-row { margin: 14px 0; font-size: 14px; }
.rpt-fund-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rpt-fund-row b { font-variant-numeric: tabular-nums; }
.rpt-fund-track { height: 10px; background: #eeeae0; border-radius: 10px; overflow: hidden; }
.rpt-fund-track i { display: block; height: 100%; border-radius: 10px; }
.rpt-year-end { font-size: 28px !important; font-weight: 700; margin: 8px 0; }
.rpt-wealth > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #e5e1d7; font-size: 14px; }
.rpt-wealth small { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.rpt-wealth b { white-space: nowrap; }
.rpt-wealth .rpt-total { font-size: 17px; font-weight: 700; }
.rpt-category-dialog { width: min(800px, calc(100vw - 32px)); max-height: 90vh; border: 1px solid var(--line); border-radius: 16px; padding: 24px; color: var(--ink); background: white; box-shadow: 0 18px 60px #0005; }
.rpt-category-dialog::backdrop { background: #20222599; }
.rpt-category-dialog h2 { margin: 0 45px 8px 0; }
.rpt-dialog-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 8px; font-size: 24px; background: #f6f4ee; color: var(--ink); }
.rpt-dialog-total { font-size: 24px; font-weight: 700; margin: 10px 0 20px; }
.rpt-dialog-total small { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); font-weight: 400; }
.rpt-transactions > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #e5e1d7; font-size: 14px; }
.rpt-transactions span { overflow-wrap: anywhere; min-width: 0; }
.rpt-transactions small { display: block; color: var(--muted); margin-bottom: 4px; }
.rpt-transactions b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rpt-category-dialog summary:focus-visible, .reporting-dashboard-panel summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.reporting-error { padding: var(--space-3); }

@media (max-width: 1100px) {
  .rpt-main-grid, .rpt-year-grid, .rpt-lower-grid { grid-template-columns: 1fr; }
  .rpt-fund-row > div:first-child { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .rpt-head { align-items: start; flex-direction: column; gap: 5px; }
  .rpt-tools { justify-content: center; }
  .rpt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-panel { padding: 16px; }
  .rpt-panel-head { flex-wrap: wrap; gap: 8px; }
  .rpt-wealth > div { flex-wrap: wrap; }
}
