:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-strong: #f0f3f2;
  --ink: #202322;
  --muted: #68716f;
  --line: #dce3e1;
  --green: #116b5b;
  --green-soft: #dceee8;
  --coral: #c85e4d;
  --coral-soft: #f5dfdb;
  --blue: #496da6;
  --blue-soft: #dfe8f7;
  --violet: #76518b;
  --violet-soft: #eadff0;
  --shadow: 0 16px 45px rgba(32, 35, 34, 0.08);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(17, 107, 91, 0.07), transparent 280px),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.lock-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.lock-panel {
  width: min(100%, 480px);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lock-panel h1,
.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.lock-panel h1 {
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1;
  margin-bottom: 24px;
}

.lock-panel label,
.field-stack label,
.month-picker span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(17, 107, 91, 0.15);
}

.password-row button,
.primary-button,
.ghost-button,
.danger-button,
.file-button,
.compact-icon-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 800;
}

.password-row button,
.primary-button {
  background: var(--green);
  color: #fff;
}

.ghost-button,
.file-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: var(--coral-soft);
  border-color: rgba(200, 94, 77, 0.35);
  color: #83372e;
}

.compact {
  min-height: 36px;
  padding: 8px 10px;
  white-space: nowrap;
}

.compact-icon-button {
  min-width: 38px;
  min-height: 38px;
  padding: 8px;
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.icon-button {
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-toggle.is-hidden-values {
  background: var(--surface-strong);
  color: var(--muted);
}

.error-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: #a73d32;
  font-weight: 700;
}

.privacy-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.app {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 18px;
}

.topbar h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.month-picker {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 7px;
  margin-bottom: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tab-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  font-weight: 850;
  white-space: nowrap;
}

.tab-button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(32, 35, 34, 0.08);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

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

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(32, 35, 34, 0.05);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  align-self: end;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.metric-card.accent {
  background: var(--green);
  color: #fff;
}

.metric-card.accent span {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-grid,
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-grid.bottom {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
}

.panel {
  padding: 18px;
}

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

.panel h2 {
  font-size: 1.25rem;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  max-height: 300px;
}

.category-bars,
.payer-grid,
.report-copy,
.transaction-list,
.goal-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 18px;
  background: var(--surface-strong);
  border: 1px dashed #c5cfcc;
  border-radius: var(--radius);
  color: var(--muted);
  line-height: 1.45;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-info {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.bar-info span:last-child {
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--blue);
}

.payer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payer-card {
  min-height: 94px;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.payer-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.payer-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.report-copy p {
  margin: 0;
  line-height: 1.5;
}

.report-copy strong {
  color: var(--green);
}

.work-grid {
  align-items: start;
}

.transactions-layout {
  display: grid;
  gap: 14px;
}

.side-stack {
  display: grid;
  gap: 14px;
  align-self: start;
  width: 100%;
}

.form-panel {
  position: sticky;
  top: 14px;
}

.side-stack .form-panel {
  position: static;
}

.collapsible-panel {
  padding: 0;
}

.collapse-summary,
.mini-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.collapse-summary {
  padding: 18px;
}

.collapse-summary::-webkit-details-marker,
.mini-summary::-webkit-details-marker {
  display: none;
}

.collapse-summary span,
.mini-summary {
  color: var(--green);
  font-weight: 900;
}

.collapsible-panel[open] .collapse-summary {
  border-bottom: 1px solid var(--line);
}

.collapsible-panel[open] .collapse-summary > span {
  font-size: 0;
}

.collapsible-panel[open] .collapse-summary > span::after {
  content: "Fechar";
  font-size: 1rem;
}

.collapsible-form {
  padding: 18px;
}

.expense-only-panel {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.field-stack {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

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

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  margin-bottom: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  min-height: 36px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 850;
}

.segmented-control input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(32, 35, 34, 0.08);
}

.color-swatch-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch-group input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.color-swatch-group span {
  display: block;
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.color-swatch-group input:checked + span {
  box-shadow: 0 0 0 3px var(--ink);
}

.transaction-item,
.goal-item,
.fixed-cost-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.transaction-main,
.goal-main,
.fixed-cost-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.transaction-title,
.goal-title,
.fixed-cost-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.transaction-title span:first-child,
.goal-title span:first-child,
.fixed-cost-title span:first-child {
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--blue-soft);
  color: #2d4d82;
  font-size: 0.76rem;
  font-weight: 900;
}

.pill.income {
  background: var(--green-soft);
  color: #0d594b;
}

.pill.paid {
  background: var(--green-soft);
  color: #0d594b;
}

.pill.expense {
  background: var(--coral-soft);
  color: #8e3b32;
}

.pill.pending {
  background: var(--coral-soft);
  color: #8e3b32;
}

.pill.neutral {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.transaction-meta,
.goal-meta,
.fixed-cost-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.transaction-value,
.goal-value {
  text-align: right;
  font-weight: 950;
  white-space: nowrap;
}

.transaction-value.income {
  color: var(--green);
}

.transaction-value.expense {
  color: var(--coral);
}

.transaction-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

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

.history-panel {
  width: 100%;
  margin-top: 4px;
}

.history-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.history-totals article {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.history-totals span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-totals strong {
  font-size: 1.15rem;
}

.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.history-status-board {
  display: grid;
  gap: 12px;
}

.history-status-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.history-status-section.pending {
  border-left-color: var(--coral);
}

.history-status-section.paid,
.history-status-section.income {
  border-left-color: var(--green);
}

.history-status-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 66px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
  background: var(--surface);
}

.history-status-section > summary::-webkit-details-marker {
  display: none;
}

.history-section-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-section-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-status-section.pending .history-section-copy span {
  color: #8f4b1f;
}

.history-status-section.paid .history-section-copy span,
.history-status-section.income .history-section-copy span {
  color: var(--green);
}

.history-section-copy strong {
  font-size: 1rem;
}

.history-section-copy small {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}

.history-section-side {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.history-section-side strong {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.history-count {
  display: inline-grid;
  min-width: 34px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--coral-soft);
  color: #8e3b32;
  font-weight: 950;
}

.history-status-section.paid .history-count,
.history-status-section.income .history-count {
  background: var(--green-soft);
  color: #0d594b;
}

.history-toggle-label {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.history-toggle-label::before {
  content: "Abrir";
}

.history-status-section[open] .history-toggle-label::before {
  content: "Fechar";
}

.history-status-section .history-table-wrap {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.history-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: var(--surface);
}

.history-table th,
.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.92rem;
}

.history-table th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-table tr:last-child td {
  border-bottom: 0;
}

.history-table tr.is-editing td {
  background: var(--surface-strong);
}

.transaction-description-cell {
  display: grid;
  gap: 4px;
}

.transaction-description-cell strong {
  font-size: 0.92rem;
}

.transaction-description-cell small {
  color: var(--muted);
  line-height: 1.35;
}

.transaction-edit-row td {
  background: #fbfcfc;
  padding: 14px;
}

.transaction-edit-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(220px, 1.3fr) repeat(5, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.transaction-edit-form .field-stack label {
  font-size: 0.7rem;
}

.transaction-edit-form input,
.transaction-edit-form select,
.transaction-edit-form textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.transaction-edit-form textarea {
  min-height: 74px;
  resize: vertical;
}

.transaction-edit-form .comment-field {
  grid-column: 1 / span 5;
}

.transaction-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.money-cell {
  text-align: right;
  font-weight: 950;
  white-space: nowrap;
}

.money-cell.income {
  color: var(--green);
}

.money-cell.expense {
  color: var(--coral);
}

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

.status-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 850;
  white-space: nowrap;
}

.status-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.goal-progress {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.goal-progress .bar-fill {
  background: var(--goal-color, var(--violet));
}

.goal-item {
  border-left: 4px solid var(--goal-color, var(--violet));
}

.goal-item.completed {
  background: linear-gradient(90deg, rgba(17, 107, 91, 0.08), var(--surface) 34%);
}

.goal-status.pending {
  background: var(--coral-soft);
  color: #8e3b32;
}

.goal-status.paid,
.goal-status.completed {
  background: var(--green-soft);
  color: #0d594b;
}

.goal-status.skipped {
  background: var(--violet-soft);
  color: var(--violet);
}

.goal-month-plan,
.goal-celebration {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.goal-celebration {
  position: relative;
  overflow: hidden;
  padding-right: 86px;
}

.goal-celebration::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 14px;
  width: 58px;
  height: 34px;
  background:
    radial-gradient(circle at 12px 8px, #116b5b 0 3px, transparent 4px),
    radial-gradient(circle at 29px 20px, #c85e4d 0 3px, transparent 4px),
    radial-gradient(circle at 45px 10px, #496da6 0 3px, transparent 4px),
    radial-gradient(circle at 18px 27px, #9a6c2f 0 3px, transparent 4px),
    radial-gradient(circle at 52px 29px, #76518b 0 3px, transparent 4px);
  animation: confetti-pop 1.7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes confetti-pop {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(0) scale(0.96);
  }

  50% {
    opacity: 1;
    transform: translateY(-3px) scale(1);
  }
}

.goal-month-plan {
  border-left: 4px solid var(--coral);
}

.goal-month-plan.paid,
.goal-celebration {
  border-left-color: var(--green);
}

.goal-month-plan.skipped {
  border-left-color: var(--violet);
}

.goal-month-plan div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.goal-month-plan span,
.goal-celebration span {
  color: var(--muted);
  font-size: 0.88rem;
}

.goal-month-plan strong,
.goal-celebration strong {
  color: var(--ink);
}

.goal-month-plan small {
  color: var(--muted);
  line-height: 1.4;
}

.goal-side {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: 190px;
}

.goal-amount-entry {
  display: grid;
  gap: 6px;
  width: 100%;
}

.goal-amount-entry label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.goal-amount-entry input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: right;
}

.goal-month-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

.goal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.fixed-cost-panel .panel-heading {
  align-items: center;
}

.fixed-cost-add {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.fixed-cost-add .mini-summary {
  min-height: 40px;
}

.fixed-cost-form {
  padding-top: 12px;
}

.fixed-cost-list {
  display: grid;
  gap: 14px;
}

.fixed-cost-board {
  display: grid;
  gap: 12px;
}

.fixed-cost-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.fixed-cost-column > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 70px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 950;
  background: var(--surface);
}

.fixed-cost-column > summary::-webkit-details-marker {
  display: none;
}

.fixed-cost-column.pending {
  border-left-color: var(--coral);
}

.fixed-cost-column.paid {
  border-left-color: var(--green);
}

.fixed-column-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.fixed-column-copy span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.fixed-cost-column.pending .fixed-column-copy span {
  color: #8f4b1f;
}

.fixed-cost-column.paid .fixed-column-copy span {
  color: var(--green);
}

.fixed-column-copy strong {
  color: var(--ink);
  font-size: 1rem;
  white-space: normal;
}

.fixed-column-copy small {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}

.fixed-column-side {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.fixed-column-side strong {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.fixed-count {
  display: inline-grid;
  min-width: 34px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--coral-soft);
  color: #8e3b32;
  font-weight: 950;
}

.fixed-cost-column.paid .fixed-count {
  background: var(--green-soft);
  color: #0d594b;
}

.fixed-toggle-label {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.fixed-toggle-label::before {
  content: "Abrir";
}

.fixed-cost-column[open] .fixed-toggle-label::before {
  content: "Fechar";
}

.fixed-cost-column-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  background: var(--surface);
}

.fixed-cost-column .fixed-cost-item {
  grid-template-columns: 1fr;
  background: var(--surface);
}

.fixed-cost-edit {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.fixed-cost-edit-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 82px minmax(120px, 0.8fr);
  gap: 8px;
}

.fixed-cost-edit label {
  display: grid;
  gap: 6px;
}

.fixed-cost-edit span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: right;
  text-transform: uppercase;
}

.fixed-cost-input {
  min-height: 38px;
  text-align: right;
}

.fixed-cost-input.due {
  min-width: 72px;
}

.fixed-cost-editor {
  min-height: 38px;
}

.fixed-cost-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.fixed-cost-history {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.history-heading {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.history-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  font-size: 0.9rem;
}

.history-item span {
  color: var(--muted);
}

.compact-empty {
  padding: 12px;
}

.fixed-total {
  color: var(--green);
  white-space: nowrap;
}

.full-button {
  width: 100%;
}

.backup-panel {
  max-width: 760px;
}

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

.file-button {
  display: inline-grid;
  place-items: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .app {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
  }

  .summary-grid,
  .dashboard-grid,
  .dashboard-grid.bottom,
  .work-grid,
  .fixed-cost-board {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }

  .side-stack {
    position: static;
  }
}

@media (max-width: 560px) {
  .lock-panel {
    padding: 20px;
  }

  .password-row,
  .form-row,
  .payer-grid,
  .topbar-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .summary-grid {
    gap: 10px;
  }

  .metric-card {
    min-height: 94px;
  }

  .panel {
    padding: 14px;
  }

  .collapsible-panel {
    padding: 0;
  }

  .expense-only-panel {
    padding: 14px;
  }

  .history-totals {
    grid-template-columns: 1fr;
  }

  .history-status-section > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-section-side {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .transaction-edit-form {
    grid-template-columns: 1fr;
  }

  .transaction-edit-form .comment-field {
    grid-column: auto;
  }

  .transaction-edit-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .transaction-item,
  .goal-item,
  .fixed-cost-item {
    grid-template-columns: 1fr;
  }

  .transaction-value,
  .goal-value {
    text-align: left;
  }

  .transaction-side {
    justify-items: start;
  }

  .goal-side {
    justify-items: start;
    min-width: 0;
    width: 100%;
  }

  .goal-month-plan div {
    align-items: flex-start;
    flex-direction: column;
  }

  .goal-celebration {
    padding-right: 12px;
  }

  .goal-celebration::after {
    display: none;
  }

  .goal-month-actions {
    width: 100%;
  }

  .transaction-actions {
    justify-content: flex-start;
  }

  .fixed-cost-edit {
    justify-items: start;
  }

  .fixed-cost-column > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .fixed-column-side {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .fixed-cost-actions {
    justify-content: flex-start;
  }

  .fixed-cost-edit-row {
    grid-template-columns: 1fr;
  }

  .fixed-cost-edit span {
    text-align: left;
  }
}
