:root {
  --paper: #f5f0e8;
  --card: #fffdfa;
  --ink: #29251f;
  --muted: #746d63;
  --line: #ded5c8;
  --plum: #4d3045;
  --plum-soft: #e8dfe5;
  --terra: #b65f42;
  --terra-soft: #f3dfd6;
  --sage: #627a67;
  --sage-soft: #dfe8df;
  --sand: #a57c45;
  --sand-soft: #eee2ce;
  --red: #b44d43;
  --green: #477358;
  --shadow: 0 16px 40px rgba(63, 48, 36, .07);
  --radius: 22px;
  --sidebar: 248px
}

* {
  box-sizing: border-box
}

html {
  background: var(--paper);
  scroll-behavior: smooth
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased
}

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

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

button {
  cursor: pointer
}

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

.app-shell {
  min-height: 100vh
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 28px 20px 22px;
  background: #ede6dc;
  border-right: 1px solid rgba(104, 87, 68, .12);
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto
}

.brand {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 4px 20px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointera
}

.brand-inner {
  display: flex;
  align-items: center;
  gap: 16px
}

.brand-edit {
  display: block;
  color: #9a9186;
  font-size: 9px;
  font-style: normal;
  opacity: 0;
  transition: .2s;
  white-space: nowrap;
  background: rgba(255, 252, 247, .85);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(154, 145, 134, .2);
  margin-top: 6px;
  text-align: center;
  align-self: flex-start
}

.brand:hover .brand-edit {
  opacity: 1
}

.brand:hover .brand-edit {
  opacity: 1
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--plum);
  color: white;
  font: 700 19px/1 "Songti SC", serif;
  box-shadow: 0 7px 18px rgba(77, 48, 69, .2)
}

.brand strong {
  display: block;
  font: 700 19px/1.2 "Songti SC", serif;
  letter-spacing: .05em
}

.brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #5e574e;
  text-align: left;
  transition: .2s
}

.nav-item:hover {
  background: rgba(255, 255, 255, .48);
  color: var(--ink)
}

.nav-item.active {
  background: var(--card);
  color: var(--plum);
  box-shadow: 0 5px 16px rgba(75, 57, 43, .05);
  font-weight: 700
}

.nav-item svg {
  width: 18px
}

.nav-label {
  margin: 16px 13px 6px;
  color: #9a9186;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em
}

.local-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid #d9cfc0;
  border-radius: 16px;
  background: rgba(255, 252, 247, .58)
}

.local-status {
  font-size: 12px;
  font-weight: 700
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #75906f;
  box-shadow: 0 0 0 4px rgba(117, 144, 111, .12)
}

.local-card p {
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6
}

.backup-meter {
  height: 4px;
  border-radius: 9px;
  background: #ddd4c7;
  overflow: hidden
}

.backup-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--terra);
  transition: .3s
}

.local-card small {
  display: block;
  margin-top: 7px;
  color: #8f8579;
  font-size: 10px
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 0 42px 56px
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 104px;
  padding: 25px 0 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(180deg, var(--paper) 78%, rgba(245, 240, 232, 0))
}

.eyebrow {
  margin: 0 0 4px;
  color: #94887a;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase
}

.eyebrow.light {
  color: rgba(255, 255, 255, .68)
}

h1,
h2,
h3,
p {
  margin-top: 0
}

h1 {
  margin: 0;
  font: 700 clamp(24px, 2.2vw, 34px)/1.2 "Songti SC", serif;
  letter-spacing: .02em
}

h2 {
  margin: 0;
  font: 700 20px/1.35 "Songti SC", serif
}

.top-actions,
.section-actions {
  display: flex;
  align-items: center;
  gap: 8px
}

.section-actions {
  justify-content: flex-end;
  margin: -2px 0 16px
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 5px;
  color: #7e756a;
  font-size: 11px;
  white-space: nowrap
}

.save-state span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #71866f
}

.save-state b {
  font-weight: 500
}

.save-state.error span {
  background: var(--red)
}

.btn {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s, background .15s
}

.btn:hover {
  transform: translateY(-1px)
}

.btn svg {
  width: 16px
}

.btn.primary {
  background: var(--plum);
  color: #fff;
  box-shadow: 0 8px 20px rgba(77, 48, 69, .16)
}

.btn.ghost {
  border-color: var(--line);
  background: rgba(255, 252, 247, .8)
}

.btn.ink {
  background: var(--ink);
  color: #fff
}

.btn.full {
  width: 100%;
  min-height: 48px;
  margin-top: 6px
}

.text-btn {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--terra);
  font-size: 12px;
  font-weight: 700
}

