:root {
  --ink: #24312c;
  --muted: #77827c;
  --paper: #f5f2eb;
  --card: rgba(255, 255, 255, 0.72);
  --green: #698877;
  --green-dark: #466457;
  --green-soft: #dfe9e2;
  --peach: #e9b39a;
  --line: rgba(45, 63, 54, 0.1);
  --shadow: 0 20px 60px rgba(48, 59, 53, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
button, textarea { font: inherit; }
button { color: inherit; }
.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
  z-index: -1;
}
.ambient-one { width: 420px; height: 420px; background: rgba(213, 228, 217, .45); right: -160px; top: 120px; }
.ambient-two { width: 380px; height: 380px; background: rgba(239, 209, 190, .22); left: -180px; top: 640px; }
.topbar {
  height: 78px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Manrope";
  font-weight: 700;
  letter-spacing: -.04em;
}
.brand-mark { width: 25px; height: 25px; border: 1.5px solid var(--green); border-radius: 50%; display: grid; place-items: center; }
.brand-mark span { width: 6px; height: 6px; border-radius: 50%; background: var(--peach); box-shadow: 6px -4px 0 -1px var(--green); }
.nav-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); }
.nav-tab { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; color: var(--muted); cursor: pointer; transition: .25s ease; }
.nav-tab:hover, .nav-tab.active { background: white; color: var(--ink); box-shadow: 0 4px 14px rgba(53,70,61,.08); }
.sync-pill { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #8bac99; transition: .3s; }
.sync-pill.saving .sync-dot { background: var(--peach); animation: pulse 1s infinite; }
main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 110px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 54px; animation: rise .7s ease both; }
.eyebrow, .section-kicker { font-size: 11px; letter-spacing: .16em; font-weight: 600; color: var(--green); margin: 0 0 12px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Manrope"; }
h1 { font-size: clamp(48px, 7vw, 82px); line-height: .98; letter-spacing: -.07em; margin-bottom: 18px; font-weight: 600; }
.hero-sub { color: var(--muted); font-size: 17px; margin: 0; }
.date-control { display: flex; align-items: center; gap: 8px; }
.icon-button, .date-button { border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: .22s ease; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; font-size: 25px; color: var(--green); }
.icon-button:hover:not(:disabled) { transform: translateY(-2px); background: white; }
.icon-button:disabled { opacity: .3; cursor: default; }
.date-button { min-width: 116px; padding: 9px 16px; border-radius: 16px; display: flex; flex-direction: column; }
.date-button small { color: var(--muted); margin-top: 2px; }
.progress-card, .note-card {
  border: 1px solid rgba(255,255,255,.7);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.progress-card { border-radius: 28px; padding: 24px 28px; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; margin-bottom: 88px; animation: rise .7s .08s ease both; }
.progress-card h2 { margin-bottom: 5px; font-size: 19px; letter-spacing: -.03em; }
.progress-card p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.progress-ring {
  --progress: 0deg;
  width: 65px; height: 65px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--green) var(--progress), var(--green-soft) 0);
  position: relative;
  transition: background .5s ease;
}
.progress-ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #f8f8f4; }
.progress-ring span { position: relative; z-index: 1; font-size: 12px; font-weight: 600; }
.streak { display: flex; align-items: center; gap: 10px; padding-left: 26px; border-left: 1px solid var(--line); }
.streak-icon { width: 34px; height: 34px; border-radius: 50%; background: #f6e2d7; color: #c17d5d; display: grid; place-items: center; }
.streak span:last-child { display: flex; flex-direction: column; }
.streak strong { font-family: "Manrope"; font-size: 20px; }
.streak small { color: var(--muted); }
.tracker-section { margin-bottom: 86px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 26px; }
.section-heading h2, .note-card h2, dialog h2 { font-size: 30px; letter-spacing: -.055em; margin-bottom: 0; }
.section-heading > p { color: var(--muted); margin: 0; font-size: 13px; }
.section-actions { display: flex; align-items: center; gap: 16px; }
.section-actions p { color: var(--muted); margin: 0; font-size: 13px; }
.play-button { border: 1px solid rgba(70,100,87,.12); background: var(--green-dark); color: white; border-radius: 999px; padding: 7px 14px 7px 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: .25s ease; }
.play-button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(55,83,69,.2); }
.play-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.15); font-size: 8px; padding-left: 1px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.metric-card {
  background: rgba(255,255,255,.56);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px;
  padding: 22px;
  transition: transform .28s ease, background .28s ease, box-shadow .28s ease;
  animation: rise .55s ease both;
}
.metric-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.86); box-shadow: 0 18px 35px rgba(48,59,53,.07); }
.metric-card.answered { background: rgba(248, 251, 248, .84); }
.metric-top { display: flex; gap: 13px; align-items: flex-start; min-height: 55px; }
.metric-icon, .habit-icon { flex: 0 0 auto; width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); }
.metric-card h3 { font-size: 15px; margin-bottom: 4px; letter-spacing: -.02em; }
.metric-card p { color: var(--muted); font-size: 11px; margin: 0; }
.level-control { display: flex; align-items: center; justify-content: space-between; position: relative; margin: 21px 3px 7px; }
.level-control::before { content: ""; position: absolute; left: 7px; right: 7px; height: 1px; background: var(--line); }
.level-dot { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 50%; background: #eceeea; color: transparent; cursor: pointer; position: relative; transition: .24s cubic-bezier(.2,.8,.2,1); }
.level-dot::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #cbd2cd; transition: .2s; }
.level-dot:hover { transform: scale(1.16); background: var(--green-soft); }
.level-dot.passed::after { background: #afc3b6; }
.level-dot.selected { transform: scale(1.16); background: var(--green); box-shadow: 0 5px 12px rgba(76,105,89,.25); }
.level-dot.selected::after { background: white; inset: 9px; }
.level-labels { display: flex; justify-content: space-between; color: #a1aaa5; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.habit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.habit-card { border: 1px solid rgba(255,255,255,.8); background: rgba(255,255,255,.56); border-radius: 24px; padding: 20px; text-align: left; min-height: 150px; display: flex; flex-direction: column; align-items: flex-start; cursor: pointer; transition: .3s cubic-bezier(.2,.8,.2,1); }
.habit-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.86); }
.habit-card.active { background: var(--green-dark); color: white; transform: translateY(-3px); box-shadow: 0 16px 35px rgba(55,83,69,.18); }
.habit-card.active .habit-icon { color: var(--green-dark); background: #edf2ee; }
.habit-copy { display: flex; flex-direction: column; margin-top: 18px; }
.habit-copy strong { font-family: "Manrope"; font-size: 14px; }
.habit-copy small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.habit-card.active small { color: rgba(255,255,255,.58); }
.habit-toggle { margin-top: auto; width: 30px; height: 17px; border-radius: 99px; background: #dfe3df; padding: 3px; transition: .25s; }
.habit-toggle span { display: block; width: 11px; height: 11px; border-radius: 50%; background: white; transition: transform .25s; }
.habit-card.active .habit-toggle { background: #9fb9a9; }
.habit-card.active .habit-toggle span { transform: translateX(13px); }
.note-card { border-radius: 30px; padding: 32px; }
.note-card textarea { width: 100%; min-height: 130px; resize: vertical; margin: 26px 0 13px; border: 0; outline: 0; background: rgba(243,245,241,.75); border-radius: 18px; padding: 18px; color: var(--ink); line-height: 1.6; transition: box-shadow .25s; }
.note-card textarea:focus { box-shadow: 0 0 0 2px rgba(105,136,119,.22); }
.note-card textarea::placeholder { color: #a8b0ab; }
.note-footer { display: flex; justify-content: space-between; align-items: center; }
.note-footer > span { color: var(--muted); font-size: 11px; }
.save-button { border: 0; background: var(--green-dark); color: white; border-radius: 999px; padding: 8px 9px 8px 18px; display: flex; gap: 16px; align-items: center; cursor: pointer; transition: .25s ease; }
.save-button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(55,83,69,.2); }
.save-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.15); }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 100px); opacity: 0; padding: 11px 18px 11px 12px; display: flex; gap: 10px; align-items: center; border-radius: 999px; background: var(--ink); color: white; font-size: 13px; box-shadow: var(--shadow); transition: .35s cubic-bezier(.2,.8,.2,1); }
.toast span:first-child { width: 23px; height: 23px; border-radius: 50%; background: var(--green); display: grid; place-items: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
dialog { width: min(460px, calc(100% - 30px)); border: 0; border-radius: 30px; padding: 35px; color: var(--ink); background: #f7f5ef; box-shadow: 0 30px 100px rgba(36,49,44,.2); }
dialog::backdrop { background: rgba(36,49,44,.28); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 18px; right: 18px; border: 0; background: #ebece7; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.dialog-sub { color: var(--muted); font-size: 13px; margin-top: 8px; }
.week-chart { height: 130px; display: flex; align-items: end; justify-content: space-around; gap: 12px; border-bottom: 1px solid var(--line); padding: 20px 10px 0; margin: 25px 0; }
.chart-day { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 8px; color: var(--muted); font-size: 10px; }
.chart-bar { width: 18px; min-height: 8px; border-radius: 99px 99px 4px 4px; background: var(--green); animation: grow .6s ease both; }
.insight-summary { display: flex; flex-direction: column; background: var(--green-soft); padding: 18px; border-radius: 18px; }
.insight-summary strong { font-family: "Manrope"; font-size: 21px; }
.insight-summary span { color: var(--muted); font-size: 12px; }
.play-dialog { width: min(600px, calc(100% - 30px)); text-align: center; padding: 38px; }
.play-progress { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; padding-right: 35px; }
.play-progress-track { flex: 1; height: 4px; border-radius: 99px; background: var(--green-soft); overflow: hidden; }
.play-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .35s ease; }
.play-question { padding: 48px 0 34px; }
.play-question-icon { width: 54px; height: 54px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 18px; background: var(--green-soft); color: var(--green-dark); font-size: 22px; }
.play-question h2 { font-size: 42px; margin-bottom: 9px; }
.play-question p:last-child { color: var(--muted); margin: 0; }
.play-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.play-level { border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 16px; padding: 15px 4px 12px; display: flex; flex-direction: column; gap: 4px; align-items: center; cursor: pointer; transition: .2s cubic-bezier(.2,.8,.2,1); }
.play-level strong { font-family: "Manrope"; font-size: 20px; }
.play-level span { color: var(--muted); font-size: 9px; }
.play-level:hover, .play-level.selected { background: var(--green-dark); color: white; transform: translateY(-3px); box-shadow: 0 8px 18px rgba(55,83,69,.16); }
.play-level:hover span, .play-level.selected span { color: rgba(255,255,255,.62); }
.play-level.just-selected { transform: scale(1.08); }
.keyboard-hint { color: var(--muted); font-size: 11px; margin: 22px 0 28px; }
kbd { min-width: 19px; display: inline-block; padding: 2px 5px; margin: 0 2px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: white; color: var(--ink); font-family: inherit; }
.play-footer { display: flex; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--line); }
.play-nav-button { border: 0; background: transparent; color: var(--green-dark); cursor: pointer; font-size: 12px; }
.play-nav-button:disabled { opacity: .3; cursor: default; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes grow { from { height: 0; } }
@media (max-width: 820px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav-tabs { display: none; }
  main { padding-top: 40px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 28px; }
  .metric-grid { grid-template-columns: 1fr; }
  .habit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  main { width: min(100% - 24px, 1120px); padding-bottom: 55px; }
  .topbar { padding: 0 14px; }
  .sync-pill { font-size: 0; }
  h1 { font-size: 50px; }
  .progress-card { grid-template-columns: auto 1fr; padding: 20px; margin-bottom: 65px; }
  .streak { display: none; }
  .section-heading { align-items: flex-start; }
  .section-heading > p { display: none; }
  .section-actions p { display: none; }
  .section-actions { align-self: flex-end; }
  .play-button span:last-child { display: none; }
  .play-button { padding: 7px; }
  .habit-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .habit-card { min-height: 145px; padding: 16px; }
  .note-card { padding: 22px; }
  .play-dialog { padding: 25px 18px; }
  .play-question { padding: 36px 0 25px; }
  .play-question h2 { font-size: 34px; }
  .play-levels { gap: 5px; }
  .play-level { padding: 13px 2px 10px; }
  .play-level span { font-size: 8px; }
}
