:root {
  --blue: #4878c7;
  --blue-dark: #1c355f;
  --paper: #fffaf2;
  --white: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --expense: #c20d2a;
  --income: #0b8f37;
  --transfer: #227df4;
  --success: #16a34a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--blue);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  min-height: 100%;
  margin: 0;
  background: var(--blue);
  color: var(--ink);
  font-family: Inter, ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 14px calc(94px + var(--safe-bottom));
}

.app-header {
  display: grid;
  grid-template-columns: 51px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 3px;
  margin: 0 0 15px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(16,40,83,.2));
}

.brand-name {
  display: grid;
  min-width: 0;
  color: white;
  font-size: clamp(13px, 5.4vw, 25px);
  font-weight: 850;
  line-height: 1;
  text-align: left;
}

.brand-name span, .brand-name strong { display: block; min-width: 0; line-height: 1.02; overflow-wrap: anywhere; }
.brand-name strong { color: #ff8200; font-weight: 950; }

.movement-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 10px;
  padding: 5px;
  border-radius: 18px;
  background: var(--blue-dark);
}

.movement-tab {
  min-height: 54px;
  padding: 6px 3px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(255,255,255,.68);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}

.movement-tab:active { transform: scale(.97); }
.movement-tab.active { color: white; box-shadow: 0 5px 13px rgba(0,0,0,.15); }
.movement-tab.expense.active { background: var(--expense); }
.movement-tab.income.active { background: var(--income); }
.movement-tab.transfer.active { background: var(--transfer); }

.form-card,
.summary-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,250,242,.99);
  box-shadow: 0 16px 38px rgba(15,38,79,.2);
}

.form-card {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
}

#categoryFields,
#transferFields { display: grid; gap: 9px; }

