:root {
  color-scheme: light;
  --bg: #fff7fa;
  --surface: #fffdfd;
  --surface-strong: #ffe8f0;
  --text: #3b2530;
  --muted: #8d6573;
  --line: #f3cbd7;
  --green: #3aa77b;
  --green-dark: #24795b;
  --pink: #f36f92;
  --pink-dark: #c73560;
  --pink-soft: #ffd9e5;
  --amber: #c97924;
  --red: #d5425f;
  --blue: #4c7ec6;
  --shadow: 0 18px 45px rgba(157, 71, 102, 0.13);
  --shadow-soft: 0 8px 22px rgba(157, 71, 102, 0.1);
  --shadow-lift: 0 18px 36px rgba(157, 71, 102, 0.16);
  --shine: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  --pixel-edge: 0 0 0 1px rgba(255, 255, 255, 0.82), inset 0 0 0 2px rgba(246, 178, 198, 0.2);
  --pixel-shadow: 4px 4px 0 rgba(199, 53, 96, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    image-set(url("./assets/brand/pixel-corner-pattern.webp") type("image/webp")) top left / 160px 160px no-repeat,
    radial-gradient(circle at 18% 0%, rgba(255, 210, 224, 0.72), transparent 220px),
    radial-gradient(circle at 88% 140px, rgba(255, 239, 196, 0.5), transparent 180px),
    linear-gradient(180deg, #fff1f6 0, #fff8fb 280px, #fffdfb 100%),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.page-view {
  display: grid;
  gap: 14px;
  animation: page-rise 0.24s ease both;
}

.page-view[hidden] {
  display: none;
}

.page-heading {
  display: grid;
  gap: 5px;
  padding: 4px 2px 0;
}

.page-heading h2 {
  font-size: 20px;
}

.page-heading span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.page-tabs {
  position: fixed;
  right: max(12px, calc((100vw - 460px) / 2 + 12px));
  bottom: 12px;
  left: max(12px, calc((100vw - 460px) / 2 + 12px));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 243, 248, 0.9)),
    rgba(255, 253, 253, 0.92);
  padding: 8px;
  box-shadow:
    0 14px 40px rgba(157, 71, 102, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.page-tabs button {
  position: relative;
  overflow: hidden;
  display: grid;
  min-width: 0;
  min-height: 50px;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  padding: 5px 3px;
  transition:
    transform 0.16s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.page-tabs button.active {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.72), transparent 28px),
    linear-gradient(180deg, #fff8fb, #ffe4ee),
    #fff0f5;
  color: var(--pink-dark);
  box-shadow:
    0 8px 18px rgba(199, 53, 96, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
}

.page-tabs button.active::before {
  position: absolute;
  top: 5px;
  width: 18px;
  height: 3px;
  border-radius: 0;
  background: var(--pink);
  content: "";
  box-shadow: 5px 0 0 rgba(199, 53, 96, 0.34), -5px 0 0 rgba(255, 217, 229, 0.9);
}

.page-tabs button:active {
  transform: translateY(0) scale(0.98);
}

.page-tabs span,
.page-tabs strong {
  display: block;
  line-height: 1;
}

.page-tabs span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 9px;
  font-size: 17px;
  font-weight: 900;
}

.page-tabs button.active span {
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 0 0 1px rgba(246, 178, 198, 0.42);
}

.page-tabs strong {
  font-size: 11px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 16px;
}

.eyebrow,
.panel-label,
.section-title p,
.budget-editor p,
.import-card p,
.card details,
.field span,
.quick-stats span,
.budget-grid span {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(27px, 8vw, 34px);
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
}

.icon-button,
.mini-button,
.ghost-button,
.primary-button,
.file-button {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-button:active,
.mini-button:active,
.ghost-button:active,
.primary-button:active,
.file-button:active {
  transform: translate(2px, 2px) scale(0.98);
  box-shadow:
    0 4px 10px rgba(157, 71, 102, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

button.tap-spark::after,
.ghost-button.tap-spark::after,
.primary-button.tap-spark::after,
.mini-button.tap-spark::after,
.icon-button.tap-spark::after,
.asset-card-summary.tap-spark::after,
.savings-overview-card.tap-spark::after,
.segmented span.tap-spark::after,
.quick-category-grid button.tap-spark::after {
  position: absolute;
  left: var(--tap-x, 50%);
  top: var(--tap-y, 50%);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: tap-spark 0.48s ease-out forwards;
}

.icon-button {
  width: 42px;
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.04) 0 5px, transparent 5px 10px),
    var(--shine),
    rgba(255, 255, 255, 0.86);
  box-shadow:
    var(--shadow-soft),
    3px 3px 0 rgba(199, 53, 96, 0.07),
    inset 0 0 0 1px rgba(246, 178, 198, 0.32);
  color: var(--pink-dark);
}

.quick-widget-panel {
  display: none;
  gap: 14px;
  border: 1px solid #f5c5d4;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 240, 246, 0.96)),
    var(--surface);
  padding: 16px;
  box-shadow: 0 12px 30px rgba(157, 71, 102, 0.1);
}

.quick-widget-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.quick-widget-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  border: 1px solid #f7d5df;
  border-radius: 16px;
  background: #fffafb;
  padding: 12px;
}

.quick-widget-summary span,
.quick-widget-summary p {
  color: var(--muted);
  font-size: 12px;
}

.quick-widget-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--pink-dark);
  font-size: 24px;
  line-height: 1;
}

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

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

