:root {
  color-scheme: light;
  --bg: #f7fbff;
  --surface: rgba(255, 252, 249, 0.72);
  --surface-strong: rgba(255, 252, 249, 0.92);
  --text-dark: #101820;
  --ink: var(--text-dark);
  --muted: #7592a9;
  --line: rgba(151, 124, 107, 0.1);
  --sky: #cfeefa;
  --sky-deep: #8ccbf2;
  --sky-soft: #edf9ff;
  --blush: #f0d5dd;
  --blush-deep: #9fbfd6;
  --blush-soft: #fbedf0;
  --oat: #f2eadf;
  --sage: #93aa88;
  --sage-deep: #78946f;
  --sage-soft: #e6ecdf;
  --shell: #b98f95;
  --button-blue: #8ccbf2;
  --button-blue-deep: #74afd2;
  --button-blue-soft: rgba(225, 243, 252, 0.78);
  --button-blue-glass: rgba(255, 255, 255, 0.14);
  --button-secondary: rgba(142, 139, 134, 0.58);
  --amount-blue: #74B0D2;
  --selected-blue: #74B0D2;
  --selected-blue-bg: linear-gradient(135deg, rgba(247, 190, 211, 0.24), rgba(191, 232, 251, 0.32));
  --selected-blue-border: rgba(255, 255, 255, 0.64);
  --nav-shell-pink: #E5D8DF;
  --logo-pink: #e8a9c1;
  --logo-blue: #82c9ee;
  --logo-lavender: #c9b7df;
  --logo-gradient: linear-gradient(90deg, var(--logo-pink) 0%, var(--logo-lavender) 48%, var(--logo-blue) 100%);
  --shadow: 0 26px 64px rgba(117, 142, 161, 0.13);
  --shadow-soft: 0 14px 34px rgba(117, 142, 161, 0.09);
  --radius: 32px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 21% 34%, rgba(247, 190, 211, 0.38), transparent 31%),
    radial-gradient(circle at 72% 42%, rgba(161, 217, 247, 0.58), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(213, 244, 250, 0.64), transparent 30%),
    linear-gradient(110deg, #fff4f0 0%, #fbf7f4 31%, #f7fbff 51%, #dff3fb 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 20px 16px 106px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: min(88vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(24, 32, 31, 0.9);
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.auth {
  min-height: 92vh;
  display: grid;
  align-items: center;
}

.auth-panel,
.sheet,
.summary-card,
.list-item,
.form-panel,
.stat-panel,
.empty {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(1.08);
}

.auth-panel {
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand-mark,
.icon-bubble {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 24px;
  color: var(--shell);
  background: linear-gradient(145deg, rgba(255, 252, 246, 0.72), rgba(238, 248, 250, 0.58));
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.logo-card {
  position: relative;
  width: min(100%, 1180px);
  min-height: clamp(320px, 52vw, 680px);
  margin: 18px auto 28px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: clamp(34px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 48%, rgba(247, 200, 216, 0.42), transparent 34%),
    radial-gradient(circle at 70% 52%, rgba(167, 216, 245, 0.48), transparent 38%),
    linear-gradient(135deg, #fffaf7 0%, #f9f5f3 38%, #f5fbff 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px rgba(255, 255, 255, 0.55),
    0 24px 70px rgba(120, 145, 165, 0.12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.logo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.38) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
  opacity: 0.28;
  pointer-events: none;
}

.logo-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 28px 80px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.nacre-logo {
  position: relative;
  display: inline-block;
  flex: none;
}

.logo-wrap {
  position: relative;
  display: inline-block;
  transform: translateY(4%);
}

.logo-word {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(78px, 15.2vw, 210px);
  font-weight: 300;
  letter-spacing: 0.14em;
  line-height: 1;
  background: linear-gradient(90deg, #f0afc7 0%, #c7b9e7 48%, #8ccbf2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.72;
}

.logo-pearl-img {
  position: absolute;
  display: block;
  width: clamp(34px, 5vw, 70px);
  height: auto;
  right: 0.5%;
  top: -22%;
  transform: rotate(-13deg);
  pointer-events: none;
  user-select: none;
}

.brand-logo-frame {
  display: grid;
  place-items: center;
  flex: none;
  width: 166px;
  min-height: 72px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 28% 42%, rgba(247, 200, 216, 0.34), transparent 40%),
    radial-gradient(circle at 76% 52%, rgba(167, 216, 245, 0.38), transparent 42%),
    rgba(255, 252, 246, 0.58);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.brand-logo .logo-word {
  font-size: 30px;
  letter-spacing: 0.12em;
}

.brand-logo .logo-pearl-img {
  width: 21px;
  right: 0;
  top: -24%;
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-actions .button {
  position: relative;
  min-height: 58px;
  border-color: rgba(116, 175, 210, 0.48);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 12px 24px rgba(116, 175, 210, 0.08);
}

.auth-actions .button:active {
  transform: scale(0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 8px 18px rgba(116, 175, 210, 0.08);
}

.button-label {
  background: var(--logo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 18px rgba(232, 169, 193, 0.16);
}

.auth-tagline {
  margin: 0;
  background: var(--logo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 8px 18px rgba(130, 201, 238, 0.12);
}

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

.auth-links .link-button {
  padding-inline: 4px;
  background: transparent;
  color: #7592a9;
  font-size: 12px;
  text-shadow: 0 7px 16px rgba(130, 201, 238, 0.14);
}

.topbar-logo {
  display: grid;
  place-items: center;
  height: 46px;
}

.topbar-logo .logo-word {
  font-size: 38px;
  letter-spacing: 0.12em;
}

.topbar-logo .logo-pearl-img {
  width: 25px;
  right: 0;
  top: -25%;
}

.hero-logo {
  z-index: 1;
}

.calendar-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  margin: 14px auto 24px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: clamp(30px, 4.6vw, 58px);
  background:
    radial-gradient(circle at 22% 18%, rgba(247, 190, 211, 0.46), transparent 34%),
    radial-gradient(circle at 78% 32%, rgba(174, 226, 250, 0.58), transparent 42%),
    linear-gradient(130deg, rgba(255, 249, 246, 0.92) 0%, rgba(251, 246, 249, 0.82) 42%, rgba(231, 247, 255, 0.86) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 24px 70px rgba(117, 142, 161, 0.12);
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
}

.calendar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.34) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
  opacity: 0.22;
  pointer-events: none;
}

.calendar-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.calendar-kicker {
  margin-bottom: 6px;
  color: #9d7481;
  font-size: 13px;
  font-weight: 760;
}

.calendar-head h2 {
  font-size: clamp(24px, 4.5vw, 42px);
  font-weight: 760;
  letter-spacing: 0;
}

.calendar-total {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  white-space: nowrap;
}

.calendar-total span {
  font-size: 13px;
  font-weight: 720;
}

.calendar-total strong {
  color: var(--amount-blue);
  font-size: clamp(18px, 4vw, 32px);
}

.calendar-weekdays,
.calendar-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(6px, 1.4vw, 12px);
}

.calendar-weekdays {
  color: rgba(117, 146, 169, 0.82);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: clamp(46px, 7.5vw, 76px);
  padding: clamp(7px, 1.4vw, 11px);
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: clamp(16px, 2vw, 22px);
  color: var(--ink);
  background: rgba(255, 252, 249, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 12px 26px rgba(117, 142, 161, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.calendar-day.empty {
  visibility: hidden;
}

.calendar-day.has-amount {
  background:
    radial-gradient(circle at 22% 18%, rgba(247, 200, 216, 0.38), transparent 45%),
    radial-gradient(circle at 82% 82%, rgba(191, 232, 251, 0.48), transparent 45%),
    rgba(255, 252, 249, 0.56);
}

.calendar-day.today {
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 16px 34px rgba(186, 130, 150, 0.12);
}

.day-number {
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 780;
}

.day-amount {
  min-height: 1.2em;
  color: var(--amount-blue);
  font-size: clamp(10px, 1.45vw, 13px);
  font-weight: 760;
  white-space: nowrap;
}

.shell-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.brand-mark .shell-icon {
  width: 28px;
  height: 28px;
  color: var(--shell);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1;
}

h2 {
  font-size: 25px;
  line-height: 1.18;
}

h3 {
  font-size: 17px;
}

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

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

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

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

.field span,
.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(135, 174, 198, 0.14);
  outline: 0;
  border-radius: 24px;
  padding: 15px 16px;
  color: var(--ink);
  font-size: 15px;
  background: rgba(255, 252, 246, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 22px rgba(113, 92, 74, 0.04);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(116, 175, 210, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 0 0 4px rgba(140, 203, 242, 0.1),
    0 10px 22px rgba(113, 92, 74, 0.04);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.button,
.icon-button,
.tab-button,
.link-button {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.button:active,
.icon-button:active,
.tab-button:active,
.link-button:active {
  transform: scale(0.98);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  color: var(--logo-pink);
  border-color: rgba(116, 175, 210, 0.62);
  background: rgba(140, 203, 242, 0.32);
  font-weight: 760;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 12px 24px rgba(116, 175, 210, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.button.secondary {
  color: var(--muted);
  border-color: rgba(142, 139, 134, 0.34);
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 20px rgba(117, 142, 161, 0.06);
}

.button.danger {
  color: var(--logo-pink);
  border-color: rgba(116, 175, 210, 0.62);
  background: rgba(140, 203, 242, 0.32);
}

.link-button {
  padding: 10px 12px;
  color: var(--logo-pink);
  background: transparent;
  font-weight: 760;
}

.settings-view .button,
.settings-view .button.secondary,
.settings-view .button.danger,
.settings-view .icon-button,
.settings-view .link-button {
  color: #7592a9;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: var(--selected-blue-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 10px 20px rgba(117, 142, 161, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.settings-view .link-button {
  min-height: 30px;
  padding: 4px 8px;
}

.settings-view .icon-button {
  background: var(--selected-blue-bg);
}

.topbar {
  position: sticky;
  top: 8px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: -8px -4px 18px;
  padding: 20px 22px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 21% 36%, rgba(247, 190, 211, 0.18), transparent 34%),
    radial-gradient(circle at 74% 45%, rgba(191, 232, 251, 0.26), transparent 42%),
    linear-gradient(135deg, rgba(255, 250, 252, 0.58), rgba(240, 249, 253, 0.5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 14px 34px rgba(117, 142, 161, 0.06);
  backdrop-filter: blur(30px) saturate(1.18);
}

.topbar-shell {
  display: grid;
  place-items: center;
  height: 30px;
  color: var(--shell);
}

.topbar-shell .shell-icon {
  width: 31px;
  height: 31px;
  stroke-width: 1.45;
}

.topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  grid-column: 3;
}

.topbar-logo {
  grid-column: 2;
}

.ledger-select {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.ledger-select select {
  width: max-content;
  min-width: 9.8em;
  max-width: min(58vw, 360px);
  field-sizing: content;
  min-height: 42px;
  padding: 10px 32px 10px 14px;
  color: #7592a9;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background:
    radial-gradient(circle at 20% 30%, rgba(247, 190, 211, 0.24), transparent 34%),
    radial-gradient(circle at 82% 52%, rgba(191, 232, 251, 0.34), transparent 38%),
    rgba(255, 252, 246, 0.58);
}

.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 18px;
  padding: 8px 2px 0;
}

.home-hero h1 {
  max-width: 560px;
  font-size: 32px;
  line-height: 1.04;
  font-weight: 780;
}

.eyebrow {
  margin-bottom: 7px;
  color: #74afd2;
  font-size: 13px;
  font-weight: 760;
}

.hero-shell {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  color: var(--shell);
  background: rgba(255, 252, 246, 0.58);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.hero-shell .shell-icon {
  width: 30px;
  height: 30px;
}

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

.home-summary-grid {
  gap: clamp(14px, 2.4vw, 24px);
  margin: 10px 0 16px;
}

.summary-card {
  min-height: 132px;
  padding: 22px;
}

.home-summary-grid .summary-card {
  min-height: clamp(140px, 18vw, 190px);
  padding: clamp(24px, 3.2vw, 36px);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.summary-card.primary {
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(247, 190, 211, 0.32), transparent 36%),
    linear-gradient(145deg, rgba(244, 251, 255, 0.96), rgba(207, 238, 250, 0.8));
}

.summary-card .amount {
  margin-top: 18px;
  color: var(--amount-blue);
  font-size: 30px;
  line-height: 1;
  font-weight: 860;
}

.summary-card.small .amount {
  font-size: 23px;
}

.home-summary-grid .summary-card.small .amount {
  font-size: clamp(23px, 4vw, 39px);
  letter-spacing: 0;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 12px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.68);
  box-shadow: var(--shadow-soft);
}

.tab-button {
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 760;
}

.tab-button.active {
  color: var(--selected-blue);
  border-color: var(--selected-blue-border);
  background: var(--selected-blue-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 10px 20px rgba(116, 175, 210, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.list-item.just-saved {
  background:
    radial-gradient(circle at 12% 20%, rgba(191, 232, 251, 0.36), transparent 34%),
    rgba(255, 252, 246, 0.86);
  box-shadow: 0 20px 46px rgba(117, 188, 230, 0.16);
}

.icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 20px;
  background: linear-gradient(145deg, #f4fbff, var(--button-blue-soft));
  color: #74afd2;
  box-shadow: none;
}

.icon-bubble .shell-icon {
  width: 25px;
  height: 25px;
  stroke-width: 1.55;
}

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

.item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 780;
}

.item-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.amount-line {
  color: var(--amount-blue);
  text-align: right;
  font-weight: 840;
}

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

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

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 9px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--ink);
  background: rgba(255, 252, 246, 0.68);
  box-shadow: var(--shadow-soft);
}

.compact-entry-list {
  gap: 8px;
}

.compact-entry-list .list-item {
  gap: 10px;
  padding: 9px 12px;
  border-radius: 24px;
}

.compact-entry-list .icon-bubble {
  width: 34px;
  height: 34px;
  border-radius: 15px;
}

.compact-entry-list .icon-bubble .shell-icon {
  width: 20px;
  height: 20px;
}

.compact-entry-list .item-title,
.compact-entry-list .item-title span,
.compact-entry-list .amount-line {
  font-size: 14px !important;
}

.compact-entry-list .item-meta {
  margin-top: 2px;
  font-size: 12px;
}

.compact-entry-list .actions {
  gap: 6px;
  margin-top: 4px;
}

.compact-entry-list .icon-button {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.form-panel,
.stat-panel,
.empty {
  padding: 18px;
}

.form-panel {
  display: grid;
  gap: 14px;
}

.category-create-panel {
  gap: 18px;
}

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

.category-create-card {
  padding: 16px;
  border-radius: 28px;
  background: rgba(255, 252, 249, 0.58);
  box-shadow: var(--shadow-soft);
}

.category-create-card h4 {
  margin: 0;
  font-size: 16px;
}

.category-picker {
  display: grid;
  gap: 14px;
}

.category-picker-head,
.secondary-category-head,
.tag-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-picker-head span,
.secondary-category-head strong,
.tag-picker-head span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 780;
}

.category-picker-head em,
.secondary-category-head span {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 720;
}

.primary-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 14px 10px;
}

.category-choice,
.secondary-choice {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.category-choice {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 98px;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 760;
}

.category-choice-icon,
.secondary-choice-icon {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  color: rgba(82, 78, 74, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 22px rgba(117, 142, 161, 0.07);
}

.category-choice-icon {
  width: 62px;
  height: 62px;
}

.category-choice-svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.75;
}

.category-choice.active .category-choice-icon {
  color: #fff;
  background: rgba(229, 132, 116, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    0 14px 26px rgba(229, 132, 116, 0.18);
}

.category-choice.active {
  color: var(--ink);
}

.secondary-category-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 28px;
  background: rgba(255, 252, 249, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 14px 32px rgba(117, 142, 161, 0.08);
}

.secondary-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 12px;
}

.secondary-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 760;
  text-align: left;
  background: rgba(255, 255, 255, 0.34);
}

.secondary-choice-icon {
  flex: none;
  width: 38px;
  height: 38px;
}

.secondary-choice-svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.75;
}

.secondary-choice.active {
  color: var(--ink);
  background: rgba(229, 216, 223, 0.48);
}

.secondary-choice.active .secondary-choice-icon {
  color: #fff;
  background: rgba(229, 132, 116, 0.68);
}

.tag-picker {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 28px;
  background: rgba(255, 252, 249, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 12px 26px rgba(117, 142, 161, 0.05);
}

.tag-create-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 260px);
}

.tag-create-form input {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
}

.tag-create-form .icon-button {
  width: 42px;
  height: 42px;
  color: var(--selected-blue);
  border: 1px solid var(--selected-blue-border);
  background: var(--selected-blue-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 10px 20px rgba(116, 175, 210, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tag-chip-list,
.account-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 9px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
  font-weight: 760;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 9px 18px rgba(117, 142, 161, 0.05);
}

.tag-chip.active {
  color: #fff;
  background: rgba(116, 176, 210, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    0 12px 22px rgba(116, 176, 210, 0.12);
}

.tag-chip b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: currentColor;
  background: rgba(255, 255, 255, 0.28);
  font-size: 15px;
  line-height: 1;
}

.account-list {
  margin-top: 12px;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #74b0d2;
  background: rgba(225, 243, 252, 0.68);
}

.form-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.compact-save {
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
  color: var(--selected-blue);
  border-color: var(--selected-blue-border);
  background: var(--selected-blue-bg);
}

.entry-actions {
  position: sticky;
  bottom: 96px;
  z-index: 7;
  display: grid;
  gap: 10px;
  margin: 4px -2px -2px;
  padding: 12px 2px 2px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0), rgba(255, 252, 246, 0.9) 34%, rgba(255, 252, 246, 0.96));
  backdrop-filter: blur(16px);
}

.entry-actions .button {
  min-height: 58px;
  color: var(--selected-blue);
  border-color: var(--selected-blue-border);
  background: var(--selected-blue-bg);
  font-size: 17px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 10px 22px rgba(116, 175, 210, 0.08);
}

.entry-workspace {
  grid-template-columns: 1fr;
}

.instant-panel {
  align-self: start;
  display: grid;
  gap: 14px;
}

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

.instant-head h2 {
  font-size: 25px;
}

.instant-list {
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.instant-list .list-item {
  grid-template-columns: auto 1fr;
}

.instant-list .amount-line {
  grid-column: 2;
  text-align: left;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: min(92vw, 520px);
  padding: 7px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 8% 50%, rgba(247, 190, 211, 0.26), transparent 30%),
    radial-gradient(circle at 92% 50%, rgba(191, 232, 251, 0.52), transparent 34%),
    rgba(255, 252, 249, 0.78);
  box-shadow: 0 18px 50px rgba(117, 142, 161, 0.16);
  transform: translateX(-50%);
  backdrop-filter: blur(22px) saturate(1.12);
}

.nav-button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  color: var(--nav-shell-pink);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
}

.nav-button strong {
  font-size: 18px;
  line-height: 1;
}

.nav-button.active {
  color: var(--selected-blue);
  border: 1px solid var(--selected-blue-border);
  background: var(--selected-blue-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 10px 22px rgba(116, 175, 210, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

button:disabled {
  cursor: default;
  opacity: 0.42;
}

.stats-view {
  gap: 18px;
}

.stats-hero {
  display: grid;
  gap: 18px;
  padding: 12px 2px 4px;
}

.stats-hero h1 {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1;
}

.stats-range-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 5px;
  border-radius: 999px;
  background: rgba(142, 142, 147, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stats-range-tabs .tab-button {
  min-height: 48px;
  font-size: 16px;
}

.stats-range-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.stats-range-nav strong {
  color: var(--text-dark);
  font-size: clamp(18px, 3.6vw, 28px);
  text-align: center;
}

.stats-range-nav .icon-button {
  width: 46px;
  height: 46px;
  color: #fff;
  background: rgba(116, 176, 210, 0.84);
  font-size: 30px;
  font-weight: 800;
}

.stats-custom-range {
  max-width: 560px;
  margin-inline: auto;
}

.stats-card {
  display: grid;
  gap: 18px;
}

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

.stats-card-head h3 {
  font-size: clamp(20px, 3vw, 28px);
}

.stats-card-head span {
  color: var(--muted);
  font-weight: 760;
}

.stats-total-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-total-grid div {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.34);
}

.stats-total-grid span {
  color: var(--muted);
  font-weight: 760;
}

.stats-total-grid strong {
  color: var(--amount-blue);
  font-size: clamp(20px, 4vw, 34px);
}

.trend-chart {
  width: 100%;
  min-height: 170px;
  overflow: visible;
}

.trend-chart line {
  stroke: rgba(142, 142, 147, 0.18);
  stroke-width: 1;
}

.trend-chart .trend-area {
  fill: rgba(116, 176, 210, 0.18);
}

.trend-chart .trend-line {
  fill: none;
  stroke: #74B0D2;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-chart circle {
  fill: rgba(255, 255, 255, 0.9);
  stroke: #74B0D2;
  stroke-width: 3;
}

.trend-chart text {
  fill: rgba(117, 146, 169, 0.86);
  font-size: 15px;
  font-weight: 700;
}

.donut-wrap {
  display: grid;
  place-items: center;
  min-height: 330px;
}

.donut-chart {
  display: grid;
  place-items: center;
  width: clamp(230px, 34vw, 330px);
  aspect-ratio: 1;
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 18px 42px rgba(117, 142, 161, 0.08);
}

.donut-hole {
  display: grid;
  place-items: center;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 252, 249, 0.92);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.42);
}

.donut-hole span {
  color: var(--muted);
  font-weight: 760;
}

.donut-hole strong {
  color: var(--amount-blue);
  font-size: clamp(24px, 4vw, 38px);
}

.segmented.mini {
  justify-self: center;
}

.analysis-list {
  display: grid;
  gap: 18px;
}

.analysis-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.analysis-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

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

.analysis-title strong {
  color: var(--text-dark);
  font-size: clamp(17px, 2.4vw, 24px);
}

.analysis-title span {
  color: var(--amount-blue);
  font-size: clamp(18px, 2.8vw, 28px);
  font-weight: 840;
  white-space: nowrap;
}

.analysis-meta {
  color: #7592a9;
  font-weight: 720;
}

.sub-stat-block {
  display: grid;
  gap: 14px;
}

.sub-stat-block h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 18px;
}

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

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.stat-amount {
  color: var(--amount-blue);
  font-weight: 760;
}

input[name="amount"] {
  color: var(--amount-blue);
  font-weight: 720;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(150, 132, 112, 0.12);
}

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

.category-group {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.58);
  box-shadow: var(--shadow-soft);
}

.category-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.category-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.category-name .shell-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.55;
  color: var(--shell);
}

.child-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(191, 232, 251, 0.32);
  color: #6daed3;
  font-size: 13px;
  font-weight: 760;
}

.sortable-pill {
  padding-right: 6px;
}

.sortable-pill .sort-button {
  min-width: 28px;
  padding: 4px 7px;
  font-size: 14px;
  line-height: 1;
}

.pill .shell-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

h1,
h2,
h3,
h4,
.item-title,
.category-name,
.category-picker-head span,
.secondary-category-head strong,
.category-choice.active,
.secondary-choice.active,
.stats-range-nav strong,
.analysis-title strong,
.sub-stat-block h4 {
  font-size: 25px !important;
}

.calendar-head h2 {
  font-size: 25px !important;
}

.calendar-weekdays {
  font-size: 12px !important;
}

.day-number {
  font-size: clamp(14px, 2vw, 18px) !important;
}

.day-amount {
  font-size: clamp(10px, 1.45vw, 13px) !important;
}

.entry-workspace .form-title-row h2,
.entry-workspace .category-picker-head span,
.entry-workspace .secondary-category-head strong,
.entry-workspace .tag-picker-head span,
.entry-workspace .instant-head h2,
.stats-view h1,
.stats-view .stats-card-head h3,
.stats-view .sub-stat-block h4 {
  font-size: 18px !important;
}

.entry-workspace .category-picker-head span,
.entry-workspace .category-picker-head em,
.entry-workspace .secondary-category-head strong,
.entry-workspace .secondary-category-head span,
.entry-workspace .category-choice,
.entry-workspace .category-choice.active,
.entry-workspace .secondary-choice,
.entry-workspace .secondary-choice.active {
  color: #7592a9;
  font-size: 12px !important;
}

.entry-workspace .category-choice span,
.entry-workspace .secondary-choice span {
  font-size: 12px !important;
}

.list-item .item-title,
.list-item .item-title span,
.stats-view .analysis-title strong {
  font-size: 15px !important;
}

.settings-view .category-name,
.settings-view .category-name .shell-icon {
  font-size: 15px !important;
}

.stats-view .stats-total-grid strong,
.stats-view .donut-hole strong,
.stats-view .analysis-title span,
.stats-view .analysis-meta,
.stats-view .stat-amount,
.stats-view .amount-line,
.stats-view .bar-head,
.stats-view .trend-chart text {
  font-size: 15px !important;
}

.desktop-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  #app {
    padding: 28px 24px 116px;
  }

  .auth-panel {
    width: min(460px, 100%);
    margin: 0 auto;
  }

  .desktop-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .entry-workspace {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  }

  .summary-grid {
    grid-template-columns: 1.3fr 0.85fr 0.85fr;
  }

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

@media (max-width: 520px) {
  .two,
  .summary-grid,
  .category-create-grid {
    grid-template-columns: 1fr;
  }

  .calendar-card {
    margin-top: 10px;
    padding: 16px;
  }

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

  .home-summary-grid .summary-card {
    min-height: 112px;
    padding: 18px 12px;
  }

  .home-summary-grid .summary-card.small .amount {
    font-size: clamp(20px, 5.3vw, 26px);
  }

  .stats-range-tabs .tab-button {
    min-height: 42px;
    padding-inline: 8px;
    font-size: 14px;
  }

  .stats-range-nav {
    gap: 8px;
  }

  .stats-range-nav .icon-button {
    width: 40px;
    height: 40px;
  }

  .stats-total-grid,
  .stats-custom-range {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    min-height: 260px;
  }

  .analysis-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .primary-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 6px;
  }

  .category-choice {
    min-height: 84px;
    font-size: 12px;
  }

  .category-choice-icon {
    width: 52px;
    height: 52px;
  }

  .category-choice-svg {
    width: 29px;
    height: 29px;
  }

  .secondary-category-panel {
    padding: 14px;
    border-radius: 24px;
  }

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

  .calendar-head {
    align-items: flex-start;
  }

  .calendar-total strong {
    font-size: 18px;
  }

  .calendar-grid,
  .calendar-weekdays {
    gap: 5px;
  }

  .calendar-day {
    min-height: 44px;
    padding: 7px 5px;
    border-radius: 16px;
  }

  .day-amount {
    font-size: 10px;
    letter-spacing: 0;
  }

  .topbar-controls {
    justify-content: flex-end;
  }

  .ledger-select select {
    width: max-content;
    min-width: 9.2em;
    max-width: 62vw;
    field-sizing: content;
    min-height: 40px;
    font-size: 13px;
  }

  .topbar {
    gap: 8px;
    padding: 16px 14px;
    grid-template-columns: minmax(28px, 1fr) auto minmax(96px, 1fr);
  }

  .topbar-logo .logo-word {
    font-size: 30px;
  }

  .topbar-logo .logo-pearl-img {
    width: 21px;
  }
}
