:root {
  --bg: #f3f2eb;
  --bg-deep: #ebece3;
  --surface: #ffffff;
  --surface-soft: #faf9f4;
  --ink: #1d2a23;
  --ink-soft: #4f5d55;
  --muted: #8a948d;
  --line: #e6e7df;
  --line-strong: #d9dcd1;
  --green: #2f7d5b;
  --green-dark: #1b2c22;
  --green-soft: #e3f0e7;
  --lime: #dcefa9;
  --blue: #4c70d8;
  --blue-soft: #e9eefc;
  --cyan: #28979d;
  --cyan-soft: #e3f4f4;
  --peach: #d97654;
  --peach-soft: #faeae3;
  --gold: #b9862f;
  --gold-soft: #f7efdc;
  --rose: #c45d58;
  --radius-xl: 32px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --shadow: 0 18px 55px rgba(36, 51, 41, 0.075);
  --shadow-soft: 0 8px 26px rgba(36, 51, 41, 0.055);
  --font-sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(219, 236, 208, 0.72), transparent 26rem),
    radial-gradient(circle at 88% 15%, rgba(246, 225, 206, 0.58), transparent 30rem),
    linear-gradient(150deg, var(--bg) 0%, #f7f5ef 48%, var(--bg-deep) 100%);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  z-index: -1;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

svg {
  flex: 0 0 auto;
}

::selection {
  background: #cfe7d8;
  color: var(--green-dark);
}

.app-frame {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  width: 228px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  overflow: hidden;
  color: #f3f6ed;
  background:
    radial-gradient(circle at 15% 4%, rgba(202, 234, 153, 0.15), transparent 14rem),
    linear-gradient(160deg, #20352a 0%, #192a21 52%, #15231b 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  box-shadow: 0 22px 60px rgba(24, 40, 30, 0.21);
}

.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(219, 239, 169, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.sidebar::before {
  width: 190px;
  height: 190px;
  right: -95px;
  top: 130px;
}

.sidebar::after {
  width: 250px;
  height: 250px;
  right: -150px;
  bottom: 20px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #1b2c22;
  background: linear-gradient(145deg, #e9f7c8, #cde899);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(201, 230, 151, 0.18);
}

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

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

.brand-copy small {
  margin-top: 4px;
  color: rgba(239, 246, 229, 0.47);
  font-size: 8.5px;
  letter-spacing: 0.19em;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  color: rgba(239, 246, 231, 0.61);
  background: transparent;
  border: 0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-link:hover {
  color: #f5f8ee;
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.nav-link.is-active {
  color: #f7faed;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.nav-link.is-active .icon {
  color: var(--lime);
}

.nav-button {
  margin-top: 10px;
}

.side-note {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 18px 17px 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 19px;
}

.note-kicker {
  color: rgba(220, 239, 169, 0.62);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.side-note p {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: rgba(248, 250, 242, 0.88);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
}

.note-leaf {
  position: absolute;
  right: -12px;
  bottom: -22px;
  width: 84px;
  height: 84px;
  background: radial-gradient(circle at 35% 35%, rgba(218, 239, 167, 0.17), transparent 68%);
  border: 1px solid rgba(218, 239, 167, 0.08);
  border-radius: 50% 8% 50% 50%;
  transform: rotate(-18deg);
}

.side-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 2px;
  color: rgba(237, 244, 230, 0.38);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #9ccf7d;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(156, 207, 125, 0.12);
}

.main {
  width: calc(100% - 264px);
  max-width: 1500px;
  min-height: 100vh;
  margin-left: 264px;
  padding: 18px 26px 36px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.topbar-date .icon {
  color: var(--muted);
}

.mobile-brand,
.mobile-nav {
  display: none;
}

.page-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  min-height: 39px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 12.5px;
}

.btn-primary {
  color: #f7faf2;
  background: var(--green);
  box-shadow: 0 8px 20px rgba(47, 125, 91, 0.18);
}

.btn-primary:hover {
  background: #286e50;
}

.btn-dark {
  color: #f6f9ef;
  background: var(--green-dark);
  box-shadow: 0 8px 22px rgba(27, 44, 34, 0.17);
}

.btn-dark:hover {
  background: #243a2d;
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(28, 46, 36, 0.12);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.62);
}

.btn-quiet {
  color: var(--ink-soft);
  background: #f4f5ef;
  border-color: var(--line);
}

.btn-quiet:hover {
  background: #eef0e8;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.72fr);
  gap: 34px;
  align-items: center;
  min-height: 302px;
  padding: 42px 44px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 15%, rgba(255, 255, 255, 0.72), transparent 18rem),
    linear-gradient(122deg, #e4efd9 0%, #f3f0e2 54%, #f3ddce 100%);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  left: 41%;
  bottom: -80px;
  width: 420px;
  height: 220px;
  opacity: 0.5;
  background: repeating-linear-gradient(112deg, transparent 0 17px, rgba(82, 112, 75, 0.065) 17px 18px);
  transform: rotate(-4deg);
  pointer-events: none;
}

.hero-orbit {
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(50, 86, 54, 0.09);
  border-radius: 50%;
}

.hero-orbit-one {
  width: 300px;
  height: 300px;
  right: -128px;
  top: -135px;
}

.hero-orbit-two {
  width: 420px;
  height: 420px;
  right: -192px;
  top: -194px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: #47624e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #5b9d70;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(91, 157, 112, 0.12);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(37px, 4.15vw, 56px);
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.hero h1 em {
  color: #2b7253;
  font-style: normal;
}

.hero-lead {
  max-width: 530px;
  margin: 17px 0 0;
  color: #5d6c62;
  font-size: 14px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.today-panel {
  position: relative;
  z-index: 2;
  padding: 22px 22px 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(71, 81, 60, 0.08);
  backdrop-filter: blur(16px);
}

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

.panel-kicker {
  color: #586a5d;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.today-chip {
  padding: 4px 9px;
  color: #566a5b;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(77, 99, 81, 0.1);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}

.today-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.today-metric-copy {
  display: grid;
  gap: 1px;
}

.today-metric-copy > span {
  color: #68776b;
  font-size: 11px;
  font-weight: 650;
}

.today-metric-copy strong {
  color: var(--ink);
  font-size: 29px;
  font-weight: 730;
  line-height: 1.25;
}

.today-metric-copy strong small {
  margin-left: 4px;
  color: #6d7a70;
  font-size: 10px;
  font-weight: 600;
}

.today-metric-copy em {
  color: #7b877e;
  font-size: 9.5px;
  font-style: normal;
}

.mini-ring,
.progress-ring {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 62px;
  height: 62px;
  background: conic-gradient(var(--green) var(--value), rgba(52, 89, 64, 0.1) 0);
  border-radius: 50%;
}

.mini-ring::before,
.progress-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: #f3f3ea;
  border-radius: 50%;
}

.mini-ring span,
.progress-ring span {
  position: relative;
  font-size: 10.5px;
  font-weight: 750;
}

.water-ring {
  background: conic-gradient(var(--cyan) var(--value), rgba(40, 151, 157, 0.1) 0);
}

.today-divider {
  height: 1px;
  margin: 15px 0;
  background: rgba(61, 81, 66, 0.1);
}

.today-tip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  padding-top: 14px;
  color: #647267;
  border-top: 1px dashed rgba(61, 81, 66, 0.12);
  font-size: 10.5px;
}

.today-tip .icon {
  color: #789245;
}

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

.summary-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-height: 112px;
  padding: 18px 17px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 21px;
  box-shadow: var(--shadow-soft);
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.tone-green { color: var(--green); background: var(--green-soft); }
.tone-blue { color: var(--blue); background: var(--blue-soft); }
.tone-cyan { color: var(--cyan); background: var(--cyan-soft); }
.tone-peach { color: var(--peach); background: var(--peach-soft); }
.tone-gold { color: var(--gold); background: var(--gold-soft); }

.summary-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.summary-copy > span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.summary-copy strong {
  margin-top: 2px;
  font-size: 25px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
}

.summary-copy strong small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.summary-copy em {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-mark {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: var(--green);
  opacity: 0.08;
  transform: rotate(-8deg);
}

.summary-sleep .summary-mark { color: var(--blue); }
.summary-study .summary-mark { color: var(--gold); }
.summary-water .summary-mark { color: var(--cyan); }

.trend-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 750;
  white-space: nowrap;
}

.trend-pill.up { color: var(--rose); background: #f9e9e7; }
.trend-pill.down { color: var(--green); background: var(--green-soft); }
.trend-pill.flat { color: var(--ink-soft); background: #eef0e9; }

.summary-card .trend-pill {
  position: absolute;
  right: 12px;
  top: 14px;
}

.content-section {
  margin-top: 38px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 0 3px;
}

.section-kicker {
  margin: 0 0 4px;
  color: #77887a;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.section-head > div > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

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

.week-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 650;
}

.health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.86fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.weight-panel {
  padding: 23px 24px 20px;
}

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

.panel-head.compact {
  align-items: center;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.panel-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.panel-title h3,
.mini-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 730;
  letter-spacing: -0.01em;
}

.panel-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.weight-current {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-top: 2px;
}

.weight-current > span {
  color: var(--muted);
  font-size: 10px;
}

.weight-current strong {
  font-size: 29px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.03em;
}

.weight-current small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
}

.weight-change {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
}

.muted-copy {
  color: var(--muted);
  font-size: 10.5px;
}

.range-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #f1f2ec;
  border-radius: 10px;
}

.range-switch button {
  min-width: 48px;
  padding: 5px 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 650;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

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

.range-switch button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(42, 58, 47, 0.08);
}

.weight-chart {
  position: relative;
  width: 100%;
  height: 286px;
  margin-top: 8px;
  overflow: hidden;
}

.weight-chart svg,
.sleep-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-placeholder {
  display: grid;
  height: 100%;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}

.chart-placeholder > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  color: #9aa69c;
  background: #f2f4ed;
  border-radius: 16px;
}

.chart-placeholder p {
  margin: 0 0 6px;
  font-size: 12px;
}

.chart-placeholder small {
  color: #a0aaa2;
  font-size: 10px;
}

.chart-tip {
  position: absolute;
  z-index: 4;
  min-width: 92px;
  padding: 8px 10px;
  color: #f4f8ef;
  background: rgba(25, 42, 32, 0.93);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(24, 39, 30, 0.22);
  font-size: 10px;
  pointer-events: none;
  transform: translate(-50%, -100%);
  transition: opacity 90ms ease;
}

.chart-tip strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.chart-tip span {
  color: rgba(244, 248, 239, 0.58);
}

.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  row-gap: 6px;
  padding: 3px 7px 0 44px;
  color: var(--muted);
  font-size: 9.5px;
}

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

.legend-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(47, 125, 91, 0.1);
}

.legend-line {
  width: 16px;
  height: 0;
  border-top: 1px dashed #a9b5ab;
}

.legend-goal-trend {
  width: 16px;
  height: 0;
  border-top: 1.2px dashed #d98a8a;
}

.target-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 11px 13px;
  background: #f6f8f1;
  border: 1px solid #eef0e6;
  border-radius: 15px;
}

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

.target-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--green);
  background: #e6f0e7;
  border-radius: 9px;
}

