:root {
  --bg: #7aa35a;
  --card: rgba(255, 255, 255, 0.84);
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-2: #f4f4f5;
  --track: rgba(255, 255, 255, 0.62);
  --accent: #27272a;
  --plus: #047857;
  --minus: #b42318;
  --danger: #b42318;
  --radius: 8px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

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

html,
body {
  margin: 0;
  max-width: 100%;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background: #2f4a28;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #2f4a28;
}

.page-bg-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 18% 12%, rgba(154, 197, 112, 0.42) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 18%, rgba(232, 212, 140, 0.22) 0%, transparent 50%),
    linear-gradient(160deg, #4d7340 0%, #2f4a28 48%, #1f331c 100%);
}

.page-bg-blur,
.page-bg-main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  border: 0;
  transition: opacity 0.28s ease;
}

.page-bg.is-pending .page-bg-blur,
.page-bg.is-ready .page-bg-blur {
  opacity: 1;
}

.page-bg.is-ready .page-bg-main {
  opacity: 1;
}

.page-bg-blur {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scale(1.12);
  filter: blur(26px) saturate(1.12) brightness(0.78);
  -webkit-filter: blur(26px) saturate(1.12) brightness(0.78);
}

.page-bg-main {
  object-fit: cover;
  object-position: center center;
  z-index: 1;
}

.page-bg-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.1);
}

.hidden {
  display: none !important;
}

.login-screen,
.app {
  position: relative;
  z-index: 1;
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(20px, var(--safe-t)) max(16px, var(--safe-r)) max(20px, var(--safe-b)) max(16px, var(--safe-l));
}

.app {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: max(12px, var(--safe-t)) max(12px, var(--safe-r)) max(14px, var(--safe-b)) max(12px, var(--safe-l));
}

.login-card,
.hero-stats,
.composer {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.col-ledger {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 12px;
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.flow-day {
  background: transparent;
  border: 0;
}

.login-card {
  width: min(400px, 100%);
  padding: 28px 24px;
}

.login-card label {
  margin-top: 14px;
}

.login-card .btn-gold {
  width: 100%;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn-spin {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
  flex: 0 0 auto;
}

#login-submit.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

#login-submit.is-loading .login-btn-spin {
  display: inline-block;
}

.login-card.is-loading {
  pointer-events: none;
}

.login-card.is-loading input,
.login-card.is-loading .login-check {
  opacity: 0.7;
}

@keyframes loginSpin {
  to {
    transform: rotate(360deg);
  }
}

.login-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.login-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.login-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.session-user-line {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.session-user-line strong {
  color: var(--ink);
  font-weight: 650;
}

.stats-fold {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: var(--card);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  overflow: hidden;
}

.stats-fold-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.stats-fold-summary::-webkit-details-marker {
  display: none;
}

.stats-fold-summary::after {
  content: " ▾";
  float: right;
  color: var(--ink);
}

.stats-fold[open] .stats-fold-summary::after {
  content: " ▴";
}

.stats-fold[open] .stats-fold-summary {
  border-bottom: 1px solid var(--line);
}

.stats-fold .hero-stats {
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
}

.item-by {
  color: var(--ink);
  font-weight: 600;
}

.col-entry,
.col-ledger {
  min-width: 0;
  width: 100%;
}

.col-entry {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.col-ledger {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
}

.top-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.period-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: var(--track);
  border-radius: 8px;
  flex: 0 0 auto;
  min-width: 132px;
}

.kicker,
.login-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 11px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.brand {
  min-width: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.2;
}

.month-nav {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 2px;
  padding: 3px;
  background: var(--track);
  border-radius: 8px;
}

.month-nav strong {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.month-nav button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.month-nav button:hover {
  background: #fff;
}

.hero-stats,
.composer {
  padding: 16px;
}

.stat-main span,
.stat-grid span,
label span {
  color: var(--muted);
  font-size: 12px;
}

.stat-main strong {
  display: block;
  margin: 4px 0 4px;
  font-size: 32px;
  letter-spacing: -0.03em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat-main em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.stat-grid article {
  min-width: 0;
  padding: 10px;
  background: var(--track);
  border-radius: 8px;
}

.stat-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.plus {
  color: var(--plus);
}

.minus {
  color: var(--minus);
}

.kind-switch,
.view-switch,
.merge-tabs {
  display: grid;
  gap: 3px;
  padding: 3px;
  background: var(--track);
  border-radius: 8px;
}

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

.kind-btn,
.chip,
.btn,
.month-nav button,
.item-actions button {
  touch-action: manipulation;
}

.kind-btn,
.chip {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  min-height: 36px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.kind-btn.is-on,
.chip.is-on {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}

#btn-logout {
  flex: 0 0 auto;
}

label {
  display: block;
  min-width: 0;
}

label span {
  display: block;
  margin-bottom: 6px;
}

.money-row,
.more-row,
.composer-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.money-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr);
}

#record-form.is-expense .money-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.more-row,
.composer-actions,
#record-form.is-editing .composer-actions {
  grid-template-columns: minmax(0, 1fr);
}

.date-field {
  margin: 0;
}

#record-form > label {
  margin-top: 12px;
}

.pay-field {
  margin: 0;
  min-width: 0;
}

.pay-select {
  position: relative;
}

.pay-trigger {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 36px 10px 12px;
  outline: none;
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2371717a' d='M1.2 1.4h9.6L6 7.2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}

.pay-trigger:focus {
  border-color: #a1a1aa;
}

.pay-select.is-open .pay-trigger {
  border-color: #a1a1aa;
}

.pay-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 24, 27, 0.12);
  overflow: hidden;
}