.system-alert,
.module-alert {
  margin-bottom: 16px;
  padding: 14px 17px;
  border: 1px solid #dba98f;
  border-radius: 15px;
  background: #f5ded2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px
}

.system-alert[hidden],
.module-alert:empty {
  display: none
}

.system-alert strong,
.system-alert span,
.module-alert strong,
.module-alert span {
  display: block
}

.system-alert span,
.module-alert span {
  margin-top: 2px;
  color: #765b4d;
  font-size: 12px
}

.system-alert.danger {
  border-color: #d68f87;
  background: #f5dcd8
}

.module-alert.good {
  border-color: #bad0bd;
  background: #e3ece2
}

.module-alert.good span {
  color: #5b705e
}

.view {
  display: none
}

.view.active {
  display: block;
  animation: reveal .28s ease
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(5px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.panel,
.hero-card {
  border: 1px solid rgba(111, 89, 67, .08);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow)
}

.panel {
  padding: 22px
}

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

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 30px;
  background: var(--plum);
  color: #fff
}

.hero-card:after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -70px;
  bottom: -95px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%
}

.hero-card h2 {
  margin: 12px 0 9px;
  font: 700 64px/1 "Songti SC", serif
}

.hero-card h2 small {
  font: 500 16px/1 sans-serif;
  color: rgba(255, 255, 255, .6)
}

.hero-card p:last-child {
  max-width: 190px;
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 12px
}

.score-orbit {
  position: absolute;
  right: 27px;
  top: 33px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%
}

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

.score-orbit:before {
  inset: 14px
}

.score-orbit:after {
  inset: 29px
}

.score-orbit span,
.score-orbit i,
.score-orbit b {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0ad91
}

.score-orbit span {
  top: 9px;
  left: 18px
}

.score-orbit i {
  right: 3px;
  top: 50%;
  background: #b4c6b7
}

.score-orbit b {
  left: 25px;
  bottom: 3px;
  background: #e6dac6
}

.quick-panel {
  grid-column: span 2
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px
}

.mini-note,
.draft-status {
  color: #978c80;
  font-size: 10px
}

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

.quick-action {
  position: relative;
  min-width: 0;
  min-height: 108px;
  padding: 17px 13px;
  border: 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  transition: .2s
}

.quick-action:hover {
  transform: translateY(-2px)
}

.quick-action>svg {
  width: 21px;
  height: 21px
}

.quick-action span strong,
.quick-action span small {
  display: block
}

.quick-action span strong {
  font-size: 13px
}

.quick-action span small {
  margin-top: 2px;
  color: rgba(41, 37, 31, .58);
  font-size: 10px
}

.quick-action i {
  position: absolute;
  right: 12px;
  top: 11px;
  font-style: normal;
  font-size: 17px
}

.terracotta {
  background: var(--terra-soft);
  color: #8d442e
}

.plum {
  background: var(--plum-soft);
  color: var(--plum)
}

.sage {
  background: var(--sage-soft);
  color: #4f6753
}

.sand {
  background: var(--sand-soft);
  color: #835f31
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 105px
}

.stat-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center
}

.stat-card span,
.stat-card strong,
.stat-card small {
  display: block
}

.stat-card span {
  color: var(--muted);
  font-size: 11px
}

.stat-card strong {
  margin: 1px 0;
  font-size: 21px
}

.stat-card small {
  color: #998f83;
  font-size: 10px
}

.span-2 {
  grid-column: span 2
}

.clean-list,
.habit-stack,
.timeline,
.record-list,
.date-groups,
.archive-list,
.shopping-list {
  display: flex;
  flex-direction: column
}

.clean-list {
  gap: 7px
}

.task-row {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 6px 7px;
  border-radius: 11px
}

.task-row:hover {
  background: #f7f2eb
}

.check-btn {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #cfc4b7;
  border-radius: 8px;
  background: transparent;
  color: white
}

.check-btn svg {
  width: 14px
}

.check-btn.checked,
.task-row.done .check-btn {
  background: var(--sage);
  border-color: var(--sage)
}

.task-row.done .task-title {
  text-decoration: line-through;
  color: #9b9288
}

.task-title {
  font-size: 13px
}

.task-title small {
  display: block;
  color: #958a7e;
  font-size: 10px;
  font-weight: 400;
  text-decoration: none
}

.task-time {
  color: #958a7e;
  font-size: 11px
}

.priority-flag {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7aea3
}

.priority-flag.high {
  background: var(--red)
}

.habit-stack {
  gap: 10px
}

.habit-pill {
  display: flex;
  align-items: center;
  gap: 12px
}

.habit-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%
}

.habit-pill strong {
  flex: 1;
  font-size: 12px
}

.habit-pill small {
  color: var(--muted)
}

