:root {
  --paper: #f7f3e9;
  --paper-deep: #efe9dc;
  --surface: rgba(255, 253, 247, 0.9);
  --surface-solid: #fffdf8;
  --ink: #243a30;
  --ink-soft: #587065;
  --ink-faint: #839187;
  --forest: #355e4d;
  --forest-deep: #24453a;
  --forest-light: #deeadf;
  --sage: #b9cbbd;
  --gold: #d7b867;
  --gold-soft: #f3e6b8;
  --complete: #e8e9e3;
  --complete-ink: #758078;
  --danger: #9f534b;
  --danger-soft: #f3dfda;
  --line: rgba(49, 80, 65, 0.13);
  --shadow-soft: 0 18px 50px rgba(48, 63, 53, 0.08);
  --shadow-card: 0 8px 24px rgba(48, 63, 53, 0.055);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 13px;
  --font-sans: "Aptos", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans SC", sans-serif;
  --font-serif: "STSong", "Songti SC", "Noto Serif SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 4%, rgba(222, 234, 223, 0.9), transparent 27rem),
    radial-gradient(circle at 94% 34%, rgba(241, 224, 173, 0.34), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(53, 94, 77, 0.32);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
}

.ambient-one {
  top: 24%;
  left: -19rem;
  width: 34rem;
  height: 34rem;
  border: 1px solid rgba(78, 113, 94, 0.12);
}

.ambient-two {
  right: -17rem;
  bottom: -14rem;
  width: 38rem;
  height: 38rem;
  background: rgba(227, 218, 196, 0.29);
}

.ambient-star {
  position: fixed;
  z-index: -1;
  color: rgba(158, 139, 84, 0.2);
  pointer-events: none;
  user-select: none;
}

.ambient-star-one {
  top: 16%;
  right: 6%;
  font-size: 52px;
  transform: rotate(12deg);
}

.ambient-star-two {
  bottom: 12%;
  left: 4%;
  font-size: 32px;
  transform: rotate(-14deg);
}

.app-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 54px) 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(34px, 5vw, 64px);
}

.topbar-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 5px 13px rgba(42, 77, 62, 0.19);
  color: var(--gold-soft);
  font-size: 14px;
  transform: rotate(-8deg);
}

.date-chip {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.date-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(215, 184, 103, 0.16);
}

.sound-toggle {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.sound-toggle:hover {
  border-color: rgba(53, 94, 77, 0.24);
  background: rgba(245, 247, 238, 0.9);
}

.sound-toggle[aria-pressed="false"] {
  color: #a3aaa2;
}

.sound-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #e6ede4;
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
}

.sound-toggle[aria-pressed="false"] .sound-icon {
  background: #ecebe5;
  color: #9ea49c;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(210px, 0.72fr) minmax(245px, 0.86fr);
  gap: clamp(16px, 2.3vw, 30px);
  align-items: stretch;
  margin-bottom: clamp(24px, 3.7vw, 42px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 6px 20px 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 9px;
  color: #6d7c6f;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 590px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(35px, 4.25vw, 57px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.hero-description {
  max-width: 450px;
  margin: 19px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.progress-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 186px;
  padding: 25px 25px 23px;
  border: 1px solid rgba(52, 88, 70, 0.11);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(13px);
}

.progress-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.progress-number {
  display: flex;
  align-items: baseline;
  margin: 0;
  color: var(--ink);
}

.progress-number strong {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 0.8;
}

.progress-divider {
  margin: 0 5px;
  color: #acb7ad;
}

.progress-number > span:last-child {
  color: var(--ink-faint);
  font-size: 17px;
}

.progress-track {
  position: relative;
  height: 10px;
  margin-top: 29px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e9e1;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #86a68e, var(--forest));
  box-shadow: 0 0 18px rgba(53, 94, 77, 0.25);
  transition: width 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-message {
  min-height: 1.5em;
  margin: 17px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.55;
}

.treasure-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 104px;
  grid-template-rows: auto 1fr auto;
  min-height: 186px;
  padding: 22px 18px 17px 24px;
  overflow: hidden;
  border: 1px solid rgba(216, 185, 103, 0.28);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.97), rgba(241, 235, 218, 0.92)),
    var(--surface-solid);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.treasure-card::before {
  position: absolute;
  top: -5rem;
  right: -4rem;
  width: 12rem;
  height: 12rem;
  border: 1px solid rgba(215, 184, 103, 0.22);
  border-radius: 50%;
  content: "";
}

.treasure-card:hover {
  border-color: rgba(198, 158, 57, 0.43);
  box-shadow: 0 15px 33px rgba(80, 70, 36, 0.1);
  transform: translateY(-3px);
}

.treasure-card:active {
  transform: translateY(-1px) scale(0.995);
}

.treasure-kicker {
  align-self: start;
  color: #746b50;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.treasure-visual {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  justify-self: end;
  width: 104px;
}

.treasure-visual svg {
  display: block;
  width: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 12px rgba(44, 75, 60, 0.16));
}

.treasure-shine {
  position: absolute;
  color: #d6ae4c;
  line-height: 1;
  pointer-events: none;
}

.shine-one {
  top: 7px;
  right: -2px;
  font-size: 13px;
  animation: twinkle 3.4s ease-in-out infinite;
}

.shine-two {
  bottom: 20px;
  left: 2px;
  font-size: 18px;
  animation: twinkle 3.4s 1.2s ease-in-out infinite;
}

.treasure-balance {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  gap: 5px;
  align-items: baseline;
  align-self: center;
  color: var(--ink);
}

