:root {
  --ink: #1d2920;
  --muted: #6d746d;
  --paper: #f3f0e8;
  --card: #fffdf8;
  --sage: #b9c8aa;
  --sage-dark: #304b38;
  --lime: #d8ec7a;
  --line: rgba(29, 41, 32, .13);
  --shadow: 0 24px 70px rgba(46, 57, 42, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", system-ui, sans-serif;
  min-height: 100vh;
}
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; padding: 32px 24px 25px;
  background: var(--ink); color: #f6f3e9; display: flex; flex-direction: column; z-index: 20;
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; font: 600 18px "Unbounded", sans-serif; }
.brand-mark, .mobile-brand { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--ink); }
.nav { display: grid; gap: 8px; margin-top: 72px; }
.nav-item { color: #aeb8ae; border: 0; background: transparent; padding: 13px 15px; border-radius: 12px; display: flex; gap: 13px; align-items: center; cursor: pointer; text-align: left; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-icon { width: 22px; text-align: center; color: var(--lime); font-size: 18px; }
.sidebar-card { margin-top: auto; padding: 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(255,255,255,.05); }
.sidebar-card p:last-child { color: #bbc3bb; font-size: 12px; line-height: 1.6; margin-bottom: 0; }
.sidebar .eyebrow { color: var(--lime); }
.sidebar-foot { color: #7f8a80; font-size: 9px; text-align: center; margin: 16px 0 0; }
main { grid-column: 2; width: 100%; max-width: 1400px; padding: 42px 5vw 64px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 42px; }
.date { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 700; margin: 0 0 8px; }
h1 { margin: 0; font: 500 clamp(28px, 3vw, 42px) "Unbounded", sans-serif; letter-spacing: -.04em; }
.streak-pill { border: 1px solid var(--line); border-radius: 99px; padding: 10px 16px; background: rgba(255,255,255,.43); font-size: 12px; }
.streak-pill strong { font-size: 15px; margin-left: 4px; }
.mobile-brand { display: none; border: 0; font-family: "Unbounded"; }
.view { display: none; animation: rise .35s ease both; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.today-grid { display: grid; grid-template-columns: minmax(460px, 1.8fr) minmax(260px, .8fr); gap: 22px; }
.timer-card, .metric-card, .note-card, .stats-row article, .history-item, .plan-card { background: var(--card); border: 1px solid rgba(29,41,32,.08); border-radius: 28px; box-shadow: var(--shadow); }
.timer-card { padding: 30px 36px 35px; min-height: 610px; display: flex; flex-direction: column; }
.timer-head { display: flex; justify-content: space-between; align-items: flex-start; }
.eyebrow { margin: 0 0 9px; text-transform: uppercase; font-size: 9px; letter-spacing: .18em; font-weight: 700; color: var(--muted); }
.plan-select { border: 0; padding: 0; background: none; font: 500 23px "Unbounded"; color: var(--ink); cursor: pointer; display: flex; gap: 8px; }
.status-badge { border-radius: 99px; padding: 8px 12px; background: #eef2e8; color: var(--sage-dark); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.timer-wrap { width: min(390px, 78vw); aspect-ratio: 1; position: relative; align-self: center; margin: 18px 0; }
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track, .ring-progress { fill: none; stroke-width: 10; }
.ring-track { stroke: #e8e8df; }
.ring-progress { stroke: var(--sage-dark); stroke-linecap: round; stroke-dasharray: 829.38; stroke-dashoffset: 829.38; transition: stroke-dashoffset 1s linear, stroke .3s; filter: drop-shadow(0 3px 5px rgba(48,75,56,.18)); }
.timer-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.timer-content p { font-size: 9px; font-weight: 700; letter-spacing: .18em; color: var(--muted); margin: 0 0 14px; }
.timer-content strong { font: 500 clamp(32px, 4vw, 52px) "Unbounded"; letter-spacing: -.06em; }
.timer-content span { color: var(--muted); font-size: 11px; margin-top: 14px; }
.timer-actions { display: flex; justify-content: center; gap: 10px; margin-top: auto; }
.primary-btn { border: 0; border-radius: 99px; padding: 16px 28px; background: var(--ink); color: white; font-weight: 700; font-size: 12px; cursor: pointer; min-width: 200px; transition: .2s; }
.primary-btn:hover { background: var(--sage-dark); transform: translateY(-2px); }
.icon-btn { width: 48px; border: 1px solid var(--line); background: white; border-radius: 50%; font-size: 20px; cursor: pointer; }
.hidden { display: none !important; }
.right-column { display: grid; grid-template-rows: 1fr 1fr; gap: 22px; }
.metric-card { padding: 29px; position: relative; overflow: hidden; }
.accent-card { background: var(--sage-dark); color: white; }
.metric-icon { position: absolute; right: 25px; top: 25px; width: 38px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; display: grid; place-items: center; color: var(--lime); }
.accent-card .eyebrow { color: #b8c4ba; }
.accent-card > strong { font: 500 44px "Unbounded"; display: block; margin: 22px 0 5px; }
.accent-card > p:not(.eyebrow) { color: #b8c4ba; font-size: 11px; margin: 0; }
.week-bars { display: flex; align-items: end; gap: 8px; height: 90px; margin-top: 30px; }
.bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar { width: 100%; max-width: 18px; border-radius: 8px; background: rgba(255,255,255,.17); min-height: 4px; }
.bar.today { background: var(--lime); }
.bar-wrap span { font-size: 8px; color: #9eaca0; }
.phase-card { display: flex; flex-direction: column; justify-content: space-between; background: #d7dfc9; }
.phase-number { align-self: flex-end; color: rgba(29,41,32,.22); font: 500 60px "Unbounded"; }
.phase-card h3 { font: 500 20px "Unbounded"; margin: 0 0 10px; }
.phase-card p:last-child { color: #5c675e; font-size: 11px; line-height: 1.6; margin: 0; }
.note-card { margin-top: 22px; padding: 28px 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; background: #e8dfcf; box-shadow: none; }
.note-card h2, .section-intro h2 { font: 500 22px "Unbounded"; margin: 0; letter-spacing: -.03em; }
.note-card > p { margin: 0; font-size: 12px; line-height: 1.7; color: #5f655f; }
.trackers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.tracker-card { min-height: 260px; padding: 28px 30px; border-radius: 28px; border: 1px solid rgba(29,41,32,.08); background: var(--card); box-shadow: var(--shadow); }
.tracker-head { display: flex; align-items: flex-start; justify-content: space-between; }
.tracker-head h2 { margin: 0; font: 500 20px "Unbounded"; }
.tracker-icon { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 20px; }
.water-card { background: #dce9e7; }
.water-progress { height: 9px; border-radius: 99px; background: rgba(29,41,32,.1); overflow: hidden; margin: 36px 0 15px; }
.water-progress div { height: 100%; width: 0; border-radius: inherit; background: #4e8989; transition: width .45s ease; }
.water-total strong, .weight-value strong { font: 500 34px "Unbounded"; }
.water-total span, .weight-value span { color: var(--muted); font-size: 11px; }
.quick-actions { display: flex; gap: 9px; margin-top: 25px; }
.quick-actions button, .weight-form button { border: 0; border-radius: 99px; background: var(--ink); color: white; padding: 11px 17px; font-size: 10px; font-weight: 700; cursor: pointer; }
.quick-actions .undo-water { margin-left: auto; width: 38px; padding: 0; border: 1px solid rgba(29,41,32,.15); background: transparent; color: var(--ink); font-size: 18px; }
.weight-value { margin-top: 25px; }
.weight-chart { height: 55px; display: flex; align-items: flex-end; gap: 7px; margin: 13px 0; }
.weight-point { flex: 1; min-width: 5px; border-radius: 6px 6px 2px 2px; background: var(--sage); position: relative; }
.weight-point:last-child { background: var(--sage-dark); }
.weight-form { display: flex; gap: 8px; }
.weight-form label { flex: 1; }
.weight-form input { width: 100%; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); padding: 11px 15px; color: var(--ink); outline: none; }
.weight-form input:focus { border-color: var(--sage-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.section-intro { max-width: 620px; margin: 25px 0 35px; }
.section-intro h2 { font-size: clamp(26px, 3vw, 40px); }
.section-intro > p:last-child { color: var(--muted); font-size: 13px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.stats-row article { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.stats-row span { color: var(--muted); font-size: 11px; }
.stats-row strong { font: 500 26px "Unbounded"; }
.history-list { display: grid; gap: 12px; }
.journal-section { margin-top: 48px; }
.section-intro.compact { margin-bottom: 20px; }
.section-intro.compact h2 { font-size: 22px; }
.journal-list { display: grid; gap: 10px; }
.journal-item { display: grid; grid-template-columns: 1fr auto auto; gap: 28px; padding: 16px 22px; border-bottom: 1px solid var(--line); align-items: center; font-size: 12px; }
.journal-item span { color: var(--muted); }
.history-item { padding: 20px 24px; display: grid; grid-template-columns: 1fr auto auto; gap: 30px; align-items: center; box-shadow: none; }
.history-item h3 { margin: 0 0 4px; font-size: 13px; }
.history-item p, .history-item span { margin: 0; color: var(--muted); font-size: 11px; }
.empty-state { border: 1px dashed var(--line); border-radius: 24px; padding: 50px; text-align: center; color: var(--muted); }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan-card { padding: 27px; box-shadow: none; cursor: pointer; transition: .2s; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.plan-card.selected { background: var(--ink); color: white; }
.plan-card .ratio { font: 500 30px "Unbounded"; margin: 20px 0 8px; }
.plan-card p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.plan-card.selected p { color: #adb8af; }
.plan-card button { margin-top: 15px; border: 1px solid var(--line); background: var(--lime); color: var(--ink); border-radius: 99px; padding: 10px 15px; font-size: 10px; font-weight: 700; cursor: pointer; }
.plan-menu { position: fixed; min-width: 175px; background: white; padding: 8px; border-radius: 15px; box-shadow: 0 20px 60px rgba(0,0,0,.2); z-index: 50; }
.plan-menu button { width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 13px; border-radius: 9px; cursor: pointer; }
.plan-menu button:hover { background: var(--paper); }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 13px 20px; border-radius: 99px; font-size: 11px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 950px) {
  .app-shell { display: block; }
  .sidebar { inset: auto 12px 12px; width: auto; height: 66px; padding: 7px; border-radius: 22px; flex-direction: row; align-items: center; }
  .brand, .sidebar-card, .sidebar-foot { display: none; }
  .nav { margin: 0; width: 100%; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .nav-item { justify-content: center; flex-direction: column; padding: 7px; gap: 1px; font-size: 9px; }
  .nav-icon { font-size: 15px; }
  main { padding: 28px 4vw 110px; }
  .today-grid { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
}
@media (max-width: 600px) {
  .topbar { align-items: center; margin-bottom: 25px; }
  .mobile-brand { display: grid; margin-right: 12px; }
  .topbar > div:nth-child(2) { margin-right: auto; }
  .streak-pill { padding: 8px 11px; font-size: 0; }
  .streak-pill strong { font-size: 12px; }
  h1 { font-size: 24px; }
  .timer-card { padding: 24px 18px; min-height: 510px; border-radius: 23px; }
  .timer-wrap { width: min(310px, 82vw); }
  .timer-content strong { font-size: 32px; }
  .right-column, .note-card, .stats-row, .plans-grid, .trackers-grid { grid-template-columns: 1fr; }
  .note-card { gap: 18px; }
  .history-item { grid-template-columns: 1fr auto; gap: 12px; }
  .history-item > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