.timeline {
  gap: 0
}

.timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0
}

.timeline-item:not(:last-child) {
  border-bottom: 1px solid #eee7de
}

.record-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center
}

.record-icon svg {
  width: 16px
}

.timeline-item strong,
.timeline-item small {
  display: block
}

.timeline-item strong {
  font-size: 12px
}

.timeline-item small {
  color: #968b7e;
  font-size: 10px
}

.record-value {
  font-size: 12px;
  font-weight: 700
}

.insight-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #e8dfd1
}

.insight-card blockquote {
  margin: 10px 0 25px;
  font: 600 19px/1.7 "Songti SC", serif
}

.insight-card>span {
  color: #8a7c6e;
  font-size: 10px
}

.empty-state {
  padding: 24px 12px;
  text-align: center;
  color: #9b9186;
  font-size: 12px
}

.module-layout {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start
}

.form-panel {
  position: sticky;
  top: 122px
}

.form-panel.static {
  position: static
}

.sticky-stack {
  position: sticky;
  top: 122px;
  display: flex;
  flex-direction: column;
  gap: 16px
}

.form-panel form {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 12px;
  background: #eee8df
}

.segmented input {
  position: absolute;
  opacity: 0
}

.segmented span {
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #7e756b;
  font-size: 12px;
  font-weight: 700
}

.segmented input:checked+span {
  background: var(--card);
  color: var(--plum);
  box-shadow: 0 3px 10px rgba(65, 50, 39, .07)
}

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

.field>span {
  color: #746b61;
  font-size: 11px;
  font-weight: 700
}

.field input,
.field select,
.compact-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #ddd4c8;
  border-radius: 11px;
  outline: 0;
  background: #fbf8f3;
  transition: .2s
}

.field input:focus,
.field select:focus,
.compact-select:focus {
  border-color: #92748a;
  box-shadow: 0 0 0 3px rgba(77, 48, 69, .07);
  background: white
}

.compact-select {
  width: auto;
  height: 36px;
  font-size: 11px
}

.amount-field>div {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #d6ccbf
}

.amount-field b {
  font: 600 22px/1 serif
}

.amount-field input {
  height: 58px;
  border: 0;
  background: transparent;
  font-size: 32px;
  font-weight: 700
}

.amount-field input:focus {
  box-shadow: none
}

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

.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--plum)
}

.module-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0
}

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

.metric {
  min-height: 102px;
  padding: 20px;
  border: 1px solid rgba(111, 89, 67, .12);
  border-radius: 18px;
  background: #eee7dd
}

.metric:nth-child(2) {
  background: #e6ebe3
}

.metric:nth-child(3) {
  background: #e9e1e7
}

.metric.income {
  background: #e0ece3
}

.metric.expense {
  background: #f1ddd6
}

.metric span,
.metric strong {
  display: block
}

.metric span {
  color: #776e64;
  font-size: 11px
}

.metric strong {
  margin-top: 8px;
  font-size: 23px
}

.inline-budget {
  color: var(--muted);
  font-size: 11px
}

.inline-budget input {
  width: 90px;
  padding: 5px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-weight: 700;
  outline: 0
}

.large-progress {
  height: 10px;
  border-radius: 20px;
  background: #eee7df;
  overflow: hidden
}

.large-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--terra);
  transition: .35s
}

.large-progress.sage-bar span {
  background: var(--sage)
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px
}

.compare-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #f0e9df
}

.compare-card>span {
  color: var(--muted);
  font-size: 12px
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 18px;
  min-width: 0
}

.split-grid>.panel {
  min-width: 0;
  overflow: hidden
}

.pie-wrap {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(110px, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0
}

.pie-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 210px;
  overflow: visible
}

.chart-legend {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px
}

.legend-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  font-size: 11px
}

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

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

.legend-item b {
  font-size: 11px;
  white-space: nowrap
}

.record-list {
  gap: 2px;
  max-height: 520px;
  overflow: auto
}

.record-row {
  display: grid;
  grid-template-columns: 42px 1fr auto 32px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 8px 6px;
  border-bottom: 1px solid #eee7df
}

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

.record-main strong,
.record-main small {
  display: block
}

.record-main strong {
  font-size: 13px
}

.record-main small {
  margin-top: 2px;
  color: #958a7e;
  font-size: 10px
}

.record-amount {
  font-weight: 750
}

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

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

.delete-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #aaa096;
  opacity: 0
}

.record-row:hover .delete-btn,
.shopping-row:hover .delete-btn {
  opacity: 1
}

.delete-btn:hover {
  background: #f3e3dc;
  color: var(--terra)
}

.habit-layout {
  display: flex;
  flex-direction: column;
  gap: 18px
}

.daily-habits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap
}