.treasure-balance strong {
  font-family: var(--font-serif);
  font-size: clamp(42px, 5vw, 63px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.treasure-balance span {
  color: #7c806d;
  font-size: 12px;
}

.treasure-action {
  grid-column: 1 / 3;
  grid-row: 3;
  width: fit-content;
  padding-top: 10px;
  color: #857960;
  font-size: 11px;
  border-bottom: 1px solid rgba(133, 121, 96, 0.3);
}

.treasure-card.is-bumping .treasure-visual {
  animation: chest-bump 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.treasure-card.is-bumping .treasure-balance strong {
  animation: number-bump 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.treasure-card.is-negative {
  border-color: rgba(159, 83, 75, 0.25);
  background:
    linear-gradient(135deg, rgba(255, 250, 245, 0.97), rgba(244, 230, 222, 0.92)),
    var(--surface-solid);
}

.treasure-card.is-negative .treasure-balance strong,
.treasure-card.is-negative .treasure-balance span {
  color: #9f5d51;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(360px, 0.93fr);
  gap: clamp(18px, 2.5vw, 30px);
  align-items: start;
}

.dashboard-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: clamp(18px, 2.5vw, 30px);
}

.panel {
  padding: clamp(21px, 3vw, 33px);
  border: 1px solid rgba(52, 88, 70, 0.11);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(13px);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.panel-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(23px, 2.4vw, 29px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.panel-heading .section-kicker {
  margin-bottom: 7px;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.primary-button {
  padding: 12px 19px;
  border-radius: 13px;
  background: var(--forest);
  box-shadow: 0 7px 15px rgba(40, 74, 59, 0.16);
  color: #fffdf6;
  font-size: 13px;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--forest-deep);
  box-shadow: 0 9px 19px rgba(40, 74, 59, 0.2);
  transform: translateY(-1px);
}

.primary-button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.primary-button.compact {
  flex: 0 0 auto;
  padding: 10px 15px;
  font-size: 12px;
}

.secondary-button {
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.secondary-button:hover {
  background: #eeeee6;
  color: var(--ink);
}

.secondary-button.compact {
  flex: 0 0 auto;
  padding: 9px 13px;
  font-size: 11px;
}

.danger-button {
  padding: 11px 17px;
  border-radius: 13px;
  background: var(--danger);
  color: #fffaf8;
  font-size: 13px;
  font-weight: 700;
}

.danger-button:hover {
  background: #88443e;
}

.text-button {
  padding: 6px 0;
  border-bottom: 1px solid rgba(53, 94, 77, 0.35);
  border-radius: 0;
  background: transparent;
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--forest-deep);
}

.habit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.improvement-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.habit-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto auto;
  gap: 13px;
  align-items: center;
  min-height: 74px;
  padding: 13px 13px 13px 15px;
  border: 1px solid rgba(53, 94, 77, 0.1);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.72);
  transition:
    background 260ms ease,
    border-color 260ms ease,
    color 260ms ease,
    transform 200ms ease;
}

.habit-row:hover {
  border-color: rgba(53, 94, 77, 0.2);
  transform: translateX(2px);
}

.habit-row.is-complete {
  border-color: rgba(87, 95, 88, 0.08);
  background: var(--complete);
  color: var(--complete-ink);
}

.habit-row.is-complete .habit-name {
  color: var(--complete-ink);
}

.habit-row.is-complete .star-reward {
  border-color: rgba(91, 97, 91, 0.08);
  background: #dedfd9;
  color: #858c86;
}

.habit-row.is-complete .habit-actions {
  opacity: 0.58;
}

.improvement-panel {
  background:
    linear-gradient(150deg, rgba(255, 253, 247, 0.94), rgba(247, 239, 232, 0.9)),
    var(--surface);
}

.improvement-intro {
  margin: -8px 0 17px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.7;
}

.improvement-add {
  border-color: rgba(159, 83, 75, 0.2);
  color: #855f58;
}

.improvement-add:hover {
  background: #f4e7e1;
  color: #824c45;
}

.improvement-row {
  border-color: rgba(143, 93, 82, 0.11);
  background: rgba(255, 252, 247, 0.72);
}

.improvement-row:hover {
  border-color: rgba(143, 93, 82, 0.22);
}

.improvement-row.is-occurred {
  border-color: rgba(151, 88, 76, 0.09);
  background: #f0e7e2;
}

.improvement-row.is-occurred .habit-name {
  color: #816e69;
}

.improvement-row.is-occurred .habit-status {
  color: #9a827c;
}

.improvement-row.is-occurred .habit-actions {
  opacity: 0.58;
}

.improvement-row .check-visual {
  border-color: #d2bdb7;
  color: transparent;
}

.improvement-row .habit-check:hover .check-visual {
  border-color: #b27d72;
}

.improvement-check input:checked + .check-visual {
  border-color: #9f5e52;
  background: #9f5e52;
  color: #fffaf7;
}

.penalty-badge {
  border-color: rgba(163, 86, 73, 0.15);
  background: #f6e6df;
  color: #94554a;
}

.penalty-badge span {
  color: #ad675a;
}

.improvement-row.is-occurred .penalty-badge {
  border-color: rgba(115, 88, 82, 0.08);
  background: #e5d9d4;
  color: #8e7771;
}

.improvement-row.is-occurred .penalty-badge span {
  color: #92766f;
}

.improvement-empty {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 20px;
  border: 1px dashed rgba(143, 93, 82, 0.2);
  border-radius: 18px;
  background: rgba(252, 247, 240, 0.45);
}

.improvement-empty-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #f0e3dc;
  color: #a46a5e;
  font-family: Georgia, serif;
  font-size: 24px;
}

.improvement-empty h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
}

.improvement-empty p {
  margin: 0 0 8px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.6;
}

.habit-check {
  position: relative;
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  cursor: pointer;
}

.habit-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.check-visual {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1.5px solid #b6c4b9;
  border-radius: 10px;
  background: #fffdf8;
  color: transparent;
  font-size: 15px;
  font-weight: 800;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.habit-check:hover .check-visual {
  border-color: #759683;
  transform: scale(1.06);
}

.habit-check input:focus-visible + .check-visual {
  outline: 3px solid rgba(53, 94, 77, 0.28);
  outline-offset: 3px;
}

.habit-check input:checked + .check-visual {
  border-color: var(--forest);
  background: var(--forest);
  color: #fffdf8;
}

.habit-row.is-complete .check-visual {
  border-color: #858e86;
  background: #858e86;
}

.improvement-row .improvement-check input:checked + .check-visual {
  border-color: #9f5e52;
  background: #9f5e52;
  color: #fffaf7;
}

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

.habit-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 220ms ease;
}

.habit-status {
  display: inline-block;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 11px;
}

.habit-row.is-complete .habit-status {
  color: #8b938c;
}

.star-reward {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid rgba(206, 170, 70, 0.19);
  border-radius: 999px;
  background: #fbf3d8;
  color: #8d742d;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  transition:
    color 220ms ease,
    background 220ms ease;
}

.star-reward span {
  color: #c49b34;
  font-size: 13px;
}

.habit-actions {
  display: flex;
  gap: 2px;
  opacity: 0.72;
  transition: opacity 180ms ease;
}

.habit-actions button {
  min-width: 32px;
  min-height: 32px;
  padding: 5px 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #728078;
  cursor: pointer;
  font-size: 11px;
}

.habit-actions button:hover {
  background: rgba(63, 79, 68, 0.08);
  color: var(--ink);
}

.habit-actions .delete-habit:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state {
  padding: 35px 24px 37px;
  border: 1px dashed rgba(62, 94, 76, 0.22);
  border-radius: 20px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: grid;
  width: 69px;
  height: 69px;
  margin: 0 auto 17px;
  place-items: center;
  border-radius: 50%;
  background: #edf1e8;
}

.empty-star {
  color: var(--gold);
  font-size: 23px;
  transform: translate(9px, -10px) rotate(12deg);
}

.empty-sprout {
  position: absolute;
  bottom: 5px;
  color: #6f947d;
  font-family: Georgia, serif;
  font-size: 43px;
  transform: rotate(-24deg);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}

.empty-state p {
  max-width: 340px;
  margin: 0 auto 17px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.7;
}

.panel-footnote {
  margin: 22px 0 -5px;
  color: #99a198;
  font-size: 10px;
  line-height: 1.6;
}

.calendar-nav {
  display: flex;
  gap: 5px;
}

.icon-button {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 16px;
}

.icon-button:hover:not(:disabled) {
  background: #e9eee7;
  color: var(--ink);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

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

.weekdays {
  margin-bottom: 6px;
}

.weekdays span {
  padding: 4px 0;
  color: #9aa399;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.calendar-grid {
  gap: 5px;
}

.calendar-blank {
  min-height: 42px;
}

.calendar-day {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 42px;
  padding: 4px 0 6px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f4f1e8;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.calendar-day:hover:not(:disabled) {
  z-index: 1;
  transform: translateY(-2px);
}

.calendar-day.full {
  background: var(--forest);
  color: #fffdf5;
}

.calendar-day.partial {
  background: #dce8dd;
  color: #3c6251;
}

.calendar-day.none {
  background: #f2eee5;
  color: #7b897e;
}

.calendar-day.no-habits {
  background: transparent;
  color: #abb1a9;
}

.calendar-day.future {
  background: transparent;
  color: #c5c7c0;
  cursor: default;
}

.calendar-day.is-today::after {
  position: absolute;
  bottom: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.75;
}

.calendar-day.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(215, 184, 103, 0.16);
}

.calendar-day.has-improvement::before {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #a76458;
  box-shadow: 0 0 0 2px rgba(167, 100, 88, 0.12);
  content: "";
}

.calendar-day.full.has-improvement::before {
  background: #f0ce84;
  box-shadow: 0 0 0 2px rgba(240, 206, 132, 0.18);
}

.calendar-day.full.is-selected {
  border-color: var(--gold-soft);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 15px 2px 22px;
  color: #98a094;
  font-size: 9px;
}

.calendar-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot.complete {
  background: var(--forest);
}

.legend-dot.partial {
  background: #adc5b4;
}

.legend-dot.none {
  border: 1px solid #c1bfb3;
}

.legend-dot.improvement {
  background: #a76458;
}

.day-details {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.day-details-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.day-details-heading .section-kicker {
  margin-bottom: 5px;
}

.day-details-heading h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}

.edit-badge {
  display: inline-flex;
  margin-top: 3px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7eee5;
  color: #56725f;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.edit-badge.readonly {
  background: #efede7;
  color: #92988f;
}

.day-summary {
  margin: 14px 0 12px;
  color: var(--ink-faint);
  font-size: 11px;
}

.day-summary strong {
  color: var(--ink-soft);
  font-weight: 750;
}

.day-habit-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.day-section-label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 11px 2px 3px;
  color: #8c978d;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.day-section-label:first-child {
  margin-top: 0;
}

.day-section-label::after {
  height: 1px;
  flex: 1;
  background: rgba(53, 94, 77, 0.08);
  content: "";
}

.day-section-label.improvement {
  color: #a07b72;
}

.day-habit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 39px;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(242, 240, 232, 0.62);
}

.day-habit-row.is-complete {
  color: #838b83;
}

.day-habit-row.is-occurred {
  background: rgba(241, 231, 226, 0.72);
  color: #8e7771;
}

.day-check {
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  cursor: pointer;
}

.day-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.day-check-box {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #bdc7bd;
  border-radius: 6px;
  background: #fffdf6;
  color: transparent;
  font-size: 11px;
  font-weight: 800;
}

.day-check input:checked + .day-check-box {
  border-color: #7f8e83;
  background: #7f8e83;
  color: white;
}

.day-check input:disabled + .day-check-box {
  border-color: #d2d2ca;
  background: #ebeae4;
}

.day-check input:checked:disabled + .day-check-box {
  border-color: #a7ada6;
  background: #a7ada6;
}

.day-habit-row.is-occurred .day-check-box {
  border-color: #cdb5ae;
}

.day-habit-row.is-occurred .day-check input:checked + .day-check-box {
  border-color: #9f675c;
  background: #9f675c;
}

.day-check input:focus-visible + .day-check-box {
  outline: 3px solid rgba(53, 94, 77, 0.25);
  outline-offset: 2px;
}

.day-check.is-readonly {
  cursor: default;
}

.day-habit-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-habit-star {
  color: #ae9760;
  font-size: 9px;
  white-space: nowrap;
}

.day-habit-row.is-occurred .day-habit-star {
  color: #9f695f;
}

.day-archived-tag {
  color: #9b9f98;
  font-size: 8px;
}

