@font-face {
  font-family: "Comfortaa";
  src: url("assets/fonts/comfortaa-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f8fafc;
  --ink: #16233b;
  --muted: #5c6780;
  --line: #e1e7ee;
  --panel: #ffffff;
  --accent: #007a78;
  --accent-2: #0c8a60;
  --danger: #b42318;
  --soft-teal: #e9f7f5;
  --soft-orange: #fff0e4;
  --soft-purple: #f0eafb;
  --shadow: 0 16px 36px rgba(22, 35, 59, .06);
  --text-sm: 14px;
  --text-base: 15px;
  --text-md: 16px;
  --text-h3: 16px;
  --text-h2: 18px;
  --text-h1: 22px;
  --text-title: 30px;
  --text-normal: var(--text-base);
  --text-small: var(--text-sm);
  --title-page: 30px;
  --title-1: var(--text-h1);
  --title-2: var(--text-h2);
  --title-3: var(--text-h3);
  --line-height: 1.38;
  --line-height-compact: 1.25;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Mobile hardening: no horizontal layouts on phone-sized screens. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body,
  .app-shell,
  .content,
  .view,
  .panel,
  .dashboard-grid,
  .summary-grid,
  .account-dashboard-grid,
  .split,
  .two-column,
  .account-layout,
  .savings-layout,
  .klarna-layout,
  .transfer-layout,
  .variable-detail-layout,
  .recurring-plan-layout,
  .recurring-layout {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .app-shell {
    display: block !important;
    width: 100% !important;
  }

  .sidebar {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .brand {
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) 56px !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .brand > div:nth-child(2) {
    min-width: 0 !important;
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
    justify-self: end !important;
  }

  .sidebar:not(.nav-open) .nav {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
  }

  .sidebar.nav-open .nav {
    display: grid !important;
    width: 100% !important;
    max-height: calc(100dvh - 96px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 12px 0 4px !important;
    margin: 12px 0 0 !important;
    border-top: 1px solid var(--line) !important;
    visibility: visible !important;
  }

  .content {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 18px 14px 110px !important;
  }

  .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 0 16px !important;
  }

  .topbar h1 {
    font-size: clamp(28px, 9vw, var(--text-title)) !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere !important;
  }

  .month-picker,
  .inline-month-picker {
    width: min(260px, calc(100% - 16px)) !important;
    max-width: calc(100% - 16px) !important;
    justify-self: start !important;
  }

  .month-picker input,
  .inline-month-picker input,
  .inline-month-picker select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-self: start !important;
    text-align: left !important;
    padding-right: 34px !important;
  }

  .panel {
    padding: 16px !important;
    border-radius: 10px !important;
  }

  .panel-heading,
  .panel-action-heading,
  .panel-filter-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
  }

  .statement-controls {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
  }

  .statement-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .statement-day-heading {
    font-size: var(--text-md) !important;
  }

  .statement-movement {
    grid-template-columns: 42px minmax(0, 1fr) !important;
    grid-template-areas:
      "initial main"
      ". amount";
    gap: 7px 10px !important;
    align-items: start !important;
    padding: 12px !important;
  }

  .statement-initial {
    grid-area: initial !important;
    width: 38px !important;
    height: 38px !important;
  }

  .statement-movement-main {
    grid-area: main !important;
  }

  .statement-movement-main strong {
    font-size: var(--text-md) !important;
  }

  .statement-movement-main small {
    font-size: var(--text-sm) !important;
  }

  .statement-amount {
    grid-area: amount !important;
    justify-self: end !important;
    font-size: var(--text-md) !important;
  }

  .action-row,
  .header-actions,
  .category-actions,
  .panel-action-row {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .primary-button,
  .secondary-button,
  .button-like {
    max-width: 100% !important;
    white-space: normal !important;
  }

  .form-row,
  .form-row.even,
  .form-row.transfer-row,
  .package-split-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
  }

  label,
  input,
  select,
  textarea,
  .money-input {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .money-input {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  .money-input.signed-money-input {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }

  .money-input:focus-within {
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(33, 132, 128, 0.16) !important;
  }

  .money-input input {
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
  }

  .money-input span {
    min-width: 28px !important;
    text-align: center !important;
    border-left: 0 !important;
  }

  .money-input .amount-sign {
    min-width: 24px !important;
    padding-left: 10px !important;
    padding-right: 0 !important;
  }

  .edit-modal {
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 8px !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
  }

  .edit-modal-panel {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 16px) !important;
    margin: 8px auto !important;
    padding: 20px 14px 18px !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    border-radius: 14px !important;
  }

  #editModalContent {
    max-height: calc(100dvh - 54px) !important;
  }

  #editModalContent,
  #editModalContent * {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .modal-form input[type="date"],
  .modal-form input[type="month"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .modal-form,
  .modal-form .form-row,
  .modal-form .form-row.even,
  .modal-form .form-row.transfer-row,
  .modal-form .package-split-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .modal-close {
    top: 0 !important;
    right: 12px !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .modal-title,
  .edit-modal h2,
  #editModalContent h2 {
    padding-right: 54px !important;
    overflow-wrap: anywhere !important;
  }

  .table-row,
  .variable-table-row,
  .recurring-plan-row,
  .recurring-table-row,
  .category-row,
  .account-item,
  .budget-card,
  .row-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .variable-table,
  .recurring-plan-table,
  .recurring-table,
  .category-table {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .variable-table-row.table-head,
  .recurring-plan-row.table-head,
  .recurring-table-row.table-head,
  .category-row-head {
    display: none !important;
  }

  .variable-table-row:not(.table-head) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "date amount"
      "title action"
      "category action";
    gap: 6px 10px !important;
    align-items: start !important;
    padding: 12px !important;
    margin: 0 0 10px !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    background: #fff !important;
  }

  .variable-table-row:not(.table-head) > span:first-child {
    display: none !important;
  }

  .variable-table-row:not(.table-head) > span:nth-child(2) {
    grid-area: date !important;
    color: var(--muted) !important;
  }

  .variable-table-row:not(.table-head) > strong {
    grid-area: title !important;
    font-style: normal !important;
    font-weight: 700 !important;
    overflow-wrap: anywhere !important;
  }

  .variable-table-row:not(.table-head) > span:nth-child(4) {
    grid-area: category !important;
    color: var(--muted) !important;
    overflow-wrap: anywhere !important;
  }

  .variable-table-row:not(.table-head) > span:nth-child(5) {
    grid-area: amount !important;
    justify-self: end !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  .variable-table-row:not(.table-head) > .row-edit-button,
  .variable-table-row:not(.table-head) > button {
    grid-area: action !important;
    justify-self: end !important;
    align-self: end !important;
  }

  .variable-account-summary {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .recurring-plan-row:not(.table-head) {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr) !important;
    gap: 6px 10px !important;
    padding: 12px !important;
    margin: 0 0 10px !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    background: #fff !important;
  }

  .recurring-plan-row:not(.table-head) > span:first-child {
    grid-column: 1 !important;
    grid-row: 1 / span 5 !important;
    align-self: start !important;
    margin-top: 4px !important;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(n + 2) {
    grid-column: 2 !important;
    min-width: 0 !important;
    white-space: normal !important;
  }

  .recurring-plan-row input {
    width: 100% !important;
  }

  .recurring-table-row:not(.table-head),
  .account-item,
  .budget-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px 10px !important;
    align-items: center !important;
  }

  .category-row:not(.category-row-head) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px 10px !important;
    align-items: center !important;
    padding: 12px !important;
  }

  .category-row:not(.category-row-head) > span {
    min-width: 0 !important;
    white-space: normal !important;
  }

  .category-row:not(.category-row-head) > span:nth-child(5) {
    justify-self: end !important;
    grid-row: 1 / span 4 !important;
  }

  .chart-shell,
  .balance-chart,
  .line-chart,
  .category-pie-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .chart-legend,
  .balance-legend {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
  }
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

/* Last mobile modal override: the dialog behaves like its own white page. */
@media (max-width: 760px) {
  html.modal-open,
  body.modal-open {
    position: static !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: auto !important;
  }

  body.modal-open .app-shell {
    pointer-events: auto !important;
  }

  body.modal-open .app-shell > :not(.edit-modal) {
    visibility: hidden !important;
  }

  .edit-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000 !important;
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
  }

  .edit-modal-backdrop {
    display: none !important;
  }

  .edit-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(10px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  #editModalContent {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: auto !important;
    touch-action: auto !important;
  }

  .edit-modal .modal-close {
    position: fixed !important;
    top: calc(10px + env(safe-area-inset-top)) !important;
    right: 16px !important;
    z-index: 2100 !important;
    display: grid !important;
    float: none !important;
    margin: 0 !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }

  .edit-modal .modal-info {
    padding-top: 0 !important;
  }

  .edit-modal .modal-info h2,
  #editModalContent h2 {
    margin-top: 0 !important;
    padding-right: 52px !important;
  }
}

@media (max-width: 760px) {
  html.modal-open,
  body.modal-open {
    position: static !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: auto !important;
  }

  body.modal-open .app-shell {
    pointer-events: auto !important;
  }

  body.modal-open .app-shell > :not(.edit-modal) {
    visibility: hidden !important;
  }

  .edit-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000 !important;
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
  }

  .edit-modal-backdrop {
    display: none !important;
  }

  .edit-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  #editModalContent {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: auto !important;
    touch-action: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--text-normal);
  line-height: var(--line-height);
}

button, input, select {
  font: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

html.modal-open,
body.modal-open {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.auth-loading .app-shell,
body.auth-required .app-shell {
  display: none !important;
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #f8fafc;
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(22, 35, 59, .08);
  padding: 24px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: #1d746f;
  font-size: 24px;
}

.auth-brand img {
  width: 42px;
  height: 42px;
}

.auth-panel h1 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.16;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

.auth-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  color: var(--ink) !important;
}

.auth-check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
}

.auth-divider {
  margin: 6px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.auth-message {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.auth-message[data-tone="bad"] {
  color: var(--danger);
}

.auth-message[data-tone="good"] {
  color: var(--accent);
}

.auth-card .link-button {
  margin-top: 14px;
}

.recovery-code-box {
  margin: 14px 0;
  border: 1px solid #bfe7e2;
  border-radius: 8px;
  background: #f3fbf8;
  padding: 14px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}

.auth-inline-actions {
  display: grid;
  gap: 10px;
}

.auth-session-chip {
  display: grid;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(22, 35, 59, .05);
}

.sidebar-session {
  margin-top: auto;
  padding: 10px 14px 0;
}

.sidebar-session[hidden] {
  display: none;
}

.auth-session-chip span {
  display: block;
  overflow-wrap: anywhere;
}

.auth-session-chip .link-button {
  justify-self: start;
  color: var(--danger);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #00a19a;
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 100%;
}

.sidebar {
  background: #ffffff;
  color: var(--ink);
  padding: 32px 16px 52px;
  display: flex;
  flex-direction: column;
  gap: 38px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-right: 1px solid var(--line);
}

.sidebar .nav {
  margin-bottom: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 10px;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-mark::before {
  content: none;
}

.brand-mark::after {
  content: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.mobile-nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.brand strong {
  display: block;
  color: #2f756e;
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.brand span, .eyebrow, .panel-heading span {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
}

.topbar-description {
  max-width: 760px;
  margin-top: 10px;
  color: #4f5d73;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.brand span {
  color: #6a7388;
  margin-top: 5px;
}

.nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  min-height: 0;
}

.app-area-nav {
  display: grid;
  gap: 8px;
}

.area-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
  font-size: var(--text-normal);
}

.area-button.active,
.area-button:hover {
  background: #eaf6f4;
  border-color: #bfe7e2;
  color: #006d70;
}

.nav-group-label {
  margin: 18px 14px 4px;
  color: #7b8599;
  font-size: var(--text-sm);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.nav-group-title {
  margin: 10px 14px 4px;
  color: var(--ink);
  font-size: var(--text-h2);
  font-weight: 900;
}

.nav-button, .ghost-button {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: var(--text-normal);
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-button.active, .nav-button:hover {
  background: #eaf6f4;
  color: #006d70;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: #1f2d4a;
  font-weight: 800;
  font-size: 20px;
}

.nav-button.active .nav-icon {
  color: #007a78;
}

.klarna-mark {
  border-radius: 7px;
  background: #ff8cb3;
  color: #17213a;
  font-size: 14px;
}

.sidebar-tip {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 14px;
  color: #34425c;
  font-size: var(--text-sm);
  line-height: 1.55;
  background: #ffffff;
}

.sidebar-tip p {
  margin-top: 9px;
}

.tip-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e9f7f5;
  color: #007a78;
  font-weight: 800;
}

.ghost-button {
  margin-top: 0;
  border: 1px solid var(--line);
  justify-content: center;
  color: #34425c;
}

.content {
  padding: 32px 38px;
  max-width: 1188px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(24, 39, 65, .06);
  font-size: 14px;
}

.modal-info {
  display: grid;
  gap: 12px;
}

.modal-info p {
  color: #3e4e66;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
}

.edit-modal .modal-info p,
.edit-modal .info-box,
.edit-modal .panel-subline {
  font-size: 15px !important;
  line-height: 1.55;
}

.modal-info-example {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid #d9ebe7;
  border-radius: 8px;
  background: #f3fbf8;
  color: #2e4f55;
  white-space: normal;
}

.modal-info-example div {
  line-height: 1.55;
}

.modal-info-example.important {
  border-color: #f0dfbc;
  background: #fff9eb;
  color: #5d4a1f;
}

.modal-info-example.important .modal-info-arrow {
  color: #a86b00;
}

.modal-info-arrow {
  color: #007a78;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.4;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: var(--title-page);
  line-height: 1.08;
  letter-spacing: 0;
  color: #16233b;
}

h2 {
  font-size: var(--title-1);
  letter-spacing: 0;
}

.month-picker {
  min-width: 190px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.topbar > .month-picker {
  display: none;
}

.month-picker.is-hidden,
.eyebrow.is-hidden {
  display: none;
}

input, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
}

input[type="date"],
input[type="month"] {
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.plain-action, .profile-button {
  border: 0;
  background: transparent;
  color: #1f2d4a;
  min-height: 38px;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--text-sm);
}

.plain-action, .profile-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.top-icon {
  font-size: 20px;
  line-height: 1;
  color: #1f2d4a;
}

.top-icon.small {
  font-size: var(--title-3);
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.profile-initial {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f0f3f6;
  color: #526077;
  font-size: var(--title-3);
  font-weight: 800;
}

.view { display: none; }
.view.active { display: grid; gap: 18px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.summary-grid:empty {
  display: none;
}

.dashboard-reminders:empty {
  display: none;
}

.dashboard-klarna-open-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 4px;
  border-color: #ead7c0;
  background: #fffaf3;
}

.dashboard-klarna-open-panel[hidden] {
  display: none !important;
}

.dashboard-klarna-open-panel h2 {
  margin: 0 0 2px;
  color: #1d2b42;
  font-size: 16px;
  line-height: 1.2;
}

.dashboard-klarna-open-panel span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.dashboard-klarna-open-panel > strong {
  color: var(--danger);
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
}

.statement-panel {
  display: grid;
  gap: 16px;
}

.statement-filter-heading {
  align-items: start;
  gap: 18px;
}

.statement-filter-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.statement-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto);
  gap: 10px;
  align-items: end;
  min-width: min(100%, 440px);
}

.statement-controls label {
  display: grid;
  gap: 6px;
  color: #526077;
  font-size: var(--text-sm);
  font-weight: 700;
}

.statement-controls select {
  width: 100%;
  border: 1px solid #d6e1ec;
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.statement-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.statement-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 5px;
}

.statement-summary span {
  color: #526077;
  font-size: var(--text-sm);
}

.statement-summary strong {
  color: #007a78;
  font-size: var(--text-md);
}

.statement-summary strong.income {
  color: var(--accent-2);
}

.statement-summary strong.expense {
  color: var(--danger);
}

.statement-timeline {
  display: grid;
  gap: 18px;
}

.statement-day {
  display: grid;
  gap: 8px;
}

.statement-day-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: #4f5b70;
  font-weight: 800;
  font-size: var(--text-h2);
}

.statement-day-heading strong {
  color: #3f4654;
  white-space: nowrap;
}

.statement-day-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.statement-movement {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.statement-movement + .statement-movement {
  border-top: 1px solid var(--line);
}

.statement-initial {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #d8e0e8;
  display: grid;
  place-items: center;
  color: #596274;
  background: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.statement-movement-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.statement-movement-main strong {
  color: #0f5f9b;
  font-size: var(--text-h2);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.statement-movement-main small {
  color: #5b6474;
  font-size: var(--text-base);
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.statement-amount {
  font-weight: 900;
  font-size: var(--text-h2);
  white-space: nowrap;
}

.statement-amount.income {
  color: var(--accent-2);
}

.statement-amount.expense {
  color: var(--danger);
}

.reminder-panel {
  border-color: #f6c7bd;
  background: #fffafa;
}

.reminder-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.reminder-item {
  border: 1px solid #ffd7d2;
  border-radius: 8px;
  padding: 10px 104px 10px 12px;
  background: #fff;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  color: var(--ink);
}

.reminder-item.no-reminder-amount {
  grid-template-columns: minmax(0, 1fr);
  padding-right: 12px;
}

.reminder-item label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.reminder-item input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin-top: 1px;
}

.reminder-item small {
  display: block;
  color: #526077;
  font-size: var(--text-sm);
  margin-top: 3px;
}

.reminder-title-line {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.reminder-title-context {
  color: #526077;
  font-weight: 400;
}

.reminder-klarna-meta {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  margin-top: 4px;
  line-height: 1.3;
}

.reminder-meta-arrow {
  color: var(--accent);
  font-weight: 900;
  line-height: 1.15;
}

.reminder-date-nowrap {
  white-space: nowrap;
}

.reminder-due-days {
  color: var(--danger);
  font-weight: 900;
  white-space: nowrap;
}

.reminder-item > .amount {
  position: absolute;
  top: 12px;
  right: 12px;
  white-space: nowrap;
}

.reminder-action-button {
  min-height: 36px;
  align-self: center;
  white-space: nowrap;
}

.account-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.account-dashboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 154px;
}

.account-dashboard-card strong,
.account-dashboard-card span {
  display: block;
}

.account-dashboard-card strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.account-dashboard-card strong .account-dot {
  margin-right: 0;
}

.account-dashboard-card > div > span {
  color: #526077;
  font-size: var(--text-sm);
  margin-top: 4px;
}

.account-dashboard-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.account-dashboard-card dl.account-dashboard-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
}

.account-dashboard-card .metric-right {
  justify-self: stretch;
  text-align: right;
}

.account-dashboard-card .metric-secondary {
  margin-top: -1px;
}

.account-dashboard-card dt {
  color: #526077;
  font-size: var(--text-sm);
}

.account-dashboard-card dd {
  margin: 2px 0 0;
  font-weight: 800;
  color: #007a78;
}

.account-dashboard-card dd.income {
  color: var(--accent-2);
}

.account-dashboard-card dd.expense {
  color: var(--danger);
}

.account-dashboard-card dd.available-soft {
  color: #d987b7;
}

.account-dashboard-breakdown {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 7px;
}

.account-dashboard-breakdown strong {
  color: #16233b;
  font-size: var(--text-sm);
}

.account-dashboard-breakdown span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: #526077;
  font-size: var(--text-sm);
}

.account-dashboard-breakdown em {
  font-style: normal;
}

.account-dashboard-breakdown b {
  font-weight: 900;
  color: #526077;
  white-space: nowrap;
}

.account-dashboard-breakdown b.income {
  color: var(--accent-2);
}

.account-dashboard-breakdown b.expense {
  color: var(--danger);
}

.reserved-breakdown {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reserved-breakdown strong {
  flex: 1 1 100%;
}

.reserved-breakdown span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6faf9;
  color: #43516a;
  padding: 5px 8px;
  font-size: 14px;
}

.dashboard-action-grid {
  display: grid;
  gap: 14px;
  margin: 6px 0 18px;
}

.dashboard-empty-intro {
  margin: 18px 0 22px;
  padding: 18px;
}

.dashboard-empty-intro h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.25;
}

.dashboard-empty-intro p {
  margin: 0 0 14px;
  color: #33445f;
  font-size: 15px;
  line-height: 1.58;
}

.dashboard-empty-intro p:last-child {
  margin-bottom: 0;
}

.settings-choice-group {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-choice-group legend {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.settings-choice {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  line-height: 1.35;
}

.settings-choice input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  align-self: center;
}

.settings-choice span {
  min-width: 0;
  align-self: center;
  font-weight: 400;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.font-medium #settings .settings-choice-group legend {
  font-size: 17px !important;
}

body.font-medium #settings .settings-choice span {
  font-size: 17px !important;
}

body.font-large #settings .settings-choice-group legend {
  font-size: 19px !important;
}

body.font-large #settings .settings-choice span {
  font-size: 19px !important;
}

