:root {
  --paper: #f4f6fb;
  --card: #fcfdff;
  --ink: #161d2e;
  --muted: #616d86;
  --line: #dde3f0;
  --green: #25488e;
  --pale: #e6ecf8;
  --red: #b5385c;
  --shadow: 0 6px 24px #18264a0a;
  color-scheme: light;
}
.quota-status {
  padding: 10px 12px;
  margin-bottom: 7px;
  border-radius: 10px;
  background: var(--pale);
}
.quota-status b {
  font-size: 14px;
}
.quota-search {
  margin-top: 15px;
}
.quota-caption {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.account-btn span {
  max-width: 30vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--paper);
}
body {
  margin: 0;
  color: var(--ink);
  font:
    15px/1.55 Inter,
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--entry-accent, #3b63b8);
  outline-offset: 3px;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled) {
  filter: brightness(0.96);
}
a {
  color: var(--green);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 4vw, 41px);
  letter-spacing: -0.055em;
  line-height: 1.25;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.03em;
  font-weight: 650;
}
h3 {
  font-size: 14px;
}
input,
select {
  min-width: 0;
}
.mast {
  background: #f8f9fd;
  border-bottom: 1px solid var(--line);
}
.mast-inner {
  max-width: 1140px;
  padding: 0 40px;
  height: 75px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 48px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}