.btn.compact {
  min-height: 36px;
  padding: 0 11px;
  font-size: 11px
}

.daily-habit {
  position: relative;
  min-width: 0;
  min-height: 156px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #faf7f2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif
}

.habit-card-delete {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .75);
  color: #9b8e84;
  opacity: 0
}

.daily-habit:hover .habit-card-delete {
  opacity: 1
}

.daily-habit>div:first-of-type {
  padding-right: 25px
}

.daily-habit.done {
  border-color: #aec5b1;
  background: var(--sage-soft)
}

.daily-habit.pulse {
  animation: gentlePulse 2.2s infinite
}

@keyframes gentlePulse {
  50% {
    box-shadow: 0 0 0 5px rgba(182, 95, 66, .09);
    border-color: #d6aa9a
  }
}

.daily-habit h3 {
  margin: 0;
  font: 700 15px/1.35 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.daily-habit p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap
}

.habit-action {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.habit-state {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap
}

.habit-action>button,
.habit-action>.counter-control,
.habit-action>.sleep-control {
  flex: 0 0 auto;
  margin-left: auto
}

.habit-action .habit-check {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #d0c6ba;
  border-radius: 13px;
  background: white
}

.habit-action .habit-check.checked {
  background: var(--sage);
  border-color: var(--sage);
  color: white
}

.counter-control {
  display: flex;
  align-items: center;
  gap: 7px
}

.counter-control button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white
}

.counter-control strong {
  min-width: 28px;
  text-align: center
}

.sleep-control {
  display: flex;
  align-items: center;
  gap: 5px
}

.sleep-control input {
  width: 62px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  text-align: center
}

.heatmap-panel {
  overflow: hidden
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 7px
}

.habit-heatmap {
  min-width: 850px
}

.heatmap-header,
.heatmap-row {
  display: grid;
  grid-template-columns: 110px repeat(30, 18px);
  gap: 5px;
  align-items: center;
  margin-bottom: 7px
}

.heatmap-header span {
  color: #9c9185;
  font-size: 8px;
  text-align: center
}

.heatmap-name {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap
}

.heat-cell {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #ede6dc
}

.heat-cell.done {
  background: #6f8c72
}

.heat-cell.partial {
  background: #b7c8b8
}

.streak-badge {
  margin-left: 8px;
  color: var(--sage);
  font-size: 10px
}

.profile-card {
  box-shadow: none
}

.target-progress {
  background: #f0e9df
}

.target-progress .panel-head>span {
  font-size: 22px;
  font-weight: 700
}

.health-note {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .45);
  color: var(--muted);
  font-size: 11px
}

.health-note.warning {
  background: #f2ddd7;
  color: #874b3b
}

.line-chart-wrap {
  width: 100%;
  overflow-x: auto
}

.line-chart {
  display: block;
  width: 100%;
  min-width: 660px;
  height: auto;
  aspect-ratio: 760/280;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision
}

.line-chart text {
  stroke: none !important;
  paint-order: normal
}

.line-chart line,
.line-chart path,
.line-chart circle {
  stroke-linecap: round;
  stroke-linejoin: round
}

.legend-inline {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 10px
}

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

.legend-inline i {
  width: 14px;
  height: 3px;
  border-radius: 2px
}

.dot-weight {
  background: var(--plum)
}

.dot-average {
  background: var(--terra)
}

.weekly-plan {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #faf7f2
}

.plan-item.done {
  opacity: .65
}

.plan-item.done strong {
  text-decoration: line-through
}

.plan-item button {
  margin-top: 1px
}

.plan-item strong,
.plan-item small {
  display: block
}

.plan-item>span {
  min-width: 0;
  flex: 1
}

.plan-item strong {
  font-size: 12px
}

.plan-delete {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a79a90;
  opacity: 0
}

.plan-item:hover .plan-delete {
  opacity: 1
}

.plan-delete:hover,
.habit-card-delete:hover {
  background: #f3e3dc;
  color: var(--terra)
}

.plan-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px
}

.date-groups,
.archive-list {
  gap: 10px
}

.date-group,
.archive-day {
  border: 1px solid #e3dbd0;
  border-radius: 15px;
  overflow: hidden
}

.date-group summary,
.archive-day summary {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  background: #faf7f2
}

.date-group summary::-webkit-details-marker,
.archive-day summary::-webkit-details-marker {
  display: none
}

.date-group summary strong,
.archive-day summary strong {
  font-size: 13px
}

.date-group summary span,
.archive-day summary span {
  color: #958b80;
  font-size: 10px
}

.group-body {
  padding: 3px 12px 10px
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px
}

.week-day {
  min-height: 92px;
  padding: 11px 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #faf7f2;
  text-align: center
}