@media (max-width: 760px) {
  .settings-choice {
    min-height: 56px;
    padding: 12px 14px;
  }

  .settings-choice input[type="radio"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
  }
}

.dashboard-action-section {
  display: grid;
  gap: 8px;
}

.dashboard-action-section h2 {
  margin: 0;
  color: #314159;
  font-size: 15px;
  line-height: 1.25;
}

.dashboard-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-action-tile {
  min-height: 76px;
  width: 100%;
  border: 1px solid #d8e5df;
  border-radius: 8px;
  background: #ffffff;
  color: #254057;
  box-shadow: var(--shadow);
  padding: 12px;
  font-weight: 600;
  text-align: left;
  line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  align-items: center;
  justify-content: flex-start;
  overflow-wrap: anywhere;
}

.booking-actions .correction-action {
  background: #fff4ea;
  border-color: #f5cfae;
  color: #7b3c14;
}

.booking-actions .correction-action:hover,
.booking-actions .correction-action:focus-visible {
  background: #ffead6;
}

.booking-actions .variable-action {
  background: #fff8dc;
  border-color: #eed77f;
  color: #705000;
}

.booking-actions .variable-action:hover,
.booking-actions .variable-action:focus-visible {
  background: #fff1b8;
}

.savings-actions .reserve-action {
  background: #edf9f3;
  border-color: #bfe6d1;
  color: #126044;
}

.savings-actions .reserve-action:hover,
.savings-actions .reserve-action:focus-visible {
  background: #def4e9;
}

.savings-actions .claim-action {
  background: #eef7ff;
  border-color: #b8d9f6;
  color: #15527a;
}

.savings-actions .claim-action:hover,
.savings-actions .claim-action:focus-visible {
  background: #dff0ff;
}

.dashboard-section-title {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.dashboard-monthly-accounts {
  display: grid;
  gap: 10px;
}

.monthly-account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.monthly-account-card h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.monthly-account-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.monthly-account-columns > div,
.monthly-account-remaining {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 9px;
  display: grid;
  gap: 4px;
}

.monthly-account-columns span,
.monthly-account-remaining span {
  color: #526077;
  font-size: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.quick-entry-panel {
  grid-column: 1 / -1;
  margin-bottom: 18px;
}

.compact-category-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-panel.wide {
  grid-column: 1 / -1;
}

.dashboard-budget-grid,
.category-chart-grid {
  display: grid;
  gap: 12px;
}

.dashboard-subsection-title {
  margin-top: 4px;
  font-weight: 800;
  color: #16233b;
  font-size: var(--text-h3);
}

.dashboard-budget-card,
.category-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.dashboard-budget-card strong,
.dashboard-budget-card span {
  display: block;
}

.dashboard-budget-card span,
.category-bar span {
  color: #526077;
  font-size: var(--text-sm);
  margin-top: 3px;
}

.category-chart-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.category-chart-grid > div + div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.category-breakdown-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.category-breakdown-card + .category-breakdown-card {
  margin-top: 10px;
}

.category-breakdown-head,
.category-breakdown-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-breakdown-head strong,
.grouped-category-bar strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.category-breakdown-head span,
.category-breakdown-row strong {
  color: #526077;
  font-size: var(--text-sm);
}

.category-breakdown-list {
  display: grid;
  gap: 9px;
}

.category-breakdown-row {
  display: grid;
  gap: 5px;
}

.category-pie-section {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.pie-chart {
  width: 140px;
  aspect-ratio: 1;
  border-radius: 999px;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, .72);
}

.pie-legend {
  display: grid;
  gap: 8px;
}

.pie-legend h3 {
  margin: 0 0 4px;
}

.pie-legend-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #3e4c64;
}

.pie-legend-row span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.pie-legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .category-pie-section {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 12px;
  }

  .pie-chart {
    width: min(180px, 56vw);
    justify-self: center;
  }

  .pie-legend {
    width: 100%;
    min-width: 0;
  }

  .pie-legend-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .pie-legend-row span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .pie-legend-row strong {
    justify-self: end;
    white-space: nowrap;
  }
}

.category-bar + .category-bar {
  margin-top: 8px;
}

.category-bar > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.trend-line-chart {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.trend-line-chart svg {
  width: 100%;
  height: 252px;
  border-radius: 8px;
  background: #fbfcfd;
  border: 1px solid var(--line);
}

.trend-line {
  fill: none;
  stroke: var(--trend-color, #007a78);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-grid-line {
  stroke: #dfe7ef;
  stroke-width: 1;
}

.trend-y-label {
  fill: #526077;
  font-size: 20px;
  font-weight: 700;
}

.trend-x-label {
  fill: #526077;
  font-size: 19px;
  font-weight: 700;
}

.trend-area {
  fill: rgba(0, 122, 120, .12);
}

.trend-line-chart circle {
  fill: #fff;
  stroke: var(--trend-color, #007a78);
  stroke-width: 3;
}

.trend-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #526077;
  font-size: var(--text-sm);
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.trend-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(70px, 1fr);
  gap: 0;
  overflow-x: auto;
  text-align: center;
}

.trend-labels small,
.trend-labels strong {
  display: block;
  font-size: var(--text-sm);
}

.trend-labels small {
  color: #526077;
}

.trend-labels strong {
  color: #16233b;
}

.metric, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 22px;
  display: grid;
  gap: 8px;
}

.metric span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.metric strong {
  font-size: var(--title-page);
  color: #16233b;
  letter-spacing: 0;
}

.two-column, .split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  align-items: start;
}

#budgets .split,
.account-layout,
.savings-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 762px;
}

#budgets .budget-create-panel {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  align-items: start;
}

#budgets .budget-create-panel .primary-button {
  width: auto;
}

.recurring-plan-layout {
  display: grid;
  max-width: 860px;
  width: 100%;
}

.recurring-plan-table {
  display: grid;
  gap: 18px;
  overflow-x: hidden;
}

.recurring-account-group {
  display: grid;
  gap: 8px;
}

.recurring-account-group h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
}

.recurring-plan-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: -2px 0 12px;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #4f5d73;
  font-size: var(--text-sm);
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-filter-heading {
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 12px;
}

.panel-filter-heading .inline-month-picker {
  width: min(180px, 100%);
}

.panel-filter-heading .inline-month-picker,
.transfer-month-filter,
.variable-month-heading .inline-month-picker {
  width: min(260px, calc(100% - 16px)) !important;
  max-width: calc(100% - 16px) !important;
  justify-self: start !important;
}

@media (max-width: 760px) {
  .panel-filter-heading .inline-month-picker,
  .transfer-month-filter,
  .variable-month-heading .inline-month-picker {
    width: min(260px, calc(100% - 16px)) !important;
    max-width: calc(100% - 16px) !important;
    justify-self: start !important;
  }
}

.variable-month-heading {
  margin-bottom: 12px;
}

.panel-action-heading {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  align-items: center;
  margin-bottom: 12px;
}

.panel-action-heading > h2 {
  flex: 0 0 100%;
}

.page-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin: -2px 0 18px;
}