.quick-category-grid button {
  min-height: 38px;
  border: 1px solid #f7d5df;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #fff, #fff7fa),
    #fffafb;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.quick-category-grid button.selected {
  border-color: var(--pink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 5px, transparent 5px 10px),
    linear-gradient(180deg, #ff8cad, var(--pink));
  color: #fff;
}

.quick-widget-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

body.quick-mode .app-shell {
  min-height: 100vh;
  padding-top: 14px;
  padding-bottom: 18px;
}

body.quick-mode .topbar,
body.quick-mode .page-tabs,
body.quick-mode .page-view,
body.quick-mode .annual-panel,
body.quick-mode .asset-overview-panel,
body.quick-mode .asset-filter-card,
body.quick-mode .asset-list,
body.quick-mode .budget-panel,
body.quick-mode .calendar-card,
body.quick-mode .month-picker-dialog,
body.quick-mode .budget-editor,
body.quick-mode .quick-stats,
body.quick-mode .sync-card,
body.quick-mode .sync-dialog,
body.quick-mode .import-card,
body.quick-mode .shortcut-card,
body.quick-mode .widget-card,
body.quick-mode .connect-dialog,
body.quick-mode .report-card,
body.quick-mode .records-card,
body.quick-mode .card[aria-labelledby="addTitle"] {
  display: none;
}

body.quick-mode .quick-widget-panel {
  display: grid;
}

.annual-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -38px top -38px / 132px 132px no-repeat,
    var(--shine),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 240, 246, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-soft), var(--pixel-shadow), inset 0 0 0 1px rgba(246, 178, 198, 0.38);
}

.annual-panel::before {
  position: absolute;
  top: -18px;
  right: -20px;
  width: 86px;
  height: 86px;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(243, 111, 146, 0.16) 0 8px, transparent 8px 16px),
    linear-gradient(0deg, rgba(199, 53, 96, 0.1) 0 8px, transparent 8px 16px);
  background-size: 16px 16px;
  content: "";
  transform: rotate(8deg);
}

.annual-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.annual-header strong {
  display: block;
  margin-top: 5px;
  color: var(--pink-dark);
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1;
}

.annual-formula {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.annual-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.annual-grid div {
  min-width: 0;
  border: 1px solid rgba(247, 213, 223, 0.86);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 251, 0.78)),
    rgba(255, 250, 251, 0.86);
  padding: 8px 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.annual-grid span,
.annual-grid strong {
  display: block;
}

.annual-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.annual-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.budget-panel {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") left -44px top -42px / 148px 148px no-repeat,
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.24), transparent 84px),
    linear-gradient(135deg, rgba(199, 53, 96, 0.92), rgba(244, 111, 146, 0.92) 52%, rgba(255, 154, 174, 0.94)),
    #f36f92;
  color: #fff;
  box-shadow:
    0 20px 42px rgba(199, 53, 96, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.budget-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 4px, transparent 4px 16px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 4px, transparent 4px 16px);
  background-size: 16px 16px;
  opacity: 0.34;
}

.budget-panel > *:not(.budget-decor) {
  position: relative;
  z-index: 2;
}

.budget-decor {
  position: absolute;
  top: 56px;
  right: 18px;
  bottom: auto;
  z-index: 1;
  width: 86px;
  max-width: none;
  opacity: 0.2;
  pointer-events: none;
  transform: rotate(3deg);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.budget-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.budget-header strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(32px, 9vw, 42px);
  line-height: 1;
}

.budget-panel .panel-label,
.budget-panel .budget-grid span {
  color: rgba(255, 255, 255, 0.72);
}

.status-pill {
  align-self: start;
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #fffafc;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.warn {
  color: #fff4d8;
  background: rgba(188, 107, 22, 0.25);
}

.status-pill.danger {
  color: #ffe1dd;
  background: rgba(194, 65, 58, 0.28);
}

.progress-track {
  height: 10px;
  margin: 22px 0 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 2px 0 rgba(100, 34, 57, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.22);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 6px, transparent 6px 12px),
    linear-gradient(90deg, #bdf5d6, #e5fff0),
    #bdf5d6;
  transition: width 0.25s ease;
}

