:root {
  --ink: #17382d;
  --ink-soft: #476156;
  --muted: #7c8c83;
  --paper: #f3f2ea;
  --paper-deep: #eae9df;
  --card: #fffdf7;
  --line: rgba(23, 56, 45, 0.11);
  --green: #2f6f53;
  --green-dark: #173c30;
  --green-soft: #dce9d7;
  --lime: #e1f4a4;
  --yellow: #f1ca78;
  --blue: #afcfe0;
  --pink: #efc0b9;
  --purple: #c9bada;
  --shadow: 0 18px 50px rgba(27, 54, 43, 0.07);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font: "Aptos", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 92% 7%, rgba(225, 244, 164, 0.3), transparent 24rem),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(47, 111, 83, 0.25);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

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

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  width: min(100%, 1560px);
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 34px 24px 26px;
  overflow: hidden;
  background: var(--green-dark);
  color: #f7f4e9;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: 150px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(225, 244, 164, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(225, 244, 164, 0.03),
    0 0 0 64px rgba(225, 244, 164, 0.02);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 34px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--lime);
  color: var(--green-dark);
  transform: rotate(-5deg);
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 20px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  margin-top: 3px;
  color: rgba(247, 244, 233, 0.46);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 13px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(247, 244, 233, 0.61);
  cursor: pointer;
  text-align: left;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

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

.nav-item span {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fffdf7;
  transform: translateX(2px);
}