.page-actions .primary-button,
.page-actions .secondary-button,
.page-actions .compact-action-button {
  width: auto;
  min-height: 40px;
  padding: 0 16px;
  background: linear-gradient(180deg, #008985, #006f6d) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(0, 122, 120, .14) !important;
  font-size: var(--text-normal);
}

.page-actions .primary-button:hover,
.page-actions .primary-button:focus-visible,
.page-actions .secondary-button:hover,
.page-actions .secondary-button:focus-visible {
  background: linear-gradient(180deg, #007d79, #006360) !important;
  color: #fff !important;
}

.panel-heading:has(.compact-action-button) {
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-heading:has(.compact-action-button) > h2 {
  flex: 0 0 100%;
}

.compact-action-button {
  width: auto;
  min-height: 40px;
  padding-inline: 16px;
}

.compact-action-button,
.panel-action-heading .compact-action-button,
.category-actions .secondary-button {
  background: linear-gradient(180deg, #008985, #006f6d);
  border: 0;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 122, 120, .14);
  font-size: var(--text-normal);
}

.klarna-ai-panel {
  display: grid;
  gap: 10px;
  border-color: #cfddec;
  background: #f8fbff;
}

.klarna-ai-panel h2 {
  margin: 0;
  color: #40556b;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.25;
}

.klarna-ai-info {
  border: 1px solid #d8e4eb;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.klarna-ai-info summary {
  min-height: auto;
  padding: .65em .85em;
  color: #36566b;
  font-size: var(--text-normal);
  font-weight: 800;
  line-height: var(--line-height-compact);
  cursor: pointer;
}

.klarna-ai-info p {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  line-height: 1.45;
}

.klarna-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chatgpt-action-button {
  width: auto;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #c8d8e1;
  border-radius: 8px;
  background: #e8f0f4;
  color: #28475a;
  box-shadow: 0 8px 18px rgba(43, 82, 108, .08);
  font-size: var(--text-normal);
  font-weight: 800;
}

.chatgpt-action-button.secondary {
  background: #e8f0f4;
  color: #28475a;
  box-shadow: 0 8px 18px rgba(43, 82, 108, .08);
}

.chatgpt-action-button:hover,
.chatgpt-action-button:focus-visible {
  background: #dfeaf0;
}

.quick-create-panel:has(> button:only-child) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.table-row {
  display: grid;
  grid-template-columns: 56px 78px minmax(150px, 1.05fr) minmax(120px, .9fr) minmax(150px, 1fr) 108px 128px 104px;
  gap: 10px;
  align-items: center;
  min-width: 860px;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  font-size: var(--text-md);
}

.table-head {
  color: #526077;
  font-weight: 800;
  font-size: var(--text-sm);
  background: #f8fafc;
  border-radius: 8px 8px 0 0;
}

.recurring-plan-row {
  grid-template-columns: 24px minmax(128px, 1.05fr) minmax(132px, .95fr) 100px 110px 86px;
  min-width: 0;
  gap: 8px;
  padding: 10px 6px;
  font-size: var(--text-normal);
}

.recurring-plan-filter {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.recurring-plan-row.table-head {
  font-size: var(--text-normal);
}

.recurring-plan-row strong,
.recurring-plan-row span {
  min-width: 0;
}

.recurring-plan-row small {
  display: block;
  margin-top: 2px;
  color: #526077;
  font-size: var(--text-sm);
  line-height: 1.2;
}

.recurring-plan-row input {
  min-height: 34px;
  padding: 6px 8px;
  width: 100%;
}

.recurring-plan-planned,
.recurring-plan-corrected {
  display: grid;
  gap: 3px;
}

.recurring-plan-planned small,
.recurring-plan-corrected small {
  color: #526077;
  font-weight: 700;
  margin: 0;
}

.recurring-plan-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.recurring-plan-heading time {
  color: #526077;
  font-weight: 800;
  white-space: nowrap;
}

.recurring-plan-row.income-row {
  background: linear-gradient(90deg, rgba(47, 163, 111, .12), rgba(47, 163, 111, .035));
  box-shadow: inset 4px 0 0 #2fa36f;
}

.recurring-plan-row.expense-row {
  background: linear-gradient(90deg, rgba(217, 83, 79, .12), rgba(217, 83, 79, .035));
  box-shadow: inset 4px 0 0 #d9534f;
}

.recurring-plan-row.income-row > span:nth-child(4),
.recurring-plan-row.income-row > span:nth-child(5) input {
  color: #087c5b;
}

.recurring-plan-row.expense-row > span:nth-child(4),
.recurring-plan-row.expense-row > span:nth-child(5) input {
  color: #a3364d;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 0;
}

.status-dot.done {
  background: #2fa36f;
}

.status-dot.pending {
  background: #d9534f;
}

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

.recurring-plan-summary:empty {
  display: none;
}

.recurring-plan-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.recurring-plan-summary span {
  color: #526077;
  font-size: var(--text-sm);
}

.recurring-plan-summary strong {
  font-size: var(--text-h2);
}

.recurring-plan-summary .summary-income strong {
  color: #087c5b;
}

.recurring-plan-summary .summary-expense strong {
  color: #a3364d;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef3f8;
  color: #28445c;
  font-size: var(--text-sm);
  font-weight: 700;
}

.transfer-layout,
.klarna-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 762px;
}

.recurring-layout,
.klarna-stack {
  display: grid;
  gap: 18px;
}

.klarna-stack,
.klarna-layout,
.klarna-stack > .panel,
.klarna-layout > .panel {
  width: 100%;
}

.klarna-month-panel,
.klarna-paid-month-group {
  display: grid;
  gap: 10px;
  align-items: start;
  justify-content: stretch;
}

.klarna-month-panel h2,
.klarna-paid-month-group h2 {
  margin: 0;
}

.klarna-paid-month-group {
  width: min(762px, 100%);
  max-width: 762px;
  justify-self: start;
  gap: 12px;
}

.klarna-paid-month-head {
  display: grid;
  gap: 8px;
}

.klarna-paid-month-results {
  display: grid;
  gap: 10px;
  padding-left: 10px;
  border-left: 3px solid #d5e5ea;
}

.klarna-paid-subpanel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.klarna-paid-subpanel[hidden] {
  display: none !important;
}

.klarna-paid-subpanel .panel-heading {
  margin-bottom: 4px;
}

.klarna-settings-panel,
#klarnaOpenPanel,
#klarnaPaidPanel,
.transfer-history-panel,
.savings-list-panel,
.account-list-panel,
#budgets .split > .panel,
.recurring-overview-panel {
  width: min(762px, 100%);
  max-width: 762px;
  justify-self: start;
}

.recurring-layout > .form-panel {
  max-width: none;
}

.variable-detail-layout {
  display: grid;
}

.variable-month-panel,
.variable-month-panel.wide {
  grid-column: 1 / -1;
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.panel-heading.panel-action-heading {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  align-items: center;
  margin-bottom: 12px;
}

.panel-heading.panel-action-heading > h2 {
  flex: initial;
}

.panel-subline {
  color: #526077;
  font-size: var(--text-sm);
  margin: -6px 0 12px;
}

.form-panel, form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

#recurringForm > .form-row:first-of-type {
  grid-template-columns: minmax(0, .55fr) 130px;
}

#recurringForm > .form-row.even {
  grid-template-columns: minmax(120px, .34fr) minmax(260px, .66fr);
}

.form-row.even,
.form-row.transfer-row {
  grid-template-columns: minmax(0, .72fr) minmax(140px, .28fr);
}

.quick-entry-panel .form-row.even {
  grid-template-columns: minmax(130px, .32fr) minmax(360px, .68fr);
}

.quick-entry-panel .form-row.transfer-row,
.quick-entry-panel .form-row.even:last-of-type {
  grid-template-columns: minmax(130px, .32fr) minmax(360px, .68fr);
}

.form-row.with-today {
  grid-template-columns: minmax(0, .58fr) minmax(170px, .34fr) 64px;
  align-items: end;
}

.date-today-row {
  grid-template-columns: 1fr;
  align-items: end;
}

.full-row {
  display: grid;
}

.today-button {
  min-width: 0;
  min-height: 42px;
  height: 42px;
  align-self: end;
  padding: 0 8px;
}

.inline-month-picker {
  width: min(170px, 100%);
  color: var(--muted);
  display: grid;
  gap: 5px;
}

.inline-month-picker input {
  min-height: 38px;
  width: 100%;
  max-width: 100%;
  text-align: left;
  padding-right: 34px;
}

.transfer-history-panel .panel-heading {
  display: flex;
  align-items: center;
}

.transfer-month-filter {
  width: min(180px, 100%);
  min-width: 0;
  margin-bottom: 10px;
}

.transfer-month-filter input {
  min-width: 0;
  max-width: 100%;
  padding-inline: 10px 8px;
}

.transfer-layout h2 {
  font-size: var(--text-h2);
}

.checkline {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkline input {
  width: auto;
  min-height: auto;
}

.primary-button, .secondary-button, .tiny-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

.account-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.account-list-panel {
  min-width: 0;
}

.account-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 58px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  grid-template-areas:
    "title amount edit"
    "meta amount edit";
  gap: 3px 10px;
  align-items: center;
  padding: 10px 12px;
  color: var(--ink);
  cursor: default;
  text-align: left;
}

.account-item + .account-item {
  margin-top: 10px;
}

.account-item.selected,
.account-item:hover {
  background: #f2fbfa;
  border-color: #9adbd6;
}

.account-title {
  grid-area: title;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.account-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-item .account-dot {
  flex: 0 0 auto;
}

.account-item small {
  grid-area: meta;
  color: #526077;
}

.account-meta {
  display: block;
  line-height: 1.35;
  align-items: start;
}

.account-planer-label,
.account-free-balance {
  display: block;
}

.account-item .amount {
  grid-area: amount;
}

.account-item .row-edit-button {
  grid-area: edit;
  justify-self: end;
}

.money-input {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.money-input.signed-money-input {
  grid-template-columns: auto 1fr auto;
}

.money-input input {
  border: 0;
}

.money-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 137, 130, .16);
}

.money-input input:focus {
  outline: none;
  box-shadow: none;
}

.money-input span {
  padding-right: 12px;
  color: #526077;
  font-weight: 800;
}

.money-input .amount-sign {
  min-width: 28px;
  padding: 0 0 0 12px;
  text-align: center;
  color: #16233b;
}

.readonly-money {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.readonly-money strong {
  font-size: 16px;
  color: #007a78;
}

.settings-panel {
  max-width: 640px;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.settings-form {
  margin-top: 0;
  display: grid;
  gap: 18px;
  max-width: 640px;
}

.settings-form label {
  display: grid;
  gap: 9px;
  color: #526077;
  font-weight: 700;
  line-height: 1.3;
}

.settings-form select {
  color: var(--ink);
  font-weight: 700;
  min-height: 48px;
  padding-block: 10px;
}

body.font-medium {
  --text-sm: 15px;
  --text-base: 16px;
  --text-md: 16px;
  --text-h3: 15px;
  --text-h2: 17px;
  --text-h1: 18px;
  --text-title: 22px;
  --title-page: 21px;
}

body.font-medium label,
body.font-medium input,
body.font-medium select,
body.font-medium textarea,
body.font-medium button,
body.font-medium .row-card,
body.font-medium .nav-button,
body.font-medium .empty-card small,
body.font-medium .settings-form label,
body.font-medium .settings-form select {
  font-size: 16px !important;
}

body.font-medium .topbar h1,
body.font-medium h1 {
  font-size: 21px !important;
}

body.font-medium h2,
body.font-medium .panel-heading h2,
body.font-medium .panel > h2 {
  font-size: 19px !important;
}

body.font-large {
  --text-sm: 16px;
  --text-base: 17px;
  --text-md: 17px;
  --text-h3: 16px;
  --text-h2: 19px;
  --text-h1: 20px;
  --text-title: 24px;
  --title-page: 23px;
}

body.font-large label,
body.font-large input,
body.font-large select,
body.font-large textarea,
body.font-large button,
body.font-large .row-card,
body.font-large .nav-button,
body.font-large .empty-card small,
body.font-large .settings-form label,
body.font-large .settings-form select {
  font-size: 18px !important;
}

body.font-large .topbar h1,
body.font-large h1 {
  font-size: 24px !important;
}

body.font-large h2,
body.font-large .panel-heading h2,
body.font-large .panel > h2 {
  font-size: 21px !important;
}

.primary-button {
  background: linear-gradient(180deg, #008985, #006f6d);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 122, 120, .14);
}

.secondary-button {
  background: #ffffff;
  color: #1f2d4a;
  border: 1px solid var(--line);
}

button.secondary-button.compact-action-button,
.panel-heading button.secondary-button.compact-action-button,
.panel-action-heading button.secondary-button.compact-action-button,
.category-actions button.secondary-button {
  background: linear-gradient(180deg, #008985, #006f6d) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(0, 122, 120, .14) !important;
}

button.secondary-button.compact-action-button:hover,
button.secondary-button.compact-action-button:focus-visible,
.category-actions button.secondary-button:hover,
.category-actions button.secondary-button:focus-visible {
  background: linear-gradient(180deg, #007d79, #006360) !important;
  color: #fff !important;
}

.tiny-button {
  min-height: 30px;
  background: #ece5dc;
  color: #2f2b26;
}

.transaction-list, .account-list, .budget-list, .goal-list, .account-forecast {
  display: grid;
  gap: 10px;
}

.transfer-history-panel {
  min-width: 0;
}

.transfer-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.transfer-item.selected {
  background: #f2fbfa;
  border-color: #9adbd6;
}

.transfer-main {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.transfer-main strong {
  line-height: 1.15;
}

.transfer-main strong span {
  font-weight: 800;
}

.transfer-main small {
  display: block;
  margin-top: 4px;
  line-height: 1.25;
}

.transfer-log {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
  color: #526077;
  font-size: var(--text-sm);
  line-height: 1.4;
}

.transfer-log p {
  margin: 0;
  color: #4f5d73;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.transfer-log h3,
.recurring-group h3 {
  margin: 0 0 8px;
  font-size: var(--text-sm);
  color: #16233b;
}

.recurring-overview-panel > h2,
.variable-budget-panel > h2 {
  margin-bottom: 16px;
}

.account-name-color {
  color: var(--account-color);
  font-weight: 800;
}

.recurring-groups {
  display: grid;
  gap: 16px;
}

.recurring-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(120px, 1.05fr) minmax(130px, .9fr) minmax(145px, 1fr) minmax(120px, .9fr) 108px 34px;
  gap: 8px;
  align-items: center;
  padding: 12px;
  text-align: left;
  cursor: default;
  font-size: var(--text-base);
}

.recurring-table-row {
  grid-template-columns: minmax(120px, 1.05fr) minmax(130px, .9fr) minmax(145px, 1fr) minmax(120px, .9fr) 108px 34px;
  min-width: 0;
  font-size: var(--text-base);
}

.recurring-table-row.recurring-action-item {
  grid-template-columns: 68px minmax(130px, 1fr) 86px minmax(125px, .8fr) minmax(140px, 1fr) 105px;
  min-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: default;
}

.recurring-table {
  display: grid;
  gap: 8px;
}

.recurring-action-list {
  display: grid;
  gap: 8px;
}

.recurring-action-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ffd7d2;
  border-radius: 8px;
  background: #fffafa;
}

.recurring-action-card input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.recurring-action-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recurring-action-main strong,
.recurring-action-main small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.recurring-action-main small {
  color: #526077;
  font-size: var(--text-sm);
  line-height: 1.35;
}

.recurring-action-card .amount {
  white-space: nowrap;
  font-weight: 900;
}

.recurring-item:hover {
  background: #f2fbfa;
  border-color: #9adbd6;
}

.recurring-item small {
  display: block;
  margin-top: 4px;
  color: #526077;
  font-size: var(--text-sm);
  line-height: 1.35;
}

.recurring-item .amount {
  font-size: var(--text-sm);
}

.recurring-action-item input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.action-required-group {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.empty-note {
  color: #526077;
  font-size: var(--text-sm);
}

.empty-card {
  grid-template-columns: 1fr;
}

.empty-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.empty-card small {
  display: block;
  margin-top: 4px;
  font-size: var(--text-sm);
  line-height: 1.35;
}

.variable-account-group {
  display: grid;
  gap: 8px;
}

.variable-account-group + .variable-account-group {
  margin-top: 16px;
}

.variable-account-group h3,
.klarna-list-section h3 {
  margin: 0;
  font-size: 14px;
}

.klarna-list-section .row-card strong {
  display: block;
  margin-bottom: 8px;
}

.klarna-list-section .row-card small {
  line-height: 1.45;
}

.klarna-settings-panel {
  max-width: none;
}

.klarna-column {
  display: grid;
  gap: 18px;
}

.page-description-panel {
  display: grid;
  gap: 10px;
  background: #f7fbfa;
}

.page-description-panel p {
  color: #4f5d73;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.package-total {
  justify-self: end;
  color: #007a78;
  font-size: var(--title-1);
  font-weight: 800;
}

.variable-table {
  display: grid;
  overflow-x: hidden;
}

.variable-table-row {
  grid-template-columns: 8px 62px minmax(110px, 1fr) minmax(112px, .92fr) minmax(82px, .6fr) 34px;
  min-width: 0;
  gap: 6px;
}

.variable-table-row > span:nth-child(5) {
  justify-self: end;
  text-align: right;
}

.variable-table-row:not(.table-head) > strong {
  font-style: normal;
  font-weight: 700;
}

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

.variable-account-summary.has-klarna {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.variable-account-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.variable-account-summary span {
  display: block;
  color: #526077;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.variable-account-summary strong {
  font-size: var(--text-md);
}

.variable-account-summary .summary-income strong {
  color: #087c5b;
}

.variable-account-summary .summary-expense strong {
  color: #b42345;
}

.variable-account-summary .summary-klarna strong {
  color: #b42345;
}

#klarnaOpenPanel .panel-heading > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

#klarnaOpenSum {
  margin-left: auto;
  color: #526077;
  font-weight: 800;
  white-space: nowrap;
}

.row-edit-button {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 32px;
  width: 34px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
}

.status-warning {
  color: #c44747;
  font-size: 15px;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-small);
  color: #526077;
}

.mini-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.klarna-list-section {
  display: grid;
  gap: 8px;
}

.klarna-list-section + .klarna-list-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.package-form,
#klarnaPackagePanel,
#klarnaPaidPanel {
  max-width: none;
}

.package-splits {
  display: grid;
  gap: 10px;
}

.package-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, .45fr);
  gap: 10px;
}

.package-split-row select,
.package-split-row input {
  min-height: 42px;
}

.edit-modal[hidden] {
  display: none;
}

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  overscroll-behavior: contain;
}

.edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 35, 59, .28);
  touch-action: none;
}

.edit-modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 820px);
  overflow: hidden;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(22, 35, 59, .18);
  padding: 22px;
}

#editModalContent {
  max-height: calc(86vh - 44px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 2px;
}

.modal-form label,
.modal-form .form-row,
.modal-form .form-row > *,
.modal-form .package-split-row,
.modal-form .package-split-row > * {
  min-width: 0;
  max-width: 100%;
}

.modal-form input[type="date"],
.modal-form input[type="month"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.modal-form input[type="date"]::-webkit-date-and-time-value,
.modal-form input[type="month"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid #f0b7b3;
  border-radius: 999px;
  background: #fff6f5;
  color: transparent;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(180, 35, 24, .08);
  font-size: 0;
  line-height: 1;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: #b42318;
  transform-origin: center;
}

.modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-close:hover,
.modal-close:focus-visible {
  background: #ffe8e6;
  border-color: #e59c96;
  box-shadow: 0 12px 24px rgba(180, 35, 24, .14);
}

.modal-close:active {
  transform: scale(.96);
}

.modal-form {
  display: grid;
  gap: 12px;
}

.modal-form .form-row.even,
.modal-form .form-row.transfer-row {
  grid-template-columns: minmax(120px, .32fr) minmax(260px, .68fr);
}

.modal-form h2 {
  padding-right: 44px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 28%);
}

.modal-actions.single {
  grid-template-columns: 1fr;
}

.recurring-type-category-row,
.recurring-amount-day-row,
.recurring-date-range {
  min-width: 0;
}

.recurring-date-range {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.recurring-date-range legend {
  padding: 0 6px;
  color: #526077;
  font-size: var(--text-sm);
  font-weight: 800;
}

@media (max-width: 760px) {
  .edit-modal {
    display: block !important;
    padding: calc(8px + env(safe-area-inset-top)) 8px calc(12px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
  }

  .edit-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    margin: 0 auto !important;
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #editModalContent {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    touch-action: auto !important;
  }

  .modal-close {
    position: sticky !important;
    top: 0 !important;
    margin-left: auto !important;
    margin-bottom: -28px !important;
    display: grid !important;
  }

  .modal-actions {
    position: static !important;
    padding-top: 8px !important;
    background: #fff !important;
  }

  .modal-form {
    padding-bottom: 4px !important;
  }
}

.modal-reminder-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.modal-reminder-card small {
  color: #526077;
}

.mini-budget-list {
  display: grid;
  gap: 10px;
}

.mini-budget {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}

.mini-budget strong {
  display: block;
  font-size: var(--text-sm);
}

.mini-budget small {
  color: #526077;
  font-size: var(--text-sm);
}

.due-soon {
  color: var(--danger);
  font-weight: 800;
}

.pay-inline {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.pay-inline select {
  min-height: 34px;
  padding: 6px 9px;
  font-size: var(--text-sm);
}

.row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 35, 59, .04);
}

.row-card small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.amount {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.income { color: var(--accent-2); }
.expense { color: var(--danger); }

.klarna-open-item {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: start;
}

.klarna-open-main {
  min-width: 0;
}

.klarna-open-titleline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.klarna-open-titleline strong span {
  font-weight: 400;
  color: var(--muted);
}

.klarna-open-due {
  display: grid;
  gap: 2px;
  justify-items: end;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.klarna-open-due small {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
}

.klarna-open-item > .klarna-open-amount {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  align-self: start;
  text-align: left;
  margin-top: 0;
}

.klarna-open-item .pay-inline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, .45fr) minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  margin-top: 5px;
}

.klarna-open-item .pay-inline select {
  grid-column: 1 / -1;
  grid-row: 1;
}

.klarna-open-item .pay-inline .tiny-button {
  grid-column: 1;
  grid-row: 2;
  justify-self: stretch;
  min-width: 124px;
}

.klarna-open-item .row-edit-button {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  width: 40px;
  height: 40px;
}

.klarna-paid-item {
  grid-template-columns: minmax(0, 1fr) auto 40px;
  gap: 8px 12px;
  align-items: start;
}

.klarna-paid-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.klarna-paid-main strong span {
  color: var(--muted);
  font-weight: 400;
}

.klarna-paid-main .amount {
  text-align: left;
}

.klarna-paid-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.klarna-paid-meta small {
  font-weight: 700;
}

.klarna-paid-item .row-edit-button {
  width: 40px;
  height: 40px;
  justify-self: end;
}

.package-splits-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.package-splits-heading {
  margin: 0;
  font-size: var(--text-sm);
}

