:root {
  --bg: #f7f7f8;
  --ink: #111113;
  --muted: #6a6d73;
  --line: rgba(25, 26, 30, 0.13);
  --line-strong: rgba(25, 26, 30, 0.24);
  --glass: rgba(255, 255, 255, 0.48);
  --glass-strong: rgba(255, 255, 255, 0.64);
  --glass-soft: rgba(255, 255, 255, 0.28);
  --field: rgba(255, 255, 255, 0.46);
  --accent: #d93131;
  --accent-deep: #8f1717;
  --income: #c92f2f;
  --income-bg: rgba(217, 49, 49, 0.12);
  --expense: #d93131;
  --expense-bg: rgba(217, 49, 49, 0.14);
  --shadow: 0 28px 70px rgba(17, 17, 19, 0.12);
  --shadow-soft: 0 14px 34px rgba(17, 17, 19, 0.09);
  --radius: 24px;
  --radius-small: 16px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  --bg: #000000;
  --ink: #f7f7f7;
  --muted: #a7a8ad;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-soft: rgba(255, 255, 255, 0.055);
  --field: rgba(255, 255, 255, 0.07);
  --accent: #ff4646;
  --accent-deep: #c91818;
  --income: #ff5a5a;
  --income-bg: rgba(255, 70, 70, 0.13);
  --expense: #ff4646;
  --expense-bg: rgba(255, 70, 70, 0.16);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.62);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
}

body {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
.balance-panel,
.metric,
.auth-panel,
.entry-form,
.ledger-panel,
.breakdown-panel,
.recently-deleted-panel,
.filters,
.table-wrap,
.calendar-popover,
.bar-row,
.account-bar,
.shell-actions,
.topbar > div:first-child {
  -webkit-backdrop-filter: blur(26px) saturate(1.28);
  backdrop-filter: blur(26px) saturate(1.28);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 34px) 14px 44px;
}

.shell-actions {
  position: sticky;
  top: 14px;
  z-index: 12;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-bottom: 14px;
  pointer-events: none;
}

.shell-actions > * {
  pointer-events: auto;
}

.topbar,
.auth-panel,
.summary-grid,
.workspace,
.breakdown-panel,
.recently-deleted-panel {
  width: 100%;
  min-width: 0;
  margin-bottom: 16px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 440px);
  gap: 16px;
  align-items: stretch;
}

.topbar > *,
.summary-grid > *,
.workspace > *,
.auth-panel > *,
.breakdown-panel > *,
.recently-deleted-panel > * {
  min-width: 0;
}

.topbar > div:first-child {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 188px;
  padding: 8px 0;
}

h2 {
  margin: 0;
  letter-spacing: 0;
}

.cashbox-name-input {
  max-width: 680px;
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: clamp(2.25rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 0.94;
}

.cashbox-name-input:focus {
  box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 56%, transparent);
}

h2 {
  font-size: 1.18rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.sun-icon,
body[data-theme="dark"] .moon-icon {
  display: none;
}

body[data-theme="dark"] .sun-icon {
  display: block;
}

.account-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(430px, calc(100vw - 92px));
  padding: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--shadow-soft);
}

.account-bar span {
  max-width: min(330px, 68vw);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-bar button {
  min-height: 34px;
  padding: 0 13px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 850;
}

.balance-panel,
.metric,
.auth-panel,
.entry-form,
.ledger-panel,
.breakdown-panel,
.recently-deleted-panel {
  border: 0;
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow);
}

.balance-panel {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --tilt-lift: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 188px;
  padding: clamp(20px, 3vw, 28px);
  isolation: isolate;
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(var(--tilt-lift));
  transform-style: preserve-3d;
  transition: box-shadow 180ms ease;
  will-change: transform;
}