.progress-fill.warn {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 6px, transparent 6px 12px),
    linear-gradient(90deg, #f0a846, #ffd982),
    #f0b64f;
}

.progress-fill.danger {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 6px, transparent 6px 12px),
    linear-gradient(90deg, #ef5368, #ff8c83),
    #ff736b;
}

.budget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: relative;
  z-index: 3;
}

.budget-grid div {
  min-width: 0;
}

.budget-grid span,
.budget-grid strong {
  display: block;
}

.budget-grid span {
  margin-bottom: 4px;
  font-size: 12px;
}

.budget-grid strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.card,
.quick-stats {
  margin-top: 0;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -58px top -60px / 128px 128px no-repeat,
    var(--shine),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 251, 0.94)),
    var(--surface);
  box-shadow:
    var(--shadow-soft),
    var(--pixel-shadow),
    inset 0 0 0 1px rgba(246, 178, 198, 0.42);
}

.card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.44), transparent 32%, rgba(255, 220, 232, 0.22));
  content: "";
  pointer-events: none;
  opacity: 0.42;
}

.entry-card {
  padding: 18px;
  border-radius: 24px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -52px top -54px / 146px 146px no-repeat,
    radial-gradient(circle at 10% 8%, rgba(255, 216, 229, 0.76), transparent 110px),
    radial-gradient(circle at 96% 0%, rgba(255, 244, 210, 0.64), transparent 120px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 245, 249, 0.95)),
    var(--surface);
  box-shadow:
    0 18px 42px rgba(157, 71, 102, 0.13),
    var(--pixel-shadow),
    inset 0 0 0 1px rgba(246, 178, 198, 0.46);
}

.entry-card .section-title {
  position: relative;
  z-index: 1;
  padding-bottom: 4px;
}

.entry-card .section-title h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
}

.entry-card .section-title h2::before {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(135deg, var(--pink-dark), var(--pink)),
    var(--pink);
  color: #fff;
  content: "¥";
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(199, 53, 96, 0.22);
}

.entry-card .entry-form {
  position: relative;
  z-index: 1;
}

.entry-card #amountInput {
  min-height: 62px;
  border-color: rgba(246, 178, 198, 0.74);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(243, 111, 146, 0.045) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #fff, #fff7fa),
    #fff;
  color: var(--pink-dark);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    var(--pixel-edge),
    inset 0 0 0 1px rgba(246, 178, 198, 0.36),
    0 10px 20px rgba(157, 71, 102, 0.07);
}

.entry-card #amountInput::placeholder {
  color: rgba(199, 53, 96, 0.32);
}

.entry-card .primary-button.full {
  min-height: 52px;
  border-radius: 18px;
  font-size: 16px;
  letter-spacing: 0.02em;
  box-shadow:
    0 12px 24px rgba(199, 53, 96, 0.28),
    4px 4px 0 rgba(199, 53, 96, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.budget-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.budget-editor form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.calendar-card {
  display: grid;
  gap: 12px;
  border-radius: 22px;
}

.calendar-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.calendar-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.calendar-actions {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px 72px;
  align-items: center;
  gap: 8px;
}

.calendar-actions strong {
  justify-self: center;
  color: var(--pink-dark);
  font-size: 16px;
}

.mini-button {
  width: 38px;
  min-height: 36px;
  background: #fff0f5;
  color: var(--pink-dark);
  font-size: 22px;
  font-weight: 900;
}

.jump-button {
  width: 72px;
  font-size: 13px;
}

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

.calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-day {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  min-width: 0;
  min-height: 48px;
  padding: 5px 3px;
  border: 1px solid #f7d5df;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #fff, #fff7fa),
    #fffafb;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.calendar-day.empty {
  border-color: transparent;
  background: transparent;
}

.calendar-day span,
.calendar-day strong {
  min-width: 0;
  text-align: center;
}

.calendar-day span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.calendar-day strong {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day.has-spend {
  border-color: #f6a6ba;
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.05) 0 5px, transparent 5px 10px),
    linear-gradient(180deg, #fff8fb, #ffe9f0),
    #fff0f5;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.09),
    inset 0 -2px 0 rgba(243, 111, 146, 0.2);
}

.calendar-day.has-spend:active {
  transform: scale(0.96);
}

.calendar-day.has-spend strong {
  color: var(--red);
  font-weight: 900;
}

.calendar-day.today {
  outline: 2px solid rgba(243, 111, 146, 0.42);
  outline-offset: 1px;
  box-shadow: 0 6px 12px rgba(157, 71, 102, 0.08);
}

.quick-stats article {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -72px top -72px / 112px 112px no-repeat,
    var(--shine),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 243, 247, 0.96)),
    var(--surface);
  box-shadow:
    3px 3px 0 rgba(199, 53, 96, 0.055),
    inset 0 0 0 1px rgba(246, 178, 198, 0.38);
}