.klarna-package-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.klarna-package-item time {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.klarna-package-item > .amount {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  text-align: left;
  margin-top: 8px;
}

.klarna-package-item > .amount span {
  color: var(--muted);
  font-weight: 700;
}

.klarna-package-item > .row-edit-button {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: start;
  margin-top: 6px;
}

.package-open-picker:empty {
  display: none;
}

.klarna-ai-import-list {
  display: grid;
  gap: 10px;
}

.klarna-ai-import-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.klarna-ai-import-row.is-duplicate {
  border-color: #f0b8b0;
  background: #fff8f7;
}

.klarna-ai-import-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.klarna-ai-import-include {
  position: relative;
  display: block;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin-top: 1px;
}

.klarna-ai-import-include input {
  position: absolute;
  inset: 0;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  opacity: 0;
}

.klarna-ai-import-include span {
  position: absolute;
  inset: 0;
  border: 1px solid #9aa7b6;
  border-radius: 5px;
  background: #fff;
}

.klarna-ai-import-include input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

.klarna-ai-import-include input:checked + span::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.klarna-ai-import-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.klarna-ai-import-title strong {
  line-height: 1.2;
}

.klarna-ai-import-title small {
  color: var(--muted);
}

.klarna-ai-import-status {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
  white-space: nowrap;
}

.klarna-ai-import-status b {
  color: var(--danger);
}

.klarna-ai-import-status span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
}

.klarna-ai-import-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.klarna-ai-import-fields label:first-child {
  grid-column: 1 / -1;
}

@media (max-width: 520px) {
  .klarna-ai-import-fields {
    grid-template-columns: 1fr;
  }
}

.klarna-ai-import-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.package-open-posts {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.package-open-posts h3 {
  margin: 0;
  font-size: var(--text-sm);
}

.package-open-post {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  padding: 8px 8px 8px 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.package-open-post.selected {
  border-color: #9bd7c8;
  background: #f2fbf8;
}

.package-open-checkbox {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 1px;
  min-width: 1px;
  height: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.package-open-check {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 18px;
  height: 18px;
  border: 1px solid #8a95a6;
  border-radius: 3px;
  background: #fff;
}

.package-open-checkbox:checked + .package-open-check {
  border-color: var(--accent);
  background: var(--accent);
}

.package-open-checkbox:checked + .package-open-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.package-open-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.package-open-post small {
  color: var(--muted);
}

.package-open-post b {
  color: var(--danger);
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef3f8;
  color: #28445c;
  font-size: var(--text-sm);
  margin-top: 6px;
}

.account-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 7px;
}

.adjust-form, .goal-form {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.progress {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #eee8df;
  margin-top: 8px;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--progress-color, var(--accent-2));
}

.budget-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f2fbfa;
  color: #31506a;
  font-size: var(--text-sm);
}

.budget-summary strong {
  color: #007a78;
  font-size: var(--title-1);
}

.budget-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  color: var(--ink);
  cursor: default;
  text-align: left;
}

.budget-item:hover,
.budget-item.selected {
  background: #f2fbfa;
  border-color: #9adbd6;
}

.budget-item strong {
  display: block;
  margin-bottom: 4px;
}

.budget-item small {
  display: block;
  color: #526077;
  font-size: var(--text-sm);
  line-height: 1.35;
}

.budget-item .row-edit-button {
  justify-self: end;
}

.subcopy {
  color: #526077;
  margin-top: -12px;
  max-width: 760px;
  font-size: var(--text-sm);
  line-height: 1.45;
  white-space: pre-line;
}

.category-head {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: start;
  margin-top: -2px;
  margin-bottom: 18px;
  min-height: 0;
}

.category-head.page-actions {
  max-width: 760px;
}

.category-head > div:first-child {
  display: none;
}

.category-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  white-space: nowrap;
}

.category-actions .primary-button,
.category-actions .secondary-button {
  min-height: 40px;
  width: auto;
  min-width: 0;
  font-size: var(--text-normal);
  padding: 0 13px;
  background: linear-gradient(180deg, #008985, #006f6d);
  border: 0;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 122, 120, .14);
}

.category-head h2 {
  font-size: var(--title-page);
  color: #16233b;
}

.metric-icon, .detail-icon, .category-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.metric-icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #e7f4f1;
  color: #007f7d;
  font-size: 20px;
  font-weight: 800;
}

.metric-icon.folder {
  background: #f0eafb;
  color: #7c55c7;
}

.metric-icon.palette {
  background: #fff0e4;
  color: #f97316;
}

.category-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 18px;
  align-items: start;
}

.category-detail {
  order: -1;
}

.category-inline-stats {
  grid-column: 1 / -1;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #526077;
  font-size: var(--text-sm);
}

.category-inline-stats strong {
  color: #16233b;
  font-size: 18px;
  margin-right: 4px;
}

.link-button {
  border: 0;
  background: transparent;
  color: #007a78;
  cursor: pointer;
  font-weight: 800;
  padding: 0;
}

.category-layout > * {
  min-width: 0;
}

.category-table-panel {
  overflow: visible;
}

.category-table {
  display: grid;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.category-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-filter-button {
  border: 1px solid #d9e4ec;
  background: #fff;
  color: #43506a;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 800;
  cursor: pointer;
}

.category-filter-button.active {
  border-color: #93d4ce;
  background: #e8f7f5;
  color: #007a78;
}

.category-filter-button:focus {
  outline: 0;
}

.category-filter-button:focus-visible {
  outline: 2px solid #79d8d2;
  outline-offset: 2px;
}

.category-group-card {
  border: 1px solid #dce6ee;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(22, 35, 59, .035);
}

.category-ungrouped-card {
  border-style: dashed;
  background: #fbfcfd;
}

.category-ungrouped-card .category-group-header h2 {
  color: #526077;
}

.category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.category-group-header > div {
  min-width: 0;
}

.category-group-header h2 {
  margin: 0;
  font-size: var(--title-2);
  line-height: 1.16;
  display: flex;
  align-items: center;
  gap: 7px;
}

.category-group-header span {
  display: block;
  margin-top: 3px;
  color: #526077;
  font-size: var(--text-sm);
  line-height: 1.25;
}

.category-group-header .group-edit-button {
  position: static;
  flex: 0 0 auto;
}

.category-group-list {
  display: grid;
  gap: 6px;
}

.category-compact-row {
  border: 1px solid #e5ebf1;
  border-radius: 8px;
  background: #fbfcfd;
  color: #17213a;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 5px 7px 5px 9px;
  cursor: pointer;
}

.category-compact-row:hover,
.category-compact-row.selected {
  border-color: #9adbd6;
  background: #f2fbfa;
}

.category-compact-row:focus {
  outline: 0;
}

.category-compact-row:focus-visible {
  outline: 2px solid #79d8d2;
  outline-offset: 2px;
}

.category-compact-row strong {
  min-width: 0;
  font-size: var(--text-sm);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.category-compact-row .type-pill {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font-weight: 800;
  white-space: nowrap;
}

.category-type-badges {
  display: inline-flex;
  justify-self: end;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  flex-wrap: wrap;
}

.category-type-badges:has(.type-pill:nth-child(2)) {
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.category-compact-row .row-edit-button {
  width: 34px;
  min-width: 34px;
  height: 32px;
  min-height: 32px;
  font-size: 14px;
}

.category-group-empty {
  border: 1px dashed #d9e4ec;
  border-radius: 8px;
  color: #526077;
  font-size: var(--text-sm);
  padding: 10px;
  background: #fbfcfd;
}

.category-type-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.category-type-picker legend {
  color: #526077;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 2px;
}

.category-type-choice {
  min-height: 40px;
  border: 1px solid #dfe8f0;
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  padding: 0 10px;
  color: #25324a;
  font-weight: 800;
}

.category-type-choice input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.category-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e9edf2;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) minmax(95px, .9fr) 50px minmax(88px, .78fr) 42px;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  padding: 0 10px;
  text-align: left;
  color: #17213a;
  font-size: var(--text-sm);
}

.category-row > span:last-child {
  justify-self: end;
}

.category-type-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #526077;
  font-size: var(--text-sm);
  font-weight: 900;
  border-bottom: 1px solid #e9edf2;
}

.category-type-row.expense {
  background: #fff0ed;
  color: #7f3f35;
}

.category-type-row.both {
  background: #fff5cf;
  color: #7a5200;
}

.category-type-row.income {
  background: #e8f7ee;
  color: #166534;
}

.category-row:not(.category-row-head) {
  cursor: pointer;
}

.category-row:focus {
  outline: 0;
}

.category-row:focus-visible {
  outline: 2px solid #79d8d2;
  outline-offset: -2px;
}

.category-row:not(.category-row-head):hover,
.category-row.selected {
  background: #f2fbfa;
  box-shadow: inset 3px 0 0 #00a19a;
}

.category-row-head {
  color: #526077;
  font-size: var(--text-sm);
  font-weight: 800;
  min-height: 36px;
}

.category-name {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: var(--text-sm);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.category-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cat) 16%, #fff);
  color: var(--cat);
  font-size: var(--title-2);
  font-weight: 900;
}

.color-dot {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-block;
  vertical-align: middle;
}

.color-dot.large {
  width: 26px;
  height: 26px;
  margin-right: 8px;
}

.type-pill, .tag-cell span, .tag-wrap span, .pill.neutral, .category-chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: var(--text-sm);
  color: #25324a;
  background: #f0f3f6;
}

.type-pill.expense {
  background: #fff0ed;
}

.type-pill.income {
  background: #e8f7ee;
  color: #166534;
}

.type-pill.both {
  background: #fff5cf;
  color: #7a5200;
}

.tag-cell, .tag-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-cell span, .tag-wrap span {
  background: #eef3f8;
}

.edit-link {
  color: #006f6d;
  font-weight: 800;
  font-size: var(--text-sm);
}

.category-detail {
  display: grid;
  gap: 18px;
}

.detail-title {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #e9edf2;
}

.detail-title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: #526077;
  font-size: var(--text-sm);
}

.detail-title-meta > span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-title-meta .pill {
  margin-top: 0;
}

.detail-icon {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cat) 16%, #fff);
  color: var(--cat);
  font-size: 20px;
  font-weight: 900;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  align-items: center;
}

.detail-list dt {
  color: #526077;
  font-size: var(--text-sm);
}

.detail-list dd {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
}

.info-box {
  color: #31535c;
  background: #eef9f7;
  border-radius: 8px;
  padding: 13px;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.category-form {
  grid-template-columns: 1fr;
  align-items: end;
  gap: 10px;
  padding-top: 0;
  border-top: 0;
}

.category-form .primary-button,
.category-form .archive-button {
  min-height: 40px;
  font-size: var(--text-sm);
}

.category-group-color-note {
  min-height: 42px;
  border: 1px solid #dfe8f0;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  color: #526077;
  font-size: var(--text-sm);
  font-weight: 800;
}

.compact-heading {
  margin-bottom: 0;
}

.compact-heading h2 {
  font-size: 18px;
}

.color-inputs {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
}

.group-color-inputs {
  grid-template-columns: 100px 1fr;
}

.group-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.group-editor {
  margin-bottom: 14px;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 14px;
}

.group-card {
  border: 1px solid #e1e7ee;
  border-radius: 8px;
  background: #fff;
  padding: 15px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  min-height: 150px;
  align-content: start;
  position: relative;
}

.group-edit-button {
  position: absolute;
  top: 10px;
  right: 10px;
}

.group-card.selected,
.group-card:hover {
  background: #f2fbfa;
  border-color: #9adbd6;
}

.group-card small {
  display: block;
  color: #526077;
  margin-top: 3px;
}

.swatches {
  display: flex;
  gap: 12px;
}

.swatches span {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.category-chip-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.category-chip-list span {
  background: #eef3f8;
  color: #25324a;
  font-size: var(--text-sm);
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 24px;
}

.archive-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid #ffd7d2;
  background: #fff8f7;
  color: #a83a32;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
}

.group-editor {
  min-width: 0;
}

.group-form-panel {
  border: 1px solid #e1e7ee;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.group-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.group-form-grid .primary-button,
.group-form-grid .archive-button {
  min-height: 38px;
  font-size: var(--text-sm);
  padding: 0 13px;
}

.archive-panel {
  margin-top: 18px;
  border-top: 1px solid #e9edf2;
  padding-top: 14px;
}

.archive-toggle {
  border: 1px solid #d8e6e7;
  border-radius: 7px;
  background: #fff;
  color: #007a78;
  cursor: pointer;
  font-weight: 800;
  min-height: 30px;
  padding: 0 10px;
  font-size: var(--text-sm);
}

.archive-content {
  display: none;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 14px;
}

.archive-content.open {
  display: grid;
}

.archive-content h3 {
  margin: 0 0 10px;
  font-size: var(--title-3);
}

.archive-content p {
  color: #526077;
  font-size: var(--text-sm);
}

.restore-row {
  width: 100%;
  min-height: 38px;
  border: 1px solid #e1e7ee;
  border-radius: 8px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 0 10px;
  cursor: pointer;
  color: #16233b;
  font-size: var(--text-normal);
}

.restore-row + .restore-row {
  margin-top: 8px;
}

.restore-row span {
  color: #007a78;
  font-weight: 800;
  font-size: 14px;
}

.archive-row {
  min-height: 42px;
  border: 1px solid #e1e7ee;
  border-radius: 8px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
}

.archive-row + .archive-row {
  margin-top: 8px;
}

.archive-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.restore-mini-button,
.delete-mini-button {
  min-height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  font-size: var(--text-sm);
  font-weight: 800;
  cursor: pointer;
}

.restore-mini-button {
  border: 1px solid #bfe7e2;
  background: #f2fbfa;
  color: #007a78;
}

.delete-mini-button {
  border: 1px solid #ffd7d2;
  background: #fff8f7;
  color: #b42318;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.capability-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.capability-card.good {
  background: #f2fbfa;
}

.capability-card.warning {
  background: #fff8f2;
}

.capability-card.later {
  background: #f8f5ff;
}

.capability-card p {
  color: #4f5d73;
  font-size: var(--text-normal);
  line-height: var(--line-height);
}

.grouped-category-bar .category-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.grouped-category-bar .category-mini-list span {
  min-height: 24px;
  border-radius: 7px;
  background: #eef3f8;
  color: #4f5d73;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: var(--text-small);
}

.savings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 762px;
  gap: 18px;
  align-items: start;
}

.savings-top-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0;
  margin-bottom: 14px;
}

.savings-total-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 13px 14px;
  min-height: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
}

.savings-total-summary strong {
  color: #087c5b;
  font-size: var(--text-md);
}

.savings-total-summary span {
  color: #526077;
  font-size: var(--text-sm);
}