.week-day.today {
  background: var(--plum);
  border-color: var(--plum);
  color: white
}

.week-day span,
.week-day strong,
.week-day small {
  display: block
}

.week-day span {
  font-size: 10px
}

.week-day strong {
  margin: 4px 0;
  font-size: 20px
}

.week-day small {
  color: var(--muted);
  font-size: 9px
}

.week-day.today small {
  color: rgba(255, 255, 255, .7)
}

.overdue .task-title {
  color: var(--red)
}

.list-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: #ebe3d8;
  color: #7e7062;
  font-size: 8px
}

.shopping-list {
  gap: 7px
}

.shopping-row {
  display: grid;
  grid-template-columns: 30px 1fr auto 32px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 9px 8px;
  border-bottom: 1px solid #eee7df
}

.shopping-row.bought {
  opacity: .58
}

.shopping-row.bought .shopping-main strong {
  text-decoration: line-through
}

.shopping-main strong,
.shopping-main small {
  display: block
}

.shopping-main strong {
  font-size: 13px
}

.shopping-main small {
  color: var(--muted);
  font-size: 10px
}

.shopping-price {
  text-align: right
}

.shopping-price strong,
.shopping-price small {
  display: block
}

.shopping-price small {
  color: var(--muted);
  font-size: 9px
}

.urgent-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--red)
}

.archive-head {
  margin: 6px 0 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px
}

.archive-head h2 {
  font-size: 26px
}

.filter-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap
}

.filter-chips button {
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: #72695f;
  font-size: 11px
}

.filter-chips button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white
}

.archive-day {
  background: var(--card)
}

.archive-record {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 7px 5px;
  border-bottom: 1px solid #eee7df
}

.archive-record:last-child {
  border-bottom: 0
}

.type-tag {
  width: max-content;
  padding: 4px 8px;
  border-radius: 7px;
  background: #eee7de;
  color: #74695d;
  font-size: 10px
}

.archive-record strong {
  font-size: 12px
}

.archive-record small {
  display: block;
  color: #958a7f;
  font-size: 10px
}

.media-layout {
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr)
}

.cover-upload {
  display: block;
  cursor: pointer
}

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

.cover-upload>span {
  min-height: 92px;
  padding: 14px;
  border: 1px dashed #cfc2d0;
  border-radius: 14px;
  background: #faf7fb;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  color: var(--plum)
}

.cover-upload svg {
  grid-row: 1/3;
  width: 24px
}

.cover-upload b,
.cover-upload small {
  display: block
}

.cover-upload b {
  font-size: 12px
}

.cover-upload small {
  color: var(--muted);
  font-size: 10px
}

.cover-upload.has-cover>span {
  min-height: 160px;
  background-size: cover;
  background-position: center;
  border-style: solid
}

.cover-upload.has-cover>span>* {
  display: none
}

.cover-upload.drag-over>span {
  border-color: var(--plum);
  background: #f0eaf2;
}

.annual-card {
  background: linear-gradient(135deg, var(--plum), #76536e);
  color: white
}

.annual-card .eyebrow,
.annual-card .mini-note {
  color: rgba(255, 255, 255, .68)
}

.rating-distribution {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 12px;
  height: 110px
}

.rating-bar {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  text-align: center
}

.rating-bar span {
  display: block;
  min-height: 4px;
  height: var(--h);
  border-radius: 8px 8px 3px 3px;
  background: rgba(255, 255, 255, .78)
}

.rating-bar b,
.rating-bar small {
  font-size: 9px
}

.rating-bar small {
  color: rgba(255, 255, 255, .7)
}

.media-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px
}

.media-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end
}

.view-toggle {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: #eee8df
}

.view-toggle button {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px
}

.view-toggle button.active {
  background: white;
  color: var(--plum);
  box-shadow: 0 2px 8px rgba(50, 38, 28, .08)
}

.media-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 24px 18px
}

.media-card {
  position: relative;
  min-width: 0
}

.media-cover {
  aspect-ratio: 3/4;
  border-radius: 13px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--plum-soft), #f0ebe5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plum);
  box-shadow: 0 10px 24px rgba(58, 42, 50, .08)
}

.media-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.media-placeholder {
  padding: 18px;
  text-align: center;
  font: 700 20px/1.35 "Songti SC", serif;
  word-break: break-word
}

.media-card-body {
  padding: 10px 3px 0
}

.media-card h3 {
  margin: 0;
  font: 700 13px/1.4 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.media-meta {
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 9px
}

.stars {
  color: #8a5a81;
  letter-spacing: 1px;
  white-space: nowrap
}

.media-review {
  margin: 6px 0 0;
  color: #796f66;
  font-size: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.media-delete {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .9);
  color: #8b777c;
  opacity: 0
}

.media-card:hover .media-delete {
  opacity: 1
}

.media-list {
  display: flex;
  flex-direction: column;
  gap: 0
}

.media-list .media-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #eee7df
}