.day-empty {
  padding: 14px 4px;
  color: #a3aaa1;
  font-size: 11px;
  line-height: 1.65;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 31px 0 0;
  color: #9da69c;
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.footer-stars {
  color: rgba(184, 155, 73, 0.55);
}

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

.toast {
  max-width: min(350px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid rgba(53, 94, 77, 0.15);
  border-radius: 13px;
  background: rgba(38, 61, 50, 0.96);
  box-shadow: 0 12px 33px rgba(29, 44, 36, 0.2);
  color: #fffdf7;
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 260ms ease both;
}

.toast.is-error {
  background: rgba(130, 64, 56, 0.97);
}

.toast.is-warning {
  background: rgba(126, 82, 62, 0.97);
}

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

.modal,
.ledger-dialog {
  border: 0;
  background: transparent;
}

.modal {
  width: min(470px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border-radius: 25px;
  overflow: visible;
}

.modal::backdrop,
.ledger-dialog::backdrop {
  background: rgba(28, 40, 33, 0.34);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: dialog-in 230ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-card {
  margin: 0;
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 25px;
  background: var(--surface-solid);
  box-shadow: 0 30px 90px rgba(27, 49, 39, 0.24);
}

.modal-heading,
.ledger-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.modal-heading h2,
.ledger-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.dialog-close {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  padding: 0 0 2px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: #7a877d;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 21px;
  line-height: 1;
}

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

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

.field > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: #728075;
  font-size: 11px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid rgba(52, 78, 64, 0.16);
  border-radius: 12px;
  outline: none;
  background: #faf8f2;
  color: var(--ink);
  font-size: 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.field input::placeholder {
  color: #b2b7af;
}

.field input:focus {
  border-color: #759783;
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(80, 121, 98, 0.1);
}

.input-with-suffix {
  display: flex !important;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(52, 78, 64, 0.16);
  border-radius: 12px;
  background: #faf8f2;
}

.input-with-suffix input {
  min-height: 43px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}

.input-with-suffix > span {
  padding-right: 13px;
  color: #8b958c;
  font-size: 11px;
  white-space: nowrap;
}

.form-error {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.delete-message {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.delete-message strong {
  color: var(--ink);
}

.ledger-dialog {
  width: min(440px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  background: #f8f4e9;
  box-shadow: -20px 0 65px rgba(27, 48, 38, 0.18);
}

.ledger-dialog[open] {
  animation: drawer-in 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ledger-shell {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 21px;
  overflow-y: auto;
  padding: 31px clamp(22px, 4vw, 33px) 37px;
  overscroll-behavior: contain;
}

.ledger-heading {
  margin-bottom: 2px;
}

.ledger-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ledger-balance-card {
  position: relative;
  overflow: hidden;
  padding: 20px 21px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 5%, rgba(238, 204, 111, 0.25), transparent 9rem),
    var(--forest);
  color: #f6f0df;
}

.ledger-balance-card.is-negative {
  background:
    radial-gradient(circle at 92% 5%, rgba(245, 204, 172, 0.2), transparent 9rem),
    #704b42;
}

.ledger-balance-card::after {
  position: absolute;
  top: -2.4rem;
  right: -1.8rem;
  width: 7.2rem;
  height: 7.2rem;
  border: 1px solid rgba(255, 250, 231, 0.12);
  border-radius: 50%;
  content: "";
}

.ledger-balance-card > span {
  color: rgba(251, 247, 232, 0.68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ledger-balance-card strong {
  display: block;
  margin-top: 7px;
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
}

.ledger-balance-card small {
  color: #e0d9be;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
}

.ledger-mini-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 0 3px;
  color: #8a948a;
  font-size: 10px;
}

.ledger-mini-stats strong {
  margin-left: 3px;
  color: #5a6a5f;
  font-size: 11px;
}

.ledger-trace-hint {
  margin: 1px 3px 0;
  color: #9b9f96;
  font-size: 9px;
  line-height: 1.6;
}

.balance-adjust-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(184, 155, 73, 0.22);
  border-radius: 12px;
  background: rgba(251, 245, 224, 0.62);
  color: #675e45;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.balance-adjust-button:hover {
  border-color: rgba(184, 155, 73, 0.38);
  background: rgba(248, 239, 208, 0.9);
}

.balance-adjust-button small {
  color: #9a9178;
  font-size: 8px;
  font-weight: 550;
}

.star-stats {
  padding: 18px;
  border: 1px solid rgba(52, 88, 70, 0.1);
  border-radius: 19px;
  background: rgba(255, 253, 247, 0.76);
}

.star-stats-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.star-stats-heading .section-kicker {
  margin-bottom: 5px;
}

.star-stats-heading h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}

.stats-period {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf1e8;
  color: #6d7e70;
  font-size: 8px;
  font-weight: 700;
}

.stats-ranges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 16px;
  padding: 4px;
  border-radius: 11px;
  background: #efede6;
}

.stats-range {
  min-height: 30px;
  padding: 5px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8f978e;
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.stats-range:hover {
  color: var(--ink);
}

.stats-range.is-active {
  background: #fffdf8;
  box-shadow: 0 2px 8px rgba(60, 76, 65, 0.08);
  color: var(--forest);
}

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

.stats-overview-item {
  padding: 10px;
  border-radius: 11px;
  background: #f3f1e9;
}

.stats-overview-item span {
  display: block;
  color: #969e95;
  font-size: 8px;
}

.stats-overview-item strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}

.stats-overview-item.increase strong {
  color: #426d59;
}

.stats-overview-item.decrease strong {
  color: #a05d51;
}

.stats-overview-item.net strong {
  color: #675e45;
}

.stats-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 11px;
}

.stats-list-card {
  padding: 11px;
  border: 1px solid rgba(52, 88, 70, 0.08);
  border-radius: 12px;
  background: #fffdf8;
}

.stats-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.stats-list-heading h4 {
  margin: 0;
  color: #4d6256;
  font-size: 10px;
  font-weight: 750;
}

.stats-list-heading span {
  color: #a5aba3;
  font-size: 8px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stats-item {
  padding: 2px 0;
}

.stats-item-heading {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.stats-item-name {
  min-width: 0;
  overflow: hidden;
  color: #56665c;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-item-value {
  flex: 0 0 auto;
  color: #527262;
  font-size: 9px;
  font-weight: 750;
}

.stats-list-card.decrease .stats-item-value {
  color: #a05d51;
}

.stats-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
}

.stats-category {
  padding: 2px 5px;
  border-radius: 999px;
  background: #eef2e9;
  color: #809083;
  font-size: 7px;
  font-weight: 700;
}

.stats-list-card.decrease .stats-category {
  background: #f4e9e4;
  color: #a17a70;
}

.stats-item-count {
  color: #a5aba3;
  font-size: 7px;
}

.stats-bar-track {
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeee8;
}

.stats-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a8c2af, #507660);
}

.stats-list-card.decrease .stats-bar {
  background: linear-gradient(90deg, #e0b7aa, #a56558);
}

.stats-empty {
  padding: 9px 2px;
  color: #a4aaa2;
  font-size: 9px;
  line-height: 1.6;
}

.stats-caption {
  margin: 10px 1px 0;
  color: #a0a79f;
  font-size: 8px;
  line-height: 1.55;
}

.spend-form {
  padding: 19px;
  border: 1px solid rgba(52, 88, 70, 0.1);
  border-radius: 19px;
  background: rgba(255, 253, 247, 0.78);
}

.balance-dialog {
  width: min(500px, calc(100vw - 32px));
}

.balance-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-radius: 15px;
  background: #f1efe5;
  color: #7f887f;
  font-size: 10px;
}

.balance-editor-summary strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
}

.balance-editor-summary small {
  color: #90978f;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 500;
}

.balance-password-intro {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.password-local-note {
  margin: 15px 0 0;
  color: #a1a79f;
  font-size: 8px;
  line-height: 1.6;
}

.balance-preview {
  margin: 14px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f1f3ea;
  color: #728076;
  font-size: 10px;
  line-height: 1.5;
}

.adjustment-history {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.adjustment-history-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.adjustment-history-heading h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
}

.adjustment-history-heading span {
  color: #a2a8a0;
  font-size: 8px;
}

.adjustment-history-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.adjustment-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f4f1e9;
}

.adjustment-history-item strong {
  display: block;
  overflow: hidden;
  color: #526257;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adjustment-history-item time {
  display: block;
  margin-top: 3px;
  color: #a1a79f;
  font-size: 8px;
}

.adjustment-history-delta {
  align-self: center;
  color: #527262;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.adjustment-history-delta.negative {
  color: #a05d51;
}

.spend-form-heading h3,
.spend-history-heading h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}

.spend-form-heading p {
  margin: 5px 0 0;
  color: #9aa198;
  font-size: 10px;
}

.spend-form .field {
  margin-top: 14px;
}

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

.spend-submit {
  min-height: 45px;
  margin-bottom: 0;
  white-space: nowrap;
}

.spend-form .form-error:empty {
  min-height: 0;
  margin-top: 0;
}

.spend-history {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.spend-history-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.spend-history-heading span {
  color: #9ba39a;
  font-size: 9px;
}

.spend-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.spend-row-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(52, 88, 70, 0.08);
  border-radius: 13px;
  background: rgba(255, 253, 247, 0.66);
}

.spend-item-copy {
  min-width: 0;
}

.spend-item-name {
  display: block;
  overflow: hidden;
  color: #3c5146;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spend-item-time {
  display: block;
  margin-top: 3px;
  color: #a2a9a1;
  font-size: 9px;
}

.spend-item-cost {
  color: #9b7b2e;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.undo-spend {
  min-height: 28px;
  padding: 5px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8c968d;
  cursor: pointer;
  font-size: 9px;
}

.undo-spend:hover {
  background: #efece3;
  color: var(--ink);
}

.spend-empty {
  padding: 23px 15px;
  border: 1px dashed rgba(62, 94, 76, 0.16);
  border-radius: 15px;
  color: #a2a99f;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.storage-error-dialog {
  width: min(480px, calc(100vw - 32px));
}

.flying-star {
  position: fixed;
  z-index: 10001;
  display: grid;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7c8, #d9b459 72%);
  box-shadow:
    0 0 0 5px rgba(223, 192, 101, 0.16),
    0 0 24px rgba(211, 173, 71, 0.42);
  color: #705b20;
  font-size: 17px;
  pointer-events: none;
  will-change: transform, opacity;
}

.flying-star span {
  transform: translateY(-1px);
}

.flying-star.is-negative {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  background: radial-gradient(circle at 35% 30%, #f9d7c7, #a85d50 74%);
  box-shadow:
    0 0 0 5px rgba(168, 93, 80, 0.14),
    0 0 24px rgba(168, 93, 80, 0.36);
  color: #fff7f1;
  font-size: 9px;
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.86) rotate(-8deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) rotate(8deg);
  }
}

@keyframes chest-bump {
  0% {
    transform: scale(1);
  }
  38% {
    transform: scale(1.08) rotate(-2deg);
  }
  70% {
    transform: scale(0.98) rotate(1deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes number-bump {
  0% {
    opacity: 0.55;
    transform: translateY(5px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawer-in {
  from {
    opacity: 0.65;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1110px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.75fr);
  }

  .hero-copy {
    grid-column: 1;
  }

  .progress-card {
    grid-column: 1;
  }

  .treasure-card {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr);
  }
}

@media (max-width: 850px) {
  .app-shell {
    padding-top: 20px;
  }

  .topbar {
    margin-bottom: 34px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.8fr);
  }

  .hero-copy {
    grid-column: 1 / 3;
    padding-bottom: 3px;
  }

  .progress-card {
    min-height: 164px;
  }

  .treasure-card {
    grid-column: 2;
    grid-row: 2;
    min-height: 164px;
  }

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

  .calendar-panel {
    order: 2;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 17px 14px 26px;
  }

  .topbar {
    margin-bottom: 28px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .sound-toggle {
    min-width: 32px;
    min-height: 32px;
    padding: 6px;
    justify-content: center;
  }

  .sound-label {
    display: none;
  }

  .date-chip {
    padding: 8px 11px;
    font-size: 10px;
  }

  .hero {
    display: flex;
    flex-direction: column;
    gap: 13px;
  }

  .hero-copy {
    padding: 0 4px 17px;
  }

  .hero-copy h1 {
    max-width: 330px;
    font-size: clamp(35px, 10.8vw, 46px);
  }

  .hero-description {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.7;
  }

  .progress-card {
    min-height: 137px;
    padding: 20px;
    border-radius: 22px;
  }

  .progress-track {
    margin-top: 23px;
  }

  .progress-message {
    margin-top: 13px;
  }

  .treasure-card {
    grid-template-columns: 1fr 103px;
    grid-template-rows: auto 1fr auto;
    min-height: 155px;
    padding: 20px 16px 15px 21px;
    border-radius: 22px;
  }

  .treasure-visual {
    width: 98px;
  }

  .treasure-balance strong {
    font-size: 48px;
  }

  .panel {
    padding: 20px 15px;
    border-radius: 23px;
  }

  .panel-heading {
    margin-bottom: 18px;
  }

  .panel-heading h2 {
    font-size: 24px;
  }

  .primary-button.compact {
    padding: 9px 11px;
    font-size: 10px;
  }

  .secondary-button.compact {
    padding: 8px 10px;
    font-size: 9px;
  }

  .habit-row {
    grid-template-columns: 33px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 68px;
    padding: 11px 8px 11px 12px;
    border-radius: 15px;
  }

  .habit-check {
    width: 33px;
    height: 33px;
  }

  .check-visual {
    width: 26px;
    height: 26px;
  }

  .habit-name {
    font-size: 14px;
  }

  .habit-actions {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }

  .star-reward {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    padding: 5px 7px;
    font-size: 9px;
  }

  .habit-copy {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .habit-actions button {
    min-width: 27px;
    min-height: 25px;
    padding: 3px 5px;
    font-size: 9px;
  }

  .empty-state {
    padding: 29px 17px 30px;
  }

  .improvement-empty {
    align-items: flex-start;
    padding: 17px;
  }

  .panel-footnote {
    margin-top: 17px;
  }

  .calendar-day,
  .calendar-blank {
    min-height: 39px;
  }

  .calendar-grid {
    gap: 3px;
  }

  .calendar-legend {
    margin-bottom: 19px;
  }

  .day-details-heading h3 {
    font-size: 18px;
  }

  .modal {
    width: calc(100vw - 24px);
  }

  .modal-card {
    padding: 23px 19px;
    border-radius: 22px;
  }

  .modal-heading h2,
  .ledger-heading h2 {
    font-size: 25px;
  }

  .ledger-dialog {
    width: 100vw;
    height: 94dvh;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }

  .ledger-dialog[open] {
    animation-name: sheet-in;
  }

  .ledger-shell {
    padding: 25px 18px max(28px, env(safe-area-inset-bottom));
  }

  .spend-row {
    grid-template-columns: minmax(0, 1fr) 108px;
  }

  .spend-form {
    padding: 16px;
  }

  .star-stats {
    padding: 15px;
  }

  .stats-overview {
    gap: 4px;
  }

  .stats-overview-item {
    padding: 9px 8px;
  }

  .balance-adjust-button {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .page-footer {
    flex-direction: column;
    gap: 7px;
    padding-top: 25px;
  }

  .toast-region {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 14px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

.cloud-toggle.is-connected {
  border-color: rgba(87, 241, 205, 0.3);
  color: #8fe8cf;
}

.cloud-toggle.is-connected .cloud-icon {
  border-color: rgba(91, 242, 205, 0.32);
  color: #74f0ce;
  box-shadow: 0 0 9px rgba(70, 233, 197, 0.2);
}

.cloud-toggle.is-syncing .cloud-icon {
  animation: cloud-icon-pulse 1.05s ease-in-out infinite;
}

.cloud-toggle.is-conflict {
  border-color: rgba(255, 112, 140, 0.3);
  color: #df8c9c;
}

.cloud-toggle.is-conflict .cloud-icon {
  border-color: rgba(255, 120, 145, 0.3);
  color: #ff8ba1;
}

.cloud-toggle.is-unconfigured,
.cloud-toggle.is-offline {
  opacity: 0.72;
}

.cloud-dialog {
  width: min(520px, calc(100vw - 32px));
}

.cloud-status-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 14px 15px;
  border: 1px solid rgba(80, 208, 231, 0.14);
  background: rgba(3, 22, 38, 0.62);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.cloud-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 4px;
  border: 1px solid #547481;
  background: #34515d;
  transform: rotate(45deg);
}

.cloud-status-card.is-connected {
  border-color: rgba(80, 230, 195, 0.22);
}

.cloud-status-card.is-connected .cloud-status-dot {
  border-color: #84f5d7;
  background: #5aeec8;
  box-shadow: 0 0 9px rgba(78, 238, 201, 0.4);
}

.cloud-status-card.is-syncing .cloud-status-dot {
  border-color: #75efff;
  background: #43d8ee;
  animation: cloud-signal-pulse 1s ease-in-out infinite;
}

.cloud-status-card.is-conflict,
.cloud-status-card.is-error {
  border-color: rgba(255, 108, 136, 0.2);
}

.cloud-status-card.is-conflict .cloud-status-dot,
.cloud-status-card.is-error .cloud-status-dot {
  border-color: #ff90a5;
  background: #e96982;
  box-shadow: 0 0 9px rgba(255, 91, 121, 0.32);
}

.cloud-status-card strong {
  display: block;
  color: #cdeff4;
  font-size: 11px;
  font-weight: 650;
}

.cloud-status-card p {
  margin: 4px 0 0;
  color: #587d8a;
  font-size: 9px;
  line-height: 1.6;
}

.cloud-login-form {
  margin-top: 18px;
}

.cloud-form-note {
  margin: 11px 0 0;
  color: #587b88;
  font-size: 8px;
  line-height: 1.65;
}

.cloud-account-panel {
  margin-top: 18px;
}

.cloud-account-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(78, 201, 224, 0.1);
  background: rgba(4, 26, 42, 0.5);
}

.cloud-account-line span {
  color: #557b87;
  font-size: 8px;
}

.cloud-account-line strong {
  overflow: hidden;
  color: #cceff4;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-sync-message {
  min-height: 1.5em;
  margin: 11px 0 0;
  color: #638d99;
  font-size: 9px;
  line-height: 1.6;
}

.cloud-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
}

.cloud-actions .secondary-button {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 8px;
}

.cloud-signout {
  border-color: rgba(255, 112, 140, 0.16);
  color: #b57a86;
}

.cloud-conflict-panel {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(255, 110, 137, 0.18);
  background: rgba(75, 22, 40, 0.22);
}

.cloud-conflict-panel h3 {
  margin: 0;
  color: #f0ced5;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 550;
}

.cloud-conflict-panel > p {
  margin: 7px 0 0;
  color: #8b6871;
  font-size: 9px;
  line-height: 1.65;
}

.cloud-conflict-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 10px;
  background: rgba(2, 13, 24, 0.5);
  color: #6f8991;
  font-size: 8px;
}

.cloud-conflict-stats strong {
  color: #ffd0d9;
  font-size: 10px;
}

@keyframes cloud-signal-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.9) rotate(45deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.12) rotate(45deg);
  }
}

@keyframes cloud-icon-pulse {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (max-width: 600px) {
  .cloud-actions {
    grid-template-columns: 1fr;
  }
}

.cloud-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid rgba(78, 199, 223, 0.11);
  background: rgba(1, 13, 25, 0.62);
}

.cloud-auth-tab {
  min-height: 33px;
  border: 0;
  border-radius: 1px;
  background: transparent;
  color: #5d8794;
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
}

.cloud-auth-tab:hover {
  color: #c9f8ff;
}

.cloud-auth-tab.is-active {
  background: rgba(18, 105, 131, 0.56);
  box-shadow: inset 0 0 10px rgba(91, 233, 252, 0.08);
  color: #d9fcff;
}

.cloud-recovery-form {
  margin-top: 18px;
}

.cloud-recovery-intro {
  margin: 0;
  color: #82aab5;
  font-size: 10px;
  line-height: 1.7;
}

@keyframes sheet-in {
  from {
    opacity: 0.7;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* --------------------------------------------------------------------------
   FUTURE HUD THEME
   Visual-only layer: layout and behavior remain owned by the original rules.
   -------------------------------------------------------------------------- */

:root {
  color-scheme: dark;
  --paper: #020813;
  --paper-deep: #030d1c;
  --surface: rgba(5, 20, 39, 0.86);
  --surface-solid: #061628;
  --ink: #e9fcff;
  --ink-soft: #91b8c7;
  --ink-faint: #5f8496;
  --forest: #23d7ee;
  --forest-deep: #0b9fbe;
  --forest-light: #0b3045;
  --sage: #78dfca;
  --gold: #ffd469;
  --gold-soft: #fff0ba;
  --complete: #081c2b;
  --complete-ink: #64808b;
  --danger: #ff6f88;
  --danger-soft: rgba(152, 39, 68, 0.25);
  --line: rgba(93, 225, 248, 0.18);
  --shadow-soft:
    0 20px 55px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(170, 248, 255, 0.06);
  --shadow-card:
    0 12px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(170, 248, 255, 0.06);
  --radius-lg: 3px;
  --radius-md: 2px;
  --radius-sm: 2px;
  --font-sans:
    "Bahnschrift", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans SC", sans-serif;
  --font-serif:
    "Bahnschrift SemiCondensed", "Microsoft YaHei UI", "Microsoft YaHei",
    sans-serif;
  --hud-cyan: #58ecff;
  --hud-cyan-bright: #c4fbff;
  --hud-blue: #248cff;
  --hud-mint: #62ffd2;
  --hud-rose: #ff728b;
  --hud-panel: rgba(4, 20, 39, 0.82);
  --hud-panel-deep: rgba(2, 12, 26, 0.93);
}

::selection {
  background: rgba(88, 236, 255, 0.28);
  color: #ffffff;
}

html {
  background: var(--paper);
}

body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 10%, rgba(17, 112, 170, 0.22), transparent 31rem),
    radial-gradient(circle at 10% 68%, rgba(6, 90, 119, 0.18), transparent 34rem),
    linear-gradient(150deg, #020711 0%, #041124 52%, #020814 100%);
  color: var(--ink);
  font-family: var(--font-sans);
}

body::before {
  position: fixed;
  z-index: -6;
  inset: 0;
  background-image:
    linear-gradient(rgba(66, 194, 224, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 194, 224, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
  mask-image: radial-gradient(ellipse at center, black 12%, transparent 82%);
  pointer-events: none;
}

body::after {
  position: fixed;
  z-index: 10003;
  inset: 0;
  border: 1px solid rgba(104, 231, 255, 0.08);
  box-shadow:
    inset 0 0 80px rgba(0, 9, 21, 0.9),
    inset 0 0 140px rgba(0, 0, 0, 0.48);
  content: "";
  pointer-events: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #020a15;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #020a15;
  border-radius: 0;
  background: #24556b;
}

::-webkit-scrollbar-thumb:hover {
  background: #2b8ca5;
}

.hud-scene {
  position: fixed;
  z-index: -5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hud-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(105, 228, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 228, 255, 0.055) 1px, transparent 1px);
  background-position: center;
  background-size: 84px 84px;
  mask-image: radial-gradient(circle at 50% 44%, black, transparent 78%);
  opacity: 0.58;
  animation: hud-grid-drift 24s linear infinite;
}

.hud-halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
}

.halo-one {
  top: -14rem;
  right: -12rem;
  width: 45rem;
  height: 45rem;
  background: radial-gradient(circle, rgba(20, 139, 255, 0.17), transparent 67%);
}

.halo-two {
  bottom: -22rem;
  left: -18rem;
  width: 52rem;
  height: 52rem;
  background: radial-gradient(circle, rgba(20, 232, 220, 0.1), transparent 67%);
}

.hud-ring {
  position: absolute;
  border-radius: 50%;
  opacity: 0.42;
}

.ring-one {
  top: 8%;
  right: -12rem;
  width: 35rem;
  height: 35rem;
  border: 1px solid rgba(77, 228, 255, 0.24);
  border-right-color: rgba(33, 151, 255, 0.7);
  border-bottom-color: transparent;
  box-shadow: 0 0 40px rgba(38, 181, 255, 0.06);
  animation: hud-spin 26s linear infinite;
}

.ring-one::before,
.ring-two::before {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.ring-one::before {
  inset: 2.4rem;
  border: 1px dashed rgba(85, 230, 255, 0.21);
}

.ring-two {
  bottom: -8rem;
  left: -9rem;
  width: 23rem;
  height: 23rem;
  border: 1px solid rgba(60, 207, 255, 0.17);
  border-top-color: rgba(90, 255, 223, 0.55);
  animation: hud-spin-reverse 34s linear infinite;
}

.ring-two::before {
  inset: 1.8rem;
  border: 6px dotted rgba(88, 218, 255, 0.08);
}

.hud-axis {
  position: absolute;
  top: 41%;
  left: -10%;
  width: 120%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(78, 218, 255, 0.15), transparent);
}

.hud-axis::after {
  position: absolute;
  top: -3px;
  left: 18%;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(94, 235, 255, 0.3);
  transform: rotate(45deg);
  content: "";
}

.hud-sweep {
  position: absolute;
  top: -20%;
  left: -50%;
  width: 34rem;
  height: 150%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(71, 220, 255, 0.025),
    rgba(87, 244, 255, 0.08),
    transparent
  );
  transform: rotate(14deg);
  animation: hud-screen-sweep 13s ease-in-out infinite;
}

.ambient,
.ambient-star {
  display: none;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.app-shell::before,
.app-shell::after {
  position: fixed;
  width: 44px;
  height: 44px;
  border-color: rgba(87, 234, 255, 0.32);
  border-style: solid;
  content: "";
  pointer-events: none;
}

.app-shell::before {
  top: 18px;
  left: 18px;
  border-width: 1px 0 0 1px;
}

.app-shell::after {
  right: 18px;
  bottom: 18px;
  border-width: 0 1px 1px 0;
}

.topbar {
  position: relative;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(83, 216, 241, 0.14);
}

.topbar::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 86px;
  height: 1px;
  background: var(--hud-cyan);
  box-shadow: 0 0 13px var(--hud-cyan);
  content: "";
}

.brand {
  color: var(--hud-cyan-bright);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.19em;
  text-shadow: 0 0 18px rgba(91, 232, 255, 0.36);
}

.brand-mark {
  width: 30px;
  height: 34px;
  border: 1px solid rgba(126, 244, 255, 0.72);
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(197, 252, 255, 0.18), transparent 52%),
    rgba(7, 44, 67, 0.8);
  box-shadow:
    0 0 17px rgba(76, 224, 255, 0.24),
    inset 0 0 10px rgba(88, 236, 255, 0.13);
  color: var(--gold);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font-size: 12px;
  transform: none;
}

.date-chip,
.sound-toggle {
  border-color: rgba(82, 212, 238, 0.2);
  border-radius: 1px;
  background:
    linear-gradient(90deg, rgba(6, 34, 56, 0.78), rgba(3, 18, 34, 0.52));
  box-shadow: inset 0 0 15px rgba(39, 167, 213, 0.05);
  color: #91c9d8;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.date-dot {
  border-radius: 1px;
  background: var(--hud-cyan);
  box-shadow: 0 0 10px var(--hud-cyan);
  transform: rotate(45deg);
}

.sound-toggle:hover {
  border-color: rgba(102, 240, 255, 0.5);
  background: rgba(10, 48, 72, 0.88);
  color: var(--hud-cyan-bright);
}

.sound-toggle[aria-pressed="false"] {
  color: #5e7c88;
  opacity: 0.7;
}

.sound-icon {
  border: 1px solid rgba(96, 229, 255, 0.28);
  border-radius: 1px;
  background: rgba(27, 123, 157, 0.18);
  color: var(--hud-cyan);
  box-shadow: 0 0 8px rgba(73, 226, 255, 0.17);
}

.sound-toggle[aria-pressed="false"] .sound-icon {
  border-color: rgba(112, 142, 150, 0.2);
  background: rgba(53, 69, 76, 0.25);
  color: #78919a;
}

.hero {
  position: relative;
}

.hero::before {
  position: absolute;
  top: 8%;
  left: 0;
  width: 38px;
  height: 1px;
  background: var(--hud-cyan);
  box-shadow: 0 0 10px rgba(86, 234, 255, 0.7);
  content: "";
}

.hero-copy h1 {
  color: #e9fdff;
  font-family: var(--font-serif);
  font-weight: 550;
  letter-spacing: -0.035em;
  text-shadow:
    0 0 28px rgba(67, 211, 255, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-description {
  color: #78a3b3;
}

.eyebrow,
.section-kicker {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #57dff2;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-shadow: 0 0 10px rgba(69, 222, 246, 0.3);
}

.eyebrow::before,
.section-kicker::before {
  display: inline-block;
  width: 14px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
  content: "";
}

.progress-card,
.treasure-card,
.panel {
  position: relative;
  border: 1px solid rgba(82, 216, 241, 0.2);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(6, 27, 49, 0.9), rgba(2, 13, 28, 0.86));
  box-shadow:
    var(--shadow-soft),
    inset 0 0 38px rgba(19, 117, 158, 0.055);
  clip-path: polygon(
    0 17px,
    17px 0,
    calc(100% - 36px) 0,
    calc(100% - 25px) 11px,
    100% 11px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    15px 100%,
    0 calc(100% - 15px)
  );
  backdrop-filter: blur(17px);
}

.progress-card::before,
.panel::before {
  position: absolute;
  z-index: 4;
  inset: 7px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--hud-cyan), var(--hud-cyan)) left top / 25px 1px no-repeat,
    linear-gradient(var(--hud-cyan), var(--hud-cyan)) left top / 1px 17px no-repeat,
    linear-gradient(var(--hud-cyan), var(--hud-cyan)) right bottom / 25px 1px no-repeat,
    linear-gradient(var(--hud-cyan), var(--hud-cyan)) right bottom / 1px 17px no-repeat;
  content: "";
  opacity: 0.42;
  pointer-events: none;
}

