:root {
  --ink: #152f45;
  --ink-soft: #5b6d7a;
  --navy: #173a60;
  --paper: #fbfcfb;
  --canvas: #edf2f3;
  --sky: #dcebf7;
  --sky-deep: #c8dfee;
  --line: #d5dfdf;
  --line-dark: #b8c8ca;
  --yellow: #f5cf57;
  --yellow-deep: #e5b932;
  --green: #137d64;
  --green-soft: #e2f2ed;
  --red: #ce4e53;
  --red-soft: #fae9e8;
  --shadow: 0 18px 46px rgba(31, 53, 63, 0.09);
  --display: "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --numbers: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Microsoft YaHei UI", sans-serif;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 47, 69, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 47, 69, 0.018) 1px, transparent 1px),
    var(--canvas);
  background-size: 28px 28px;
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  color: var(--ink);
  background: var(--yellow);
}

:focus-visible {
  outline: 3px solid rgba(23, 58, 96, 0.34);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(21, 47, 69, 0.11);
  background: rgba(247, 249, 248, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1220px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 10px 9px;
  overflow: hidden;
  background: var(--ink);
  border-radius: 5px;
}

.brand-mark span {
  display: block;
  width: 24px;
  height: 3px;
  margin-bottom: 5px;
  background: var(--sky);
  border-radius: 999px;
}

.brand-mark span:nth-child(2) {
  width: 18px;
}

.brand-mark span:nth-child(3) {
  width: 12px;
  margin-bottom: 0;
  background: var(--yellow);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0.14em;
}

.brand-copy small {
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.today-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.today-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(19, 125, 100, 0.1);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  transition: background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  background: white;
  transform: rotate(12deg);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.settings-wrap {
  position: relative;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.settings-menu button {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  text-align: left;
  border: 0;
  border-radius: 3px;
  background: transparent;
}

.settings-menu button:hover {
  background: #f0f4f3;
}

.settings-menu span {
  font-size: 13px;
  font-weight: 700;
}

.settings-menu small {
  color: var(--ink-soft);
  font-size: 11px;
}

.settings-menu .danger-text span {
  color: var(--red);
}

.page-shell {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 46px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 26px;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.07em;
}

.heading-note {
  max-width: 430px;
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
  text-align: right;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.72fr);
  gap: 20px;
}

.statement-card {
  min-height: 410px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(235px, 0.72fr);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.balance-pane {
  position: relative;
  padding: 34px 36px 30px;
  overflow: hidden;
  background-color: var(--sky);
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 33px,
    rgba(23, 58, 96, 0.055) 34px
  );
}

.balance-pane::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 7px;
  height: 100%;
  background: var(--yellow);
}

.statement-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.statement-label {
  color: #456176;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.reveal-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #456176;
  border: 1px solid rgba(23, 58, 96, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.reveal-button:hover {
  background: rgba(255, 255, 255, 0.65);
}

.reveal-button svg {
  width: 17px;
  height: 17px;
}

.reveal-button .eye-closed {
  display: none;
}

.reveal-button.is-hidden .eye-open {
  display: none;
}

.reveal-button.is-hidden .eye-closed {
  display: block;
}

.balance-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 26px;
  white-space: nowrap;
}

.currency-mark {
  margin-top: 10px;
  color: var(--navy);
  font-family: var(--numbers);
  font-size: 25px;
  font-weight: 700;
}

.balance-line strong {
  font-family: var(--numbers);
  font-size: clamp(47px, 6.4vw, 76px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.055em;
  transition: color 160ms ease;
}

.balance-line strong.balance-flash {
  color: var(--green);
}

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

.text-button,
.mini-link {
  padding: 0;
  color: var(--navy);
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.text-button:hover,
.mini-link:hover {
  color: var(--red);
}

.autosave-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #557083;
  font-size: 10px;
}

.save-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.today-figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 40px;
  border-top: 1px solid rgba(23, 58, 96, 0.18);
  border-bottom: 1px solid rgba(23, 58, 96, 0.18);
}

.today-figures div {
  padding: 17px 12px;
  border-right: 1px solid rgba(23, 58, 96, 0.15);
}

.today-figures div:first-child {
  padding-left: 0;
}

.today-figures div:last-child {
  border-right: 0;
}

.today-figures span {
  display: block;
  margin-bottom: 7px;
  color: #597083;
  font-size: 10px;
}

.today-figures strong {
  font-family: var(--numbers);
  font-size: 17px;
  letter-spacing: -0.025em;
}

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

.expense-text {
  color: var(--red);
}

.statement-side {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 31px 27px 25px;
  background: var(--paper);
}

.statement-side::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-left: 1px dashed #aababc;
}

.statement-side::after {
  content: "";
  position: absolute;
  top: -6px;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--canvas);
  box-shadow: 0 calc(410px - 1px) 0 var(--canvas);
}