.target-copy > div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.target-copy > div span {
  color: var(--muted);
  font-size: 8.5px;
}

.target-copy > div strong {
  font-size: 12px;
}

.target-gap {
  flex: 1;
  min-width: 0;
  padding-left: 12px;
  color: var(--ink-soft);
  border-left: 1px solid #e4e8dc;
  font-size: 9.5px;
}

.target-gap strong {
  color: var(--ink);
}

.goal-reached {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-weight: 650;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

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

.goal-forecast {
  margin-top: 12px;
  padding: 14px 15px 13px;
  background: linear-gradient(135deg, #f5f8f1, #faf9f4);
  border: 1px solid #e8ece0;
  border-radius: 17px;
}

.goal-forecast.status-on_track,
.goal-forecast.status-reached {
  background: linear-gradient(135deg, #eff7ef, #fafaf3);
  border-color: #dce9dc;
}

.goal-forecast.status-off_track {
  background: linear-gradient(135deg, #fdf1ec, #faf8f3);
  border-color: #f2ddd3;
}

.goal-forecast.status-stalled,
.goal-forecast.status-due_today {
  background: linear-gradient(135deg, #faf5e8, #faf9f3);
  border-color: #eee4ca;
}

.goal-forecast.status-expired {
  background: linear-gradient(135deg, #f9edeb, #faf8f3);
  border-color: #efd9d4;
}

.goal-forecast-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.forecast-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.goal-forecast-head strong {
  font-size: 10.5px;
  font-weight: 700;
}

.forecast-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--ink-soft);
  background: #eceee7;
  border-radius: 99px;
  font-size: 8.5px;
  font-weight: 700;
}

.status-on_track .forecast-status,
.status-reached .forecast-status {
  color: var(--green);
  background: var(--green-soft);
}

.status-off_track .forecast-status {
  color: #b35b3d;
  background: #fae5dd;
}

.status-stalled .forecast-status,
.status-due_today .forecast-status {
  color: #a67724;
  background: #f7ecd2;
}

.status-expired .forecast-status {
  color: var(--rose);
  background: #fae6e4;
}

.status-insufficient .forecast-status,
.status-no_data .forecast-status {
  color: var(--blue);
  background: var(--blue-soft);
}

.forecast-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed rgba(72, 94, 77, 0.13);
}

.forecast-metric {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0 9px;
  border-left: 1px solid rgba(72, 94, 77, 0.1);
}

.forecast-metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.forecast-metric > span {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.forecast-metric strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forecast-metric small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 500;
}

.forecast-metric .forecast-date {
  font-size: 12.5px;
}

.forecast-message {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.6;
}

.forecast-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.forecast-foot p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.forecast-foot > span {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 99px;
  font-size: 7.5px;
}

.weight-history {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
}

.history-row {
  display: grid;
  grid-template-columns: 108px 82px minmax(0, 1fr) 54px 28px;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  border-top: 1px solid #f0f1eb;
}

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

.history-date {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.history-date strong {
  font-size: 10.5px;
  font-weight: 650;
}

.history-date span {
  color: var(--muted);
  font-size: 8.5px;
}

.history-weight {
  font-size: 15px;
  font-weight: 730;
}

.history-weight small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
}

.history-note {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
}

.history-note > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 99px;
  font-size: 8px;
  font-weight: 700;
}

.period-morning {
  color: #a8792c;
  background: #f8efdd;
}

.period-evening {
  color: var(--green);
  background: var(--green-soft);
}

.log-delta {
  justify-self: end;
  font-size: 9.5px;
  font-weight: 700;
}

.log-delta.up { color: var(--rose); }
.log-delta.down { color: var(--green); }
.log-delta.flat { color: var(--muted); }

.icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #a0aaa2;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition: color 150ms ease, background 150ms ease;
}

.icon-button:hover {
  color: var(--rose);
  background: #faece9;
}

.icon-button-soft {
  width: 32px;
  height: 32px;
  color: var(--green);
  background: var(--green-soft);
}

.icon-button-soft:hover {
  color: var(--green-dark);
  background: #d8ebde;
}

.empty-row {
  padding: 14px 4px 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.health-side {
  display: grid;
  gap: 16px;
}

.sleep-panel {
  padding: 21px 22px 18px;
}

.sleep-metric {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.sleep-metric strong {
  font-size: 39px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.04em;
}

.sleep-metric > span {
  display: flex;
  flex-direction: column;
  padding-bottom: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.sleep-metric small {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
}

.sleep-chart {
  width: 100%;
  height: 98px;
  margin-top: 12px;
}

.sleep-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  padding-top: 12px;
  color: var(--muted);
  border-top: 1px solid #f0f1eb;
  font-size: 9px;
}

.sleep-foot > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mini-panel {
  min-width: 0;
  padding: 18px 17px 15px;
}

.mini-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mini-head .panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.mini-head h3 {
  font-size: 13px;
}

.exercise-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 14px;
}

.exercise-copy {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px;
}

.exercise-copy strong {
  font-size: 25px;
  font-weight: 750;
  line-height: 1;
}

.exercise-copy > span {
  color: var(--muted);
  font-size: 8.5px;
}

.exercise-copy em {
  flex-basis: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.progress-ring {
  width: 50px;
  height: 50px;
}

.progress-ring::before {
  inset: 5px;
  background: #fff;
}

.progress-ring span {
  font-size: 9px;
}

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 13px;
  padding: 8px 9px;
  color: var(--ink-soft);
  background: #f6f7f2;
  border: 1px solid #eceee7;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 650;
  transition: background 150ms ease, color 150ms ease;
}

.mini-action:hover {
  color: var(--green);
  background: #edf4ec;
}

.water-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 13px;
}

.water-count strong {
  font-size: 25px;
  font-weight: 750;
  line-height: 1;
}

.water-count span {
  color: var(--muted);
  font-size: 8.5px;
}

.water-cups {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px;
  margin-top: 10px;
}

.water-cup {
  display: grid;
  place-items: center;
  width: 16px;
  height: 21px;
  color: #c5d1cd;
  background: #eef3f1;
  border-radius: 5px 5px 7px 7px;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.water-cup.is-filled {
  color: #effcfd;
  background: linear-gradient(160deg, #58b9bd, var(--cyan));
  transform: translateY(-1px);
}

.water-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
}

.water-actions form {
  flex: 1;
}

.water-actions .mini-action {
  margin-top: 0;
}

.water-add {
  color: #287b7f;
  background: var(--cyan-soft);
  border-color: #d6ecec;
}

.water-add:hover {
  color: #1f686c;
  background: #d4ecec;
}

.study-section {
  padding-bottom: 8px;
}

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

.course-card {
  position: relative;
  display: flex;
  min-height: 178px;
  flex-direction: column;
  padding: 18px 17px 15px;
  overflow: hidden;
  background:
    radial-gradient(circle at 102% -5%, var(--course-tint), transparent 8rem),
    rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.course-card::after {
  content: "";
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--course-color), transparent);
  opacity: 0.45;
  border-radius: 99px;
}

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

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

.course-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--course-color);
  background: var(--course-tint);
  border-radius: 12px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