.progress-card::after,
.panel::after {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 11%;
  left: 11%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(105, 240, 255, 0.22), transparent);
  content: "";
  pointer-events: none;
  animation: hud-panel-scan 7s ease-in-out infinite;
}

.progress-card {
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(51, 215, 255, 0.1), transparent 9rem),
    linear-gradient(145deg, rgba(5, 29, 51, 0.92), rgba(2, 13, 27, 0.88));
}

.progress-heading {
  color: #79abba;
  font-size: 11px;
  letter-spacing: 0.09em;
}

.progress-number {
  color: var(--hud-cyan-bright);
}

.progress-number strong {
  color: #e8fdff;
  text-shadow: 0 0 18px rgba(76, 231, 255, 0.32);
}

.progress-divider,
.progress-number > span:last-child {
  color: #4f7987;
}

.progress-track {
  height: 7px;
  border: 1px solid rgba(94, 223, 246, 0.16);
  border-radius: 1px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(70, 188, 214, 0.025) 0,
      rgba(70, 188, 214, 0.025) calc(10% - 1px),
      rgba(110, 229, 247, 0.16) calc(10% - 1px),
      rgba(110, 229, 247, 0.16) 10%
    ),
    rgba(2, 15, 28, 0.9);
  box-shadow: inset 0 0 7px rgba(0, 0, 0, 0.55);
}