.savings-summary-grid {
  display: block;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

.savings-summary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.savings-summary-grid article:first-child {
  align-self: start;
  min-height: 0;
  padding: 10px 12px;
}

.savings-summary-grid strong {
  color: #087c5b;
  font-size: var(--text-h3);
}

.savings-summary-grid span,
.reserved-note {
  color: #526077;
  font-size: var(--text-sm);
}

.account-dashboard-card .reserved-note {
  margin-top: auto;
}

.savings-reservation-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.savings-reservation-map h3 {
  margin: 0;
  font-size: var(--text-h3);
}

.savings-reservation-account {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.savings-reservation-account > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.savings-list {
  display: grid;
  gap: 10px;
}

.savings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 10px;
  cursor: default;
  position: relative;
}

.savings-card > div:first-of-type {
  padding-right: 48px;
}

.savings-card.selected,
.savings-card:hover {
  background: #f2fbfa;
  border-color: #83d2ce;
}

.savings-card small {
  color: #526077;
  display: block;
  margin-top: 2px;
}

.savings-account-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.savings-account-list span {
  border-radius: 7px;
  background: #eef3f8;
  color: #4f5d73;
  padding: 4px 8px;
  font-size: var(--text-sm);
}

.savings-card .savings-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.savings-edit-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.savings-card .savings-actions .compact-action-button {
  width: auto;
  justify-self: end;
}

.savings-delete-button {
  flex: 0 0 auto;
  padding-inline: 12px;
}

.form-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.reserved-note {
  display: block;
  margin-top: 8px;
}

body,
button,
input,
select,
textarea {
  font-size: var(--text-normal);
  line-height: var(--line-height);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.note-compose,
.tax-entry-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.simple-output-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.simple-output-list:empty {
  display: none;
}

.simple-output-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
  display: grid;
  gap: 4px;
}

.simple-output-list span {
  color: #526077;
  font-size: var(--text-small);
}

h1 {
  font-size: var(--title-page);
  line-height: 1.08;
  font-weight: 800;
}

h2,
.panel-heading h2,
.panel > h2,
.category-head h2 {
  font-size: var(--title-1);
  line-height: 1.2;
  font-weight: 800;
}

.form-panel > h2,
.compact-heading h2,
#accountFormTitle,
#budgetFormTitle,
.recurring-overview-panel > h2,
.variable-budget-panel h2 {
  font-size: var(--title-2);
  line-height: 1.25;
  font-weight: 800;
}

h3,
.recurring-group h3,
.category-chart-grid h3,
.variable-account-group h3,
.klarna-list-section h3,
.archive-content h3,
.capability-card h3 {
  font-size: var(--title-3);
  line-height: 1.25;
  font-weight: 800;
}

small,
label,
.brand span,
.eyebrow,
.panel-heading span,
.panel-subline,
.empty-note,
.info-box,
.subcopy,
.type-pill,
.pill,
.category-chip-list span,
.row-card small,
.recurring-item small,
.account-dashboard-card > div > span,
.account-dashboard-card dt,
.dashboard-budget-card span,
.category-bar span,
.nav-group-label {
  font-size: var(--text-small);
  line-height: 1.45;
  color: #4f5d73;
}

.text-normal {
  font-size: var(--text-normal);
  line-height: var(--line-height);
}

.text-small-info {
  font-size: var(--text-small);
  line-height: 1.45;
  color: #4f5d73;
}

.heading-1 {
  font-size: var(--title-1);
  line-height: 1.2;
  font-weight: 800;
}

.heading-2 {
  font-size: var(--title-2);
  line-height: 1.25;
  font-weight: 800;
}

.heading-3 {
  font-size: var(--title-3);
  line-height: 1.25;
  font-weight: 800;
}

.page-title {
  font-size: var(--title-page);
  line-height: 1.08;
  font-weight: 800;
}

.row-card,
.table-row,
.recurring-item,
.category-row,
.account-item,
.budget-item,
.dashboard-budget-card,
.category-bar {
  font-size: var(--text-normal);
  line-height: var(--line-height-compact);
}

.table-head,
.category-row-head,
.status-pill,
.type-pill,
.pill,
.category-chip-list span {
  font-size: var(--text-small);
  line-height: var(--line-height-compact);
}

.recurring-table-row,
.recurring-table-row.recurring-item,
.recurring-table-row.recurring-item strong,
.recurring-table-row.recurring-item small,
.recurring-table-row.recurring-item .amount {
  font-size: var(--text-sm);
}

input,
select {
  font-size: var(--text-normal);
  line-height: var(--line-height-compact);
}

.primary-button,
.secondary-button,
.archive-button,
.tiny-button,
.link-button,
.restore-row,
.archive-toggle,
.restore-mini-button,
.delete-mini-button {
  font-size: var(--text-normal);
  line-height: 1.25;
}

.archive-toggle,
.restore-mini-button,
.delete-mini-button {
  font-size: var(--text-small);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
    max-width: 100vw;
    height: auto;
    max-height: none;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    gap: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(22, 35, 59, .05);
    overflow: visible;
  }

  .brand {
    padding: 0;
    width: 100%;
    min-width: 0;
  }

  .brand > div:nth-child(2) {
    min-width: 0;
  }

  .brand strong,
  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .sidebar .nav {
    display: none;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100dvh - 86px);
    padding: 12px 0 4px;
    margin: 12px 0 0;
    gap: 8px;
    border-top: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.nav-open .nav {
    display: grid;
  }

  .sidebar:not(.nav-open) .nav {
    visibility: hidden;
  }

  .nav-button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .nav-group-title,
  .nav-group-label {
    margin-left: 8px;
  }

  .ghost-button { margin-top: 0; }

  .content {
    padding: 18px;
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .topbar, .two-column, .split, .account-layout, .savings-layout { grid-template-columns: 1fr; display: grid; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-head, .category-layout { grid-template-columns: 1fr; display: grid; }
  .category-head {
    margin-top: 0;
    margin-bottom: 14px;
    min-height: 0;
  }
  .category-actions {
    justify-content: start;
    flex-wrap: wrap;
  }
  .category-metrics, .group-grid { grid-template-columns: 1fr 1fr; }
  .group-layout { grid-template-columns: 1fr; }
  .category-form { grid-template-columns: 1fr 1fr; }
  .capability-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .content {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .panel {
    padding: 16px;
    overflow: hidden;
  }

  .table-row {
    min-width: 0;
    width: 100%;
  }

  .variable-table,
  .recurring-account-table,
  .recurring-table,
  .category-table {
    overflow: visible;
    gap: 8px;
  }

  .variable-table-row.table-head,
  .recurring-plan-row.table-head,
  .recurring-table-row.table-head,
  .category-row-head {
    display: none;
  }

  .variable-account-group h3,
  .recurring-account-group h3 {
    margin-bottom: 10px;
  }

  .variable-table-row:not(.table-head) {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .variable-table-row:not(.table-head) > span:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    min-width: 0;
  }

  .variable-table-row:not(.table-head) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    color: #526077;
  }

  .variable-table-row:not(.table-head) > strong {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .variable-table-row:not(.table-head) > span:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    color: #526077;
  }

  .variable-table-row:not(.table-head) > span:nth-child(5) {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    white-space: nowrap;
    max-width: 100%;
  }

  .variable-table-row:not(.table-head) > span:nth-child(6) {
    grid-column: 3;
    grid-row: 3;
    justify-self: end;
  }

  .variable-account-summary,
  .recurring-account-summary {
    grid-template-columns: 1fr;
  }

  .category-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-height: 0;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .category-row > span:first-child {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    font-weight: 800;
  }

  .category-row > span:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  .category-row > span:nth-child(3),
  .category-row > span:nth-child(4) {
    grid-column: 1;
    justify-self: start;
  }

  .category-row > span:last-child {
    grid-column: 2;
    grid-row: 1 / span 4;
    justify-self: end;
    align-self: center;
  }

  .category-type-row {
    margin: 12px 0 8px;
    border-radius: 8px;
  }

  .recurring-plan-row:not(.table-head) {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
  }

  .recurring-plan-row:not(.table-head) > span:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    color: #526077;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(4) {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    white-space: nowrap;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(5) {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(6) {
    grid-column: 2 / -1;
    grid-row: 4;
    justify-self: end;
    white-space: nowrap;
  }

  .recurring-table-row:not(.table-head) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .recurring-table-row:not(.table-head) > strong {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .recurring-table-row:not(.table-head) > small {
    grid-column: 1;
    min-width: 0;
  }

  .recurring-table-row:not(.table-head) > .amount {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    white-space: nowrap;
  }

  .recurring-table-row:not(.table-head) > span:last-child {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 560px) {
  .summary-grid, .savings-summary-grid { grid-template-columns: 1fr; }
  .category-metrics, .group-grid, .group-layout, .category-form { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .row-card { grid-template-columns: 1fr; }
  .amount { text-align: left; }
}

@media (max-width: 700px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .content,
  .panel,
  .variable-table,
  .recurring-account-table,
  .recurring-table,
  .category-table {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .variable-table-row.table-head,
  .recurring-plan-row.table-head,
  .recurring-table-row.table-head,
  .category-row-head {
    display: none !important;
  }

  .variable-table-row:not(.table-head) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    align-items: start;
    width: 100%;
    min-width: 0;
    padding: 12px;
  }

  .variable-table-row:not(.table-head) > span:first-child {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
  }

  .variable-table-row:not(.table-head) > span:first-child:empty {
    display: none;
  }

  .variable-table-row:not(.table-head) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    color: var(--muted);
    font-size: 14px;
  }

  .variable-table-row:not(.table-head) > strong {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    overflow-wrap: anywhere;
    font-style: normal;
    font-weight: 700;
  }

  .variable-table-row:not(.table-head) > span:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
  }

  .variable-table-row:not(.table-head) > span:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: center;
    max-width: 36vw;
    text-align: right;
    white-space: nowrap;
  }

  .variable-table-row:not(.table-head) > span:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }

  .category-row:not(.category-row-head) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    width: 100%;
    min-width: 0;
    padding: 12px;
  }

  .category-row:not(.category-row-head) > .category-name {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .category-row:not(.category-row-head) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  .category-row:not(.category-row-head) > span:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
  }

  .category-row:not(.category-row-head) > span:nth-child(4) {
    grid-column: 1;
    grid-row: 4;
    min-width: 0;
  }

  .category-row:not(.category-row-head) > span:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    justify-self: end;
  }

  .recurring-plan-row:not(.table-head) {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 6px 10px;
    width: 100%;
    min-width: 0;
    padding: 12px;
  }

  .recurring-plan-row:not(.table-head) > span:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    color: var(--muted);
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(4),
  .recurring-plan-row:not(.table-head) > span:nth-child(5),
  .recurring-plan-row:not(.table-head) > span:nth-child(6) {
    grid-column: 2;
    justify-self: stretch;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(4) { grid-row: 3; }
  .recurring-plan-row:not(.table-head) > span:nth-child(5) { grid-row: 4; }
  .recurring-plan-row:not(.table-head) > span:nth-child(6) {
    grid-row: 5;
    text-align: right;
  }

  .recurring-plan-row input {
    width: 100%;
    min-width: 0;
  }

  .row-edit-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }
}