.course-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 730;
  line-height: 1.3;
}

.course-title > div > span {
  color: var(--muted);
  font-size: 8px;
}

.course-pin {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--muted);
  background: #f1f2ec;
  border-radius: 99px;
  font-size: 8px;
  font-weight: 650;
}

.course-progress-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 17px;
}

.course-progress-copy > div {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.course-progress-copy span {
  color: var(--muted);
  font-size: 8.5px;
}

.course-progress-copy strong {
  font-size: 21px;
  font-weight: 750;
  line-height: 1;
}

.course-progress-copy em {
  color: var(--course-color);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 750;
}

.course-progress {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  background: #eef0e9;
  border-radius: 99px;
}

.course-progress > span {
  display: block;
  height: 100%;
  background: var(--course-color);
  border-radius: inherit;
  transition: width 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.course-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.course-today {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.course-today strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 730;
}

.course-add {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  color: var(--course-color);
  background: var(--course-tint);
  border: 0;
  border-radius: 10px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.course-add:hover {
  color: #fff;
  background: var(--course-color);
  transform: rotate(4deg) scale(1.04);
}

.add-course-card {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.34);
  border: 1.5px dashed #d9ddd2;
  border-radius: 22px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.add-course-card:hover {
  color: var(--green);
  background: rgba(255, 255, 255, 0.63);
  border-color: #b8c9b8;
  transform: translateY(-2px);
}

.add-course-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 14px;
}

.add-course-card strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.add-course-card > span:last-child {
  font-size: 9px;
}

.study-lower {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  margin-top: 16px;
}

.rhythm-panel,
.recent-panel {
  padding: 22px 23px 20px;
}

.rhythm-total {
  padding: 5px 9px;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
}

.study-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  height: 156px;
  margin-top: 21px;
  padding-top: 12px;
}

.study-day {
  display: grid;
  grid-template-rows: 16px minmax(0, 1fr) 13px;
  gap: 3px;
  justify-items: center;
  min-width: 0;
}

.study-bar-value {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.study-bar-track {
  display: flex;
  width: 100%;
  max-width: 30px;
  height: 100%;
  align-items: flex-end;
  overflow: hidden;
  background: #f2f3ed;
  border-radius: 8px 8px 5px 5px;
}

.study-bar-track > span {
  display: block;
  width: 100%;
  min-height: 0;
  background: linear-gradient(180deg, #e2c783, #c59a3f);
  border-radius: 7px 7px 4px 4px;
  transition: height 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.study-day.is-today .study-bar-track {
  background: #e9eee2;
  box-shadow: inset 0 0 0 1px #d6e0ce;
}

.study-day.is-today .study-bar-track > span {
  background: linear-gradient(180deg, #65a47e, var(--green));
}

.study-day.is-today small {
  color: var(--green);
  font-weight: 750;
}

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

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

.week-progress {
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  background: #eef0e8;
  border-radius: 99px;
}

.week-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d4b566, var(--gold));
  border-radius: inherit;
}

.rhythm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 8.5px;
}

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

.rhythm-percent {
  color: var(--gold);
  font-size: 10px;
  font-weight: 750;
}

.study-timeline {
  margin-top: 14px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  min-height: 55px;
  border-top: 1px solid #f0f1eb;
}

.timeline-item:first-child {
  border-top: 0;
}

.timeline-dot {
  width: 7px;
  height: 7px;
  background: var(--dot-color);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot-color) 12%, transparent);
}