.progress-fill {
  border-radius: 0;
  background:
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.16) 0 2px,
      transparent 2px 8px
    ),
    linear-gradient(90deg, #138fbd, #5deeff 68%, #b2fff1);
  box-shadow:
    0 0 7px rgba(69, 230, 255, 0.78),
    0 0 18px rgba(49, 194, 255, 0.28);
}

.progress-message {
  color: #6f95a3;
}

.treasure-card {
  overflow: hidden;
  border-color: rgba(96, 229, 255, 0.28);
  background:
    radial-gradient(circle at 76% 45%, rgba(42, 204, 241, 0.17), transparent 12rem),
    linear-gradient(145deg, rgba(5, 29, 53, 0.95), rgba(2, 12, 27, 0.9));
}

.treasure-card::before {
  top: calc(50% - 110px);
  right: -52px;
  width: 220px;
  height: 220px;
  border: 1px dashed rgba(100, 231, 255, 0.28);
  border-radius: 50%;
  background: transparent;
  box-shadow:
    inset 0 0 0 18px rgba(64, 213, 242, 0.025),
    inset 0 0 0 19px rgba(103, 229, 255, 0.09);
  transform: none;
  animation: hud-spin 22s linear infinite;
}

.treasure-card::after {
  position: absolute;
  z-index: 0;
  top: 13px;
  right: 16px;
  left: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(87, 235, 255, 0.52), transparent);
  content: "";
  box-shadow: 0 0 8px rgba(59, 227, 255, 0.35);
}

.treasure-card:hover {
  border-color: rgba(126, 246, 255, 0.54);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(39, 195, 231, 0.1),
    inset 0 0 34px rgba(24, 139, 178, 0.08);
  transform: translateY(-3px);
}

.treasure-kicker {
  position: relative;
  z-index: 2;
  color: #57dced;
  font-size: 9px;
  letter-spacing: 0.19em;
}

.treasure-visual {
  z-index: 2;
  width: 118px;
}

.treasure-visual svg {
  filter:
    drop-shadow(0 0 11px rgba(72, 227, 255, 0.22))
    drop-shadow(0 10px 16px rgba(0, 0, 0, 0.36));
  animation: treasure-float 4.5s ease-in-out infinite;
}

.treasure-card {
  grid-template-columns: 1fr 118px;
}

.chest-orbit {
  transform-box: fill-box;
  transform-origin: center;
  animation: chest-orbit-spin 8s linear infinite;
}

.chest-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: chest-core-pulse 2.8s ease-in-out infinite;
}

.chest-scan {
  animation: chest-scan-line 3.6s ease-in-out infinite;
}

.treasure-shine {
  color: var(--hud-cyan);
  text-shadow: 0 0 8px var(--hud-cyan);
}

.treasure-balance {
  position: relative;
  z-index: 2;
  color: #f6feff;
}

.treasure-balance strong {
  color: #e9fdff;
  text-shadow:
    0 0 12px rgba(84, 234, 255, 0.24),
    0 0 34px rgba(50, 183, 255, 0.15);
}

.treasure-balance span {
  color: #7196a2;
}

.treasure-action {
  position: relative;
  z-index: 2;
  border-color: rgba(93, 223, 245, 0.22);
  color: #6c97a4;
}

.treasure-card.is-negative {
  border-color: rgba(255, 113, 139, 0.35);
  background:
    radial-gradient(circle at 76% 45%, rgba(255, 74, 117, 0.1), transparent 12rem),
    linear-gradient(145deg, rgba(35, 12, 30, 0.95), rgba(4, 12, 25, 0.92));
}

.treasure-card.is-negative .treasure-balance strong,
.treasure-card.is-negative .treasure-balance span {
  color: #ff8ea1;
  text-shadow: 0 0 14px rgba(255, 91, 121, 0.28);
}