.pay-menu[hidden] {
  display: none;
}

.pay-menu li {
  padding: 10px 12px;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

.pay-menu li.is-on {
  background: #e4e4e7;
}

.pay-menu li:active,
.pay-menu li:hover {
  background: #f4f4f5;
}

.pay-menu li.is-on:hover,
.pay-menu li.is-on:active {
  background: #e4e4e7;
}

input,
button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  font-size: 16px;
}

input[type="date"] {
  display: block;
}

input:focus {
  border-color: #a1a1aa;
}

.profit-preview {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--track);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  background: var(--track);
  color: var(--ink);
}

.btn-gold {
  color: #fff;
  background: var(--accent);
}

.btn-gold:hover {
  background: #3f3f46;
}

.btn-ghost {
  background: var(--track);
  color: var(--ink);
}

.btn-ghost:hover {
  background: #e4e4e7;
}

.btn-slim {
  padding: 8px 12px;
  width: auto;
  min-height: 36px;
  font-weight: 500;
}

.more-row .btn,
.composer-actions .btn,
.composer-actions .btn-gold {
  width: 100%;
}

.form-error,
.login-hint {
  color: var(--muted);
}

.empty {
  color: var(--muted);
  text-shadow: none;
}

.form-error {
  color: var(--danger);
}

.ledger-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 12px 0;
}

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

.merge-range {
  position: relative;
  margin: 0;
  min-height: 0;
}