.quick-stats article::after {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 18px;
  height: 18px;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(243, 111, 146, 0.18) 0 6px, transparent 6px 12px),
    linear-gradient(0deg, rgba(243, 111, 146, 0.14) 0 6px, transparent 6px 12px);
  content: "";
}

.quick-stats span,
.quick-stats strong {
  display: block;
}

.quick-stats span {
  margin-bottom: 8px;
  font-size: 12px;
}

.quick-stats strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.asset-overview-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -54px top -54px / 126px 126px no-repeat,
    var(--shine),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 241, 247, 0.94)),
    var(--surface);
  box-shadow:
    var(--shadow-soft),
    var(--pixel-shadow),
    inset 0 0 0 1px rgba(246, 178, 198, 0.38);
}

.asset-overview-grid {
  margin-top: 14px;
}

.finance-overview-panel .annual-header strong {
  color: var(--pink-dark);
}

.finance-overview-strip {
  display: grid;
  grid-auto-columns: minmax(132px, 42%);
  grid-auto-flow: column;
  gap: 10px;
  margin-top: 14px;
  margin-right: -4px;
  padding: 2px 4px 8px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

.finance-overview-strip article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(246, 178, 198, 0.56);
  border-radius: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 6px, transparent 6px 12px),
    rgba(255, 255, 255, 0.7);
  box-shadow:
    3px 3px 0 rgba(199, 53, 96, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  scroll-snap-align: start;
}

.finance-overview-strip article.debt {
  border-color: rgba(231, 101, 121, 0.5);
}

.finance-overview-strip span,
.finance-overview-strip strong,
.finance-overview-strip small {
  display: block;
}

.finance-overview-strip span {
  color: var(--muted);
  font-size: 12px;
}

.finance-overview-strip strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.finance-overview-strip small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.finance-overview-strip b {
  font-weight: 900;
}

.finance-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.finance-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(246, 178, 198, 0.48);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.finance-item.settled {
  opacity: 0.76;
}

.finance-item strong,
.finance-item span,
.finance-item small,
.finance-item b {
  display: block;
}

.finance-item strong {
  font-size: 15px;
}

.finance-item span,
.finance-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.finance-item > b {
  color: var(--pink-dark);
  font-size: 15px;
  white-space: nowrap;
}

.finance-item .saving-inline-actions {
  grid-column: 1 / -1;
}

.savings-overview-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -54px top -54px / 126px 126px no-repeat,
    var(--shine),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 241, 247, 0.94)),
    var(--surface);
  color: var(--text);
  padding: 16px;
  text-align: left;
  box-shadow:
    var(--shadow-soft),
    var(--pixel-shadow),
    inset 0 0 0 1px rgba(246, 178, 198, 0.38);
}

.savings-overview-card::before {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  min-width: 52px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 5px, transparent 5px 10px),
    linear-gradient(180deg, #ff8cad, var(--pink));
  color: #fff;
  content: "进入";
  font-size: 12px;
  font-weight: 900;
  box-shadow:
    3px 3px 0 rgba(199, 53, 96, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.savings-overview-card:active {
  transform: translate(2px, 2px) scale(0.99);
}

.savings-overview-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #ff8cad, var(--pink));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow:
    4px 4px 0 rgba(199, 53, 96, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.savings-overview-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.savings-overview-copy strong {
  color: var(--pink-dark);
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1;
}

.savings-overview-copy small,
.savings-overview-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.savings-enter-hint {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(246, 178, 198, 0.58);
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fff7fa, #ffe8f0),
    #fff0f5;
  color: var(--pink-dark);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 2px 2px 0 rgba(199, 53, 96, 0.05);
}

.savings-enter-hint b {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 8px;
  background: var(--pink);
  color: #fff;
  font-size: 17px;
  line-height: 1;
}

.savings-overview-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.savings-overview-grid span {
  min-width: 0;
  border: 1px solid rgba(247, 213, 223, 0.86);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 247, 250, 0.96)),
    #fff7fa;
  padding: 9px;
}

.savings-overview-grid b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
}

.savings-hero-panel {
  margin-top: 0;
}

.savings-alert-card {
  border-color: rgba(255, 201, 150, 0.72);
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -58px top -58px / 120px 120px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 238, 0.94)),
    var(--surface);
}

.saving-plan-list,
.saving-record-list {
  display: grid;
  gap: 10px;
}

.saving-plan-item,
.saving-record-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid #f7d5df;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 251, 0.96)),
    #fffafb;
  padding: 12px;
  box-shadow:
    3px 3px 0 rgba(199, 53, 96, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.saving-plan-item.due {
  border-color: #f3a8bb;
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.04) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #fff, #fff0f5),
    #fff0f5;
}