/* Final mobile hardening: no desktop table or sidebar width may leak onto phones. */
@media (max-width: 820px) {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body {
    min-width: 0;
    font-size: 14px;
  }

  .app-shell {
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .sidebar {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 16px 16px 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
    overflow: visible !important;
    box-shadow: none;
  }

  .brand {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 52px !important;
    gap: 12px !important;
    align-items: center !important;
    width: 100%;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .brand-mark {
    width: 44px !important;
    height: 44px !important;
  }

  .brand strong {
    font-size: 24px !important;
    line-height: 1.08;
  }

  .brand span {
    font-size: 14px !important;
    line-height: 1.2;
  }

  .mobile-nav-toggle {
    display: grid !important;
    place-items: center;
    width: 52px !important;
    height: 52px !important;
    margin-left: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .sidebar:not(.nav-open) .nav {
    display: none !important;
    width: 100%;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }

  .sidebar.nav-open .nav {
    display: grid !important;
    width: 100%;
    margin: 12px 0 0 !important;
    padding: 12px 0 4px !important;
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    overflow-x: hidden;
    border-top: 1px solid var(--line);
  }

  .nav-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 22px 16px 48px !important;
    overflow-x: hidden !important;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0 !important;
    margin: 0 0 18px;
    padding: 0;
  }

  .topbar h1 {
    font-size: clamp(28px, 8vw, 34px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .topbar .month-picker {
    justify-self: start;
    width: 100%;
    max-width: 220px;
  }

  .view,
  .panel,
  .dashboard-grid,
  .summary-grid,
  .account-dashboard-grid,
  .split,
  .account-layout,
  .savings-layout,
  .transfer-layout,
  .klarna-layout,
  .recurring-layout,
  .variable-detail-layout,
  .category-layout,
  .table-scroll,
  .variable-table,
  .recurring-table,
  .recurring-account-table,
  .category-table,
  .balance-trend,
  .balance-chart,
  .chart-canvas {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .panel {
    padding: 16px;
    border-radius: 12px;
  }

  .dashboard-grid,
  .summary-grid,
  .account-dashboard-grid,
  .account-layout,
  .savings-layout,
  .transfer-layout,
  .klarna-layout,
  .recurring-layout,
  .variable-detail-layout,
  .category-layout,
  .form-row,
  .form-row.even,
  .form-row.transfer-row,
  .package-split-row,
  .modal-form .form-row,
  .modal-form .form-row.even,
  .modal-form .form-row.transfer-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .table-row {
    width: 100% !important;
    min-width: 0 !important;
  }

  .variable-table-row.table-head,
  .recurring-plan-row.table-head,
  .recurring-table-row.table-head,
  .category-row-head {
    display: none !important;
  }

  .variable-table-row:not(.table-head),
  .recurring-plan-row:not(.table-head),
  .recurring-table-row:not(.table-head),
  .category-row:not(.category-row-head) {
    display: grid !important;
    width: 100%;
    min-width: 0 !important;
    margin: 0 0 8px;
    padding: 12px;
    gap: 6px 10px;
    align-items: center;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .variable-table-row:not(.table-head) > span,
  .variable-table-row:not(.table-head) > strong,
  .recurring-plan-row:not(.table-head) > span,
  .recurring-plan-row:not(.table-head) > strong,
  .recurring-table-row:not(.table-head) > span,
  .recurring-table-row:not(.table-head) > strong,
  .recurring-table-row:not(.table-head) > small,
  .category-row:not(.category-row-head) > span {
    min-width: 0 !important;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .variable-table-row:not(.table-head) {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .variable-table-row:not(.table-head) > span:first-child {
    display: none;
  }

  .variable-table-row:not(.table-head) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    color: var(--muted);
  }

  .variable-table-row:not(.table-head) > strong {
    grid-column: 1;
    grid-row: 2;
    font-style: normal;
    font-weight: 700;
  }

  .variable-table-row:not(.table-head) > span:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    color: var(--muted);
  }

  .variable-table-row:not(.table-head) > span:nth-child(5) {
    grid-column: 1;
    grid-row: 4;
    justify-self: start;
    max-width: 100%;
    text-align: left;
    white-space: normal;
  }

  .variable-table-row:not(.table-head) > span:nth-child(6) {
    grid-column: 2;
    grid-row: 1 / span 4;
    justify-self: end;
    align-self: center;
  }

  .category-row:not(.category-row-head) {
    grid-template-columns: minmax(0, 1fr) 44px !important;
  }

  .category-row:not(.category-row-head) > .category-name {
    grid-column: 1;
    grid-row: 1;
  }

  .category-row:not(.category-row-head) > span:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .category-row:not(.category-row-head) > span:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }

  .category-row:not(.category-row-head) > span:nth-child(4) {
    grid-column: 1;
    grid-row: 4;
  }

  .category-row:not(.category-row-head) > span:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / span 4;
    justify-self: end;
    align-self: center;
  }

  .recurring-plan-row:not(.table-head) {
    grid-template-columns: 18px minmax(0, 1fr) auto !important;
  }

  .recurring-plan-row:not(.table-head) > span:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    color: var(--muted);
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(4) {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    white-space: nowrap;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(5) {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(6) {
    grid-column: 2 / -1;
    grid-row: 4;
    justify-self: end;
  }

  .recurring-plan-row input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .recurring-table-row:not(.table-head) {
    grid-template-columns: minmax(0, 1fr) auto 44px !important;
    gap: 6px 10px !important;
  }

  .recurring-table-row:not(.table-head) > strong {
    grid-column: 1;
    grid-row: 1;
  }

  .recurring-table-row:not(.table-head) > small:nth-of-type(1) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    text-align: right;
  }

  .recurring-table-row:not(.table-head) > small:nth-of-type(2) {
    grid-column: 1;
    grid-row: 3;
  }

  .recurring-table-row:not(.table-head) > small:nth-of-type(3) {
    grid-column: 1;
    grid-row: 4;
  }

  .recurring-table-row:not(.table-head) > .amount {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    align-self: center;
    white-space: nowrap;
  }

  .recurring-table-row:not(.table-head) > span:last-child {
    grid-column: 3;
    grid-row: 1 / span 4;
    justify-self: end;
    align-self: center;
  }

  .variable-account-summary,
  .recurring-account-summary,
  .savings-summary-grid,
  .chart-legend,
  .balance-legend {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px 12px;
    max-width: 100%;
    overflow: hidden;
  }

  .variable-account-summary > *,
  .recurring-account-summary > *,
  .savings-summary-grid > * {
    flex: 1 1 100%;
    min-width: 0;
  }

  .edit-modal {
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
  }

  .edit-modal-panel {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px);
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 18px;
    border-radius: 12px;
  }

  #editModalContent {
    max-height: calc(100dvh - 56px);
  }

  .edit-modal-panel h2 {
    padding-right: 48px;
    font-size: 24px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .modal-form,
  .modal-form label,
  .modal-form input,
  .modal-form select,
  .modal-form textarea,
  .modal-form .money-input,
  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  input,
  select,
  textarea,
  button,
  .empty-note,
  .panel-subline,
  .topbar-description,
  .row-card small,
  small,
  p {
    font-size: max(14px, 1em) !important;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px !important;
  }

  .money-input {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
  }

  .money-input.signed-money-input {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .money-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.18);
  }

  .money-input input:focus {
    outline: none;
    box-shadow: none;
  }

  .money-input span {
    flex: 0 0 auto;
  }

  .money-input .amount-sign {
    min-width: 24px;
    padding-left: 10px;
    padding-right: 0;
    text-align: center;
  }

  .row-edit-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }
}

@media (max-width: 820px) {
  .sidebar .brand {
    grid-template-columns: 52px minmax(0, 1fr) 38px !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .sidebar .brand-mark {
    width: 52px !important;
    height: 52px !important;
    flex-basis: 52px !important;
  }

  .sidebar .brand > div:nth-child(2) {
    min-height: 52px !important;
    display: flex !important;
    align-items: center !important;
  }

  .sidebar .brand strong {
    font-size: 32px !important;
    line-height: 1 !important;
    transform: translateY(1px) !important;
  }
}

@media (max-width: 820px) {
  body.mobile-nav-open .app-shell {
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.mobile-nav-open .sidebar.nav-open {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    background: #fff !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
  }

  body.mobile-nav-open .sidebar.nav-open .brand {
    position: relative !important;
    z-index: 2 !important;
    padding: 0 0 12px !important;
    border-bottom: 1px solid var(--line) !important;
  }

  body.mobile-nav-open .sidebar.nav-open .nav {
    display: grid !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 22px 2px calc(88px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-top: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

#categoryPieChart > .empty-note {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  white-space: nowrap !important;
}

.dashboard-empty-intro {
  display: grid !important;
  gap: 14px !important;
  margin: 18px 0 24px !important;
  padding: 20px 18px !important;
  border: 1px solid #d8e5df !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%) !important;
  box-shadow: 0 10px 24px rgba(23, 45, 77, .05) !important;
}

.dashboard-empty-intro h2 {
  margin: 0 !important;
  color: var(--ink) !important;
  font-size: 20px !important;
  line-height: 1.7 !important;
}

.dashboard-empty-intro p {
  margin: 0 !important;
  max-width: 66ch;
  color: #34445e !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
}

.dashboard-empty-intro p + p {
  padding-top: 2px;
}

body.font-medium .dashboard-empty-intro p {
  font-size: 17px !important;
  line-height: 1.72 !important;
}

body.font-medium .dashboard-empty-intro h2 {
  font-size: 22px !important;
  line-height: 1.72 !important;
}

body.font-large .dashboard-empty-intro p {
  font-size: 19px !important;
  line-height: 1.74 !important;
}

body.font-large .dashboard-empty-intro h2 {
  font-size: 24px !important;
  line-height: 1.74 !important;
}

.brand {
  align-items: center !important;
}

.brand > div:nth-child(2) {
  display: flex !important;
  align-items: center !important;
  min-height: 36px !important;
}

.brand strong {
  font-size: 26px !important;
  line-height: 1 !important;
  transform: translateY(1px);
}

@media (max-width: 820px) {
  .brand {
    grid-template-columns: 44px minmax(0, 1fr) 38px !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .brand-mark {
    width: 44px !important;
    height: 44px !important;
  }

  .brand > div:nth-child(2) {
    min-height: 44px !important;
  }

  .brand strong {
    font-size: 29px !important;
    line-height: 1 !important;
    transform: translateY(1px);
  }
}

/* App-wide readable-size modes. These intentionally sit last so no small fixed labels escape the setting. */
body.font-medium .view :where(p, span, small, strong, label, input, select, textarea, button, dt, dd, li),
body.font-medium .view :where(.empty-note, .panel-subline, .subcopy, .info-box, .amount, .type-pill, .pill),
body.font-medium .edit-modal :where(p, span, small, strong, label, input, select, textarea, button, dt, dd, li),
body.font-medium .sidebar :where(span, small, strong, button) {
  font-size: 16px !important;
  line-height: 1.45 !important;
}

body.font-medium .view :where(h2, h3, .dashboard-section-title, .panel-heading h2, .category-group-card h3),
body.font-medium .edit-modal :where(h2, h3) {
  font-size: 18px !important;
  line-height: 1.25 !important;
}

body.font-medium .view :where(.topbar h1, h1),
body.font-medium .edit-modal #editModalTitle {
  font-size: 22px !important;
  line-height: 1.15 !important;
}

body.font-medium .view :where(.amount, dd, .budget-summary strong, #klarnaOpenSum) {
  font-size: 17px !important;
}

body.font-medium .trend-line-chart text,
body.font-medium .trend-line-chart .trend-y-label,
body.font-medium .trend-line-chart .trend-x-label {
  font-size: 18px !important;
}

body.font-large .view :where(p, span, small, strong, label, input, select, textarea, button, dt, dd, li),
body.font-large .view :where(.empty-note, .panel-subline, .subcopy, .info-box, .amount, .type-pill, .pill),
body.font-large .edit-modal :where(p, span, small, strong, label, input, select, textarea, button, dt, dd, li),
body.font-large .sidebar :where(span, small, strong, button) {
  font-size: 18px !important;
  line-height: 1.48 !important;
}

body.font-large .view :where(h2, h3, .dashboard-section-title, .panel-heading h2, .category-group-card h3),
body.font-large .edit-modal :where(h2, h3) {
  font-size: 21px !important;
  line-height: 1.25 !important;
}

body.font-large .view :where(.topbar h1, h1),
body.font-large .edit-modal #editModalTitle {
  font-size: 25px !important;
  line-height: 1.14 !important;
}

body.font-large .view :where(.amount, dd, .budget-summary strong, #klarnaOpenSum) {
  font-size: 19px !important;
}

body.font-large .trend-line-chart text,
body.font-large .trend-line-chart .trend-y-label,
body.font-large .trend-line-chart .trend-x-label {
  font-size: 21px !important;
}

@media (max-width: 820px) {
  body.mobile-nav-open .sidebar.nav-open {
    position: sticky !important;
    inset: auto !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    padding: 12px 14px 0 !important;
    overflow: visible !important;
    background: #fff !important;
    border-bottom: 1px solid var(--line) !important;
  }

  body.mobile-nav-open .sidebar.nav-open .brand {
    padding: 0 0 12px !important;
    border-bottom: 0 !important;
  }

  body.mobile-nav-open .sidebar.nav-open .nav {
    position: fixed !important;
    inset: 61px 0 0 0 !important;
    z-index: 999 !important;
    width: 100vw !important;
    height: calc(100dvh - 61px) !important;
    max-height: calc(100dvh - 61px) !important;
    padding: 22px 16px calc(96px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    background: #fff !important;
    border-top: 1px solid var(--line) !important;
    box-shadow: none !important;
  }
}

@media (max-width: 430px) {
  .content {
    padding: 20px 14px 44px !important;
  }

  .panel {
    padding: 14px;
  }

  .topbar h1 {
    font-size: 30px;
  }
}

/* Mobile polish pass: make the iPhone UI lighter and denser. */
@media (max-width: 820px) {
  :root {
    --text-sm: 14px;
    --text-base: 15px;
    --text-md: 15px;
    --text-h3: 14px;
    --text-h2: 15px;
    --text-h1: 16px;
    --text-title: 19px;
    --title-page: 19px;
    --line-height: 1.32;
    --line-height-compact: 1.2;
  }

  body {
    background: #f9fbfd;
  }

  html.mobile-nav-open,
  body.mobile-nav-open {
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.mobile-nav-open {
    touch-action: none;
  }

  body.mobile-nav-open .content {
    display: none !important;
  }

  .sidebar {
    padding: 12px 14px 10px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 80 !important;
  }

  .brand-mark,
  .brand strong {
    cursor: pointer;
  }

  .brand {
    grid-template-columns: 36px minmax(0, 1fr) 46px !important;
    gap: 10px !important;
  }

  .brand-mark {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  .brand-mark::before {
    inset: 7px 8px;
    border-width: 4px;
  }

  .brand-mark::after {
    right: 7px;
    top: 13px;
    width: 6px;
    height: 6px;
  }

  .brand strong {
    font-size: 22px !important;
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background:
      linear-gradient(#23666a, #23666a) center calc(50% - 4.5px) / 14px 1.2px no-repeat,
      linear-gradient(#23666a, #23666a) center 50% / 14px 1.2px no-repeat,
      linear-gradient(#23666a, #23666a) center calc(50% + 4.5px) / 14px 1.2px no-repeat,
      #eef7f6 !important;
    box-shadow: none !important;
    padding: 0 !important;
    justify-self: center !important;
    margin-left: 0 !important;
    margin-right: 2px !important;
    position: relative !important;
    overflow: visible !important;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-toggle::before,
  .mobile-nav-toggle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 17px;
    height: 1.35px;
    border-radius: 999px;
    background: #23666a;
    opacity: 0;
    transform-origin: center;
    transition: opacity .12s ease, transform .16s ease;
  }

  .mobile-nav-toggle span {
    display: none !important;
  }

  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    background:
      linear-gradient(#23666a, #23666a) center calc(50% - 4.5px) / 14px 1.2px no-repeat,
      linear-gradient(#23666a, #23666a) center 50% / 14px 1.2px no-repeat,
      linear-gradient(#23666a, #23666a) center calc(50% + 4.5px) / 14px 1.2px no-repeat,
      #e2f2f0 !important;
    outline: 0 !important;
    box-shadow: inset 0 0 0 1px #a8dcd7 !important;
  }

  .sidebar.nav-open .mobile-nav-toggle,
  .sidebar.nav-open .mobile-nav-toggle:hover,
  .sidebar.nav-open .mobile-nav-toggle:focus-visible {
    background: #eef7f6 !important;
  }

  .sidebar.nav-open .mobile-nav-toggle::before {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .sidebar.nav-open .mobile-nav-toggle::after {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .sidebar.nav-open .nav {
    position: fixed !important;
    inset: 59px 0 0 0 !important;
    z-index: 79 !important;
    margin: 0 !important;
    padding: 14px 16px calc(22px + env(safe-area-inset-bottom)) !important;
    gap: 4px !important;
    width: 100vw !important;
    height: calc(100dvh - 59px) !important;
    max-height: calc(100dvh - 59px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    background: #fff !important;
    border-top: 1px solid var(--line) !important;
    box-shadow: 0 24px 40px rgba(22, 35, 59, .08) !important;
  }

  .nav-group-title {
    margin: 8px 8px 2px !important;
    font-size: 17px !important;
  }

  #settings .settings-form {
    gap: 18px !important;
  }

  #settings .settings-panel {
    gap: 16px !important;
    padding: 16px !important;
  }

  #settings .settings-form label {
    gap: 9px !important;
    margin: 0 !important;
  }

  #settings .settings-form select {
    min-height: 48px !important;
    line-height: 1.25 !important;
  }

  .nav-group-label {
    margin: 12px 8px 2px !important;
    font-size: 15px !important;
  }

  .nav-button {
    min-height: 44px !important;
    padding: 0 12px !important;
    gap: 12px !important;
    border-radius: 7px !important;
    font-size: 16px !important;
  }

  .nav-icon {
    width: 24px !important;
    height: 24px !important;
    font-size: 18px !important;
  }

  .content {
    padding: 14px 16px 36px !important;
  }

  .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    column-gap: 8px !important;
    row-gap: 6px !important;
    margin: 0 0 12px !important;
  }

  .topbar-title-row {
    gap: 6px !important;
    min-width: 0 !important;
    align-items: flex-start !important;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar-title-row h1 {
    min-width: 0 !important;
  }

  .hint-button {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 9px !important;
    padding: 0 !important;
    font-size: 14px !important;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding-top: 2px;
  }

  .topbar-actions > .page-actions,
  .topbar-actions > .quick-create-panel {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    width: auto !important;
    max-width: 34vw !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .topbar-actions > .category-head.page-actions {
    max-width: 58vw !important;
  }

  .topbar-actions > .page-actions:has(#newKlarnaModalButton) {
    max-width: 52vw !important;
    gap: 6px !important;
  }

  .topbar-actions > .category-head.page-actions .category-actions {
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    width: 100% !important;
  }

  .topbar-actions button {
    width: auto !important;
    max-width: 34vw !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  .topbar-actions > .category-head.page-actions button {
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 7px !important;
    font-size: 14px !important;
  }

  .topbar-actions .hint-button {
    width: 38px !important;
    max-width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
  }

  .topbar-actions > .page-actions:has(#newKlarnaModalButton) button {
    width: auto !important;
    max-width: 31vw !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  .topbar h1 {
    font-size: 19px !important;
    line-height: 1.12 !important;
  }

  .eyebrow {
    font-size: 14px !important;
    margin-bottom: 3px !important;
  }

  .view.active {
    gap: 10px !important;
  }

  .account-dashboard-grid:empty,
  .dashboard-budget-grid:empty {
    display: none !important;
  }

  .quick-entry-panel {
    margin-bottom: 0 !important;
  }

  .dashboard-grid,
  .summary-grid,
  .account-dashboard-grid,
  .dashboard-budget-grid,
  .category-chart-grid {
    gap: 10px !important;
  }

  .panel {
    padding: 12px 14px !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 20px rgba(22, 35, 59, .035) !important;
  }

  .panel-heading {
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  h2,
  .panel-heading h2,
  .panel > h2,
  .category-head h2 {
    font-size: 15px !important;
    line-height: 1.18 !important;
  }

  .form-panel > h2,
  .compact-heading h2,
  #accountFormTitle,
  #budgetFormTitle,
  .recurring-overview-panel > h2,
  .variable-budget-panel h2 {
    font-size: 15px !important;
  }

  .row-card,
  .dashboard-budget-card,
  .category-bar,
  .account-dashboard-card {
    padding: 9px 10px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
  }

  .empty-card strong {
    font-size: 14px !important;
  }

  .empty-card small {
    margin-top: 3px !important;
    font-size: 14px !important;
  }

  input,
  select,
  textarea {
    min-height: 40px !important;
    padding: 8px 10px !important;
    border-radius: 7px !important;
    font-size: 16px !important;
  }

  .primary-button,
  .secondary-button,
  .archive-button,
  .tiny-button,
  .compact-action-button,
  .link-button,
  .restore-row,
  .archive-toggle,
  .restore-mini-button,
  .delete-mini-button,
  .page-actions .primary-button,
  .page-actions .secondary-button,
  .page-actions .compact-action-button {
    min-height: 40px !important;
    padding-inline: 14px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    box-shadow: 0 5px 12px rgba(0, 122, 120, .12) !important;
  }

  .page-actions {
    gap: 8px !important;
    margin: 0 0 10px !important;
  }

  .category-inline-stats {
    gap: 8px !important;
    flex-wrap: wrap;
    min-height: 0;
    font-size: 14px !important;
  }

  .category-inline-stats span {
    line-height: 1.2;
  }

  .category-inline-stats strong {
    font-size: 15px !important;
  }

  .category-filter-tabs {
    gap: 6px !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .category-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-filter-button {
    flex: 0 0 auto;
    min-height: 36px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }

  .category-table {
    gap: 9px !important;
  }

  .category-group-card {
    padding: 10px !important;
    gap: 8px !important;
    box-shadow: none !important;
  }

  .category-group-header h2 {
    font-size: 15px !important;
  }

  .category-group-header span,
  .category-group-empty {
    font-size: 14px !important;
  }

  .category-group-list {
    gap: 5px !important;
  }

  .category-compact-row {
    grid-template-columns: minmax(0, 1fr) auto 36px !important;
    gap: 6px !important;
    min-height: 38px !important;
    padding: 5px 6px 5px 8px !important;
  }

  .category-compact-row strong {
    font-size: 14px !important;
  }

  .category-compact-row .type-pill {
    min-height: 22px !important;
    padding: 0 7px !important;
    font-size: 14px !important;
  }

  .category-type-badges {
    gap: 4px !important;
  }

  .category-type-badges:has(.type-pill:nth-child(2)) {
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 3px !important;
  }

  .category-compact-row .row-edit-button {
    width: 36px !important;
    min-width: 36px !important;
    height: 34px !important;
    min-height: 34px !important;
  }

  .edit-modal {
    z-index: 120 !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(16px + env(safe-area-inset-bottom)) !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
  }

  .edit-modal-panel {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 26px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    margin: 0 auto !important;
    padding: 18px 14px 16px !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
  }

  #editModalContent {
    max-height: calc(100dvh - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }

  .edit-modal-panel h2,
  #editModalContent h2 {
    padding-right: 46px !important;
    font-size: 20px !important;
  }

  .modal-close {
    top: 0 !important;
    right: 12px !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .trend-line-chart {
    gap: 8px !important;
    overflow: hidden !important;
  }

  .trend-line-chart svg {
    height: 218px !important;
    border-radius: 8px !important;
    background: #fbfcfd !important;
  }
}

@media (max-width: 430px) {
  .content {
    padding: 13px 16px 34px !important;
  }

  .topbar h1 {
    font-size: 19px !important;
  }

  .panel {
    padding: 12px !important;
  }
}

@media (max-width: 820px) {
  .dashboard-action-grid {
    gap: 9px !important;
  }

  .dashboard-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .dashboard-action-tile {
    min-height: 78px !important;
    padding: 10px !important;
    font-size: 14px !important;
    line-height: 1.22 !important;
  }

  .account-dashboard-card dl,
  .monthly-account-columns {
    grid-template-columns: 1fr !important;
  }

  .reserved-breakdown {
    gap: 6px !important;
  }

  .reserved-breakdown span,
  .monthly-account-columns span,
  .monthly-account-remaining span {
    font-size: 14px !important;
  }

  .trend-y-label {
    font-size: 20px !important;
  }
}

@media (max-width: 760px) {
  .recurring-plan-row:not(.table-head) {
    grid-template-columns: 18px minmax(0, 1fr) !important;
    gap: 8px 10px !important;
    align-items: start !important;
  }

  .recurring-plan-row:not(.table-head) > span:first-child {
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: start;
    padding-top: 3px;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-heading {
    grid-column: 2;
    grid-row: 1;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-planned {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-corrected {
    grid-column: 2;
    grid-row: 3;
    display: grid;
    gap: 5px;
    min-width: 0;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-diff {
    grid-column: 2;
    grid-row: 4;
    justify-self: end;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  html.modal-open,
  body.modal-open {
    height: auto !important;
    min-height: 100% !important;
    overflow: auto !important;
    overscroll-behavior: auto !important;
  }

  body.modal-open .app-shell {
    pointer-events: none !important;
  }

  body.modal-open .app-shell > :not(.edit-modal) {
    visibility: hidden !important;
  }

  .edit-modal {
    position: absolute !important;
    top: var(--modal-top, 0px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    z-index: 120 !important;
    display: block !important;
    width: 100% !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
    background: #fff !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }

  .edit-modal-backdrop {
    position: absolute !important;
    inset: 0 !important;
    min-height: 100% !important;
    background: transparent !important;
    touch-action: auto !important;
  }

  .edit-modal-panel {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(14px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: auto !important;
  }

  #editModalContent {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: auto !important;
    touch-action: auto !important;
  }

  .edit-modal .modal-form,
  .edit-modal .modal-info,
  .edit-modal .modal-form label,
  .edit-modal .modal-form input,
  .edit-modal .modal-form select,
  .edit-modal .modal-form textarea,
  .edit-modal .modal-form .money-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .edit-modal input,
  .edit-modal select,
  .edit-modal textarea {
    font-size: 16px !important;
  }

  .edit-modal .modal-close {
    position: sticky !important;
    top: calc(8px + env(safe-area-inset-top)) !important;
    right: auto !important;
    z-index: 5 !important;
    display: grid !important;
    margin-left: auto !important;
    margin-bottom: 8px !important;
  }

  .edit-modal .modal-actions {
    position: static !important;
    bottom: auto !important;
    padding-top: 8px !important;
    background: #fff !important;
  }

  .edit-modal[hidden] {
    display: none !important;
  }
}

.edit-modal[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .recurring-plan-row:not(.table-head) {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr) !important;
    grid-template-areas:
      "status heading"
      ". planned"
      ". corrected"
      ". diff" !important;
    gap: 9px 12px !important;
    align-items: start !important;
  }

  .recurring-plan-row:not(.table-head) > span:first-child {
    grid-area: status !important;
    align-self: start !important;
    padding-top: 4px !important;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-heading {
    grid-area: heading !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 14px !important;
    min-width: 0 !important;
  }

  .recurring-plan-heading strong {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }

  .recurring-plan-heading time {
    flex: 0 0 auto !important;
    color: #526077 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-planned {
    grid-area: planned !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: baseline !important;
    gap: 8px !important;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-corrected {
    grid-area: corrected !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
  }

  .recurring-plan-corrected input {
    width: 112px !important;
    max-width: 42vw !important;
    flex: 0 0 auto !important;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-diff {
    grid-area: diff !important;
    justify-self: start !important;
    min-height: 0 !important;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(3),
  .recurring-plan-row:not(.table-head) > span:nth-child(4),
  .recurring-plan-row:not(.table-head) > span:nth-child(5) {
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: auto !important;
    white-space: normal !important;
  }
}

@media (max-width: 760px) {
  .recurring-plan-row:not(.table-head) {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
    padding: 14px 12px !important;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-status {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: start !important;
    padding-top: 4px !important;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-card-body {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    gap: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .recurring-plan-card-body .recurring-plan-heading {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 12px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .recurring-plan-card-body .recurring-plan-heading strong {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    font-size: 15px !important;
  }

  .recurring-plan-card-body .recurring-plan-heading time {
    flex: 0 0 auto !important;
    color: #526077 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  .recurring-plan-line {
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
  }

  .recurring-plan-planned {
    justify-content: flex-start !important;
  }

  .recurring-plan-corrected {
    justify-content: flex-start !important;
    display: flex !important;
    align-items: center !important;
  }

  .recurring-plan-planned span,
  .recurring-plan-planned strong,
  .recurring-plan-corrected span {
    display: inline !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .recurring-plan-corrected input {
    width: 112px !important;
    max-width: 42vw !important;
    flex: 0 0 112px !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
  }

  .recurring-plan-diff {
    justify-self: start !important;
    min-height: 0 !important;
  }

  .recurring-plan-row:not(.table-head) > span:nth-child(n),
  .recurring-plan-row:not(.table-head) > label:nth-child(n) {
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: auto !important;
    white-space: normal !important;
  }
}

@media (max-width: 760px) {
  .recurring-plan-row:not(.table-head) {
    display: flex !important;
    align-items: flex-start !important;
    min-height: 0 !important;
    height: auto !important;
    align-content: start !important;
    padding: 14px 12px 12px !important;
    gap: 10px !important;
  }

  .recurring-plan-row:not(.table-head) > span.recurring-plan-status:first-child {
    flex: 0 0 18px !important;
    align-self: start !important;
    padding-top: 4px !important;
    margin: 0 !important;
  }

  .recurring-plan-row:not(.table-head) > .recurring-plan-card-body {
    flex: 1 1 auto !important;
    align-content: start !important;
    gap: 7px !important;
    min-width: 0 !important;
  }

  .recurring-plan-corrected {
    align-items: center !important;
  }

  .recurring-plan-diff:empty {
    display: none !important;
  }

  .recurring-account-summary {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  .recurring-account-summary > * {
    min-width: 0 !important;
    padding: 8px 10px !important;
  }

  .recurring-account-summary > article:nth-child(3) {
    grid-column: 1 / -1 !important;
  }

  .recurring-account-summary span {
    margin-bottom: 2px !important;
  }

  .account-dashboard-card dl {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr) !important;
    gap: 10px 24px !important;
  }

  .account-dashboard-card dl > div:nth-child(3) {
    grid-column: 1 / -1 !important;
  }

  .account-dashboard-card dl > div:nth-child(2) {
    justify-self: end !important;
    text-align: right !important;
    min-width: 0 !important;
  }

  .account-dashboard-card dl.account-dashboard-metrics {
    grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr) !important;
    gap: 4px 20px !important;
  }

  .account-dashboard-card dl.account-dashboard-metrics > div:nth-child(3) {
    grid-column: auto !important;
  }

  .account-dashboard-card dl.account-dashboard-metrics > div:nth-child(2),
  .account-dashboard-card dl.account-dashboard-metrics > div:nth-child(4) {
    justify-self: stretch !important;
    text-align: right !important;
    min-width: 0 !important;
  }

  .account-dashboard-card dt {
    line-height: 1.2 !important;
  }

  .recurring-account-group > h3 {
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    margin: 0 0 8px !important;
  }

  .recurring-plan-card-body .recurring-plan-heading strong {
    font-size: 14px !important;
  }

  .recurring-account-group {
    display: grid !important;
    gap: 10px !important;
    padding: 12px !important;
    border: 1.5px solid var(--account-color, var(--line)) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .recurring-account-group + .recurring-account-group {
    margin-top: 14px !important;
  }

  .recurring-account-group .recurring-account-table {
    display: grid !important;
    gap: 8px !important;
  }

  .recurring-account-group > h3 {
    display: block !important;
    margin: 0 0 2px !important;
    padding: 0 !important;
    background: transparent !important;
    border-bottom: 0 !important;
    color: var(--ink) !important;
    letter-spacing: 0 !important;
  }

  .recurring-account-group .recurring-plan-row:not(.table-head),
  .recurring-account-group .recurring-account-summary > article {
    background: #fbfcfd !important;
  }

  #variableList > .variable-account-group {
    display: grid !important;
    gap: 10px !important;
    padding: 12px !important;
    border: 1.5px solid var(--account-color, var(--line)) !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  #variableList > .variable-account-group + .variable-account-group {
    margin-top: 14px !important;
  }

  #variableList > .variable-account-group > h3 {
    display: block !important;
    margin: 0 0 2px !important;
    padding: 0 !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    color: var(--ink) !important;
    letter-spacing: 0 !important;
  }

  #variableList > .variable-account-group .variable-table-row:not(.table-head),
  #variableList > .variable-account-group .variable-account-summary > article {
    background: #fbfcfd !important;
  }

  #variableList .variable-table-row:not(.table-head) {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 6px 12px !important;
  }

  #variableList .variable-table-row:not(.table-head) > span:nth-child(5) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: end !important;
    padding-right: 0 !important;
    margin-right: 2px !important;
  }

  #variableList .variable-table-row:not(.table-head) > span:nth-child(6) {
    grid-column: 3 !important;
    grid-row: 1 / span 3 !important;
    align-self: center !important;
    justify-self: end !important;
    margin-left: 4px !important;
  }

  #variableList .variable-table-row:not(.table-head) > span:nth-child(6) .row-edit-button {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  #variableList .variable-account-summary {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  #variableList .variable-account-summary > * {
    min-width: 0 !important;
    padding: 8px 10px !important;
  }

  #variableList .variable-account-summary > article:nth-child(3) {
    grid-column: 1 / -1 !important;
  }

  #variableList .variable-account-summary.has-klarna > article:nth-child(3) {
    grid-column: auto !important;
  }

  #variableList .variable-account-summary.has-klarna > article:nth-child(4) {
    grid-column: auto !important;
  }

  #variableList .variable-account-summary span {
    margin-bottom: 2px !important;
  }

  .recurring-overview-panel {
    margin-top: 18px !important;
  }
}

/* Final font-size scaling pass: keep "klein" unchanged, make medium/large reach dense cards and help modals too. */
body.font-medium .modal-info,
body.font-medium .modal-info p,
body.font-medium .edit-modal .modal-info,
body.font-medium .edit-modal .modal-info p,
body.font-medium #editModalContent .modal-info,
body.font-medium #editModalContent .modal-info p,
body.font-medium .info-box,
body.font-medium .modal-info-example,
body.font-medium .modal-info-example div {
  font-size: 17px !important;
  line-height: 1.62 !important;
}

body.font-medium .dashboard-section-title,
body.font-medium .dashboard-action-section h2,
body.font-medium .dashboard-empty-intro,
body.font-medium .dashboard-empty-intro p,
body.font-medium .dashboard-action-tile,
body.font-medium .account-dashboard-card,
body.font-medium .account-dashboard-card strong,
body.font-medium .account-dashboard-card span,
body.font-medium .account-dashboard-card dt,
body.font-medium .account-dashboard-card dd,
body.font-medium .account-dashboard-card .reserved-note,
body.font-medium .reserved-breakdown,
body.font-medium .reserved-breakdown strong,
body.font-medium .reserved-breakdown span,
body.font-medium .monthly-account-card,
body.font-medium .monthly-account-card h3,
body.font-medium .monthly-account-columns span,
body.font-medium .monthly-account-remaining span {
  font-size: 16px !important;
}

body.font-medium .account-dashboard-card dd,
body.font-medium .dashboard-section-title,
body.font-medium .dashboard-empty-intro h2,
body.font-medium .dashboard-action-section h2 {
  font-size: 17px !important;
}

body.font-medium .trend-y-label,
body.font-medium .trend-x-label {
  font-size: 16px !important;
}

body.font-medium .dashboard-budget-card,
body.font-medium .dashboard-budget-card *,
body.font-medium .savings-dashboard-card,
body.font-medium .savings-dashboard-card *,
body.font-medium .dashboard-budget-grid,
body.font-medium .dashboard-budget-grid *,
body.font-medium .variable-account-group,
body.font-medium .variable-account-group *,
body.font-medium .variable-table-row,
body.font-medium .variable-table-row *,
body.font-medium .variable-account-summary,
body.font-medium .variable-account-summary *,
body.font-medium .recurring-account-group,
body.font-medium .recurring-account-group *,
body.font-medium .recurring-table-row,
body.font-medium .recurring-table-row *,
body.font-medium .recurring-plan-row,
body.font-medium .recurring-plan-row *,
body.font-medium .recurring-account-summary,
body.font-medium .recurring-account-summary *,
body.font-medium .row-card,
body.font-medium .row-card *,
body.font-medium .empty-card,
body.font-medium .empty-card *,
body.font-medium .category-compact-row,
body.font-medium .category-compact-row *,
body.font-medium .recurring-group,
body.font-medium .recurring-group *,
body.font-medium #recurringList,
body.font-medium #recurringList *,
body.font-medium #klarnaList,
body.font-medium #klarnaList *,
body.font-medium #klarnaPaidList,
body.font-medium #klarnaPaidList *,
body.font-medium #klarnaPackageList,
body.font-medium #klarnaPackageList *,
body.font-medium #klarnaOpenSum,
body.font-medium .klarna-list-section,
body.font-medium .klarna-list-section *,
body.font-medium #categoryPieChart,
body.font-medium #categoryPieChart *,
body.font-medium .category-pie-section,
body.font-medium .category-pie-section *,
body.font-medium .pie-legend,
body.font-medium .pie-legend *,
body.font-medium .category-breakdown-card,
body.font-medium .category-breakdown-card *,
body.font-medium .category-bar,
body.font-medium .category-bar *,
body.font-medium .savings-card,
body.font-medium .savings-card *,
body.font-medium .budget-item,
body.font-medium .budget-item * {
  font-size: 16px !important;
}

body.font-medium .trend-line-chart text,
body.font-medium .trend-line-chart .trend-y-label,
body.font-medium .trend-line-chart .trend-x-label {
  font-size: 18px !important;
}

body.font-large .modal-info,
body.font-large .modal-info p,
body.font-large .edit-modal .modal-info,
body.font-large .edit-modal .modal-info p,
body.font-large #editModalContent .modal-info,
body.font-large #editModalContent .modal-info p,
body.font-large .info-box,
body.font-large .modal-info-example,
body.font-large .modal-info-example div {
  font-size: 19px !important;
  line-height: 1.65 !important;
}

body.font-large .dashboard-section-title,
body.font-large .dashboard-action-section h2,
body.font-large .dashboard-empty-intro,
body.font-large .dashboard-empty-intro p,
body.font-large .dashboard-action-tile,
body.font-large .account-dashboard-card,
body.font-large .account-dashboard-card strong,
body.font-large .account-dashboard-card span,
body.font-large .account-dashboard-card dt,
body.font-large .account-dashboard-card dd,
body.font-large .account-dashboard-card .reserved-note,
body.font-large .reserved-breakdown,
body.font-large .reserved-breakdown strong,
body.font-large .reserved-breakdown span,
body.font-large .monthly-account-card,
body.font-large .monthly-account-card h3,
body.font-large .monthly-account-columns span,
body.font-large .monthly-account-remaining span {
  font-size: 18px !important;
}

body.font-large .account-dashboard-card dd,
body.font-large .dashboard-section-title,
body.font-large .dashboard-empty-intro h2,
body.font-large .dashboard-action-section h2 {
  font-size: 19px !important;
}

body.font-large .trend-y-label,
body.font-large .trend-x-label {
  font-size: 18px !important;
}

body.font-large .dashboard-budget-card,
body.font-large .dashboard-budget-card *,
body.font-large .savings-dashboard-card,
body.font-large .savings-dashboard-card *,
body.font-large .dashboard-budget-grid,
body.font-large .dashboard-budget-grid *,
body.font-large .variable-account-group,
body.font-large .variable-account-group *,
body.font-large .variable-table-row,
body.font-large .variable-table-row *,
body.font-large .variable-account-summary,
body.font-large .variable-account-summary *,
body.font-large .recurring-account-group,
body.font-large .recurring-account-group *,
body.font-large .recurring-table-row,
body.font-large .recurring-table-row *,
body.font-large .recurring-plan-row,
body.font-large .recurring-plan-row *,
body.font-large .recurring-account-summary,
body.font-large .recurring-account-summary *,
body.font-large .row-card,
body.font-large .row-card *,
body.font-large .empty-card,
body.font-large .empty-card *,
body.font-large .category-compact-row,
body.font-large .category-compact-row *,
body.font-large .recurring-group,
body.font-large .recurring-group *,
body.font-large #recurringList,
body.font-large #recurringList *,
body.font-large #klarnaList,
body.font-large #klarnaList *,
body.font-large #klarnaPaidList,
body.font-large #klarnaPaidList *,
body.font-large #klarnaPackageList,
body.font-large #klarnaPackageList *,
body.font-large #klarnaOpenSum,
body.font-large .klarna-list-section,
body.font-large .klarna-list-section *,
body.font-large #categoryPieChart,
body.font-large #categoryPieChart *,
body.font-large .category-pie-section,
body.font-large .category-pie-section *,
body.font-large .pie-legend,
body.font-large .pie-legend *,
body.font-large .category-breakdown-card,
body.font-large .category-breakdown-card *,
body.font-large .category-bar,
body.font-large .category-bar *,
body.font-large .savings-card,
body.font-large .savings-card *,
body.font-large .budget-item,
body.font-large .budget-item * {
  font-size: 18px !important;
}

body.font-large .trend-line-chart text,
body.font-large .trend-line-chart .trend-y-label,
body.font-large .trend-line-chart .trend-x-label {
  font-size: 20px !important;
}

@media (max-width: 820px) {
  #variableList .variable-table-row:not(.table-head) {
    grid-template-columns: minmax(0, 1fr) 52px !important;
    gap: 5px 12px !important;
    align-items: start !important;
  }

  #variableList .variable-table-row:not(.table-head) > span:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  #variableList .variable-table-row:not(.table-head) > strong {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  #variableList .variable-table-row:not(.table-head) > span:nth-child(4) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }

  #variableList .variable-table-row:not(.table-head) > span:nth-child(5) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: start !important;
    max-width: none !important;
    margin: 0 !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  #variableList .variable-table-row:not(.table-head) > span:nth-child(6) {
    grid-column: 2 !important;
    grid-row: 2 / span 2 !important;
    justify-self: end !important;
    align-self: center !important;
    margin: 0 !important;
  }

  .recurring-table-row.recurring-item {
    grid-template-columns: minmax(0, 1fr) minmax(90px, auto) 44px !important;
    gap: 4px 10px !important;
    padding: 10px 12px !important;
  }

  .recurring-table-row.recurring-item > strong {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .recurring-table-row.recurring-item > small:nth-of-type(1) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    text-align: right !important;
  }

  .recurring-table-row.recurring-item > small:nth-of-type(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .recurring-table-row.recurring-item > small:nth-of-type(3) {
    grid-column: 1 !important;
    grid-row: 3 !important;
    margin-top: 0 !important;
  }

  .recurring-table-row.recurring-item > .amount {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    align-self: center !important;
  }

  .recurring-table-row.recurring-item > span:last-child {
    grid-column: 3 !important;
    grid-row: 2 / span 2 !important;
    align-self: end !important;
    justify-self: end !important;
  }

  .recurring-action-card {
    grid-template-columns: 22px minmax(0, 1fr) !important;
    gap: 8px 10px !important;
    padding: 12px !important;
  }

  .recurring-action-card .amount {
    grid-column: 2 !important;
    justify-self: start !important;
  }
}

@media (max-width: 820px) {
  body.mobile-nav-open .app-shell {
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.mobile-nav-open .sidebar.nav-open {
    position: sticky !important;
    top: 0 !important;
    inset: auto !important;
    z-index: 1000 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 12px 14px 0 !important;
    overflow: visible !important;
    background: #fff !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  body.mobile-nav-open .sidebar.nav-open .brand {
    grid-template-columns: 78px minmax(0, 1fr) 56px !important;
    min-height: 118px !important;
    padding: 10px 0 18px !important;
    align-items: center !important;
    gap: 12px !important;
    border-bottom: 0 !important;
  }

  body.mobile-nav-open .sidebar.nav-open .brand-mark {
    width: 78px !important;
    height: 78px !important;
  }

  body.mobile-nav-open .sidebar.nav-open .brand > div:nth-child(2) {
    min-height: 78px !important;
    display: flex !important;
    align-items: center !important;
  }

  body.mobile-nav-open .sidebar.nav-open .brand strong {
    font-size: 43px !important;
    line-height: 1 !important;
    transform: translateY(1px) !important;
  }

  body.mobile-nav-open .sidebar.nav-open .mobile-nav-toggle {
    width: 56px !important;
    min-width: 56px !important;
    height: 56px !important;
    justify-self: end !important;
  }

  body.mobile-nav-open .sidebar.nav-open .nav {
    position: fixed !important;
    inset: 119px 0 0 0 !important;
    z-index: 999 !important;
    width: 100vw !important;
    height: calc(100dvh - 119px) !important;
    max-height: calc(100dvh - 119px) !important;
    margin: 0 !important;
    padding: 24px 16px calc(104px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    background: #fff !important;
    border-top: 1px solid var(--line) !important;
    box-shadow: none !important;
  }
}

@media (max-width: 820px) {
  .brand,
  body.mobile-nav-open .sidebar.nav-open .brand {
    grid-template-columns: 62px minmax(0, 1fr) 46px !important;
    min-height: 84px !important;
    padding: 10px 0 !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .brand-mark,
  body.mobile-nav-open .sidebar.nav-open .brand-mark {
    width: 62px !important;
    height: 62px !important;
  }

  .brand > div:nth-child(2),
  body.mobile-nav-open .sidebar.nav-open .brand > div:nth-child(2) {
    min-height: 62px !important;
    display: flex !important;
    align-items: center !important;
  }

  .brand strong,
  body.mobile-nav-open .sidebar.nav-open .brand strong {
    font-size: 39px !important;
    line-height: 1 !important;
    transform: translateY(1px) !important;
  }

  body.mobile-nav-open .sidebar.nav-open .mobile-nav-toggle {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
  }

  body.mobile-nav-open .sidebar.nav-open .nav {
    inset: 97px 0 0 0 !important;
    height: calc(100dvh - 97px) !important;
    max-height: calc(100dvh - 97px) !important;
  }
}

@media (max-width: 820px) {
  .sidebar .brand,
  .sidebar.nav-open .brand,
  body.mobile-nav-open .sidebar.nav-open .brand {
    grid-template-columns: 56px minmax(0, 1fr) 46px !important;
    min-height: 74px !important;
    padding: 8px 0 10px !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .sidebar .brand-mark,
  .sidebar.nav-open .brand-mark,
  body.mobile-nav-open .sidebar.nav-open .brand-mark {
    width: 56px !important;
    height: 56px !important;
  }

  .sidebar .brand > div:nth-child(2),
  .sidebar.nav-open .brand > div:nth-child(2),
  body.mobile-nav-open .sidebar.nav-open .brand > div:nth-child(2) {
    min-height: 56px !important;
    display: flex !important;
    align-items: center !important;
  }

  .sidebar .brand strong,
  .sidebar.nav-open .brand strong,
  body.mobile-nav-open .sidebar.nav-open .brand strong {
    font-size: 34px !important;
    line-height: 1 !important;
    transform: translateY(1px) !important;
  }

  .sidebar.nav-open .nav,
  body.mobile-nav-open .sidebar.nav-open .nav {
    inset: 94px 0 0 0 !important;
    height: calc(100dvh - 94px) !important;
    max-height: calc(100dvh - 94px) !important;
  }
}

@media (max-width: 820px) {
  .sidebar,
  body.mobile-nav-open .sidebar.nav-open {
    padding: 12px 16px 0 !important;
    background: #fff !important;
  }

  .sidebar .brand,
  .sidebar.nav-open .brand,
  body.mobile-nav-open .sidebar.nav-open .brand {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 48px !important;
    gap: 12px !important;
    align-items: center !important;
    min-height: 64px !important;
    height: 64px !important;
    padding: 0 !important;
  }

  .sidebar .brand-mark,
  .sidebar.nav-open .brand-mark,
  body.mobile-nav-open .sidebar.nav-open .brand-mark {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .sidebar .brand > div:nth-child(2),
  .sidebar.nav-open .brand > div:nth-child(2),
  body.mobile-nav-open .sidebar.nav-open .brand > div:nth-child(2) {
    min-height: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  .sidebar .brand strong,
  .sidebar.nav-open .brand strong,
  body.mobile-nav-open .sidebar.nav-open .brand strong {
    display: block !important;
    font-family: "Comfortaa", system-ui, sans-serif !important;
    font-size: 26px !important;
    line-height: 1 !important;
    transform: translateY(1px) !important;
  }

  .sidebar .mobile-nav-toggle,
  .sidebar.nav-open .mobile-nav-toggle,
  body.mobile-nav-open .sidebar.nav-open .mobile-nav-toggle {
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    justify-self: end !important;
    align-self: center !important;
  }

  .sidebar.nav-open .nav,
  body.mobile-nav-open .sidebar.nav-open .nav {
    inset: 77px 0 0 0 !important;
    height: calc(100dvh - 77px) !important;
    max-height: calc(100dvh - 77px) !important;
  }
}

.dashboard-empty-intro h2,
body.font-medium .dashboard-empty-intro h2,
body.font-large .dashboard-empty-intro h2 {
  line-height: 1.7 !important;
}

.backup-panel {
  display: grid;
  gap: 14px;
}

.backup-panel-heading {
  margin-bottom: 0;
}

.backup-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-file-button {
  position: relative;
  cursor: pointer;
}

.backup-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.backup-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.backup-status-grid article,
.backup-history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.backup-status-grid strong,
.backup-status-grid span,
.backup-history-item strong,
.backup-history-item span {
  display: block;
}

.backup-status-grid strong,
.backup-history-item strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.backup-status-grid span,
.backup-history-item span {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: 4px;
}

.backup-message {
  min-height: 20px;
  color: #2f6f73;
  font-size: var(--text-sm);
  font-weight: 800;
}

.backup-message[data-tone="bad"] {
  color: var(--danger);
}

.backup-history-list {
  display: grid;
  gap: 10px;
}

.backup-history-list h3 {
  margin: 0;
  font-size: var(--title-3);
}

.backup-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.backup-history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 820px) {
  .backup-status-grid,
  .backup-history-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .backup-action-row,
  .backup-history-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .backup-action-row .primary-button,
  .backup-action-row .secondary-button,
  .backup-history-actions .secondary-button,
  .backup-history-actions .archive-button {
    width: 100%;
  }
}

.backup-page-panel {
  display: grid;
  gap: 6px;
}

.backup-page-panel .backup-page-heading {
  margin-bottom: 0 !important;
}

.backup-page-panel .backup-primary-actions {
  margin-top: 0 !important;
}

.backup-page-heading,
.backup-history-heading {
  align-items: start;
}

.backup-page-heading .backup-message {
  justify-self: end;
  text-align: right;
  max-width: 320px;
}

.backup-primary-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.backup-primary-actions .primary-button,
.backup-primary-actions .secondary-button,
.backup-history-actions .secondary-button,
.backup-history-actions .archive-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}

.backup-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.backup-overview-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.backup-overview-grid strong,
.backup-overview-grid span {
  display: block;
}

.backup-overview-grid strong {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.backup-overview-grid span {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: 5px;
  line-height: 1.35;
}

.backup-history-panel {
  display: grid;
  gap: 14px;
}

.server-backup-panel {
  display: grid;
  gap: 14px;
}

.server-backup-heading {
  align-items: start;
}

.server-backup-heading .secondary-button {
  justify-self: end;
}

.server-backup-list {
  display: grid;
  gap: 8px;
}

.server-backup-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.server-backup-item strong,
.server-backup-item span {
  display: block;
}

.server-backup-item strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.server-backup-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.server-backup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.backup-history-list {
  gap: 8px;
}

.backup-history-item {
  border-radius: 8px;
  background: #ffffff;
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
}

.backup-history-main {
  min-width: 0;
}

.backup-history-main small {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.backup-history-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  align-items: center;
}

.danger-lite-button {
  color: var(--danger) !important;
  border-color: #f4c7c2 !important;
  background: #fffafa !important;
}

.danger-lite-button:hover {
  background: #fff1f0 !important;
}

#clearBackupHistoryButton {
  justify-self: end;
}

@media (max-width: 980px) {
  .backup-primary-actions,
  .backup-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .backup-history-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-backup-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .backup-history-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .backup-page-heading .backup-message,
  #clearBackupHistoryButton,
  .server-backup-heading .secondary-button {
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .backup-primary-actions,
  .backup-overview-grid,
  .backup-history-actions,
  .server-backup-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .reminder-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .reminder-action-button {
    width: 100%;
  }
}

/* Final modal containment: info/help dialogs scroll inside the dialog, not the page behind it. */
body.modal-open {
  position: static !important;
  inset: auto !important;
  width: 100%;
  overflow: hidden !important;
}

.edit-modal {
  position: fixed !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  min-height: 100dvh !important;
  padding: 16px !important;
  overflow: hidden !important;
  background: rgba(22, 35, 59, .28);
  overscroll-behavior: contain !important;
}

.edit-modal-backdrop {
  background: transparent !important;
}

.edit-modal-panel {
  width: min(720px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 70px rgba(22, 35, 59, .18) !important;
  overscroll-behavior: contain !important;
}

#editModalContent {
  max-height: calc(100dvh - 84px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 760px) {
  html.modal-open,
  body.modal-open {
    height: auto !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: auto !important;
  }

  .edit-modal {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    overscroll-behavior: contain !important;
  }

  .edit-modal-backdrop {
    display: none !important;
  }

  .edit-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom)) !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }

  #editModalContent {
    max-height: calc(100dvh - 56px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  .edit-modal .modal-info {
    padding-top: 42px;
  }

  .auth-card {
    padding: 18px;
  }

  .auth-session-chip {
    max-width: 100%;
  }

  .sidebar.nav-open .nav,
  body.mobile-nav-open .sidebar.nav-open .nav {
    display: flex !important;
    flex-direction: column !important;
  }

  .sidebar:not(.nav-open) .sidebar-session {
    display: none !important;
  }

  .sidebar.nav-open .sidebar-session {
    display: block !important;
    padding: 10px 0 4px;
  }
}

body.auth-loading .app-shell,
body.auth-required .app-shell {
  display: none !important;
}

body.auth-loading,
body.auth-required {
  overflow-x: hidden !important;
}

[hidden] {
  display: none !important;
}

/* Absolute last override for mobile form dialogs. */
@media (max-width: 760px) {
  html.modal-open,
  body.modal-open {
    position: static !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: auto !important;
  }

  body.modal-open .app-shell {
    pointer-events: auto !important;
  }

  body.modal-open .app-shell > :not(.edit-modal) {
    visibility: hidden !important;
  }

  .edit-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000 !important;
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
  }

  .edit-modal-backdrop {
    display: none !important;
  }

  .edit-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  #editModalContent {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: auto !important;
    touch-action: auto !important;
  }

  .edit-modal .modal-close {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    z-index: 1 !important;
    display: grid !important;
    float: none !important;
    margin: 0 0 14px auto !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }
}

/* Final Klarna mobile layout lock: keep package controls in the top-right corner. */
#klarna .klarna-open-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
}

#klarna .klarna-open-main {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

#klarna .klarna-open-titleline {
  display: grid !important;
  grid-template-columns: minmax(150px, 1fr) auto !important;
  gap: 12px !important;
  align-items: start !important;
}

#klarna .klarna-open-left {
  display: grid !important;
  gap: 2px !important;
  align-content: start !important;
  min-width: 0 !important;
}

#klarna .klarna-open-left strong {
  display: block !important;
  line-height: 1.2 !important;
  min-width: 0 !important;
}

#klarna .klarna-open-main .klarna-open-amount {
  display: block !important;
  margin: 0 !important;
  text-align: left !important;
  line-height: 1.15 !important;
}

#klarna .klarna-open-item .pay-inline {
  grid-column: 1 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-columns: minmax(148px, .55fr) minmax(0, 1fr) 40px !important;
  gap: 8px !important;
  margin-top: 2px !important;
}

#klarna .klarna-open-item .pay-inline select {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
}

#klarna .klarna-open-item .pay-inline .tiny-button {
  grid-column: 1 !important;
  grid-row: 2 !important;
  min-width: 148px !important;
}

#klarna .klarna-open-item .pay-inline .row-edit-button {
  grid-column: 3 !important;
  grid-row: 2 !important;
  justify-self: end !important;
}

#klarna .klarna-paid-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 40px !important;
  gap: 8px 10px !important;
  align-items: start !important;
  padding: 10px 12px !important;
}

#klarna .klarna-paid-main {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

#klarna .klarna-paid-meta {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

#klarna .klarna-paid-item .row-edit-button {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: end !important;
}

#klarna .klarna-package-item {
  position: relative !important;
  display: block !important;
  padding: 12px 62px 12px 12px !important;
}

#klarna .klarna-package-item time {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  display: block !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
}

#klarna .klarna-package-item > .row-edit-button {
  position: absolute !important;
  top: 42px !important;
  right: 12px !important;
  margin: 0 !important;
}

#klarna .klarna-package-item > .amount {
  display: block !important;
  margin-top: 20px !important;
  text-align: left !important;
}

#editModalContent .package-open-post {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  column-gap: 10px !important;
  row-gap: 2px !important;
  align-items: start !important;
  padding: 8px 8px 8px 38px !important;
}

#editModalContent .package-open-checkbox {
  position: absolute !important;
  top: 8px !important;
  left: 10px !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
}

#editModalContent .package-open-check {
  position: absolute !important;
  top: 8px !important;
  left: 10px !important;
}

#editModalContent .package-open-copy {
  grid-column: 1 !important;
  grid-row: 1 !important;
  padding-top: 0 !important;
}

#editModalContent .package-open-post b {
  grid-column: 2 !important;
  grid-row: 1 !important;
  padding-left: 4px !important;
}

#klarna .klarna-package-item > div:first-child > strong {
  display: block !important;
  margin-bottom: 5px !important;
}

#klarnaAiPanel > h2 {
  color: #40556b !important;
  font-size: var(--text-sm) !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
}

#dashboardKlarnaOpenAmount {
  font-size: 14px !important;
}

body.font-medium .klarna-ai-info summary {
  font-size: 17px !important;
  line-height: 1.45 !important;
}

body.font-medium #klarnaAiPanel > h2 {
  font-size: 16px !important;
  line-height: 1.35 !important;
}

body.font-large .klarna-ai-info summary {
  font-size: 18px !important;
  line-height: 1.48 !important;
}

body.font-large #klarnaAiPanel > h2 {
  font-size: 17px !important;
  line-height: 1.4 !important;
}
