:root {
  --bg: #e9ede8;
  --surface: #f7f7f3;
  --surface-strong: #ffffff;
  --surface-muted: #eef1ec;
  --ink: #17211d;
  --ink-soft: #4c5b54;
  --ink-muted: #7c8882;
  --line: #dfe4df;
  --line-strong: #cfd6d1;
  --green: #1d3b31;
  --green-deep: #142d25;
  --green-soft: #dce9e1;
  --green-bright: #2f795f;
  --coral: #ee765d;
  --coral-soft: #fbe7e1;
  --yellow: #f3c85f;
  --yellow-soft: #fbf1d2;
  --blue: #6884cf;
  --blue-soft: #e8edfa;
  --danger: #bd4d40;
  --shadow-sm: 0 2px 8px rgba(29, 49, 41, 0.05);
  --shadow-md: 0 16px 46px rgba(26, 47, 39, 0.1);
  --radius: 8px;
  --sidebar-width: 232px;
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(29, 59, 49, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(29, 59, 49, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  border: 0;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(104, 132, 207, 0.52);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: min(1440px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(21, 48, 39, 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
  padding: 30px 20px 24px;
  overflow: hidden;
  color: #fff;
  background: var(--green);
}

.sidebar::before {
  position: absolute;
  top: -100px;
  left: -110px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(255, 255, 255, 0.025),
    0 0 0 96px rgba(255, 255, 255, 0.018);
  content: "";
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--green-deep);
  background: var(--yellow);
  border-radius: 50%;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.brand strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.17em;
}

.side-nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-top: 58px;
}

.nav-item {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  border-radius: 7px;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.nav-item.is-active::after {
  width: 4px;
  height: 18px;
  margin-left: auto;
  background: var(--yellow);
  border-radius: 8px;
  content: "";
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item span {
  font-size: 14px;
  font-weight: 600;
}

.side-quote {
  position: relative;
  margin-top: auto;
  padding: 22px 15px 8px;
  color: rgba(255, 255, 255, 0.62);
}

.quote-mark {
  position: absolute;
  top: -24px;
  left: 6px;
  color: var(--yellow);
  font-family: Georgia, serif;
  font-size: 64px;
  line-height: 1;
  opacity: 0.8;
}

.side-quote p {
  position: relative;
  margin: 0;
  font-family: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.quote-line {
  display: block;
  width: 30px;
  height: 1px;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.24);
}

.settings-link {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.settings-link svg {
  width: 17px;
  height: 17px;
}

.content {
  min-width: 0;
  padding: 0 40px 50px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.topbar-date {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.dot {
  width: 3px;
  height: 3px;
  background: var(--ink-muted);
  border-radius: 50%;
}

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

.local-badge {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 8px 11px;
  color: var(--ink-muted);
  font-size: 11px;
  background: var(--surface-muted);
  border-radius: 100px;
}

.local-dot {
  width: 6px;
  height: 6px;
  background: #5a9b79;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(90, 155, 121, 0.14);
}

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

.icon-button:hover {
  background: var(--surface-strong);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-button.small {
  width: 32px;
  height: 32px;
}

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

.view {
  display: none;
  animation: view-in 420ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-heading,
.page-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px 0 28px;
}

.eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 11px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.eyebrow span {
  width: 18px;
  height: 1px;
  background: var(--coral);
}

.home-heading h1,
.page-heading h1 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  font-size: clamp(38px, 4.4vw, 56px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.home-heading h1 em,
.page-heading h1 em {
  color: var(--green-bright);
  font-style: normal;
}

.soft-button,
.primary-action,
.text-button,
.timer-control,
.timer-finish {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.soft-button {
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 100px;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.soft-button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.soft-button svg {
  width: 16px;
  height: 16px;
}

.soft-button.accent-button {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.night-card {
  position: relative;
  min-height: 292px;
  padding: 26px 28px 0;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 45%),
    var(--green);
  border-radius: var(--radius);
}

.night-glow {
  position: absolute;
  top: -120px;
  right: -90px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 50px rgba(255, 255, 255, 0.025),
    0 0 0 100px rgba(255, 255, 255, 0.018);
}

.night-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.night-label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-weight: 600;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(243, 200, 95, 0.12);
}

.night-settings {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.night-settings:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.night-settings svg {
  width: 14px;
  height: 14px;
}

.night-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 2px 24px;
}

.countdown-label {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.bedtime-countdown {
  display: block;
  margin-top: 5px;
  font-family: "DIN Alternate", "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: clamp(42px, 5.2vw, 68px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.night-main p {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
}

.night-main p span {
  color: rgba(255, 255, 255, 0.75);
}

.progress-orbit {
  --progress: 0deg;
  position: relative;
  display: grid;
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  place-items: center;
  background: conic-gradient(var(--yellow) var(--progress), rgba(255, 255, 255, 0.12) 0);
  border-radius: 50%;
  transition: background 300ms ease;
}

.progress-orbit::before {
  position: absolute;
  width: 86px;
  height: 86px;
  background: var(--green);
  border-radius: 50%;
  content: "";
}

.orbit-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.orbit-inner strong {
  display: block;
  font-size: 23px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.orbit-inner span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
}

.night-stats {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(0, 0, 0, 0.12);
}

.night-stats > div {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  gap: 1px 9px;
  align-items: center;
  min-height: 72px;
  padding: 12px 20px;
}

.night-stats > div + div::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.09);
  content: "";
}

.mini-icon {
  display: grid;
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.mini-icon svg {
  width: 13px;
  height: 13px;
}

.night-stats p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.night-stats > div > span:last-child {
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
}

.focus-card,
.panel {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.focus-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 22px 20px;
}

.card-heading,
.panel-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.card-heading.compact {
  align-items: center;
}

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

.card-heading h2,
.panel-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.time-chip,
.weekday-tag {
  padding: 6px 9px;
  color: var(--green-bright);
  font-size: 10px;
  font-weight: 600;
  background: var(--green-soft);
  border-radius: 100px;
}

.focus-body {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 24px 0 20px;
}

.focus-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #8e5e20;
  background: var(--yellow-soft);
  border-radius: 50%;
}

.focus-icon svg {
  width: 22px;
  height: 22px;
}

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

.focus-copy h3 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-copy p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-action {
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  background: var(--green);
  border-radius: 6px;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.primary-action:hover:not(:disabled) {
  background: var(--green-bright);
  transform: translateY(-1px);
}

.primary-action:disabled {
  color: var(--ink-muted);
  background: var(--surface-muted);
}

.primary-action svg {
  width: 15px;
  height: 15px;
}

.focus-timer {
  padding: 13px 14px 12px;
  margin: -4px 0 14px;
  background: var(--surface-muted);
  border-radius: 6px;
}

.focus-timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 9px;
}

.focus-timer-head span:last-child {
  overflow: hidden;
  max-width: 110px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-timer > strong {
  display: block;
  margin: 5px 0 7px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.focus-timer-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.timer-control,
.timer-finish {
  padding: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  background: transparent;
}

.timer-control svg {
  width: 12px;
  height: 12px;
}

.timer-finish {
  color: var(--green-bright);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.task-panel {
  min-width: 0;
  padding: 24px 24px 12px;
}

.panel-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
  color: var(--ink-muted);
  font-size: 9px;
}

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

.task-list {
  margin-top: 18px;
}

.task-row {
  display: grid;
  grid-template-columns: 42px 40px minmax(0, 1fr) 62px 70px auto;
  gap: 11px;
  align-items: center;
  min-height: 68px;
  padding: 9px 6px 9px 0;
  border-top: 1px solid var(--line);
  transition: background 160ms ease;
}

.task-row:hover {
  background: #fafbf8;
}

.task-time {
  color: var(--ink-muted);
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.task-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--task-color);
  background: var(--task-bg);
  border-radius: 50%;
}

.task-icon svg {
  width: 16px;
  height: 16px;
}

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

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

.task-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.5;
  text-overflow: clip;
  white-space: nowrap;
}

.task-duration {
  color: var(--ink-muted);
  font-size: 10px;
  text-align: right;
}

.task-reward {
  color: var(--green-bright);
  font-size: 10px;
  font-weight: 650;
  text-align: right;
}

.task-reward.is-neutral {
  color: var(--ink-muted);
  font-weight: 500;
}

.task-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.task-timer-btn {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  width: auto;
  height: 31px;
  padding: 0 9px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  background: var(--surface-muted);
  border-radius: 100px;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.task-timer-btn:hover {
  color: var(--green-bright);
  background: var(--green-soft);
}

.task-timer-btn.is-running {
  color: #fff;
  background: var(--coral);
}

.task-timer-btn svg {
  width: 13px;
  height: 13px;
}

.task-check {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 64px;
  height: 31px;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.task-check:hover {
  color: var(--green-bright);
  border-color: var(--green-bright);
}

.task-check svg {
  width: 12px;
  height: 12px;
}

.task-row.is-done .task-copy strong {
  color: var(--ink-muted);
  text-decoration: line-through;
}

.task-row.is-done .task-icon {
  opacity: 0.55;
}

.task-row.is-done .task-check {
  color: #fff;
  background: var(--green-bright);
  border-color: var(--green-bright);
}

.task-row.is-active {
  margin: 0 -8px;
  padding-right: 14px;
  padding-left: 8px;
  background: #f7faf7;
  border-radius: 6px;
}

.task-timer-value {
  display: inline-block;
  min-width: 39px;
  color: var(--coral);
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.right-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.entertainment-card {
  position: relative;
  min-height: 274px;
  padding: 20px;
  overflow: hidden;
}

.entertainment-visual {
  position: relative;
  display: grid;
  width: 140px;
  height: 104px;
  margin: 14px auto 4px;
  place-items: center;
}

.visual-ring {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.ring-one {
  width: 96px;
  height: 96px;
  border-color: #edd6a0;
}

.ring-two {
  width: 124px;
  height: 124px;
  border-color: #f2e9d4;
}

.visual-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  color: var(--coral);
  background: var(--coral-soft);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(238, 118, 93, 0.16);
}

.visual-icon svg {
  width: 27px;
  height: 27px;
}

.visual-dot,
.visual-star {
  position: absolute;
}

.visual-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-a {
  top: 22px;
  right: 10px;
  background: var(--yellow);
}

.dot-b {
  bottom: 17px;
  left: 16px;
  width: 5px;
  height: 5px;
  background: var(--blue);
}

.visual-star {
  color: var(--yellow);
}

.star-a {
  top: 2px;
  left: 19px;
  font-size: 17px;
}

.star-b {
  right: 25px;
  bottom: 4px;
  color: var(--coral);
  font-size: 23px;
}

.entertainment-copy {
  text-align: center;
}

.entertainment-copy > span {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.entertainment-copy h3 {
  margin: 5px 0 5px;
  font-family: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  font-size: 16px;
  font-weight: 650;
}

.entertainment-copy p {
  margin: 0 auto;
  max-width: 260px;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.6;
}

.text-button {
  padding: 0;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  background: transparent;
}

.text-button:hover {
  color: var(--green-bright);
}

.entertainment-card > .text-button {
  position: absolute;
  top: 23px;
  right: 20px;
}

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

.note-card {
  padding: 18px 20px 14px;
}

.note-status {
  color: #6b937e;
  font-size: 9px;
}

.note-card textarea {
  width: 100%;
  height: 88px;
  padding: 12px 0;
  resize: none;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
  background: transparent;
  border: 0;
  outline: 0;
}

.note-card textarea::placeholder {
  color: #aeb7b2;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 9px;
  color: #a1aba5;
  font-size: 8px;
  border-top: 1px dashed var(--line);
}

.page-heading {
  padding-bottom: 34px;
}

.stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.segmented-control {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  background: #e8ece8;
  border-radius: 100px;
}

.segmented-control button {
  min-width: 68px;
  height: 31px;
  padding: 0 14px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  background: transparent;
  border-radius: 100px;
}

.segmented-control button.is-active {
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 2px 7px rgba(23, 42, 34, 0.08);
}

.segmented-control.small button {
  min-width: 52px;
  height: 28px;
  padding: 0 11px;
}

.range-caption {
  color: var(--ink-muted);
  font-size: 10px;
}

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

.stat-card {
  position: relative;
  padding: 20px 20px 18px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-card::after {
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 84px;
  height: 84px;
  background: var(--stat-soft);
  border-radius: 50%;
  content: "";
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--stat-color);
  background: var(--stat-soft);
  border-radius: 50%;
}

.stat-card-icon svg {
  width: 16px;
  height: 16px;
}

.stat-trend {
  display: flex;
  gap: 3px;
  align-items: center;
  color: var(--ink-muted);
  font-size: 9px;
}

.stat-trend.is-up {
  color: #437c63;
}

.stat-trend.is-down {
  color: var(--coral);
}

.stat-trend svg {
  width: 10px;
  height: 10px;
}

.stat-card-label {
  display: block;
  margin-top: 16px;
  color: var(--ink-muted);
  font-size: 10px;
}

.stat-card-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 3px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 33px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-card-value small {
  margin-left: 4px;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.stat-card-footer {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 9px;
}

.stat-line {
  width: 100%;
  height: 3px;
  margin-bottom: 7px;
  overflow: hidden;
  background: #edf0ec;
  border-radius: 3px;
}

.stat-line span {
  display: block;
  width: var(--fill);
  height: 100%;
  background: var(--stat-color);
  border-radius: inherit;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.7fr);
  gap: 16px;
  margin-top: 16px;
}

.chart-panel {
  min-width: 0;
  padding: 22px 22px 18px;
}

.chart-legend {
  display: flex;
  gap: 13px;
  align-items: center;
}

.chart-legend span {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--ink-muted);
  font-size: 8px;
}

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

.legend-exercise {
  background: var(--coral);
}

.legend-english {
  background: var(--blue);
}

.legend-growth {
  background: var(--yellow);
}

.chart-wrap {
  position: relative;
  height: 230px;
  padding: 22px 4px 0 36px;
  margin-top: 8px;
}

.chart-grid-lines {
  position: absolute;
  top: 22px;
  right: 4px;
  bottom: 30px;
  left: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-grid-lines span {
  width: 100%;
  border-top: 1px dashed #e7ebe6;
}

.bar-chart {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: stretch;
  height: 100%;
}

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

.chart-bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  width: min(30px, 70%);
  min-height: 0;
}

.chart-bar {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: 2px;
  overflow: hidden;
  background: #eef0ed;
  border-radius: 4px 4px 2px 2px;
  transition: height 400ms ease;
}

.bar-segment {
  width: 100%;
  flex: 0 0 var(--segment-height);
}

.bar-exercise {
  background: var(--coral);
}

.bar-english {
  background: var(--blue);
}

.bar-growth {
  background: var(--yellow);
}

.chart-label {
  height: 26px;
  padding-top: 9px;
  color: var(--ink-muted);
  font-size: 8px;
  white-space: nowrap;
}

.chart-value {
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 8px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.chart-column:hover .chart-value {
  opacity: 1;
}

.insight-panel {
  padding: 22px;
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.insight-panel .section-kicker {
  color: rgba(255, 255, 255, 0.4);
}

.insight-panel h2 {
  color: #fff;
}

.insight-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.insight-badge svg {
  width: 15px;
  height: 15px;
}

.insight-total {
  padding: 28px 0 22px;
}

.insight-total > span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
}

.insight-total strong {
  display: block;
  margin-top: 5px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 38px;
  font-weight: 500;
}

.insight-total strong small {
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 10px;
  font-weight: 400;
}

.insight-total p {
  margin: 4px 0 0;
  color: var(--yellow);
  font-size: 9px;
}

.insight-list {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.insight-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.insight-list span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
}

.insight-list strong {
  font-size: 10px;
  font-weight: 500;
}

.recent-panel {
  padding: 22px;
  margin-top: 16px;
}

.recent-panel .panel-heading {
  align-items: center;
  margin-bottom: 10px;
}

.recent-list {
  display: grid;
}

.recent-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--line);
}

.recent-item-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--cat-color);
  background: var(--cat-bg);
  border-radius: 50%;
}

.recent-item-icon svg {
  width: 13px;
  height: 13px;
}

.recent-item-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.recent-item-copy span,
.recent-item-date,
.recent-item-duration {
  color: var(--ink-muted);
  font-size: 9px;
}

.recent-item-duration {
  min-width: 50px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  color: var(--ink-soft);
  text-align: right;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 24px;
  color: var(--ink-muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.empty-state-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  place-items: center;
  color: var(--green-bright);
  background: var(--green-soft);
  border-radius: 50%;
}

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

.empty-state strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.empty-state p {
  margin: 5px 0 0;
  font-size: 9px;
}

.wallet-heading {
  padding-bottom: 28px;
}

.wallet-count {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  color: var(--green-bright);
  font-size: 10px;
  font-weight: 650;
  background: var(--green-soft);
  border-radius: 100px;
}

.wallet-count svg {
  width: 15px;
  height: 15px;
}

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

.wallet-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.wallet-card::after {
  position: absolute;
  top: -38px;
  right: -38px;
  width: 110px;
  height: 110px;
  background: var(--wallet-soft);
  border-radius: 50%;
  content: "";
}

.wallet-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
}

.wallet-category-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--wallet-color);
  background: var(--wallet-soft);
  border-radius: 50%;
}

.wallet-category-icon svg {
  width: 17px;
  height: 17px;
}

.wallet-card-title {
  min-width: 0;
}

.wallet-card-title span {
  display: block;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.wallet-card-title h2 {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 650;
}

.wallet-reward-tag {
  margin-left: auto;
  padding: 5px 8px;
  color: var(--wallet-color);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--wallet-soft);
  border-radius: 100px;
}

.wallet-card-balance {
  position: relative;
  z-index: 1;
  padding: 24px 0 18px;
}

.wallet-card-balance > span {
  color: var(--ink-muted);
  font-size: 9px;
}

.wallet-card-balance strong {
  display: flex;
  gap: 5px;
  align-items: baseline;
  margin-top: 5px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.wallet-card-balance strong small {
  color: var(--wallet-color);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}

.wallet-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.wallet-card-stats > div + div {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.wallet-card-stats span {
  display: block;
  color: var(--ink-muted);
  font-size: 8px;
}

.wallet-card-stats strong {
  display: block;
  margin-top: 4px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 10px;
  font-weight: 600;
}

.wallet-potential {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 12px 0 10px;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.45;
}

.wallet-potential::before {
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  background: var(--wallet-color);
  border-radius: 50%;
  content: "";
}

.wallet-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 4px;
}

.wallet-card-action {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 5px;
}

.wallet-card-action:hover {
  border-color: var(--line-strong);
}

.wallet-card-action.is-primary {
  color: #fff;
  background: var(--green);
}

.wallet-card-action.is-primary:hover {
  background: var(--green-bright);
}

.wallet-card-action:disabled {
  color: #a8b0ac;
  background: #f1f3f0;
  cursor: not-allowed;
  opacity: 0.72;
}

.wallet-card-action svg {
  width: 12px;
  height: 12px;
}

.balance-card {
  position: relative;
  min-height: 247px;
  padding: 26px 28px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 45%),
    var(--green);
  border-radius: var(--radius);
}

.balance-card::before,
.balance-card::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.balance-card::before {
  right: -90px;
  bottom: -160px;
  width: 350px;
  height: 350px;
}

.balance-card::after {
  right: -40px;
  bottom: -110px;
  width: 250px;
  height: 250px;
}

.balance-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.balance-label {
  color: rgba(255, 255, 255, 0.47);
  font-size: 10px;
  font-weight: 600;
}

.balance-top strong {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin-top: 7px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance-top strong small {
  color: var(--yellow);
  font-family: inherit;
  font-size: 19px;
  font-weight: 500;
}

.wallet-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.wallet-icon svg {
  width: 19px;
  height: 19px;
}

.balance-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0;
  margin-top: 30px;
}

.balance-metrics > div {
  min-width: 116px;
  padding-right: 28px;
}

.balance-metrics > div + div {
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-metrics span {
  display: block;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
}

.balance-metrics strong {
  display: block;
  margin-top: 5px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 13px;
  font-weight: 500;
}

.balance-footer {
  position: absolute;
  right: 28px;
  bottom: 20px;
  left: 28px;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.34);
  font-size: 8px;
}

.rule-dot {
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.34);
  border-radius: 50%;
}

.reward-rule-card {
  padding: 22px;
}

.reward-rules {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.reward-rule {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px;
  background: var(--surface-muted);
  border-radius: 6px;
}

.reward-rule-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--cat-color);
  background: var(--cat-bg);
  border-radius: 50%;
}

.reward-rule-icon svg {
  width: 13px;
  height: 13px;
}

.reward-rule-name {
  font-size: 10px;
  font-weight: 600;
}

.reward-rule-amount {
  color: var(--green-bright);
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.rule-hint {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 8px;
  text-align: center;
}

.ledger-panel {
  padding: 22px;
  margin-top: 16px;
}

.ledger-heading {
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ledger-list {
  display: grid;
}

.ledger-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border-top: 1px solid var(--line);
}

.ledger-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
}

.ledger-icon.income {
  color: var(--cat-color, var(--green-bright));
  background: var(--cat-bg, var(--green-soft));
}

.ledger-icon.expense {
  color: var(--cat-color, var(--coral));
  background: var(--cat-bg, var(--coral-soft));
}

.ledger-icon svg {
  width: 14px;
  height: 14px;
}

.ledger-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

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

.ledger-amount {
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

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

.mobile-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(13, 27, 22, 0.55);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(540px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 28px 80px rgba(7, 20, 15, 0.24);
  animation: modal-in 240ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  font-size: 23px;
  font-weight: 650;
}

.modal-content {
  padding: 22px 24px 24px;
}

.form-section + .form-section {
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.form-section-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 650;
}

.form-section-copy {
  margin: -7px 0 14px;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.6;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.modal textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.modal textarea:focus {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(47, 121, 95, 0.1);
}

.field small {
  color: var(--ink-muted);
  font-size: 8px;
}

.money-input-wrap {
  position: relative;
}

.money-input-wrap span {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--ink-muted);
  font-size: 12px;
}

.money-input-wrap input {
  padding-left: 27px;
}

.form-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding-top: 20px;
}

.button-secondary,
.button-primary,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
}

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

.button-primary {
  color: #fff;
  background: var(--green);
}

.button-primary:hover {
  background: var(--green-bright);
}

.button-danger {
  color: var(--danger);
  background: #fff1ee;
  border: 1px solid #f2cec7;
}

.button-danger:hover {
  background: var(--coral-soft);
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.data-action {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 10px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.data-action:hover {
  border-color: var(--line-strong);
}

.data-action svg {
  width: 17px;
  height: 17px;
}

.data-action.is-danger {
  color: var(--danger);
}

.rotation-grid {
  display: grid;
  gap: 8px;
}

.rotation-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.rotation-day {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 600;
}

.rotation-row input {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 11px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.withdraw-breakdown {
  padding: 14px;
  margin-bottom: 14px;
  background: var(--green-soft);
  border-radius: 6px;
}

.withdraw-breakdown span {
  display: block;
  color: var(--ink-muted);
  font-size: 9px;
}

.withdraw-breakdown strong {
  display: block;
  margin-top: 4px;
  font-family: "DIN Alternate", "Bahnschrift", sans-serif;
  font-size: 26px;
}

.confirm-copy {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  background: var(--green-deep);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(10, 27, 20, 0.24);
  animation: toast-in 220ms ease both;
}

.toast::before {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border-radius: 50%;
  content: "";
}

.toast.is-error::before {
  background: var(--coral);
}

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

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

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

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 200px;
  }

  .app-shell {
    width: calc(100% - 20px);
    margin: 10px auto;
  }

  .sidebar {
    min-height: calc(100vh - 20px);
  }

  .content {
    padding-right: 26px;
    padding-left: 26px;
  }

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

  .night-card {
    padding-right: 22px;
    padding-left: 22px;
  }

  .task-row {
    grid-template-columns: 38px 38px minmax(0, 1fr) 56px auto;
  }

  .task-reward {
    display: none;
  }

  .balance-metrics > div {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 82px;
  }

  .sidebar {
    padding: 26px 14px 20px;
  }

  .brand {
    justify-content: center;
  }

  .brand > span:last-child,
  .nav-item span,
  .nav-item.is-active::after,
  .side-quote,
  .settings-link span {
    display: none;
  }

  .side-nav {
    margin-top: 50px;
  }

  .nav-item {
    justify-content: center;
    padding: 14px;
  }

  .settings-link {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .dashboard-grid,
  .content-grid,
  .analytics-grid,
  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .focus-card {
    min-height: 240px;
  }

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

  .analytics-grid {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.7fr);
  }

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

  .balance-card {
    min-height: 255px;
  }
}

@media (max-width: 720px) {
  body {
    background: var(--surface);
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    overflow: visible;
    background: var(--surface);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 0 16px calc(100px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 58px;
    margin: 0 -16px;
    padding: 0 16px;
    background: rgba(247, 247, 243, 0.92);
    backdrop-filter: blur(12px);
  }

  .local-badge {
    display: none;
  }

  .topbar-date {
    font-size: 11px;
  }

  .home-heading,
  .page-heading {
    display: block;
    padding: 18px 0 22px;
  }

  .home-heading {
    padding-top: 12px;
    padding-bottom: 18px;
  }

  .home-heading > .soft-button {
    display: none;
  }

  .home-heading h1,
  .page-heading h1 {
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.2;
  }

  .home-heading .soft-button,
  .page-heading .soft-button {
    margin-top: 18px;
  }

  .dashboard-grid {
    gap: 12px;
  }

  .night-card {
    min-height: 286px;
    padding: 22px 20px 0;
  }

  .night-main {
    padding-top: 27px;
  }

  .bedtime-countdown {
    font-size: 48px;
  }

  .progress-orbit {
    flex-basis: 92px;
    width: 92px;
    height: 92px;
  }

  .progress-orbit::before {
    width: 76px;
    height: 76px;
  }

  .orbit-inner strong {
    font-size: 20px;
  }

  .night-stats > div {
    grid-template-columns: 24px 1fr;
    padding: 10px 11px;
  }

  .mini-icon {
    width: 24px;
    height: 24px;
  }

  .night-stats p {
    font-size: 12px;
  }

  .focus-card {
    min-height: 228px;
  }

  .content-grid {
    gap: 12px;
    margin-top: 12px;
  }

  .task-panel {
    padding: 20px 16px 8px;
  }

  .panel-heading {
    align-items: center;
  }

  .panel-summary .dot,
  .panel-summary span:last-child {
    display: none;
  }

  .task-row {
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 9px;
    min-height: 84px;
    padding: 12px 0;
  }

  .task-time {
    display: none;
  }

  .task-icon {
    grid-row: 1 / 3;
    grid-column: 1;
    align-self: start;
  }

  .task-copy {
    grid-row: 1;
    grid-column: 2;
  }

  .task-duration {
    display: none;
  }

  .task-actions {
    grid-row: 2;
    grid-column: 2;
    justify-content: flex-start;
    padding-top: 2px;
  }

  .task-copy span {
    max-width: none;
  }

  .task-reward {
    display: none;
  }

  .right-column {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entertainment-card {
    min-height: 280px;
  }

  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px;
    background: rgba(20, 45, 37, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(18, 38, 31, 0.3);
    backdrop-filter: blur(16px);
  }

  .mobile-nav button {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 9px;
    background: transparent;
    border-radius: 8px;
  }

  .mobile-nav button.is-active {
    color: var(--yellow);
    background: rgba(255, 255, 255, 0.07);
  }

  .mobile-nav svg {
    width: 18px;
    height: 18px;
  }

  .toast-region {
    right: 16px;
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 14px 14px 0 0;
    animation-name: modal-up;
  }

  @keyframes modal-up {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .modal-header {
    padding: 20px 18px 14px;
  }

  .modal-content {
    padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .stat-summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 13px;
    align-items: center;
    padding: 16px;
  }

  .stat-card-top {
    display: contents;
  }

  .stat-card-icon {
    grid-row: 1 / 3;
  }

  .stat-trend {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .stat-card-label {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .stat-card-value {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }

  .stat-card-footer {
    grid-column: 1 / -1;
    margin-top: 13px;
  }

  .stat-card::after {
    display: none;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  .chart-panel {
    padding: 20px 16px 14px;
  }

  .chart-legend {
    gap: 8px;
  }

  .chart-wrap {
    height: 210px;
    padding-left: 0;
    overflow: hidden;
  }

  .chart-grid-lines {
    left: 0;
  }

  .bar-chart {
    gap: 6px;
  }

  .insight-panel {
    padding: 20px;
  }

  .insight-total {
    padding: 18px 0 14px;
  }

  .recent-panel {
    padding: 20px 16px;
    margin-top: 12px;
  }

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

  .recent-item-date {
    display: none;
  }

  .wallet-grid {
    gap: 12px;
  }

  .wallet-count {
    margin-top: 14px;
  }

  .wallet-card {
    padding: 18px;
  }

  .balance-card {
    min-height: 264px;
    padding: 22px 20px;
  }

  .balance-top strong {
    font-size: 43px;
  }

  .balance-metrics {
    margin-top: 27px;
  }

  .balance-metrics > div {
    flex: 1;
    padding-right: 12px;
  }

  .balance-metrics > div + div {
    padding-left: 12px;
  }

  .balance-footer {
    right: 20px;
    bottom: 18px;
    left: 20px;
    flex-wrap: wrap;
    line-height: 1.4;
  }

  .reward-rule-card {
    padding: 20px;
  }

  .ledger-panel {
    padding: 20px 16px;
    margin-top: 12px;
  }

  .ledger-heading {
    align-items: flex-start;
  }

  .ledger-heading .segmented-control button {
    min-width: 44px;
    padding: 0 8px;
  }

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

  .form-grid.three .field:not(.full) {
    grid-column: auto;
  }

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

@media (max-width: 390px) {
  .bedtime-countdown {
    font-size: 42px;
  }

  .progress-orbit {
    flex-basis: 82px;
    width: 82px;
    height: 82px;
  }

  .progress-orbit::before {
    width: 68px;
    height: 68px;
  }

  .orbit-inner strong {
    font-size: 18px;
  }

  .night-stats > div {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mini-icon {
    display: none;
  }

  .balance-metrics strong {
    font-size: 11px;
  }

  .ledger-controls {
    max-width: 160px;
  }

  .task-check span {
    display: none;
  }

  .task-check {
    min-width: 31px;
    width: 31px;
    padding: 0;
    justify-content: center;
  }
}

@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;
  }
}