.stamp-wrap {
  display: flex;
  justify-content: flex-end;
}

.settled-stamp {
  width: 118px;
  height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 50%;
  outline: 1px dashed rgba(23, 58, 96, 0.65);
  outline-offset: -7px;
  transform: rotate(5deg);
}

.settled-stamp.is-untouched {
  color: #78909e;
  border-color: #9aaeb8;
  outline-color: rgba(112, 135, 145, 0.5);
}

.settled-stamp span {
  font-size: 11px;
  font-weight: 800;
}

.settled-stamp strong {
  margin: 3px 0 1px;
  font-family: var(--numbers);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.settled-stamp small {
  font-family: var(--numbers);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.day-note {
  margin-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.day-note-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

.day-note p {
  min-height: 40px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.goal-block {
  margin-top: auto;
  padding-top: 20px;
}

.goal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 10px;
}

.goal-numbers {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 6px;
}

.goal-numbers strong {
  font-family: var(--numbers);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.goal-numbers span {
  color: var(--ink-soft);
  font-family: var(--numbers);
  font-size: 12px;
}

.goal-track {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  background: #e3e9e9;
}

.goal-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.goal-block p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.entry-card {
  position: relative;
  min-height: 410px;
  padding: 29px 26px 24px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.entry-card::before {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -43px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(23, 58, 96, 0.08);
  border-radius: 50%;
}

.entry-tab {
  position: absolute;
  top: 0;
  left: 25px;
  padding: 5px 15px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.entry-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.entry-head h2,
.panel-heading h2,
.trend-heading h2,
.tip-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.entry-date {
  color: var(--ink-soft);
  font-family: var(--numbers);
  font-size: 11px;
}

.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0 0 17px;
  padding: 3px;
  border: 0;
  background: #eef2f1;
}

.type-switch label {
  cursor: pointer;
}

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

.type-switch span {
  display: block;
  padding: 8px 10px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease;
}

.type-switch input:checked + span {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 7px rgba(21, 47, 69, 0.08);
}

.type-switch input:focus-visible + span {
  outline: 3px solid rgba(23, 58, 96, 0.28);
  outline-offset: -1px;
}

.amount-field > label,
.field > span,
.dialog-field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.amount-input-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-dark);
}

.amount-input-wrap:focus-within {
  border-color: var(--navy);
}

.amount-input-wrap > span {
  font-family: var(--numbers);
  font-size: 19px;
  font-weight: 700;
}

.amount-input-wrap input {
  width: 100%;
  padding: 2px 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--numbers);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

input::placeholder {
  color: #b5c0c4;
}

input[type="number"] {
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field {
  display: block;
  margin-top: 14px;
}

.field small {
  font-weight: 400;
}

.field input,
.field select {
  width: 100%;
  height: 37px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: 0;
  background: white;
  font-size: 12px;
}

.field input:focus,
.field select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(23, 58, 96, 0.08);
}

.balance-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: #f0f4f3;
  font-size: 10px;
}

.balance-preview strong {
  color: var(--ink);
  font-family: var(--numbers);
  font-size: 12px;
}

.form-error {
  min-height: 16px;
  margin: 5px 0 0;
  color: var(--red);
  font-size: 10px;
  line-height: 1.4;
}

.form-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: white;
  border: 1px solid var(--navy);
  background: var(--navy);
}

.primary-button:hover {
  background: #0e2e50;
  box-shadow: 0 7px 16px rgba(23, 58, 96, 0.18);
  transform: translateY(-1px);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: white;
}

.secondary-button:hover {
  background: #f0f4f3;
}

.danger-button {
  color: white;
  border: 1px solid var(--red);
  background: var(--red);
}

.danger-button:hover {
  background: #b83e43;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.72fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.records-card {
  min-height: 480px;
  padding: 28px 30px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 35px rgba(31, 53, 63, 0.055);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.filter-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #eef2f1;
}

.filter-button {
  padding: 6px 12px;
  color: var(--ink-soft);
  border: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.filter-button.is-active {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 8px rgba(21, 47, 69, 0.08);
}

.record-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 21px;
  padding: 10px 0;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.record-summary b {
  color: var(--ink);
  font-family: var(--numbers);
  font-size: 14px;
}

.record-summary strong {
  margin-left: 4px;
  color: var(--ink);
  font-family: var(--numbers);
  font-size: 12px;
}

.records-list {
  min-height: 250px;
}

.record-group {
  padding-top: 17px;
}

.record-group + .record-group {
  margin-top: 5px;
  border-top: 1px dashed var(--line);
}

.group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.group-heading h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.group-heading h3 span {
  margin-right: 7px;
  color: var(--ink-soft);
  font-family: var(--numbers);
  font-size: 10px;
  font-weight: 500;
}

.group-heading strong {
  font-family: var(--numbers);
  font-size: 11px;
}

.record-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 59px;
  border-bottom: 1px solid #edf1f0;
}

.record-row:last-child {
  border-bottom: 0;
}

.record-row.is-new {
  animation: row-enter 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes row-enter {
  from {
    opacity: 0;
    transform: translateX(-8px);
    background: var(--yellow);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    background: transparent;
  }
}

.category-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--navy);
  border: 1px solid #d6e4ed;
  border-radius: 50%;
  background: #edf5fa;
  font-size: 11px;
  font-weight: 800;
}