.saving-record-item.available {
  border-color: rgba(125, 211, 169, 0.66);
}

.saving-record-item.locked {
  border-color: rgba(247, 190, 206, 0.88);
}

.saving-plan-item strong,
.saving-record-main strong {
  display: block;
  font-size: 15px;
}

.saving-plan-item span,
.saving-plan-item small,
.saving-record-main span,
.saving-record-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.saving-plan-item > b,
.saving-record-side b {
  color: var(--pink-dark);
  white-space: nowrap;
  font-size: 15px;
}

.saving-record-side {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.saving-record-side em {
  border-radius: 999px;
  background: #fff0f5;
  color: var(--pink-dark);
  padding: 5px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.saving-record-item.available .saving-record-side em {
  background: #e7fff2;
  color: var(--green-dark);
}

.saving-inline-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.saving-inline-actions .primary-button,
.saving-inline-actions .ghost-button,
.saving-inline-actions .text-danger-button {
  min-height: 34px;
  border-radius: 12px;
  font-size: 12px;
}

.asset-filter-card {
  display: grid;
  gap: 12px;
}

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

.backfill-stock-fields[hidden],
.backfill-daily-fields[hidden] {
  display: none;
}

.asset-tag-filter,
.asset-tags,
.asset-finish-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.asset-filter-chip,
.asset-tag {
  position: relative;
  overflow: hidden;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fff7fa, #ffe8f0),
    #fff0f5;
  color: var(--pink-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.asset-filter-chip.active,
.asset-filter-chip.clear {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 5px, transparent 5px 10px),
    linear-gradient(180deg, #ff8cad, var(--pink));
  color: #fff;
}

.asset-tag.empty {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #fff6f9;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.asset-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
}

.asset-card {
  min-width: 0;
}

.asset-card.finished {
  opacity: 0.78;
}

.asset-card[open] {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -62px top -62px / 128px 128px no-repeat,
    var(--shine),
    linear-gradient(180deg, #fff, #fff7fa),
    var(--surface);
  box-shadow: var(--shadow-lift), var(--pixel-shadow), inset 0 0 0 1px rgba(246, 178, 198, 0.42);
  animation: card-open 0.2s ease both;
}

.asset-card[open].finished {
  background: #fff8fa;
  opacity: 1;
}

.asset-card > summary {
  list-style: none;
}

.asset-card > summary::-webkit-details-marker {
  display: none;
}

.asset-card-summary {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 7px 4px 9px;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    filter 0.16s ease;
}

.asset-card-summary:active {
  transform: translate(1px, 1px) scale(0.98);
}

.asset-card:not([open]) .asset-card-summary:hover {
  border-color: rgba(246, 178, 198, 0.5);
  background: rgba(255, 255, 255, 0.48);
  filter: saturate(1.04);
}

.asset-card[open] .asset-card-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;
  cursor: default;
}

.asset-icon-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.asset-card[open] .asset-icon-wrap {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
}

.asset-thumb,
.asset-thumb img,
.asset-image-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 20px;
}

.asset-thumb {
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.86);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.82), transparent 24px),
    linear-gradient(135deg, #fff7fa, #ffe6ef),
    #fff0f5;
  box-shadow:
    0 12px 24px rgba(157, 71, 102, 0.16),
    4px 4px 0 rgba(199, 53, 96, 0.08),
    inset 0 0 0 1px rgba(246, 178, 198, 0.55);
}

.asset-card:not([open]) .asset-icon-wrap::after {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 15px;
  height: 15px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--pink);
  content: "";
  box-shadow: 0 4px 10px rgba(199, 53, 96, 0.22);
}

.asset-card.finished:not([open]) .asset-icon-wrap::after {
  background: #c9a6b3;
}

.asset-thumb img {
  display: block;
  object-fit: cover;
}

.asset-image-placeholder {
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.asset-icon-progress {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 0;
  background: rgba(255, 228, 237, 0.92);
  box-shadow: 0 2px 6px rgba(100, 34, 57, 0.18);
}

.asset-icon-progress div {
  height: 100%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 4px, transparent 4px 8px),
    linear-gradient(90deg, var(--pink-dark), var(--pink)),
    var(--pink-dark);
  transition: width 0.25s ease;
}

.asset-compact-text {
  display: grid;
  justify-items: center;
  width: 100%;
  min-width: 0;
  gap: 2px;
  text-align: center;
}

.asset-card[open] .asset-compact-text {
  justify-items: start;
  flex: 1;
  text-align: left;
}

.asset-compact-text strong,
.asset-compact-text span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-compact-text strong {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.15;
}

.asset-compact-text span {
  color: var(--muted);
  font-size: 11px;
}

.asset-card-summary > b {
  display: none;
}