.media-list .media-cover {
  width: 58px;
  aspect-ratio: 3/4;
  border-radius: 8px
}

.media-list .media-placeholder {
  padding: 5px;
  font-size: 10px
}

.media-list .media-card-body {
  padding: 0
}

.media-list .media-delete {
  position: static;
  opacity: 1
}

.media-stat strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.custom-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700
}

.custom-list-head small {
  font-weight: 400
}

.custom-manage-list {
  max-height: 230px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 3px
}

.custom-manage-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf7f2
}

.custom-manage-row strong,
.custom-manage-row small {
  display: block
}

.custom-manage-row strong {
  font-size: 12px
}

.custom-manage-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px
}

.custom-manage-row button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a09187
}

.custom-manage-row button:hover {
  background: #f3e3dc;
  color: var(--terra)
}

.fitness-profile-sheet {
  width: min(600px, 100%)
}

.fitness-profile-sheet .field>span {
  font-size: 13px
}

.fitness-profile-sheet .field input,
.fitness-profile-sheet .field select {
  height: 52px;
  font-size: 16px
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 26, 22, .38);
  backdrop-filter: blur(6px)
}

.settings-backdrop[hidden] {
  display: none
}

.settings-sheet {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 28px 80px rgba(36, 26, 22, .24)
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px
}

.sheet-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf7f2;
  font-size: 24px;
  line-height: 1
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 17px;
  background: #eee7dd
}

.brand-preview strong,
.brand-preview span {
  display: block
}

.brand-preview strong {
  font: 700 20px/1.3 "Songti SC", serif
}

.brand-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px
}

.settings-sheet form {
  display: flex;
  flex-direction: column;
  gap: 16px
}

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

.theme-swatches input {
  position: absolute;
  opacity: 0
}

.theme-swatches label {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer
}

.theme-swatches i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08)
}

.theme-swatches b {
  font-size: 10px;
  font-weight: 600
}

.theme-swatches input:checked~i {
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--plum)
}

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

.mobile-nav {
  display: none
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 11px 17px;
  border-radius: 12px;
  background: #27231f;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  font-size: 12px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: .25s
}

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

.confetti {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  overflow: hidden
}

.confetti i {
  position: absolute;
  left: var(--x);
  top: 45%;
  width: 7px;
  height: 12px;
  border-radius: 3px;
  background: var(--c);
  animation: burst .85s ease-out forwards
}

@keyframes burst {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(280deg);
    opacity: 0
  }
}

@media(max-width:1280px) {
  .split-grid {
    grid-template-columns: 1fr
  }

  .pie-wrap {
    grid-template-columns: 210px minmax(130px, 1fr)
  }
}

@media(max-width:1180px) {
  .main-content {
    padding-left: 26px;
    padding-right: 26px
  }

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

  .quick-panel {
    grid-column: span 1
  }

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

  .stat-card:last-of-type {
    grid-column: span 2
  }

  .module-layout {
    grid-template-columns: 310px minmax(0, 1fr)
  }

  .daily-habits {
    grid-template-columns: repeat(3, 1fr)
  }
}