.panel {
  background:
    linear-gradient(145deg, rgba(5, 24, 43, 0.9), rgba(2, 12, 26, 0.87));
}

.panel-heading h2 {
  color: #e4fbff;
  font-family: var(--font-serif);
  font-weight: 550;
  letter-spacing: 0.015em;
  text-shadow: 0 0 20px rgba(70, 216, 255, 0.1);
}

.primary-button {
  border: 1px solid rgba(152, 253, 255, 0.5);
  border-radius: 1px;
  background:
    linear-gradient(90deg, rgba(20, 145, 183, 0.95), rgba(24, 211, 226, 0.93));
  box-shadow:
    0 0 15px rgba(47, 205, 232, 0.18),
    inset 0 0 12px rgba(210, 255, 255, 0.16);
  color: #02141e;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  text-shadow: 0 1px rgba(230, 255, 255, 0.35);
}

.primary-button:hover {
  background: linear-gradient(90deg, #21c3d9, #75f5ff);
  box-shadow:
    0 0 21px rgba(77, 229, 255, 0.31),
    inset 0 0 14px rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.primary-button:disabled {
  filter: grayscale(0.7);
}

.secondary-button {
  border: 1px solid rgba(94, 225, 245, 0.22);
  border-radius: 1px;
  background: rgba(5, 28, 48, 0.5);
  color: #7dc4d2;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.secondary-button:hover {
  border-color: rgba(101, 237, 255, 0.45);
  background: rgba(13, 61, 82, 0.67);
  color: #c2faff;
}

.danger-button {
  border: 1px solid rgba(255, 121, 145, 0.45);
  border-radius: 1px;
  background: rgba(109, 24, 48, 0.55);
  color: #ffb0be;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.danger-button:hover {
  background: rgba(151, 34, 65, 0.72);
  color: #fff;
}

.text-button {
  border-color: rgba(89, 224, 245, 0.34);
  color: var(--hud-cyan);
}

.icon-button {
  border-color: rgba(88, 221, 243, 0.2);
  border-radius: 1px;
  background: rgba(5, 29, 49, 0.48);
  color: #79c7d5;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.icon-button:hover:not(:disabled) {
  border-color: rgba(99, 237, 255, 0.45);
  background: rgba(16, 70, 90, 0.68);
  color: #e4fdff;
  box-shadow: 0 0 13px rgba(54, 213, 237, 0.12);
}

.habit-list,
.improvement-list {
  gap: 8px;
}

.habit-row {
  position: relative;
  min-height: 68px;
  border: 1px solid rgba(73, 195, 221, 0.16);
  border-left-color: rgba(80, 227, 250, 0.37);
  border-radius: 1px;
  background:
    linear-gradient(90deg, rgba(5, 29, 49, 0.9), rgba(4, 20, 37, 0.7));
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  box-shadow: inset 0 0 20px rgba(32, 148, 185, 0.035);
}

.habit-row::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 1px;
  background: rgba(96, 235, 255, 0.62);
  box-shadow: 0 0 8px rgba(88, 233, 255, 0.54);
  content: "";
}

.habit-row:hover {
  border-color: rgba(83, 222, 247, 0.32);
  background: linear-gradient(90deg, rgba(7, 38, 62, 0.94), rgba(4, 23, 41, 0.78));
  transform: translateX(2px);
}

.habit-row.is-complete {
  border-color: rgba(68, 153, 172, 0.12);
  border-left-color: rgba(67, 158, 178, 0.2);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(56, 138, 157, 0.022) 0 5px,
      transparent 5px 11px
    ),
    rgba(3, 17, 29, 0.74);
  color: #5d7b86;
}

.habit-row.is-complete::before {
  background: #355b67;
  box-shadow: none;
}

.habit-row.is-complete .habit-name {
  color: #688793;
}

.habit-row.is-complete .habit-status {
  color: #4e6e79;
}

.habit-name {
  color: #dff9fd;
  font-weight: 620;
  letter-spacing: 0.025em;
}

.habit-status {
  color: #678b98;
}

.habit-check {
  width: 34px;
  height: 34px;
}

.check-visual {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(92, 213, 236, 0.32);
  border-radius: 1px;
  background: rgba(1, 13, 26, 0.72);
  box-shadow: inset 0 0 8px rgba(42, 168, 203, 0.08);
  color: transparent;
  clip-path: polygon(24% 0, 76% 0, 100% 24%, 100% 76%, 76% 100%, 24% 100%, 0 76%, 0 24%);
}

.habit-check:hover .check-visual {
  border-color: rgba(111, 245, 255, 0.72);
  box-shadow:
    0 0 10px rgba(61, 224, 252, 0.2),
    inset 0 0 9px rgba(42, 204, 234, 0.12);
  transform: scale(1.06);
}

.habit-check input:checked + .check-visual {
  border-color: #70f0ff;
  background: rgba(24, 171, 198, 0.82);
  box-shadow:
    0 0 12px rgba(79, 237, 255, 0.35),
    inset 0 0 10px rgba(222, 255, 255, 0.2);
  color: #01131d;
  animation: hud-check-pulse 500ms ease-out;
}

.habit-row.is-complete .check-visual {
  border-color: #3d6976;
  background: #183a49;
  box-shadow: none;
  color: #8fb3bc;
}

.star-reward {
  border: 1px solid rgba(255, 206, 92, 0.2);
  border-radius: 1px;
  background: rgba(94, 65, 13, 0.18);
  color: #f4cf71;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.star-reward span {
  color: #ffd76b;
  text-shadow: 0 0 7px rgba(255, 205, 90, 0.35);
}

.habit-row.is-complete .star-reward {
  border-color: rgba(94, 130, 138, 0.1);
  background: rgba(44, 77, 85, 0.16);
  color: #587985;
}

.habit-row.is-complete .star-reward span {
  color: #5f818b;
  text-shadow: none;
}

.habit-actions {
  opacity: 0.6;
}

.habit-actions button {
  color: #5d8592;
}

.habit-actions button:hover {
  background: rgba(45, 146, 174, 0.14);
  color: #b8f8ff;
}

.habit-actions .delete-habit:hover {
  background: rgba(152, 35, 70, 0.2);
  color: #ff9bae;
}

.empty-state {
  border: 1px dashed rgba(80, 211, 237, 0.2);
  border-radius: 1px;
  background:
    linear-gradient(rgba(68, 190, 221, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 190, 221, 0.03) 1px, transparent 1px);
  background-size: 22px 22px;
}

.empty-illustration {
  border: 1px solid rgba(92, 229, 250, 0.22);
  border-radius: 50%;
  background: rgba(15, 85, 111, 0.2);
  box-shadow:
    0 0 28px rgba(44, 202, 232, 0.09),
    inset 0 0 18px rgba(40, 204, 234, 0.08);
}

.empty-star {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 213, 102, 0.35);
}

.empty-sprout {
  color: var(--hud-cyan);
  text-shadow: 0 0 10px rgba(76, 230, 255, 0.3);
}

.empty-state h3 {
  color: #dffcff;
  font-family: var(--font-serif);
}

.empty-state p,
.panel-footnote,
.improvement-intro {
  color: #638795;
}

.improvement-panel {
  border-color: rgba(255, 108, 135, 0.13);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 70, 112, 0.06), transparent 14rem),
    linear-gradient(145deg, rgba(20, 17, 38, 0.92), rgba(3, 14, 28, 0.9));
}

.improvement-panel::before {
  background:
    linear-gradient(var(--hud-rose), var(--hud-rose)) left top / 25px 1px no-repeat,
    linear-gradient(var(--hud-rose), var(--hud-rose)) left top / 1px 17px no-repeat,
    linear-gradient(var(--hud-rose), var(--hud-rose)) right bottom / 25px 1px no-repeat,
    linear-gradient(var(--hud-rose), var(--hud-rose)) right bottom / 1px 17px no-repeat;
  opacity: 0.3;
}

.improvement-intro {
  padding: 8px 10px;
  border-left: 1px solid rgba(255, 113, 139, 0.34);
  background: rgba(127, 35, 63, 0.08);
}

.improvement-add {
  border-color: rgba(255, 118, 144, 0.26);
  color: #df93a1;
}

.improvement-add:hover {
  border-color: rgba(255, 136, 158, 0.44);
  background: rgba(108, 30, 55, 0.24);
  color: #ffc4cf;
}

.improvement-row {
  border-color: rgba(255, 112, 138, 0.12);
  border-left-color: rgba(255, 112, 138, 0.32);
  background: linear-gradient(90deg, rgba(35, 20, 39, 0.82), rgba(7, 18, 32, 0.7));
}

.improvement-row::before {
  background: rgba(255, 109, 137, 0.64);
  box-shadow: 0 0 8px rgba(255, 81, 116, 0.38);
}

.improvement-row:hover {
  border-color: rgba(255, 121, 145, 0.3);
  background: linear-gradient(90deg, rgba(48, 24, 45, 0.9), rgba(8, 21, 37, 0.8));
}

.improvement-row.is-occurred {
  border-color: rgba(255, 105, 132, 0.1);
  border-left-color: rgba(255, 105, 132, 0.24);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(170, 49, 78, 0.026) 0 5px,
      transparent 5px 11px
    ),
    rgba(24, 13, 29, 0.74);
}

.improvement-row.is-occurred .habit-name {
  color: #bd8591;
}

.improvement-row.is-occurred .habit-status {
  color: #835e68;
}

.improvement-row .check-visual {
  border-color: rgba(255, 126, 150, 0.3);
}

.improvement-check input:checked + .check-visual,
.improvement-row .improvement-check input:checked + .check-visual {
  border-color: rgba(255, 120, 145, 0.72);
  background: rgba(153, 45, 70, 0.82);
  box-shadow:
    0 0 12px rgba(255, 81, 115, 0.28),
    inset 0 0 9px rgba(255, 208, 218, 0.12);
  color: #ffedf0;
}

.penalty-badge {
  border-color: rgba(255, 115, 140, 0.2);
  background: rgba(130, 32, 59, 0.17);
  color: #ff97aa;
}

.penalty-badge span {
  color: #ff8097;
  text-shadow: 0 0 7px rgba(255, 99, 127, 0.35);
}

.improvement-row.is-occurred .penalty-badge {
  border-color: rgba(255, 126, 150, 0.08);
  background: rgba(77, 36, 49, 0.2);
  color: #966c76;
}

.improvement-row.is-occurred .penalty-badge span {
  color: #9b6d78;
  text-shadow: none;
}