.timeline-body {
  min-width: 0;
}

.timeline-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.timeline-top strong {
  font-size: 10.5px;
  font-weight: 700;
}

.timeline-top span {
  color: var(--ink-soft);
  font-size: 9px;
}

.timeline-top em {
  margin-left: auto;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.timeline-body p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-empty {
  display: grid;
  min-height: 180px;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.timeline-empty > span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: #9ba79e;
  background: #f1f3ed;
  border-radius: 16px;
}

.timeline-empty p {
  margin: 9px 0 4px;
  font-size: 11px;
}

.toast-stack {
  position: fixed;
  z-index: 80;
  top: 18px;
  right: 22px;
  display: grid;
  width: min(370px, calc(100vw - 28px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(32, 47, 37, 0.15);
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: auto;
  animation: toastIn 260ms ease both;
  backdrop-filter: blur(14px);
}

.toast-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 8px;
}

.toast-error .toast-icon {
  color: var(--rose);
  background: #fae9e7;
}

.toast-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.toast-close:hover {
  background: #f2f3ed;
}

.modal {
  width: min(560px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100vh - 28px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(18, 31, 23, 0.54);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: modalIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-card {
  max-height: calc(100vh - 28px);
  padding: 25px;
  overflow-y: auto;
  background: #fbfbf7;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 27px;
  box-shadow: 0 28px 90px rgba(17, 31, 22, 0.3);
}

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

.modal-kicker {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.modal-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: #f0f2eb;
  border: 0;
  border-radius: 11px;
  transition: color 150ms ease, background 150ms ease;
}

.modal-close:hover {
  color: var(--ink);
  background: #e7eae1;
}

.modal-desc {
  margin: 10px 0 19px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

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

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

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

.field > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.field > span small {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e2e5dc;
  border-radius: 12px;
  outline: 0;
  font-size: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

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

.field input:focus,
.field select:focus {
  border-color: #8db79b;
  box-shadow: 0 0 0 3px rgba(47, 125, 91, 0.1);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: #eff1ea;
  border-radius: 12px;
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: grid;
  height: 35px;
  place-items: center;
  color: var(--muted);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 650;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.segmented input:checked + span {
  color: var(--green-dark);
  background: #fff;
  box-shadow: 0 2px 8px rgba(43, 59, 48, 0.08);
}

.segmented input:focus-visible + span {
  box-shadow: 0 0 0 2px rgba(47, 125, 91, 0.25);
}

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

.color-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid #e6e8e1;
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.color-option input {
  position: absolute;
  opacity: 0;
}

.color-option:has(input:checked) {
  color: var(--ink);
  border-color: #9fb7a3;
  box-shadow: 0 0 0 2px rgba(47, 125, 91, 0.08);
}

.color-swatch {
  width: 17px;
  height: 17px;
  background: var(--swatch);
  border-radius: 6px;
}

.color-option em {
  font-size: 9px;
  font-style: normal;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid #edefe7;
}

.modal-actions .btn {
  min-width: 88px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 1400px;
  margin: 38px auto 0;
  padding: 18px 3px 0;
  color: #9aa39c;
  border-top: 1px solid rgba(93, 112, 98, 0.13);
  font-size: 9.5px;
}

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

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

@keyframes lineDraw {
  from { stroke-dashoffset: var(--line-length); }
  to { stroke-dashoffset: 0; }
}

@media (max-width: 1240px) {
  .course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-copy strong {
    font-size: 23px;
  }
}

@media (max-width: 1100px) {
  .health-grid {
    grid-template-columns: 1fr;
  }

  .health-side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

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

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

@media (max-width: 960px) {
  .sidebar {
    display: none;
  }

  .main {
    width: 100%;
    margin-left: 0;
    padding: 14px 20px 32px;
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
  }

  .mobile-brand .brand-mark {
    width: 34px;
    height: 34px;
    color: #f4f8ec;
    background: var(--green-dark);
    border-radius: 11px;
  }

  .mobile-brand strong {
    font-size: 16px;
    letter-spacing: 0.06em;
  }

  .mobile-nav {
    display: flex;
    gap: 5px;
    margin-left: 20px;
  }

  .mobile-nav a {
    padding: 6px 10px;
    color: var(--ink-soft);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 650;
  }

  .mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.6);
  }

  .topbar-date {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .today-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 22px;
  }

  .today-panel-head,
  .today-tip {
    grid-column: 1 / -1;
  }

  .today-divider {
    display: none;
  }

  .today-tip {
    margin-top: 18px;
  }

  .study-lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 32px 28px;
    border-radius: 27px;
  }

  .hero h1 {
    font-size: clamp(34px, 8vw, 46px);
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .section-side-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .health-side {
    grid-template-columns: 1fr;
  }

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

  .history-row {
    grid-template-columns: 96px 72px minmax(0, 1fr) 44px 28px;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 580px) {
  .main {
    padding: 10px 12px 26px;
  }

  .topbar {
    padding: 2px 3px;
  }

  .mobile-nav {
    display: none;
  }

  .hero {
    min-height: 0;
    padding: 27px 22px 23px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-lead {
    font-size: 12.5px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .today-panel {
    grid-template-columns: 1fr;
  }

  .today-metric + .today-metric {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(61, 81, 66, 0.12);
  }

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

  .summary-card {
    min-height: 108px;
    padding: 15px 13px;
    gap: 10px;
  }

  .summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .summary-copy strong {
    font-size: 20px;
  }

  .summary-copy em {
    max-width: 110px;
  }

  .summary-card .trend-pill {
    right: 9px;
    top: 9px;
  }

  .weight-panel,
  .sleep-panel,
  .rhythm-panel,
  .recent-panel {
    padding: 19px 16px 17px;
  }

  .panel-head {
    gap: 10px;
  }

  .panel-title {
    gap: 9px;
  }

  .panel-title p {
    display: none;
  }

  .weight-current strong {
    font-size: 24px;
  }

  .chart-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .chart-legend {
    padding-left: 8px;
  }

  .weight-chart {
    height: 245px;
  }

  .target-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .target-gap {
    flex-basis: calc(100% - 55px);
    padding-left: 0;
    border-left: 0;
  }

  .target-strip > .text-button {
    margin-left: 42px;
  }

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

  .forecast-metric {
    padding-left: 10px;
  }

  .forecast-metric:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .forecast-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .history-row {
    grid-template-columns: 90px 62px minmax(0, 1fr) 24px;
    gap: 6px;
  }

  .history-note,
  .log-delta {
    display: none;
  }

  .mini-grid,
  .course-grid {
    grid-template-columns: 1fr;
  }

  .course-card,
  .add-course-card {
    min-height: 162px;
  }

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

  .field-full {
    grid-column: auto;
  }

  .modal-card {
    padding: 21px 18px;
    border-radius: 23px;
  }

  .modal-actions .btn {
    flex: 1;
  }

  .segmented span {
    font-size: 9px;
  }

  .toast-stack {
    right: 14px;
    top: 12px;
  }
}

@media (max-width: 400px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-copy em {
    max-width: none;
  }

  .btn-sm {
    padding: 0 11px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.celebration-canvas {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
