:root {
  color-scheme: light;
  --ink: #173f36;
  --muted: #69766d;
  --paper: #f6f5ef;
  --line: #e0e5db;
  --green: #236352;
  --lime: #e6edb7;
  --orange: #ca673f;
  --white: #fffef9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 15px;
  font-weight: 600;
}
button:hover {
  border-color: var(--green);
  background: #eff2e7;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--green);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #c3762c;
  outline-offset: 3px;
}
.primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.primary:hover {
  background: var(--green);
  color: white;
}
.danger {
  background: #a33131;
  color: white;
  border-color: #a33131;
}
.danger:hover {
  background: #842828;
  color: white;
  border-color: #842828;
}
.reset-panel {
  border-color: #dfbdb6;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  margin-bottom: 14px;
}
h2 {
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
p {
  line-height: 1.6;
}
.muted,
.footnote {
  color: var(--muted);
  font-size: 0.88rem;
}
.footnote {
  margin: 24px 0;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 8px;
  max-width: 1160px;
  margin: auto;
  padding: 4px 28px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  background: var(--paper);
  padding-top: max(4px, env(safe-area-inset-top));
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.07em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  background: var(--ink);
  color: var(--lime);
  border-radius: 10px;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  font-family: Georgia, serif;
  font-style: italic;
  transform: rotate(-7deg);
}
.brand-dot {
  color: var(--orange);
}
.header-end {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
#offline {
  font-size: 0.75rem;
  color: #90502c;
}
#app-version, #update-app {
  font-size: 0.75rem;
  color: var(--muted);
}
#update-app {
  border: 0;
  background: transparent;
  padding: 6px;
}
.app-menu {
  margin: 0;
}
.app-menu > summary {
  display: grid;
  place-items: center;
  min-height: 36px;
  width: 36px;
  padding: 6px;
  border-radius: 8px;
  list-style: none;
}
.app-menu > summary::-webkit-details-marker {
  display: none;
}
.app-menu > summary svg {
  width: 22px;
  height: 22px;
}
.app-menu[open] > summary {
  background: #e6ecdf;
}
.app-menu nav {
  position: absolute;
  left: 16px;
  top: calc(100% - 2px);
  z-index: 30;
  display: grid;
  width: min(260px, calc(100vw - 32px));
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px #173f3620;
}
.app-menu nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  font-size: 14px;
  padding: 8px 12px;
  min-height: 40px;
}
.app-menu nav button svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-menu nav button.active {
  background: #e6ecdf;
}
.menu-brand {
  margin: 0 6px 6px;
  padding: 10px 6px 14px;
  border-bottom: 1px solid var(--line);
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 0 28px 12px;
  min-height: 70vh;
}
main:focus {
  outline: none;
}
.hero {
  position: relative;
  background: var(--ink);
  color: #fffef5;
  border-radius: 26px;
  padding: 36px 34px 26px;
  overflow: hidden;
}
.hero:after {
  content: "";
  width: 210px;
  height: 210px;
  border: 1px solid #dce8b62b;
  border-radius: 50%;
  position: absolute;
  right: -85px;
  top: -60px;
  pointer-events: none;
  box-shadow:
    0 0 0 35px #dce8b609,
    0 0 0 70px #dce8b609;
}
.eyebrow {
  font-size: 0.67rem;
  letter-spacing: 0.17em;
  font-weight: 700;
  margin-bottom: 16px;
  color: #798656;
}
.hero .eyebrow {
  color: #dce8b6;
}
.hero p {
  color: #c7d7cd;
  margin-bottom: 25px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stats.budget-totals {
  grid-template-columns: 1fr;
}

/* Keep the monthly budget summary compact without changing other stat cards. */
.stats.budget-totals .stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.stats.budget-totals .stat span {
  min-height: 0;
  margin-bottom: 0;
}
.stats.budget-totals .stat strong {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}
.stats.budget-totals .stat strong small {
  display: inline;
  margin-bottom: 0;
}
.stat {
  padding: 20px 22px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 17px;
  min-width: 0;
}
.stat span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat strong {
  display: block;
  font-size: clamp(1.05rem, 2.2vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.stat strong small {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 4px;
  opacity: 0.8;
}
.positive strong {
  color: var(--green);
}
.hero .stats {
  margin-bottom: 0;
}
.hero .stat {
  background: #ffffff0b;
  border-color: #ffffff25;
}
.hero .stat span {
  color: #bdcfc5;
}
.hero .stat strong {
  color: #fffef5;
}
.hero .stat strong small {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0;
  font-weight: 400;
  margin-bottom: 4px;
  opacity: 0.8;
}
.positive strong {
  color: var(--lime);
}
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
}
.month-nav label {
  margin: 0;
  width: auto;
}
.month-nav button {
  font-size: 1.1rem;
  min-width: 44px;
}
.month-nav button svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
}
.month-nav input {
  width: 180px;
  padding: 9px;
  min-height: 44px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.hero .month-nav {
  position: absolute;
  right: 34px;
  top: 52px;
  margin: 0;
}
.hero .month-nav input,
.hero .month-nav button {
  background: #ffffff10;
  border-color: #ffffff40;
  color: #fffef5;
  color-scheme: dark;
}
.flow-help {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.flow-help > span {
  flex: 1;
}
.home-totals {
  margin: 0;
  padding: 0;
  background: var(--paper);
  border-bottom: 0;
  gap: 8px;
}
.home-totals .stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.home-totals .stat span {
  font-size: 10px;
  min-height: 0;
  line-height: 12px;
  margin-bottom: 1px;
}
.home-totals .stat strong {
  font-size: clamp(13px, 3.5vw, 22px);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.home-totals .stat small {
  display: inline;
  margin-right: 3px;
}
.detail-period > button {
  min-height: 32px;
  font-size: 12px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
}
.compact-month {
  margin: 0;
  gap: 0;
  display: inline-grid;
  grid-template-columns: 28px auto 28px;
  align-items: center;
}
.compact-month button {
  position: relative;
  z-index: 1;
  min-height: 32px;
  min-width: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 22px;
}
.compact-month.month-only {
  grid-template-columns: auto;
}
.compact-month .month-picker {
  position: relative;
  display: grid;
  place-items: center;
  width: auto;
  padding: 0 2px;
  height: 32px;
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
}
.compact-month .month-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.month-picker:focus-within {
  outline: 2px solid var(--green);
  border-radius: 6px;
}
.entity-section {
  border-top: 1px solid var(--line);
  padding-top: 5px;
  margin-top: 5px;
}
.entity-section + .entity-section {
  padding-top: 12px;
  margin-top: 12px;
}
.row-0 {
  --row-color: #62802b;
}
.row-1 {
  --row-color: #236352;
}
.row-2 {
  --row-color: #b45832;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.section-heading > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.section-heading h2 {
  margin: 0;
  font-size: 15px;
}
.section-total {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}
.section-total strong {
  display: block;
  color: var(--row-color);
  font-size: 12px;
  margin-top: 2px;
}
.step {
  font:
    12px Georgia,
    serif;
  color: #7e8d77;
}
.entity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 6px;
  row-gap: 12px;
  padding: 0;
}
/* Entity rows and their final create button scroll together. */
.entity-strip {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 18px) / 4);
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-margin-top: calc(48px + env(safe-area-inset-top));
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.entity-strip::-webkit-scrollbar {
  height: 3px;
}
.entity-strip::-webkit-scrollbar-thumb {
  background: #bbc7b9;
  border-radius: 3px;
}
.entity-wrap {
  position: relative;
  min-width: 0;
}
.entity-card,
.entity-add {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--row-color);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.entity-card:hover,
.entity-add:hover {
  background: transparent;
}
.entity-card .entity-mark {
  touch-action: none;
  cursor: grab;
}
.entity-name {
  display: block;
  width: 100%;
  padding: 0 1px;
  font-size: 12px;
  line-height: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-mark {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--row-color);
  color: white;
  border: 2px solid transparent;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}
.entity-mark svg {
  width: 24px;
  height: 24px;
}
.entity-card strong {
  display: block;
  width: 100%;
  font-size: 12px;
  line-height: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-planned {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 10px;
  line-height: 11px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-card strong.budget-amount {
  color: var(--budget-color, #aeb5b0);
}
.budget-mark {
  --budget-color: #aeb5b0;
  background: linear-gradient(
    to top,
    var(--budget-color) 0%,
    var(--budget-color) var(--budget-fill),
    #aeb5b0 var(--budget-fill),
    #aeb5b0 100%
  );
  background-origin: border-box;
  background-repeat: no-repeat;
}
.budget-green {
  --budget-color: #27824f;
}
.budget-orange {
  --budget-color: #e28724;
}
.budget-red {
  --budget-color: #d73742;
}
.entity-card.valid-target .entity-mark {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--row-color) 16%, transparent);
}
.entity-card.invalid-target {
  opacity: 0.35;
}
.entity-card.drop-target .entity-mark {
  transform: scale(1.15);
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 6px var(--row-color);
}
.entity-card.dragging .entity-mark {
  background: transparent;
  border: 2px dashed var(--row-color);
  box-shadow: none;
}
.entity-card.dragging .entity-mark svg {
  visibility: hidden;
}
.entity-add {
  align-self: start;
  padding-top: 22px;
}
.entity-tools {
  display: none;
}
.editing-entities .entity-tools {
  display: contents;
}
.editing-entities .entity-card {
  cursor: default;
}
.editing-entities .entity-card .entity-mark {
  cursor: grab;
}
html.is-reordering {
  overscroll-behavior: none;
}
.is-reordering body {
  user-select: none;
  -webkit-user-select: none;
}
.is-reordering .entity-add {
  opacity: 0.35;
}
.entity-tools button {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 50%;
  border: 1px solid var(--paper);
  background: #e0e6df;
  color: var(--ink);
}
.entity-tools .entity-remove {
  top: 18px;
  left: 0;
  padding: 3px;
}
.entity-tools .entity-pencil {
  top: 42px;
  right: 4px;
}
.entity-tools svg {
  width: 16px;
  height: 16px;
}
.remove-options {
  padding: 0;
  border: 0;
}
.remove-options p {
  margin: 0 0 12px 26px;
  font-size: 12px;
}
#entity-edit-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0 12px;
  font-size: 12px;
  color: var(--muted);
}
#entity-edit-bar button {
  min-height: 32px;
  border: 0;
  background: #e6ecdf;
  font-size: 12px;
  padding: 4px 12px;
}
.entity-add .entity-mark {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid #d5dcd3;
  color: #8b988c;
}
.entity-add .entity-mark svg {
  width: 18px;
  height: 18px;
}
.entity-add:hover .entity-mark,
.entity-add:focus-visible .entity-mark {
  border-color: #8b988c;
  color: var(--ink);
}
.drag-clone {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  margin: 0;
  pointer-events: none;
  transform-origin: center;
  transition: none;
  opacity: 1;
  box-shadow: 0 6px 15px #173f3633;
  will-change: transform;
}
html.is-dragging {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
.is-dragging body {
  position: fixed;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}
.is-dragging .entity-add {
  opacity: 0.35;
}
.entity-detail {
  padding-top: 6px;
}
.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-toolbar > div {
  flex: 1;
  min-width: 0;
}
.detail-toolbar h1 {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-kind {
  font-size: 11px;
  color: var(--muted);
}
.detail-toolbar > button {
  background: transparent;
  border: 0;
  padding: 6px 8px;
  font-size: 12px;
  min-height: 36px;
}
.detail-toolbar > button:first-child {
  display: grid;
  place-items: center;
  font-size: 30px;
  min-width: 36px;
  padding: 0;
}
.detail-toolbar > button:first-child svg {
  width: 20px;
  height: 20px;
}
.detail-period {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 6px;
}
.detail-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 20px;
}
.detail-totals .stat {
  flex: 1;
  min-width: 80px;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.detail-totals .stat span {
  font-size: 11px;
  min-height: 0;
  margin-bottom: 4px;
}
.detail-totals .stat strong {
  font-size: 18px;
  color: var(--row-color);
}
.detail-totals .stat small {
  display: inline;
  margin-right: 4px;
}
.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.chart-heading h2 {
  font-size: 14px;
  margin: 0;
}
.chart-heading > span {
  color: var(--muted);
  font-size: 10px;
}
.entity-chart {
  margin: 12px 0 22px;
}
.entity-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-interactive {
  position: relative;
  margin-top: 8px;
}
.chart-plot {
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
  border-radius: 4px;
}
.chart-plot:focus-visible {
  outline: 2px solid var(--row-color);
  outline-offset: 3px;
}
.chart-tooltip {
  position: absolute;
  top: 0;
  z-index: 1;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}
.chart-selection {
  pointer-events: none;
}
.chart-selection line {
  stroke: var(--row-color);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.chart-selection circle {
  fill: var(--row-color);
  stroke: var(--paper);
  stroke-width: 2;
}
.entity-chart svg text {
  font-size: 16px;
  fill: var(--muted);
}
.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart-area {
  fill: var(--row-color);
  opacity: 0.14;
}
.chart-line {
  fill: none;
  stroke: var(--row-color);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dot {
  fill: var(--row-color);
}
.history-scope {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}
.history-scope button {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 11px;
  border: 0;
  background: transparent;
  border-radius: 16px;
  color: var(--muted);
}
.history-scope [aria-pressed="true"] {
  color: var(--ink);
  background: #e6ecdf;
}
.history-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.history-day h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}
.history-day-total {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.amount-positive {
  color: var(--green);
}
.amount-negative {
  color: #a33131;
}
.amount-neutral {
  color: var(--muted);
}
.entity-history .transaction {
  padding: 12px 0;
}
.entity-history .transaction-info {
  min-width: 0;
}
.entity-history .transaction-info strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.entity-history .transaction-end {
  max-width: none;
}
.transaction-swipe {
  position: relative;
  overflow: hidden;
  background: #bf3540;
  touch-action: pan-y pinch-zoom;
}
.transaction-swipe > .transaction {
  position: relative;
  background: var(--paper);
  transform: translateX(var(--swipe-offset, 0px));
  transition: transform 160ms ease;
}
.transaction-swipe.is-swiping > .transaction {
  transition: none;
  user-select: none;
  -webkit-user-select: none;
}
.transaction-swipe-delete {
  position: absolute;
  inset: 0 0 0 auto;
  width: 84px;
  min-height: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: #bf3540;
  color: white;
  font-size: 13px;
  visibility: hidden;
}
.transaction-swipe.is-revealed > .transaction-swipe-delete {
  visibility: visible;
}
.transaction-swipe.is-revealed .transaction-end [data-action="delete-transaction"] {
  visibility: hidden;
}
.transaction-swipe:not(:last-child) {
  border-bottom: 1px solid var(--line);
}
.transaction-swipe-delete:hover {
  background: #a82b35;
  color: white;
}
@media (prefers-reduced-motion: reduce) {
  .transaction-swipe > .transaction {
    transition: none;
  }
}
.page-heading {
  padding: 20px 0 8px;
}
.page-heading > p {
  color: var(--muted);
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 20px;
}
.panel p {
  font-size: 0.9rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.wide {
  grid-column: 1/-1;
}
label {
  display: block;
  font-size: 0.85rem;
  margin: 16px 0 10px;
  font-weight: 550;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #cdd5c8;
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
  background: white;
  min-height: 46px;
  margin-top: 7px;
  font-size: 16px;
}
select[multiple] {
  height: 110px;
}
textarea {
  resize: vertical;
}
select,
input[type="date"],
input[type="month"],
input[type="time"] {
  border: 0;
  background: transparent;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 16px 0;
  padding: 8px 12px;
}
legend {
  font-size: 0.85rem;
}
.check,
.tag-choices label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.check input,
.tag-choices input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
}
.tag-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-choices label {
  margin: 5px 0;
}
.tag-choices .muted {
  padding: 8px 0;
}
.inline-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.filters summary {
  font-size: 0.9rem;
  font-weight: 650;
}
.filters .form-grid {
  margin-top: 8px;
}
summary {
  cursor: pointer;
  padding: 12px 0;
  min-height: 44px;
}
.transaction {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.transaction:last-child {
  border-bottom: 0;
}
.transaction-symbol {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 11px;
  background: #f6e6d8;
  color: #975537;
  font-size: 1.3rem;
}
.transaction-symbol.income {
  background: #e2ecd3;
  color: var(--green);
}
.transaction-symbol.transfer {
  background: #e7eceb;
  color: #476761;
}
.transaction-info {
  flex: 1;
  min-width: 0;
}
.transaction-info > strong {
  display: block;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.transaction-info > span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}
.transaction-info p {
  font-size: 0.85rem;
  margin: 9px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.tags span {
  border-radius: 5px;
  background: #efefe6;
  color: var(--muted);
  padding: 3px 7px;
  font-size: 0.65rem;
}
.transaction-end {
  text-align: right;
}
.transaction-end > strong {
  font-size: 0.95rem;
  white-space: nowrap;
}
.transaction-end > div {
  margin-top: 6px;
}
.transaction-end button {
  font-size: 0.75rem;
  padding: 7px;
  min-height: 36px;
  background: transparent;
  border-color: transparent;
}
.load-more {
  width: 100%;
  margin-top: 15px;
}
.empty {
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
}
.archived-categories {
  margin-top: 14px;
}
.archived-categories > summary {
  display: inline-block;
  cursor: pointer;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 0;
  list-style: none;
}
.archived-categories > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
}
.archived-categories[open] > summary::before {
  content: "▾";
}
.archived-categories > summary::-webkit-details-marker {
  display: none;
}
.archived-categories > .budget-grid {
  margin-top: 10px;
}
.archived-categories .budget-restore {
  margin-top: 12px;
  color: var(--green);
  font-weight: 600;
}
.budget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.budget-card {
  margin: 0;
}
.budget-spent {
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}
.budget-spent span {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 5px;
}
progress {
  display: block;
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  background: var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin: 14px 0;
}
progress::-webkit-progress-bar {
  background: var(--line);
}
progress::-webkit-progress-value {
  background: var(--green);
  border-radius: 20px;
}
progress::-moz-progress-bar {
  background: var(--green);
}
dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  font-size: 0.85rem;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}
.budget-card button {
  width: 100%;
  font-size: 0.8rem;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
td,
th {
  padding: 13px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td:first-child,
th:first-child {
  text-align: left;
}
th {
  font-weight: 500;
  color: var(--muted);
}
.distribution {
  margin: 28px 0;
}
.distribution > div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 50px;
  gap: 14px;
  align-items: center;
  font-size: 0.8rem;
  margin: 16px 0;
}
.distribution > div > span {
  overflow-wrap: anywhere;
}
.distribution strong {
  font-size: 0.75rem;
  text-align: right;
}
.bar-track {
  height: 15px;
  background: #edefe6;
  border-radius: 5px;
  overflow: hidden;
}
.bar-track i {
  height: 100%;
  background: var(--green);
  display: block;
  border-radius: 5px;
}
.legend {
  display: flex;
  gap: 20px;
  color: var(--muted);
}
.legend span:before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--green);
  margin-right: 8px;
}
.legend .expense-key:before {
  background: var(--orange);
}
.timeline {
  display: flex;
  gap: 14px;
  height: 185px;
  align-items: flex-end;
  margin: 25px 0;
}
.timeline-month {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.columns {
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--line);
}
.columns i {
  width: 35%;
  border-radius: 4px 4px 0 0;
  min-width: 3px;
}
.income-bar {
  background: var(--green);
}
.expense-bar {
  background: var(--orange);
}
.timeline-month > span {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 8px;
}
.file-label {
  margin-top: 24px;
}
.file-label input {
  font-size: 0.85rem;
  background: var(--paper);
  max-width: 100%;
}
.review-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.review-row p {
  overflow-wrap: anywhere;
}
.manage-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.manage-row span {
  overflow-wrap: anywhere;
}
.manage-row button {
  font-size: 0.8rem;
}
.manage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.manage-actions [data-action="restore-entity"] {
  color: var(--green);
  font-weight: 600;
}
.panel details + details {
  border-top: 1px solid var(--line);
}
dialog {
  position: fixed;
  top: var(--dialog-viewport-top, 0px);
  bottom: calc(100% - var(--dialog-viewport-top, 0px) - var(--dialog-viewport-height, 100%));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 25px;
  width: min(540px, calc(100% - 24px));
  max-height: calc(var(--dialog-viewport-height, 100dvh) - 32px);
  overflow-y: auto;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 24px 100px #173f3630;
}
dialog::backdrop {
  background: #0d292580;
  backdrop-filter: blur(4px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.dialog-heading h2 {
  margin: 0;
  font-size: 1.3rem;
}
.dialog-heading button {
  border: 0;
  font-size: 1.4rem;
  background: transparent;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
#modal-error {
  color: #9c422b;
  font-size: 0.85rem;
  margin: 14px 0 0;
}
#toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 6px;
  align-items: center;
  width: max-content;
  max-width: min(420px, calc(100% - 24px));
  background: var(--ink);
  color: white;
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 4px 14px #173f3630;
  font-size: 12px;
  line-height: 1.4;
}
#toast span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#toast button {
  flex-shrink: 0;
  min-height: 28px;
  min-width: 28px;
  border-radius: 6px;
  font-size: 12px;
  background: #ffffff15;
  color: white;
  border-color: #ffffff30;
  padding: 3px 6px;
  white-space: nowrap;
}
#toast [data-action="dismiss"] {
  background: transparent;
  border: 0;
  font-size: 18px;
}
[hidden] {
  display: none !important;
}
.sr-only,
.titleless-dialog:not(.choosing-tags) #dialog-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  top: -80px;
  left: 10px;
  z-index: 10;
  background: white;
  padding: 15px;
}
.skip-link:focus {
  top: 10px;
}
@media (max-width: 760px) {
  .app-header {
    padding: 4px 16px;
    padding-top: max(4px, env(safe-area-inset-top));
  }
  .brand {
    font-size: 1.25rem;
  }
  main {
    padding: 0 16px 28px;
  }
  .hero {
    padding: 28px 22px 20px;
    border-radius: 22px;
  }
  .hero .month-nav {
    position: static;
    margin: 20px 0;
  }
  .hero h1 {
    max-width: 260px;
  }
  .hero p {
    font-size: 0.85rem;
  }
  .hero .stat {
    padding: 15px 12px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 17px 12px;
    border-radius: 13px;
  }
  .stat span {
    min-height: 2.6em;
    font-size: 0.65rem;
    line-height: 1.3;
  }
  .stat strong {
    font-size: 1.05rem;
  }
  .flow-help {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.75rem;
  }
  .flow-help > span {
    flex-basis: 55%;
    line-height: 1.5;
  }
  .flow-help button {
    font-size: 0.75rem;
    padding: 9px 12px;
  }
  .section-heading {
    gap: 8px;
  }
  .section-heading > div {
    gap: 7px;
  }
  .section-heading h2 {
    font-size: 0.94rem;
  }
  .step {
    font-size: 0.7rem;
  }
  .section-total {
    font-size: 0.6rem;
  }
  .section-total strong {
    font-size: 0.8rem;
  }
  .panel {
    padding: 20px 16px;
    border-radius: 17px;
  }
  .form-grid {
    gap: 0 12px;
  }
  .budget-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .budget-card h2 {
    font-size: 1rem;
  }
  .budget-spent {
    font-size: 1.45rem;
  }
  .budget-card dl > div {
    font-size: 0.75rem;
  }
  .budget-card button {
    font-size: 0.7rem;
    padding: 10px 8px;
  }
  .page-heading {
    padding-top: 16px;
  }
  .page-heading p {
    font-size: 0.9rem;
  }
  .transaction {
    gap: 8px;
    flex-wrap: wrap;
  }
  .transaction-symbol {
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }
  .transaction-info > strong {
    font-size: 0.8rem;
  }
  .transaction-end > strong {
    font-size: 0.8rem;
  }
  .transaction-end button {
    padding: 6px 3px;
    font-size: 0.65rem;
    min-height: 44px;
  }
  .transaction-info {
    min-width: 100px;
  }
  .transaction-end {
    max-width: 115px;
  }
  .transaction-info > span {
    font-size: 0.65rem;
  }
  .timeline {
    gap: 6px;
  }
  .distribution > div {
    grid-template-columns: 80px minmax(0, 1fr) 45px;
    gap: 8px;
  }
  #toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  #toast span {
    max-height: 100px;
    overflow: auto;
  }
  dialog {
    padding: 18px;
    max-height: calc(var(--dialog-viewport-height, 100dvh) - 24px);
  }
  .header-end button {
    font-size: 0.7rem;
    padding: 6px;
  }
  .footnote {
    font-size: 0.75rem;
  }
}
@media (max-width: 360px) {
  .budget-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 24px 16px;
  }
  .stat {
    padding: 14px 8px;
  }
  .stat strong {
    font-size: 0.9rem;
  }
  .section-heading h2 {
    font-size: 0.8rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.15s,
      border-color 0.15s,
      transform 0.15s;
  }
  dialog[open] {
    animation: appear 0.15s ease-out;
  }
  @keyframes appear {
    from {
      transform: translateY(8px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

.compact-dialog {
  width: min(440px, calc(100% - 20px));
  padding: 14px;
  border-radius: 16px;
  max-height: calc(var(--dialog-viewport-height, 100dvh) - 24px);
}
.compact-dialog .dialog-heading {
  gap: 8px;
  margin-bottom: 6px;
}
.compact-dialog .dialog-heading h2 {
  font-size: 18px;
}
.compact-dialog .dialog-heading button {
  min-height: 32px;
  width: 32px;
  padding: 2px;
}
.titleless-dialog:not(.choosing-tags) .dialog-heading {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}
.titleless-dialog:not(.choosing-tags) .movement-tags {
  margin-right: 38px;
}
.compact-dialog label {
  font-size: 12px;
  margin: 6px 0;
}
.compact-dialog input,
.compact-dialog select,
.compact-dialog textarea {
  min-width: 0;
  min-height: 38px;
  margin-top: 4px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 16px;
}
.compact-dialog .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}
.compact-dialog .movement-fields select,
.compact-dialog .movement-fields input[type="date"] {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
}
.movement-fields input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}
.movement-fields input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}
.compact-dialog fieldset {
  margin: 8px 0;
}
.compact-dialog .check input,
.compact-dialog .tag-choices input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  margin: 0;
}
.compact-dialog .dialog-actions {
  margin-top: 10px;
  gap: 6px;
}
.compact-dialog .dialog-actions button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
.movement-extras {
  margin-top: 4px;
}
.movement-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0 0 8px;
}
#tag-picker-toggle,
.tag-search > button {
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--green);
  font-size: 24px;
}
.movement-tags .tag-choices {
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  gap: 18px;
  scrollbar-width: thin;
}
.movement-tags .tag-choices label {
  position: relative;
  flex-shrink: 0;
  padding: 8px 2px;
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  color: var(--muted);
}
.movement-tags .tag-choices input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  clip-path: inset(50%);
}
.movement-tags .tag-choices label:has(:checked) {
  color: var(--green);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.movement-tags .tag-choices label:has(input:focus-visible) {
  text-decoration: underline;
  text-decoration-style: dotted;
}
.movement-tag-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}
.choosing-tags .movement-tags,
.choosing-tags .movement-fields { display: none; }
.choosing-tags #tag-picker-list { max-height: min(55dvh, 440px); }
.tag-search {
  display: flex;
  gap: 8px;
  align-items: end;
}
.tag-search label { flex: 1; min-width: 0; }
#tag-picker-list { max-height: 210px; overflow-y: auto; margin: 6px 0; }
#tag-picker-list label { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 9px 0; margin: 0; font-weight: 400; }
.compact-dialog #tag-picker-list input { width: 20px; height: 20px; min-height: 20px; margin: 0; padding: 0; flex-shrink: 0; accent-color: var(--green); }
.movement-extras summary {
  min-height: 32px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
}
#modal-error:empty {
  display: none;
}
.compact-dialog .icon-field {
  border: 0;
  padding: 0;
  margin: 6px 0 10px;
}
.icon-field legend {
  font-size: 12px;
}
.icon-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 4px 0;
  background: transparent;
  border: 0;
  font-size: 12px;
}
.icon-preview .entity-mark {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
}
.icon-picker {
  min-width: 0;
  padding: 6px 0;
}
.icon-pages {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 8px;
}
.icon-pages::-webkit-scrollbar {
  display: none;
}
.icon-page {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  padding: 4px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.icon-page button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 7px;
  border-radius: 8px;
  background: transparent;
}
.icon-picker button[aria-pressed="true"] {
  background: #e6ecdf;
  border-color: var(--row-color);
}
.icon-picker svg {
  width: 24px;
  height: 24px;
  color: var(--row-color);
}
.icon-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.icon-pagination > div {
  display: flex;
  gap: 4px;
}
.icon-pagination button {
  min-height: 28px;
  min-width: 28px;
  padding: 3px 6px;
  font-size: 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.icon-pagination button[aria-current="true"] {
  background: #e6ecdf;
  color: var(--ink);
}
/* Dense secondary pages share the compact spacing used on Inicio. */
.compact-page .page-heading {
  padding: 10px 0 8px;
}
.compact-page .eyebrow {
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
}
.compact-page h1 {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  margin-bottom: 4px;
}
.compact-page p {
  line-height: 1.4;
  margin-bottom: 8px;
}
.compact-page .page-heading > p {
  font-size: 13px;
  margin-bottom: 0;
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 8px;
}
.page-title .compact-month {
  margin: 0;
}
.compact-page .compact-month button {
  min-height: 36px;
  padding: 0;
}
.compact-page .panel {
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.compact-page h2 {
  font-size: 15px;
  margin-bottom: 6px;
}
.compact-page .panel p {
  font-size: 13px;
}
.compact-page label {
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.3;
  min-width: 0;
}
.compact-page input,
.compact-page select,
.compact-page textarea {
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  margin-top: 3px;
  border-radius: 8px;
}
.compact-page select[multiple] {
  height: 76px;
}
.compact-page .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}
.compact-page button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.compact-page summary {
  min-height: 32px;
  padding: 6px 0;
  font-size: 13px;
}
.compact-page .filters summary {
  padding: 0 0 4px;
  min-height: 24px;
}
.compact-page .filters .form-grid {
  margin-top: 0;
  gap: 0 8px;
}
.compact-page .filters label {
  margin: 3px 0;
  line-height: 1.2;
}
.compact-page .filters input,
.compact-page .filters select {
  height: 32px;
  min-height: 32px;
  padding: 4px 6px;
  margin-top: 2px;
  border-radius: 6px;
}
.compact-page .filters {
  padding: 10px;
}
.expense-pie {
  margin: 0 auto 8px;
  max-width: 420px;
}
.expense-pie > svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.pie-slice {
  stroke: var(--white);
  stroke-width: 1.5px;
}
.pie-slice:focus-visible {
  outline: none;
  stroke: var(--ink);
  stroke-width: 3px;
}
.pie-label path {
  fill: none;
  stroke: #9ca99d;
  stroke-width: 1px;
}
.pie-label text {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.pie-percent {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.pie-others {
  padding: 4px 0;
}
.pie-others h3 {
  margin: 0 0 4px;
  font-size: 12px;
}
.pie-others h3 span {
  color: var(--muted);
  font-weight: 400;
}
.pie-others ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pie-others li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
}
.pie-others li > span {
  overflow-wrap: anywhere;
}
.pie-color {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--slice-color);
}
.pie-others strong {
  font-weight: 500;
  color: var(--muted);
}
.compact-page .inline-actions {
  margin-top: 4px;
  gap: 6px;
}
.compact-page .stats {
  gap: 8px;
  margin: 10px 0;
}
.compact-page .stat {
  padding: 10px;
  border-radius: 10px;
}
.compact-page .stat span {
  font-size: 11px;
  line-height: 1.3;
  min-height: 0;
  margin-bottom: 4px;
}
.compact-page .stat strong {
  font-size: clamp(15px, 2.2vw, 22px);
}
.compact-page .positive strong {
  color: var(--green);
}
.compact-page .stat small {
  margin-bottom: 2px;
}
.compact-page .section-heading {
  justify-content: space-between;
  margin-bottom: 0;
}
.compact-page .section-heading h2 {
  margin: 0;
}
.compact-page .transaction {
  padding: 8px 0;
  gap: 8px;
}
.compact-page .transaction-symbol {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
}
.compact-page .transaction-info > span,
.compact-page .transaction-end > div {
  margin-top: 2px;
}
.compact-page .transaction-info p {
  margin: 4px 0;
}
.compact-page .transaction-end button {
  min-height: 28px;
  font-size: 11px;
  padding: 4px;
}
.compact-page .tags {
  margin-top: 3px;
}
.compact-page .tags:empty {
  display: none;
}
.compact-page .empty {
  padding: 10px 0;
  margin: 0;
}
.compact-page .budget-grid {
  gap: 8px;
}
.compact-page .budget-card {
  margin: 0;
}
.budget-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.compact-page .budget-heading h2 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.compact-page .budget-heading button {
  flex: 0 0 auto;
  width: auto;
  min-height: 28px;
  padding: 4px 0 4px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
}
.budget-heading button:hover {
  text-decoration: underline;
}
.compact-page .budget-spent {
  font-size: clamp(19px, 2.5vw, 25px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.compact-page .budget-spent span {
  display: inline-block;
  margin: 0 0 0 5px;
  font-size: 11px;
}
.compact-page progress {
  margin: 8px 0;
  height: 5px;
}
.compact-page .budget-card dl {
  margin: 0;
}
.compact-page dl > div {
  margin: 4px 0;
  gap: 6px;
  font-size: 12px;
}
.compact-page .footnote {
  margin: 8px 0;
  font-size: 12px;
}
.compact-page td,
.compact-page th {
  padding: 8px 6px;
}
.compact-page .distribution {
  margin: 10px 0;
}
.compact-page .distribution > div {
  margin: 8px 0;
  gap: 8px;
}
.compact-page .bar-track {
  height: 10px;
}
.compact-page .legend {
  gap: 12px;
  margin-bottom: 4px;
}
.compact-page .timeline {
  height: 145px;
  margin: 10px 0;
  gap: 6px;
}
.compact-page .columns {
  height: 120px;
}
.compact-page .timeline-month > span {
  margin-top: 4px;
}
.compact-page .file-label {
  margin-top: 8px;
}
.compact-page .file-label input {
  padding: 6px;
  font-size: 13px;
}
.compact-page .review-row {
  padding: 8px 0;
}
.compact-page .manage-row {
  padding: 4px 0;
  gap: 8px;
  font-size: 13px;
}
.compact-dialog p {
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.4;
}
.date-control {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 7px 22px 7px 0;
  overflow: hidden;
  isolation: isolate;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}
.date-value {
  display: block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.date-control svg {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.date-control input[type] {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}
.date-control:focus-within {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  border-radius: 4px;
}
.compact-page .filters .date-control {
  min-height: 32px;
  height: 32px;
  margin-top: 2px;
  padding: 4px 22px 4px 0;
}
.compact-dialog .movement-timezone {
  font-size: 11px;
  margin: 0 0 4px;
}
.compact-dialog .movement-timestamp {
  font-size: 12px;
  margin: 8px 0 2px;
}
.app-header.without-menu {
  grid-template-columns: minmax(0, 1fr);
}
.back-swipe-stage {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  pointer-events: none;
  background: var(--paper);
}
.back-swipe-front,
.back-swipe-underlay,
.back-swipe-shade {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--paper);
  will-change: transform;
}
.back-swipe-front {
  box-shadow: -5px 0 22px #173f3626;
}
.back-swipe-shade {
  background: #071b18;
  will-change: opacity;
}
.back-swipe-active {
  overflow-x: clip;
}
.back-swipe-settling body {
  pointer-events: none;
}
dialog.back-swipe-clipping {
  overflow-x: hidden;
}
.timeline-month > span small {
  display: block;
  font-size: inherit;
}
.compact-page .timeline {
  height: 155px;
}
@media (max-width: 360px) {
  .compact-page .form-grid {
    grid-template-columns: 1fr;
  }
}
/* Compact hierarchy with comfortable touch targets; financial meanings stay unchanged. */
:root { --muted: #526257; }
.row-0 { --row-color: #49691f; }
.eyebrow { color: #52623d; }
.entity-card strong.budget-gray { color: #526257; }
.entity-card strong.budget-orange { color: #975009; }
.entity-card strong.budget-red { color: #a33131; }
.home-totals .stat span { font-size: 11px; line-height: 1.25; }
.home-totals .stat strong { white-space: nowrap; }
.compact-page .page-heading { padding: 8px 0; }
.compact-page .page-heading > p { font-size: 13px; }
.compact-page button, .compact-dialog button, .detail-period > button,
.history-scope button, .transaction-end button, .budget-heading button {
  min-height: 44px; min-width: 44px; font-size: 14px;
}
.compact-month { grid-template-columns: 44px auto 44px; }
.compact-month button, .compact-page .compact-month button { min-width: 44px; min-height: 44px; }
.compact-month .month-picker { min-width: 44px; height: 44px; font-size: 13px; }
.compact-month .month-picker input { min-height: 44px; height: 44px; }
.compact-page summary, .compact-dialog summary { min-height: 44px; }
.compact-page .filters { padding: 8px 12px; }
.compact-page .filters > summary { min-height: 48px; padding: 4px 0; font-size: 14px; }
.filters > summary small { display: block; margin: 3px 0 0 16px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.35; }
.filters:not([open]) > summary { margin-bottom: 0; }
.compact-page .filters input, .compact-page .filters select { min-height: 44px; height: 44px; font-size: 16px; }
.compact-page label { font-size: 13px; }
.filter-sharing { margin: 4px 0; font-size: 12px; }
.compact-page .inline-actions { margin-top: 8px; }
.transaction-actions { display: block; }
.transaction-actions > summary { list-style: none; min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; font-size: 22px; cursor: pointer; border-radius: 8px; }
.transaction-actions > summary::-webkit-details-marker { display: none; }
.transaction-actions[open] > div { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.transaction-end { align-self: start; }
.transaction-note { font-size: 13px; margin-top: 4px; }
.transaction-note > summary { list-style: none; cursor: pointer; color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.transaction-note > summary::-webkit-details-marker { display: none; }
.note-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-close { display: none; }
.transaction-note[open] .note-preview { display: none; }
.transaction-note[open] .note-close { display: inline; }
.transaction-note p { white-space: pre-wrap; overflow-wrap: anywhere; }
.compact-page .transaction, .entity-history .transaction { padding: 8px 0; gap: 8px; }
.transaction-info > span, .compact-page .transaction-info > span { font-size: 12px; }
.tags { font-size: 12px; }
.compact-page .history-day-heading { margin-top: 8px; }
.budget-card { min-width: 0; }
.budget-heading h2 { overflow-wrap: anywhere; }
.budget-card.budget-red .budget-spent, .budget-card.budget-red dd { color: #a33131; }
.budget-card.budget-red progress { accent-color: #a33131; }
.budget-card.budget-red progress::-webkit-progress-value { background: #a33131; }
.budget-card.budget-orange progress { accent-color: #975009; }
.budget-card.budget-orange progress::-webkit-progress-value { background: #975009; }
.budget-unlimited, .limit-contributions { font-size: 12px; color: var(--muted); line-height: 1.4; }
.settings-group > summary { font-weight: 650; font-size: 15px; }
.settings-group[open] > summary { margin-bottom: 8px; }
.report-breakdown > summary, .report-table > summary { font-size: 14px; color: var(--green); }
.draft-notice { padding: 8px; margin-bottom: 8px; background: #e6ecdf; border-radius: 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.draft-notice span { flex-basis: 100%; }
#movement-clock-info { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
#change-movement-clock { background: transparent; border: 0; color: var(--green); text-decoration: underline; padding: 4px 0; }
.gesture-help { font-size: 13px; padding: 8px 0; color: var(--muted); }
.gesture-help > summary { min-height: 44px; cursor: pointer; }
.exact-amount { font-size: 12px; }
.exact-amount summary { min-height: 44px; color: var(--green); cursor: pointer; }
.exact-amount span { display: block; overflow-wrap: anywhere; font-size: 13px; }
@media (max-width: 360px) {
  .home-totals { gap: 6px; }
  .home-totals .stat span { font-size: 11px; }
  .home-totals .stat strong { font-size: 12px; }
  .compact-page .budget-grid { grid-template-columns: 1fr; }
}

.compact-page .transaction-end button, .compact-page .budget-heading button, .detail-toolbar button { min-height: 44px; min-width: 44px; }

.tags:empty { display: none; }
@media (max-width: 600px) { .compact-page .budget-grid.budget-long-names { grid-template-columns: 1fr; } }

.entity-card strong.budget-green { color: var(--green); }
.entity-planned { font-size: 12px; line-height: 14px; }
.stat strong small { opacity: 1; font-size: 12px; }
.compact-dialog .dialog-heading button { min-height: 44px; min-width: 44px; width: 44px; }
.titleless-dialog:not(.choosing-tags) .movement-tags { margin-right: 50px; }

.compact-page .budget-spent span { font-size: 12px; }