.nav-item.is-active {
  background: rgba(255, 253, 247, 0.1);
  color: #f8f6ed;
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  right: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(225, 244, 164, 0.08);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-note {
  position: relative;
  margin: 20px 2px;
  padding: 22px 20px 19px;
  border: 1px solid rgba(225, 244, 164, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-note-icon {
  position: absolute;
  top: -13px;
  right: 18px;
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green-dark);
  transform: rotate(18deg);
}

.sidebar-note p {
  margin: 0 0 15px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.05em;
}

.sidebar-note span {
  color: rgba(247, 244, 233, 0.42);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(225, 244, 164, 0.35);
  border-radius: 50%;
  background: rgba(225, 244, 164, 0.12);
  color: var(--lime);
  font-family: "Songti SC", serif;
  font-size: 13px;
}

.sidebar-footer div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer strong {
  font-size: 12px;
  font-weight: 600;
}

.sidebar-footer span {
  color: rgba(247, 244, 233, 0.4);
  font-size: 9px;
}

.member-switch {
  margin-left: auto;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: transparent;
  color: rgba(247, 244, 233, 0.52);
  font-size: 8px;
  cursor: pointer;
}

.member-switch:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fffdf7;
}

.workspace {
  min-width: 0;
  padding: 0 clamp(28px, 4vw, 64px) 62px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 108px;
  gap: 24px;
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 14px;
}

.topbar-actions {
  gap: 14px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.topbar-date {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.today-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.58);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ba745;
  box-shadow: 0 0 0 4px rgba(123, 167, 69, 0.12);
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: #5c4318;
  font-family: "Songti SC", serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.view {
  animation: view-in 360ms ease both;
}

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

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(255px, 292px);
  align-items: start;
  gap: 22px;
}

.dashboard-main,
.dashboard-rail {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.hero-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 244px;
  gap: 36px;
  padding: clamp(28px, 3.3vw, 44px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0.2), transparent 50%),
    var(--lime);
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(23, 60, 48, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.hero-card::before {
  width: 350px;
  height: 350px;
  right: -130px;
  top: -170px;
}

.hero-card::after {
  width: 245px;
  height: 245px;
  right: -78px;
  bottom: -135px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 530px;
}

.hero-eyebrow {
  color: rgba(23, 60, 48, 0.5);
}

.hero-copy h1,
.page-heading h1 {
  margin: 13px 0 12px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 440px;
  margin: 0;
  color: rgba(23, 60, 48, 0.7);
  font-size: 13px;
  line-height: 1.75;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid rgba(23, 60, 48, 0.32);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.text-link .icon {
  width: 16px;
  height: 16px;
  transition: transform 180ms ease;
}

.text-link:hover .icon {
  transform: translateX(4px);
}

.hero-progress {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  margin-right: 12px;
}

.progress-orbit {
  position: relative;
  width: 144px;
  height: 144px;
}

.progress-ring {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 7;
}

.ring-track {
  stroke: rgba(23, 60, 48, 0.11);
}

.ring-value {
  stroke: var(--green-dark);
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  stroke-linecap: round;
  transition: stroke-dashoffset 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.progress-center strong {
  font-family: "Aptos Display", var(--font);
  font-size: 27px;
  letter-spacing: -0.04em;
}

.progress-center span {
  margin-top: 2px;
  color: rgba(23, 60, 48, 0.54);
  font-size: 9px;
}

.orbit-leaf {
  position: absolute;
  width: 14px;
  height: 8px;
  border-radius: 100% 0 100% 0;
  background: var(--green);
}

.leaf-one {
  top: 13px;
  right: 2px;
  transform: rotate(-32deg);
}

.leaf-two {
  bottom: 13px;
  left: -3px;
  transform: rotate(148deg);
}

.hero-progress > p {
  max-width: 170px;
  margin: 12px 0 0;
  color: rgba(23, 60, 48, 0.6);
  font-size: 10px;
  text-align: center;
}

.panel {
  border: 1px solid rgba(23, 56, 45, 0.06);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 10px 36px rgba(25, 52, 42, 0.035);
}

.week-panel,
.habits-panel {
  padding: 25px 27px;
}

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

.panel-heading h2 {
  margin: 6px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.week-navigation {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

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

.icon-button:disabled {
  opacity: 0.3;
}

.icon-button .icon {
  width: 16px;
  height: 16px;
}

.text-button {
  padding: 6px 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

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

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

.day-cell {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
  padding: 11px 4px 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, border 160ms ease, transform 160ms ease;
}

.day-cell:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--paper);
}

.day-cell.is-selected {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fffdf7;
  box-shadow: 0 8px 20px rgba(23, 60, 48, 0.17);
  transform: translateY(-2px);
}

.day-cell:disabled {
  cursor: default;
  opacity: 0.36;
}

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

.day-cell.is-selected .day-name {
  color: rgba(255, 253, 247, 0.55);
}

.day-number {
  font-size: 15px;
  font-weight: 700;
}

.day-status {
  position: relative;
  width: 42px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.day-cell.is-selected .day-status {
  background: rgba(255, 255, 255, 0.2);
}

.day-status i {
  display: block;
  width: var(--day-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.day-cell.is-selected .day-status i {
  background: var(--lime);
}

.day-cell.is-today .day-number::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
  opacity: 0.6;
}

.soft-button,
.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.soft-button {
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green);
  font-size: 10px;
}

.soft-button:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.soft-button .icon,
.primary-button .icon,
.danger-button .icon {
  width: 15px;
  height: 15px;
}

.habit-list {
  display: grid;
  gap: 2px;
  margin-top: 18px;
}

.habit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 11px 14px 13px;
  border-top: 1px solid var(--line);
  transition: background 180ms ease;
}

.habit-row:first-child {
  border-top: 0;
}

.habit-row:hover {
  border-radius: 15px;
  background: rgba(243, 242, 234, 0.58);
}

.habit-icon,
.summary-icon,
.stat-icon {
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.habit-icon {
  width: 45px;
  height: 45px;
}

.habit-icon .icon {
  width: 21px;
  height: 21px;
}

.color-green {
  background: var(--green-soft);
  color: #326a50;
}

.color-yellow {
  background: #f7e5bb;
  color: #9b6f22;
}

.color-blue {
  background: #d8e8ef;
  color: #4b8199;
}

.color-pink {
  background: #f4d9d4;
  color: #a65c55;
}

.color-purple {
  background: #e7dfef;
  color: #77648c;
}

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

.habit-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.habit-title-line strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-badge {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 8px;
}

.habit-meta {
  display: flex;
  align-items: center;
  min-height: 17px;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.habit-meta .icon {
  width: 13px;
  height: 13px;
}

.habit-progress {
  display: flex;
  align-items: center;
  width: 160px;
  gap: 9px;
  margin-top: 7px;
}

.habit-progress-track {
  height: 4px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.habit-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.habit-progress span {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.habit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-edit {
  opacity: 0;
  transition: opacity 160ms ease;
}

.habit-row:hover .row-edit,
.row-edit:focus-visible {
  opacity: 1;
}

.check-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1.5px solid rgba(23, 56, 45, 0.18);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.check-button:hover {
  border-color: var(--green);
  color: var(--green);
  transform: scale(1.05);
}

.check-button .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.3;
}

.check-button.is-done {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.check-button.is-done:hover {
  background: var(--green-dark);
}

.check-button.is-counter:not(.is-done) {
  color: var(--green);
  font-size: 19px;
  font-weight: 500;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
}

.empty-state .empty-illustration {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.empty-state .empty-illustration .icon {
  width: 29px;
  height: 29px;
}

.empty-state h3 {
  margin: 0 0 7px;
  font-family: "Songti SC", serif;
  font-size: 18px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.rail-card {
  border-radius: var(--radius-md);
}

.streak-card {
  position: relative;
  min-height: 196px;
  padding: 21px 22px;
  overflow: hidden;
  background: var(--green-dark);
  color: #f9f6ec;
}

.streak-top,
.rail-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rail-icon {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 10px;
}

.rail-icon .icon {
  width: 17px;
  height: 17px;
}

.rail-icon.warm {
  background: rgba(241, 202, 120, 0.13);
  color: var(--yellow);
}

.streak-chip {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: rgba(249, 246, 236, 0.47);
  font-size: 8px;
}

.streak-card > p {
  margin: 17px 0 2px;
  color: rgba(249, 246, 236, 0.49);
  font-size: 10px;
}

.streak-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.streak-value strong {
  color: var(--lime);
  font-family: "Aptos Display", var(--font);
  font-size: 43px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.streak-value span {
  color: rgba(249, 246, 236, 0.48);
  font-size: 10px;
}

.streak-card .streak-note {
  max-width: 180px;
  margin-top: 5px;
  color: rgba(249, 246, 236, 0.38);
  font-size: 9px;
  line-height: 1.55;
}

.sprout-track {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 59px;
  height: 75px;
}

.sprout-stem {
  position: absolute;
  right: 28px;
  bottom: 0;
  width: 1.5px;
  height: 60px;
  background: rgba(225, 244, 164, 0.33);
}

.sprout-leaf {
  position: absolute;
  width: 22px;
  height: 12px;
  border-radius: 100% 0 100% 0;
  background: rgba(225, 244, 164, 0.65);
}

.sprout-leaf.left {
  right: 28px;
  bottom: 31px;
  transform: scaleX(-1) rotate(10deg);
}

.sprout-leaf.right {
  right: 6px;
  bottom: 49px;
  transform: rotate(-11deg);
}

.sprout-bud {
  position: absolute;
  right: 23px;
  top: 0;
  width: 11px;
  height: 17px;
  border-radius: 100% 0 100% 0;
  background: var(--lime);
  transform: rotate(35deg);
}

.weekly-card {
  padding: 21px 22px 18px;
  border: 1px solid rgba(23, 56, 45, 0.07);
  background: var(--card);
}

.rail-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.rail-card-heading strong {
  display: block;
  margin-top: 3px;
  font-family: "Aptos Display", var(--font);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.trend-tag {
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 8px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  height: 82px;
  gap: 7px;
  margin-top: 16px;
}

.bar-slot {
  position: relative;
  display: flex;
  align-items: end;
  height: 100%;
}

.bar-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: rgba(23, 56, 45, 0.035);
}

.bar-slot i {
  position: relative;
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 5px;
  background: #b8d2ba;
  transition: height 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar-slot.is-current i {
  background: var(--green);
}

.bar-slot.is-full i {
  background: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(23, 60, 48, 0.08);
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.gentle-card {
  position: relative;
  padding: 21px 22px 19px;
  border: 1px dashed rgba(23, 56, 45, 0.14);
  background: rgba(255, 253, 247, 0.47);
}

.quote-mark {
  position: absolute;
  top: 10px;
  left: 17px;
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1;
  opacity: 0.16;
}

.gentle-card p {
  position: relative;
  margin: 8px 0 12px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  line-height: 1.7;
}

.quote-author {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
}

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

.page-heading h1 {
  margin-top: 10px;
  font-size: clamp(34px, 4vw, 46px);
}

.page-heading > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.primary-button {
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
  color: #fffdf7;
  font-size: 11px;
  box-shadow: 0 8px 22px rgba(23, 60, 48, 0.14);
}

.primary-button:hover {
  box-shadow: 0 11px 26px rgba(23, 60, 48, 0.2);
}

.habit-garden-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 17px 20px;
  border: 1px solid rgba(23, 56, 45, 0.06);
  border-radius: 18px;
  background: var(--lime);
}

.habit-garden-summary > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.summary-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.45);
}

.summary-icon .icon {
  width: 17px;
  height: 17px;
}

.habit-garden-summary p {
  margin: 0;
  color: rgba(23, 60, 48, 0.66);
  font-size: 10px;
}

.habit-garden-summary > div p {
  color: var(--ink);
  font-size: 12px;
}

.habit-garden-summary strong {
  font-size: 18px;
}

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

.habit-card {
  position: relative;
  min-width: 0;
  padding: 21px;
  border: 1px solid rgba(23, 56, 45, 0.07);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 10px 30px rgba(25, 52, 42, 0.025);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.habit-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.habit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.habit-card .habit-icon {
  width: 48px;
  height: 48px;
}

.habit-card-copy {
  min-width: 0;
  flex: 1;
}

.habit-card-copy strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-card-copy span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.habit-card-metrics {
  display: flex;
  gap: 24px;
  margin: 20px 0 17px;
}

.habit-card-metrics div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.habit-card-metrics span {
  color: var(--muted);
  font-size: 8px;
}

.habit-card-metrics strong {
  font-size: 15px;
  font-weight: 650;
}

.habit-card-week {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mini-day {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 8px;
}

.mini-day i {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: transparent;
}

.mini-day i .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.mini-day.is-done i {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.mini-day.is-today {
  color: var(--green);
  font-weight: 700;
}

.heading-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border: 1px solid rgba(23, 56, 45, 0.08);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.65);
  color: var(--green);
  font-size: 10px;
}

.heading-badge .icon {
  width: 17px;
  height: 17px;
}

.join-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 32px 20px;
  place-items: center;
  background:
    radial-gradient(circle at 12% 12%, rgba(225, 244, 164, 0.82), transparent 28rem),
    radial-gradient(circle at 88% 82%, rgba(175, 207, 224, 0.48), transparent 30rem),
    #eef0e4;
}

.join-card {
  position: relative;
  width: min(100%, 475px);
  padding: 34px 38px 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 30px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 30px 90px rgba(23, 60, 48, 0.15);
  backdrop-filter: blur(16px);
}

.join-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
  color: var(--ink);
}

.join-brand .brand-mark {
  width: 39px;
  height: 39px;
}

.join-brand .brand-copy strong {
  font-size: 18px;
}

.join-brand .brand-copy small {
  color: var(--muted);
}

.join-illustration {
  position: absolute;
  top: 24px;
  right: 30px;
  width: 116px;
  height: 96px;
  border-radius: 50%;
  background: rgba(225, 244, 164, 0.45);
}

.join-illustration .icon {
  position: absolute;
  right: 31px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  color: var(--green);
  stroke-width: 1.35;
  transform: rotate(-5deg);
}

.join-illustration > span {
  position: absolute;
  border: 1px solid rgba(47, 111, 83, 0.12);
  border-radius: 50%;
}

.join-illustration > span:nth-child(1) {
  inset: 8px;
}

.join-illustration > span:nth-child(2) {
  inset: -13px;
}

.join-illustration > span:nth-child(3) {
  right: -27px;
  bottom: -21px;
  width: 55px;
  height: 55px;
  background: rgba(255, 255, 255, 0.2);
}

.join-card h1 {
  max-width: 330px;
  margin: 13px 0 12px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 35px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.join-description {
  max-width: 340px;
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.join-card .field {
  margin-bottom: 15px;
}

.join-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.join-submit .icon {
  margin-left: auto;
}

.admin-entry {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin: 16px auto 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.admin-entry:hover {
  background: var(--green-soft);
  color: var(--green);
}

.form-error {
  min-height: 17px;
  margin: 5px 0 4px;
  color: #aa4e45;
  font-size: 9px;
  line-height: 1.6;
}

.admin-login-copy {
  margin: -8px 0 20px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.member-page-heading {
  align-items: center;
}

.refresh-members .icon {
  transform: rotate(-35deg);
}

.invite-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 18px;
  padding: 24px 26px;
  border-radius: 24px;
  background: var(--green-dark);
  color: #f9f6ec;
}

.invite-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.invite-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: rgba(225, 244, 164, 0.13);
  color: var(--lime);
}

.invite-icon .icon {
  width: 22px;
  height: 22px;
}

.invite-copy .section-kicker {
  color: rgba(225, 244, 164, 0.55);
}

.invite-copy h2 {
  margin: 6px 0 4px;
  font-family: "Songti SC", serif;
  font-size: 19px;
  font-weight: 550;
}

.invite-copy p:last-child {
  margin: 0;
  color: rgba(249, 246, 236, 0.48);
  font-size: 9px;
}

.invite-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.invite-actions code {
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--lime);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.invite-actions .primary-button {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--green-dark);
  box-shadow: none;
}

.community-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.community-stat {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid rgba(23, 56, 45, 0.065);
  border-radius: 18px;
  background: var(--card);
}

.community-stat .stat-icon {
  width: 31px;
  height: 31px;
}

.community-stat p {
  margin: 13px 0 5px;
  color: var(--muted);
  font-size: 8px;
}

.community-stat strong {
  font-family: "Aptos Display", var(--font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.community-stat small {
  color: var(--muted);
  font-family: var(--font);
  font-size: 8px;
  font-weight: 500;
}

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

.member-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 56, 45, 0.07);
  border-radius: 21px;
  background: var(--card);
}

.member-card-main {
  display: grid;
  grid-template-columns: minmax(130px, 1.15fr) minmax(175px, 1fr);
  align-items: center;
  gap: 17px 22px;
  padding: 20px;
}

.member-profile {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.member-avatar-large {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-family: "Songti SC", serif;
  font-size: 14px;
  font-weight: 700;
}

.member-profile h3 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
}

.member-metrics {
  display: flex;
  justify-content: flex-end;
  gap: 19px;
}

.member-metrics span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-metrics small {
  color: var(--muted);
  font-size: 7px;
  white-space: nowrap;
}

.member-metrics strong {
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.member-progress-wrap {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 10px;
}

.member-progress-value {
  width: 29px;
  color: var(--green);
  font-size: 8px;
  font-weight: 700;
}

.member-progress-track {
  height: 5px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.member-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #85aa74);
}

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

.member-details summary {
  padding: 12px 20px;
  color: var(--muted);
  font-size: 8px;
  cursor: pointer;
  list-style: none;
}

.member-details summary::after {
  content: "+";
  float: right;
  font-size: 12px;
  line-height: 0.8;
}

.member-details[open] summary::after {
  content: "−";
}

.member-habit-list {
  display: grid;
  gap: 7px;
  padding: 0 20px 17px;
}

.member-habit-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(243, 242, 234, 0.57);
}

.member-habit-line .habit-icon {
  width: 25px;
  height: 25px;
  border-radius: 8px;
}

.member-habit-line .habit-icon .icon {
  width: 13px;
  height: 13px;
}

.member-habit-line > strong {
  overflow: hidden;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-habit-value {
  color: var(--muted);
  font-size: 8px;
}

.member-habit-value.is-done {
  color: var(--green);
  font-weight: 700;
}

.member-no-habits {
  margin: 0;
  padding: 2px 0 5px;
  color: var(--muted);
  font-size: 9px;
}

.community-loading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 10px;
}

.loading-leaf {
  width: 14px;
  height: 14px;
  border-radius: 100% 0 100% 0;
  background: var(--green);
  animation: leaf-pulse 1s ease-in-out infinite alternate;
}

@keyframes leaf-pulse {
  from { opacity: 0.35; transform: rotate(0deg) scale(0.8); }
  to { opacity: 1; transform: rotate(35deg) scale(1); }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 19px 20px;
  overflow: hidden;
  border: 1px solid rgba(23, 56, 45, 0.065);
  border-radius: 19px;
  background: var(--card);
}

.stat-icon {
  width: 34px;
  height: 34px;
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-icon.yellow {
  background: #f7e7c1;
  color: #9f741f;
}

.stat-icon.blue {
  background: #dceaf0;
  color: #4f8197;
}

.stat-icon.pink {
  background: #f3dbd6;
  color: #a76059;
}

.stat-icon .icon {
  width: 17px;
  height: 17px;
}

.stat-card p {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 9px;
}

.stat-card strong {
  font-family: "Aptos Display", var(--font);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.stat-card small {
  color: var(--muted);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(270px, 0.8fr);
  gap: 20px;
  margin-bottom: 20px;
}

.heatmap-panel,
.rhythm-panel,
.performance-panel {
  padding: 24px 26px;
}

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

.heat-legend i,
.heat-cell {
  border-radius: 3px;
}

.heat-legend i {
  width: 9px;
  height: 9px;
}

.heat-0 {
  background: #edece4;
}

.heat-1 {
  background: #d4e5cd;
}

.heat-2 {
  background: #9dc398;
}

.heat-3 {
  background: #5d9568;
}

.heat-4 {
  background: #276044;
}

.heatmap-scroll {
  margin-top: 22px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.heatmap-with-labels {
  display: flex;
  min-width: 598px;
  gap: 8px;
}

.heat-day-labels {
  display: grid;
  grid-template-rows: repeat(7, 15px);
  width: 12px;
  flex: 0 0 auto;
  gap: 4px;
  color: var(--muted);
  font-size: 7px;
}

.heat-day-labels span {
  line-height: 15px;
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 15px;
  grid-template-rows: repeat(7, 15px);
  flex: 1;
  gap: 4px;
}

.heat-cell {
  position: relative;
  width: 15px;
  height: 15px;
  border: 0;
  background: #edece4;
  cursor: help;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.heat-cell:hover {
  z-index: 1;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--green);
  transform: scale(1.16);
}

.heatmap-caption {
  margin: 13px 0 0 20px;
  color: var(--muted);
  font-size: 9px;
}

.panel-note {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 8px;
}

.rhythm-chart {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

.rhythm-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
}

.rhythm-row > span {
  color: var(--muted);
  font-size: 9px;
}

.rhythm-row > strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  text-align: right;
}

.rhythm-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.rhythm-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #7aa56b);
}

.rhythm-row.is-today > span {
  color: var(--green);
  font-weight: 800;
}

.performance-panel {
  margin-bottom: 20px;
}

.performance-list {
  display: grid;
  gap: 2px;
  margin-top: 18px;
}

.performance-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 2fr) 50px;
  align-items: center;
  gap: 20px;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}

.performance-row:first-child {
  border-top: 0;
}

.performance-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.performance-name .habit-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.performance-name .habit-icon .icon {
  width: 15px;
  height: 15px;
}

.performance-name strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.performance-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.performance-row > strong {
  color: var(--ink-soft);
  font-size: 10px;
  text-align: right;
}

.mobile-scrim {
  display: none;
}

.mobile-menu {
  display: none;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 28px;
  place-items: center;
  background: rgba(14, 35, 27, 0.46);
  backdrop-filter: blur(6px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(100%, 610px);
  max-height: calc(100vh - 56px);
  padding: 28px;
  overflow-y: auto;
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(8, 29, 21, 0.26);
  animation: modal-in 250ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-header h2 {
  margin: 8px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 27px;
  font-weight: 600;
}

.field {
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.field > span,
.field legend {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border: 1px solid rgba(23, 56, 45, 0.14);
  border-radius: 11px;
  background: #faf9f3;
  color: var(--ink);
  font-size: 12px;
}

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

.field input[type="text"]:focus,
.field input[type="number"]:focus,
.field select:focus {
  border-color: rgba(47, 111, 83, 0.45);
  background: white;
}

.icon-picker,
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pick-icon {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #faf9f3;
  color: var(--ink-soft);
  cursor: pointer;
}

.pick-icon:hover {
  background: var(--green-soft);
}

.pick-icon.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  box-shadow: 0 0 0 2px rgba(47, 111, 83, 0.1);
}

.pick-icon .icon {
  width: 19px;
  height: 19px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.65fr);
  gap: 16px;
}

.color-picker {
  min-height: 41px;
  align-items: center;
}

.pick-color {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--pick);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.pick-color.is-selected {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--pick);
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.type-option {
  cursor: pointer;
}

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

.type-option > span {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf9f3;
}

.type-option .icon {
  grid-row: span 2;
  width: 19px;
  height: 19px;
  color: var(--green);
}

.type-option b {
  font-size: 10px;
}

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

.type-option input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 2px rgba(47, 111, 83, 0.08);
}

.type-option input:focus-visible + span {
  outline: 3px solid rgba(47, 111, 83, 0.25);
  outline-offset: 2px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.action-spacer {
  flex: 1;
}

.ghost-button,
.danger-button {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 10px;
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
}

.ghost-button:hover {
  background: var(--paper);
}

.danger-button {
  border: 1px solid rgba(170, 70, 60, 0.18);
  background: rgba(170, 70, 60, 0.06);
  color: #a44d45;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: var(--green-dark);
  color: #fffdf7;
  font-size: 11px;
  box-shadow: 0 18px 40px rgba(8, 29, 21, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green-dark);
}

.toast-icon .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.celebration-layer {
  position: fixed;
  z-index: 70;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  width: 7px;
  height: 11px;
  border-radius: 100% 0 100% 0;
  animation: confetti-fall 900ms cubic-bezier(0.1, 0.65, 0.35, 1) forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--drift), 130px) rotate(var(--spin));
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 222px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 18px;
  }

  .workspace {
    padding-inline: 30px;
  }

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

  .hero-card {
    padding: 32px;
  }

  .insights-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.8fr);
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    width: 252px;
    transform: translateX(-105%);
    transition: transform 240ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-scrim {
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgba(14, 35, 27, 0.35);
    backdrop-filter: blur(3px);
  }

  body.nav-open .mobile-scrim {
    display: block;
  }

  .mobile-menu {
    display: grid;
  }

  .workspace {
    padding-inline: 26px;
  }

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

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

  .gentle-card {
    grid-column: 1 / -1;
  }

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

  .member-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 0 17px 42px;
  }

  .topbar {
    min-height: 86px;
  }

  .today-pill {
    display: none;
  }

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

  .hero-card {
    align-items: flex-start;
    min-height: auto;
    padding: 26px 22px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .hero-copy > p:not(.eyebrow) {
    max-width: 290px;
  }

  .hero-progress {
    margin: 0 -20px 0 -30px;
    transform: scale(0.78);
  }

  .week-panel,
  .habits-panel {
    padding: 20px 17px;
  }

  .week-navigation {
    gap: 1px;
  }

  .week-strip {
    gap: 3px;
  }

  .day-cell {
    gap: 7px;
    padding: 9px 2px;
  }

  .day-status {
    width: 30px;
  }

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

  .gentle-card {
    grid-column: auto;
  }

  .habit-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 3px;
  }

  .habit-icon {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .habit-progress {
    width: 120px;
  }

  .row-edit {
    display: none;
  }

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

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 12px;
  }

  .page-heading .primary-button {
    align-self: stretch;
  }

  .page-heading h1 {
    font-size: 36px;
  }

  .heading-badge {
    display: none;
  }

  .join-backdrop {
    padding: 18px;
  }

  .join-card {
    padding: 27px 22px 23px;
    border-radius: 24px;
  }

  .join-card h1 {
    max-width: 270px;
    font-size: 30px;
  }

  .join-illustration {
    top: 22px;
    right: 17px;
    width: 88px;
    height: 75px;
    opacity: 0.75;
  }

  .join-illustration .icon {
    right: 22px;
    bottom: 17px;
    width: 34px;
    height: 34px;
  }

  .member-page-heading {
    align-items: flex-start;
  }

  .refresh-members {
    width: 100%;
  }

  .invite-panel {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .invite-actions {
    justify-content: space-between;
  }

  .invite-actions .primary-button {
    flex: 1;
  }

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

  .member-card-main {
    grid-template-columns: 1fr;
  }

  .member-metrics {
    justify-content: flex-start;
  }

  .member-progress-wrap {
    grid-column: auto;
  }

  .habit-garden-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

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

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

  .stat-card {
    padding: 16px;
  }

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

  .heatmap-panel,
  .rhythm-panel,
  .performance-panel {
    padding: 20px 18px;
  }

  .heat-legend {
    display: none;
  }

  .performance-row {
    grid-template-columns: minmax(120px, 1fr) 90px 38px;
    gap: 10px;
  }

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

  .modal {
    width: 100%;
    max-height: 92vh;
    padding: 24px 19px;
    border-radius: 24px 24px 0 0;
  }

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

  .type-picker {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (max-width: 470px) {
  .hero-card {
    display: block;
  }

  .hero-progress {
    width: 150px;
    margin: 8px auto -18px;
    transform: scale(0.78);
  }

  .text-link {
    margin-top: 15px;
  }

  .panel-heading {
    gap: 10px;
  }

  .week-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .week-navigation {
    align-self: stretch;
    justify-content: space-between;
  }

  .habits-panel .panel-heading > .soft-button {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 0;
  }

  .habit-title-line {
    gap: 5px;
  }

  .habit-title-line strong {
    max-width: 150px;
  }

  .habit-progress {
    width: 100px;
  }

  .habit-progress span {
    display: none;
  }

  .habit-card-metrics {
    gap: 18px;
  }

  .performance-row {
    grid-template-columns: minmax(115px, 1fr) 70px 35px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .join-backdrop {
    align-items: start;
    padding: 14px;
  }

  .join-card {
    margin: auto 0;
  }

  .join-illustration {
    display: none;
  }

  .invite-copy {
    align-items: flex-start;
  }

  .invite-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .invite-actions code {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .community-stat {
    padding: 15px;
  }

  .member-metrics {
    justify-content: space-between;
  }
}

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