.brand img {
  display: block;
  border-radius: 9px;
  box-shadow: 0 2px 6px #0f172a24;
}
.nav {
  display: flex;
  gap: 8px;
}
.nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}
.nav button[aria-current="page"] {
  background: #e4ebf9;
  color: #1e3f82;
  font-weight: 650;
}
.account-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  min-height: 40px;
  padding: 4px 10px 4px 5px;
  border-radius: 99px;
}
.account-btn:hover:not(:disabled) {
  background: #e8eefb;
}
.account-btn[data-auth="user"]::after {
  font: normal 11px/1 LedgerIcons;
  content: "\f282";
  color: var(--muted);
  margin-left: -2px;
}
.account-btn i {
  border: 1px solid #c9d4ea;
  border-radius: 50%;
  height: 31px;
  width: 31px;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.mobile {
  display: none;
}
main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 38px 40px 70px;
}
.page-title,
.section-line,
.amount-top,
.time-row,
.save-line,
.net-line,
.sheet-head,
.note-field,
.toolbar,
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-title {
  margin-bottom: 21px;
}
.page-title p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.025em;
}
.plain,
.primary,
.subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  min-height: 42px;
  padding: 8px 15px;
  font-weight: 550;
}
.plain {
  border: 1px solid #cbd5ea;
  background: var(--card);
  color: var(--entry-accent, var(--green));
}
.primary {
  background: var(--entry-accent, var(--green));
  color: white;
  border: 1px solid var(--entry-accent, var(--green));
}
.subtle {
  background: #ebf0fa;
  color: var(--green);
}
.photo-btn {
  font-size: 14px;
}
.photo-btn i {
  font-size: 18px;
}
@media (min-width: 641px) {
  main[data-page="compose"] {
    max-width: 740px;
  }
}
.card {
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
:is(.card, .record-highlight)[data-entry-kind] {
  --card: #f8f9fc;
  --line: #d6dceb;
  --entry-wash-rgb: 225, 231, 244;
  --entry-accent: #3e4c6d;
  --entry-muted: #556280;
  --entry-selected-line: #7382a3;
  --entry-control-fill: rgba(43, 58, 94, 0.06);
}
:is(.card, .record-highlight)[data-entry-kind="expense"] {
  --card: #f6f9ff;
  --line: #cfe0f5;
  --entry-wash-rgb: 213, 231, 253;
  --entry-accent: #1d4b8f;
  --entry-muted: #476491;
  --entry-selected-line: #5886c9;
}
:is(.card, .record-highlight)[data-entry-kind="income"] {
  --card: #faf7ff;
  --line: #ded2f4;
  --entry-wash-rgb: 232, 220, 253;
  --entry-accent: #5a3696;
  --entry-muted: #66508f;
  --entry-selected-line: #8968c7;
}
.entry-form fieldset {
  min-inline-size: 0;
  margin: 0;
}
#entry-fields {
  border: 0;
  padding: 0;
}
.amount-block {
  border: 0;
  color: var(--entry-accent);
  background-color: rgb(var(--entry-wash-rgb));
  background-image: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.32),
    transparent 78%
  );
  padding: 25px 29px 21px;
  border-bottom: 1px solid var(--line);
}
.amount-top label,
.field-label {
  font-weight: 550;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.field-label i {
  color: var(--entry-muted, #687694);
  font-size: 15px;
}
.kind-switch,
.seg {
  display: inline-flex;
  align-items: center;
  background: var(--entry-control-fill, #dfe6f4);
  padding: 3px;
  border-radius: 9px;
  gap: 1px;
}
.kind-switch button,
.seg button {
  font-size: 13px;
  color: var(--entry-muted, #51607d);
  padding: 5px 13px;
  border-radius: 7px;
  min-height: 32px;
}
.kind-switch button.chosen,
.seg button.chosen {
  background: var(--card);
  color: var(--entry-accent, var(--green));
  box-shadow: 0 1px 3px #18243d18;
  font-weight: 650;
}
.kind-switch .more-kind {
  padding: 5px 8px;
}
.money-input {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  color: var(--entry-accent);
}
.money-input span {
  font-size: 32px;
  font-weight: 520;
}
.money-input input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: 0;
  font-size: clamp(46px, 5.5vw, 64px);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 1.2;
  font-weight: 500;
  padding: 0;
}
.money-input input::placeholder {
  color: var(--entry-muted);
  opacity: 1;
}
.money-input input:focus-visible {
  outline: 0;
}
.form-body {
  padding: 4px 28px 24px;
}
.time-row {
  min-height: 60px;
  border-bottom: 1px solid var(--line);
}
.value-btn,
.text-btn,
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  font-size: 13px;
  color: var(--entry-accent, var(--green));
}
.value-btn {
  font-size: 14px;
}
.text-btn i,
.value-btn i {
  font-size: 11px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--green);
}
.icon-btn:hover {
  background: var(--pale);
}
#category-row {
  padding: 9px 0 18px;
  border-bottom: 1px solid var(--line);
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.quick,
.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 5px;
  background: var(--entry-control-fill, #eef2fa);
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  min-height: 43px;
}
.quick .ic,
.choice .ic {
  font-size: 17px;
  color: var(--entry-muted, #5c6d8e);
}
.quick {
  min-width: 0;
}
.quick .ic {
  flex: none;
}
.quick-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick.chosen,
.choice.chosen {
  background: rgb(var(--entry-wash-rgb, 219, 232, 252));
  color: var(--entry-accent, #25488e);
  border-color: var(--entry-selected-line, #6b8fc9);
  font-weight: 600;
}
.note-field {
  min-height: 64px;
  justify-content: flex-start;
  gap: 18px;
}
.note-field input,
.form-field input {
  border: 0;
  background: transparent;
  outline: 0;
  flex: 1;
  width: 100%;
  font-size: 14px;
}
.note-field input::placeholder {
  color: var(--entry-muted, #6f7c96);
}
.save-line {
  gap: 8px;
  margin-top: 4px;
}
.save-line > .primary {
  width: 100%;
  font-size: 16px;
  min-height: 47px;
}
.save-line > .primary i {
  font-size: 21px;
}
.save-line .plain {
  flex: none;
}
.form-field {
  display: grid;
  gap: 5px;
  margin: 10px 0;
}
.form-field input,
.edit-input,
.select-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 9px 11px;
  width: 100%;
}
.form-field label {
  font-size: 13px;
  color: var(--muted);
}
.panel {
  padding: 19px 22px;
}
.metric-label,
.muted,
.hint {
  color: var(--muted);
  font-size: 13px;
}
.flow-dot {
  height: 7px;
  width: 7px;
  border-radius: 100%;
  display: inline-block;
  margin-right: 3px;
}
.out {
  background: #3572c6;
}
.in {
  background: #8454d9;
}
.net-line {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  font-size: 13px;
  color: var(--muted);
}
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 23px 8px;
}
.empty > .ic {
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--entry-control-fill, #e9eef8);
  color: var(--entry-muted, #6d7d9c);
  font-size: 19px;
}
.empty-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.empty-action {
  font-size: 13px;
  min-height: 35px;
  padding: 6px 14px;
}
.record {
  scroll-margin-block: 12px 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 12px 0;
  border-bottom: 1px solid #e6ebf5;
}
.record:last-child {
  border: 0;
}
#detail-rows .record {
  position: relative;
  isolation: isolate;
}
#detail-rows .record::before {
  content: "";
  position: absolute;
  inset: 0 -10px;
  z-index: -1;
  pointer-events: none;
  border-radius: 14px;
  background-color: transparent;
}
#detail-rows .record-highlight::before {
  background-color: rgba(var(--entry-wash-rgb), 0.78);
}
.record .badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e9f0fb;
  color: #315a9c;
  flex: none;
}
.record[data-entry-kind="income"] .badge {
  background: #efeafa;
  color: #5e3d99;
}
.record[data-entry-kind="transfer"] .badge,
.record[data-entry-kind="refund"] .badge {
  background: #eaeef6;
  color: #4c5a75;
}
.record .desc {
  flex: 1;
  min-width: 0;
}
.record .desc b,
.record .desc small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record .desc b {
  font-size: 14px;
  font-weight: 550;
}
.record small,
.hint {
  font-size: 12px;
  color: var(--muted);
}
.record .num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.positive {
  color: #5e399e;
}
.danger {
  color: var(--red);
}
.error,
#save-recovery {
  margin: 0 0 12px;
}
.recovery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
}
.recovery-row button {
  min-height: 36px;
}
.notice {
  font-size: 13px;
  background: #f5effe;
  color: #553788;
  border-radius: 8px;
  padding: 9px 12px;
  margin: 10px 0;
}
.error {
  background: #fceef2;
  color: var(--red);
}
.toolbar,
.filter-row {
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .plain,
.filter-row .plain {
  font-size: 13px;
}
.period-controls {
  display: flex;
  gap: 3px;
  align-items: center;
}
.period-controls b {
  font-size: 14px;
  font-weight: 550;
}
.filter-row input {
  flex: 1;
  min-width: 140px;
}
.filter-row select {
  max-width: 130px;
}
.day-heading {
  font-size: 12px;
  color: var(--muted);
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
}
.day-heading:first-child {
  border-top: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
#category-breakdown {
  background-color: rgb(var(--entry-wash-rgb));
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.82)
  );
}
.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 21px 24px;
}
.metric-strip > div + div {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.metric-strip strong {
  display: block;
  font-size: clamp(19px, 3vw, 31px);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.rank {
  display: block;
  text-align: left;
  width: 100%;
  padding: 9px 0;
}
.rank span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.rank progress {
  height: 5px;
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: var(--line);
}
.rank progress::-webkit-progress-bar {
  background: var(--line);
}
.rank progress::-webkit-progress-value {
  background: var(--entry-selected-line);
  border-radius: 99px;
}
.rank progress::-moz-progress-bar {
  background: var(--entry-selected-line);
}
.trend {
  position: relative;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 112px;
  border-bottom: 1px solid var(--line);
  padding-top: 12px;
}
.trend-empty::after {
  content: attr(data-empty-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.trend-col {
  height: 100%;
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 1px;
  min-width: 0;
}
.trend-col b {
  flex: 1;
  min-width: 0;
  border-radius: 2px 2px 0 0;
}
.legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.report {
  margin-top: 16px;
}
.report p {
  margin: 11px 0;
  white-space: pre-line;
  font-size: 14px;
}
.stack {
  display: grid;
  gap: 12px;
}
.full {
  width: 100%;
}
.sheet-head {
  margin-bottom: 14px;
}
.sheet-head h2 {
  font-size: 20px;
}
.sheet-head button {
  flex: none;
}
.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sheet-actions button {
  flex: 1;
}
.sheet-body-note {
  color: var(--muted);
  font-size: 13px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.manage-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.manage-row > span:first-child {
  flex: 1;
}
.manage-row button {
  min-width: 34px;
  min-height: 38px;
}
.sheet-list {
  display: grid;
  gap: 2px;
}
.sheet-list > button {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  min-height: 44px;
  color: var(--green);
}
.sheet-list > button.danger {
  color: var(--red);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px 23px;
  background: var(--card);
  color: var(--ink);
  width: min(430px, calc(100% - 30px));
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: 0 18px 65px #121c3833;
}
dialog::backdrop {
  background: #10172b58;
}
body:has(dialog[open]) {
  overflow: hidden;
}
dialog label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
dialog input,
dialog select {
  font-size: 16px;
}
.sheet-error {
  margin-bottom: 0;
}
.draft-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.draft-head img {
  width: 42px;
  height: 52px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.draft-head b {
  font-size: 14px;
}
.draft-head p {
  font-size: 12px;
  color: var(--muted);
}
.preview-box {
  display: flex;
  justify-content: center;
}
.crop-stage {
  position: relative;
  line-height: 0;
  touch-action: none;
  user-select: none;
  max-width: 100%;
}
.crop-stage img,
.preview-img {
  max-width: 100%;
  max-height: 43dvh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.crop-selection {
  position: absolute;
  pointer-events: none;
  border: 2px solid #fff;
  outline: 2px solid var(--green);
  background: #60a5fa2b;
}
.preview-note {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.memory-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.memory-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.auth-tabs {
  margin-bottom: 15px;
}
.auth-tabs button {
  min-width: 76px;
}
#toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 15px;
  width: max-content;
  max-width: 90%;
  padding: 10px 16px;
  border-radius: 11px;
  background: #18223b;
  color: white;
  box-shadow: 0 5px 20px #18223b2b;
  font-size: 14px;
}
#toast span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
#toast button {
  color: #99e2ff;
  white-space: nowrap;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin-block: -8px;
}
#toast .toast-message {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  color: inherit;
  white-space: normal;
  text-align: start;
}
#toast .toast-message span {
  text-decoration: underline #99e2ff;
  text-underline-offset: 3px;
}
#toast .toast-message .ic {
  flex: none;
  color: #99e2ff;
}
#toast button:focus-visible {
  outline-color: #99e2ff;
}
.memory-item b {
  overflow-wrap: anywhere;
}
.invite-entry {
  margin-bottom: 16px;
}
#copy-status:empty {
  margin: 0;
}
@media (max-width: 780px) {
  .mast-inner {
    padding: 0 23px;
    gap: 20px;
  }
  main {
    padding: 27px 22px 60px;
  }
  .form-body {
    padding: 3px 19px 20px;
  }
  .amount-block {
    padding: 19px;
  }
  .quick {
    gap: 4px;
  }
  .panel {
    padding: 16px;
  }
}
@media (max-width: 640px) {
  .mast-inner {
    padding: 0 19px;
    height: 56px;
  }
  .brand img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }
  .account-btn {
    font-size: 13px;
  }
  .account-btn i {
    height: 28px;
    width: 28px;
    font-size: 16px;
  }
  .desktop {
    display: none;
  }
  .mobile {
    position: fixed;
    z-index: 3;
    display: flex;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8f9fdf5;
    border-top: 1px solid var(--line);
    padding: 5px 10px max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
    backdrop-filter: blur(10px);
  }
  .mobile button {
    flex: 1;
    flex-direction: column;
    gap: 1px;
    font-size: 11px;
    min-height: 43px;
    border-radius: 8px;
    padding: 3px;
  }
  .mobile button i {
    font-size: 19px;
  }
  .mobile button[aria-current="page"] {
    background: transparent;
    color: #1e3f82;
  }
  .mobile button[aria-current="page"] i {
    background: #e3ebfa;
    border-radius: 9px;
    padding: 2px 12px;
  }
  main {
    padding: 20px 15px calc(88px + env(safe-area-inset-bottom));
    max-width: 520px;
  }
  .page-title {
    margin-bottom: 14px;
  }
  .page-title h1 {
    font-size: 29px;
  }
  .page-title p {
    font-size: 12px;
    margin-top: 3px;
  }
  .photo-btn {
    font-size: 12px;
    padding: 7px 11px;
    min-height: 37px;
  }
  .card {
    border-radius: 15px;
  }
  .amount-block {
    padding: 16px 18px 15px;
  }
  .amount-top label {
    font-size: 13px;
  }
  .money-input {
    margin-top: 6px;
  }
  .money-input input {
    font-size: 53px;
  }
  .money-input span {
    font-size: 28px;
  }
  .kind-switch button {
    min-height: 29px;
    padding: 3px 11px;
  }
  .kind-switch .more-kind {
    padding: 3px 7px;
  }
  .form-body {
    padding: 2px 17px 17px;
  }
  .time-row {
    min-height: 51px;
  }
  #category-row {
    padding: 4px 0 13px;
  }
  .quick {
    font-size: 13px;
    gap: 4px;
    padding-inline: 3px;
    flex: 1 1 auto;
    min-height: 40px;
  }
  .quick .ic {
    font-size: 15px;
  }
  .quick-grid {
    display: flex;
    gap: 5px;
  }
  .quick-name {
    max-width: 7em;
  }
  .note-field {
    min-height: 55px;
  }
  .note-field input,
  .form-field input {
    font-size: 16px;
  }
  .save-line > .primary {
    min-height: 43px;
  }
  .panel {
    padding: 14px 17px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .metric-strip {
    padding: 14px;
  }
  .metric-strip > div + div {
    padding-left: 10px;
  }
  .metric-strip strong {
    font-size: 20px;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar .seg button {
    padding: 4px 12px;
  }
  .period-controls .icon-btn {
    width: 31px;
  }
  .filter-row {
    gap: 6px;
  }
  .filter-row select {
    max-width: 110px;
  }
  .filter-row input {
    min-width: 110px;
  }
  .stats-grid .panel h2 {
    font-size: 16px;
  }
  dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 87dvh;
    border-radius: 20px 20px 0 0;
    padding: 16px 20px max(22px, env(safe-area-inset-bottom));
  }
  #toast {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }
  .sheet-actions {
    padding-bottom: 3px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  #detail-rows .record::before {
    transition: background-color 240ms ease-out;
  }
  .card[data-entry-kind],
  .entry-form .amount-block {
    transition:
      background-color 180ms ease-out,
      border-color 180ms ease-out,
      color 180ms ease-out;
  }
  button {
    transition:
      background-color 0.13s,
      border-color 0.13s;
  }
  dialog[open] {
    animation: slide-in 0.14s ease-out;
  }
  @keyframes slide-in {
    from {
      transform: translateY(6px);
      opacity: 0.8;
    }
  }
}