.asset-card[open] .asset-card-summary > b {
  display: grid;
  min-width: 42px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #fff0f5;
  color: var(--pink-dark);
  font-size: 12px;
}

.asset-detail-panel {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.asset-card-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.asset-card-title strong,
.asset-card-title span,
.asset-card-title b {
  display: block;
}

.asset-card-title strong {
  font-size: 17px;
}

.asset-card-title span,
.asset-dates,
.asset-metrics span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.asset-card-title b {
  flex: 0 0 auto;
  color: var(--pink-dark);
  font-size: 14px;
}

.asset-progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(246, 178, 198, 0.62);
  border-radius: 0;
  background: #ffe4ed;
}

.asset-progress-track div {
  height: 100%;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 5px, transparent 5px 10px),
    linear-gradient(90deg, var(--pink-dark), var(--pink)),
    var(--pink);
  transition: width 0.25s ease;
}

.asset-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.asset-metrics div {
  min-width: 0;
  min-height: 58px;
  border: 1px solid rgba(247, 213, 223, 0.86);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 247, 250, 0.96)),
    #fff7fa;
  padding: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.asset-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.asset-dates {
  display: grid;
  gap: 4px;
}

.asset-actions,
.asset-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.asset-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.asset-image-button {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(246, 178, 198, 0.58);
  border-radius: 12px;
  background:
    linear-gradient(180deg, #fff7fa, #ffe8f0),
    #fff0f5;
  color: var(--pink-dark);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.asset-image-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.category-breakdown-card .section-title,
.category-manager-card .section-title {
  margin-bottom: 12px;
}

.category-breakdown-list {
  display: grid;
  gap: 12px;
}

.category-breakdown-group {
  display: grid;
  gap: 8px;
}

.category-breakdown-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.category-breakdown-heading span {
  color: var(--pink-dark);
}

.category-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.category-breakdown-grid article {
  min-width: 0;
  border: 1px solid #f7d5df;
  border-radius: 14px;
  background: #fffafb;
  padding: 10px 11px;
}

.category-breakdown-grid span,
.category-breakdown-grid strong {
  display: block;
}

.category-breakdown-grid span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-breakdown-grid strong {
  overflow-wrap: anywhere;
  color: var(--pink-dark);
  font-size: 15px;
}

.category-breakdown-grid article.empty strong {
  color: var(--muted);
}

.category-manager-list {
  display: grid;
  gap: 12px;
}

.category-manager-item {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #f7d5df;
  border-radius: 14px;
  background: #fffafb;
}

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

.category-manager-name {
  min-width: 0;
}

.category-manager-name.locked {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.category-manager-name strong,
.category-manager-name span {
  display: block;
}

.category-manager-name strong {
  overflow: hidden;
  max-width: 150px;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-manager-name span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.category-manager-name label,
.subcategory-add-row {
  display: grid;
  gap: 6px;
}

.category-manager-name input,
.subcategory-row input,
.subcategory-add-row input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  outline: none;
}

.category-manager-name input:focus,
.subcategory-row input:focus,
.subcategory-add-row input:focus {
  border-color: rgba(243, 111, 146, 0.82);
  box-shadow: 0 0 0 3px rgba(243, 111, 146, 0.15);
}

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

.subcategory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
}

.subcategory-row.editing {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.subcategory-row span {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subcategory-add-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.subcategory-empty {
  border: 1px dashed #f2bfd0;
  border-radius: 12px;
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.category-name-locked strong,
.category-name-locked span {
  display: block;
}

.category-name-locked strong {
  font-size: 15px;
}

.category-name-locked span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.category-name-field span {
  margin: 0;
  font-size: 11px;
}

.category-name-locked {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.category-name-locked div {
  min-width: 0;
}

.category-name-locked strong {
  overflow: hidden;
  max-width: 150px;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-name-field.editing {
  max-width: 150px;
}

.category-name-field.editing input {
  padding-inline: 9px;
  text-align: left;
  font-weight: 800;
}

.category-name-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.tiny-button {
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  background: #fff0f5;
  color: var(--pink-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.tiny-button.confirm {
  background: var(--pink);
  color: #fff;
}

.text-danger-button {
  justify-self: start;
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  background: #fff0f5;
  color: var(--red);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title.compact-actions {
  justify-content: flex-end;
}

.section-title p,
.budget-editor p,
.import-card p,
.sync-panel p {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
}

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

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.035) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #ffeef4, #ffe4ee),
    var(--surface-strong);
  box-shadow: inset 0 1px 2px rgba(157, 71, 102, 0.08);
}

.segmented label {
  min-width: 0;
}

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

.segmented span {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.segmented input:checked + span {
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.04) 0 5px, transparent 5px 10px),
    var(--shine),
    var(--surface);
  border-color: rgba(246, 178, 198, 0.58);
  color: var(--pink-dark);
  box-shadow:
    0 5px 12px rgba(157, 71, 102, 0.14),
    3px 3px 0 rgba(199, 53, 96, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(243, 203, 215, 0.92);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(199, 53, 96, 0.028) 0 7px, transparent 7px 14px),
    linear-gradient(180deg, #fff, #fff9fb),
    #fffafb;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(243, 111, 146, 0.82);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(243, 111, 146, 0.15),
    0 8px 18px rgba(157, 71, 102, 0.08);
}

.field.compact input {
  min-height: 42px;
}

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

.asset-purchase-mode,
.asset-entry-fields {
  display: grid;
  gap: 10px;
}

.asset-purchase-mode > span,
.asset-entry-hint {
  color: var(--muted);
  font-size: 13px;
}

.asset-entry-fields {
  padding: 12px;
  border: 1px dashed #f2bfd0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 246, 249, 0.92)),
    #fffafb;
}

.asset-entry-fields[hidden],
.asset-stock-fields[hidden],
.asset-daily-fields[hidden],
.asset-image-preview[hidden] {
  display: none;
}

.asset-image-preview {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
}

.asset-image-preview img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  object-fit: cover;
}

.primary-button {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 12px),
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.36), transparent 24px),
    linear-gradient(180deg, #ff8cad, var(--pink) 58%, #e95e84);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  box-shadow:
    0 10px 20px rgba(199, 53, 96, 0.22),
    3px 3px 0 rgba(199, 53, 96, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.primary-button.full {
  width: 100%;
}

.ghost-button {
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.035) 0 6px, transparent 6px 12px),
    var(--shine),
    linear-gradient(180deg, #fff7fa, #ffe8f0),
    #fff0f5;
  color: var(--pink-dark);
  padding: 0 13px;
  font-size: 14px;
  font-weight: 700;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.06),
    inset 0 0 0 1px rgba(246, 178, 198, 0.44);
}

.import-card,
.sync-card {
  display: grid;
  gap: 14px;
}

.collapsible-card {
  display: block;
}

.collapsible-card > summary {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  color: var(--text);
}

.collapsible-card > summary::-webkit-details-marker {
  display: none;
}

.collapsible-card > summary::after {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #fff7fa, #ffe8f0),
    #fff0f5;
  color: var(--pink-dark);
  content: "›";
  font-size: 20px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transition:
    transform 0.16s ease,
    background 0.16s ease;
}

.collapsible-card[open] > summary {
  margin-bottom: 14px;
}

.collapsible-card[open] > summary::after {
  transform: rotate(90deg);
  background: var(--pink);
  color: #fff;
}

.collapsible-card > summary span {
  min-width: 0;
}

.collapsible-card > summary strong,
.collapsible-card > summary small {
  display: block;
}

.collapsible-card > summary strong {
  font-size: 16px;
}

.collapsible-card > summary small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.shortcut-card {
  display: grid;
  gap: 12px;
}

.recurring-card {
  display: grid;
  gap: 12px;
}

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

.recurring-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.recurring-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #f7d5df;
  border-radius: 14px;
  background: #fffafb;
}

.recurring-item strong,
.recurring-item span,
.recurring-item small {
  display: block;
}

.recurring-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-item span,
.recurring-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.recurring-item b {
  color: var(--pink-dark);
  font-size: 14px;
  white-space: nowrap;
}

.widget-card {
  display: grid;
  gap: 12px;
}

.shortcut-template {
  display: grid;
  gap: 7px;
}

.shortcut-template span {
  color: var(--muted);
  font-size: 13px;
}

.shortcut-template input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffafb;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  outline: none;
}

.file-button {
  display: grid;
  min-height: 46px;
  place-items: center;
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.035) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #fff7fa, #ffe8f0),
    #ffe8f0;
  color: var(--pink-dark);
  font-weight: 700;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.06),
    inset 0 0 0 1px rgba(246, 178, 198, 0.44);
}

.file-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 13px;
}