.balance-panel:hover {
  box-shadow:
    0 34px 82px rgba(17, 17, 19, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.balance-panel::before {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 260px;
  height: 260px;
  transform: translate(80px, 130px);
  border-radius: 50%;
  background: rgba(217, 49, 49, 0.24);
  filter: blur(24px);
  pointer-events: none;
}

body[data-theme="dark"] .balance-panel::before {
  background: rgba(255, 70, 70, 0.16);
}

.balance-panel span,
.metric span,
label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.balance-panel strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 22px;
  max-width: 100%;
  font-size: clamp(1.55rem, 2.7vw, 2.65rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  transform: translateZ(24px);
}

.top-currency-control {
  position: relative;
  z-index: 1;
  transform: translateZ(18px);
  display: grid;
  gap: 7px;
  width: min(190px, 100%);
  margin-top: 18px;
}

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

.metric {
  min-height: 108px;
  padding: 18px;
  background: var(--glass-soft);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.08rem, 1.85vw, 1.45rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.metric.income strong {
  color: var(--income);
}

.metric.expense strong {
  color: var(--expense);
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 22px;
  align-items: center;
  padding: clamp(20px, 3vw, 28px);
}

.auth-panel h2,
.auth-panel p {
  margin: 0;
}

.auth-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.55;
}

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

.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

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

.auth-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.auth-options input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
  box-shadow: none;
}

.auth-options span {
  min-width: 0;
}

.auth-actions > button:not(.primary-action) {
  color: var(--accent);
  font-weight: 850;
}

.auth-message {
  min-height: 1.35em;
  font-size: 0.88rem;
  font-weight: 750;
}

.auth-message.error {
  color: var(--expense);
}

.auth-message.success {
  color: var(--income);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.entry-form,
.ledger-panel,
.breakdown-panel {
  padding: clamp(16px, 2vw, 22px);
}

.entry-form {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.form-header,
.ledger-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.type-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 124px;
  padding: 5px;
  border: 0;
  border-radius: 999px;
  background: var(--field);
}

.type-toggle label {
  cursor: pointer;
}

.type-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-toggle span {
  display: block;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.type-toggle input:checked + span {
  background: var(--glass-strong);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.entry-form label,
.filters label {
  display: grid;
  gap: 7px;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--field);
  color: var(--ink);
  padding: 0 15px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

select {
  appearance: auto;
}

input::placeholder {
  color: color-mix(in srgb, var(--muted) 74%, transparent);
}

.date-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
}

.date-picker input {
  border-radius: var(--radius-small) 0 0 var(--radius-small);
}

.date-picker-button {
  min-height: 46px;
  border-left: 0;
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  background: var(--field);
}

input:focus,
select:focus {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary-action {
  position: relative;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 60px;
  margin-top: 4px;
  padding: 9px 15px;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(217, 49, 49, 0.9), rgba(143, 23, 23, 0.78)),
    var(--glass);
  color: #fff;
  box-shadow:
    0 18px 38px rgba(217, 49, 49, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  text-align: left;
  overflow: hidden;
}

body[data-theme="dark"] .primary-action {
  background:
    linear-gradient(135deg, rgba(255, 70, 70, 0.74), rgba(145, 11, 11, 0.58)),
    var(--glass);
  box-shadow:
    0 18px 42px rgba(255, 70, 70, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.primary-action:hover {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 22px 44px rgba(217, 49, 49, 0.31),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 3px;
}

.primary-action-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.primary-action-icon svg {
  width: 19px;
  height: 19px;
}

.primary-action-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.primary-action-copy strong {
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.primary-action-copy small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1;
}

.toolbar-actions,
.row-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button,
.row-actions button {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
}

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

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

.success {
  color: var(--income);
}

.row-actions {
  justify-content: flex-end;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--glass-soft);
}

.filters label:first-child {
  grid-column: span 2;
}

.table-wrap {
  position: relative;
  overflow-x: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--glass-soft);
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: transparent;
}

.date-col {
  width: 11%;
}

.type-col {
  width: 8%;
}

.vendor-col {
  width: 13%;
}

.description-col {
  width: 15%;
}

.category-col {
  width: 11%;
}

.note-col {
  width: 8%;
}

.amount-col {
  width: 24%;
}

.actions-col {
  width: 10%;
}

thead {
  background: color-mix(in srgb, var(--glass-strong) 72%, transparent);
}

th,
td {
  padding: 12px 8px;
  border-bottom: 0;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--glass-strong) 64%, transparent);
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.amount-cell {
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  text-align: right;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

td:first-child,
th:first-child {
  white-space: nowrap;
  overflow-wrap: normal;
}

td:first-child {
  font-size: 0.9rem;
}

.amount-cell.income,
.amount-cell.expense {
  font-weight: 900;
}

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

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

.money-line {
  display: block;
  max-width: 100%;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.balance-panel .money-line + .money-line,
.metric .money-line + .money-line,
.bar-row .money-line + .money-line {
  margin-top: 4px;
}

.balance-panel .money-line {
  font-size: clamp(1.28rem, 2.2vw, 2.1rem);
}

.metric .money-line,
.bar-row .money-line {
  font-size: clamp(0.82rem, 1.2vw, 1rem);
}

.ledger-amount-input {
  width: 118px;
  min-height: 38px;
  text-align: right;
  font-weight: 900;
}

.ledger-amount-input.income {
  color: var(--income);
}

.ledger-amount-input.expense {
  color: var(--expense);
}

.pill {
  display: inline-flex;
  min-width: 68px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.pill.income {
  background: var(--income-bg);
  color: var(--income);
}

.pill.expense {
  background: var(--expense-bg);
  color: var(--expense);
}

.note-cell {
  max-width: 260px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty-state {
  display: none;
  min-height: 166px;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state.visible {
  display: grid;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.1rem;
}

.calendar-popover {
  position: absolute;
  z-index: 20;
  width: min(284px, calc(100vw - 24px));
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}

.calendar-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-header strong {
  text-align: center;
}

.calendar-header button {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 5px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
}

.calendar-days button,
.calendar-empty {
  min-height: 34px;
}

.calendar-days button {
  border: 0;
  border-radius: 999px;
  background: var(--field);
}

.calendar-days button:hover,
.calendar-days button.selected {
  background: var(--accent);
  color: #fff;
}

.breakdown-panel {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.breakdown {
  display: grid;
  gap: 12px;
}

.breakdown .empty-state {
  justify-items: center;
  align-content: center;
  text-align: center;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr minmax(82px, auto);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--glass-soft);
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
}

.bar-row strong,
.bar-row span {
  overflow-wrap: anywhere;
}

.bar-row strong:last-child {
  text-align: right;
}

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

.deleted-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-small);
  background: var(--glass-soft);
}

.deleted-entry > div:first-child {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.deleted-entry strong,
.deleted-entry span,
.deleted-entry small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.deleted-entry span,
.deleted-entry small {
  color: var(--muted);
}

.deleted-entry small {
  font-size: 0.78rem;
  font-weight: 760;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .entry-form {
    position: static;
  }
}

@media (max-width: 980px) {
  .topbar,
  .auth-panel,
  .breakdown-panel {
    grid-template-columns: 1fr;
  }

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

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

  .filters label:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 1280px) {
  .app-shell,
  .app-shell *,
  .app-shell *::before,
  .app-shell *::after {
    max-width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  table {
    width: 100%;
    min-width: 0;
  }

  colgroup,
  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    padding: 13px 14px;
    border: 0;
    border-radius: var(--radius);
    background: var(--glass-soft);
    box-shadow: var(--shadow-soft);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    backdrop-filter: blur(24px) saturate(1.2);
  }

  tr:hover {
    background: var(--glass);
  }

  td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border: 0;
    white-space: normal;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  td:first-child {
    font-size: 1rem;
    white-space: normal;
  }

  .amount-cell {
    text-align: left;
    white-space: normal;
  }

  td[data-label="Actions"] {
    display: block;
    padding-top: 10px;
  }

  td[data-label="Actions"]::before {
    display: none;
  }

  .row-actions {
    justify-content: flex-end;
    gap: 6px;
  }

  .ledger-amount-input {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    max-width: 100%;
    padding: 16px 16px 44px;
    overflow-x: clip;
  }

  .shell-actions {
    position: sticky;
    top: 10px;
    width: 100%;
    margin-bottom: 12px;
    padding: 0;
  }

  .shell-actions .theme-toggle {
    flex: 0 0 46px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 12px;
  }

  .topbar,
  .auth-panel,
  .summary-grid,
  .workspace,
  .entry-form,
  .ledger-panel,
  .breakdown-panel,
  .recently-deleted-panel,
  .filters,
  .table-wrap {
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .topbar > div:first-child {
    position: relative;
    align-content: start;
    justify-items: stretch;
    min-height: 0;
    padding: 18px;
    border: 0;
    border-radius: var(--radius);
    background: var(--glass);
    box-shadow: var(--shadow);
  }

  .cashbox-name-input {
    max-width: 100%;
    font-size: clamp(1.95rem, 8.2vw, 2.55rem);
    line-height: 0.98;
  }

  .eyebrow {
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .theme-toggle {
    margin-top: 0;
  }

  .account-bar {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) auto;
    flex: 0 1 auto;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: calc(100vw - 94px);
    padding: 8px 8px 8px 14px;
    border-radius: 999px;
  }

  .account-bar span {
    max-width: 100%;
  }

  .account-bar button {
    min-width: 96px;
  }

  .balance-panel {
    min-height: 140px;
    padding: 20px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .auth-options {
    grid-template-columns: 1fr;
  }

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

  .metric {
    min-height: 92px;
    padding: 14px;
  }

  .metric strong {
    font-size: clamp(1.15rem, 6vw, 1.55rem);
  }

  .filters label:first-child {
    grid-column: span 1;
  }

  .form-header,
  .ledger-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .type-toggle {
    width: 100%;
  }

  .toolbar-actions {
    justify-content: flex-end;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-row strong:last-child {
    text-align: left;
  }
}

@media (max-width: 430px) {
  .app-shell {
    width: 100%;
    max-width: 100%;
    padding-right: 16px;
    padding-left: 16px;
  }

  .entry-form,
  .ledger-panel,
  .breakdown-panel,
  .recently-deleted-panel,
  .auth-panel {
    padding: 14px;
  }

  .balance-panel,
  .metric,
  .auth-panel,
  .entry-form,
  .ledger-panel,
  .breakdown-panel,
  .recently-deleted-panel,
  .filters,
  tr {
    border-radius: 20px;
  }

  td {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
  }
}