.improvement-empty {
  border: 1px dashed rgba(255, 112, 138, 0.17);
  border-radius: 1px;
  background:
    linear-gradient(rgba(255, 104, 135, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 104, 135, 0.025) 1px, transparent 1px);
  background-size: 20px 20px;
}

.improvement-empty-mark {
  border: 1px solid rgba(255, 120, 144, 0.24);
  border-radius: 50%;
  background: rgba(115, 31, 57, 0.2);
  color: #e18a9a;
}

.improvement-empty h3 {
  color: #e0c3c9;
}

.improvement-empty p {
  color: #7c626b;
}

.weekdays span {
  color: #517b8b;
  letter-spacing: 0.12em;
}

.calendar-grid {
  gap: 4px;
}

.calendar-day {
  min-height: 41px;
  border: 1px solid rgba(78, 200, 226, 0.09);
  border-radius: 1px;
  background: rgba(7, 28, 47, 0.52);
  color: #87b5c2;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.calendar-day:hover:not(:disabled) {
  border-color: rgba(96, 232, 251, 0.38);
  background: rgba(12, 50, 72, 0.72);
  box-shadow: 0 0 12px rgba(53, 214, 239, 0.1);
}

.calendar-day.partial {
  border-color: rgba(91, 225, 245, 0.22);
  background: rgba(13, 73, 91, 0.64);
  color: #8eeef5;
}

.calendar-day.full {
  border-color: rgba(121, 247, 255, 0.5);
  background:
    linear-gradient(145deg, rgba(20, 149, 174, 0.9), rgba(12, 87, 116, 0.86));
  box-shadow:
    0 0 11px rgba(65, 221, 244, 0.16),
    inset 0 0 10px rgba(183, 252, 255, 0.11);
  color: #f0ffff;
}

.calendar-day.none {
  background: rgba(8, 29, 48, 0.42);
  color: #668b98;
}

.calendar-day.no-habits {
  border-color: transparent;
  background: rgba(5, 19, 34, 0.22);
  color: #436674;
}

.calendar-day.future {
  border-color: transparent;
  background: transparent;
  color: #304d5b;
}

.calendar-day.is-selected {
  z-index: 2;
  border-color: #c7fcff;
  box-shadow:
    0 0 0 1px rgba(103, 237, 255, 0.18),
    0 0 15px rgba(65, 229, 255, 0.3);
}

.calendar-day.full.is-selected {
  border-color: #d6feff;
}

.calendar-day.is-today::after {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  transform: rotate(45deg);
}

.calendar-day.has-improvement::before {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--hud-rose);
  box-shadow: 0 0 7px rgba(255, 94, 126, 0.7);
  transform: rotate(45deg);
}

.calendar-day.full.has-improvement::before {
  background: #ffced8;
  box-shadow: 0 0 8px rgba(255, 195, 208, 0.7);
}

.calendar-legend {
  color: #517987;
  letter-spacing: 0.03em;
}

.legend-dot {
  border-radius: 1px;
  transform: rotate(45deg);
}

.legend-dot.complete {
  background: var(--hud-cyan);
  box-shadow: 0 0 5px rgba(81, 234, 255, 0.42);
}

.legend-dot.partial {
  background: #477b85;
}

.legend-dot.none {
  border-color: #446773;
}

.legend-dot.improvement {
  background: var(--hud-rose);
  box-shadow: 0 0 5px rgba(255, 100, 130, 0.38);
}

.day-details {
  border-top-color: rgba(84, 207, 230, 0.11);
}

.day-details-heading h3 {
  color: #e2fbff;
  font-family: var(--font-serif);
}

.edit-badge {
  border: 1px solid rgba(91, 227, 246, 0.16);
  border-radius: 1px;
  background: rgba(10, 65, 78, 0.39);
  color: #7cd8df;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.edit-badge.readonly {
  border-color: rgba(96, 124, 132, 0.11);
  background: rgba(47, 65, 72, 0.18);
  color: #59757d;
}

.day-summary {
  color: #638b98;
}

.day-summary strong {
  color: #b9edf1;
}

.day-section-label {
  color: #5b8b98;
}

.day-section-label::after {
  background: linear-gradient(90deg, rgba(82, 213, 236, 0.18), transparent);
}

.day-section-label.improvement {
  color: #ae7180;
}

.day-habit-row {
  border: 1px solid rgba(73, 190, 214, 0.08);
  border-radius: 1px;
  background: rgba(5, 24, 41, 0.5);
}

.day-habit-row.is-complete {
  background: rgba(3, 17, 28, 0.56);
  color: #5b7a85;
}

.day-habit-row.is-occurred {
  border-color: rgba(255, 104, 134, 0.1);
  background: rgba(47, 21, 38, 0.45);
  color: #97727c;
}

.day-check-box {
  border-color: rgba(85, 202, 223, 0.25);
  border-radius: 1px;
  background: rgba(1, 14, 26, 0.8);
  clip-path: polygon(20% 0, 80% 0, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0 80%, 0 20%);
}

.day-check input:checked + .day-check-box {
  border-color: #6be7f4;
  background: #1e8fa5;
  color: #00121b;
}

.day-habit-row.is-occurred .day-check input:checked + .day-check-box {
  border-color: #ff92a8;
  background: #a4425b;
}

.day-habit-star {
  color: #d4b566;
}

.day-habit-row.is-occurred .day-habit-star {
  color: #b37581;
}

.day-archived-tag {
  color: #5e7780;
}

.page-footer {
  color: #436875;
  font-family: var(--font-sans);
  letter-spacing: 0.12em;
}

.footer-stars {
  color: rgba(92, 229, 255, 0.36);
}

.toast {
  border: 1px solid rgba(99, 231, 250, 0.26);
  border-radius: 1px;
  background: rgba(4, 27, 43, 0.96);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(40, 198, 225, 0.08);
  color: #d9fbff;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.toast.is-error {
  border-color: rgba(255, 112, 137, 0.3);
  background: rgba(67, 16, 35, 0.96);
}

.toast.is-warning {
  border-color: rgba(255, 147, 112, 0.26);
  background: rgba(59, 29, 29, 0.96);
}

.modal::backdrop,
.ledger-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 45%, rgba(12, 77, 111, 0.16), transparent 28rem),
    rgba(0, 5, 12, 0.76);
  backdrop-filter: blur(7px);
}

.modal-card {
  border: 1px solid rgba(82, 221, 243, 0.28);
  border-radius: 2px;
  background:
    radial-gradient(circle at 90% 4%, rgba(28, 158, 200, 0.1), transparent 16rem),
    linear-gradient(145deg, rgba(5, 25, 45, 0.98), rgba(2, 12, 25, 0.99));
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.62),
    0 0 24px rgba(47, 203, 232, 0.08),
    inset 0 0 60px rgba(20, 113, 154, 0.055);
  clip-path: polygon(
    0 16px,
    16px 0,
    calc(100% - 34px) 0,
    calc(100% - 24px) 10px,
    100% 10px,
    100% calc(100% - 16px),
    calc(100% - 16px) 100%,
    12px 100%,
    0 calc(100% - 12px)
  );
}

.modal-card::before {
  position: absolute;
  top: 10px;
  right: 16px;
  left: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 237, 255, 0.32), transparent);
  content: "";
  pointer-events: none;
}

.modal-heading h2,
.ledger-heading h2 {
  color: #ebfdff;
  font-family: var(--font-serif);
  font-weight: 550;
}