.category-icon.income {
  color: var(--green);
  border-color: #cce4dc;
  background: var(--green-soft);
}

.category-icon.adjustment {
  color: #7c5d0b;
  border-color: #ead9a6;
  background: #faf3db;
}

.record-copy {
  min-width: 0;
}

.record-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-copy span {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.record-amount {
  min-width: 76px;
  font-family: var(--numbers);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

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

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

.row-actions {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.record-row:hover .row-actions,
.record-row:focus-within .row-actions {
  opacity: 1;
}

.row-action {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
}

.row-action:hover {
  color: var(--ink);
  border-color: var(--line);
  background: white;
}

.row-action.delete:hover {
  color: var(--red);
  border-color: #f0cfcd;
  background: var(--red-soft);
}

.row-action svg {
  width: 13px;
  height: 13px;
}

.empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  text-align: center;
}

.empty-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  color: var(--navy);
  border: 1px dashed var(--line-dark);
  border-radius: 50%;
  font-family: var(--numbers);
  font-size: 21px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 13px;
}

.empty-state p {
  max-width: 260px;
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.7;
}

.insights-column {
  display: grid;
  gap: 20px;
}

.trend-card {
  padding: 25px 24px 22px;
  color: white;
  border: 1px solid #0b2946;
  border-radius: var(--radius);
  background: var(--navy);
  box-shadow: 0 14px 32px rgba(20, 42, 67, 0.16);
}

.trend-card .section-kicker {
  color: #94b1c8;
}

.trend-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.trend-heading h2 {
  color: white;
}

.legend {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #a8c2d3;
  font-size: 8px;
}

.legend i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-income {
  margin-left: 5px;
  background: #66d3ae;
}

.legend-expense {
  margin-left: 5px;
  background: #ff8b85;
}

.trend-chart {
  height: 144px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 25px;
  padding-top: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.trend-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.bar-area {
  width: 100%;
  height: 103px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.bar {
  width: min(8px, 30%);
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  transition: height 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar.income {
  background: #66d3ae;
}

.bar.expense {
  background: #ff8b85;
}

.trend-day > span {
  margin-top: 8px;
  color: #8faaba;
  font-family: var(--numbers);
  font-size: 8px;
}

.trend-day.is-today > span {
  color: var(--yellow);
  font-weight: 700;
}

.trend-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 15px;
  color: #a9c2d2;
  font-size: 9px;
}

.trend-foot strong {
  color: #7ee0bd;
  font-family: var(--numbers);
  font-size: 19px;
}

.trend-foot strong.is-negative {
  color: #ff9d97;
}

.tip-card {
  position: relative;
  min-height: 180px;
  padding: 24px;
  overflow: hidden;
  background: var(--yellow);
  border: 1px solid #ddba45;
  border-radius: var(--radius);
}

.tip-card .section-kicker {
  color: #6a5311;
}

.tip-card h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  color: #253747;
}

.tip-card > p:not(.section-kicker) {
  position: relative;
  z-index: 1;
  max-width: 245px;
  margin: 0 0 13px;
  color: #554b2e;
  font-size: 10px;
  line-height: 1.7;
}

.tip-card .mini-link {
  position: relative;
  z-index: 1;
  color: #253747;
}

.tip-mark {
  position: absolute;
  right: -15px;
  bottom: -31px;
  color: rgba(255, 255, 255, 0.27);
  font-family: var(--numbers);
  font-size: 154px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-8deg);
}

.site-footer {
  width: min(1220px, calc(100% - 48px));
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0 0 31px;
  color: #71818a;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.site-footer p {
  margin: 0;
}

.app-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(12, 35, 52, 0.24);
}

.app-dialog::backdrop {
  background: rgba(10, 29, 43, 0.44);
  backdrop-filter: blur(3px);
}