.concept-select-row { display: grid; grid-template-columns: minmax(0, 1fr) 58px; gap: 8px; }
.concept-select-row select { min-width: 0; }
.concept-shortcut { display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border: 1.5px solid #c7cbd3; border-radius: 14px; background: white; cursor: pointer; }
.concept-shortcut img { width: 28px; height: 28px; filter: brightness(0); }
.concept-shortcut:active { background: #eef4ff; }

.date-field {
  display: grid;
  position: relative;
  place-items: center;
  align-items: center;
  min-height: 58px;
  padding: 0 12px;
  border: 1.5px solid #c7cbd3;
  border-radius: 14px;
  background: white;
  color: #747983;
}

.date-display { color: var(--ink); font-size: 20px; font-weight: 850; text-transform: lowercase; }

input,
select {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1.5px solid #c7cbd3;
  border-radius: 14px;
  outline: 0;
  background: white;
  color: #151a22;
  font-size: 16px;
  font-weight: 700;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.date-field input {
  position: absolute;
  inset: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  cursor: pointer;
}

input::placeholder { color: #747983; opacity: 1; }
select:invalid,
select.placeholder { color: #747983; }
select:disabled { opacity: .58; }
input:focus,
select:focus,
.date-field:focus-within { border-color: var(--transfer); box-shadow: 0 0 0 4px rgba(34,125,244,.13); }
.date-field input:focus { box-shadow: none; }

.amount-input {
  height: 76px;
  border: 2px solid var(--blue-dark);
  border-radius: 18px;
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.primary-action {
  position: sticky;
  bottom: calc(76px + var(--safe-bottom));
  z-index: 5;
  width: 100%;
  min-height: 60px;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 18px;
  color: white;
  box-shadow: 0 12px 28px rgba(15,36,75,.27);
  font-size: 17px;
  font-weight: 950;
  cursor: pointer;
}

.primary-action.expense { background: var(--expense); }
.primary-action.income { background: var(--income); }
.primary-action.transfer { background: var(--transfer); }
.primary-action:active { transform: translateY(1px); }

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: fixed;
  left: 50%;
  bottom: 9px;
  z-index: 20;
  width: min(calc(100vw - 20px), 492px);
  max-width: calc(100vw - 20px);
  padding: 5px 7px calc(5px + min(var(--safe-bottom), 10px));
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px;
  background: #f47b20;
  box-shadow: 0 14px 36px rgba(8,26,57,.36);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.bottom-nav-item {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: rgba(255,255,255,.67);
  cursor: pointer;
}

.bottom-nav-item { color: rgba(255,255,255,.82); }
.bottom-nav-item.active { background: white; color: #d85c00; }
.bottom-nav-item svg { display: block; width: 28px; height: 28px; margin: auto; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.sync-detail { display: block; overflow-wrap: anywhere; color: rgba(255,255,255,.78); font-size: 12px; line-height: 1.35; }
.sync-open-sheet { display: inline-flex; width: fit-content; color: white; font-size: 12px; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }

.recent-heading { display: flex; align-items: center; margin: 4px 2px 12px; }
.recent-heading h1 { margin: 0; color: white; font-size: 20px; }
.movements-heading { margin-top: 22px; }
.summary-card { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 10px; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
.summary-account { padding: 15px; border-radius: 14px; background: #edf4ff; }
.summary-account span { display: block; color: var(--ink); font-size: 14px; font-weight: 850; }
.summary-account strong { display: block; margin-top: 5px; font-size: 21px; }
.summary-account strong.positive { color: var(--income); }
.summary-account strong.negative { color: var(--expense); }
.summary-account strong.zero { color: var(--transfer); }
.summary-account.inactive { opacity: .58; filter: saturate(.35); }
.summary-account small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 900; }
.recent-list { display: grid; gap: 9px; }
.recent-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 16px; border-radius: 18px; background: var(--blue-dark); color: white; }
.recent-copy { min-width: 0; }
.recent-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.recent-copy small { display: block; margin-top: 5px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.35; }
.recent-side { display: grid; justify-items: end; gap: 10px; }
.recent-amount { font-size: 18px; font-weight: 900; white-space: nowrap; }
.recent-item.expense .recent-amount { color: #ff637c; }
.recent-item.income .recent-amount { color: #61dc86; }
.recent-item.transfer .recent-amount { color: #70acff; }
.movement-info { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 2px solid rgba(255,255,255,.78); border-radius: 50%; background: transparent; color: white; font-family: Georgia, serif; font-size: 20px; font-weight: 800; font-style: italic; cursor: pointer; }
.movement-info:active { transform: scale(.94); }
.empty-state { padding: 40px 18px; border: 1px dashed rgba(255,255,255,.5); border-radius: 20px; color: white; text-align: center; }
.empty-state strong { display: block; font-size: 17px; }
.empty-state span { display: block; margin-top: 6px; color: rgba(255,255,255,.7); font-size: 12px; }

.modal-backdrop { display: grid; place-items: end center; position: fixed; inset: 0; z-index: 100; padding: 16px 16px calc(16px + var(--safe-bottom)); background: rgba(7,22,48,.68); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(100%, 460px); padding: 26px 21px 17px; border: 0; border-radius: 26px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.32); text-align: center; animation: modalIn .2s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(22px) scale(.98); } }
.success-check { display: grid; place-items: center; width: 62px; height: 54px; margin: 0 auto 14px; color: var(--success); }
.success-check svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.modal-card h2 { margin: 0; font-size: 22px; }
.modal-card p { margin: 9px auto 20px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.info-card p { font-size: 17px; line-height: 1.5; }
.modal-action { width: 100%; min-height: 52px; border-radius: 15px; font-size: 14px; font-weight: 900; cursor: pointer; }
.modal-action { border: 0; background: var(--blue-dark); color: white; }
.auth-backdrop { z-index: 200; place-items: center; }
.auth-card { padding: 28px 22px 22px; }
.auth-logo { width: 78px; height: 78px; margin-bottom: 12px; object-fit: contain; }
.auth-card p { max-width: 340px; }
.auth-action:disabled { opacity: .55; cursor: wait; }
.auth-other {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 0 14px;
  border: 2px solid var(--blue-dark);
  border-radius: 15px;
  background: var(--paper);
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}
.auth-other:active { background: #eaf1fb; }
.auth-link { display: grid; place-items: center; margin-top: 10px; text-decoration: none; }
.setup-account { display: block; margin: 2px 0 13px; color: var(--blue-dark); font-size: 14px; overflow-wrap: anywhere; }
.auth-check { margin-top: 10px; background: var(--transfer); }
.busy-backdrop { z-index: 240; place-items: center; }
.busy-card { display: grid; justify-items: center; gap: 17px; width: min(86%, 360px); padding: 27px 22px; border: 2px solid rgba(255,255,255,.88); border-radius: 24px; background: var(--blue-dark); color: white; box-shadow: 0 30px 80px rgba(0,0,0,.32); text-align: center; }
.busy-card strong { font-size: 16px; }
.spinner { width: 52px; height: 52px; border: 6px solid rgba(255,255,255,.32); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.onboarding-shell {
  position: fixed; inset: 0; z-index: 190; overflow-y: auto;
  padding: calc(22px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  background: var(--blue); color: white;
}
.onboarding-form {
  display: flex; flex-direction: column; width: min(100%, 520px);
  min-height: calc(100dvh - 46px - var(--safe-top) - var(--safe-bottom)); margin: 0 auto;
}
.onboarding-brand { display: grid; grid-template-columns: 73px minmax(0,1fr); gap: 3px; align-items: center; }
.onboarding-brand img { width: 82px; height: 82px; object-fit: contain; }
.onboarding-brand-copy { min-width: 0; font-size: clamp(25px, 7vw, 38px); font-weight: 900; line-height: .98; }
.onboarding-brand-copy span, .onboarding-brand-copy strong { display: block; overflow-wrap: anywhere; }
.onboarding-brand-copy strong { color: #ff8200; }
.onboarding-heading { margin: 25px 0 18px; text-align: center; }
.onboarding-heading h1 { margin: 0; font-size: clamp(25px, 7.3vw, 36px); line-height: 1.08; }
.onboarding-heading p { margin: 10px 0 0; font-size: 20px; font-weight: 850; }
.onboarding-card { display: grid; gap: 12px; padding: 22px 18px; border-radius: 23px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 42px rgba(15,38,79,.24); }
.onboarding-label { color: var(--blue-dark); font-size: 15px; font-weight: 900; }
.onboarding-name-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 8px; }
.onboarding-name-fields input { min-width: 0; padding-left: 10px; padding-right: 10px; font-size: 16px; }
.onboarding-card input, .onboarding-card select { height: 60px; font-size: 18px; }
.onboarding-warning { padding: 13px 14px; border-radius: 14px; background: #fff0bf; color: #5e4500; font-size: 14px; line-height: 1.4; }
.onboarding-confirm { display: grid; grid-template-columns: 27px minmax(0,1fr); gap: 11px; align-items: start; font-size: 15px; line-height: 1.42; }
.onboarding-confirm input { width: 25px; height: 25px; margin: 0; }
.onboarding-error { margin: 0; padding: 12px; border-radius: 12px; background: #ffe1e5; color: #8f1025; font-size: 15px; font-weight: 800; }
.onboarding-continue { width: 100%; min-height: 68px; margin-top: auto; transform: translateY(14px); border: 2px solid rgba(255,255,255,.8); border-radius: 18px; background: var(--blue-dark); color: white; box-shadow: 0 13px 30px rgba(15,36,75,.3); font-size: 22px; font-weight: 950; }
.onboarding-continue:disabled { opacity: .65; cursor: wait; }
.onboarding-brand.compact { grid-template-columns: 61px minmax(0,1fr); }
.onboarding-brand.compact img { width: 68px; height: 68px; }
.start-choice-form { justify-content: flex-start; }
.start-choice-heading { margin-top: clamp(34px, 10vh, 88px); }
.start-choice-heading p { max-width: 390px; margin: 13px auto 0; font-size: 18px; line-height: 1.45; }
.start-choice-card { display: grid; gap: 14px; margin-top: 12px; }
.choice-button { display: grid; gap: 7px; width: 100%; min-height: 112px; padding: 20px 18px; border-radius: 20px; text-align: left; cursor: pointer; }
.choice-button strong, .choice-button span { display: block; }
.choice-button strong { font-size: 20px; font-weight: 950; }
.choice-button span { font-size: 15px; line-height: 1.4; }
.choice-button.primary { border: 2px solid white; background: var(--blue-dark); color: white; box-shadow: 0 14px 32px rgba(15,36,75,.28); }
.choice-button.primary span { color: rgba(255,255,255,.78); }
.choice-button.secondary { border: 0; background: var(--paper); color: var(--blue-dark); box-shadow: 0 14px 32px rgba(15,36,75,.22); }
.choice-button.secondary span { color: var(--muted); }
.chooser-form { min-height: calc(100dvh - 46px - var(--safe-top) - var(--safe-bottom)); }
.chooser-heading { margin-bottom: 12px; }
.chooser-heading p { font-size: 17px; line-height: 1.4; }
.chooser-heading small { display: block; margin-top: 10px; color: rgba(255,255,255,.82); font-size: 13px; overflow-wrap: anywhere; }
.chooser-status { min-height: 22px; margin: 0 3px 11px; color: white; font-size: 15px; font-weight: 800; text-align: center; }
.accountings-list { display: grid; gap: 10px; }
.accounting-choice { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 88px; padding: 16px; border-radius: 19px; background: var(--paper); color: var(--ink); box-shadow: 0 11px 26px rgba(15,38,79,.2); }
.accounting-choice-copy { min-width: 0; }
.accounting-choice-copy strong { display: block; overflow-wrap: anywhere; color: var(--blue-dark); font-size: 18px; line-height: 1.2; }
.accounting-choice-copy small { display: inline-block; margin-top: 7px; padding: 4px 8px; border-radius: 999px; background: #dff3e6; color: #176232; font-size: 11px; font-weight: 900; }
.accounting-choice button { min-width: 86px; min-height: 48px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--blue-dark); color: white; font-size: 13px; font-weight: 950; cursor: pointer; }
.accounting-choice button:disabled { opacity: .55; cursor: wait; }
.chooser-actions { display: grid; gap: 10px; margin-top: auto; padding-top: 18px; }
.chooser-new, .chooser-other { margin: 0; }
.chooser-other { border: 0; background: var(--paper); color: var(--blue-dark); }
.chooser-back { min-height: 50px; border: 2px solid rgba(255,255,255,.7); border-radius: 16px; background: transparent; color: white; font-size: 15px; font-weight: 900; cursor: pointer; }
.accounts-heading { margin: 18px 0 14px; }
.accounts-heading h1 { font-size: clamp(24px, 6.7vw, 34px); }
.accounts-heading p { font-size: clamp(18px, 5.2vw, 25px); }
.account-setup-editor { display: grid; min-width: 0; gap: 11px; padding: 19px 17px; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 38px rgba(15,38,79,.22); }
.account-setup-editor label { min-width: 0; }
.account-setup-editor label > span:not(.localized-date-control) { display: block; margin: 0 0 6px 2px; color: var(--blue-dark); font-size: 14px; font-weight: 900; }
.account-setup-editor input { height: 58px; font-size: 18px; }
.localized-date-control { display: grid; position: relative; place-items: center; width: 100%; min-width: 0; height: 58px; border: 1.5px solid #c7cbd3; border-radius: 14px; background: white; color: var(--ink); font-size: 18px; font-weight: 700; overflow: hidden; }
.localized-date-control:focus-within { border-color: var(--transfer); box-shadow: 0 0 0 4px rgba(34,125,244,.13); }
.localized-date-control > span { padding: 0 45px; text-align: center; }
.localized-date-control > input[type="date"] { position: absolute; inset: 0; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.account-create-button, .account-add-button, .account-next-button { min-height: 60px; border-radius: 16px; font-size: 18px; font-weight: 950; }
.account-create-button { border: 0; background: var(--blue-dark); color: white; }
.account-setup-list { display: grid; gap: 9px; margin-top: 12px; }
.account-setup-row { display: grid; grid-template-columns: 42px minmax(0,1fr) 42px 42px 38px; grid-template-rows: auto auto; grid-template-areas: "order name edit delete move" "order balance edit delete move"; gap: 4px 8px; align-items: center; min-height: 92px; padding: 14px 12px; border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 24px rgba(15,38,79,.18); }
.account-setup-order { grid-area: order; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: white; font-size: 18px; font-weight: 900; }
.account-setup-name { grid-area: name; align-self: end; min-width: 0; overflow-wrap: anywhere; color: var(--blue-dark); font-size: 19px; font-weight: 900; line-height: 1.12; }
.account-setup-balance { grid-area: balance; align-self: start; font-size: 18px; font-weight: 850; }
.account-setup-icon { display: grid; place-items: center; grid-row: 1 / 3; width: 42px; height: 42px; padding: 0; border: 0; background: transparent; color: var(--ink); }
.account-setup-icon.edit { grid-area: edit; }
.account-setup-icon.delete { grid-area: delete; }
.account-setup-icon img { display: block; width: 27px; height: 27px; filter: brightness(0); }
.account-setup-move { display: grid; grid-area: move; grid-template-rows: 1fr 1fr; width: 38px; }
.account-setup-move button { height: 24px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 19px; line-height: 1; }
.account-setup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: auto; padding-top: 15px; }
.account-add-button { border: 2px solid white; background: transparent; color: white; }
.account-next-button { border: 0; background: var(--paper); color: var(--blue-dark); }
.account-next-button:disabled { opacity: .65; cursor: wait; }
.category-setup-editor { display: grid; gap: 11px; padding: 19px 17px; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 16px 38px rgba(15,38,79,.22); }
.category-setup-editor label > span { display: block; margin: 0 0 6px 2px; color: var(--blue-dark); font-size: 14px; font-weight: 900; }
.category-setup-editor input, .category-setup-editor textarea { width: 100%; border: 1px solid #c9cdd5; border-radius: 13px; background: #fffdf6; color: var(--ink); font: inherit; }
.category-setup-editor input { height: 58px; font-size: 18px; }
.category-setup-editor textarea { min-height: 132px; padding: 13px; resize: vertical; font-size: 17px; line-height: 1.35; }
.category-editor-actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
.category-editor-actions.with-cancel { grid-template-columns: 1fr 1fr; }
.category-editor-cancel { min-height: 60px; border: 0; border-radius: 16px; background: #e9edf5; color: var(--blue-dark); font-size: 18px; font-weight: 950; }
.category-setup-list { display: grid; gap: 10px; margin-top: 12px; }
.category-setup-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px 12px; padding: 16px 15px; border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 24px rgba(15,38,79,.18); }
.category-setup-row > strong { align-self: center; color: var(--blue-dark); font-size: 19px; font-weight: 950; overflow-wrap: anywhere; }
.category-setup-icons { display: flex; align-items: center; gap: 8px; }
.category-setup-icons button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; background: transparent; }
.category-setup-icons img { width: 27px; height: 27px; filter: brightness(0); }
.category-setup-subs { grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid #e5e5e5; font-size: 16px; line-height: 1.55; }
.primary-action:disabled,
.detail-action:disabled,
.confirm-button:disabled { opacity: .55; cursor: wait; }
.detail-modal-card { max-height: 88dvh; overflow-y: auto; background: var(--paper); color: var(--ink); text-align: center; }
.detail-modal-heading { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 8px; }
.detail-modal-heading::before { content: ''; width: 44px; }
.detail-modal-heading h2 { color: var(--ink); font-size: 21px; text-align: center; }
.detail-close { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: #e9edf4; color: var(--blue-dark); font-size: 34px; font-weight: 500; line-height: 1; cursor: pointer; }
.detail-content { display: grid; gap: 13px; margin-top: 22px; }
.detail-row { display: grid; grid-template-columns: minmax(105px,.8fr) minmax(0,1.4fr); gap: 12px; padding: 0 2px 11px; border-bottom: 1px solid #dfe4ec; text-align: left; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--muted); font-size: 12px; font-weight: 800; }
.detail-row strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 15px; text-align: right; }
.detail-row.amount strong { font-size: 20px; }
.detail-row.amount.expense strong { color: #ff637c; }
.detail-row.amount.income strong { color: #61dc86; }
.detail-row.amount.transfer strong { color: #70acff; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.detail-action { display: grid; place-items: center; min-height: 58px; border: 0; border-radius: 15px; background: #e9edf4; color: var(--blue-dark); cursor: pointer; }
.detail-action:disabled { opacity: .42; cursor: wait; }
.detail-action svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.detail-action.edit:active { background: #dff5e6; color: var(--income); }
.detail-action.delete:active { background: #ffe1e5; color: var(--expense); }
.delete-confirm-backdrop { z-index: 110; }
.delete-confirm-card p { margin-bottom: 22px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.confirm-button { min-height: 52px; border: 0; border-radius: 15px; font-size: 13px; font-weight: 900; cursor: pointer; }
.confirm-button.cancel { background: #e9edf4; color: var(--blue-dark); }
.confirm-button.delete { background: var(--expense); color: white; }
.reset-confirm-card h2 { color: #a91f2c; }
.confirm-button.reset-delete { background: #c9323f; color: white; }
.toast { position: fixed; left: 50%; bottom: calc(88px + var(--safe-bottom)); z-index: 150; max-width: calc(100% - 32px); padding: 11px 15px; border-radius: 14px; background: #111827; color: white; box-shadow: 0 10px 26px rgba(0,0,0,.28); font-size: 12px; font-weight: 750; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.settings-list { display: grid; gap: 10px; }
.settings-offline-note { margin: 0 3px 16px; color: white; font-size: 16px; font-weight: 400; line-height: 1.5; white-space: pre-line; }
.settings-card { width: 100%; padding: 21px 19px; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 12px 28px rgba(15,38,79,.18); text-align: left; }
button.settings-card { cursor: pointer; }
.settings-card strong, .settings-card span { display: block; }
.settings-card strong { color: var(--blue-dark); font-size: 20px; }
.settings-card span { margin-top: 8px; color: var(--muted); font-size: 16px; line-height: 1.45; }
.settings-danger-zone { display: grid; gap: 11px; margin-top: 26px; padding: 20px 18px; border: 2px solid #c9323f; border-radius: 18px; background: #fff4f4; box-shadow: 0 12px 28px rgba(15,38,79,.14); }
.settings-danger-zone strong { display: grid; place-items: center; line-height: 1; }
.reset-warning-icon { display: block; width: 68px; height: 68px; object-fit: contain; }
.settings-danger-zone span { color: #6f3036; font-size: 15px; line-height: 1.45; }
#resetAccounting { min-height: 56px; border: 0; border-radius: 14px; background: #c9323f; color: white; font-size: 16px; font-weight: 950; cursor: pointer; }
.name-settings-card { display: grid; gap: 15px; padding: 20px 18px; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 14px 32px rgba(15,38,79,.22); }
.name-settings-preview { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 13px; align-items: center; padding: 8px 4px 17px; border-bottom: 1px solid #e1e3e7; }
.name-settings-preview img { width: 64px; height: 64px; object-fit: contain; }
.name-settings-preview span, .name-settings-preview strong { display: block; overflow-wrap: anywhere; line-height: 1.02; }
.name-settings-preview span { color: var(--blue-dark); font-size: 24px; font-weight: 900; }
.name-settings-preview strong { color: var(--orange); font-size: 25px; font-weight: 950; }
.name-copy-warning { margin: 0 !important; padding: 13px 14px; border-radius: 14px; background: #fff0bf; color: #5e4500 !important; font-size: 14px !important; font-weight: 750; line-height: 1.45 !important; text-align: left; }
.name-settings-card label > span { display: block; margin: 0 0 7px 3px; color: var(--blue-dark); font-size: 14px; font-weight: 900; }
.name-settings-card input { width: 100%; height: 60px; border: 1px solid #c9cdd5; border-radius: 14px; background: white; color: var(--ink); font-size: 18px; }
.sync-action { width: 100%; min-height: 54px; margin-top: 16px; border: 0; border-radius: 14px; background: var(--blue-dark); color: white; font-size: 15px; font-weight: 900; cursor: pointer; }
.sync-action:disabled { opacity: .55; }
.pending-badge { display: inline-block; margin-top: 7px; padding: 4px 8px; border-radius: 999px; background: #fff1bd; color: #6c4d00; font-size: 10px; font-weight: 900; }
.manager-heading { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 8px; }
.manager-heading h1 { margin: 0; color: white; font-size: 23px; text-align: center; }
.back-button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: rgba(255,255,255,.14); color: white; font-size: 38px; line-height: 1; cursor: pointer; }
.return-movement-button { width: 100%; min-height: 56px; margin: 0 0 12px; border: 0; border-radius: 16px; background: var(--paper); color: var(--blue-dark); box-shadow: 0 10px 24px rgba(15,38,79,.18); font-size: 16px; font-weight: 950; cursor: pointer; }
.manager-help { margin: 0 4px 16px; color: rgba(255,255,255,.9); font-size: 16px; line-height: 1.5; }
.manager-add { width: 100%; min-height: 56px; margin-bottom: 12px; border: 2px solid rgba(255,255,255,.7); border-radius: 16px; background: var(--transfer); color: white; font-size: 16px; font-weight: 900; cursor: pointer; }
.manager-list { display: grid; gap: 9px; }
.manager-item { padding: 15px; border-radius: 17px; background: var(--paper); box-shadow: 0 10px 24px rgba(15,38,79,.18); }
.manager-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.manager-item-copy { min-width: 0; }
.manager-item-copy strong { display: block; overflow-wrap: anywhere; color: var(--blue-dark); font-size: 19px; }
.manager-item-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 15px; }
.manager-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.manager-icon { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.manager-icon.delete { background: transparent; }
.manager-icon img { display: block; width: 27px; height: 27px; filter: brightness(0); }
.subcategory-list { display: grid; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #dfe4ec; }
.subcategory-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 6px; align-items: center; }
.subcategory-row span { overflow-wrap: anywhere; font-size: 17px; }
.subcategory-add { margin-top: 12px; border: 0; background: transparent; color: var(--transfer); font-size: 15px; font-weight: 900; cursor: pointer; }
.manager-form { display: grid; gap: 12px; text-align: left; }
.manager-form h2 { text-align: center; }
.manager-form label > span:not(.localized-date-control) { display: block; margin: 0 0 7px 3px; color: var(--muted); font-size: 14px; font-weight: 850; }
#newAccountFields { display: grid; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 12px; border-radius: 14px; background: white; }
.switch-row > span { margin: 0 !important; color: var(--ink) !important; font-size: 16px !important; }
.switch-row input { width: 25px; height: 25px; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.confirm-button.save { background: var(--blue-dark); color: white; }
.manager-form .confirm-button { font-size: 15px; }

[hidden] { display: none !important; }

@media (max-width: 360px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-name { font-size: 22px; }
  .movement-tab { font-size: 12px; }
  .form-card { padding: 11px; }
  input, select { padding-left: 12px; padding-right: 12px; }
  .amount-input { font-size: 29px; }
  .summary-account { padding: 12px; }
  .summary-account span { font-size: 13px; }
  .summary-account strong { font-size: 18px; }
  .recent-copy strong { font-size: 16px; }
  .recent-copy small { font-size: 12px; }
  .recent-amount { font-size: 16px; }
  .onboarding-shell { padding-left: 12px; padding-right: 12px; }
  .onboarding-brand { grid-template-columns: 61px minmax(0,1fr); }
  .onboarding-brand img { width: 68px; height: 68px; }
  .onboarding-name-fields { grid-template-columns: 1fr; }
  .account-setup-row { grid-template-columns: 36px minmax(0,1fr) 38px 38px 32px; gap: 3px 5px; padding-left: 9px; padding-right: 7px; }
  .account-setup-order { width: 34px; height: 34px; }
  .account-setup-name { font-size: 17px; }
  .account-setup-balance { font-size: 16px; }
  .account-setup-icon { width: 38px; height: 38px; }
  .account-setup-icon img { width: 25px; height: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