@media(max-width:860px) {
  :root {
    --sidebar: 0px
  }

  html,
  body {
    overflow-x: hidden
  }

  .sidebar {
    display: none
  }

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

  .topbar {
    min-height: 88px;
    padding-top: 18px;
    align-items: center;
    flex-wrap: wrap
  }

  .topbar>div:first-child {
    flex: 1;
    min-width: 150px
  }

  .topbar h1 {
    font-size: 24px
  }

  .top-actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.35fr)
  }

  .top-actions .save-state {
    display: none
  }

  .top-actions:has(#clearSamplesBtn[hidden]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr)
  }

  .top-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0 8px;
    white-space: nowrap
  }

  .top-actions #clearSamplesBtn span {
    display: none
  }

  .dashboard-grid {
    display: flex;
    flex-direction: column
  }

  .hero-card {
    min-height: 190px
  }

  .quick-panel {
    order: -1
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr))
  }

  .quick-action {
    min-height: 96px;
    padding: 14px 10px
  }

  .quick-action span small {
    display: none
  }

  .module-layout {
    display: flex;
    flex-direction: column
  }

  .form-panel,
  .sticky-stack {
    position: static;
    width: 100%
  }

  .module-main {
    width: 100%
  }

  .mobile-nav {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 40;
    height: 66px;
    padding: 6px;
    border: 1px solid rgba(85, 69, 55, .14);
    border-radius: 20px;
    background: rgba(255, 252, 247, .94);
    box-shadow: 0 14px 35px rgba(53, 41, 31, .16);
    backdrop-filter: blur(14px)
  }

  .mobile-nav button {
    min-width: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #847a70;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 9px
  }

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

  .mobile-nav button.active {
    background: var(--plum);
    color: #fff
  }

  .daily-habits {
    grid-template-columns: repeat(2, 1fr)
  }

  .archive-head {
    align-items: flex-start;
    flex-direction: column
  }

  .archive-record {
    grid-template-columns: 72px 1fr
  }

  .archive-record>span:last-child {
    display: none
  }

  .delete-btn,
  .habit-card-delete,
  .plan-delete {
    opacity: 1
  }

  .section-actions {
    justify-content: flex-start;
    overflow-x: auto
  }

  .media-toolbar {
    align-items: flex-start;
    flex-direction: column
  }

  .media-controls {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 3px
  }

  .media-controls>* {
    flex: 0 0 auto
  }

  .media-delete {
    opacity: 1
  }

  .section-actions .btn {
    min-height: 46px;
    white-space: nowrap
  }

  .system-alert {
    align-items: flex-start
  }

  .system-alert .btn {
    white-space: nowrap
  }

  .week-strip {
    overflow-x: auto;
    grid-template-columns: repeat(7, 78px)
  }

  .pie-wrap {
    grid-template-columns: 190px 1fr
  }

  .pie-wrap svg {
    width: 190px;
    height: 190px
  }
}

@media(max-width:560px) {
  body {
    font-size: 14px
  }

  .main-content {
    padding-left: 12px;
    padding-right: 12px
  }

  .topbar {
    gap: 8px
  }

  .topbar h1 {
    font-size: 21px
  }

  .panel {
    padding: 18px;
    border-radius: 19px
  }

  .quick-panel {
    padding: 17px
  }

  .quick-grid {
    gap: 7px
  }

  .quick-action {
    min-height: 84px;
    padding: 12px 8px
  }

  .quick-action>svg {
    width: 19px
  }

  .quick-action span strong {
    font-size: 11px;
    white-space: nowrap
  }

  .quick-action i {
    font-size: 15px;
    right: 8px;
    top: 8px
  }

  .hero-card {
    padding: 24px
  }

  .hero-card h2 {
    font-size: 54px
  }

  .metric-row {
    gap: 7px
  }

  .metric {
    min-height: 88px;
    padding: 14px 12px
  }

  .metric strong {
    font-size: 18px
  }

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

  .daily-habits {
    grid-template-columns: 1fr
  }

  .daily-habit {
    min-height: 122px
  }

  .habit-action {
    grid-template-columns: 70px minmax(0, 1fr)
  }

  .theme-swatches {
    grid-template-columns: repeat(2, 1fr)
  }

  .media-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 13px
  }

  .rating-distribution {
    gap: 7px
  }

  .settings-sheet {
    padding: 20px
  }

  .weekly-plan {
    grid-template-columns: 1fr
  }

  .pie-wrap {
    grid-template-columns: 1fr
  }

  .pie-wrap svg {
    margin: auto
  }

  .record-row {
    grid-template-columns: 38px 1fr auto 30px;
    gap: 8px
  }

  .record-row .record-main small {
    max-width: 140px
  }

  .filter-chips {
    width: 100%;
    overflow: auto;
    flex-wrap: nowrap;
    padding-bottom: 3px
  }

  .filter-chips button {
    flex: 0 0 auto;
    min-height: 38px
  }

  .panel-head:has(.filter-chips) {
    flex-direction: column
  }

  .compare-card {
    align-items: flex-start;
    flex-direction: column
  }

  .system-alert {
    flex-direction: column
  }

  .system-alert .btn {
    width: 100%;
    min-height: 46px
  }

  .shopping-row {
    grid-template-columns: 28px 1fr auto 30px
  }

  .archive-head h2 {
    font-size: 23px
  }

  .legend-inline {
    display: none
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important
  }
}

.lang-switch {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(85, 69, 55, .14);
  border-radius: 999px;
  background: rgba(255, 253, 250, .94);
  box-shadow: 0 8px 24px rgba(53, 41, 31, .12);
  backdrop-filter: blur(12px)
}

.lang-switch button {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700
}

.lang-switch button.active {
  background: var(--plum);
  color: #fff
}

.lang-switch span {
  color: #b2a89d;
  font-size: 10px
}

.lang-switch button:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 2px
}

@media(max-width:860px) {
  .lang-switch {
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom))
  }
}