summary {
  color: var(--pink-dark);
  font-weight: 700;
}

details p {
  margin-top: 8px;
  line-height: 1.55;
}

.connect-dialog,
.month-picker-dialog,
.sync-dialog {
  width: min(calc(100vw - 28px), 430px);
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.connect-dialog::backdrop,
.month-picker-dialog::backdrop,
.sync-dialog::backdrop {
  background: rgba(59, 37, 48, 0.26);
  backdrop-filter: blur(3px);
}

.connect-panel,
.month-picker-panel,
.sync-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background:
    url("./assets/brand/pixel-corner-pattern.webp") right -58px top -58px / 128px 128px no-repeat,
    var(--shine),
    linear-gradient(180deg, rgba(255, 248, 251, 0.98), rgba(255, 253, 253, 0.98)),
    var(--surface);
  padding: 16px;
  box-shadow:
    0 22px 60px rgba(157, 71, 102, 0.2),
    var(--pixel-shadow),
    inset 0 0 0 1px rgba(246, 178, 198, 0.38);
}

.connect-header,
.month-picker-header,
.sync-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.connect-header p,
.month-picker-header p,
.sync-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.sync-code-field {
  display: grid;
  gap: 7px;
}

.sync-code-field span {
  color: var(--muted);
  font-size: 13px;
}