.range-pop {
  position: fixed;
  z-index: 80;
  width: min(332px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(24, 24, 27, 0.16);
}

.range-pop[hidden] {
  display: none;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-nav strong {
  font-size: 14px;
}

.cal-nav button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--line-2);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-week {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.cal-grid button {
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cal-grid button.muted {
  color: #a1a1aa;
}

.cal-grid button.is-on {
  background: #18181b;
  color: #fff;
}

.cal-grid button.is-today:not(.is-on) {
  box-shadow: inset 0 0 0 1px #a1a1aa;
}

.cal-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.merge-range-hint {
  margin: 0 0 10px;
  display: block;
}

.range-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}

.range-quick,
.range-node {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.86);
  color: #111827;
  font: inherit;
  cursor: pointer;
}

.range-quick {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.range-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.range-node {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 12px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.range-node em {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.range-node input[type="date"] {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.range-node:hover,
.range-node.is-picking {
  border-color: rgba(17, 24, 39, 0.28);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
  background: #fff;
}

.cal-grid button.is-in-range:not(.is-on) {
  background: rgba(24, 24, 27, 0.08);
}

.cal-grid button.is-from,
.cal-grid button.is-to {
  background: #18181b;
  color: #fff;
}

.range-nodes-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.merge-span {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.merge-row.is-clickable {
  cursor: pointer;
}

.merge-row.is-clickable:hover td {
  background: rgba(17, 24, 39, 0.04);
}

.merge-row.is-clickable.is-open td {
  background: rgba(17, 24, 39, 0.07);
}

.merge-detail-hint {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.day-detail {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 24, 39, 0.08);
}

#view-merge.is-detail .merge-range,
#view-merge.is-detail .merge-range-hint,
#view-merge.is-detail .merge-tabs,
#view-merge.is-detail .table-wrap {
  display: none !important;
}

#view-merge.is-detail .day-detail {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.day-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.day-detail-head strong {
  display: block;
  font-size: 15px;
}

.day-detail-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.day-detail-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.03);
}

.day-detail-item.is-cat {
  grid-template-columns: 72px 1fr;
}

.day-detail-time {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  padding-top: 2px;
}

.day-detail-time em,
.day-detail-time span {
  display: block;
  font-style: normal;
}

.day-detail-time em {
  font-size: 12px;
}

.day-detail-time span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.day-detail-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.day-detail-body p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.day-detail-body p.plus,
.day-detail-body p.minus {
  margin-top: 4px;
  font-weight: 600;
}

.day-detail-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.trash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.trash-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.merge-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 10px;
}

.search {
  margin: 0;
  min-width: 0;
}

.search span {
  display: none;
}

.pane {
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.flow {
  display: grid;
  gap: 14px;
}

.flow-day {
  padding: 0;
  overflow: hidden;
}

.flow-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.flow-head strong {
  color: var(--ink);
  font-weight: 600;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.item h3 {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.item-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.item-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.item-actions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 8px;
  min-height: 36px;
  font-size: 13px;
}

.item-actions button:hover {
  color: var(--ink);
}

.item-actions .danger {
  color: var(--danger);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager .btn {
  padding: 8px 12px;
  font-weight: 500;
}

.pager .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.empty {
  margin: 32px 0;
  text-align: center;
}

@media (max-width: 520px) {
  .merge-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .view-switch .chip {
    font-size: 12px;
    padding: 8px 4px;
  }
}

@media (min-width: 521px) {
  .more-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .more-row .btn {
    width: auto;
    min-width: 72px;
    height: 42px;
  }

  #record-form.is-editing .composer-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #record-form.is-editing .composer-actions .btn-ghost {
    width: auto;
  }

  .stat-main strong {
    font-size: 36px;
  }
}

@media (min-width: 861px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    overflow: hidden;
  }

  .app {
    display: grid;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100dvh;
    gap: 16px;
    padding: 18px;
    overflow: hidden;
  }

  .col-entry {
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .col-ledger {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .top-actions {
    grid-column: auto;
    flex: 0 0 auto;
  }

  .month-nav {
    flex: 0 0 auto;
  }

  .month-nav strong {
    min-width: 72px;
    flex: 0 0 auto;
    padding: 0 8px;
  }

  .month-nav button {
    width: 32px;
    height: 32px;
  }

  .brand h1 {
    font-size: 22px;
  }

  .hero-stats,
  .composer {
    padding: 18px;
  }

  .stat-main strong {
    font-size: 38px;
  }

  .ledger-head {
    flex-direction: row;
    align-items: center;
    padding: 14px 16px 0;
  }

  .view-switch {
    width: 252px;
    flex: 0 0 auto;
  }

  .search {
    flex: 1;
  }

  .pane {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 14px 16px 16px;
  }

  .pager {
    margin-top: auto;
  }

  .table-wrap {
    flex: 1;
    min-height: 0;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="date"] {
    font-size: 14px;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-card,
  .hero-stats,
  .composer,
  .col-ledger {
    background: rgba(255, 255, 255, 0.92);
  }
}