.dialog-close {
  border-color: rgba(90, 216, 239, 0.22);
  border-radius: 1px;
  background: rgba(8, 38, 57, 0.45);
  color: #81cbd7;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

.dialog-close:hover {
  border-color: rgba(109, 242, 255, 0.48);
  background: rgba(15, 69, 86, 0.7);
  color: #f2ffff;
}

.field > span:first-child {
  color: #79a6b2;
  letter-spacing: 0.06em;
}

.field input {
  border: 1px solid rgba(82, 210, 235, 0.17);
  border-radius: 1px;
  background: rgba(1, 13, 25, 0.74);
  color: #e3fcff;
}

.field input::placeholder {
  color: #436876;
}

.field input:focus {
  border-color: rgba(100, 237, 255, 0.55);
  background: rgba(4, 23, 38, 0.9);
  box-shadow:
    0 0 0 2px rgba(55, 212, 238, 0.08),
    0 0 15px rgba(38, 185, 216, 0.08);
}

.input-with-suffix {
  border-color: rgba(82, 210, 235, 0.17);
  border-radius: 1px;
  background: rgba(1, 13, 25, 0.74);
}

.input-with-suffix > span {
  color: #58808d;
}

.form-error {
  color: #ff92a5;
}

.delete-message {
  color: #87a9b4;
}

.delete-message strong {
  color: #e3fbff;
}

.ledger-dialog {
  border-left: 1px solid rgba(86, 226, 247, 0.28);
  background:
    radial-gradient(circle at 100% 0, rgba(25, 135, 181, 0.17), transparent 23rem),
    linear-gradient(155deg, #041426, #020b17);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.55);
}

.ledger-shell {
  position: relative;
  background:
    linear-gradient(rgba(75, 205, 231, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 205, 231, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
}

.ledger-shell::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 1px;
  background: linear-gradient(transparent, rgba(75, 226, 248, 0.22), transparent);
  content: "";
  pointer-events: none;
}

.ledger-balance-card {
  border: 1px solid rgba(98, 235, 255, 0.24);
  border-radius: 1px;
  background:
    linear-gradient(115deg, rgba(10, 95, 122, 0.86), rgba(6, 35, 59, 0.94));
  box-shadow:
    0 0 20px rgba(38, 192, 220, 0.08),
    inset 0 0 28px rgba(53, 225, 244, 0.055);
  color: #e6fcff;
  clip-path: polygon(0 10px, 10px 0, calc(100% - 24px) 0, calc(100% - 14px) 10px, 100% 10px, 100% 100%, 0 100%);
}

.ledger-balance-card::after {
  border-color: rgba(122, 244, 255, 0.17);
}

.ledger-balance-card > span,
.ledger-balance-card small {
  color: #83c0cb;
}

.ledger-balance-card.is-negative {
  border-color: rgba(255, 112, 140, 0.27);
  background:
    linear-gradient(115deg, rgba(100, 31, 54, 0.9), rgba(28, 13, 29, 0.96));
}

.ledger-mini-stats {
  color: #577c89;
}

.ledger-mini-stats strong {
  color: #8fc5cf;
}

.ledger-trace-hint {
  color: #4f7280;
}

.balance-adjust-button {
  border: 1px solid rgba(255, 210, 101, 0.18);
  border-radius: 1px;
  background: rgba(86, 65, 18, 0.15);
  color: #d9bf7a;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.balance-adjust-button:hover {
  border-color: rgba(255, 218, 122, 0.4);
  background: rgba(111, 80, 20, 0.25);
}

.balance-adjust-button small {
  color: #7e745a;
}

.star-stats,
.spend-form {
  border: 1px solid rgba(77, 207, 231, 0.15);
  border-radius: 1px;
  background:
    linear-gradient(145deg, rgba(5, 27, 47, 0.84), rgba(2, 14, 27, 0.78));
  box-shadow: inset 0 0 25px rgba(30, 137, 170, 0.035);
  clip-path: polygon(0 10px, 10px 0, calc(100% - 18px) 0, calc(100% - 10px) 8px, 100% 8px, 100% 100%, 0 100%);
}

.star-stats-heading h3,
.spend-form-heading h3,
.spend-history-heading h3 {
  color: #dffbff;
  font-family: var(--font-serif);
  font-weight: 550;
}

.stats-period {
  border: 1px solid rgba(84, 221, 243, 0.15);
  border-radius: 1px;
  background: rgba(11, 66, 82, 0.3);
  color: #7acbd7;
}

.stats-ranges {
  border: 1px solid rgba(74, 194, 218, 0.1);
  border-radius: 1px;
  background: rgba(1, 13, 25, 0.67);
}

.stats-range {
  border-radius: 1px;
  color: #5e8794;
}

.stats-range:hover {
  color: #c7f8ff;
}

.stats-range.is-active {
  background: rgba(20, 104, 130, 0.62);
  box-shadow:
    0 0 11px rgba(41, 190, 215, 0.1),
    inset 0 0 9px rgba(90, 230, 247, 0.08);
  color: #d9fcff;
}

.stats-overview-item {
  border: 1px solid rgba(73, 189, 213, 0.07);
  border-radius: 1px;
  background: rgba(3, 18, 32, 0.62);
}

.stats-overview-item span {
  color: #527884;
}

.stats-overview-item.increase strong {
  color: #6ff3df;
  text-shadow: 0 0 11px rgba(56, 220, 201, 0.17);
}

.stats-overview-item.decrease strong {
  color: #ff8b9f;
}

.stats-overview-item.net strong {
  color: #d9faff;
}

.stats-list-card {
  border-color: rgba(75, 194, 217, 0.1);
  border-radius: 1px;
  background: rgba(3, 18, 32, 0.61);
}

.stats-list-heading h4 {
  color: #9cd0d8;
}

.stats-list-heading span,
.stats-item-count,
.stats-caption {
  color: #4f7280;
}

.stats-item-name {
  color: #b8e2e8;
}

.stats-item-value {
  color: #62e5d0;
}

.stats-list-card.decrease .stats-item-value {
  color: #ff8298;
}

.stats-category {
  background: rgba(16, 73, 85, 0.42);
  color: #6eb3be;
}

.stats-list-card.decrease .stats-category {
  background: rgba(99, 31, 51, 0.35);
  color: #bf7b88;
}

.stats-bar-track {
  background: rgba(45, 83, 94, 0.22);
}

.stats-bar {
  background: linear-gradient(90deg, #147a94, #64efff);
  box-shadow: 0 0 7px rgba(65, 227, 250, 0.2);
}

.stats-list-card.decrease .stats-bar {
  background: linear-gradient(90deg, #8f3852, #ff758d);
  box-shadow: 0 0 7px rgba(255, 91, 123, 0.16);
}

.stats-empty {
  color: #4f7280;
}

.spend-form-heading p {
  color: #527784;
}

.spend-row-item {
  border-color: rgba(75, 194, 217, 0.08);
  border-radius: 1px;
  background: rgba(3, 19, 33, 0.63);
}

.spend-item-name {
  color: #b9e4e9;
}

.spend-item-time {
  color: #4e7180;
}

.spend-item-cost {
  color: #ffd06c;
}

.undo-spend {
  border: 1px solid rgba(83, 210, 233, 0.1);
  border-radius: 1px;
  color: #6395a1;
}

.undo-spend:hover {
  border-color: rgba(83, 220, 241, 0.25);
  background: rgba(13, 59, 77, 0.4);
  color: #c7faff;
}

.spend-empty {
  border-color: rgba(74, 193, 215, 0.12);
  border-radius: 1px;
  color: #4f7380;
}

.balance-editor-summary {
  border: 1px solid rgba(82, 218, 241, 0.11);
  border-radius: 1px;
  background: rgba(4, 26, 44, 0.64);
  color: #628894;
}

.balance-editor-summary strong {
  color: #dffbff;
}

.balance-editor-summary small {
  color: #5f8590;
}

.balance-password-intro {
  color: #8cb1bd;
}

.password-local-note {
  color: #4f7280;
}

.balance-preview {
  border: 1px solid rgba(90, 219, 239, 0.09);
  border-radius: 1px;
  background: rgba(8, 45, 60, 0.34);
  color: #80afb9;
}

.adjustment-history {
  border-top-color: rgba(80, 204, 226, 0.12);
}

.adjustment-history-heading h3 {
  color: #c8eef3;
}

.adjustment-history-heading span {
  color: #4e7180;
}

.adjustment-history-item {
  border: 1px solid rgba(76, 194, 217, 0.07);
  border-radius: 1px;
  background: rgba(3, 18, 32, 0.55);
}

.adjustment-history-item strong {
  color: #a8d8df;
}

.adjustment-history-item time {
  color: #4e7180;
}

.adjustment-history-delta {
  color: #67ebd5;
}

.adjustment-history-delta.negative {
  color: #ff8298;
}

.flying-star {
  border: 1px solid rgba(255, 238, 176, 0.72);
  border-radius: 2px;
  background:
    radial-gradient(circle at 34% 28%, #fffce4, #ffd76b 56%, #c58f24 100%);
  box-shadow:
    0 0 0 4px rgba(255, 213, 100, 0.1),
    0 0 20px rgba(255, 205, 78, 0.55),
    0 0 38px rgba(83, 230, 255, 0.18);
  color: #46320a;
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
}

.flying-star.is-negative {
  border-color: rgba(255, 188, 202, 0.64);
  background: radial-gradient(circle at 34% 28%, #ffe1e7, #ff718d 62%, #891e3d);
  box-shadow:
    0 0 0 4px rgba(255, 96, 128, 0.09),
    0 0 22px rgba(255, 79, 116, 0.42);
  color: #fff8fa;
}

.storage-error-dialog .modal-card {
  border-color: rgba(255, 110, 136, 0.26);
}

@keyframes hud-grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 84px 84px, 84px 84px;
  }
}

@keyframes hud-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes hud-spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes hud-screen-sweep {
  0%,
  100% {
    opacity: 0.3;
    transform: translateX(-18vw) rotate(14deg);
  }
  50% {
    opacity: 0.8;
    transform: translateX(82vw) rotate(14deg);
  }
}

@keyframes hud-panel-scan {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 0.9;
    transform: translateY(3px);
  }
}

@keyframes hud-check-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(101, 242, 255, 0.6);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(101, 242, 255, 0);
  }
}

@keyframes treasure-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes chest-orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes chest-core-pulse {
  0%,
  100% {
    opacity: 0.82;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes chest-scan-line {
  0%,
  100% {
    opacity: 0.12;
    transform: translateY(0);
  }
  50% {
    opacity: 0.65;
    transform: translateY(34px);
  }
}

@media (max-width: 850px) {
  .hud-ring {
    opacity: 0.2;
  }

  .ring-one {
    right: -19rem;
  }
}

@media (max-width: 600px) {
  body::before {
    background-size: 36px 36px;
  }

  .hud-grid {
    background-size: 52px 52px;
  }

  .hud-sweep {
    opacity: 0.45;
  }

  .app-shell::before,
  .app-shell::after {
    width: 24px;
    height: 24px;
  }

  .topbar {
    padding-bottom: 13px;
  }

  .date-chip,
  .sound-toggle {
    clip-path: none;
  }

  .progress-card,
  .treasure-card,
  .panel,
  .modal-card {
    clip-path: polygon(
      0 12px,
      12px 0,
      calc(100% - 20px) 0,
      calc(100% - 12px) 8px,
      100% 8px,
      100% calc(100% - 12px),
      calc(100% - 12px) 100%,
      10px 100%,
      0 calc(100% - 10px)
    );
  }

  .progress-card::before,
  .panel::before {
    inset: 5px;
  }

  .treasure-card::before {
    top: calc(50% - 95px);
    right: -70px;
    width: 190px;
    height: 190px;
  }

  .treasure-card {
    grid-template-columns: 1fr 104px;
  }

  .treasure-visual {
    width: 104px;
  }

  .habit-row {
    min-height: 66px;
  }

  .calendar-day {
    min-height: 37px;
  }

  .ledger-dialog {
    border-top: 1px solid rgba(86, 226, 247, 0.28);
    border-left-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hud-grid,
  .hud-ring,
  .hud-sweep,
  .treasure-card::before,
  .treasure-visual svg,
  .chest-orbit,
  .chest-core,
  .chest-scan,
  .progress-card::after,
  .panel::after {
    animation: none !important;
  }
}

.data-transfer-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(77, 206, 230, 0.12);
  background: rgba(3, 20, 35, 0.58);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.data-transfer-copy {
  min-width: 0;
}

.data-transfer-copy h3 {
  margin: 0;
  color: #a8d9e0;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 600;
}

.data-transfer-copy p {
  margin: 3px 0 0;
  color: #507582;
  font-size: 8px;
  line-height: 1.5;
}

.data-transfer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  gap: 5px;
  flex: 0 0 auto;
}

.data-transfer-actions .secondary-button {
  min-height: 29px;
  padding: 5px 9px;
  font-size: 8px;
}

.import-data-dialog {
  width: min(520px, calc(100vw - 32px));
}

.import-file-name {
  margin: -5px 0 15px;
  padding: 8px 10px;
  overflow: hidden;
  border-left: 1px solid rgba(91, 229, 248, 0.3);
  background: rgba(8, 46, 63, 0.3);
  color: #79afbb;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.import-preview-item {
  padding: 10px;
  border: 1px solid rgba(78, 200, 224, 0.09);
  background: rgba(3, 20, 35, 0.55);
}

.import-preview-item span {
  display: block;
  color: #527783;
  font-size: 8px;
}

.import-preview-item strong {
  display: block;
  margin-top: 5px;
  color: #d9fbff;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 550;
}

.import-warning {
  margin: 16px 0 0;
  padding: 10px 11px;
  border-left: 1px solid rgba(255, 200, 92, 0.4);
  background: rgba(100, 71, 13, 0.13);
  color: #b89f63;
  font-size: 9px;
  line-height: 1.7;
}

.import-data-dialog .form-error:empty {
  min-height: 0;
  margin-top: 0;
}

@media (max-width: 600px) {
  .data-transfer-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .data-transfer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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