.app-dialog form {
  padding: 28px;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.dialog-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 19px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--ink);
  background: #f1f4f3;
}

.dialog-copy {
  margin: 18px 0 20px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.dialog-field {
  display: block;
}

.dialog-amount {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border: 1px solid var(--line-dark);
  background: white;
}

.dialog-amount:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(23, 58, 96, 0.08);
}

.dialog-amount > span {
  font-family: var(--numbers);
  font-size: 17px;
  font-weight: 700;
}

.dialog-amount input {
  width: 100%;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--numbers);
  font-size: 25px;
  font-weight: 700;
}

.adjustment-preview {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: #f0f4f3;
  font-size: 10px;
}

.adjustment-preview strong {
  color: var(--ink);
  font-family: var(--numbers);
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 19px;
}

.compact-dialog {
  width: min(430px, calc(100% - 32px));
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: min(360px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  color: white;
  background: var(--ink);
  border-left: 4px solid var(--yellow);
  box-shadow: 0 12px 30px rgba(8, 28, 42, 0.24);
  font-size: 11px;
  pointer-events: auto;
  animation: toast-in 240ms ease both;
}

.toast button {
  flex: 0 0 auto;
  padding: 2px 0;
  color: var(--yellow);
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.toast.is-leaving {
  animation: toast-out 180ms ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

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

  .statement-card {
    min-height: 390px;
  }

  .entry-card {
    min-height: auto;
  }

  .entry-card form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
  }

  .entry-card .type-switch,
  .entry-card .amount-field,
  .entry-card .balance-preview,
  .entry-card .form-error,
  .entry-card .form-actions {
    grid-column: 1 / -1;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding-top: 35px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .heading-note {
    max-width: 570px;
    text-align: left;
  }

  .statement-card {
    grid-template-columns: 1fr;
  }

  .balance-pane {
    padding: 31px 29px 26px;
  }

  .statement-side {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 19px;
    padding: 23px 28px;
  }

  .statement-side::before {
    top: 0;
    right: 0;
    bottom: auto;
    left: 28px;
    border-top: 1px dashed #aababc;
    border-left: 0;
  }

  .statement-side::after {
    display: none;
  }

  .day-note {
    margin-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .goal-block {
    grid-column: 1 / -1;
    padding-top: 2px;
  }

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

  .insights-column {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

@media (max-width: 620px) {
  .header-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 28px, 1220px);
  }

  .header-inner {
    height: 66px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    padding: 8px 7px;
  }

  .brand-mark span {
    width: 21px;
    height: 2px;
    margin-bottom: 5px;
  }

  .brand-mark span:nth-child(2) {
    width: 16px;
  }

  .brand-mark span:nth-child(3) {
    width: 10px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .today-chip {
    display: none;
  }

  .page-shell {
    padding: 29px 0 36px;
  }

  .page-heading {
    margin-bottom: 20px;
  }

  .page-heading h1 {
    font-size: 35px;
  }

  .heading-note {
    font-size: 11px;
  }

  .balance-pane {
    padding: 27px 22px 23px;
  }

  .balance-line {
    margin-top: 24px;
  }

  .balance-line strong {
    font-size: clamp(43px, 14vw, 67px);
  }

  .today-figures {
    margin-top: 32px;
  }

  .today-figures div {
    padding: 14px 7px;
  }

  .today-figures strong {
    font-size: 14px;
  }

  .statement-side {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 16px;
    padding: 21px 18px;
  }

  .settled-stamp {
    width: 91px;
    height: 91px;
  }

  .settled-stamp strong {
    font-size: 22px;
  }

  .settled-stamp span {
    font-size: 9px;
  }

  .entry-card {
    padding: 27px 18px 20px;
  }

  .entry-card form {
    display: block;
  }

  .entry-head h2,
  .panel-heading h2,
  .trend-heading h2,
  .tip-card h2 {
    font-size: 20px;
  }

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

  .records-card {
    padding: 23px 17px 20px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-tabs {
    align-self: stretch;
  }

  .filter-button {
    flex: 1;
  }

  .record-summary {
    margin-top: 15px;
  }

  .record-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .row-amount-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .record-amount {
    min-width: 60px;
    font-size: 13px;
  }

  .row-actions {
    opacity: 1;
  }

  .row-action {
    width: 24px;
    height: 28px;
  }

  .insights-column {
    grid-template-columns: 1fr;
  }

  .trend-card,
  .tip-card {
    padding: 22px 19px;
  }

  .site-footer {
    flex-direction: column;
    gap: 5px;
  }

  .app-dialog form {
    padding: 23px 19px;
  }

  .dialog-actions > * {
    flex: 1;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .toast {
    width: 100%;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