.sync-code-field textarea {
  width: 100%;
  min-height: 138px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffafb;
  color: var(--text);
  padding: 10px 12px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
}

.sync-code-field textarea:focus {
  border-color: rgba(243, 111, 146, 0.82);
  box-shadow: 0 0 0 3px rgba(243, 111, 146, 0.15);
}

.sync-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.connect-grid {
  display: grid;
  gap: 10px;
}

.connect-provider {
  display: grid;
  gap: 12px;
  border: 1px solid #f7d5df;
  border-radius: 16px;
  background: #fffafb;
  padding: 13px;
}

.connect-provider.alipay {
  border-color: #cfddf7;
  background: #f7fbff;
}

.connect-provider strong,
.connect-provider span {
  display: block;
}

.connect-provider span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.connect-note {
  border-radius: 16px;
  background: #fff0f5;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.connect-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--pink-dark);
  font-size: 13px;
}

.month-picker-year {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: end;
  gap: 10px;
}

.month-picker-year label {
  display: grid;
  gap: 6px;
}

.month-picker-year span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.month-picker-year input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffafb;
  color: var(--text);
  padding: 0 12px;
  text-align: center;
  outline: none;
}

.month-picker-year input:focus {
  border-color: rgba(243, 111, 146, 0.82);
  box-shadow: 0 0 0 3px rgba(243, 111, 146, 0.15);
}

.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.month-picker-grid button {
  min-height: 42px;
  border: 1px solid #f7d5df;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fff, #fff7fa),
    #fffafb;
  color: var(--text);
  font-weight: 800;
  box-shadow:
    2px 2px 0 rgba(199, 53, 96, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.month-picker-grid button.current {
  border-color: #f3a8bb;
  background:
    repeating-linear-gradient(90deg, rgba(199, 53, 96, 0.04) 0 5px, transparent 5px 10px),
    #fff0f5;
}

.month-picker-grid button.selected {
  border-color: var(--pink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 5px, transparent 5px 10px),
    linear-gradient(180deg, #ff8cad, var(--pink));
  color: #fff;
}

.month-picker-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.report-card {
  display: grid;
  gap: 14px;
}

.report-card .section-title {
  margin-bottom: 0;
}

.report-tabs {
  margin-top: 0;
}

.report-table {
  display: grid;
  gap: 8px;
}

.report-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid #f7d5df;
  border-radius: 14px;
  background: #fffafb;
}

.report-row strong,
.report-row span {
  display: block;
}

.report-row strong {
  font-size: 15px;
}

.report-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.report-row b {
  color: var(--red);
  white-space: nowrap;
  font-size: 16px;
}

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

.empty-state {
  padding: 18px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.transaction-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
}

.channel-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: #fff0f5;
  color: var(--pink-dark);
  font-weight: 800;
}

.channel-mark.alipay {
  background: #edf4ff;
  color: var(--blue);
}

.transaction-main {
  min-width: 0;
}

.transaction-main strong,
.transaction-main span {
  display: block;
}

.transaction-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.transaction-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.transaction-amount {
  justify-self: end;
  white-space: nowrap;
  font-weight: 800;
}

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

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

.transaction-amount.transfer {
  color: var(--blue);
}

@keyframes page-rise {
  from {
    opacity: 0.72;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-open {
  from {
    opacity: 0.72;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tap-spark {
  0% {
    opacity: 0.52;
    transform: translate(-50%, -50%) scale(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

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

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 12px;
  }

  .budget-grid,
  .quick-stats,
  .annual-grid {
    gap: 7px;
  }

  .card,
  .budget-panel,
  .annual-panel,
  .asset-overview-panel {
    padding: 14px;
  }

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

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

  .asset-actions,
  .asset-edit-row {
    grid-template-columns: 1fr;
  }

  .asset-finish-row .ghost-button,
  .asset-finish-row .text-danger-button {
    flex: 1 1 120px;
  }

  .quick-category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-manager-top,
  .subcategory-row,
  .subcategory-row.editing,
  .subcategory-add-row,
  .recurring-item {
    grid-template-columns: 1fr;
  }

  .category-manager-name.locked {
    align-items: start;
  }

  .calendar-actions {
    grid-template-columns: 34px minmax(0, 1fr) 34px 64px;
    gap: 6px;
  }

  .mini-button {
    width: 34px;
  }

  .jump-button {
    width: 64px;
    font-size: 12px;
  }
}