/* === ATOM LAB THEME === */
:root {
  --paper: #F4F4F6;
  --card: #FFFFFF;
  --ink: #0A0A0C;
  --muted: #6E6E73;
  --line: rgba(0, 0, 0, 0.08);
  --plum: #0A0A0C;
  --plum-soft: #EDEDF2;
  --terra: #2C2C30;
  --terra-soft: #EFEFF4;
  --sage: #48484A;
  --sage-soft: #E8E8EE;
  --sand: #636366;
  --sand-soft: #F2F2F7;
  --red: #D70015;
  --green: #248A3D;
}

.sidebar {
  background: #EAEAEF;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

/* --- NAV ACTIVE STRIPE --- */
.nav-item.active {
  background: transparent !important;
  color: #0A0A0C !important;
  font-weight: bold;
  position: relative;
}

.nav-item.active svg {
  color: #0A0A0C !important;
  fill: #0A0A0C !important;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0px;
  top: 15%;
  height: 70%;
  width: 4px;
  background: #0A0A0C;
  border-radius: 0 4px 4px 0;
}

/* --- LOGO ANIMATION & STYLES --- */
.brand-mark {
  background: transparent !important;
  box-shadow: none !important;
  margin: 0;
  padding: 0;
  width: auto !important;
  height: auto !important;
}

.navbar-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}

.nav-draw-path {
  fill: currentColor;
  stroke: none;
  stroke-width: 2px;
  stroke-dasharray: 820;
  stroke-dashoffset: 0;
  transition: fill 0.4s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.navbar-logo-link:hover .navbar-logo-svg .nav-draw-path,
.navbar-logo-link:active .navbar-logo-svg .nav-draw-path,
.navbar-logo-link.touch-active .navbar-logo-svg .nav-draw-path {
  fill: none;
  stroke: currentColor;
  stroke-dashoffset: 820;
  animation: strokeDraw 4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes strokeDraw {
  0% {
    stroke-dashoffset: 820;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

/* --- HERO CARD COMPACT & ASTRO BOY CENTERED --- */
.hero-card {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
  position: relative;
  overflow: hidden;
  min-height: 140px !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-card>div {
  position: relative;
  z-index: 1;
}

.hero-card h2 {
  color: #FFFFFF !important;
  margin: 6px 0 6px !important;
  font-size: 46px !important;
}

.hero-card .eyebrow {
  color: rgba(255, 255, 255, 0.6) !important;
}

.hero-card p {
  color: rgba(255, 255, 255, 0.8) !important;
}

.hero-card p:last-child {
  max-width: 200px !important;
  margin-bottom: 0 !important;
}

.hero-card::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 160px;
  background: url('/assets/hero.png') no-repeat right center / contain;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

.score-orbit {
  display: none !important;
}

/* --- LEFT COMPONENT (QUICK PANEL) COORDINATION --- */
.quick-panel {
  padding: 16px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quick-panel .panel-head {
  margin-bottom: 12px !important;
}

.quick-action {
  min-height: 70px !important;
  padding: 12px 10px !important;
}

.quick-action>svg {
  width: 18px !important;
  height: 18px !important;
}

.quick-action i {
  top: 8px !important;
  right: 8px !important;
  font-size: 14px !important;
}

/* --- OTHER THEME ELEMENTS --- */
.heat-cell {
  background: #E5E5EA !important;
}

.heat-cell.done {
  background: #0A0A0C !important;
}

.heat-cell.partial {
  background: #8E8E93 !important;
}

.daily-habit.done .habit-check {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
}

.habit-check.checked {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
}

.week-day.active,
.week-day[aria-selected=true] {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
}

.filter-chips button.active {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
}

.view-toggle button.active {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
}

.btn.primary,
button[type=submit].btn {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
}

.check-btn.checked {
  background: #0A0A0C !important;
  color: #FFFFFF !important;
  border-color: #0A0A0C !important;
}

.annual-card {
  background: linear-gradient(135deg, #0A0A0C, #2C2C30) !important;
}

[hidden] {
  display: none !important;
}

.brand-mark svg {
  width: 100% !important;
  height: 100% !important;
}

/* --- INTERACTIVE MEDIA STATUS & STARS --- */
.media-meta {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}
.media-status-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: inherit;
  color: #0A0A0C;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}
.media-status-select:hover, .media-status-select:focus {
  background: #0A0A0C;
  color: #FFFFFF;
  border-color: #0A0A0C;
}
.stars-interactive {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.star-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: rgba(0,0,0,0.18);
  cursor: pointer;
  transition: color 0.15s, transform 0.1s;
}
.star-btn:hover {
  transform: scale(1.25);
  color: #6E6E73;
}
.star-btn.active {
  color: #0A0A0C !important;
}
.media-type-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}